+++ /dev/null
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-\f
- 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.)
-\f
-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.
-\f
- 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.
-\f
- 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
+++ /dev/null
-What is Babel?
-==============
-
-:Contact: joel@scopserv.com
-
-.. contents:: Contents
-.. section-numbering::
-
-Babel is a web interface to viewing and editing PO (gettext) files for all
-modules written in PHP and utilizing the `Horde Application Framework`_.
-
-This software is OSI Certified Open Source Software. OSI Certified is a
-certification mark of the `Open Source Initiative`_.
-
-.. _`Horde Application Framework`: http://www.horde.org/horde/
-.. _`Open Source Initiative`: http://www.opensource.org/
-
-
-Obtaining Babel
----------------
-
-Further information on Babel and the latest version can be obtained at
-
- http://.../
-
-
-Documentation
--------------
-
-The following documentation is available in the Babel distribution:
-
-:README_: This file
-:COPYING_: Copyright and license information
-:`docs/BUGS`_: Known bugs
-:`docs/CHANGES`_: Changes by release
-:`docs/CREDITS`_: Project developers
-:`docs/INSTALL`_: Installation instructions and notes
-:`docs/TODO`_: Development TODO list
-
-
-Installation
-------------
-
-Instructions for installing Babel can be found in the file INSTALL_ in the
-``docs/`` directory of the Babel distribution.
-
-
-Assistance
-----------
-
-If you encounter problems with Babel, help is available!
-
-The Horde Frequently Asked Questions List (FAQ), available on the Web at
-
- http://www.horde.org/faq/
-
-The Horde Project runs a number of mailing lists, for individual applications
-and for issues relating to the project as a whole. Information, archives, and
-subscription information can be found at
-
- http://www.horde.org/mail/
-
-Lastly, Horde developers, contributors and users also make occasional
-appearances on IRC, on the channel #horde on the freenode Network
-(irc.freenode.net).
-
-
-Licensing
----------
-
-For licensing and copyright information, please see the file COPYING_ in the
-Babel distribution.
-
-Thanks,
-
-The Babel team
-
-
-.. _README: ?f=README.html
-.. _COPYING: http://www.horde.org/licenses/gpl.php
-.. _docs/BUGS: ?f=BUGS.html
-.. _docs/CHANGES: ?f=CHANGES.html
-.. _docs/CREDITS: ?f=CREDITS.html
-.. _INSTALL:
-.. _docs/INSTALL: ?f=INSTALL.html
-.. _docs/TODO: ?f=TODO.html
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-@define('BABEL_BASE', dirname(__FILE__)) ;
-require_once BABEL_BASE . '/lib/base.php';
-
-// Define if we use Horde CVS or Custom Commit
-$custom_commit = true;
-
-/* Render the page. */
-require BABEL_TEMPLATES . '/common-header.inc';
-echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-
-Translate_Display::header(_("Horde translation generator"));
-
-/* Do sanity check */
-Translate::sanity_check();
-
-/* Searching applications */
-Translate::check_binaries();
-
-Translate_Display::info(sprintf('Searching Horde applications in %s', realpath(HORDE_BASE)));
-$dirs = Translate::search_applications();
-
-$apps = Translate::strip_horde($dirs);
-$apps[0] = 'horde';
-Translate_Display::info(_("Found applications:"));
-Translate_Display::info(wordwrap(implode(', ', $apps)), false);
-Translate_Display::info();
-
-// Check if we must execute Custom commit or Horde CVS Commit (Developer)
-if ($custom_commit) {
- Translate_Display::header(_("Commit PO files ..."));
- foreach($dirs as $d => $dir) {
- $dir = realpath($dir);
- $po = $dir . '/po/' . $lang . '.po';
-
- if (@file_exists($po)) {
- Translate_Display::info(_("Commit") . " $po ($lang)");
- Babel::callHook('commit', array($po, $lang));
- }
-
- }
-} else {
- Translate::commit();
-}
-
-
-Translate_Display::info();
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-
-if (!function_exists('_babel_hook_commit')) {
- function _babel_hook_commit($info)
- {
- $po = $info[0];
- $lang = $info[1];
- $cmd = "svn commit $po -m \"- Update $lang translation.\"";
- Translate_Display::warning($cmd);
- }
-}
-
-if (!function_exists('_babel_hook_reset')) {
- function _babel_hook_reset($po)
- {
-
- $cmd = "rm -rf $po";
- exec("sudo $cmd");
-
- $cmd = "svn update $po";
- exec("sudo $cmd");
-
- if (!@file_exists($po)) {
- Translate_Display::warning(_("File doesn't exist ... ") . $po);
- Translate_Display::info();
- }
- }
-}
+++ /dev/null
-----------
-v0.1-dev
-----------
-
-[jvandal] ...
+++ /dev/null
-========================
- Babel Development Team
-========================
-
-Joel Vandal <joel@scopserv.com>
-
-Thanks to Michael Wallner <mike@php.net> for File_Gettext PEAR library.
-
-
-Localization
-============
-
-===================== ======================================================
-French Joel Vandal <joel@scopserv.com>
-===================== ======================================================
+++ /dev/null
-=============================
- Babel Development TODO List
-=============================
-
-:Contact: joel@scopsev.com
-
-- Add support for Obsolete strings.
-
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-$no_compress = true;
-
-$title = _("Download File");
-
-@define('BABEL_BASE', dirname(__FILE__));
-require_once BABEL_BASE . '/lib/base.php';
-
-$files = array();
-$dirs = Translate::search_applications();
-foreach($dirs as $d => $dir) {
- $dir = realpath($dir);
-
- $app = str_replace(realpath(HORDE_BASE), '', $dir);
- $app = str_replace('/', '', $app);
- if (empty($app)) {
- $app = 'horde';
- }
-
- $po = $dir . '/po/' . $lang . '.po';
- if (@file_exists($po)) {
- $files[$app] = $po;
- }
-}
-
-$filename = "po-" . $lang . ".zip";
-@system("rm -rf /tmp/$filename");
-@system("rm -rf /tmp/translate");
-@mkdir("/tmp/translate");
-foreach($files as $app => $file) {
- $cmd = "cp $file /tmp/translate/$app-" . basename($file);
- @system($cmd);
-}
-$cmd = "zip -j /tmp/$filename /tmp/translate/*";
-@exec($cmd);
-
-$data = file_get_contents("/tmp/$filename");
-
-$browser->downloadHeaders($filename);
-echo $data;
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-$meta_params = array(
- "Project-Id-Version" => @$_SESSION['babel']['language'],
- "Report-Msgid-Bugs-To" => "support@scopserv.com",
- "POT-Creation-Date" => "",
- "PO-Revision-Date" => "",
- "Last-Translator" => "",
- "Language-Team" => "",
- "MIME-Version" => "1.0",
- "Content-Type" => "text/plain; charset=utf-8",
- "Content-Transfer-Encoding" => "8bit",
- "Plural-Forms" => "nplurals=2; plural=(n > 1);");
-
-
-require_once dirname(__FILE__) . '/lib/base.php';
-require_once BABEL_BASE . '/lib/Gettext/PO.php';
-
-require_once 'Horde/Form.php';
-require_once 'Horde/Form/Renderer.php';
-require_once 'Horde/Form/Action.php';
-
-$app = Horde_Util::getFormData('module');
-
-$show = 'edit';
-$vars = &Horde_Variables::getDefaultVariables();
-
-if ($app) {
- $napp = ($app == 'horde') ? '' : $app;
- $pofile = HORDE_BASE . '/' . $napp . '/po/' . $_SESSION['babel']['language'] . '.po';
- $po = new File_Gettext_PO();
- $po->load($pofile);
-}
-
-/* Set up the template fields. */
-$template->set('menu', Babel::getMenu()->render());
-
-Horde::startBuffer();
-$notification->notify(array('listeners' => 'status')));
-$template->set('notify', Horde::endBuffer());
-
-/* Create upload form */
-$form = new Horde_Form($vars, _("Edit Translation"), $show);
-
-/* Validate form if submitted */
-if ($app && Horde_Util::getFormData('submitbutton') == _("Save")) {
-
- if ($form->validate($vars, false)) {
- $form->getInfo($vars, $form_values);
-
- foreach($meta_params as $k => $v) {
- if ($val = Horde_Util::getFormData($k)) {
- $po->meta[$k] = $val;
- }
- }
-
- $po->save($pofile);
-
- if (Horde_Util::getFormData('url') == 'view') {
- Horde::url('view.php')->add('module' => $app)->redirect();
- }
- }
-}
-
-if (!$app) {
- $form->setButtons(_("Edit"));
- $form->addVariable(_("Module"), 'module', 'enum', true, false, null, array(Babel::listApps(), true));
- $form->addVariable('', '', 'spacer', true);
-} else {
-
- $form->setButtons(_("Save"));
- $form->addHidden('', 'module', 'text', false);
- $vars->set('module', $app);
-
- $form->addHidden('', 'url', 'text', false);
- $vars->set('url', Horde_Util::getFormData('url'));
-
- foreach($meta_params as $k => $v) {
- $form->addVariable($k, $k, 'text', false, false);
- if (isset($po->meta[$k]) && !empty($po->meta[$k])) {
- $vars->set($k, $po->meta[$k]);
- } elseif (!empty($v)) {
- $vars->set($k, $v);
- }
- }
-}
-
-/* Render the page. */
-require BABEL_TEMPLATES . '/common-header.inc';
-
-echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-
-$renderer_params = array();
-$renderer = new Horde_Form_Renderer($renderer_params);
-$renderer->setAttrColumnWidth('20%');
-
-$form->renderActive($renderer, $vars, Horde::selfURL(), 'post');
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-set_time_limit(0);
-
-@define('BABEL_BASE', dirname(__FILE__)) ;
-require_once BABEL_BASE . '/lib/base.php';
-
-if ($app) {
- Babel::RB_init();
-}
-
-/* Render the page. */
-require BABEL_TEMPLATES . '/common-header.inc';
-
-if ($app) {
- Babel::RB_start(300);
-}
-
-echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-
-$vars = &Horde_Variables::getDefaultVariables();
-
-/* Create upload form */
-$form = new Horde_Form($vars, _("Extract Translation"), 'extract');
-
-if (!$app) {
- $form->setButtons(_("Extract"));
- $form->addVariable(_("Module"), 'module', 'enum', true, false, null, array(Babel::listApps(true), true));
- $form->addVariable('', '', 'spacer', true);
-
- $renderer_params = array();
- $renderer = new Horde_Form_Renderer($renderer_params);
- $renderer->setAttrColumnWidth('20%');
-
- $form->renderActive($renderer, $vars, Horde::selfURL(), 'post');
-} else {
- Translate_Display::header(_("Horde translation generator"));
-
- /* Sanity checks */
- if (!extension_loaded('gettext')) {
- Translate_Display::error(_("Gettext extension not found!"));
- footer();
- }
-
- Translate_Display::info(_("Loading libraries..."));
- $libs_found = true;
-
- foreach (array('Console_Getopt' => 'Console/Getopt.php',
- 'Console_Table' => 'Console/Table.php',
- 'File_Find' => 'File/Find.php')
- as $class => $file) {
- @include_once $file;
- if (class_exists($class)) {
- // Translate_Display::info("$class ...", false);
- } else {
- Translate_Display::error(sprintf(_("%s not found."), $class));
- $libs_found = false;
- }
- }
-
- if (!$libs_found) {
- Translate_Display::info();
- Translate_Display::info(_("Make sure that you have PEAR installed and in your include path."));
- Translate_Display::info('include_path: ' . ini_get('include_path'));
- }
- Translate_Display::info();
-
- /* Searching applications */
- Translate::check_binaries();
-
- Translate_Display::info(sprintf(_("Searching Horde applications in %s"), realpath(HORDE_BASE)));
- $dirs = Translate::search_applications();
-
- if ($app == 'ALL') {
- Translate_Display::info(_("Found directories:"), false);
- Translate_Display::info(implode("\n", $dirs), false);
- }
- Translate_Display::info();
-
- $apps = Translate::strip_horde($dirs);
- $apps[0] = 'horde';
- if ($app == 'ALL') {
- Translate_Display::info(_("Found applications:"));
- Translate_Display::info(wordwrap(implode(', ', $apps)), false);
- Translate_Display::info();
- }
-
- global $module;
- if ($app != 'ALL') {
- $module = $app;
- }
-
- Translate::init();
- Translate::cleanup();
-
- Translate_Display::header(_("Generate Compendium ..."));
- Translate::compendium();
- Translate_Display::info();
-
- Translate::xtract();
- Translate_Display::info();
- Translate::merge();
-
- Translate_Display::info();
- Translate_Display::header(_("Done!"));
-
- Babel::RB_close();
-}
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-@define('BABEL_BASE', dirname(__FILE__)) ;
-require_once BABEL_BASE . '/lib/base.php';
-
-/* Render the page. */
-require BABEL_TEMPLATES . '/common-header.inc';
-echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-
-require BABEL_TEMPLATES . '/index.php';
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Babel application API.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-class Babel_Application extends Horde_Registry_Application
-{
- public $version = 'H4 (0.1-git)';
-
- /**
- * Returns a list of available permissions.
- *
- * @return array An array describing all available permissions.
- */
- public function perms()
- {
- global $registry;
-
- $perms = array(
- 'language' => array(
- 'title' => _("Languages"),
- 'type' => 'none'
- ),
- 'module' => array(
- 'title' => _("Modules"),
- 'type' => 'none'
- )
- );
-
- foreach($registry->nlsconfig['languages'] as $langcode => $langdesc) {
- $perms['language:' . $langcode] = array(
- 'title' => sprintf("%s (%s)", $langdesc, $langcode),
- 'type' => 'boolean'
- );
- }
-
-
- foreach ($registry->applications as $app => $params) {
- if (in_array($params['status'], array('block', 'heading')) ||
- (isset($params['fileroot']) && !is_dir($params['fileroot'])) ||
- preg_match('/_[tools|reports]$/', $app)) {
- continue;
- }
-
- $perms['module:' . $app] = array(
- 'title' => sprintf("%s (%s)", $params['name'], $app),
- 'type' => 'boolean'
- );
- }
-
- $tabdesc = array(
- 'download' => _("Download"),
- 'upload' => _("Upload"),
- 'stats' => _("Statistics"),
- 'view' => _("View/Edit"),
- 'viewsource' => _("View Source"),
- 'extract' => _("Extract"),
- 'make' => _("Make"),
- 'commit' => _("Commit"),
- 'reset' => _("Reset")
- );
-
- foreach ($tabdesc as $cat => $desc) {
- $perms[$cat] = array(
- 'title' => $desc
- );
- }
-
- return $perms;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-class Babel {
-
- function callHook($fname, $info) {
- /* Check if an hooks file exist */
- if (file_exists(BABEL_BASE . '/config/hooks.php')) {
- include_once BABEL_BASE . '/config/hooks.php';
-
- $func = '_babel_hook_' . $fname;
-
- if (function_exists($func)) {
- $res = call_user_func($func, $info);
- } else {
- Translate_Display::warning(sprintf(_("Function doesn't exist: %s"), $func));
- }
- } else {
- Translate_Display::warning(_("Hook file doesn't exist"));
- }
- }
-
- function displayLanguage() {
- global $lang, $app;
-
- if (!isset(Horde_Nls::$config['languages'][$lang])) {
- return;
- }
-
- $res = sprintf(_("Language: %s (%s)"), Horde_Nls::$config['languages'][$lang], $lang);
- if ($app) {
- $res .= ' | ' . sprintf(_("Module: %s"), $app);
- }
-
- return $res;
- }
-
-
- function ModuleSelection() {
- $html = '';
- $html .= '<span style="float:right">';
- $html .= '<form action="' . Horde::selfUrl() . '" method="post" name="moduleSelector">';
- $html .= '<select name="module" onchange="moduleSubmit()">';
-
- $apps = array('ALL' => _("All Applications")) + Babel::listApps();
-
- foreach($apps as $app => $desc) {
- if (!Babel::hasPermission("module:$app")) {
- continue;
- }
-
- if (Horde_Util::getFormData('module') == $app) {
- $html .= '<option class="control" value="' . $app . '" selected>' . '+ ' . $desc;
- } else {
- $html .= '<option value="' . $app . '">' . '– ' . $desc;
- }
- }
-
- $html .= '</select>';
- $html .= '</form>';
- $html .= '</span>';
-
- $html .= '<script language="JavaScript" type="text/javascript">' . "\n";
- $html .= '<!--' . "\n";
- $html .= 'var loading;' . "\n";
- $html .= 'function moduleSubmit()' . "\n";
- $html .= '{' . "\n";
- $html .= 'document.moduleSelector.submit();' . "\n";
- $html .= 'return false;' . "\n";
- $html .= '}' . "\n";
- $html .= '// -->' . "\n";
- $html .= '</script>' . "\n";
- return $html;
- }
-
- function LanguageSelection() {
- global $app;
-
- $html = '';
- $html .= '<span style="float:right">';
- $html .= '<form action="' . Horde::selfUrl() . '" method="post" name="languageSelector">';
- $html .= ' ';
- $html .= '<input type="hidden" name="module" value="' . $app . '">';
- $html .= '<select name="display_language" onchange="languageSubmit()">';
-
- $tests = Horde_Nls::$config['languages'];
-
- // Unset English
- unset($tests['en_US']);
-
- foreach($tests as $dir => $desc) {
- if (!Babel::hasPermission("language:$dir")) {
- continue;
- }
-
- if (isset($_SESSION['babel']['language']) && $dir == $_SESSION['babel']['language']) {
- $html .= '<option class="control" value="' . $dir . '" selected>' . '+ ' . $desc;
- } else {
- $html .= '<option value="' . $dir . '">' . '– ' . $desc;
- }
- }
-
- $html .= '</select>';
- $html .= ' ';
- $html .= '</form>';
- $html .= '</span>';
-
- $html .= '<script language="JavaScript" type="text/javascript">' . "\n";
- $html .= '<!--' . "\n";
- $html .= 'var loading;' . "\n";
- $html .= 'function languageSubmit()' . "\n";
- $html .= '{' . "\n";
- $html .= 'document.languageSelector.submit();' . "\n";
- $html .= 'return false;' . "\n";
- $html .= '}' . "\n";
- $html .= '// -->' . "\n";
- $html .= '</script>' . "\n";
- return $html;
- }
-
- function listApps($all = false) {
- global $registry;
-
- $res = array();
-
- if ($all) {
- $res['ALL'] = _("All Applications");
- }
-
- foreach ($registry->applications as $app => $params) {
- if ($params['status'] == 'heading' || $params['status'] == 'block') {
- continue;
- }
-
- if (isset($params['fileroot']) && !is_dir($params['fileroot'])) {
- continue;
- }
-
- if (preg_match('/_reports$/', $app) || preg_match('/_tools$/', $app)) {
- continue;
- }
-
- if (Babel::hasPermission("module:$app")) {
- $res[$app] = sprintf("%s (%s)", $params['name'], $app);
- }
- }
- return $res;
- }
-
- /**
- * Returns the value of the specified permission for $userId.
- *
- * @return mixed Does user have $permission?
- */
- function hasPermission($permission, $filter = null, $perm = null)
- {
- $userId = $GLOBALS['registry']->getAuth();
- $admin = ($userId == 'admin') ? true : false;
- $perms = $GLOBALS['injector']->getInstance('Horde_Perms');
-
- if ($admin || !$perms->exists('babel:' . $permission)) {
- return true;
- }
-
- $allowed = $perms->getPermissions('babel:' . $permission);
-
- switch ($filter) {
- case 'tabs':
- if ($perm) {
- $allowed = $perms->hasPermission('babel:' . $permission, $GLOBALS['registry']->getAuth(), $perm);
- }
- break;
- }
- return $allowed;
- }
-
- /**
- * Get the module main Menu.
- **/
- function getMenu()
- {
- global $registry;
-
- $menu = new Horde_Menu();
-
- $menu->addArray(array('url' => Horde::url('index.php'),
- 'text' => _("_General"),
- 'icon' => 'list.png'));
-
- if (Babel::hasPermission('view')) {
- $menu->addArray(array('url' => Horde::url('view.php'),
- 'text' => _("_View"),
- 'icon' => 'view.png'));
- }
-
- if (Babel::hasPermission('stats')) {
- $menu->addArray(array('url' => Horde::url('stats.php'),
- 'text' => _("_Stats"),
- 'icon' => 'extract.png'));
- }
-
- if (Babel::hasPermission('extract')) {
- $menu->addArray(array('url' => Horde::url('extract.php'),
- 'text' => _("_Extract"),
- 'icon' => 'extract.png'));
- }
-
- if (Babel::hasPermission('make')) {
- $menu->addArray(array('url' => Horde::url('make.php'),
- 'text' => _("_Make"),
- 'icon' => 'make.png'));
- }
-
- if (Babel::hasPermission('upload')) {
- $menu->addArray(array('url' => Horde::url('upload.php'),
- 'text' => _("_Upload"),
- 'icon' => 'upload.png'));
- }
-
- return $menu;
- }
-
- /**
- * Send an Email.
- **/
- function sendEmail($email, $type = 'html', $attachments = array()) {
- global $client, $scopserv;
-
- include_once("Mail.php");
- include_once("Mail/mime.php");
-
- $headers["From"] = $email['from'];
- $headers["Subject"] = $email['subject'];
-
- $mime = new Mail_Mime();
- if ($type == 'html') {
- $mime->setHtmlBody($email['content']);
- } else {
- $mime->setTxtBody($email['content']);
- }
-
- if (!empty($attachments)) {
- foreach ($attachments as $info) {
- $mime->addAttachment($info['file'],
- $info['type'],
- $info['name'], false);
- }
- }
-
- $body = $mime->get();
- $hdrs = $mime->headers($headers);
-
- return $GLOBALS['injector']->getInstance('Horde_Mail')->send($email['to'], $hdrs, $body);
- }
-
-
- function RB_init() {
- Horde::addScriptFile('effects.js', 'horde');
- Horde::addScriptFile('redbox.js', 'horde');
- }
-
- function RB_start($secs = 30) {
-
- $msg = '';
- $msg .= '<table width=100% id="RB_confirm"><tr><td>';
- $msg .= '<b>' . _("Please be patient ...") . '</b>';
- $msg .= '<br />';
- $msg .= '<br />';
- if ($secs < 60) {
- $msg .= addslashes(sprintf(_("Can take up to %d seconds !"), $secs));
- } else {
- $min = intval($secs / 60);
- if ($min == 1) {
- $msg .= addslashes(_("Can take up to 1 minute !"));
- } else {
- $msg .= addslashes(sprintf(_("Can take up to %d minutes !"), $min));
- }
- }
-
- $msg .= '</td><td><img src="themes/graphics/redbox_spinner.gif">';
-
- $msg .= '</td></tr></table>';
- echo '<script>';
- echo 'RedBox.loading();';
- echo "RedBox.showHtml('$msg');";
- echo '</script>';
- flush();
- }
-
- function RB_close() {
- echo '<script>';
- echo 'RedBox.close();';
- echo '</script>';
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-class Translate_Display {
-
- function header($msg, $msg2 = '') {
- global $cnt_i, $registry;
- $select_img = Horde::img('alerts/message.png');
- print sprintf('<table cellspacing=0 cellpadding=0 width=100%%><tr><td class="header">%s</td><td align="right" class="header">%s</td><td class="header" width="20">%s</td></tr></table>', $msg, $msg2, $select_img);
- flush();
- }
-
- function warning($msg, $bold = true) {
- global $cnt_i, $registry;
- $item = ($cnt_i++ % 2);
- $select_img = Horde::img('alerts/warning.png');
- if ($bold) {
- print sprintf('<table cellspacing=0 cellpadding=0 width=100%%><tr><td class="item%d" style="color: #ff0000">%s</td><td class="item%1$d" width="20">%s</td></tr></table>', $item, $msg, $select_img);
- } else {
- print sprintf('<table cellspacing=0 cellpadding=0 width=100%%><tr><td class="item%d small" style="color: #ff0000">%s</td><td class="item%1$d" width="20">%s</td></tr></table>', $item, $msg, $select_img);
- }
- flush();
- }
-
- function error($msg) {
- global $cnt_i, $registry;
- $item = ($cnt_i++ % 2);
- $select_img = Horde::img('alerts/error.png');
- print sprintf('<table cellspacing=0 cellpadding=0 width=100%%><tr><td class="item%d" style="color: #ff0000"><b>%s</b></td><td class="item%1$d" width="20">%s</td></tr></table>', $item, $msg, $select_img);
- flush();
- }
-
- function info($msg = "", $bold = true) {
-
- global $cnt_i, $registry;
-
- if (empty($msg)) {
- echo "<br />";
- } else {
-
- $item = ($cnt_i++ % 2);
-
- $select_img = Horde::img('alerts/select.png');
- if ($bold) {
- print sprintf('<table cellspacing=0 cellpadding=0 width=100%%><tr><td class="item%d"><b>%s</b></td><td class="item%1$d" width="20">%s</td></tr></table>', $item, $msg, $select_img);
- } else {
- print sprintf('<table cellspacing=0 cellpadding=0 width=100%%><tr><td class="item%d small">%s</td><td class="item%1$d" width="20">%s</td></tr></table>', $item, $msg, '');
- }
- flush();
- }
- }
-
- function parseCharset($headers)
- {
- if (preg_match('/charset=(.*)/i', $headers, $m)) {
- return $m[1];
- }
- return $GLOBALS['registry']->getCharset();
- }
-
- function convert_string($msg) {
- global $po;
-
- $f = array('/</', '/>/');
- $t = array('<', '>');
- $msg = preg_replace($f, $t, $msg);
- return Horde_String::convertCharset(html_entity_decode($msg), $GLOBALS['registry']->getCharset(), Translate_Display::parseCharset($po->meta['Content-Type']));
- }
-
- function display_string($msg) {
- global $po;
-
- $f = array('/</', '/>/');
- $t = array('<', '>');
- $msg = preg_replace($f, $t, $msg);
- return Horde_String::convertCharset($msg, Translate_Display::parseCharset($po->meta['Content-Type']), $GLOBALS['registry']->getCharset());
- }
-
- function get_percent($used, $total) {
- if ($total > 0) {
- $percent = sprintf("%2.2f", (($used * 100) / $total));
- } else {
- $percent = 0;
- }
-
- return $percent;
- }
-
- function create_bargraph ($used, $total, $text = true, $reverse = false, $small = false) {
- if ($total > 0) {
- $percent = round(($used * 100) / $total);
- } else {
- $percent = 0;
- }
-
- $html = '<table border="0" cellpadding="0" cellspacing="0"><tr><td nowrap="nowrap">';
- $html .= '<table border="0" width="100" cellpadding="0" cellspacing="0">';
- $html .= '<tr height="10">';
-
- if ($percent > 0) {
- $html .= '<td nowrap="nowrap" width="' . ($percent) . '" bgcolor="#00FF00"></td>';
- }
-
- if ($percent != 100) {
- $html .= '<td nowrap="nowrap" width="' . (100 - $percent) . '" ';
- if ($reverse) {
- $html .= ' bgcolor="#FFFFFF"></td>';
- } else {
- $html .= ' bgcolor="#006699"></td>';
- }
- }
-
- $html .= '</tr></table></td>';
-
- if ($text) {
- if ($small) {
- $html .= '<td class="small"> ' . $percent .'% </td>';
- } else {
- $html .= '<td> ' . $percent .'% </td>';
- }
- }
-
- $html .= '</tr></table>';
-
- return $html;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-class Translate {
-
- function getPath($app) {
- if ($app == 'horde') {
- $app = '';
- }
- return realpath(HORDE_BASE . '/' . $app . '/po/');
- }
-
- function stats($app, $filter_lang = false) {
- global $module, $apps, $dirs, $lang;
-
- $report = array();
- $dir = Translate::getPath($app);
-
- $i = 0;
- $handle = opendir($dir);
- while ($file = readdir($handle)) {
- if (preg_match('/(.*)\.po$/', $file, $matches)) {
- $locale = $matches[1];
- if ($filter_lang && $locale != $filter_lang) {
- continue;
- }
-
- if (!isset(Horde_Nls::$config['languages'][$locale]) || $locale == 'en_US') {
- continue;
- }
- $i++;
-
- $pofile = $dir . "/$file";
-
- $tmppo = new File_Gettext_PO();
- $tmppo->load($pofile);
- $fuzzy = 0;
- $untranslated = 0;
- $translated = 0;
- $obsolete = 0;
-
- foreach($tmppo->status as $msgid => $status) {
- if (in_array('untranslated', $status)) {
- $untranslated++;
- } elseif (in_array('fuzzy', $status)) {
- $fuzzy++;
- } elseif (in_array('obsolete', $status)) {
- $obsolete++;
- } else {
- $translated++;
- }
- }
-
- $all = $translated + $fuzzy + $untranslated;
- $percent_done = round($translated / $all * 100, 2);
- $report[$locale] = array($all, $percent_done, $translated, $fuzzy, $untranslated, $obsolete);
- }
- }
- uasort ($report, 'my_usort_function');
-
- return $report;
- }
-
- function sanity_check()
- {
-
- /* Sanity checks */
- if (!extension_loaded('gettext')) {
- Translate_Display::error(_("Gettext extension not found!"));
- }
-
- Translate_Display::info(_("Loading libraries..."));
- $libs_found = true;
-
- foreach (array('Console_Getopt' => 'Console/Getopt.php',
- 'Console_Table' => 'Console/Table.php',
- 'File_Find' => 'File/Find.php')
- as $class => $file) {
- @include_once $file;
- if (class_exists($class)) {
- // Translate_Display::info("$class ...", false);
- } else {
- Translate_Display::error(sprintf(_("%s not found."), $class));
- $libs_found = false;
- }
- }
-
- if (!$libs_found) {
- Translate_Display::info();
- Translate_Display::info(_("Make sure that you have PEAR installed and in your include path."));
- Translate_Display::info('include_path: ' . ini_get('include_path'));
- }
- }
-
- function check_binaries()
- {
- global $gettext_version, $c;
-
- Translate_Display::info(_("Searching gettext binaries..."));
- require_once 'System.php';
- foreach (array('gettext', 'msgattrib', 'msgcat', 'msgcomm', 'msgfmt', 'msginit', 'msgmerge', 'xgettext') as $binary) {
- $GLOBALS[$binary] = System::which($binary);
- if ($GLOBALS[$binary]) {
- // Translate_Display::info("$binary ... found: " . $GLOBALS[$binary], false);
- } else {
- Translate_Display::error(sprintf(_("%s not found."), $binary));
- }
- }
-
- $out = '';
- exec($GLOBALS['gettext'] . ' --version', $out, $ret);
- $split = explode(' ', $out[0]);
- // Translate_Display::info('gettext version: ' . $split[count($split) - 1]);
- $gettext_version = explode('.', $split[count($split) - 1]);
- if ($gettext_version[0] == 0 && $gettext_version[1] < 12) {
- $GLOBALS['php_support'] = false;
- Translate_Display::info();
- Translate_Display::warning(_("Warning: Your gettext version is too old and does not support PHP natively."));
- Translate_Display::warning(_("Not all strings will be extracted."), false);
- } else {
- $GLOBALS['php_support'] = true;
- }
- Translate_Display::info();
- }
-
- function search_file($file, $dir = '.', $local = false)
- {
- static $ff;
- if (!isset($ff)) {
- $ff = new File_Find();
- }
-
- if (substr($file, 0, 1) != '/') {
- $file = "/$file/";
- }
-
- if ($local) {
- $files = $ff->glob($file, $dir, 'perl');
- $files = array_map(create_function('$file', 'return "' . $dir . '/' . '" . $file;'), $files);
- return $files;
- } else {
- return $ff->search($file, $dir, 'perl');
- }
- }
-
- function search_ext($ext, $dir = '.', $local = false)
- {
- return Translate::search_file(".+\\.$ext\$", $dir, $local);
- }
-
- function get_po_files($dir)
- {
- $langs = Translate::search_ext('po', $dir);
- if (($key = array_search($dir . '/' . 'messages.po', $langs)) !== false) {
- unset($langs[$key]);
- }
- if (($key = array_search($dir . '/' . 'compendium.po', $langs)) !== false) {
- unset($langs[$key]);
- }
- return $langs;
- }
-
- function get_languages($dir)
- {
- chdir($dir);
- $langs = get_po_files('po');
- $langs = array_map(create_function('$lang', 'return str_replace("po" . '/', "", str_replace(".po", "", $lang));'), $langs);
- return $langs;
- }
-
- function search_applications()
- {
- $dirs = array();
- $horde = false;
- if (@is_dir(HORDE_BASE . '/' . 'po')) {
- $dirs[] = HORDE_BASE;
- $horde = true;
- }
- $dh = @opendir(HORDE_BASE);
- if ($dh) {
- while ($entry = @readdir($dh)) {
- $dir = HORDE_BASE . '/' . $entry;
- if (is_dir($dir) &&
- substr($entry, 0, 1) != '.' &&
- fileinode(HORDE_BASE) != fileinode($dir)) {
- $sub = opendir($dir);
- if ($sub) {
- while ($subentry = readdir($sub)) {
- if ($subentry == 'po' && is_dir($dir . '/' . $subentry)) {
- $dirs[] = $dir;
- if ($entry == 'horde') {
- $horde = true;
- }
- break;
- }
- }
- }
- }
- }
- if (!$horde) {
- array_unshift($dirs, HORDE_BASE);
- }
- }
-
- return $dirs;
- }
-
- function strip_horde($file)
- {
- if (is_array($file)) {
- return array_map(create_function('$file', 'return Translate::strip_horde($file);'), $file);
- } else {
- return str_replace(HORDE_BASE . '/', '', $file);
- }
- }
-
- function commit($help_only = false)
- {
- global $apps, $dirs, $lang, $module;
-
- $docs = false;
- $files = array();
- for ($i = 0; $i < count($dirs); $i++) {
- if (!empty($module) && $module != $apps[$i]) continue;
- if ($apps[$i] == 'horde') {
- $dirs[] = $dirs[$i] . '/' . 'admin';
- $apps[] = 'horde/admin';
- if (!empty($module)) {
- $module = 'horde/admin';
- }
- }
- if (empty($lang)) {
- if ($help_only) {
- $files = array_merge($files, Translate::strip_horde(Translate::search_ext('xml', $dirs[$i] . '/' . 'locale')));
- } else {
- $files = array_merge($files, Translate::strip_horde(Translate::get_po_files($dirs[$i] . '/' . 'po')));
- $files = array_merge($files, Translate::strip_horde(Translate::search_file('^[a-z]{2}_[A-Z]{2}', $dirs[$i] . '/' . 'locale', true)));
- }
- } else {
- if ($help_only) {
- if (!@file_exists($dirs[$i] . '/' . 'locale' . '/' . $lang . '/' . 'help.xml')) continue;
- } else {
- if (!@file_exists($dirs[$i] . '/po/' . $lang . '.po')) continue;
- $files[] = Translate::strip_horde($dirs[$i] . '/' . 'po' . '/' . $lang . '.po');
- }
- $files[] = Translate::strip_horde($dirs[$i] . '/' . 'locale' . '/' . $lang);
- }
- if ($docs && !$help_only && $apps[$i]) {
- $files[] = Translate::strip_horde($dirs[$i] . '/' . 'docs');
- if ($apps[$i] == 'horde') {
- $horde_conf = $dirs[array_search('horde', $dirs)] . '/' . 'config' . '/';
- $files[] = Translate::strip_horde($horde_conf . 'nls.php.dist');
- }
- }
- }
- chdir(HORDE_BASE);
- if (count($files)) {
- if ($docs) {
- Translate_Display::info(_("Adding new files to repository:"));
- $sh = 'cvs add';
- foreach ($files as $file) {
- if (strstr($file, 'locale') || strstr($file, '.po')) {
- $sh .= " $file";
- Translate_Display::info($file, false);
- }
- }
- $sh .= '; cvs add';
- foreach ($files as $file) {
- if (strstr($file, 'locale')) {
- if ($help_only) {
- $sh .= ' ' . $file . '/' . '*.xml';
- Translate_Display::info($file . '/' . '*.xml', false);
- } else {
- $sh .= ' ' . $file . '/' . '*.xml ' . $file . '/' . 'LC_MESSAGES';
- Translate_Display::info($file . '/' . "*.xml\n$file" . '/' . 'LC_MESSAGES', false);
- }
- }
- }
- if (!$help_only) {
- $sh .= '; cvs add';
- foreach ($files as $file) {
- if (strstr($file, 'locale')) {
- $add = $file . '/' . 'LC_MESSAGES' . '/' . '*.mo';
- $sh .= ' ' . $add;
- Translate_Display::info($add, false);
- }
- }
- }
- Translate_Display::info();
- system($sh);
- Translate_Display::info();
- }
- Translate_Display::header(_("Committing:"));
- Translate_Display::info(implode(' ', $files), false);
- if (!empty($lang)) {
- $lang = ' ' . $lang;
- }
- if (empty($msg)) {
- if ($docs) {
- $msg = "Add $lang translation.";
- } elseif ($help_only) {
- $msg = "Update $lang help file.";
- } else {
- $msg = "Update $lang translation.";
- }
- }
- $sh = 'cvs commit -m "' . $msg . '" ' . implode(' ', $files);
- system($sh);
- }
- }
-
- function xtract()
- {
- global $module, $apps, $dirs, $gettext_version;
-
- require_once 'Horde/Array.php';
- if ($GLOBALS['php_support']) {
- $language = 'PHP';
- } else {
- $language = 'C++';
- }
- for ($i = 0; $i < count($dirs); $i++) {
- if (!empty($module) && $module != $apps[$i]) {
- continue;
- }
- Translate_Display::header(sprintf(_("Extracting from %s... "), $apps[$i]));
- chdir($dirs[$i]);
- if ($apps[$i] == 'horde') {
- $files = Translate::search_ext('php', '.', true);
- foreach (array('admin', 'framework', 'lib', 'services', 'templates', 'util', 'config' . '/' . 'themes') as $search_dir) {
- $files = array_merge($files, Translate::search_ext('(php|inc|js)', $search_dir));
- }
- $files = array_merge($files, Translate::search_ext('(php|dist)', 'config'));
- $sh = $GLOBALS['xgettext'] . ' --language=' . $language .
- ' --from-code=iso-8859-1 --keyword=_ --sort-output --copyright-holder="Horde Project"';
- if ($gettext_version[0] > 0 || $gettext_version[1] > 11) {
- $sh .= ' --msgid-bugs-address="dev@lists.horde.org"';
- }
- $file = $dirs[$i] . '/' . 'po' . '/' . $apps[$i] . '.pot';
- if (file_exists($file) && !is_writable($file)) {
- Translate_Display::error(sprintf(_('%s is not writable.', $file)));
- }
- $tmp_file = $file . '.tmp.pot';
- $sh .= ' -o ' . $tmp_file . ' ' . implode(' ', $files);
- if (@file_exists($dirs[$i] . '/po/translation.php')) {
- $sh .= ' po/translation.php';
- }
- exec($sh);
- } else {
- $files = Translate::search_ext('(php|inc|js)');
- $files = array_filter($files, create_function('$file', 'return substr($file, 0, 9) != "./config/";'));
- $files = array_merge($files, Translate::search_ext('(php|dist)', 'config'));
- $sh = $GLOBALS['xgettext'] . ' --language=' . $language .
- ' --keyword=_ --sort-output --force-po --copyright-holder="Horde Project"';
- if ($gettext_version[0] > 0 || $gettext_version[1] > 11) {
- $sh .= ' --msgid-bugs-address="support@scopserv.com"';
- }
- $file = 'po' . '/' . $apps[$i] . '.pot';
- if (file_exists($file) && !is_writable($file)) {
- Translate_Display::error((sprintf(_("%s is not writable."), $file)));
- }
- $tmp_file = $file . '.tmp.pot';
- $sh .= ' -o ' . $tmp_file . ' ' . implode(' ', $files);
- exec($sh);
- }
-
- if (file_exists($tmp_file)) {
- $files = Translate::search_ext('html', 'templates');
- $tmp = fopen($file . '.templates', 'w');
- foreach ($files as $template) {
- $fp = fopen($template, 'r');
- $lineno = 0;
- while (($line = fgets($fp, 4096)) !== false) {
- $lineno++;
- $offset = 0;
- while (($left = strpos($line, '<gettext>', $offset)) !== false) {
- $left += 9;
- $buffer = '';
- $linespan = 0;
- while (($end = strpos($line, '</gettext>', $left)) === false) {
- $buffer .= substr($line, $left);
- $left = 0;
- $line = fgets($fp, 4096);
- $linespan++;
- if ($line === false) {
- Translate_Display::error((sprintf(_("<gettext> tag not closed in file %s.\nOpening tag found in line %d."), $template, $lineno)));
- break 2;
- }
- }
- $buffer .= substr($line, $left, $end - $left);
- fwrite($tmp, "#: $template:$lineno\n");
- fwrite($tmp, 'msgid "' . str_replace(array('"', "\n"), array('\"', "\\n\"\n\""), $buffer) . "\"\n");
- fwrite($tmp, 'msgstr ""' . "\n\n");
-
- $offset = $end + 10;
- }
- }
- fclose($fp);
- }
- fclose($tmp);
- $sh = $GLOBALS['msgcomm'] . " --more-than=0 --sort-output \"$tmp_file\" \"$file.templates\" --output-file \"$tmp_file\"";
- exec($sh);
- unlink($file . '.templates');
-
- if (file_exists($file)) {
- $diff = array_diff(file($tmp_file), file($file));
- $diff = preg_grep('/^"POT-Creation-Date:/', $diff, PREG_GREP_INVERT);
- }
- }
-
- if (!file_exists($file) || count($diff)) {
- @unlink($file);
- rename($tmp_file, $file);
- Translate_Display::info(_("Updated!"));
- } else {
- @unlink($tmp_file);
- Translate_Display::info(_("Not changed!"));
- }
- }
- }
-
- function merge()
- {
- global $apps, $dirs, $lang, $module;
-
- $compendium = ' --compendium="' . HORDE_BASE . '/' . 'po' . '/' . 'compendium.po"';
- // $compendium = ' --compendium=' . $option[1];
- // $compendium = '';
-
- if (!isset($lang) && !empty($compendium)) {
- Translate_Display::error(_("Error: No locale specified."));
- Translate_Display::info();
- usage();
- }
-
- Translate::cleanup();
-
- for ($i = 0; $i < count($dirs); $i++) {
- if (!empty($module) && $module != $apps[$i]) {
- continue;
- }
- Translate_Display::header(sprintf(_("Merging translation for module %s..."), $apps[$i]));
- $dir = $dirs[$i] . '/' . 'po' . '/';
- if (empty($lang)) {
- $langs = get_languages($dirs[$i]);
- } else {
- if (!@file_exists($dir . $lang . '.po')) {
- Translate_Display::info(_("Skipped..."));
- Translate_Display::info();
- continue;
- }
- $langs = array($lang);
- }
- foreach ($langs as $locale) {
- Translate_Display::info(sprintf(_("Merging locale %s..."), $locale));
- $sh = $GLOBALS['msgmerge'] . ' --update -v' . $compendium . ' "' . $dir . $locale . '.po" "' . $dir . $apps[$i] . '.pot"';
- exec($sh);
- Translate_Display::info(_("Done!"));
- }
- }
- }
-
- function compendium()
- {
- global $dirs, $lang, $module;
-
- $dir = HORDE_BASE . '/' . 'po' . '/';
- $add = '';
- if (!isset($lang)) {
- Translate_Display::error(_("Error: No locale specified."));
- Translate_Display::info();
- usage();
- }
- Translate_Display::info(sprintf(_("Merging all %s.po files to the compendium... "), $lang));
- $pofiles = array();
- for ($i = 0; $i < count($dirs); $i++) {
- $pofile = $dirs[$i] . '/' . 'po' . '/' . $lang . '.po';
- if (file_exists($pofile)) {
- $pofiles[] = $pofile;
- }
- }
- if (!empty($dir) && substr($dir, -1) != '/') {
- $dir .= '/';
- }
- $sh = $GLOBALS['msgcat'] . ' --sort-output ' . implode(' ', $pofiles) . $add . ' > ' . $dir . 'compendium.po ';
- exec($sh, $out, $ret);
-
- if ($ret == 0) {
- Translate_Display::info(_("Done!"));
- } else {
- Translate_Display::error(_("Failed!"));
- }
- }
-
- function init()
- {
- global $module, $apps, $dirs, $lang, $module;
-
- if (empty($lang)) { $lang = getenv('LANG'); }
- for ($i = 0; $i < count($dirs); $i++) {
- if (@file_exists($dirs[$i] . '/po/' . $lang . '.po')) {
- continue;
- }
- if (!empty($module) && $module != $apps[$i]) { continue; }
- $package = ucfirst($apps[$i]);
- $package_u = Horde_String::upper($apps[$i]);
- @include $dirs[$i] . '/lib/version.php';
- $version = eval('return(defined("' . $package_u . '_VERSION") ? ' . $package_u . '_VERSION : "???");');
- Translate_Display::header(sprintf(_("Initializing module %s..."), $apps[$i]));
- if (!@file_exists($dirs[$i] . '/po/' . $apps[$i] . '.pot')) {
- Translate_Display::error(_("Failed!"));
- Translate_Display::info(sprintf(_("%s not found. Run 'Extract' first."), $dirs[$i] . '/' . 'po' . '/' . $apps[$i] . '.pot'));
- continue;
- }
- $dir = $dirs[$i] . '/' . 'po' . '/';
- $sh = $GLOBALS['msginit'] . ' --no-translator -i ' . $dir . $apps[$i] . '.pot ' .
- (!empty($lang) ? ' -o ' . $dir . $lang . '.po --locale=' . $lang : '');
-
- if (!empty($lang) && !OS_WINDOWS) {
- $pofile = $dirs[$i] . '/po/' . $lang . '.po';
- $sh .= "; sed 's/PACKAGE package/$package package/' $pofile " .
- "| sed 's/PACKAGE VERSION/$package $version/' " .
- "| sed 's/messages for PACKAGE/messages for $package/' " .
- "| sed 's/Language-Team: none/Language-Team: i18n@lists.horde.org/' " .
- "> $pofile.tmp";
- }
- exec($sh, $out, $ret);
- rename($pofile . '.tmp', $pofile);
- if ($ret == 0) {
- Translate_Display::info(_("Done!"));
- } else {
- Translate_Display::error(_("Failed!"));
- }
- Translate_Display::info();
- }
- }
-
- function make()
- {
- global $apps, $dirs, $lang, $module;
-
- $compendium = HORDE_BASE . '/' . 'po' . '/' . 'compendium.po';
- $save_stats = true;
-
- $horde = array_search('horde', $dirs);
- $horde_msg = array();
- $stats_array = array();
-
- for ($i = 0; $i < count($dirs); $i++) {
- if (!empty($module) && $module != $apps[$i]) continue;
- Translate_Display::header(sprintf(_("Building MO files for module %s..."), $apps[$i]));
- if (empty($lang)) {
- $langs = get_languages($dirs[$i]);
- } else {
- if (!@file_exists($dirs[$i] . '/' . 'po' . '/' . $lang . '.po')) {
- Translate_Display::info(_("Skipped..."));
- Translate_Display::info();
- continue;
- }
- $langs = array($lang);
- }
- foreach ($langs as $locale) {
- Translate_Display::info(sprintf(_("Building locale %s..."), $locale));
- $dir = $dirs[$i] . '/' . 'locale' . '/' . $locale . '/' . 'LC_MESSAGES';
- if (!is_dir($dir)) {
- require_once 'System.php';
- if (!@System::mkdir("-p $dir")) {
- Translate_Display::error(sprintf(_("Warning: Could not create locale directory for locale %s:"), $locale));
- Translate_Display::info($dir, false);
- Translate_Display::info();
- continue;
- }
- }
-
- /* Convert to unix linebreaks. */
- $pofile = $dirs[$i] . '/' . 'po' . '/' . $locale . '.po';
- $fp = fopen($pofile, 'r');
- $content = fread($fp, filesize($pofile));
- fclose($fp);
-
- $content = str_replace("\r", '', $content);
- $fp = fopen($pofile, 'wb');
- fwrite($fp, $content);
- fclose($fp);
-
- /* Check PO file sanity. */
- $sh = $GLOBALS['msgfmt'] . " --check \"$pofile\" 2>&1";
- exec($sh, $out, $ret);
- if ($ret != 0) {
- Translate_Display::error(_("Warning: an error has occured:"));
- Translate_Display::info(implode("\n", $out));
- Translate_Display::info();
- if ($apps[$i] == 'horde') {
- continue 2;
- }
- continue;
- }
-
- /* Compile MO file. */
- $sh = $GLOBALS['msgfmt'] . ' --statistics -o "' . $dir . '/' . $apps[$i] . '.mo"';
- if ($apps[$i] != 'horde') {
- $horde_po = $dirs[$horde] . '/' . 'po' . '/' . $locale . '.po';
- if (!@is_readable($horde_po)) {
- Translate_Display::error(sprintf(_("Warning: the Horde PO file for the locale %s does not exist:"), $locale));
- Translate_Display::info($horde_po);
- Translate_Display::info();
- $sh .= $dirs[$i] . '/' . 'po' . '/' . $locale . '.po';
- } else {
- $sh = "export LANG=C ; " . $GLOBALS['msgcomm'] . " --more-than=0 --sort-output \"$pofile\" \"$horde_po\" | $sh -";
- }
- } else {
- $sh .= $pofile;
- }
- $sh .= ' 2>&1';
- $out = '';
-
- exec($sh, $out, $ret);
-
- if ($ret == 0) {
- Translate_Display::info(_("Done!"));
- $messages = array(0, 0, 0);
- if (preg_match('/(\d+) translated/', $out[0], $match)) {
- $messages[0] = $match[1];
- if (isset($horde_msg[$locale])) {
- $messages[0] -= $horde_msg[$locale][0];
- if ($messages[0] < 0) $messages[0] = 0;
- }
- }
- if (preg_match('/(\d+) fuzzy/', $out[0], $match)) {
- $messages[1] = $match[1];
- if (isset($horde_msg[$locale])) {
- $messages[1] -= $horde_msg[$locale][1];
- if ($messages[1] < 0) $messages[1] = 0;
- }
- }
- if (preg_match('/(\d+) untranslated/', $out[0], $match)) {
- $messages[2] = $match[1];
- if (isset($horde_msg[$locale])) {
- $messages[2] -= $horde_msg[$locale][2];
- if ($messages[2] < 0) $messages[2] = 0;
- }
- }
- if ($apps[$i] == 'horde') {
- $horde_msg[$locale] = $messages;
- }
- $stats_array[$apps[$i]][$locale] = $messages;
- } else {
- Translate_Display::error(_("Failed!"));
- exec($sh, $out, $ret);
- Translate_Display::info(implode("\n", $out));
- }
- if (count($langs) > 1) {
- continue;
- }
-
- /* Merge translation into compendium. */
- if (!empty($compendium)) {
- Translate_Display::header(sprintf(_("Merging the PO file for %s to the compendium..."), $apps[$i]));
- if (!empty($dir) && substr($dir, -1) != '/') {
- $dir .= '/';
- }
- $sh = $GLOBALS['msgcat'] . " --sort-output \"$compendium\" \"$pofile\" > \"$compendium.tmp\"";
- $out = '';
- exec($sh, $out, $ret);
- @unlink($compendium);
- rename($compendium . '.tmp', $compendium);
- if ($ret == 0) {
- Translate_Display::info(_("Done!"));
- } else {
- Translate_Display::error(_("Failed!"));
- }
- }
- Translate_Display::info();
- }
- }
- if (empty($module)) {
- Translate_Display::header(_("Results:"));
- } else {
- Translate_Display::header(_("Results (including Horde):"));
- }
-
- echo '<br />';
- echo '<table cellspacing=0 cellpadding=0 width=90%>';
- echo sprintf('<tr><td class="control" width="15%%"><b>%s</b></td><td class="control"><b>%s</b></td><td align="right" width="5%%" class="control"><b>%s</b></td><td align="right" width="5%%" class="control"><b>%s</b></td><td align="right" width="5%%" class="control"><b>%s</b></td></tr>', 'Module', 'Language', 'Translated', 'Fuzzy', 'Untranslated');
-
- $i = 0;
- foreach($stats_array as $app => $info) {
- foreach($info as $locale => $message) {
- echo sprintf('<tr class="item%d"><td>%s</td><td>%s</td><td align="right" >%s</td><td align="right" >%s</td><td align="right" >%s</td></tr>',
- ($i++ %2), $app, $locale, $messages[0], $messages[1], $messages[2]);
- }
- }
- echo '</table>';
-
- if ($save_stats) {
- $fp = @fopen('/tmp/translation_stats.txt', 'w');
- if ($fp) {
- fwrite($fp, serialize($stats_array));
- fclose($fp);
- }
- }
- }
-
- function cleanup($keep_untranslated = false)
- {
- global $apps, $dirs, $lang, $module;
-
- for ($i = 0; $i < count($dirs); $i++) {
- if (!empty($module) && $module != $apps[$i]) { continue; }
- Translate_Display::header(sprintf(_("Cleaning up PO files for module %s..."), $apps[$i]));
- if (empty($lang)) {
- $langs = get_languages($dirs[$i]);
- } else {
- if (!@file_exists($dirs[$i] . '/' . 'po' . '/' . $lang . '.po')) {
- Translate_Display::info(_("Skipped..."));
- Translate_Display::info();
- continue;
- }
- $langs = array($lang);
- }
- foreach ($langs as $locale) {
- Translate_Display::info(sprintf(_("Cleaning up locale %s..."), $locale));
- $pofile = $dirs[$i] . '/' . 'po' . '/' . $locale . '.po';
- $sh = $GLOBALS['msgattrib'] . ($keep_untranslated ? '' : ' --translated') . " --no-obsolete --no-fuzzy --force-po $pofile > $pofile.tmp";
- $out = '';
- exec($sh, $out, $ret);
- if ($ret == 0) {
- @unlink($pofile);
- rename($pofile . '.tmp', $pofile);
- Translate_Display::info(_("Done!"));
- } else {
- @unlink($pofile . '.tmp', $pofile);
- Translate_Display::error(_("Failed!"));
- }
- Translate_Display::info();
- }
- }
- }
-}
-
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-class Translate_Help {
- function update_help()
- {
- global $dirs, $apps, $last_error_msg, $lang, $module;
-
- $files = array();
- for ($i = 0; $i < count($dirs); $i++) {
- if (!empty($module) && $module != $apps[$i]) { continue; }
- if (!is_dir("$dirs[$i]/locale")) continue;
- if ($apps[$i] == 'horde') {
- $dirs[] = $dirs[$i] . '/' . 'admin';
- $apps[] = 'horde/admin';
- if (!empty($module)) {
- $module = 'horde/admin';
- }
- }
- if (empty($lang)) {
- $files = search_file('help.xml', $dirs[$i] . '/' . 'locale');
- } else {
- $files = array($dirs[$i] . '/' . 'locale' . '/' . $lang . '/' . 'help.xml');
- }
- $file_en = $dirs[$i] . '/' . 'locale' . '/' . 'en' . '/' . 'help.xml';
- if (!@file_exists($file_en)) {
- Translate_Display::info(sprintf(_("Warning: There doesn't yet exist a help file for %s."), $apps[$i]));
- Translate_Display::info();
- continue;
- }
- foreach ($files as $file_loc) {
- $locale = substr($file_loc, 0, strrpos($file_loc, '/'));
- $locale = substr($locale, strrpos($locale, '/') + 1);
- if ($locale == 'en') continue;
- if (!@file_exists($file_loc)) {
- Translate_Display::info(sprintf(_("Warning: The %s help file for %s doesn't yet exist. Creating a new one."), $locale, $apps[$i]));
- $dir_loc = substr($file_loc, 0, -9);
- if (!is_dir($dir_loc)) {
- require_once 'System.php';
- if (!@System::mkdir("-p $dir_loc")) {
- Translate_Display::error(sprintf(_("Warning: Could not create locale directory for locale %s:"), $locale));
- Translate_Display::info($dir_loc, false);
- Translate_Display::info();
- continue;
- }
- }
-
- if (!@copy($file_en, $file_loc)) {
- Translate_Display::error(sprintf(_("Warning: Could not copy %s to %s"), $file_en, $file_loc));
- }
- Translate_Display::info();
- continue;
- }
- Translate_Display::info(sprintf(_("Updating %s help file for %s."), $locale, $apps[$i]));
- $fp = fopen($file_loc, 'r');
- $line = fgets($fp);
- fclose($fp);
- if (!strstr($line, '<?xml')) {
- Translate_Display::info(sprintf(_("Warning: The help file %s didn't start with <?xml"), $file_loc));
- Translate_Display::info();
- continue;
- }
- $encoding = '';
- if (preg_match('/encoding=(["\'])([^\\1]+)\\1/', $line, $match)) {
- $encoding = $match[2];
- }
- $doc_en = domxml_open_file($file_en);
- if (!is_object($doc_en)) {
- Translate_Display::info(sprintf(_("Warning: There was an error opening the file %s."), $file_en));
- Translate_Display::info();
- continue 2;
- }
- $doc_loc = domxml_open_file($file_loc);
- if (!is_object($doc_loc)) {
- Translate_Display::info(sprintf(_("There was an error opening the file %s."), $file_loc));
- Translate_Display::info();
- continue;
- }
- $doc_new = domxml_new_doc('1.0');
- $help_en = $doc_en->document_element();
- $help_loc = $doc_loc->document_element();
- $help_new = $help_loc->clone_node();
- $entries_loc = array();
- $entries_new = array();
- $count_uptodate = 0;
- $count_new = 0;
- $count_changed = 0;
- $count_unknown = 0;
- foreach ($doc_loc->get_elements_by_tagname('entry') as $entry) {
- $entries_loc[$entry->get_attribute('id')] = $entry;
- }
- foreach ($doc_en->get_elements_by_tagname('entry') as $entry) {
- $id = $entry->get_attribute('id');
- if (array_key_exists($id, $entries_loc)) {
- if ($entries_loc[$id]->has_attribute('md5') &&
- md5($entry->get_content()) != $entries_loc[$id]->get_attribute('md5')) {
- $comment = $doc_loc->create_comment(" English entry:\n" . str_replace('--', '--', $doc_loc->dump_node($entry)));
- $entries_loc[$id]->append_child($comment);
- $entry_new = $entries_loc[$id]->clone_node(true);
- $entry_new->set_attribute('state', 'changed');
- $count_changed++;
- } else {
- if (!$entries_loc[$id]->has_attribute('state')) {
- $comment = $doc_loc->create_comment(" English entry:\n" . str_replace('--', '--', $doc_loc->dump_node($entry)));
- $entries_loc[$id]->append_child($comment);
- $entry_new = $entries_loc[$id]->clone_node(true);
- $entry_new->set_attribute('state', 'unknown');
- $count_unknown++;
- } else {
- $entry_new = $entries_loc[$id]->clone_node(true);
- $count_uptodate++;
- }
- }
- } else {
- $entry_new = $entry->clone_node(true);
- $entry_new->set_attribute('state', 'new');
- $count_new++;
- }
- $entries_new[] = $entry_new;
- }
- $doc_new->append_child($doc_new->create_comment(' $' . 'Horde$ '));
- foreach ($entries_new as $entry) {
- $help_new->append_child($entry);
- }
- Translate_Display::info(sprintf(_("Entries: %d total, %d up-to-date, %d new, %d changed, %d unknown"),
- $count_uptodate + $count_new + $count_changed + $count_unknown,
- $count_uptodate, $count_new, $count_changed, $count_unknown), false);
- $doc_new->append_child($help_new);
- $output = $doc_new->dump_mem(true, $encoding);
- $fp = fopen($file_loc, 'w');
- $line = fwrite($fp, $output);
- fclose($fp);
- Translate_Display::info(sprintf(_("%d bytes written."), strlen($output)), false);
- Translate_Display::info();
- }
- }
- }
-
- function make_help()
- {
- global $dirs, $apps, $lang, $module;
-
- $files = array();
- for ($i = 0; $i < count($dirs); $i++) {
- if (!empty($module) && $module != $apps[$i]) continue;
- if (!is_dir("$dirs[$i]/locale")) continue;
- if ($apps[$i] == 'horde') {
- $dirs[] = $dirs[$i] . '/' . 'admin';
- $apps[] = 'horde/admin';
- if (!empty($module)) {
- $module = 'horde/admin';
- }
- }
- if (empty($lang)) {
- $files = search_file('help.xml', $dirs[$i] . '/' . 'locale');
- } else {
- $files = array($dirs[$i] . '/' . 'locale' . '/' . $lang . '/' . 'help.xml');
- }
- $file_en = $dirs[$i] . '/' . 'locale' . '/' . 'en' . '/' . 'help.xml';
- if (!@file_exists($file_en)) {
- continue;
- }
- foreach ($files as $file_loc) {
- if (!@file_exists($file_loc)) {
- Translate_Display::info(_("Skipped..."));
- Translate_Display::info();
- continue;
- }
- $locale = substr($file_loc, 0, strrpos($file_loc, '/'));
- $locale = substr($locale, strrpos($locale, '/') + 1);
- if ($locale == 'en') continue;
- Translate_Display::info(sprintf(_("Updating %s help file for %s."), ($locale), ($apps[$i])));
- $fp = fopen($file_loc, 'r');
- $line = fgets($fp);
- fclose($fp);
- if (!strstr($line, '<?xml')) {
- Translate_Display::info(sprintf(_("Warning: The help file %s didn't start with <?xml"), $file_loc));
- Translate_Display::info();
- continue;
- }
- $encoding = '';
- if (preg_match('/encoding=(["\'])([^\\1]+)\\1/', $line, $match)) {
- $encoding = $match[2];
- }
- $doc_en = domxml_open_file($file_en);
- if (!is_object($doc_en)) {
- Translate_Display::info(sprintf(_("Warning: There was an error opening the file %s."), $file_en));
- Translate_Display::info();
- continue 2;
- }
- $doc_loc = domxml_open_file($file_loc);
- if (!is_object($doc_loc)) {
- Translate_Display::info(sprintf(_("Warning: There was an error opening the file %s."), $file_loc));
- Translate_Display::info();
- continue;
- }
- $help_loc = $doc_loc->document_element();
- $md5_en = array();
- $count_all = 0;
- $count = 0;
- foreach ($doc_en->get_elements_by_tagname('entry') as $entry) {
- $md5_en[$entry->get_attribute('id')] = md5($entry->get_content());
- }
- foreach ($doc_loc->get_elements_by_tagname('entry') as $entry) {
- foreach ($entry->child_nodes() as $child) {
- if ($child->node_type() == XML_COMMENT_NODE && strstr($child->node_value(), 'English entry')) {
- $entry->remove_child($child);
- }
- }
- $count_all++;
- $id = $entry->get_attribute('id');
- if (!array_key_exists($id, $md5_en)) {
- Translate_Display::info(sprintf(_("No entry with the id '%s' exists in the original help file."), $id));
- } else {
- $entry->set_attribute('md5', $md5_en[$id]);
- $entry->set_attribute('state', 'uptodate');
- $count++;
- }
- }
- $output = $doc_loc->dump_mem(true, $encoding);
- $fp = fopen($file_loc, 'w');
- $line = fwrite($fp, $output);
- fclose($fp);
-
- Translate_Display::info(sprintf(_("%d of %d entries marked as up-to-date"), $count, $count_all), false);
- Translate_Display::info();
- }
- }
- }
-}
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-/* Check for a prior definition of HORDE_BASE (perhaps by an auto_prepend_file
- * definition for site customization). */
-if (!defined('HORDE_BASE')) {
- @define('HORDE_BASE', dirname(__FILE__) . '/../..');
-}
-
-if (!defined('BABEL_BASE')) {
- @define('BABEL_BASE', dirname(__FILE__) . '/..');
-}
-
-/* Load the Horde Framework core, and set up inclusion paths. */
-require_once HORDE_BASE . '/lib/core.php';
-
-/* Registry. */
-$registry = new Horde_Registry();
-
-try {
- $registry->pushApp('babel', array('logintasks' => true));
-} catch (Horde_Exception $e) {
- $registry->authenticateFailure('babel', $e);
-}
-
-$conf = &$GLOBALS['conf'];
-@define('BABEL_TEMPLATES', $registry->get('templates'));
-
-/* Babel base library */
-require_once BABEL_BASE . '/lib/Babel.php';
-require_once BABEL_BASE . '/lib/Translate.php';
-require_once BABEL_BASE . '/lib/Translate_Help.php';
-require_once BABEL_BASE . '/lib/Display.php';
-
-/* Gettext (PO) */
-require_once BABEL_BASE . '/lib/Gettext/PO.php';
-
-/* Form and Variables */
-require_once 'Horde/Form.php';
-require_once 'Horde/Form/Renderer.php';
-require_once 'Horde/Form/Action.php';
-
-/* Templates */
-$template = $injector->createInstance('Horde_Template');
-
-/* Module selection */
-$app = Horde_Util::getFormData('module');
-
-/* Language selection */
-if (($lang = Horde_Util::getFormData('display_language')) !== null) {
- $_SESSION['babel']['language'] = $lang;
-} elseif (isset($_SESSION['babel']['language'])) {
- $lang = $_SESSION['babel']['language'];
-} else {
-
- $tests = Horde_Nls::$config['languages'];
-
- // Unset English
- unset($tests['en_US']);
-
- foreach($tests as $dir => $desc) {
- if (!Babel::hasPermission("language:$dir")) {
- continue;
- } else {
- $lang = $dir;
- break;
- }
- }
- $_SESSION['babel']['language'] = $lang;
-}
-
-/* Set up the template fields. */
-$template->set('menu', Babel::getMenu()->render());
-
-Horde::startBuffer();
-$notification->notify(array('listeners' => 'status'));
-$template->set('notify', Horde::endBuffer());
-
-$template->set('lang', Babel::displayLanguage());
-$fmenu = Babel::LanguageSelection();
-
-// Only display the Module Selection widget if an application has been set
-if ($app) {
- $fmenu .= Babel::ModuleSelection();
-}
-$template->set('fmenu', $fmenu);
-
-if ($lang && !Babel::hasPermission("language:$lang")) {
- throw new Horde_Exception(sprintf(_("Access forbidden to '%s'."), $lang));
-}
-
-if ($app && !Babel::hasPermission("module:$app")) {
- throw new Horde_Exception(sprintf(_("Access forbidden to '%s'."), $app));
-}
-
-/* Custom sort function */
-function my_usort_function($a, $b)
-{
- if ($a[1] > $b[1]) { return -1; }
- if ($a[1] < $b[1]) { return 1; }
- return 0;
-}
+++ /dev/null
-Deny from all
+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Horde Project
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2010-08-17 17:46+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: lib/Translate_Help.php:141
-#, php-format
-msgid "%d bytes written."
-msgstr ""
-
-#: lib/Translate_Help.php:233
-#, php-format
-msgid "%d of %d entries marked as up-to-date"
-msgstr ""
-
-#: lib/Translate.php:349 lib/Translate.php:368
-#, php-format
-msgid "%s is not writable."
-msgstr ""
-
-#: extract.php:65 lib/Translate.php:91 lib/Translate.php:114
-#, php-format
-msgid "%s not found."
-msgstr ""
-
-#: lib/Translate.php:520
-#, php-format
-msgid "%s not found. Run 'Extract' first."
-msgstr ""
-
-#: view.php:303
-#, php-format
-msgid "%s to %s of %s"
-msgstr ""
-
-#: lib/Translate.php:394
-#, php-format
-msgid ""
-"<gettext> tag not closed in file %s.\n"
-"Opening tag found in line %d."
-msgstr ""
-
-#: viewsource.php:30
-#, php-format
-msgid "Access denied to %s"
-msgstr ""
-
-#: lib/base.php:97 lib/base.php:101
-#, php-format
-msgid "Access forbidden to '%s'."
-msgstr ""
-
-#: lib/Translate.php:267
-msgid "Adding new files to repository:"
-msgstr ""
-
-#: view.php:225 view.php:227
-msgid "All"
-msgstr ""
-
-#: lib/Babel.php:53 lib/Babel.php:135
-msgid "All Applications"
-msgstr ""
-
-#: templates/index.php:50
-msgid "Build binary MO files from the specified PO files."
-msgstr ""
-
-#: lib/Translate.php:559
-#, php-format
-msgid "Building MO files for module %s..."
-msgstr ""
-
-#: lib/Translate.php:571
-#, php-format
-msgid "Building locale %s..."
-msgstr ""
-
-#: lib/Babel.php:284
-#, php-format
-msgid "Can take up to %d minutes !"
-msgstr ""
-
-#: lib/Babel.php:278
-#, php-format
-msgid "Can take up to %d seconds !"
-msgstr ""
-
-#: lib/Babel.php:282
-msgid "Can take up to 1 minute !"
-msgstr ""
-
-#: view.php:444
-msgid "Cancel"
-msgstr ""
-
-#: lib/Translate.php:718
-#, php-format
-msgid "Cleaning up PO files for module %s..."
-msgstr ""
-
-#: lib/Translate.php:730
-#, php-format
-msgid "Cleaning up locale %s..."
-msgstr ""
-
-#: commit.php:47 templates/index.php:55 lib/Application.php:67
-msgid "Commit"
-msgstr ""
-
-#: commit.php:41
-msgid "Commit PO files ..."
-msgstr ""
-
-#: templates/index.php:56
-msgid "Commit translations to the SVN server."
-msgstr ""
-
-#: lib/Translate.php:301
-msgid "Committing:"
-msgstr ""
-
-#: extract.php:114 lib/Translate.php:466 lib/Translate.php:497
-#: lib/Translate.php:538 lib/Translate.php:628 lib/Translate.php:676
-#: lib/Translate.php:738
-msgid "Done!"
-msgstr ""
-
-#: templates/index.php:25 lib/Application.php:60
-msgid "Download"
-msgstr ""
-
-#: download.php:14
-msgid "Download File"
-msgstr ""
-
-#: templates/index.php:26
-msgid "Download all current PO files."
-msgstr ""
-
-#: edit.php:75
-msgid "Edit"
-msgstr ""
-
-#: view.php:166
-msgid "Edit Header"
-msgstr ""
-
-#: view.php:231
-msgid "Edit Mode"
-msgstr ""
-
-#: edit.php:52 view.php:440
-msgid "Edit Translation"
-msgstr ""
-
-#: lib/Translate_Help.php:133
-#, php-format
-msgid "Entries: %d total, %d up-to-date, %d new, %d changed, %d unknown"
-msgstr ""
-
-#: lib/Translate.php:439 lib/Translate.php:478
-msgid "Error: No locale specified."
-msgstr ""
-
-#: extract.php:36 templates/index.php:43 lib/Application.php:65
-msgid "Extract"
-msgstr ""
-
-#: extract.php:33
-msgid "Extract Translation"
-msgstr ""
-
-#: lib/Translate.php:334
-#, php-format
-msgid "Extracting from %s... "
-msgstr ""
-
-#: lib/Translate.php:499 lib/Translate.php:519 lib/Translate.php:540
-#: lib/Translate.php:656 lib/Translate.php:678 lib/Translate.php:741
-msgid "Failed!"
-msgstr ""
-
-#: config/hooks.php.dist:24
-msgid "File doesn't exist ... "
-msgstr ""
-
-#: view.php:222
-msgid "Filter: "
-msgstr ""
-
-#: extract.php:92 make.php:61 reset.php:34 commit.php:35
-msgid "Found applications:"
-msgstr ""
-
-#: extract.php:84
-msgid "Found directories:"
-msgstr ""
-
-#: lib/Babel.php:24
-#, php-format
-msgid "Function doesn't exist: %s"
-msgstr ""
-
-#: stats.php:81 view.php:200 view.php:246 view.php:248
-msgid "Fuzzy"
-msgstr ""
-
-#: extract.php:105 make.php:65
-msgid "Generate Compendium ..."
-msgstr ""
-
-#: templates/index.php:44
-msgid "Generate and merge PO files."
-msgstr ""
-
-#: templates/index.php:38
-msgid "Get statistics about translations."
-msgstr ""
-
-#: extract.php:50 lib/Translate.php:77
-msgid "Gettext extension not found!"
-msgstr ""
-
-#: lib/Babel.php:27
-msgid "Hook file doesn't exist"
-msgstr ""
-
-#: extract.php:46 reset.php:24 stats.php:42 commit.php:22
-msgid "Horde translation generator"
-msgstr ""
-
-#: lib/Translate.php:517
-#, php-format
-msgid "Initializing module %s..."
-msgstr ""
-
-#: upload.php:37
-msgid "Invalid Translations file. Please submit a valid PO file!"
-msgstr ""
-
-#: stats.php:77 view.php:196
-msgid "Language"
-msgstr ""
-
-#: lib/Babel.php:38
-#, php-format
-msgid "Language: %s (%s)"
-msgstr ""
-
-#: lib/Application.php:29
-msgid "Languages"
-msgstr ""
-
-#: extract.php:54 lib/Translate.php:80
-msgid "Loading libraries..."
-msgstr ""
-
-#: stats.php:78 view.php:197
-msgid "Locale"
-msgstr ""
-
-#: view.php:432
-#, php-format
-msgid "Locked by %s"
-msgstr ""
-
-#: make.php:36 templates/index.php:49 lib/Application.php:66
-msgid "Make"
-msgstr ""
-
-#: make.php:33
-msgid "Make Translation"
-msgstr ""
-
-#: extract.php:72 lib/Translate.php:98
-msgid "Make sure that you have PEAR installed and in your include path."
-msgstr ""
-
-#: lib/Translate.php:482
-#, php-format
-msgid "Merging all %s.po files to the compendium... "
-msgstr ""
-
-#: lib/Translate.php:463
-#, php-format
-msgid "Merging locale %s..."
-msgstr ""
-
-#: lib/Translate.php:666
-#, php-format
-msgid "Merging the PO file for %s to the compendium..."
-msgstr ""
-
-#: lib/Translate.php:450
-#, php-format
-msgid "Merging translation for module %s..."
-msgstr ""
-
-#: view.php:177
-msgid "Meta Informations"
-msgstr ""
-
-#: viewsource.php:25
-msgid "Missing filename!"
-msgstr ""
-
-#: extract.php:37 edit.php:76 make.php:37 upload.php:20 stats.php:33
-#: view.php:155
-msgid "Module"
-msgstr ""
-
-#: lib/Babel.php:40
-#, php-format
-msgid "Module: %s"
-msgstr ""
-
-#: lib/Application.php:39
-msgid "Modules"
-msgstr ""
-
-#: lib/Translate_Help.php:221
-#, php-format
-msgid "No entry with the id '%s' exists in the original help file."
-msgstr ""
-
-#: lib/Translate.php:127
-msgid "Not all strings will be extracted."
-msgstr ""
-
-#: lib/Translate.php:425
-msgid "Not changed!"
-msgstr ""
-
-#: stats.php:83 view.php:202
-msgid "Obsolete"
-msgstr ""
-
-#: lib/Babel.php:274
-msgid "Please be patient ..."
-msgstr ""
-
-#: upload.php:31
-msgid "Please select module of translations PO file!"
-msgstr ""
-
-#: templates/index.php:61 lib/Application.php:68
-msgid "Reset"
-msgstr ""
-
-#: reset.php:43
-msgid "Reset PO file on "
-msgstr ""
-
-#: reset.php:38
-msgid "Reset PO files ..."
-msgstr ""
-
-#: lib/Translate.php:687
-msgid "Results (including Horde):"
-msgstr ""
-
-#: lib/Translate.php:685
-msgid "Results:"
-msgstr ""
-
-#: edit.php:55 edit.php:80 view.php:442
-msgid "Save"
-msgstr ""
-
-#: view.php:269
-msgid "Search"
-msgstr ""
-
-#: extract.php:80 make.php:56
-#, php-format
-msgid "Searching Horde applications in %s"
-msgstr ""
-
-#: lib/Translate.php:107
-msgid "Searching gettext binaries..."
-msgstr ""
-
-#: lib/Translate_Help.php:173 lib/Translate.php:456 lib/Translate.php:564
-#: lib/Translate.php:723
-msgid "Skipped..."
-msgstr ""
-
-#: view.php:190
-msgid "Statistic"
-msgstr ""
-
-#: templates/index.php:37 lib/Application.php:62
-msgid "Statistics"
-msgstr ""
-
-#: stats.php:79 view.php:198
-msgid "Status"
-msgstr ""
-
-#: templates/index.php:62
-msgid ""
-"The reset procedure will delete all PO files from the server for all modules "
-"and restore from SVN server."
-msgstr ""
-
-#: lib/Translate_Help.php:83
-#, php-format
-msgid "There was an error opening the file %s."
-msgstr ""
-
-#: stats.php:80 view.php:199 view.php:235 view.php:237
-msgid "Translated"
-msgstr ""
-
-#: view.php:304
-msgid "Translations"
-msgstr ""
-
-#: upload.php:21
-msgid "Translations File (.PO)"
-msgstr ""
-
-#: stats.php:82 view.php:201 view.php:256 view.php:258
-msgid "Untranslated"
-msgstr ""
-
-#: lib/Translate.php:422
-msgid "Updated!"
-msgstr ""
-
-#: lib/Translate_Help.php:62 lib/Translate_Help.php:180
-#, php-format
-msgid "Updating %s help file for %s."
-msgstr ""
-
-#: upload.php:19 upload.php:25 templates/index.php:31 lib/Application.php:61
-msgid "Upload"
-msgstr ""
-
-#: templates/index.php:32
-msgid "Upload new PO files."
-msgstr ""
-
-#: upload.php:18
-msgid "Upload new Translation"
-msgstr ""
-
-#: upload.php:45
-#, php-format
-msgid "Upload successful for %s (%s)"
-msgstr ""
-
-#: stats.php:32 view.php:154 templates/index.php:19
-msgid "View"
-msgstr ""
-
-#: lib/Application.php:64
-msgid "View Source"
-msgstr ""
-
-#: stats.php:29
-msgid "View Statistics"
-msgstr ""
-
-#: view.php:151
-msgid "View Translation"
-msgstr ""
-
-#: templates/index.php:20
-msgid "View all translations."
-msgstr ""
-
-#: viewsource.php:39
-#, php-format
-msgid "View source: %s"
-msgstr ""
-
-#: lib/Application.php:63
-msgid "View/Edit"
-msgstr ""
-
-#: lib/Translate_Help.php:57
-#, php-format
-msgid "Warning: Could not copy %s to %s"
-msgstr ""
-
-#: lib/Translate_Help.php:49 lib/Translate.php:576
-#, php-format
-msgid "Warning: Could not create locale directory for locale %s:"
-msgstr ""
-
-#: lib/Translate_Help.php:44
-#, php-format
-msgid "Warning: The %s help file for %s doesn't yet exist. Creating a new one."
-msgstr ""
-
-#: lib/Translate_Help.php:67 lib/Translate_Help.php:185
-#, php-format
-msgid "Warning: The help file %s didn't start with <?xml"
-msgstr ""
-
-#: lib/Translate_Help.php:35
-#, php-format
-msgid "Warning: There doesn't yet exist a help file for %s."
-msgstr ""
-
-#: lib/Translate_Help.php:77 lib/Translate_Help.php:195
-#: lib/Translate_Help.php:201
-#, php-format
-msgid "Warning: There was an error opening the file %s."
-msgstr ""
-
-#: lib/Translate.php:126
-msgid ""
-"Warning: Your gettext version is too old and does not support PHP natively."
-msgstr ""
-
-#: lib/Translate.php:598
-msgid "Warning: an error has occured:"
-msgstr ""
-
-#: lib/Translate.php:612
-#, php-format
-msgid "Warning: the Horde PO file for the locale %s does not exist:"
-msgstr ""
-
-#: lib/Babel.php:212
-msgid "_Extract"
-msgstr ""
-
-#: lib/Babel.php:195
-msgid "_General"
-msgstr ""
-
-#: lib/Babel.php:218
-msgid "_Make"
-msgstr ""
-
-#: lib/Babel.php:206
-msgid "_Stats"
-msgstr ""
-
-#: lib/Babel.php:224
-msgid "_Upload"
-msgstr ""
-
-#: lib/Babel.php:200
-msgid "_View"
-msgstr ""
+++ /dev/null
-msgid ""
-msgstr ""
-"Project-Id-Version: Translation ???\n"
-"Report-Msgid-Bugs-To: support@scopserv.com\n"
-"POT-Creation-Date: 2009-01-18 17:15-0500\n"
-"PO-Revision-Date: 2009-01-12 23:02-0500\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: i18n@lists.horde.org\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#: lib/Translate.php:257 lib/Translate.php:276
-#, php-format
-msgid "%s is not writable."
-msgstr "%s n'est pas accessible en écriture."
-
-#: extract.php:65 lib/Translate.php:94 lib/Translate.php:117
-#, php-format
-msgid "%s not found."
-msgstr "%s non trouvé."
-
-#: lib/Translate.php:428
-#, php-format
-msgid "%s not found. Run 'Extract' first."
-msgstr "%s non trouvé. Veuillez faire une 'Extraction'."
-
-#: view.php:301
-#, php-format
-msgid "%s to %s of %s"
-msgstr "%s à %s de %s"
-
-#: lib/Translate.php:302
-#, php-format
-msgid ""
-"<gettext> tag not closed in file %s.\n"
-"Opening tag found in line %d."
-msgstr ""
-"La balise <gettext> n'est pas fermé correctement dans le fichier %s. Balise "
-"d'ouverture trouvé à la ligne %d."
-
-#: viewsource.php:30
-#, php-format
-msgid "Access denied to %s"
-msgstr "Accès refusé à %s"
-
-#: lib/base.php:112 lib/base.php:116
-#, php-format
-msgid "Access forbidden to '%s'."
-msgstr "Accès refusé à '%s'."
-
-#: view.php:223 view.php:225
-msgid "All"
-msgstr "Tout"
-
-#: lib/Translation.php:53 lib/Translation.php:135
-msgid "All Applications"
-msgstr "Toutes les applications"
-
-#: templates/index.php:50
-msgid "Build binary MO files from the specified PO files."
-msgstr "Construire les fichiers binaire MO à partir des fichiers PO spécifié."
-
-#: lib/Translate.php:467
-#, php-format
-msgid "Building MO files for module %s..."
-msgstr "Génération des fichiers MO pour le module %s ..."
-
-#: lib/Translate.php:479
-#, php-format
-msgid "Building locale %s..."
-msgstr "Généré locale %s ..."
-
-#: lib/Translation.php:292
-#, php-format
-msgid "Can take up to %d minutes !"
-msgstr "Peut prendre jusqu'à %d minutes !"
-
-#: lib/Translation.php:286
-#, php-format
-msgid "Can take up to %d seconds !"
-msgstr "Peut prendre jusqu'à %d secondes !"
-
-#: lib/Translation.php:290
-msgid "Can take up to 1 minute !"
-msgstr "Peut prendre jusqu'à 1 minute !"
-
-#: view.php:442
-msgid "Cancel"
-msgstr "Annuler"
-
-#: lib/Translate.php:626
-#, php-format
-msgid "Cleaning up PO files for module %s..."
-msgstr "Nettoyage des fichiers PO pour le module %s ..."
-
-#: lib/Translate.php:638
-#, php-format
-msgid "Cleaning up locale %s..."
-msgstr "Netoyage de la locale %s ..."
-
-#: commit.php:42 templates/index.php:55 lib/api.php:66
-msgid "Commit"
-msgstr "Validez"
-
-#: commit.php:36
-msgid "Commit PO files ..."
-msgstr "Validez les fichier PO ..."
-
-#: templates/index.php:56
-msgid "Commit translations to the SVN server."
-msgstr "Validez (commit) les traductions sur le serveur SVN."
-
-#: extract.php:114 lib/Translate.php:374 lib/Translate.php:405
-#: lib/Translate.php:446 lib/Translate.php:536 lib/Translate.php:584
-#: lib/Translate.php:646
-msgid "Done!"
-msgstr "Terminé!"
-
-#: templates/index.php:25 lib/api.php:59
-msgid "Download"
-msgstr "Télécharger"
-
-#: download.php:14
-msgid "Download File"
-msgstr "Télécharger Fichier"
-
-#: templates/index.php:26
-msgid "Download all current PO files."
-msgstr "Télécharger tous les fichiers PO."
-
-#: edit.php:78
-msgid "Edit"
-msgstr "Modifier"
-
-#: view.php:164
-msgid "Edit Header"
-msgstr "Modifier Entête"
-
-#: view.php:229
-msgid "Edit Mode"
-msgstr "Mode Édition"
-
-#: edit.php:52 view.php:438
-msgid "Edit Translation"
-msgstr "Modifier Traduction"
-
-#: lib/Translate.php:347 lib/Translate.php:386
-msgid "Error: No locale specified."
-msgstr "Erreur: Il n'y a pas de locale de spécifié."
-
-#: extract.php:36 templates/index.php:43 lib/api.php:64
-msgid "Extract"
-msgstr "Extraire"
-
-#: extract.php:33
-msgid "Extract Translation"
-msgstr "Extraire Traduction"
-
-#: lib/Translate.php:242
-#, php-format
-msgid "Extracting from %s... "
-msgstr "Extraction à partir de %s ..."
-
-#: lib/Translate.php:407 lib/Translate.php:427 lib/Translate.php:448
-#: lib/Translate.php:564 lib/Translate.php:586 lib/Translate.php:649
-msgid "Failed!"
-msgstr "Échoué!"
-
-#: config/hooks.php:24
-msgid "File doesn't exist ... "
-msgstr "Fichier non existant ..."
-
-#: view.php:220
-msgid "Filter: "
-msgstr "Filtres: "
-
-#: commit.php:32 make.php:61 reset.php:34 extract.php:92
-msgid "Found applications:"
-msgstr "Applications Trouvée :"
-
-#: lib/Translation.php:24
-#, php-format
-msgid "Function doesn't exist: %s"
-msgstr "Fonction non-existante: %s"
-
-#: view.php:198 view.php:244 view.php:246 stats.php:81
-msgid "Fuzzy"
-msgstr "Floue"
-
-#: make.php:65 extract.php:105
-msgid "Generate Compendium ..."
-msgstr "Génération du Compendium ..."
-
-#: templates/index.php:44
-msgid "Generate and merge PO files."
-msgstr "Générer et fusionner les fichier PO."
-
-#: templates/index.php:38
-msgid "Get statistics about translations."
-msgstr "Obtenir les statistiques concernant les traductions."
-
-#: extract.php:50 lib/Translate.php:80
-msgid "Gettext extension not found!"
-msgstr "Extension Gettext non trouvé!"
-
-#: lib/Translation.php:27
-msgid "Hook file doesn't exist"
-msgstr "Fichier Hook non existant"
-
-#: commit.php:19 reset.php:24 stats.php:42 extract.php:46
-msgid "Horde translation generator"
-msgstr "Générateur de traduction Horde"
-
-#: lib/Translate.php:425
-#, php-format
-msgid "Initializing module %s..."
-msgstr "Initialisation du module %s ..."
-
-#: upload.php:37
-msgid "Invalid Translations file. Please submit a valid PO file!"
-msgstr ""
-"Fichier de traductions invalide. Veuillez soumettre un fichier PO valide !"
-
-#: view.php:194 stats.php:77
-msgid "Language"
-msgstr "Langue"
-
-#: lib/Translation.php:38
-#, php-format
-msgid "Language: %s (%s)"
-msgstr "Langue: %s (%s)"
-
-#: lib/api.php:28
-msgid "Languages"
-msgstr "Langues"
-
-#: extract.php:54 lib/Translate.php:83
-msgid "Loading libraries..."
-msgstr "Chargement des librairies ..."
-
-#: view.php:195 stats.php:78
-msgid "Locale"
-msgstr "Locale"
-
-#: view.php:430
-#, php-format
-msgid "Locked by %s"
-msgstr "Verouillé par %s"
-
-#: make.php:36 templates/index.php:49 lib/api.php:65
-msgid "Make"
-msgstr "Générer"
-
-#: make.php:33
-msgid "Make Translation"
-msgstr "Générer la Traduction"
-
-#: lib/Translate.php:101
-msgid "Make sure that you have PEAR installed and in your include path."
-msgstr ""
-"Veuillez vérifier que vous avez installé PEAR et qu'il sont include dans le "
-"chemin d'accès (include path)."
-
-#: lib/Translate.php:390
-#, php-format
-msgid "Merging all %s.po files to the compendium... "
-msgstr "Fusionner tous les fichiers %s.po vers le compendium..."
-
-#: lib/Translate.php:371
-#, php-format
-msgid "Merging locale %s..."
-msgstr "Fusion de la locale %s ..."
-
-#: lib/Translate.php:574
-#, php-format
-msgid "Merging the PO file for %s to the compendium..."
-msgstr "Fusionner tous les fichiers PO pour %s vers le compendium..."
-
-#: lib/Translate.php:358
-#, php-format
-msgid "Merging translation for module %s..."
-msgstr "Fusion de la traduction pour le module %s ..."
-
-#: view.php:175
-msgid "Meta Informations"
-msgstr "Informations Meta"
-
-#: viewsource.php:25
-msgid "Missing filename!"
-msgstr "Nom de fichier manquant!"
-
-#: edit.php:79 make.php:37 view.php:153 upload.php:20 stats.php:33
-#: extract.php:37
-msgid "Module"
-msgstr "Module"
-
-#: lib/Translation.php:40
-#, php-format
-msgid "Module: %s"
-msgstr "Module: %s"
-
-#: lib/api.php:38
-msgid "Modules"
-msgstr "Modules"
-
-#: lib/Translate.php:130
-msgid "Not all strings will be extracted."
-msgstr "Les chaînes de caractères n'ont pas toutes été extraite."
-
-#: lib/Translate.php:333
-msgid "Not changed!"
-msgstr "Non modifié!"
-
-#: view.php:200 stats.php:83
-msgid "Obsolete"
-msgstr "Obsolète"
-
-#: lib/Translation.php:282
-msgid "Please be patient ..."
-msgstr "Veuillez patienter..."
-
-#: upload.php:31
-msgid "Please select module of translations PO file!"
-msgstr "Veuillez sélectionner le module pour le fichier PO de traduction."
-
-#: templates/index.php:61 lib/api.php:67
-msgid "Reset"
-msgstr "Réinitialiser"
-
-#: reset.php:43
-msgid "Reset PO file on "
-msgstr "Ré-initialisation du fichier PO pour "
-
-#: reset.php:38
-msgid "Reset PO files ..."
-msgstr "Ré-initialisation des fichiers PO ..."
-
-#: lib/Translate.php:595
-msgid "Results (including Horde):"
-msgstr "Résultats (incluant Horde):"
-
-#: lib/Translate.php:593
-msgid "Results:"
-msgstr "Résultats:"
-
-#: edit.php:55 edit.php:83 view.php:440
-msgid "Save"
-msgstr "Enregistrer"
-
-#: view.php:267
-msgid "Search"
-msgstr "Recherche"
-
-#: lib/Translate.php:110
-msgid "Searching gettext binaries..."
-msgstr "Recherche des exécutables pour gettext ..."
-
-#: lib/Translate.php:364 lib/Translate.php:472 lib/Translate.php:631
-msgid "Skipped..."
-msgstr "Ignoré..."
-
-#: view.php:188
-msgid "Statistic"
-msgstr "Statistique"
-
-#: templates/index.php:37 lib/api.php:61
-msgid "Statistics"
-msgstr "Statistiques"
-
-#: view.php:196 stats.php:79
-msgid "Status"
-msgstr "Statut"
-
-#: templates/index.php:62
-msgid ""
-"The reset procedure will delete all PO files from the server for all modules "
-"and restore from SVN server."
-msgstr ""
-"La procédure de ré-initialisation effacera tous les fichiers PO du serveur "
-"et les restaurera à partir du serveur SVN."
-
-#: view.php:197 view.php:233 view.php:235 stats.php:80
-msgid "Translated"
-msgstr "Traduit"
-
-#: view.php:302
-msgid "Translations"
-msgstr "Traductions"
-
-#: upload.php:21
-msgid "Translations File (.PO)"
-msgstr "Fichier de Traduction (.PO)"
-
-#: view.php:199 view.php:254 view.php:256 stats.php:82
-msgid "Untranslated"
-msgstr "Non Traduit"
-
-#: lib/Translate.php:330
-msgid "Updated!"
-msgstr "Mis à jour!"
-
-#: upload.php:19 upload.php:25 templates/index.php:31 lib/api.php:60
-msgid "Upload"
-msgstr "Envoi"
-
-#: templates/index.php:32
-msgid "Upload new PO files."
-msgstr "Envoyer nouveaux fichiers PO."
-
-#: upload.php:18
-msgid "Upload new Translation"
-msgstr "Envoi une nouvelle Traduction"
-
-#: upload.php:45
-#, php-format
-msgid "Upload successful for %s (%s)"
-msgstr "Transfert de fichier réussi pour %s (%s)"
-
-#: view.php:152 stats.php:32 templates/index.php:19
-msgid "View"
-msgstr "Voir"
-
-#: lib/api.php:63
-msgid "View Source"
-msgstr "Visionner Source"
-
-#: stats.php:29
-msgid "View Statistics"
-msgstr "Voir Statistiques"
-
-#: view.php:149
-msgid "View Translation"
-msgstr "Voir Traduction"
-
-#: templates/index.php:20
-msgid "View all translations."
-msgstr "Visionner toutes les traductions."
-
-#: viewsource.php:39
-#, php-format
-msgid "View source: %s"
-msgstr "Voir source: %s"
-
-#: lib/api.php:62
-msgid "View/Edit"
-msgstr "Visionner/Modifier"
-
-#: lib/Translate.php:484
-#, php-format
-msgid "Warning: Could not create locale directory for locale %s:"
-msgstr "Avertissement: Impossible de créer le dossier pour le locale %s :"
-
-#: lib/Translate.php:129
-msgid ""
-"Warning: Your gettext version is too old and does not support PHP natively."
-msgstr ""
-"Avertissement: Votre version de gettext est trop ancienne et ne supporte pas "
-"PHP nativement."
-
-#: lib/Translate.php:506
-msgid "Warning: an error has occured:"
-msgstr "Avertissement: Une erreur s'est produite:"
-
-#: lib/Translate.php:520
-#, php-format
-msgid "Warning: the Horde PO file for the locale %s does not exist:"
-msgstr "Avertissement: le fichier PO de Horde pour le locale %s n'existe pas:"
-
-#: lib/Translation.php:214
-msgid "_Extract"
-msgstr "_Extraire"
-
-#: lib/Translation.php:197
-msgid "_General"
-msgstr "_Général"
-
-#: lib/Translation.php:220
-msgid "_Make"
-msgstr "Gé_nérer"
-
-#: lib/Translation.php:208
-msgid "_Stats"
-msgstr "_Stats"
-
-#: lib/Translation.php:226
-msgid "_Upload"
-msgstr "En_voi"
-
-#: lib/Translation.php:202
-msgid "_View"
-msgstr "_Visionner"
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-set_time_limit(0);
-
-@define('BABEL_BASE', dirname(__FILE__)) ;
-require_once BABEL_BASE . '/lib/base.php';
-
-if ($app) {
- /* Render the page. */
- Babel::RB_init();
-}
-
-require BABEL_TEMPLATES . '/common-header.inc';
-
-if ($app) {
- Babel::RB_start(30);
-}
-
-echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-
-$vars = &Horde_Variables::getDefaultVariables();
-
-/* Create upload form */
-$form = new Horde_Form($vars, _("Make Translation"), 'make');
-
-if (!$app) {
- $form->setButtons(_("Make"));
- $form->addVariable(_("Module"), 'module', 'enum', true, false, null, array(Babel::listApps(true), true));
- $form->addVariable('', '', 'spacer', true);
-
- $renderer_params = array();
- $renderer = new Horde_Form_Renderer($renderer_params);
- $renderer->setAttrColumnWidth('20%');
-
- $form->renderActive($renderer, $vars, Horde::selfURL(), 'post');
-} else {
-
- if ($app != 'ALL') {
- $module = $app;
- }
-
- Translate::sanity_check();
-
- /* Searching applications */
- Translate::check_binaries();
-
- Translate_Display::info(sprintf(_("Searching Horde applications in %s"), realpath(HORDE_BASE)));
- $dirs = Translate::search_applications();
-
- $apps = Translate::strip_horde($dirs);
- $apps[0] = 'horde';
- Translate_Display::info(_("Found applications:"));
- Translate_Display::info(wordwrap(implode(', ', $apps)), false);
- Translate_Display::info();
-
- Translate_Display::header(_("Generate Compendium ..."));
- Translate::compendium();
- Translate_Display::info();
-
- Translate::cleanup(true);
- Translate_Display::info();
- Translate::make();
-
- Babel::RB_close();
-}
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-@define('BABEL_BASE', dirname(__FILE__)) ;
-require_once BABEL_BASE . '/lib/base.php';
-
-Babel::RB_init();
-
-/* Render the page. */
-require BABEL_TEMPLATES . '/common-header.inc';
-
-Babel::RB_start(15);
-
-echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-
-Translate_Display::header(_("Horde translation generator"));
-
-Translate_Display::info(sprintf('Searching Horde applications in %s', realpath(HORDE_BASE)));
-
-Translate::check_binaries();
-
-$dirs = Translate::search_applications();
-
-$apps = Translate::strip_horde($dirs);
-$apps[0] = 'horde';
-Translate_Display::info(_("Found applications:"));
-Translate_Display::info(wordwrap(implode(', ', $apps)), false);
-Translate_Display::info();
-
-Translate_Display::header(_("Reset PO files ..."));
-foreach($dirs as $d => $dir) {
- $dir = realpath($dir);
- $po = $dir . '/po/' . $lang . '.po';
-
- Translate_Display::info(_("Reset PO file on ") . $po);
- Babel::callHook('reset', $po);
-
-}
-
-Translate_Display::info();
-Translate::cleanup(true);
-
-Babel::RB_close();
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-@define('BABEL_BASE', dirname(__FILE__)) ;
-require_once BABEL_BASE . '/lib/base.php';
-
-if ($app) {
- /* Render the page. */
- Babel::RB_init();
-}
-require BABEL_TEMPLATES . '/common-header.inc';
-
-if ($app) {
- Babel::RB_start(30);
-}
-echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-
-$vars = &Horde_Variables::getDefaultVariables();
-
-/* Create upload form */
-$form = new Horde_Form($vars, _("View Statistics"), 'stats');
-
-if (!$app) {
- $form->setButtons(_("View"));
- $form->addVariable(_("Module"), 'module', 'enum', true, false, null, array(Babel::listApps(true), true));
- $form->addVariable('', '', 'spacer', true);
-
- $renderer_params = array();
- $renderer = new Horde_Form_Renderer($renderer_params);
- $renderer->setAttrColumnWidth('20%');
-
- $form->renderActive($renderer, $vars, Horde::selfURL(), 'post');
-} else {
- Translate_Display::header(_("Horde translation generator"));
-
- $dirs = Translate::search_applications();
- $apps = Translate::strip_horde($dirs);
- $apps[0] = 'horde';
- Translate_Display::info();
-
- foreach($dirs as $d => $dir) {
- $dir = realpath($dir);
- $pofile = $dir . '/po/' . $lang . '.po';
-
- if (!@file_exists($pofile)) {
- continue;
- }
-
- $_app = str_replace(realpath(HORDE_BASE), '', $dir);
- $_app = str_replace('/', '', $_app);
- if (empty($_app)) {
- $_app = 'horde';
- }
-
- if ($app != 'ALL' && $app != $_app) {
- continue;
- }
-
- if (!Babel::hasPermission("module:$_app")) {
- continue;
- }
-
- Translate_Display::header($_app);
-
- $report = Translate::stats($_app);
-
- echo '<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">';
- echo '<tr class="control">';
- echo '<td class="control" style="border-bottom: 1px solid #999;"><b>' . _("Language") . '</b></td>';
- echo '<td width="5%"><b>' . _("Locale") . '</b></td>';
- echo '<td width="15%"><b>' . _("Status") . '</b></td>';
- echo '<td valign="bottom" style="width: 80px;"><b>' . _("Translated") . '</b></td>';
- echo '<td valign="bottom" style="width: 80px;"><b>' . _("Fuzzy") . '</b></td>';
- echo '<td valign="bottom" style="width: 80px;"><b>' . _("Untranslated") . '</b></td>';
- echo '<td valign="bottom" style="width: 80px;"><b>' . _("Obsolete") . '</b></td>';
- echo '</tr>';
-
- $i = 0;
- $j = 0;
- $line = 0;
- $last_key = null;
- foreach ($report as $key => $value) {
-
- if (!Babel::hasPermission("language:$key")) {
- continue;
- }
-
- if ($key == $_SESSION['babel']['language']) {
- echo "\n<tr class=\"smallheader control\">";
- } else {
- echo "\n<tr class=\"item" . ($i++ % 2) . "\">";
- }
- echo "\n\t<td>" . Horde_Nls::$config['languages'][$key] . "</td>";
- echo "\n\t<td>" . Horde::link(Horde_Util::addParameter(Horde::url('view.php'), array('display_language' => $key, 'module' => $_app))) . $key . '</a>' . "</td>";
- echo "\n\t<td>" . Translate_Display::create_bargraph($value[2], $value[0]) . "</td>";
- echo "\n\t<td>" . $value[2] . "</td>";
- echo "\n\t<td>" . $value [3] . "</td>";
- echo "\n\t<td>" . $value[4] . "</td>";
- echo "\n\t<td>" . $value[5] . "</td>";
- echo "\t</tr>";
- $last_key = $key;
- }
-
- echo '</table>';
-
- Translate_Display::info();
- }
-
- Babel::RB_close();
-}
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-if (isset($language)) {
- header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
- header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $GLOBALS['registry']->get('name');
-if (!empty($title)) {
- $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-
-?>
-<title><?php echo $page_title ?></title>
-<?php Horde_Themes::includeStylesheetFiles() ?>
-</head>
-
-<body>
+++ /dev/null
-<table style="width:100%" cellspacing="0">
-<tr class="header">
-<td style="width:200px; padding-left:8px; vertical-align:top">
- <h1 class="header">
- <gettext>Command</gettext>
- </h1>
-</td>
-<td style="padding-left:8px; vertical-align:top">
- <h1 class="header">
- <gettext>Description</gettext>
- </h1>
-</td>
-
-<?php
-
-$cmds = array();
-
-$cmds['view'] = array(
- 'desc' => _("View"),
- 'text' => _("View all translations."),
- 'url' => Horde::url('view.php')
-);
-
-$cmds['download'] = array(
- 'desc' => _("Download"),
- 'text' => _("Download all current PO files."),
- 'url' => Horde::url('download.php')
-);
-
-$cmds['upload'] = array(
- 'desc' => _("Upload"),
- 'text' => _("Upload new PO files."),
- 'url' => Horde::url('upload.php')
-);
-
-$cmds['stats'] = array(
- 'desc' => _("Statistics"),
- 'text' => _("Get statistics about translations."),
- 'url' => Horde::url('stats.php')
-);
-
-$cmds['extract'] = array(
- 'desc' => _("Extract"),
- 'text' => _("Generate and merge PO files."),
- 'url' => Horde::url('extract.php')
-);
-
-$cmds['make'] = array(
- 'desc' => _("Make"),
- 'text' => _("Build binary MO files from the specified PO files."),
- 'url' => Horde::url('make.php')
-);
-
-$cmds['commit'] = array(
- 'desc' => _("Commit"),
- 'text' => _("Commit translations to the SVN server."),
- 'url' => Horde::url('commit.php')
-);
-
-$cmds['reset'] = array(
- 'desc' => _("Reset"),
- 'text' => _("The reset procedure will delete all PO files from the server for all modules and restore from SVN server."),
- 'url' => Horde::url('reset.php')
-);
-
-
-$i = 0;
-
-foreach($cmds as $cmdid => $cmd) {
- if (Babel::hasPermission($cmdid)) {
- echo '<tr height="50" class="item' . ($i++ % 2) . '">';
- echo '<td align="center"><div style="width: 140px;" onclick="window.location=\'' . $cmd['url'] . '\';" class="button"><a class="smallheader" href="' . $cmd['url'] . '">' . $cmd['desc'] . '</a></div></td>';
- echo '<td>' . $cmd['text'] . '</td>';
- echo '</tr>';
- }
-}
-?>
-</table>
+++ /dev/null
-<div id="menu">
- <span style="float:right">
- <tag:fmenu />
- </span>
- <tag:menu />
-</div>
-<br />
-
-<tag:notify />
-
-<table cellspacing=0 cellpadding=0 width=100%>
-<tr><td class="header control"><tag:lang /></td></tr>
-</table>
-<br />
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-@define('BABEL_BASE', dirname(__FILE__)) ;
-require_once BABEL_BASE . '/lib/base.php';
-
-$vars = &Horde_Variables::getDefaultVariables();
-
-/* Create upload form */
-$form = new Horde_Form($vars, _("Upload new Translation"), 'upload');
-$form->setButtons(_("Upload"));
-$form->addVariable(_("Module"), 'module', 'enum', true, false, null, array(Babel::listApps(true), true));
-$form->addVariable(_("Translations File (.PO)"), 'po_file', 'file', true, false);
-$form->addVariable('', '', 'spacer', true);
-
-/* Validate form if submitted */
-if (Horde_Util::getFormData('submitbutton') == _("Upload")) {
- if ($form->validate($vars, false)) {
- $form->getInfo($vars, $form_values);
-
- $po_module = @$form_values['module'];
- if (empty($po_module)) {
- $notification->push(_("Please select module of translations PO file!"), 'horde.error');
- } else {
- $po_file_path = @$form_values['po_file']['file'];
- $po_file_name = @$form_values['po_file']['name'];
- $po_file_size = @$form_values['po_file']['size'];
- if (empty($po_file_path) || substr($po_file_name, -3) != '.po' || $po_file_size <= 0) {
- $notification->push(_("Invalid Translations file. Please submit a valid PO file!"), 'horde.error');
- } else {
- if ($po_module == 'horde') {
- $mod = '';
- } else {
- $mod = $po_module;
- }
-
- $notification->push(sprintf(_("Upload successful for %s (%s)"), $po_module, $lang), 'horde.success');
- $cmd = "cp $po_file_path " . HORDE_BASE . "/$mod/po/$lang.po";
- system($cmd);
-
- // Redirect to page URL
- Horde::url('upload.php')->redirect();
- }
- }
- }
-}
-
-/* Render upload page */
-require BABEL_TEMPLATES . '/common-header.inc';
-echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-
-$renderer_params = array();
-$renderer = new Horde_Form_Renderer($renderer_params);
-$renderer->setAttrColumnWidth('20%');
-
-$form->renderActive($renderer, $vars, Horde::selfURL(), 'post');
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-require_once 'Horde/Lock.php';
-
-$meta_params = array(
- "Project-Id-Version" => @$_SESSION['babel']['language'],
- "Report-Msgid-Bugs-To" => "support@scopserv.com",
- "POT-Creation-Date" => "",
- "PO-Revision-Date" => "",
- "Last-Translator" => "",
- "Language-Team" => "",
- "MIME-Version" => "1.0",
- "Content-Type" => "text/plain; charset=utf-8",
- "Content-Transfer-Encoding" => "8bit",
- "Plural-Forms" => "nplurals=2; plural=(n > 1);");
-
-$app = Horde_Util::getFormData('module');
-$editmode = Horde_Util::getFormData('editmode', 0);
-$cstring = Horde_Util::getFormData('cstring');
-$page = Horde_Util::getFormData('page', 0);
-$filter = Horde_Util::getFormData('filter');
-$search = Horde_Util::getFormData('search');
-
-if ($app) {
- /* Render the page. */
- Babel::RB_init();
-}
-
-/* Render the page. */
-require BABEL_TEMPLATES . '/common-header.inc';
-
-if ($app) {
- if ($editmode) {
- Babel::RB_start(10);
- } else {
- Babel::RB_start(60);
- }
-}
-
-echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-
-$app = Horde_Util::getFormData('module');
-$show = 'edit';
-$vars = Horde_Variables::getDefaultVariables();
-
-if ($app) {
- $napp = ($app == 'horde') ? '' : $app;
- $pofile = HORDE_BASE . '/' . $napp . '/po/' . $lang . '.po';
- $po = new File_Gettext_PO();
- $po->load($pofile);
-
- // Set Scope
- $lockscope = sprintf("babel-%s-%s", $app, $lang);
-
- // Initialize Horde_Lock class
- $locks = $injector->getInstance('Horde_Lock');
-
-// $curlocks = $locks->getLocks($lockscope);
-// var_dump($curlocks);
-}
-
-//
-
-$f_cancel = Horde_Util::getFormData('cancel');
-$f_save = Horde_Util::getFormData('submit');
-
-if (($f_save || $f_cancel) && $cstring) {
- if ($curlock = $locks->getLocks(md5($cstring), $lockscope)) {
- foreach($curlock as $lid => $linfo) {
- if ($linfo['lock_scope'] == md5($cstring)) {
- $locks->clearLock($lid);
- }
- }
- }
-}
-
-if ($f_save && $cstring) {
-
- $decstr = $po->encstr[$cstring];
- $msgstr = Horde_Util::getFormData('msgstr');
- $comments = trim($po->comments[$decstr]);
-
- $phpformat = Horde_Util::getFormData('phpformat');
- $fuzzy = Horde_Util::getFormData('fuzzy');
-
- $status = $po->status[$decstr];
- foreach($status as $k => $v) {
- if ($v == 'untranslated' && !empty($msgstr)) {
- unset($status[$k]);
- }
-
- if ($v == 'php-format' && !$phpformat) {
- unset($status[$k]);
- }
-
- if ($v == 'fuzzy' && !$fuzzy) {
- unset($status[$k]);
- }
- }
-
- if (!in_array('php-format', $status) && $phpformat) {
- $status[] = 'php-format';
- }
-
- if (!in_array('fuzzy', $status) && $fuzzy) {
- $status[] = 'fuzzy';
- }
-
- $status = array_unique($status);
- $po->status[$decstr] = $status;
-
- $status = '';
- if (preg_match('/(#,.*)$/', $comments, $m)) {
- $status = $m[1];
- }
-
- if (count($po->status[$decstr])) {
- $newstatus = "#, " . implode(', ', $po->status[$decstr]);
- } else {
- $newstatus = "";
- }
-
- $newcomments = str_replace($status, $newstatus, $comments);
-
- $po->comments[$decstr] = $newcomments;
- $po->strings[$decstr] = Translate_Display::convert_string($msgstr);
- $po->save($pofile);
-}
-
-//
-
-/* Set up the template fields. */
-$template->set('menu', Babel::getMenu()->render());
-
-Horde::startBuffer();
-$notification->notify(array('listeners' => 'status'));
-$template->set('notify', Horde::endBuffer());
-
-/* Create upload form */
-$form = new Horde_Form($vars, _("View Translation"), $show);
-
-if (!$app) {
- $form->setButtons(_("View"));
- $form->addVariable(_("Module"), 'module', 'enum', true, false, null, array(Babel::listApps(), true));
- $form->addVariable('', '', 'spacer', true);
-
- $renderer_params = array();
- $renderer = new Horde_Form_Renderer($renderer_params);
- $renderer->setAttrColumnWidth('20%');
-
- $form->renderActive($renderer, $vars, Horde::selfURL(), 'post');
-} else {
-
- if (Babel::hasPermission('view', 'tabs', Horde_Perms::EDIT)) {
- $hmenu_desc = _("Edit Header");
- $url = Horde::url('edit.php');
- $url = Horde_Util::addParameter($url, array('module' => $app,
- 'url' => 'view'));
-
- $hmenu = Horde::link($url, $hmenu_desc, 'menuitem', null);
- $hmenu .= Horde::img('edit.png', null, $hmenu_desc) . ' ' . $hmenu_desc . '</a> ';
- } else {
- $hmenu = '';
- }
-
- Translate_Display::header(_("Meta Informations"), $hmenu);
- echo '<table border=0 width=100% style="border: solid 1px black" cellpadding=0 cellspacing=0>';
- $i = 0;
- foreach($po->meta as $k => $v) {
- echo '<tr><td class="control" width=30%>';
- echo $k;
- echo '</td><td class="item' . ($i++ % 2) . '">';
- echo htmlentities($v);
- echo '</td><tr>';
- }
- echo '</table>';
- Translate_Display::info();
-
- Translate_Display::header(_("Statistic"));
-
- $report = Translate::stats($app, $lang);
-
- echo '<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">';
- echo '<tr class="control">';
- echo '<td class="control" style="border-bottom: 1px solid #999;"><b>' . _("Language") . '</b></td>';
- echo '<td width="5%"><b>' . _("Locale") . '</b></td>';
- echo '<td width="15%"><b>' . _("Status") . '</b></td>';
- echo '<td valign="bottom" style="width: 80px;"><b>' . _("Translated") . '</b></td>';
- echo '<td valign="bottom" style="width: 80px;"><b>' . _("Fuzzy") . '</b></td>';
- echo '<td valign="bottom" style="width: 80px;"><b>' . _("Untranslated") . '</b></td>';
- echo '<td valign="bottom" style="width: 80px;"><b>' . _("Obsolete") . '</b></td>';
- echo '</tr>';
-
- echo "\n<tr class=\"item" . ($i++ % 2) . "\">";
- echo "\n\t<td>" . Horde_Nls::$config['languages'][$lang] . "</td>";
- echo "\n\t<td>" . $lang . "</td>";
- echo "\n\t<td>" . Translate_Display::create_bargraph(@$report[$lang][2], @$report[$lang][0]) . "</td>";
- echo "\n\t<td>" . @$report[$lang][2] . "</td>";
- echo "\n\t<td>" . @$report[$lang] [3] . "</td>";
- echo "\n\t<td>" . @$report[$lang][4] . "</td>";
- echo "\n\t<td>" . @$report[$lang][5] . "</td>";
- echo "\t</tr>";
-
- echo '</table>';
- Translate_Display::info();
-
- $filter_html = '';
- $filter_html .= '<form action="' . Horde::url('view.php') . '" method="post" name="edit" id="edit">';
- $filter_html .= '<span class="smallheader">';
- $filter_html .= Horde::img('edit.png') . ' ';
- $filter_html .= '<b>' . _("Filter: ") . '</b>';
- $filter_html .= '[ ';
- if (!$filter) {
- $hmenu_desc = '<b>' . _("All") . '</b>';
- } else {
- $hmenu_desc = _("All");
- }
- $url = Horde::url('view.php');
- $url = Horde_Util::addParameter($url, array('module' => $app));
- $filter_html .= Horde::link($url, _("Edit Mode"), 'menuitem', null). ' ' . $hmenu_desc . '</a> ';
- $filter_html .= '| ';
-
- if ($filter == 'translated') {
- $hmenu_desc = '<b>' . _("Translated") . '</b>';
- } else {
- $hmenu_desc = _("Translated");
- }
- $url = Horde::url('view.php');
- $url = Horde_Util::addParameter($url, array('module' => $app, 'filter' => 'translated'));
- $filter_html .= Horde::link($url, $hmenu_desc, 'menuitem', null). ' ' . $hmenu_desc . '</a> ';
- $filter_html .= '| ';
-
-
- if ($filter == 'fuzzy') {
- $hmenu_desc = '<b>' . _("Fuzzy") . '</b>';
- } else {
- $hmenu_desc = _("Fuzzy");
- }
- $url = Horde::url('view.php');
- $url = Horde_Util::addParameter($url, array('module' => $app, 'filter' => 'fuzzy'));
- $filter_html .= Horde::link($url, $hmenu_desc, 'menuitem', null). ' ' . $hmenu_desc . '</a> ';
- $filter_html .= '| ';
-
- if ($filter == 'untranslated') {
- $hmenu_desc = '<b>' . _("Untranslated") . '</b>';
- } else {
- $hmenu_desc = _("Untranslated");
- }
- $url = Horde::url('view.php');
- $url = Horde_Util::addParameter($url, array('module' => $app, 'filter' => 'untranslated'));
- $filter_html .= Horde::link($url, $hmenu_desc, 'menuitem', null). ' ' . $hmenu_desc . '</a> ';
- $filter_html .= '] ';
-
- $filter_html .= '<input type="hidden" name="module" value="' . $app . '">';
- $filter_html .= '<input type="hidden" name="page" value="' . $page . '">';
- $filter_html .= '<input type="hidden" name="filter" value="' . $filter . '">';
- $filter_html .= '<input type="text" name="search" value="' . $search . '">';
- $filter_html .= '<input type="submit" name="filter_btn" value="' . _("Search") . '">';
- $filter_html .= '</span>';
- $filter_html .= '</form>';
-
- $perpage = 100;
-
- foreach($po->strings as $msgid => $msgstr) {
- if ($filter && !in_array($filter, $po->status[$msgid])) {
- unset($po->strings[$msgid]);
- unset($po->status[$msgid]);
- unset($po->ref[$msgid]);
- }
- if ($search && !preg_match(';' . $search . ';i', $msgid)) {
- unset($po->strings[$msgid]);
- unset($po->status[$msgid]);
- unset($po->ref[$msgid]);
- }
- }
-
- $numitem = count($po->strings);
- // Set list min/max values
- $min = $page * $perpage;
- while ($min > $numitem) {
- $page--;
- $min = $page * $perpage;
- }
- $max = $min + $perpage;
-
- // Start start/end items (according to current page)
- $start = ($page * $perpage) + 1;
- $end = min($numitem, $start + $perpage - 1);
-
- $cntstr = 0;
-
- $pageinf = ' <span class="smallheader">[' . sprintf(_("%s to %s of %s"), $start, $end, $numitem) . ']</span>';
- Translate_Display::header(_("Translations") . $pageinf, $filter_html);
-
- foreach($po->strings as $msgid => $msgstr) {
-
- $cntstr++;
-
- if ($start && $cntstr < $start) {
- continue;
- }
-
- if ($end && $cntstr > $end) {
- break;
- }
-
- if ($filter && !in_array($filter, $po->status[$msgid])) {
- continue;
- }
-
- $encstr = base64_encode($msgid);
-
- $bgcolor = '1px #000000';
- if (in_array('fuzzy', $po->status[$msgid])) {
- $bgcolor = '3px #FFFF00';
- }
-
- if (in_array('untranslated', $po->status[$msgid])) {
- $bgcolor = '3px #FF0000';
- }
-
- $locked = false;
- if ($curlock = $locks->getLocks(md5($encstr), $lockscope)) {
- foreach($curlock as $lid => $linfo) {
- if ($linfo['lock_scope'] == md5($encstr)) {
- $bgcolor = '3px #FF00FF';
- $locked = $linfo['lock_owner'];
- }
- }
- }
-
- if ($editmode && $cstring == $encstr) {
-
- // Lock the current item for 5 minutes
- $locks->setLock($GLOBALS['registry']->getAuth(), md5($encstr), $lockscope, 300);
-
- echo '<form action="' . Horde::url('view.php') . "#" . md5($encstr) . '" method="post" name="edit" id="edit">';
- echo '<input type="hidden" name="module" value="' . $app . '">';
- echo '<input type="hidden" name="page" value="' . $page . '">';
- echo '<input type="hidden" name="filter" value="' . $filter . '">';
- echo '<input type="hidden" name="search" value="' . $search . '">';
- echo '<input type="hidden" name="cstring" value="' . $encstr . '">';
- }
-
-
- ?>
-<a name="<?php echo md5($encstr) ?>">
-<table border=0 width=100% style="border: solid <?php echo $bgcolor ?>;">
-<tr>
- <td valign=top class="control" style="height: 18px; border-bottom: 1px solid #999;"><b>MSGID</b></td>
- <td valign=top class="control" style="height: 18px; border-bottom: 1px solid #999;"><b>REFERENCES</b></td>
- <td valign=top class="control" style="height: 18px; border-bottom: 1px solid #999;"><b>STATUS</b></td>
-</tr>
-<tr><td valign=top class="item0">
- <?php echo Translate_Display::display_string($msgid) ?><br />
-</td>
-<td valign=top rowspan=3 width=30%>
-<table border=0 width=100% cellspacing=0 cellpadding=0>
-
-<?php
- $ref = array();
- foreach($po->ref[$msgid] as $k => $v) {
- if (preg_match('/(.*):(.*)/', $v, $m)) {
- $sfile = $m[1];
- $sline = $m[2];
-
- if (Babel::hasPermission('viewsource', 'tabs', Horde_Perms::EDIT)) {
- $surl = Horde::url('viewsource.php');
- $surl = Horde_Util::addParameter($surl, array('module' => $app,
- 'file' => $sfile,
- 'line' => $sline));
-
- $onclick = "viewwindow=window.open('". $surl . "', 'viewsource', 'toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=650,height=350,left=100,top=100'); if(window.focus) { viewwindow.focus()} ; return false;";
-
- $surl = Horde::link('#', $sline, null, null, $onclick);
- $surl .= $sline . '</a>';
- $surl = str_replace('&', '&', $surl);
- } else {
- $surl = $sline;
- }
-
- $ref[$sfile][] = $surl;
- }
- }
-
- $i = 0;
- foreach($ref as $k => $v) {
- echo sprintf("<tr class=item%s><td>%s</td><td align=right>[ %s ]</td></tr>", ($i++ %2), $k, implode(' | ', $v));
- }
- ?>
-</table>
-</td>
-<td valign=top rowspan=3 width=10%>
-<?php
- if ($editmode && $cstring == $encstr) {
- if (in_array('php-format', $po->status[$msgid])) {
- echo '<input type="checkbox" checked name="phpformat">' . ' php-format<br>';
- } else {
- echo '<input type="checkbox" name="phpformat">' . ' php-format<br>';
- }
- if (in_array('fuzzy', $po->status[$msgid])) {
- echo '<input type="checkbox" checked name="fuzzy">' . ' fuzzy<br>';
- } else {
- echo '<input type="checkbox" name="fuzzy">' . ' fuzzy<br>';
- }
- } else {
- echo implode('<br />', $po->status[$msgid]);
- }
- ?>
-
-</td>
-</tr>
-<tr>
- <td valign=top class="control" style="height: 18px; border-bottom: 1px solid #999;">
- <table border="0" width="100%" cellspacing="0" cellpadding="0">
- <tr>
- <td><b>MSGSTR</b></td>
- <td align="right">
-<?php
- if ($locked) {
- echo Horde::img('locked.png') . ' ' . sprintf(_("Locked by %s"), $locked);
- } else {
- if (Babel::hasPermission('view', 'tabs', Horde_Perms::EDIT)) {
- if (!$editmode || $cstring != $encstr) {
- $surl = Horde::url('view.php');
- $surl = Horde_Util::addParameter($surl, array('module' => $app, 'cstring' => $encstr, 'editmode' => 1, 'page' => $page, 'filter' => $filter, 'search' => $search));
- $surl .= "#" . md5($encstr);
-
- echo Horde::link($surl, _("Edit Translation")) . Horde::img('babel.png') . ' ' ._("Edit Translation") . "</a>";
- } elseif ($editmode && $cstring == $encstr) {
- echo '<input type="submit" class="button" name="submit" value="' . _("Save") . '">';
- echo ' ';
- echo '<input type="submit" class="button" name="cancel" value="' . _("Cancel") . '">';
- }
- }
- }
-?></td>
- </tr>
- </table>
-</tr>
-<tr><td valign=top class="item0">
-<?php
- if ($editmode && $cstring == $encstr) {
- echo '<textarea style="width:100%; height:100%" name="msgstr">' . Translate_Display::display_string($msgstr) . '</textarea><br />';
- } else {
- if (in_array('fuzzy', $po->status[$msgid]) && preg_match('/#-#-#-#-#/', $msgstr)) {
- preg_match_all('/(#-#-#-#-#\s+(.*?)\s+#-#-#-#-#(\n)*(.*))+/', Translate_Display::display_string($msgstr), $matches, PREG_SET_ORDER);
- foreach($matches as $m) {
- echo sprintf("%s - %s<br />", $m[4], $m[2]);
- }
- } else {
- echo Translate_Display::display_string($msgstr) . "<br />";
- }
- }
-?>
-</td>
-</tr>
-</table>
-<p />
-<?php
- flush();
-
- if ($editmode && $cstring == $encstr) {
- echo '</form>';
- }
-
- // print "STAT " . implode(', ', $po->status[$msgid]) . "<br>";
- }
-}
-
-?>
-<!-- START PAGER -->
-<?php if (isset($numitem) && $numitem > $perpage): ?>
-<table width="100%" class="item box">
-<tr><td>
-<?php
- $viewurl = Horde::url('view.php');
-$viewurl = Horde_Util::addParameter($viewurl, array('editmode' => $editmode,
- 'module' => $app,
- 'filter' => $filter,
- 'search' => $search));
- $pager = new Horde_Core_Ui_Pager('page', $vars, array('num' => $numitem, 'url' => $viewurl, 'page_count' => 10, 'perpage' => $perpage));
- echo $pager->render($page, $numitem, $viewurl);
-?>
-</td></tr></table>
-<?php endif; ?>
-<!-- END PAGER -->
-<?php
-if ($app) {
- Babel::RB_close();
-}
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Joel Vandal <joel@scopserv.com>
- * @package Babel
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-$app = Horde_Util::getFormData('module');
-$sfile = Horde_Util::getFormData('file');
-$sline = Horde_Util::getFormData('line');
-
-if ($app == 'horde') {
- $srcfile = realpath(sprintf("%s/%s", HORDE_BASE, $sfile));
-} else {
- $srcfile = realpath(sprintf("%s/%s/%s", HORDE_BASE, $app, $sfile));
-}
-
-if (empty($srcfile)) {
- throw new Horde_Exception(_("Missing filename!"));
-}
-
-$rpath = realpath(HORDE_BASE);
-if (!preg_match(";$rpath;", $srcfile)) {
- throw new Horde_Exception(sprintf(_("Access denied to %s"), $srcfile));
-}
-
-// Get File content
-$src = file_get_contents($srcfile);
-
-/* Render the page. */
-require BABEL_TEMPLATES . '/common-header.inc';
-
-Translate_Display::header(sprintf(_("View source: %s"), str_replace(realpath(HORDE_BASE) . '/', '', $srcfile)));
-
-printCode($src, $sline, 10);
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
-
-function printCode($code, $sline = 1, $sdiff = 10) {
- if (!is_array($code)) $code = explode("\n", $code);
-
- $count_lines = count($code);
- $r = '';
-
- $from = $sline - $sdiff;
- $to = $sline + $sdiff;
-
- foreach ($code as $line => $code_line) {
-
- if ($from && $line < $from) {
- continue;
- }
-
- if ($to && $line > $to) {
- break;
- }
-
- $r1 = ($line + 1);
-
- if (ereg("<\?(php)?[^[:graph:]]", $code_line)) {
- $r2 = highlight_string($code_line, 1)."<br />";
- } else {
- $r2 = ereg_replace("(<\?php )+", "", highlight_string("<?php ".$code_line, 1))."<br />";
- }
-
- if ($r1 == $sline) {
- $r .= sprintf('<tr><td align="right" class="control"><b>%s </b></td><td class="item0">%s</td></tr>', $r1, $r2);
- } else {
- $r .= sprintf('<tr><td align="right" class="control">%s </td><td>%s</td></tr>', $r1, $r2);
- }
- }
-
- $r = '<table width="100%" cellspacing=0>' . $r . '</table>';
-
- echo "<div class=\"code\">".$r."</div>";
-}
+++ /dev/null
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-\f
- 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.)
-\f
-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.
-\f
- 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.
-\f
- 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
+++ /dev/null
-Version 1.0
-
-Copyright 2006-2010 The Horde Project. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-2. 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.
-
-3. The end-user documentation included with the redistribution, if
-any, must include the following acknowledgment:
-
- "This product includes software developed by the Horde Project
- (http://www.horde.org/)."
-
-Alternately, this acknowledgment may appear in the software itself, if
-and wherever such third-party acknowledgments normally appear.
-
-4. The names "Horde", "The Horde Project", and "Skeleton" must not be
-used to endorse or promote products derived from this software without
-prior written permission. For written permission, please contact
-core@horde.org.
-
-5. Products derived from this software may not be called "Horde" or
-"Skeleton", nor may "Horde" or "Skeleton" appear in their name, without
-prior written permission of the Horde Project.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED 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 HORDE PROJECT OR ITS 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.
-
-This software consists of voluntary contributions made by many
-individuals on behalf of the Horde Project. For more information on
-the Horde Project, please see <http://www.horde.org/>.
+++ /dev/null
-Copyright 2006-2010 The Horde Project. 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.
-
-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 HORDE PROJECT
-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.
+++ /dev/null
-What is Crumb?
-=================
-
-.. contents:: Contents
-.. section-numbering::
-
-Crumb is a light-weight CRM application. By creating the concept of a client
-within Horde, Crumb allows a single place to manage functionality in
-several applications with data related to a client.
-
-This software is OSI Certified Open Source Software. OSI Certified is a
-certification mark of the `Open Source Initiative`_.
-
-.. _`Open Source Initiative`: http://www.opensource.org/
-
-
-Obtaining Crumb
-------------------
-
-Further information on Crumb and the latest version can be obtained at
-
- http://www.horde.org/crumb/
-
-
-Documentation
--------------
-
-The following documentation is available in the Crumb distribution:
-
-:README_: This file
-:COPYING_: Copyright and license information
-:LICENSE_: Copyright and license information
-:`docs/CHANGES`_: Changes by release
-:`docs/CREDITS`_: Project developers
-:`docs/INSTALL`_: Installation instructions and notes
-:`docs/TODO`_: Development TODO list
-:`docs/UPGRADING`_: Pointers on upgrading from previous Crumb versions
-
-
-Installation
-------------
-
-Instructions for installing Crumb can be found in the file INSTALL_ in the
-``docs/`` directory of the Crumb distribution.
-
-
-Assistance
-----------
-
-If you encounter problems with Crumb, help is available!
-
-The Horde Frequently Asked Questions List (FAQ), available on the Web at
-
- http://www.horde.org/faq/
-
-The Horde Project runs a number of mailing lists, for individual applications
-and for issues relating to the project as a whole. Information, archives, and
-subscription information can be found at
-
- http://www.horde.org/mail/
-
-Lastly, Horde developers, contributors and users also make occasional
-appearances on IRC, on the channel #horde on the freenode Network
-(irc.freenode.net).
-
-
-Licensing
----------
-
-For licensing and copyright information, please see the file COPYING_/LICENSE_
-in the Crumb distribution.
-
-Thanks,
-
-The Crumb team
-
-
-.. _README: ?f=README.html
-.. _COPYING: http://www.horde.org/licenses/gpl.php
-.. _LICENSE: http://www.horde.org/licenses/asl.php
-.. _docs/CHANGES: ?f=CHANGES.html
-.. _docs/CREDITS: ?f=CREDITS.html
-.. _INSTALL:
-.. _docs/INSTALL: ?f=INSTALL.html
-.. _docs/TODO: ?f=TODO.html
-.. _docs/UPGRADING: ?f=UPGRADING.html
+++ /dev/null
-<?php
-/**
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Ben Klang <ben@alkaloid.net>
- */
-
-@define('CRUMB_BASE', dirname(__FILE__));
-require_once CRUMB_BASE . '/lib/base.php';
-require_once 'Horde/Form.php';
-require_once 'Horde/Form/Renderer.php';
-require_once CRUMB_BASE . '/lib/Forms/AddClient.php';
-
-$vars = Horde_Variables::getDefaultVariables();
-$formname = $vars->get('formname');
-
-$addform = new Horde_Form_AddClient($vars);
-if (is_a($addform, 'PEAR_Error')) {
- Horde::logMessage($addform, 'ERR');
- $notification->push(_("An internal error has occurred. Details have been logged for the administrator."));
- $addform = null;
-}
-
-if ($addform->validate($vars)) {
-print_r($addform->getInfo());
-}
-
-$url = Horde::url('addclient.php');
-$title = _("Add New Client");
-
-require CRUMB_TEMPLATES . '/common-header.inc';
-require CRUMB_TEMPLATES . '/menu.inc';
-
-if (!empty($addform)) {
- $addform->renderActive(null, null, $url, 'post');
-}
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */
-$conf['storage']['params']['table'] = 'crumb_clients';
-$conf['storage']['params']['driverconfig'] = 'horde';
-$conf['storage']['driver'] = 'sql';
-$conf['menu']['apps'] = array();
-/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */
+++ /dev/null
-<?xml version="1.0"?>
-<!-- $Id$ -->
-<configuration>
- <configsection name="storage">
- <configheader>Storage System Settings</configheader>
- <configswitch name="driver" desc="What storage driver should we use?">sql
- <case name="sql" desc="SQL">
- <configsection name="params">
- <configsql switchname="driverconfig">
- <configstring name="table" desc="Database
- table">crumb_clients</configstring>
- </configsql>
- </configsection>
- </case>
- </configswitch>
- </configsection>
-
- <configsection name="menu">
- <configheader>Menu Settings</configheader>
- <configmultienum name="apps" desc="Select any applications that should be
- linked in Crumb's menu">
- <values>
- <configspecial name="list-horde-apps" />
- </values>
- </configmultienum>
- </configsection>
-</configuration>
+++ /dev/null
-<?php
-/**
- * $Id$
- *
- * See horde/config/prefs.php for documentation on the structure of this file.
- */
-
-$prefGroups['Sample'] = array(
- 'column' => _("Sample Prefs"),
- 'label' => _("Sample Pref"),
- 'desc' => _("Set your sample preference."),
- 'members' => array('sample')
-);
-
-$_prefs['sample'] = array(
- 'value' => '',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'text',
- 'desc' => _("This is your sample preference.")
-);
+++ /dev/null
-<?php
-/**
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Ben Klang <ben@alkaloid.net>
- */
-
-@define('CRUMB_BASE', dirname(__FILE__));
-require_once CRUMB_BASE . '/lib/base.php';
-require_once 'Horde/Form.php';
-require_once 'Horde/Form/Renderer.php';
-require_once CRUMB_BASE . '/lib/Forms/ContactSearch.php';
-
-$vars = Horde_Variables::getDefaultVariables();
-
-$searchform = new Horde_Form_ContactSearch($vars);
-
-$info = array();
-if ($searchform->validate($vars)) {
-echo "Success!";
-}
-
-$url = Horde::url(basename(__FILE__));
-$title = $searchform->getTitle();
-
-require CRUMB_TEMPLATES . '/common-header.inc';
-require CRUMB_TEMPLATES . '/menu.inc';
-
-$searchform->renderActive(null, null, $url, 'post');
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
----
-0.1
----
-
-[xyz] Initial Release
+++ /dev/null
-===========================
- Crumb Development Team
-===========================
-
-
-Core Developers
-===============
-Ben Klang <ben@alkaloid.net>
-
-
-Drivers
-=======
-
-
-
-Localization
-============
-
-===================== ======================================================
-===================== ======================================================
-
-
-Contributions
-=============
+++ /dev/null
-=========================
- Installing Crumb 1.0
-=========================
-
-.. contents:: Contents
-.. section-numbering::
-
-This document contains instructions for installing the Crumb ...
-
-For information on the capabilities and features of Crumb, see the file
-README_ in the top-level directory of the Crumb distribution.
-
-
-Obtaining Crumb
-==================
-
-Crumb can be obtained from the Horde website and FTP server, at
-
- http://www.horde.org/crumb/
-
- ftp://ftp.horde.org/pub/crumb/
-
-Or use the mirror closest to you:
-
- http://www.horde.org/mirrors.php
-
-Bleeding-edge development versions of Crumb are available via CVS; see the
-file `horde/docs/HACKING`_ in the Horde distribution, or the website
-http://www.horde.org/source/, for information on accessing the Horde CVS
-repository.
-
-
-Prerequisites
-=============
-
-To function properly, Crumb **requires** the following:
-
-1. A working Horde installation.
-
- Crumb runs within the `Horde Application Framework`_, a set of common
- tools for Web applications written in PHP. You must install Horde before
- installing Crumb.
-
- .. Important:: Crumb 1.0 requires version 3.0+ of the Horde Framework -
- earlier versions of Horde will **not** work.
-
- .. _`Horde Application Framework`: http://www.horde.org/horde/
-
- The Horde Framework can be obtained from the Horde website and FTP server,
- at
-
- http://www.horde.org/horde/
-
- ftp://ftp.horde.org/pub/horde/
-
- Many of Crumb's prerequisites are also Horde prerequisites.
-
- .. Important:: Be sure to have completed all of the steps in the
- `horde/docs/INSTALL`_ file for the Horde Framework before
- installing Crumb.
-
-2. The following PHP capabilities:
-
- a. FOO support ``--with-foo`` [OPTIONAL]
-
- Description of Foo and what it is used for.
-
-3. The following PEAR packages:
- (See `horde/docs/INSTALL`_ for instructions on installing PEAR packages)
-
- a. PEAR_Package x.x.x [OPTIONAL]
-
- Crumb uses the Foo_Bar class for...
-
-4. The following PECL modules:
- (See `horde/docs/INSTALL`_ for instructions on installing PECL modules)
-
- a. pecl_package x.x.x [OPTIONAL]
-
- pecl_package is required to...
-
-5. Something else.
-
-The following items are not required, but are strongly **recommended**:
-
-1. Yet something else.
-
-
-Installing Crumb
-===================
-
-Crumb is written in PHP, and must be installed in a web-accessible
-directory. The precise location of this directory will differ from system to
-system. Conventionally, Crumb is installed directly underneath Horde in the
-web server's document tree.
-
-Since Crumb is written in PHP, there is no compilation necessary; simply
-expand the distribution where you want it to reside and rename the root
-directory of the distribution to whatever you wish to appear in the URL. For
-example, with the Apache web server's default document root of
-``/usr/local/apache/htdocs``, you would type::
-
- cd /usr/local/apache/htdocs/horde
- tar zxvf /path/to/crumb-h3-x.y.z.tar.gz
- mv crumb-h3-x.y.z crumb
-
-and would then find Crumb at the URL::
-
- http://your-server/horde/crumb/
-
-
-Configuring Crumb
-====================
-
-1. Configuring Horde for Crumb
-
- a. Register the application
-
- In ``horde/config/registry.php``, find the ``applications['crumb']``
- stanza. The default settings here should be okay, but you can change
- them if desired. If you have changed the location of Crumb relative
- to Horde, either in the URL, in the filesystem or both, you must update
- the ``fileroot`` and ``webroot`` settings to their correct values.
-
-2. Creating the database tables
-
- The specific steps to create Crumb's database tables depend on which
- database you've chosen to use.
-
- First, look in ``scripts/sql/`` to see if a script already exists for your
- database type. If so, you should be able to simply execute that script as
- superuser in your database. (Note that executing the script as the "horde"
- user will probably fail when granting privileges.)
-
- If such a script does not exist, you'll need to build your own, using the
- file ``crumb.sql`` as a starting point. If you need assistance in
- creating database tables, you may wish to let us know on the Crumb
- mailing list.
-
- You will also need to make sure that the "horde" user in your database has
- table-creation privileges, so that the tables that `PEAR DB`_ uses to
- provide portable sequences can be created.
-
- .. _`PEAR DB`: http://pear.php.net/DB
-
-3. Configuring Crumb
-
- To configure Crumb, change to the ``config/`` directory of the installed
- distribution, and make copies of all of the configuration ``dist`` files
- without the ``dist`` suffix::
-
- cd config/
- for foo in *.dist; do cp $foo `basename $foo .dist`; done
-
- Or on Windows::
-
- copy *.dist *.
-
- Documentation on the format and purpose of those files can be found in each
- file. You may edit these files if you wish to customize Crumb's
- appearance and behavior. With one exception (``foo.php``) the defaults will
- be correct for most sites.
-
- You must login to Horde as a Horde Administrator to finish the
- configuration of Crumb. Use the Horde ``Administration`` menu item to
- get to the administration page, and then click on the ``Configuration``
- icon to get the configuration page. Select ``Crumb Name`` from the
- selection list of applications. Fill in or change any configuration values
- as needed. When done click on ``Generate Crumb Name Configuration`` to
- generate the ``conf.php`` file. If your web server doesn't have write
- permissions to the Crumb configuration directory or file, it will not be
- able to write the file. In this case, go back to ``Configuration`` and
- choose one of the other methods to create the configuration file
- ``crumb/config/conf.php``.
-
- Note for international users: Crumb uses GNU gettext to provide local
- translations of text displayed by applications; the translations are found
- in the ``po/`` directory. If a translation is not yet available for your
- locale (and you wish to create one), see the ``horde/po/README`` file, or
- if you're having trouble using a provided translation, please see the
- `horde/docs/TRANSLATIONS`_ file for instructions.
-
-4. More instructions, upgrading, securing, etc.
-
-5. Testing Crumb
-
- Once you have configured Crumb, bring up the included test page in your
- Web browser to ensure that all necessary prerequisites have been met. See
- the `horde/docs/INSTALL`_ document for further details on the Horde test
- script.
-
- The test script will also allow you to test...
-
- Next, use Crumb to.... Test at least the following:
-
- - Foo
- - Bar
-
-
-Known Problems
-==============
-
-...
-
-
-Obtaining Support
-=================
-
-If you encounter problems with Crumb, help is available!
-
-The Horde Frequently Asked Questions List (FAQ), available on the Web at
-
- http://www.horde.org/faq/
-
-The Horde Project runs a number of mailing lists, for individual applications
-and for issues relating to the project as a whole. Information, archives, and
-subscription information can be found at
-
- http://www.horde.org/mail/
-
-Lastly, Horde developers, contributors and users may also be found on IRC,
-on the channel #horde on the Freenode Network (irc.freenode.net).
-
-Please keep in mind that Crumb is free software written by volunteers.
-For information on reasonable support expectations, please read
-
- http://www.horde.org/support.php
-
-Thanks for using Crumb!
-
-The Crumb team
-
-
-.. _README: ?f=README.html
-.. _`horde/docs/HACKING`: ../../horde/docs/?f=HACKING.html
-.. _`horde/docs/INSTALL`: ../../horde/docs/?f=INSTALL.html
-.. _`horde/docs/TRANSLATIONS`: ../../horde/docs/?f=TRANSLATIONS.html
+++ /dev/null
-<?php
-/**
- * Release focus. Possible values:
- * 0 - N/A
- * 1 - Initial freshmeat announcement
- * 2 - Documentation
- * 3 - Code cleanup
- * 4 - Minor feature enhancements
- * 5 - Major feature enhancements
- * 6 - Minor bugfixes
- * 7 - Major bugfixes
- * 8 - Minor security fixes
- * 9 - Major security fixes
- */
-$this->notes['fm']['focus'] = 4;
-
-/* Mailing list release notes. */
-$this->notes['ml']['changes'] = <<<ML
-The Horde Team is pleased to announce the [first release candidate|final
-release] of the Crumb Foo Bar Application version H3 (x.x).
-
-The Crumb Foo Bar Application is a...
-
-[For alpha/beta releases:
-This is a preview version that should not be used on production systems. This
-version is considered feature complete but there might still be a few bugs.
-You should not use this preview version over existing production data.
-
-We encourage widespread testing and feedback via the mailing lists or our bug
-tracking system. Updated translations are very welcome, though some strings
-might still change before the final release.]
-
-[For release candidates:
-Barring any problems, this code will be released as Crumb H3 (x.x).
-Testing is requested and comments are encouraged.
-Updated translations would also be great.]
-
-The major changes compared to the Crumb version H3 (x.x) are:
-[or: Changes in this release:]
- * ...
-ML;
-
-/* Freshmeat release notes, not more than 600 characters. */
-$this->notes['fm']['changes'] = <<<FM
-FM;
-
-$this->notes['name'] = 'Crumb';
-$this->notes['fm']['project'] = 'crumb';
-$this->notes['fm']['branch'] = 'Default';
+++ /dev/null
-================================
- Crumb Development TODO List
-================================
-
-- Example todo
+++ /dev/null
-<?php
-/**
- * Copyright 2007-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Ben Klang <ben@alkaloid.net>
- */
-
-require dirname(__FILE__) . '/listclients.php';
+++ /dev/null
-<?php
-class Crumb_Application extends Horde_Registry_Application
-{
- public $version = 'H4 (0.1-git)';
-
- /**
- * Add additional items to the menu.
- *
- * @param Horde_Menu $menu The menu object.
- */
- public function menu($menu)
- {
- return Crumb::getMenu();
- }
-
-}
+++ /dev/null
-<?php
-
-$block_name = _("Example Block");
-
-/**
- * @package Horde_Block
- */
-class Horde_Block_Skeleton_example extends Horde_Block {
-
- var $_app = 'skeleton';
-
- function _params()
- {
- return array('color' => array('type' => 'text',
- 'name' => _("Color"),
- 'default' => '#ff0000'));
- }
-
- /**
- * The title to go in this block.
- *
- * @return string The title text.
- */
- function _title()
- {
- return _("Color");
- }
-
- /**
- * The content to go in this block.
- *
- * @return string The content
- */
- function _content()
- {
- $html = '<table width="100" height="100" bgcolor="%s">';
- $html .= '<tr><td> </td></tr>';
- $html .= '</table>';
-
- return sprintf($html, $this->_params['color']);
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Crumb Base Class.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Ben Klang <ben@alkaloid.net>
- * @package Crumb
- */
-class Crumb {
-
- /**
- * Build Crumb's list of menu items.
- */
- function getMenu()
- {
- global $conf, $registry, $browser, $print_link;
-
- $menu = new Horde_Menu(Horde_Menu::MASK_ALL);
- $menu->add(Horde::url('listclients.php'), _("List Clients"), 'user.png', Horde_Themes::img(null, 'horde'));
- $menu->add(Horde::url('addclient.php'), _("Add Client"), 'user.png', Horde_Themes::img(null, 'horde'));
-
- return $menu;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Crumb_Driver:: defines an API for implementing storage backends for
- * Crumb.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Ben Klang <ben@alkaloid.net>
- * @package Crumb
- */
-class Crumb_Driver {
-
-
- /**
- * Lists all clients.
- *
- * @return array Returns a list of all foos.
- */
- function listClients()
- {
- return $this->_listClients();
- }
-
- /**
- * Attempts to return a concrete Crumb_Driver instance based on $driver.
- *
- * @param string $driver The type of the concrete Crumb_Driver subclass
- * to return. The class name is based on the
- * storage driver ($driver). The code is
- * dynamically included.
- *
- * @param array $params A hash containing any additional configuration
- * or connection parameters a subclass might need.
- *
- * @return Crumb_Driver The newly created concrete Crumb_Driver
- * instance, or false on an error.
- */
- function factory($driver = null, $params = null)
- {
- if ($driver === null) {
- $driver = $GLOBALS['conf']['storage']['driver'];
- }
- $driver = basename($driver);
-
- if ($params === null) {
- $params = Horde::getDriverConfig('storage', $driver);
- }
-
- $class = 'Crumb_Driver_' . $driver;
- if (!class_exists($class)) {
- include dirname(__FILE__) . '/Driver/' . $driver . '.php';
- }
- if (class_exists($class)) {
- return new $class($params);
- } else {
- return false;
- }
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Crumb storage implementation for PHP's PEAR database abstraction layer.
- *
- * Required values for $params:<pre>
- * 'phptype' The database type (e.g. 'pgsql', 'mysql', etc.).
- * 'table' The name of the foo table in 'database'.
- * 'charset' The database's internal charset.</pre>
- *
- * Required by some database implementations:<pre>
- * 'database' The name of the database.
- * 'hostspec' The hostname of the database server.
- * 'protocol' The communication protocol ('tcp', 'unix', etc.).
- * 'username' The username with which to connect to the database.
- * 'password' The password associated with 'username'.
- * 'options' Additional options to pass to the database.
- * 'tty' The TTY on which to connect to the database.
- * 'port' The port on which to connect to the database.</pre>
- *
- * The table structure can be created by the scripts/sql/crumb_foo.sql
- * script.
- *
- * Copyright 2007-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Ben Klang <ben@alkaloid.net>
- * @package Crumb
- */
-class Crumb_Driver_sql extends Crumb_Driver {
-
- /**
- * Hash containing connection parameters.
- *
- * @var array
- */
- var $_params = array();
-
- /**
- * Handle for the current database connection.
- *
- * @var DB
- */
- var $_db;
-
- /**
- * Handle for the current database connection, used for writing. Defaults
- * to the same handle as $_db if a separate write database is not required.
- *
- * @var DB
- */
- var $_write_db;
-
- /**
- * Boolean indicating whether or not we're connected to the SQL server.
- *
- * @var boolean
- */
- var $_connected = false;
-
- /**
- * Constructs a new SQL storage object.
- *
- * @param array $params A hash containing connection parameters.
- */
- function Crumb_Driver_sql($params = array())
- {
- $this->_params = $params;
- }
-
- /**
- * Retrieves the list of clients from the database.
- *
- * @return boolean|PEAR_Error True on success, PEAR_Error on failure.
- */
- function _listClients()
- {
- /* Make sure we have a valid database connection. */
- $this->_connect();
-
- /* Build the SQL query. */
- $query = 'SELECT * FROM ' . $this->_params['table'];
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Crumb_Driver_sql::_listClients(): %s', $query), 'DEBUG');
-
- /* Execute the query. */
- $result = $this->_db->getAll($query, array(), DB_FETCHMODE_ASSOC);
-
- return $result;
- }
-
- /**
- * Attempts to open a persistent connection to the SQL server.
- *
- * @return boolean True on success.
- */
- function _connect()
- {
- if ($this->_connected) {
- return true;
- }
-
- $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'crumb', 'storage');
- $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'crumb', 'storage');
-
- return true;
- }
-
- /**
- * Disconnects from the SQL server and cleans up the connection.
- *
- * @return boolean True on success, false on failure.
- */
- function _disconnect()
- {
- if ($this->_connected) {
- $this->_connected = false;
- $this->_db->disconnect();
- $this->_write_db->disconnect();
- }
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Copyright 2008-2010 The Horde Project <http://www.horde.org/>
- *
- * See the enclosed file LICENSE for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- *
- * @author Ben Klang <ben@alkaloid.net>
- * @package Crumb
- */
-require_once 'Horde/Form/Action.php';
-
-class Horde_Form_AddClient extends Horde_Form
-{
- function Horde_Form_AddClient(&$vars)
- {
- parent::Horde_Form($vars, _("Add New Client"));
-
- $addOrPick = array('create' => _("Create New"),
- 'assign' => _("Assign Existing"));
-
- $action = &Horde_Form_Action::factory('reload');
-
- $select = &$this->addVariable(_("Contact Information"), 'chooseContact', 'enum', true, false, null, array($addOrPick, true));
- $select->setAction($action);
- $select->setOption('trackchange', true);
-
- if ($vars->get('chooseContact') == 'create') {
- try {
- $turbaform = $GLOBALS['registry']->call('contacts/getAddClientForm', array(&$vars));
- } catch (Horde_Exception $e) {
- Horde::logMessage($e, 'ERR');
- $notification->push(_("An internal error has occurred. Details have beenlogged for the administrator."));
- $addform = null;
- }
- $elements = $turbaform->getVariables();
- foreach ($elements as $element) {
- $this->importVariable($element);
- }
- } elseif ($vars->get('chooseContact') == 'assign') {
- require_once CRUMB_BASE . '/lib/Forms/ContactSearch.php';
- $searchform = new Horde_Form_ContactSearch($vars);
- $elements = $searchform->getVariables();
- foreach ($elements as $element) {
- $this->importVariable($element);
- }
- }
-
- $action = &Horde_Form_Action::factory('reload');
- $select = &$this->addVariable(_("Ticket Queue"), 'chooseQueue', 'enum', true, false, null, array($addOrPick, true));
- $select->setAction($action);
- $select->setOption('trackchange', true);
-
- if ($vars->get('chooseQueue') == 'create') {
- try {
- $whupsform = $GLOBALS['registry']->call('tickets/getAddQueueForm', array(&$vars));
- } catch (Horde_Exception $e) {
- Horde::logMessage($e, 'ERR');
- $notification->push(_("An internal error has occurred. Details have been logged for the administrator."));
- $addform = null;
- }
- $elements = $whupsform->getVariables();
- foreach ($elements as $element) {
- $this->importVariable($element);
- }
- } elseif ($vars->get('chooseQueue') == 'assign') {
- $queues = $GLOBALS['registry']->listQueues();
- }
-
- $action = &Horde_Form_Action::factory('reload');
- $select = &$this->addVariable(_("Group"), 'rectype', 'enum', true, false, null, array($addOrPick, true));
- $select->setAction($action);
- $select->setOption('trackchange', true);
-
- return true;
- }
-}
+++ /dev/null
-<?php
-/**
- * Copyright 2005-2007 Alkaloid Networks <http://www.alkaloid.net>
- *
- * See the enclosed file LICENSE for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- *
- * @author Ben Klang <ben@alkaloid.net>
- * @package Beatnik
- */
-class Horde_Form_ContactSearch extends Horde_Form
-{
- function Horde_Form_ContactSearch(&$vars)
- {
- parent::Horde_Form($vars, _("Search for Client Contact Record"));
-
- $this->addVariable(_("Name"), 'name', 'text', true, false, _("Enter a few characters to search for all clients whose names contain the search text"));
-
- $name = $vars->get('name');
- if (!empty($name)) {
- $results = $GLOBALS['registry']->call('contacts/searchClients', array($name));
- // We only pass one search string so there is only one element at
- // the top level of the results array.
- $results = array_pop($results);
- $contacts = array();
- foreach ($results as $contact) {
- $contacts[$contact['__uid']] = $contact['name'];
- }
- asort($contacts);
- $this->addVariable(_("Contact"), 'uid', 'radio', true, false, _("Select the matching contact record or begin a new search above"), array($contacts));
- return true;
- }
- }
-}
+++ /dev/null
-<?php
-/**
- * Crumb base application file.
- *
- * Copyright 2008-2010 The Horde Project <http://www.horde.org>
- *
- * This file brings in all of the dependencies that every Crumb script will
- * need, and sets up objects that all scripts use.
- *
- * @author Ben Klang <ben@alkaloid.net>
- */
-
-// Check for a prior definition of HORDE_BASE (perhaps by an auto_prepend_file
-// definition for site customization).
-if (!defined('HORDE_BASE')) {
- @define('HORDE_BASE', dirname(__FILE__) . '/../..');
-}
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$registry = new Horde_Registry();
-try {
- $registry->pushApp('crumb', array('logintasks' => true));
-} catch (Horde_Exception $e) {
- $registry->authenticateFailure('crumb', $e);
-}
-$conf = &$GLOBALS['conf'];
-@define('CRUMB_TEMPLATES', $registry->get('templates'));
-
-// Define the base file path of Crumb.
-@define('CRUMB_BASE', dirname(__FILE__) . '/..');
-
-// Crumb driver
-$crumb_driver = Crumb_Driver::factory();
-
-// Start output compression.
-Horde::compressOutput();
+++ /dev/null
-<?php
-/**
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Ben Klang <ben@alkaloid.net>
- */
-
-@define('CRUMB_BASE', dirname(__FILE__));
-require_once CRUMB_BASE . '/lib/base.php';
-
-$clients = $crumb_driver->listClients();
-
-$title = _("List");
-
-require CRUMB_TEMPLATES . '/common-header.inc';
-require CRUMB_TEMPLATES . '/menu.inc';
-print_r($clients);
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Horde Project
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2010-08-17 17:46+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: lib/Crumb.php:24
-msgid "Add Client"
-msgstr ""
-
-#: addclient.php:32 lib/Forms/AddClient.php:17
-msgid "Add New Client"
-msgstr ""
-
-#: addclient.php:23 lib/Forms/AddClient.php:59
-msgid ""
-"An internal error has occurred. Details have been logged for the "
-"administrator."
-msgstr ""
-
-#: lib/Forms/AddClient.php:33
-msgid ""
-"An internal error has occurred. Details have beenlogged for the "
-"administrator."
-msgstr ""
-
-#: lib/Forms/AddClient.php:20
-msgid "Assign Existing"
-msgstr ""
-
-#: lib/Block/example.php:15 lib/Block/example.php:26
-msgid "Color"
-msgstr ""
-
-#: lib/Forms/ContactSearch.php:30
-msgid "Contact"
-msgstr ""
-
-#: lib/Forms/AddClient.php:24
-msgid "Contact Information"
-msgstr ""
-
-#: lib/Forms/AddClient.php:19
-msgid "Create New"
-msgstr ""
-
-#: lib/Forms/ContactSearch.php:17
-msgid ""
-"Enter a few characters to search for all clients whose names contain the "
-"search text"
-msgstr ""
-
-#: lib/Block/example.php:3
-msgid "Example Block"
-msgstr ""
-
-#: lib/Forms/AddClient.php:71
-msgid "Group"
-msgstr ""
-
-#: listclients.php:16
-msgid "List"
-msgstr ""
-
-#: lib/Crumb.php:23
-msgid "List Clients"
-msgstr ""
-
-#: lib/Forms/ContactSearch.php:17
-msgid "Name"
-msgstr ""
-
-#: config/prefs.php.dist:10
-msgid "Sample Pref"
-msgstr ""
-
-#: config/prefs.php.dist:9
-msgid "Sample Prefs"
-msgstr ""
-
-#: lib/Forms/ContactSearch.php:15
-msgid "Search for Client Contact Record"
-msgstr ""
-
-#: lib/Forms/ContactSearch.php:30
-msgid "Select the matching contact record or begin a new search above"
-msgstr ""
-
-#: config/prefs.php.dist:11
-msgid "Set your sample preference."
-msgstr ""
-
-#: config/prefs.php.dist:20
-msgid "This is your sample preference."
-msgstr ""
-
-#: lib/Forms/AddClient.php:50
-msgid "Ticket Queue"
-msgstr ""
+++ /dev/null
-CREATE TABLE crumb_clients (
- client_id INT NOT NULL,
- turba_uid VARCHAR(255),
- whups_queue INT,
- group_id VARCHAR(255),
-
- PRIMARY KEY (client_id)
-);
-
+++ /dev/null
-<?php
-if (isset($language)) {
- header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
- header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Skeleton: Copyright 2004-2010 The Horde Project. Skeleton is under a Horde license. -->
-<!-- Horde Project: http://www.horde.org/ | Skeleton: http://www.horde.org/horde/ -->
-<!-- Horde Licenses: http://www.horde.org/licenses/ -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
- $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-<link href="<?php echo Horde_Themes::img('favicon.ico', array('nohorde' => true)) ?>" rel="SHORTCUT ICON" />
-<?php Horde_Themes::includeStylesheetFiles() ?>
-</head>
-
-<body>
+++ /dev/null
-<div id="menu">
- <?php echo Crumb::getMenu()->render() ?>
-</div>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
-<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
+++ /dev/null
-<?php
-/**
- * $Id: block.php 219 2008-01-11 09:45:33Z duck $
- *
- * Copyright Obala d.o.o. (www.obala.si)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package Folks
- */
-define('HORDE_BASE', dirname(__FILE__) . '/..');
-require_once HORDE_BASE . '/lib/base.php';
-require_once 'Horde/Loader.php';
-
-// Block to load
-$block_id = Horde_Util::getFormData('block');
-list($app, $name) = explode(':', $block_id);
-
-$block_data = array();
-$block = Horde_Block_Collection::getBlock($app, $name, Horde_Util::getFormData('defaults'));
-if ($block instanceof PEAR_Error) {
- $block_data['title'] = $block->getMessage();
- $block_data['content'] = $block->getDebugInfo();
-} else {
- $block_data['title'] = @$block->getTitle();
- if ($block_data['title'] instanceof PEAR_Error) {
- $block_data['title'] = $block_data['title']->getMessage();
- }
- $block_data['content'] = @$block->getContent();
- if ($block_data['content'] instanceof PEAR_Error) {
- $block_data['content'] = $block_data['content']->getDebugInfo();
- }
-}
-
-echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset());
+++ /dev/null
-<?php
-/**
- * $Id: index.php 220 2008-01-11 11:46:13Z duck $
- *
- * Copyright Obala d.o.o. (www.obala.si)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package Folks
- */
-require_once dirname(__FILE__) . '/../lib/base.php';
-require_once 'Horde/Loader.php';
-require_once './lib/Block/Layout/View/js.php';
-
-// Load layout from preferences.
-$layout_pref = unserialize($prefs->getValue('portal_layout'));
-if (!is_array($layout_pref)) {
- $layout_pref = array();
-}
-if (!count($layout_pref)) {
- $layout_pref = Horde_Block_Collection::getFixedBlocks();
-}
-
-// Render layout.
-$view = new Horde_Block_Layout_View_Js($layout_pref);
-$layout_html = $view->toHtml();
-
-$title = _("Edit yout profile page");
-
-Horde::addScriptFile('effects.js', 'horde');
-Horde::addScriptFile('redbox.js', 'horde');
-require HORDE_TEMPLATES . '/common-header.inc';
-require HORDE_TEMPLATES . '/menu/menu.inc';
-?>
-
-<script type="text/javascript" src="js/builder.js"></script>
-<script type="text/javascript" src="js/dragdrop.js"></script>
-<script type="text/javascript" src="js/src/portal.js"></script>
-<script type="text/javascript" src="js/src/portal_edit.js"></script>
-
-<link href="themes/screen.css" rel="stylesheet" type="text/css" />
-</head>
-
-<div id="menuBottom">
- <a href="#" onclick="listWidgets()"><?php echo _("Add content") ?></a> |
- <a href="#" onclick="alert('TODO')"><?php echo _("Reset to default") ?></a> |
- <a href="#" onclick="savePortal()"><?php echo _("Save") ?></a> |
-</div>
-<br class="clear" />
- <div id="control_buttons" style="display: none">
- <a href="#" onclick="minimizeWidget(this); return false;" id="minimize_button" title="<?php echo _("Minimize") ?>"></a>
- <a href="#" onclick="editWidget(this); return false;" id="edit_button" title="<?php echo _("Edit") ?>"></a>
- <a href="#" onclick="reloadWidget(this); return false;" id="reload_button" title="<?php echo _("Reload") ?>"></a>
- <a href="#" onclick="removeWidget(this); return false;" id="delete_button" title="<?php echo _("Delete") ?>"></a>
- </div>
-
-<?php
-
-echo $layout_html;
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-// Copyright 2006 Sébastien Gruhier (http://xilinus.com, http://itseb.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// VERSION 1.1-trunk
-
-if(typeof Draggable == 'undefined')
- throw("widget.js requires including script.aculo.us' dragdrop.js library");
-
-if(typeof Builder == 'undefined')
- throw("widget.js requires including script.aculo.us' builder.js library");
-
-// Xilinus namespace
-if(typeof Xilinus == 'undefined')
- Xilinus = {}
-
-Builder.dump();
-
-
-Xilinus.Widget = Class.create();
-Xilinus.Widget.lastId = 0;
-Xilinus.Widget.remove = function(element, options) {
- if (options && options.afterFinish)
- options.afterFinish.call();
-}
-
-Object.extend(Xilinus.Widget.prototype, {
- initialize: function(className, id) {
- className = className || "widget";
- this._id = id || ("widget_" + Xilinus.Widget.lastId++);
-
- this._titleDiv = DIV({className: 'header', id: this._getId("header")}, "");
- this._contentDiv = DIV({className: 'headerbox', id: this._getId("content")}, "");
- this._footerDiv = DIV({className: className + '_statusbar', id: this._getId("footer")}, "");
-
- var divHeader = DIV({className: 'header' }, this._titleDiv);
- var divContent = DIV({className: 'headerbox' }, this._contentDiv);
- var divFooter = DIV({className: className + '_sw' }, this._footerDiv);
-
- this._div = DIV({className: className + (className != "widget" ? " widget" : ""), id: this._getId()}, [divHeader, divContent, divFooter]);
- this._div.widget = this;
-
- return this;
- },
-
- destroy: function() {
- this._div.remove();
- },
-
- getElement: function() {
- return $(this._getId()) || $(this._div);
- },
-
- setTitle: function(title) {
- $(this._titleDiv).update(title);
- return this;
- },
-
- getTitle: function(title) {
- return $(this._titleDiv)
- },
-
- setFooter: function(title) {
- $(this._footerDiv).update(title);
- return this;
- },
-
- getFooter: function(title) {
- return $(this._footerDiv)
- },
-
- setContent: function(title) {
- $(this._contentDiv).update(title);
- return this;
- },
-
- getContent: function(title) {
- return $(this._contentDiv)
- },
-
- updateHeight: function() {
- $(this._contentDiv).setStyle({height: null})
-
- var h = $(this._contentDiv).getHeight();
- $(this._contentDiv).setStyle({height: h + "px"})
- },
-
- // PRIVATE FUNCTIONS
- _getId: function(prefix) {
- return (prefix ? prefix + "_" : "") + this._id;
- }
-});
-
-
-Xilinus.Portal = Class.create()
-Object.extend(Xilinus.Portal.prototype, {
- lastEvent: null,
- widgets: null,
- columns: null,
-
- initialize: function(columns, options) {
- this.options = Object.extend({
- url: null, // Url called by Ajax.Request after a drop
- onOverWidget: null, // Called when the mouse goes over a widget
- onOutWidget: null, // Called when the mouse goes out of a widget
- onChange: null, // Called a widget has been move during drag and drop
- onUpdate: null, // Called a widget has been move after drag and drop
- removeEffect: Xilinus.Widget.remove // Remove effect (by default no effect), you can set it to Effect.SwitchOff for example
- }, options)
- this._columns = (typeof columns == "string") ? $$(columns) : columns;
- this._widgets = new Array();
- this._columns.each(function(element) {Droppables.add(element, {onHover: this.onHover.bind(this),
- overlap: "vertical",
- accept: this.options.accept})}.bind(this));
- this._outTimer = null;
-
- // Draggable calls makePositioned for IE fix (??), I had to remove it for all browsers fix :) to handle properly zIndex
- this._columns.invoke("undoPositioned");
-
- this._currentOverWidget = null;
- this._widgetMouseOver = this.widgetMouseOver.bindAsEventListener(this);
- this._widgetMouseOut = this.widgetMouseOut.bindAsEventListener(this);
-
- Draggables.addObserver({ onEnd: this.endDrag.bind(this), onStart: this.startDrag.bind(this) });
- },
-
- add: function(widget, columnIndex, draggable) {
- draggable = typeof draggable == "undefined" ? true : draggable
- // Add to widgets list
- this._widgets.push(widget);
- if (this.options.accept)
- widget.getElement().addClassName(this.options.accept)
- // Add element to column
- this._columns[columnIndex].appendChild(widget.getElement());
- widget.updateHeight();
-
- // Make header draggable
- if (draggable) {
- widget.draggable = new Draggable(widget.getElement(),{ handle: widget._titleDiv, revert: false});
- widget.getTitle().addClassName("widget_draggable");
- }
-
- // Update columns heights
- this._updateColumnsHeight();
-
- // Add mouse observers
- if (this.options.onOverWidget)
- widget.getElement().immediateDescendants().invoke("observe", "mouseover", this._widgetMouseOver);
- if (this.options.onOutWidget)
- widget.getElement().immediateDescendants().invoke("observe", "mouseout", this._widgetMouseOut);
- },
-
- remove: function(widget) {
- // Remove from the list
- this._widgets.reject(function(w) { return w == widget});
-
- // Remove observers
- if (this.options.onOverWidget)
- widget.getElement().immediateDescendants().invoke("stopObserving", "mouseover", this._widgetMouseOver);
- if (this.options.onOutWidget)
- widget.getElement().immediateDescendants().invoke("stopObserving", "mouseout", this._widgetMouseOut);
-
- // Remove draggable
- if (widget.draggable)
- widget.draggable.destroy();
-
- // Remove from the dom
- this.options.removeEffect(widget.getElement(), {afterFinish: function() {widget.destroy();}});
-
- // Update columns heights
- this._updateColumnsHeight();
- },
-
- serialize: function() {
- parameters = ""
- this._columns.each(function(column) {
- var p = column.immediateDescendants().collect(function(element) {
- return column.id + "[]=" + element.id
- }).join("&")
- parameters += p + "&"
- });
-
- return parameters;
- },
-
- addWidgetControls: function(element) {
- $(element).observe("mouseover", this._widgetMouseOver);
- $(element).observe("mouseout", this._widgetMouseOut);
- },
-
- // EVENTS CALLBACKS
- widgetMouseOver: function(event) {
- this._clearTimer();
-
- var element = Event.element(event).up(".widget");
- if (this._currentOverWidget == null || this._currentOverWidget != element) {
- if (this._currentOverWidget && this._currentOverWidget != element)
- this.options.onOutWidget(this, this._currentOverWidget.widget)
-
- this._currentOverWidget = element;
- this.options.onOverWidget(this, element.widget)
- }
- },
-
- widgetMouseOut: function(event) {
- this._clearTimer();
- var element = Event.element(event).up(".widget");
- this._outTimer = setTimeout(this._doWidgetMouseOut.bind(this, element), 100);
- },
-
- _doWidgetMouseOut: function(element) {
- this._currentOverWidget = null;
- this.options.onOutWidget(this, element.widget)
- },
-
- // DRAGGABLE OBSERVER CALLBACKS
- startDrag: function(eventName, draggable) {
- var widget = draggable.element;
-
- if (!this._widgets.find(function(w) {return w == widget.widget}))
- return;
-
- var column = widget.parentNode;
-
- // Create and insert ghost widget
- var ghost = DIV({className: 'widget_ghost'}, "");
- $(ghost).setStyle({height: widget.getHeight() + 'px'})
-
- column.insertBefore(ghost, widget);
-
- // IE Does not absolutize properly the widget, needs to set width before
- widget.setStyle({width: widget.getWidth() + "px"});
-
- // Absolutize and move widget on body
- Position.absolutize(widget);
- document.body.appendChild(widget);
-
- // Store ghost to drag widget for later use
- draggable.element.ghost = ghost;
-
- // Store current position
- this._savePosition = this.serialize();
- },
-
- endDrag: function(eventName, draggable) {
- var widget = draggable.element;
- if (!this._widgets.find(function(w) {return w == widget.widget}))
- return;
-
- var column = widget.ghost.parentNode;
-
- column.insertBefore(draggable.element, widget.ghost);
- widget.ghost.remove();
-
- if (Prototype.Browser.Opera)
- widget.setStyle({top: 0, left: 0, width: "100%", height: widget._originalHeight, zIndex: null, opacity: null, position: "relative"})
- else
- widget.setStyle({top: null, left: null, width: null, height: widget._originalHeight, zIndex: null, opacity: null, position: "relative"})
-
- widget.ghost = null;
- widget.widget.updateHeight();
- this._updateColumnsHeight();
-
- // Fire events if changed
- if (this._savePosition != this.serialize()) {
- if (this.options.url)
- new Ajax.Request(this.options.url, {parameters: this.serialize()});
-
- if (this.options.onUpdate)
- this.options.onUpdate(this);
- }
- },
-
- onHover: function(dragWidget, dropon, overlap) {
- var offset = Position.cumulativeOffset(dropon);
- var x = offset[0] + 10;
- var y = offset[1] + (1 - overlap) * dropon.getHeight();
-
- // Check over ghost widget
- if (Position.within(dragWidget.ghost, x, y))
- return;
-
- // Find if it's overlapping a widget
- var found = false;
- var moved = false;
- for (var index = 0, len = this._widgets.length; index < len; ++index) {
- var w = this._widgets[index].getElement();
- if (w == dragWidget || w.parentNode != dropon)
- continue;
-
- if (Position.within(w, x, y)) {
- var overlap = Position.overlap( 'vertical', w);
- // Bottom of the widget
- if (overlap < 0.5) {
- // Check if the ghost widget is not already below this widget
- if (w.next() != dragWidget.ghost) {
- w.parentNode.insertBefore(dragWidget.ghost, w.next());
- moved = true;
- }
- }
- // Top of the widget
- else {
- // Check if the ghost widget is not already above this widget
- if (w.previous() != dragWidget.ghost) {
- w.parentNode.insertBefore(dragWidget.ghost, w);
- moved = true;
- }
- }
- found = true;
- break;
- }
- }
- // Not found a widget
- if (! found) {
- // Check if dropon has ghost widget
- if (dragWidget.ghost.parentNode != dropon) {
- // Get last widget bottom value
- var last = dropon.immediateDescendants().last();
- var yLast = last ? Position.cumulativeOffset(last)[1] + last.getHeight() : 0;
- if (y > yLast && last != dragWidget.ghost) {
- dropon.appendChild(dragWidget.ghost);
- moved = true;
- }
- }
- }
- if (moved && this.options.onChange)
- this.options.onChange(this)
-
- this._updateColumnsHeight();
- },
-
- // PRIVATE FUNCTIONS
- _updateColumnsHeight: function() {
- var h = 0;
- this._columns.each(function(col) {
- h = Math.max(h, col.immediateDescendants().inject(0, function(sum, element) {
- return sum + element.getHeight();
- }));
- })
- this._columns.invoke("setStyle", {height: h + 'px'})
- },
-
- _clearTimer: function() {
- if (this._outTimer) {
- clearTimeout(this._outTimer);
- this._outTimer = null;
- }
- }
-});
+++ /dev/null
-
-var _widgets_blocks = new Array();
-var _layout_params = new Array();
-
-function onOverWidget(portal, widget) {
- widget.getElement().insertBefore($('control_buttons'), widget.getElement().firstChild);
- $('control_buttons').show();
-}
-
-function onOutWidget(portal, widget) {
- $('control_buttons').hide();
-}
-
-function minimizeWidget(element) {
- var widget = $(element).up(".widget").widget;
- id = widget._getId().substr(7);
- if ($('content_widget_' + id).style.display == 'none') {
- $('content_widget_' + id).style.display = 'block';
- element.id = 'minimize_button';
- } else {
- $('content_widget_' + id).style.display = 'none';
- element.id = 'maximize_button';
- }
-}
-
-function removeWidget(element) {
- var widget = $(element).up(".widget").widget;
-
- if (confirm(confirm_remove)) {
- document.body.appendChild($('control_buttons').hide())
- portal.remove(widget);
- }
-}
-
-function listWidgets() {
-
- RedBox.loading();
-
- // load edit options
- new Ajax.Request(list_url, {
- method: 'get',
- onSuccess: function(transport) {
- RedBox.showHtml('<div id="RB_info">' + transport.responseText + '</div>');
- },
- onFailure: function(transport) {
- RedBox.close();
- }
- });
-}
-
-function addWidget() {
-
- // Add widget
- select = $('block_selection');
- title = select.options[select.selectedIndex].text;
-
- widget = new Xilinus.Widget();
- widget.setTitle(title);
- widget.setContent(title);
- portal.add(widget, parseInt($F('block_column')));
-
- _widgets_blocks[_widgets_blocks.length] = select.value;
- _layout_params[_widgets_blocks.length] = new Array();
-
- // Edit wiget
- editWidget(widget);
-
- cancelRedBox();
-}
-
-function reloadWidget(element) {
-
- if ($(element).id == 'reload_button') {
- var widget = $(element).up(".widget").widget;
- } else {
- var widget = element;
- }
-
- var id = widget._getId().substr(7);
-
- new Ajax.Request(load_url, {
- parameters: getAjaxParameters(element),
- method: 'get',
- onSuccess: function(transport) {
- block_data = transport.responseText.evalJSON(true);
- widget.setTitle(block_data['title']);
- widget.setContent(block_data['content']);
- _widgets_blocks[widget._getId().substr(7)] = block_used;
- },
- onFailure: function(transport) {
- alert('Someting gone wrong.');
- }
- });
-}
-
-function editWidget(element) {
-
- if ($(element).id == 'reload_button') {
- var widget = $(element).up(".widget").widget;
- } else {
- var widget = element;
- }
-
- new Ajax.Request(edit_url, {
- parameters: getAjaxParameters(element),
- method: 'get',
- onSuccess: function(transport) {
- RedBox.showHtml('<div id="RB_info">' + transport.responseText + '</div>');
- },
- onFailure: function(transport) {
- RedBox.close();
- }
- });
-
-}
-
-function getAjaxParameters(element) {
-
- if ($(element).id == 'reload_button' || $(element).id == 'edit_button') {
- var widget = $(element).up(".widget").widget;
- } else {
- var widget = element;
- }
-
- var id = widget._getId().substr(7);
-
- parameters = 'block=' + _widgets_blocks[id];
- parameters = parameters + '&widget=' + widget._getId();
-
- p = _layout_params[id];
- for (a in p) {
- if (typeof(p[a]) != 'string') {
- break;
- }
- parameters = parameters + '&defaults[' + a + ']=' + p[a];
- }
-
- return parameters;
-}
-
-function setParams() {
-
- widget_name = '';
- params = new Array();
- inputs = $('blockform').getElements();
- inputs.each(function(item) {
- name = item.name.substr(0, 6);
- if (name == 'params') {
- pos = item.name.indexOf(']', 7);
- param_name = item.name.substr(7, pos - 7);
- if (item.type == 'checkbox') {
- params[param_name] = item.checked;
- } else {
- params[param_name] = item.value;
- }
- }
- if (name == 'widget') {
- widget_name = item.value;
- }
- });
-
- _layout_params[widget_name.substr(7)] = params;
-
- var widget = $(widget_name).widget;
- reloadWidget(widget);
-
- cancelRedBox();
-}
-
-function noParams(widget_name, msg) {
-
- // alert(msg);
-
- var widget = $(widget_name).widget;
- reloadWidget(widget);
-
- cancelRedBox();
-}
-
-function cancelRedBox() {
- RedBox.close();
- return false;
-}
-
-function savePortal() {
-
- parameters = portal.serialize();
-
- for (var i = 0; i < _layout_params.length; i++) {
- parameters = parameters + '¶ms[' + i + '][type]=' + _widgets_blocks[i];
- p = _layout_params[i];
- for (a in p) {
- if (typeof(p[a]) != 'string') {
- break;
- }
- parameters = parameters + '¶ms[' + i + '][' + a + ']=' + p[a];
- }
- }
-
- new Ajax.Request(save_url, {
- parameters: parameters,
- method: 'post'
- });
-}
+++ /dev/null
-<?php
-/**
- * The Horde_Block_Layout_View class represents the user defined portal layout.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package Horde_Block
- */
-class Horde_Block_Layout_View_Js extends Horde_Block_Layout_View {
-
- /**
- * Render the current layout as HTML.
- *
- * @return string HTML layout.
- */
- function toHtml()
- {
- $html = '<div id="page">';
- $js = '<script type="text/javascript">' . "\n";
- $js .= 'var confirm_remove = "' . _("Are sure to remove this block?") . '";' . "\n";
- $js .= 'var edit_url = "' . Horde::url('dragdrop/params.php') . '";' . "\n";
- $js .= 'var load_url = "' . Horde::url('dragdrop/block.php') . '";' . "\n";
- $js .= 'var list_url = "' . Horde::url('dragdrop/select.php') . '";' . "\n";
- $js .= 'var save_url = "' . Horde::url('dragdrop/save.php') . '";' . "\n";
-
- $js_init = '<script type="text/javascript">'
- . ' function init() {'
- . ' portal = new Xilinus.Portal("#page div", {onOverWidget: onOverWidget, onOutWidget: onOutWidget});';
-
- $js_id = 0;
- $widget_col = 0;
- $columns = 0;
- foreach ($this->_layout as $row_num => $row) {
- foreach ($row as $col_num => $item) {
- if ($col_num > $columns) {
- $columns = $col_num;
- }
- if (is_array($item)) {
- $js .= $this->_serializeBlock($js_id, $item['app'], $item['params']['type'],
- $item['params']['params'], $js_init, $col_num);
- $js_id++;
- }
- }
- }
-
- $columns = max($columns, 2); // FOR TESTING ADD AT KEAST 3 COLUMNS
- for ($col_num = 0; $col_num <= $columns; $col_num++) {
- $html .= '<div id="widget_col_' . $col_num . '"></div>';
- }
-
- $js .= '</script>';
-
- $js_init .= 'portal.addWidgetControls("control_buttons");'
- . '}'
- . 'document.observe("dom:loaded", init);
-'
- . '</script>';
-
- $html .= '</div>' . "\n" . $js . "\n" . $js_init;
-
- // Strip any CSS <link> tags out of the returned content so
- // they can be handled seperately.
- if (preg_match_all('/<link .*?rel="stylesheet".*?\/>/', $html, $links)) {
- $html = str_replace($links[0], '', $html);
- $this->_linkTags = $links[0];
- }
-
- return $html;
- }
-
- function _serializeBlock($js_id, $app, $name, $params, &$js_init, $col_num)
- {
- $block = Horde_Block_Collection::getBlock($app, $name, $params);
- if ($block instanceof PEAR_Error) {
- $title = $block->getMessage();
- $content = $block->getDebugInfo();
- $params = array();
- } else {
- $content = @$block->getContent();
- if ($content instanceof PEAR_Error) {
- $content = $content->getDebugInfo();
- }
- $title = @$block->getTitle();
- if ($title instanceof PEAR_Error) {
- $title = $title->getMessage();
- } else {
- $title = strip_tags($title);
- }
- }
-
- $content = Horde_Serialize::serialize($content, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset());
- $title = Horde_Serialize::serialize($title, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset());
- $params = Horde_Serialize::serialize($params, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset());
-
- $js_init .= 'portal.add(new Xilinus.Widget().'
- . 'setTitle(title_' . $js_id .').'
- . ' setContent(content_' . $js_id .'), ' . $col_num . ');'
- . '_widgets_blocks[' . $js_id . '] = "' . $app . ':' . $name . '";'
- . '_layout_params[' . $js_id . '] = \'' . $params . '\'.evalJSON();'
- . 'delete title_' . $js_id .';'
- . 'delete content_' . $js_id .';' . "\n";
-
- return 'var content_' . $js_id . ' = ' . $content . ';' . "\n"
- . 'var title_' . $js_id . ' = ' . $title . ';' . "\n";
- }
-}
+++ /dev/null
-<?php
-/**
- * $Id: params.php 216 2008-01-10 19:47:31Z duck $
- *
- * Copyright Obala d.o.o. (www.obala.si)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package Folks
- */
-define('HORDE_BASE', dirname(__FILE__) . '/..');
-require_once HORDE_BASE . '/lib/base.php';
-require_once 'Horde/Loader.php';
-
-// Block to load
-$block_id = Horde_Util::getFormData('block');
-list($app, $name) = explode(':', $block_id);
-
-// Load collection
-$blocks = new Horde_Block_Collection(null, array($app));
-
-// Create block params form
-$params = $blocks->getParams($app, $name);
-if (empty($params) ||
- !$blocks->isEditable($app, $name)) {
- echo '<script type="text/javascript">noParams("' . Horde_Util::getFormData('widget') . '", "' . _("This block has no special parameters.") . '");</script>';
-} else {
- $block = &$blocks->getBlock($app, $name);
-
- $defaults = Horde_Util::getFormData('defaults');
- if (empty($defaults)) {
- foreach ($params as $key => $val) {
- $defaults[$key] = $val;
- }
- }
- if (!isset($defaults['_refresh_time'])) {
- $defaults['_refresh_time'] = 0;
- }
- require './templates/portal/params.php';
-}
+++ /dev/null
-<?php
-/**
- * $Id: block.php 219 2008-01-11 09:45:33Z duck $
- *
- * Copyright Obala d.o.o. (www.obala.si)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package Folks
- */
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-$layout = array();
-$params = Horde_Util::getPost('params');
-foreach ($_POST as $column => $rows) {
- if (substr($column, 0, 11) != 'widget_col_') {
- continue;
- }
- $col = (int)substr($column, 11);
- foreach ($rows as $row => $widget) {
- $id = (int)substr($widget, 7);
- list($app, $name) = explode(':', $params[$id]['type']);
- $layout[$row][$col] = array('app' => $app,
- 'height' => 1,
- 'width' => 1,
- 'params' => array('type' => $name,
- 'params' => $params[$id]));
- }
-}
-
-$prefs->setValue('portal_layout', serialize($layout));
+++ /dev/null
-<?php
-/**
- * $Id: select.php 215 2008-01-10 19:32:18Z duck $
- *
- * Copyright Obala d.o.o. (www.obala.si)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package Folks
- */
-define('HORDE_BASE', dirname(__FILE__) . '/..');
-require_once HORDE_BASE . '/lib/base.php';
-require_once 'Horde/Loader.php';
-
-?>
-<form>
-<select id="block_column">
-<option value="0"><?php echo _("First column") ?></option>
-<option value="1"><?php echo _("Second column") ?></option>
-<option value="2"><?php echo _("Third column") ?></option>
-</select>
-<br />
-<select id="block_selection" size="7">
-<?php
-$collection = Horde_Block_Collection::singleton();
-foreach ($collection->getBlocksList() as $id => $name) {
- echo '<option value="' . $id .'">' . $name . '</option>';
-}
-?>
-</select>
-<br />
-<input type="button" class="button" value="<?php echo _("Add") ?>" onclick="return addWidget()" />
-<input type="button" class="button" value="<?php echo _("Cancel") ?>" onclick="return cancelRedBox()" />
-</form>
+++ /dev/null
-<h1 class="header"><?php echo htmlspecialchars($blocks->getName($app, $name)) ?></h1>
-<form action="<?php echo Horde::selfUrl() ?>#block" method="post" id="blockform" name="blockform">
-<?php Horde_Util::pformInput() ?>
-<input type="hidden" name="action" value="save" />
-<input type="hidden" name="block" value="<?php echo Horde_Util::getFormData('block') ?>" />
-<input type="hidden" name="widget" value="<?php echo Horde_Util::getFormData('widget') ?>" />
-<table style="width: 100%; border-collapse: collapse;">
-<?php if ($block->updateable): ?>
-<tr>
- <td class="text rightAlign" valign="top"><?php echo Horde::label('params_refresh_time', _("Refresh rate:")) ?> </td>
- <td class="text" valign="top">
- <select id="params_refresh_time" name="params[_refresh_time]">
- <option<?php if ($defaults['_refresh_time'] == 0) echo ' selected="selected"' ?> value="0"><?php echo _("Never") ?></option>
- <option<?php if ($defaults['_refresh_time'] == 30) echo ' selected="selected"' ?> value="30"><?php echo _("Every 30 seconds") ?></option>
- <option<?php if ($defaults['_refresh_time'] == 60) echo ' selected="selected"' ?> value="60"><?php echo _("Every minute") ?></option>
- <option<?php if ($defaults['_refresh_time'] == 300) echo ' selected="selected"' ?> value="300"><?php echo _("Every 5 minutes") ?></option>
- <option<?php if ($defaults['_refresh_time'] == 900) echo ' selected="selected"' ?> value="900"><?php echo _("Every 15 minutes") ?></option>
- <option<?php if ($defaults['_refresh_time'] == 1800) echo ' selected="selected"' ?> value="1800"><?php echo _("Every half hour") ?></option>
- <option<?php if ($defaults['_refresh_time'] == 3600) echo ' selected="selected"' ?> value="3600"><?php echo _("Every hour") ?></option>
- </select>
- </td>
-</tr>
-<?php endif; ?>
-<?php $i = 0; foreach ($params as $id): $i++; ?>
- <tr>
- <td class="<?php echo ($i % 2) ? 'text' : 'item0' ?> rightAlign" valign="top"><?php echo $blocks->getParamName($app, $name, $id) ?>: </td>
- <td class="<?php echo ($i % 2) ? 'text' : 'item0' ?>" valign="top"><?php echo $blocks->getOptionsWidget($app, $name, $id, $defaults) ?></td>
- </tr>
-<?php endforeach; ?>
-<tr>
-<td class="control" colspan="2" style="text-align: center;">
-<input type="button" class="button" value="<?php echo _("Save") ?>" onclick="return setParams()" />
-<input type="button" class="button" value="<?php echo _("Cancel") ?>" onclick="return cancelRedBox()" />
-</td>
-</tr>
-</table>
-</form>
+++ /dev/null
-
-/* Redbox styles. */
-#RB_overlay {
- position: absolute;
- z-index: 100;
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- min-height: 100%;
- background-color: #000;
- opacity: .6;
- filter: alpha(opacity=60);
-}
-#RB_loading {
- z-index: 101;
- width: 66;
- margin-left: auto;
- margin-right: auto;
- margin-top: 200px;
- padding-bottom: 66px;
- text-align: center;
- background: url("graphics/redbox_spinner.gif") no-repeat bottom center;
-}
-#RB_window {
- z-index: 102;
- background-color: #fff;
- display: block;
- text-align: left;
- overflow: hidden;
- margin: 20px auto 0 auto;
- position: absolute;
-}
-
-#RB_confirm {
- width: 20em;
- padding: 1em;
- border: 1px solid #ccc;
- background: #ffc;
-}
-#RB_confirm input {
- margin: .2em;
-}
-
-#RB_info {
- width: 30em;
- padding: 1em;
- border: 1px solid #ccc;
- background: #ccf;
-}
-#RB_info input {
- margin: .2em;
-}
-
-/* Portal editing */
-
-#page {
- margin: 10px auto;
-}
-
-#page1 {
- float: left;
- width: 45%;
-}
-
-#page2 {
- float: right;
- width: 45%;
-}
-
-#widget_col_0 {
- float: left;
- width: 30%;
- background: #E6E6E6;
-}
-
-#widget_col_1 {
- width: 50%;
- float: left;
- background: #CCC;
-}
-
-#widget_col_2 {
- float: left;
- width: 20%;
- background: #B3B3B3;
-}
-
-#widget_col_3 {
- float: left;
- width: 40%;
- background: #B3B3B3;
-}
-
-#widget_col_4 {
- float: left;
- width: 60%;
- background: #E6E6E6;
-}
-
-#control_buttons {
- position: absolute;
- right: 0px;
- top: 10px;
- width: 90px;
-}
-
-#reload_button {
- position: relative;
- float: left;
- width: 16px;
- height: 16px;
- background: url(graphics/reload.png);
- behavior: url(png.htc);
- margin-right: 5px;
-}
-
-#minimize_button {
- position: relative;
- float: left;
- width: 16px;
- height: 16px;
- background: url(graphics/minus.png);
- behavior: url(png.htc);
- margin-right: 5px;
-}
-
-#maximize_button {
- position: relative;
- float: left;
- width: 16px;
- height: 16px;
- background: url(graphics/plus.png);
- behavior: url(png.htc);
- margin-right: 5px;
-}
-
-#edit_button {
- position: relative;
- float: left;
- width: 16px;
- height: 16px;
- background: url(graphics/edit.png);
- behavior: url(png.htc);
- margin-right: 5px;
-}
-
-#delete_button {
- position: relative;
- float: left;
- width: 16px;
- height: 16px;
- background: url(graphics/delete.png);
- behavior: url(png.htc);
- margin-right: 5px;
-}
-
-/* Sliding doors technique */
-.widget_nw {
- background: transparent url(graphics/top_left.gif) no-repeat;
- height: 30px;
-}
-
-.widget_w {
- border-left: 1px solid #B9B9B9;
- margin-left: 5px;
-}
-
-.widget_sw {
- background: transparent url(graphics/bottom_left.gif) no-repeat;
- height: 15px;
-}
-
-.widget_title {
- background: url(graphics/top_right.gif) repeat-x right top;
- color: #123456;
- font: bold 14px/25px Tahoma, Arial, sans-serif;
- height: 26px;
- margin: 0 0 0 15px;
- padding: 5px 0 0 0 ;
- text-align: center;
- margin-left: 15px;
-}
-
-.widget_content {
- background-color: #FDFDFD;
- color: #71777A;
- font: normal 12px/1em Tahoma, Arial, sans-serif;
- overflow: hidden;
- padding: 5px;
- border-right: 1px solid #B9B9B9;
- margin-right: 5px;
-}
-
-.widget_statusbar {
- background: transparent url(graphics/bottom_right.gif) repeat-x right top;
- font-size: 8px;
- height: 15px;
- margin-left: 11px;
-}
-
-.widget_draggable {
- cursor: move;
-}
-
-/* Ghost */
-.widget_ghost {
- background: #FFF;
- opacity: 0.5;
- filter: alpha(opacity=50);
- position: relative;
- border: 3px dashed #F00;
- margin: 0px;
- padding: 0;
-}
+++ /dev/null
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-\f
- 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.)
-\f
-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.
-\f
- 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.
-\f
- 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
+++ /dev/null
-What is Fima?
-=================
-
-.. contents:: Contents
-.. section-numbering::
-
-Fima is a double entry based ledger written in PHP and utilizing the Horde
-Application Framework.
-
-This software is OSI Certified Open Source Software. OSI Certified is a
-certification mark of the `Open Source Initiative`_.
-
-.. _`Open Source Initiative`: http://www.opensource.org/
-
-
-Obtaining Fima
-------------------
-
-Further information on Fima and the latest version can be obtained at
-
- http://www.horde.org/fima/
-
-
-Documentation
--------------
-
-The following documentation is available in the Fima distribution:
-
-:README_: This file
-:COPYING_: Copyright and license information
-:LICENSE_: Copyright and license information
-:`docs/CHANGES`_: Changes by release
-:`docs/CREDITS`_: Project developers
-:`docs/INSTALL`_: Installation instructions and notes
-:`docs/TODO`_: Development TODO list
-:`docs/UPGRADING`_: Pointers on upgrading from previous Fima versions
-
-
-Installation
-------------
-
-Instructions for installing Fima can be found in the file INSTALL_ in the
-``docs/`` directory of the Fima distribution.
-
-
-Assistance
-----------
-
-If you encounter problems with Fima, help is available!
-
-The Horde Frequently Asked Questions List (FAQ), available on the Web at
-
- http://www.horde.org/faq/
-
-The Horde Project runs a number of mailing lists, for individual applications
-and for issues relating to the project as a whole. Information, archives, and
-subscription information can be found at
-
- http://www.horde.org/mail/
-
-Lastly, Horde developers, contributors and users also make occasional
-appearances on IRC, on the channel #horde on the freenode Network
-(irc.freenode.net).
-
-
-Licensing
----------
-
-For licensing and copyright information, please see the file COPYING_/LICENSE_
-in the Fima distribution.
-
-Thanks,
-
-The Fima team
-
-
-.. _README: ?f=README.html
-.. _COPYING: http://www.horde.org/licenses/gpl.php
-.. _LICENSE: http://www.horde.org/licenses/asl.php
-.. _docs/CHANGES: ?f=CHANGES.html
-.. _docs/CREDITS: ?f=CREDITS.html
-.. _INSTALL:
-.. _docs/INSTALL: ?f=INSTALL.html
-.. _docs/TODO: ?f=TODO.html
-.. _docs/UPGRADING: ?f=UPGRADING.html
+++ /dev/null
-<?php
-/**
- * Copyright 2008 Thomas Trethan <thomas@trethan.net>
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-@define('FIMA_BASE', dirname(__FILE__));
-require_once FIMA_BASE . '/lib/base.php';
-require_once FIMA_BASE . '/lib/Forms/account.php';
-$vars = Horde_Variables::getDefaultVariables();
-
-/* Redirect to the account list if no action has been requested. */
-$actionID = $vars->get('actionID');
-if (is_null($actionID)) {
- Horde::url('accounts.php', true)->redirect();
-}
-
-/* Get ledger. */
-$ledger = Fima::getActiveLedger();
-$share = &$GLOBALS['fima_shares']->getShare($ledger);
-if (is_a($share, 'PEAR_Error')) {
- $notification->push(sprintf(_("Access denied on account: %s"), $share->getMessage()), 'horde.error');
- Horde::url('accounts.php', true)->redirect();
-}
-$ledger_name = $share->get('name');
-
-/* Run through the action handlers. */
-switch ($actionID) {
-case 'add_account':
- $vars->set('actionID', 'save_account');
-
- /* Preset account attributes regarding its parent. */
- $parent_id = $vars->get('account');
- $vars->set('parent_id', $parent_id);
- if (isset($parent_id)) {
- $account_types = Fima::getAccountTypes();
- if (isset($account_types[$parent_id])) {
- $vars->set('type', $parent_id);
- } else {
- $parent = Fima::getAccount($parent_id);
- if (!is_a($parent, 'PEAR_Error')) {
- if (Fima::getAccountParent($parent['number']) === null) {
- $accounts = Fima::listAccounts();
- $tmp = '';
- foreach ($accounts as $accountId => $account) {
- if ((int)$account['number'] >= $parent['number'] + 100) {
- break;
- }
- $tmp = $account['number'] + 1;
- }
- if (Fima::getAccountParent($tmp) == $parent['number']) {
- $vars->set('number', sprintf('%\'04d', $tmp));
- }
- }
- $vars->set('type', $parent['type']);
- }
- }
- }
- $vars->set('number_new', $vars->get('number'));
-
- $form = new Fima_AccountForm($vars, _("New Account"));
- break;
-
-case 'modify_account':
- $account_id = $vars->get('account');
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
- $notification->push(_("Access denied editing account."), 'horde.error');
- } else {
- $account = Fima::getAccount($account_id);
- if (!isset($account) || !isset($account['account_id'])) {
- $notification->push(_("Account not found."), 'horde.error');
- } else {
- $vars = new Horde_Variables($account);
- $vars->set('actionID', 'save_account');
- $vars->set('number_new', $vars->get('number'));
- $form = new Fima_AccountForm($vars, sprintf(_("Edit: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE));
- break;
- }
- }
-
- /* Return to the accounts. */
- Horde::url('accounts.php', true)->redirect();
-
-case 'save_account':
- if ($vars->get('submitbutton') == _("Delete this account")) {
- /* Redirect to the delete form. */
- $account_id = $vars->get('account_id');
- header('Location: ' . Horde_Util::addParameter(Horde::url('account.php', true), array('account' => $account_id, 'actionID' => 'delete_account'), null, false));
- exit;
- }
-
- $form = new Fima_AccountForm($vars, $vars->get('account_id') ? sprintf(_("Edit: %s"), $vars->get('name')) : _("New Account"));
- if (!$form->validate($vars)) {
- break;
- }
-
- $form->getInfo($vars, $info);
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
- $notification->push(sprintf(_("Access denied saving account to %s."), $share->get('name')), 'horde.error');
- Horde::url('accounts.php', true)->redirect();
- }
-
- $storage = &Fima_Driver::singleton($ledger);
- $info['number_new'] = sprintf('%\'04d', $info['number_new']);
-
- /* Check for existing account width provided number. */
- if ($info['number'] != $info['number_new']) {
- $existingaccount = $storage->getAccountByNumber($info['number_new']);
- if (!is_a($existingaccount, 'PEAR_Error')) {
- $notification->push(sprintf(_("The account number %s is already used by the account %s."), $info['number_new'], trim($existingaccount['number'] . ' ' . $existingaccount['name'])), 'horde.error');
- break;
- } else {
- $notification->push(sprintf(_("The account including all postings was shifted from number %s to %s."), $info['number'], $info['number_new']), 'horde.message');
- }
- }
-
- /* Check account type. */
- if (($parent_number = Fima::getAccountParent($info['number_new'])) !== null) {
- $parent = $storage->getAccountByNumber($parent_number);
- if (!is_a($parent, 'PEAR_Error')) {
- if ($info['type'] != $parent['type']) {
- $info['type'] = $parent['type'];
- $notification->push(sprintf(_("The account type was set to %s."), Fima::getAccountTypes($info['type'])), 'horde.message');
- }
- }
- }
-
- /* If an account id is set, we're modifying an existing account.
- * Otherwise, we're adding a new account with the provided
- * attributes. */
- if (!empty($info['account_id'])) {
- $result = $storage->modifyAccount($info['account_id'],
- $info['number_new'],
- $info['type'],
- $info['name'],
- $info['eo'],
- $info['desc'],
- $info['closed']);
- } else {
- $result = $storage->addAccount($info['number_new'],
- $info['type'],
- $info['name'],
- $info['eo'],
- $info['desc'],
- $info['closed']);
- }
-
- /* Check our results. */
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem saving the account: %s."), $result->getMessage()), 'horde.error');
- } else {
- $notification->push(sprintf(_("Saved %s."), trim($info['number_new'] . ' ' . $info['name'])), 'horde.success');
- /* Return to the accounts. */
- if ($vars->get('submitbutton') == _("Save and New")) {
- header('Location: ' . Horde_Util::addParameter(Horde::url('account.php', true), array('account' => $vars->get('parent_id'), 'actionID' => 'add_account'), null, false));
- exit;
- }
- Horde::url('accounts.php', true)->redirect();
- }
-
- break;
-
-case 'delete_account':
- $account_id = $vars->get('account');
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
- $notification->push(_("Access denied deleting account."), 'horde.error');
- } else {
- $account = Fima::getAccount($account_id);
- if (!isset($account) || !isset($account['account_id'])) {
- $notification->push(_("Account not found."), 'horde.error');
- } else {
- $vars = new Horde_Variables($account);
- $vars->set('actionID', 'purge_account');
- $vars->set('dssubaccounts', array('type' => 'none', 'account' => $account_id));
- $vars->set('dspostings', array('type' => 'delete', 'account' => $account_id));
- $form = new Fima_AccountDeleteForm($vars, sprintf(_("Delete: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT));
- break;
- }
- }
-
- /* Return to the accounts. */
- Horde::url('accounts.php', true)->redirect();
-
-case 'purge_account':
- if ($vars->get('submitbutton') == _("Edit this account")) {
- /* Redirect to the edit form. */
- $account_id = $vars->get('account_id');
- header('Location: ' . Horde_Util::addParameter(Horde::url('account.php', true), array('account' => $account_id, 'actionID' => 'modify_account'), null, false));
- exit;
- }
-
- $form = new Fima_AccountDeleteForm($vars, sprintf(_("Delete: %s"), trim($vars->get('number') . ' ' . $vars->get('name'))));
- if (!$form->validate($vars)) {
- break;
- }
-
- $form->getInfo($vars, $info);
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
- $notification->push(sprintf(_("Access denied deleting account from %s."), $share->get('name')), 'horde.error');
- Horde::url('accounts.php', true)->redirect();
- }
-
- $storage = &Fima_Driver::singleton($ledger);
-
- /* Delete the account. */
- $result = $storage->deleteAccount($info['account_id'], $info['dssubaccounts'], $info['dspostings']);
-
- /* Check our results. */
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem deleting the account: %s."), $result->getMessage()), 'horde.error');
- } else {
- $notification->push(sprintf(_("Deleted %s."), trim($info['number_new'] . ' ' . $info['name'])), 'horde.success');
- /* Return to the accounts. */
- Horde::url('accounts.php', true)->redirect();
- }
-
- break;
-
-default:
- Horde::url('accounts.php', true)->redirect();
-}
-
-$title = $form->getTitle();
-require FIMA_TEMPLATES . '/common-header.inc';
-require FIMA_TEMPLATES . '/menu.inc';
-$form->renderActive();
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2008 Thomas Trethan <thomas@trethan.net>
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- */
-
-@define('FIMA_BASE', dirname(__FILE__));
-require_once FIMA_BASE . '/lib/base.php';
-require_once 'Horde/Tree.php';
-
-/* Get ledger. */
-$ledger = Fima::getActiveLedger();
-$share = &$GLOBALS['fima_shares']->getShare($ledger);
-if (is_a($share, 'PEAR_Error')) {
- $notification->push(sprintf(_("Access denied on accounts: %s"), $share->getMessage()), 'horde.error');
-}
-
-/* Run through the action handlers. */
-$actionID = Horde_Util::getFormData('actionID');
-switch ($actionID) {
-case 'delete_all':
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
- $notification->push(_("Access denied deleting all accounts and postings."), 'horde.error');
- } else {
- $storage = &Fima_Driver::singleton($ledger);
-
- /* Delete all. */
- $result = $storage->deleteAll();
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem deleting all accounts and postings: %s"),
- $result->getMessage()), 'horde.error');
- } else {
- $notification->push(_("Deleted all accounts and postings."), 'horde.success');
- }
- break;
- }
-default:
- break;
-}
-
-/* Prepare account folder structure */
-$account_url = Horde::url('account.php');;
-$view_url = Horde_Util::addParameter(Horde::url('postings.php'), 'actionID', 'search_postings');
-
-$accounts = array();
-$accounts['root'] = array('account_id' => 'root', 'owner' => $ledger, 'number' => '', 'type' => 'root', 'name' => $share->get('name'), 'desc' => '', 'icon' => 'accounts.png', 'closed' => false, 'expanded' => true, 'parent_id' => null);
-
-$types = Fima::getAccountTypes();
-foreach ($types as $typeId => $typeLabel) {
- $accounts[$typeId] = array('account_id' => $typeId, 'owner' => $ledger, 'number' => '', 'type' => $typeId, 'name' => $typeLabel, 'desc' => '', 'icon' => $typeId . '.png', 'closed' => false, 'expanded' => true, 'parent_id' => 'root', 'view_link' => Horde_Util::addParameter($view_url, 'search_type', $typeId), 'add_link' => Horde_Util::addParameter($account_url, array('account' => $typeId, 'actionID' => 'add_account')));
-}
-
-/* Get accounts. */
-$accountlist = Fima::listAccounts();
-foreach ($accountlist as $accountId => $account) {
- $accounts[$accountId] = $account;
-
- $accounts[$accountId]['view_link'] = Horde_Util::addParameter($view_url, $account['type'] == FIMA_ACCOUNTTYPE_ASSET ? 'search_asset' : 'search_account', $account['account_id']);
- $account_url_account = Horde_Util::addParameter($account_url, 'account', $account['account_id']);
- $accounts[$accountId]['add_link'] = Horde_Util::addParameter($account_url_account, 'actionID', 'add_account');
- $accounts[$accountId]['edit_link'] = Horde_Util::addParameter($account_url_account, 'actionID', 'modify_account');
- $accounts[$accountId]['delete_link'] = Horde_Util::addParameter($account_url_account, 'actionID', 'delete_account');
-
- if ($account['parent_id'] !== null && isset($accounts[$account['parent_id']])) {
- unset($accounts[$accountId]['add_link']);
- } else {
- $accounts[$accountId]['parent_id'] = $account['type'];
- $accounts[$accountId]['parent_number'] = '';
- $accounts[$accountId]['parent_name'] = '';
- }
-
- $accounts[$accountId]['icon'] = $accounts[$accounts[$accountId]['parent_id']]['icon'];
- $accounts[$accountId]['closed'] = $account['closed'];
- $accounts[$accountId]['expanded'] = false;
-}
-
-/* Print. */
-$print_view = (bool)Horde_Util::getFormData('print');
-if (!$print_view) {
- $print_link = Horde::url(Horde_Util::addParameter('accounts.php', array('print' => 1)));
-}
-
-Horde::addScriptFile('tables.js', 'horde');
-$title = _("My Accounts");
-require FIMA_TEMPLATES . '/common-header.inc';
-
-if ($print_view) {
- require_once $registry->get('templates', 'horde') . '/javascript/print.js';
-} else {
- require FIMA_TEMPLATES . '/menu.inc';
-}
-
-require FIMA_TEMPLATES . '/accounts/accounts.inc';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-Deny from all
+++ /dev/null
-<?xml version="1.0"?>
-<configuration>
- <configsection name="storage">
- <configheader>Storage System Settings</configheader>
-
- <configswitch name="driver" desc="What storage driver should we use?">sql
- <case name="sql" desc="SQL">
- <configsection name="params">
- <configsql switchname="driverconfig">
- <configstring name="table_accounts" desc="Database table accounts">fima_accounts</configstring>
- <configstring name="table_postings" desc="Database table postings">fima_postings</configstring>
- </configsql>
- </configsection>
- </case>
- </configswitch>
- </configsection>
-
- <configsection name="menu">
- <configheader>Menu Settings</configheader>
- <configmultienum name="apps" desc="Select any applications that should be linked in the Fima menu">
- <values>
- <configspecial name="list-horde-apps" />
- </values>
- </configmultienum>
- </configsection>
-</configuration>
+++ /dev/null
-<?php
-/**
- * This file lets you extend Fima's menu with your own items.
- *
- * To add a new menu item, simply add a new entry to the $_menu array.
- * Valid attributes for a new menu item are:
- *
- * 'url' The URL value for the menu item.
- * 'text' The text to accompany the menu item.
- *
- * These attributes are optional:
- *
- * 'icon' The filename of an icon to use for the menu item.
- * 'icon_path' The path to the icon if it doesn't exist in the graphics/
- * directory.
- * 'target' The "target" of the link (e.g. '_top', '_blank').
- * 'onclick' Any JavaScript to execute on the "onclick" event.
- *
- * Here's an example entry:
- *
- * $_menu[] = array(
- * 'url' => 'http://www.example.com/',
- * 'text' => 'Example, Inc.',
- * 'icon' => 'example.png',
- * 'icon_path' => 'http://www.example.com/images/',
- * 'target' => '_blank',
- * 'onclick' => ''
- * );
- *
- * You can also add a "separator" (a spacer) between menu items. To add a
- * separator, simply add a new string to the $_menu array set to the text
- * 'separator'. It should look like this:
- *
- * $_menu[] = 'separator';
- */
-
-$_menu = array();
-
-/* Add your custom entries below this line. */
+++ /dev/null
-<?php
-/**
- * See horde/config/prefs.php for documentation on the structure of this file.
- */
-
-$prefGroups['share'] = array(
- 'column' => _("General Preferences"),
- 'label' => _("Active Configuration"),
- 'desc' => _("Choose your active Ledger and Posting Type."),
- 'members' => array(
- 'active_ledger', 'active_postingtype', 'closedperiodselect'
- )
-);
-
-$prefGroups['display'] = array(
- 'column' => _("General Preferences"),
- 'label' => _("Interface Preferences"),
- 'desc' => _("Change the display and input preferences."),
- 'members' => array(
- 'max_postings', 'startpage', 'sortby', 'altsortby', 'sortdir',
- 'wildcard_format', 'amount_format', 'expenses_sign', 'delete_opt',
- 'report_graphsize'
- )
-);
-
-// active ledger
-// Set locked to true if you don't want users to have multiple ledgers.
-$_prefs['active_ledger'] = array(
- 'value' => $GLOBALS['registry']->getAuth() ? $GLOBALS['registry']->getAuth() : 0
- 'type' => 'enum',
- 'shared' => true
-);
-
-// store the ledgers to diplay
-$_prefs['display_ledgers'] = array(
- 'value' => 'a:0:{}'
-);
-
-// active posting type
-$_prefs['active_postingtype'] = array(
- 'value' => FIMA_POSTINGTYPE_ACTUAL,
- 'type' => 'enum',
- 'enum' => array(
- FIMA_POSTINGTYPE_ACTUAL => _("Actual"),
- FIMA_POSTINGTYPE_FORECAST => _("Forecast"),
- FIMA_POSTINGTYPE_BUDGET => _("Budget")
- ),
- 'desc' => _("Your active posting type:")
-);
-
-// closed period selection widget
-$_prefs['closedperiodselect'] = array(
- 'type' => 'special'
-);
-
-// closed period
-$_prefs['closed_period'] = array(
- 'value' => 0
-);
-
-// postings per page
-$_prefs['max_postings'] = array(
- 'value' => 20,
- 'type' => 'number',
- 'desc' => _("Postings per page in the list view.")
-);
-
-// start page
-$_prefs['startpage'] = array(
- 'value' => -1,
- 'type' => 'enum',
- 'enum' => array(
- 1 => _("First Page"),
- -1 => _("Last Page")
- ),
- 'desc' => _("When displaying the postings, which page do you want to start on?")
-);
-
-// user preferred sorting column
-$_prefs['sortby'] = array(
- 'value' => FIMA_SORT_DATE,
- 'type' => 'enum',
- 'enum' => array(
- FIMA_SORT_DATE => _("Date"),
- FIMA_SORT_ASSET => _("Asset Account"),
- FIMA_SORT_ACCOUNT => _("Posting Account"),
- FIMA_SORT_AMOUNT => _("Amount"),
- FIMA_SORT_DESC => _("Description")
- ),
- 'desc' => _("Sort postings by:")
-);
-
-// alternate sort column
-$_prefs['altsortby'] = array(
- 'value' => FIMA_SORT_ACCOUNT,
- 'type' => 'enum',
- 'enum' => array(
- FIMA_SORT_DATE => _("Date"),
- FIMA_SORT_ASSET => _("Asset Account"),
- FIMA_SORT_ACCOUNT => _("Posting Account"),
- FIMA_SORT_AMOUNT => _("Amount"),
- FIMA_SORT_DESC => _("Description")
- ),
- 'desc' => _("Then:")
-);
-
-// user preferred sorting direction
-$_prefs['sortdir'] = array(
- 'value' => FIMA_SORT_ASCEND,
- 'type' => 'enum',
- 'enum' => array(
- FIMA_SORT_ASCEND => _("Ascending"),
- FIMA_SORT_DESCEND => _("Descending")
- ),
- 'desc' => _("Sort direction:")
-);
-
-// format for wildcards
-$_prefs['wildcard_format'] = array(
- 'value' => 'dos',
- 'type' => 'enum',
- 'enum' => array(
- 'dos' => _("DOS (* and ?)"),
- 'sql' => _("SQL (% and _)"),
- 'none' => _("none")
- ),
- 'desc' => _("Select the format for wildcards for text search:")
-);
-
-// format for amounts
-$_prefs['amount_format'] = array(
- 'value' => '.,',
- 'type' => 'enum',
- 'enum' => array(
- '.,' => _("-12.345.678,90"),
- ',.' => _("-12,345,678.90"),
- ' ,' => _("-12 345 678,90"),
- '\'.' => _("-12'345'678.90")
- ),
- 'desc' => _("Select the format for amounts:")
-);
-
-// sign for expenses
-$_prefs['expenses_sign'] = array(
- 'value' => 0,
- 'type' => 'checkbox',
- 'desc' => _("Enter expenses with negative sign?")
-);
-
-// preference for delete confirmation dialog.
-$_prefs['delete_opt'] = array(
- 'value' => 1,
- 'type' => 'checkbox',
- 'desc' => _("Do you want to confirm deleting postings?")
-);
-
-// report graph size
-$_prefs['report_graphsize'] = array(
- 'value' => '800x600',
- 'type' => 'enum',
- 'enum' => array(
- '400x300' => _("400 x 300 Pixel"),
- '800x600' => _("800 x 600 Pixel"),
- '1024x768' => _("1024 x 768 Pixel"),
- '1600x1200' => _("1600 x 1200 Pixel")
- ),
- 'desc' => _("Select the canvas size for chart reports:")
-);
+++ /dev/null
-<?php
-/**
- * This file will defines the set of existing reports.
- * Reports are located in fima/lib/Report/.
- */
-
-$_reports = array('GeneralOverview' => _("General Overview"),
- 'PeriodOverview' => _("Period Overview"),
- 'AccountOverview' => _("Account Overview"),
- 'AssetOverview' => _("Asset Overview"),
- 'Analysis' => _("Analysis"),
- 'Trend' => _("Trend"),
- );
+++ /dev/null
-<?php
-/**
- * Copyright 2008 Thomas Trethan <thomas@trethan.net>
- *
- * See the enclosed file LICENSE for license information (ASL). If you
- * did not receive this file, see http://www.horde.org/licenses/asl.php.
- */
-
-function _cleanupData()
-{
- $GLOBALS['import_step'] = 1;
- return Horde_Data::IMPORT_FILE;
-}
-
-@define('FIMA_BASE', dirname(__FILE__));
-require_once FIMA_BASE . '/lib/base.php';
-
-$ledger = Fima::getActiveLedger();
-
-/* Importable file types. */
-$file_types = array('csv' => _("CSV"),
- 'tsv' => _("TSV"));
-
-/* Templates for the different import steps. */
-$templates = array(
- Horde_Data::IMPORT_CSV => array($registry->get('templates', 'horde') . '/data/csvinfo.inc'),
- Horde_Data::IMPORT_TSV => array($registry->get('templates', 'horde') . '/data/tsvinfo.inc'),
- Horde_Data::IMPORT_MAPPED => array($registry->get('templates', 'horde') . '/data/csvmap.inc'),
- Horde_Data::IMPORT_DATETIME => array($registry->get('templates', 'horde') . '/data/datemap.inc'),
- Horde_Data::IMPORT_FILE => array(FIMA_TEMPLATES . '/data/import.inc', FIMA_TEMPLATES . '/data/export.inc'),
-);
-
-/* Field/clear name mapping. */
-$app_fields = array('date' => _("Date"),
- 'asset' => _("Asset Account"),
- 'account' => _("Account"),
- 'desc' => _("Description"),
- 'amount' => _("Amount"),
- 'eo' => _("e.o."));
-
-/* Date/time fields. */
-$time_fields = array('date' => 'date');
-
-/* Initial values. */
-$param = array('time_fields' => $time_fields,
- 'file_types' => $file_types);
-$import_format = Horde_Util::getFormData('import_format', '');
-$import_step = Horde_Util::getFormData('import_step', 0) + 1;
-$next_step = Horde_Data::IMPORT_FILE;
-$actionID = Horde_Util::getFormData('actionID');
-$error = false;
-
-/* Loop through the action handlers. */
-switch ($actionID) {
-case 'export':
- $data = array();
-
- /* Create a Fima storage instance. */
- $storage = &Fima_Driver::singleton($ledger);
- if (is_a($storage, 'PEAR_Error')) {
- $notification->push(sprintf(_("Failed to access the ledger: %s"), $storage->getMessage()), 'horde.error');
- $error = true;
- break;
- }
- $params = $storage->getParams();
-
- $filters = array(array('type', $prefs->getValue('active_postingtype')));
-
- /* Get accounts and postings. */
- $accounts = Fima::listAccounts();
- $postings = Fima::listPostings($filters);
-
- foreach ($postings as $postingId => $posting) {
- $row = array();
- foreach ($posting as $key => $value) {
- switch ($key) {
- case 'date':
- $row[$key] = strftime(Fima::convertDateFormat($prefs->getValue('date_format')), $value);
- break;
- case 'asset':
- case 'account':
- $row[$key] = isset($accounts[$value]) ? $accounts[$value]['number'] : '';
- break;
- case 'amount':
- $row[$key] = Fima::convertValueToAmount($value);
- break;
- case 'eo':
- case 'desc':
- $row[$key] = Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $params['charset']);
- break;
- default:
- break;
- }
- }
- $data[] = $row;
- }
-
- if (!count($data)) {
- $notification->push(_("There were no postings to export."), 'horde.message');
- $error = true;
- break;
- }
-
- switch (Horde_Util::getFormData('exportID')) {
- case EXPORT_CSV:
- $injector->getInstance('Horde_Data')->getData('Csv', array('cleanup' => '_cleanupData'))->exportFile(_("postings.csv"), $data, true);
- exit;
-
- case EXPORT_TSV:
- $injector->getInstance('Horde_Data')->getData('Tsv', array('cleanup' => '_cleanupData'))->exportFile(_("postings.tsv"), $data, true);
- exit;
- }
- break;
-
-case Horde_Data::IMPORT_FILE:
- $storage = &Fima_Driver::singleton($ledger);
- if (is_a($storage, 'PEAR_Error')) {
- $notification->push(sprintf(_("Failed to access the ledger: %s"), $storage->getMessage()), 'horde.error');
- $error = true;
- break;
- }
-
- $_SESSION['import_data']['target'] = $ledger;
- $_SESSION['import_data']['purge'] = Horde_Util::getFormData('purge');
- break;
-}
-
-if (!$error) {
- try {
- $data = $injector->getInstance('Horde_Data')->getData($import_format, array('cleanup' => '_cleanupData'));
- $next_step = $data->nextStep($actionID, $param);
- } catch (Horde_Data_Exception $e) {
- if ($data) {
- $notification->push($e, 'horde.error');
- $next_step = $data->cleanup();
- } else {
- $notification->push(_("This file format is not supported."), 'horde.error');
- $next_step = Horde_Data::IMPORT_FILE;
- }
- }
-}
-
-/* We have a final result set. */
-if (is_array($next_step)) {
- /* Create a Fima storage instance. */
- $storage = &Fima_Driver::singleton($ledger);
- if (is_a($storage, 'PEAR_Error')) {
- $notification->push(sprintf(_("Failed to access the ledger: %s"), $storage->getMessage()), 'horde.error');
- }
-
- $params = $storage->getParams();
-
- /* Purge old postings if requested. */
- if ($_SESSION['import_data']['purge']) {
- $result = $storage->deleteAll(false, $prefs->getValue('active_postingtype'));
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("The postings could not be purged: %s"), $result->getMessage()), 'horde.error');
- } else {
- $notification->push(_("Postings successfully purged."), 'horde.success');
- }
- }
-
- /* Get accounts and postings. */
- $accounts = Fima::listAccounts();
- $accounts_indices = array();
- foreach ($accounts as $account) {
- $accounts_indices[$account['number']] = $account['account_id'];
- }
-
- foreach ($next_step as $row) {
- $row['type'] = $prefs->getValue('active_postingtype');
- $row['asset'] = sprintf('%\'04d', $row['asset']);
- $row['asset'] = isset($accounts_indices[$row['asset']]) ? $accounts_indices[$row['asset']] : null;
- $row['account'] = sprintf('%\'04d', $row['account']);
- $row['account'] = isset($accounts_indices[$row['account']]) ? $accounts_indices[$row['account']] : null;
- $row['date'] = Fima::convertDateToStamp($row['date'], Fima::convertDateFormat($prefs->getValue('date_format')));
- $row['amount'] = Fima::convertAmountToValue($row['amount']);
- if ($prefs->getValue('expenses_sign') == 0) {
- if ($row['account'] !== null) {
- if ($accounts[$row['account']]['type'] == FIMA_ACCOUNTTYPE_EXPENSE) {
- $row['amount'] *= -1;
- }
- } else {
- $row['amount'] *= -1;
- }
- }
- $row['desc'] = isset($row['desc']) ? trim($row['desc']) : '';
- $row['eo'] = isset($row['eo']) ? (bool)trim($row['eo']) : false;
- $result = $storage->addPosting($row['type'], $row['date'], $row['asset'], $row['account'], $row['eo'], $row['amount'], $row['desc']);
- if (is_a($result, 'PEAR_Error')) {
- break;
- }
- }
-
- if (!count($next_step)) {
- $notification->push(sprintf(_("The %s file didn't contain any postings."),
- $file_types[$_SESSION['import_data']['format']]), 'horde.error');
- } else {
- $notification->push(sprintf(_("%s successfully imported"),
- $file_types[$_SESSION['import_data']['format']]), 'horde.success');
- }
- $next_step = $data->cleanup();
-}
-
-$title = _("Import/Export Postings");
-require FIMA_TEMPLATES . '/common-header.inc';
-require FIMA_TEMPLATES . '/menu.inc';
-
-if ($next_step == Horde_Data::IMPORT_FILE) {
- /* Build the charset options. */
- $charsets = $registry->nlsconfig['encodings'];
- asort($charsets);
- $all_charsets = $registry->nlsconfig['charsets'];
- natcasesort($all_charsets);
- foreach ($all_charsets as $charset) {
- if (!isset($charsets[$charset])) {
- $charsets[$charset] = $charset;
- }
- }
- $my_charset = $GLOBALS['registry']->getCharset(true);
-}
-
-foreach ($templates[$next_step] as $template) {
- require $template;
- echo '<br />';
-}
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
----
-v1.1
----
-
-[trt] Close accounts.
-[trt] Hide null rows in reports.
-
----
-v1.0
----
-
-[trt] Initial Release.
+++ /dev/null
-===========================
- Fima Development Team
-===========================
-
-
-Core Developers
-===============
-
-- Thomas Trethan <thomas@trethan.net>
-
-
-Localization
-============
-
-===================== ======================================================
-German Thomas Trethan <thomas@trethan.net>
- Gerhard Trethan
-===================== ======================================================
-
-
-Contributions
-=============
-
-- Gerhard Trethan, who inspired and supported the work on fima and had
- programmed the basis of fima a while ago, a double entry based ledger in
- visual basic.
+++ /dev/null
-=========================
- Installing Fima 1.0
-=========================
-
-.. contents:: Contents
-.. section-numbering::
-
-This document contains instructions for installing Fima.
-
-For information on the capabilities and features of Skeleton, see the file
-README_ in the top-level directory of the Skeleton distribution.
-
-
-Obtaining Fima
-==================
-
-Fima can be obtained from the Horde website and FTP server, at
-
- http://www.horde.org/fima/
-
- ftp://ftp.horde.org/pub/fima/
-
-Or use the mirror closest to you:
-
- http://www.horde.org/mirrors.php
-
-Bleeding-edge development versions of Fima are available via CVS; see the
-file `horde/docs/HACKING`_ in the Horde distribution, or the website
-http://www.horde.org/source/, for information on accessing the Horde CVS
-repository.
-
-
-Prerequisites
-=============
-
-To function properly, Fima **requires** the following:
-
-1. A working Horde installation.
-
- Fima runs within the `Horde Application Framework`_, a set of common
- tools for Web applications written in PHP. You must install Horde before
- installing Fima.
-
- .. Important:: Fima 1.0 requires version 3.0+ of the Horde Framework -
- earlier versions of Horde will **not** work.
-
- .. _`Horde Application Framework`: http://www.horde.org/horde/
-
- The Horde Framework can be obtained from the Horde website and FTP server,
- at
-
- http://www.horde.org/horde/
-
- ftp://ftp.horde.org/pub/horde/
-
- Many of Fima's prerequisites are also Horde prerequisites.
-
- .. Important:: Be sure to have completed all of the steps in the
- `horde/docs/INSTALL`_ file for the Horde Framework before
- installing Fima.
-
-2. The following PEAR packages:
- (See `horde/docs/INSTALL`_ for instructions on installing PEAR packages)
-
- a. Image_Graph 0.7.2 [OPTIONAL]
-
- Fima uses the Image_Graph package for creating graphical reports.
-
-3. SQL support.
-
- Fima will store its data in an SQL database. Build PHP with whichever
- SQL driver you require; see the Horde INSTALL_ file for details.
-
-
-Installing Fima
-===================
-
-Fima is written in PHP, and must be installed in a web-accessible
-directory. The precise location of this directory will differ from system to
-system. Conventionally, Fima is installed directly underneath Horde in the
-web server's document tree.
-
-Since Fima is written in PHP, there is no compilation necessary; simply
-expand the distribution where you want it to reside and rename the root
-directory of the distribution to whatever you wish to appear in the URL. For
-example, with the Apache web server's default document root of
-``/usr/local/apache/htdocs``, you would type::
-
- cd /usr/local/apache/htdocs/horde
- tar zxvf /path/to/fima-h3-x.y.z.tar.gz
- mv fima-h3-x.y.z fima
-
-and would then find Fima at the URL::
-
- http://your-server/horde/fima/
-
-
-Configuring Fima
-====================
-
-1. Configuring Horde for Fima
-
- a. Register the application
-
- In ``horde/config/registry.php``, find the ``applications['fima']``
- stanza. The default settings here should be okay, but you can change
- them if desired. If you have changed the location of Fima relative
- to Horde, either in the URL, in the filesystem or both, you must update
- the ``fileroot`` and ``webroot`` settings to their correct values.
-
-2. Creating the database tables
-
- The specific steps to create Fima's database tables depend on which
- database you've chosen to use.
-
- First, look in ``scripts/sql/`` to see if a script already exists for your
- database type. If so, you should be able to simply execute that script as
- superuser in your database. (Note that executing the script as the "horde"
- user will probably fail when granting privileges.)
-
- If such a script does not exist, you'll need to build your own, using the
- file ``fima.sql`` as a starting point. If you need assistance in
- creating database tables, you may wish to let us know on the Fima
- mailing list.
-
- You will also need to make sure that the "horde" user in your database has
- table-creation privileges, so that the tables that `PEAR DB`_ uses to
- provide portable sequences can be created.
-
- .. _`PEAR DB`: http://pear.php.net/DB
-
-3. Configuring Fima
-
- To configure Fima, change to the ``config/`` directory of the installed
- distribution, and make copies of all of the configuration ``dist`` files
- without the ``dist`` suffix::
-
- cd config/
- for foo in *.dist; do cp $foo `basename $foo .dist`; done
-
- Or on Windows::
-
- copy *.dist *.
-
- Documentation on the format and purpose of those files can be found in each
- file. You may edit these files if you wish to customize Fima's
- appearance and behavior. With one exception (``foo.php``) the defaults will
- be correct for most sites.
-
- You must login to Horde as a Horde Administrator to finish the
- configuration of Fima. Use the Horde ``Administration`` menu item to
- get to the administration page, and then click on the ``Configuration``
- icon to get the configuration page. Select ``Fima Name`` from the
- selection list of applications. Fill in or change any configuration values
- as needed. When done click on ``Generate Fima Name Configuration`` to
- generate the ``conf.php`` file. If your web server doesn't have write
- permissions to the Fima configuration directory or file, it will not be
- able to write the file. In this case, go back to ``Configuration`` and
- choose one of the other methods to create the configuration file
- ``fima/config/conf.php``.
-
- Note for international users: Fima uses GNU gettext to provide local
- translations of text displayed by applications; the translations are found
- in the ``po/`` directory. If a translation is not yet available for your
- locale (and you wish to create one), see the ``horde/po/README`` file, or
- if you're having trouble using a provided translation, please see the
- `horde/docs/TRANSLATIONS`_ file for instructions.
-
-4. More instructions, upgrading, securing, etc.
-
-5. Testing Fima
-
- Once you have configured Fima, bring up the included test page in your
- Web browser to ensure that all necessary prerequisites have been met. See
- the `horde/docs/INSTALL`_ document for further details on the Horde test
- script.
-
- Test at least the following:
-
- - Creating a new account
- - Modifying an account
- - Deleting an account
- - Creating a new posting
- - Modifying a posting
- - Delete a posting
-
-
-Known Problems
-==============
-
-None yet.
-
-
-Obtaining Support
-=================
-
-If you encounter problems with Fima, help is available!
-
-The Horde Frequently Asked Questions List (FAQ), available on the Web at
-
- http://www.horde.org/faq/
-
-The Horde Project runs a number of mailing lists, for individual applications
-and for issues relating to the project as a whole. Information, archives, and
-subscription information can be found at
-
- http://www.horde.org/mail/
-
-Lastly, Horde developers, contributors and users may also be found on IRC,
-on the channel #horde on the Freenode Network (irc.freenode.net).
-
-Please keep in mind that Fima is free software written by volunteers.
-For information on reasonable support expectations, please read
-
- http://www.horde.org/support.php
-
-Thanks for using Fima!
-
-The Fima team
-
-
-.. _README: ?f=README.html
-.. _`horde/docs/HACKING`: ../../horde/docs/?f=HACKING.html
-.. _`horde/docs/INSTALL`: ../../horde/docs/?f=INSTALL.html
-.. _`horde/docs/TRANSLATIONS`: ../../horde/docs/?f=TRANSLATIONS.html
+++ /dev/null
-<?php
-/**
- * Release focus. Possible values:
- * 0 - N/A
- * 1 - Initial freshmeat announcement
- * 2 - Documentation
- * 3 - Code cleanup
- * 4 - Minor feature enhancements
- * 5 - Major feature enhancements
- * 6 - Minor bugfixes
- * 7 - Major bugfixes
- * 8 - Minor security fixes
- * 9 - Major security fixes
- */
-$this->notes['fm']['focus'] = 0;
-
-/* Mailing list release notes. */
-$this->notes['ml']['changes'] = <<<ML
-The Horde Team is pleased to announce the first release candidate
-of the Fima Application version H3 (1.0).
-
-Fima is a double entry based ledger written in PHP and utilizing the Horde
-Application Framework.
-
-Barring any problems, this code will be released as Skeleton H3 (x.x).
-Testing is requested and comments are encouraged.
-Updated translations would also be great.
-
-ML;
-
-/* Freshmeat release notes, not more than 600 characters. */
-$this->notes['fm']['changes'] = <<<FM
-FM;
-
-$this->notes['name'] = 'Fima';
-$this->notes['fm']['project'] = 'fima';
-$this->notes['fm']['branch'] = 'Default';
+++ /dev/null
-================================
- Fima Development TODO List
-================================
-
-- fix search with umlaute
-- drill down in reports
-- shift all postings from an account or only selected
-- simplified entering of budget/forecast values analog to report Account Overview
-- after selecting asset account immediately show result
+++ /dev/null
-<?php
-/**
- * Copyright 2008 Thomas Trethan <thomas@trethan.net>
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- */
-
-require dirname(__FILE__) . '/postings.php';
+++ /dev/null
-<?php
-/**
- * Copyright 2002-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-@define('FIMA_BASE', dirname(dirname(__FILE__)));
-require_once FIMA_BASE . '/lib/base.php';
-require_once FIMA_BASE . '/lib/Forms/CreateLedger.php';
-
-// Exit if this isn't an authenticated user or if the user can't
-// create new task lists (default share is locked).
-if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('active_ledger')) {
- Horde::url('postings.php', true)->redirect();
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$form = new Fima_CreateLedgerForm($vars);
-
-// Execute if the form is valid.
-if ($form->validate($vars)) {
- $result = $form->execute();
- if (is_a($result, 'PEAR_Error')) {
- $notification->push($result, 'horde.error');
- } else {
- $notification->push(sprintf(_("The ledger \"%s\" has been created."), $vars->get('name')), 'horde.success');
- }
-
- Horde::url('ledgers/', true)->redirect();
-}
-
-$title = $form->getTitle();
-require FIMA_TEMPLATES . '/common-header.inc';
-require FIMA_TEMPLATES . '/menu.inc';
-echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2002-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-@define('FIMA_BASE', dirname(dirname(__FILE__)));
-require_once FIMA_BASE . '/lib/base.php';
-require_once FIMA_BASE . '/lib/Forms/DeleteLedger.php';
-
-// Exit if this isn't an authenticated user.
-if (!$GLOBALS['registry']->getAuth()) {
- Horde::url('postings.php', true)->redirect();
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$ledger_id = $vars->get('l');
-if ($ledger_id == $GLOBALS['registry']->getAuth()) {
- $notification->push(_("This ledger cannot be deleted."), 'horde.warning');
- Horde::url('ledgers/', true)->redirect();
-}
-
-$ledger = $fima_shares->getShare($ledger_id);
-if (is_a($ledger, 'PEAR_Error')) {
- $notification->push($ledger, 'horde.error');
- Horde::url('ledgers/', true)->redirect();
-}
-if ($ledger->get('owner') != $GLOBALS['registry']->getAuth()) {
- $notification->push(_("You are not allowed to delete this ledger."), 'horde.error');
- Horde::url('ledgers/', true)->redirect();
-}
-
-$form = new Fima_DeleteLedgerForm($vars, $ledger);
-
-// Execute if the form is valid (must pass with POST variables only).
-if ($form->validate(new Horde_Variables($_POST))) {
- $result = $form->execute();
- if (is_a($result, 'PEAR_Error')) {
- $notification->push($result, 'horde.error');
- } elseif ($result) {
- $notification->push(sprintf(_("The ledger \"%s\" has been deleted."), $ledger->get('name')), 'horde.success');
- }
-
- Horde::url('ledgers/', true)->redirect();
-}
-
-$title = $form->getTitle();
-require FIMA_TEMPLATES . '/common-header.inc';
-require FIMA_TEMPLATES . '/menu.inc';
-echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2002-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-@define('FIMA_BASE', dirname(dirname(__FILE__)));
-require_once FIMA_BASE . '/lib/base.php';
-require_once FIMA_BASE . '/lib/Forms/EditLedger.php';
-
-// Exit if this isn't an authenticated user.
-if (!$GLOBALS['registry']->getAuth()) {
- Horde::url('postings.php', true)->redirect();
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$ledger = $fima_shares->getShare($vars->get('l'));
-if (is_a($ledger, 'PEAR_Error')) {
- $notification->push($ledger, 'horde.error');
- Horde::url('ledgers/', true)->redirect();
-}
-if ($ledger->get('owner') != $GLOBALS['registry']->getAuth()) {
- $notification->push(_("You are not allowed to change this ledger."), 'horde.error');
- Horde::url('ledgers/', true)->redirect();
-}
-$form = new Fima_EditLedgerForm($vars, $ledger);
-
-// Execute if the form is valid.
-if ($form->validate($vars)) {
- $original_name = $ledger->get('name');
- $result = $form->execute();
- if (is_a($result, 'PEAR_Error')) {
- $notification->push($result, 'horde.error');
- } else {
- if ($ledger->get('name') != $original_name) {
- $notification->push(sprintf(_("The ledger \"%s\" has been renamed to \"%s\"."), $original_name, $ledger->get('name')), 'horde.success');
- } else {
- $notification->push(sprintf(_("The ledger \"%s\" has been saved."), $original_name), 'horde.success');
- }
- }
-
- Horde::url('ledgers/', true)->redirect();
-}
-
-$vars->set('name', $ledger->get('name'));
-$vars->set('description', $ledger->get('desc'));
-$title = $form->getTitle();
-require FIMA_TEMPLATES . '/common-header.inc';
-require FIMA_TEMPLATES . '/menu.inc';
-echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2001-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file LICENSE for license information (ASL). If you
- * did not receive this file, see http://www.horde.org/licenses/asl.php.
- */
-
-@define('FIMA_BASE', dirname(dirname(__FILE__)));
-require_once FIMA_BASE . '/lib/base.php';
-
-/* Exit if this isn't an authenticated user. */
-if (!$GLOBALS['registry']->getAuth()) {
- require FIMA_BASE . '/postings.php';
- exit;
-}
-
-$edit_url_base = Horde::url('ledgers/edit.php');
-$perms_url_base = Horde::url($registry->get('webroot', 'horde') . '/services/shares/edit.php?app=fima', true);
-$delete_url_base = Horde::url('ledgers/delete.php');
-
-// Get the shares owned by the current user, and figure out what we will
-// display the share name as to the user.
-$ledgers = Fima::listLedgers(true);
-$sorted_ledgers = array();
-foreach ($ledgers as $ledger) {
- $sorted_ledgers[$ledger->getName()] = $ledger->get('name');
-}
-asort($sorted_ledgers);
-
-$browse_img = Horde::img('accounts.png', _("Ledger"));
-$edit_img = Horde::img('edit.png', _("Edit"));
-$perms_img = Horde::img('perms.png', _("Change Permissions"));
-$delete_img = Horde::img('delete.png', _("Delete"));
-
-Horde::addScriptFile('tables.js', 'horde');
-$title = _("Manage Ledgers");
-require FIMA_TEMPLATES . '/common-header.inc';
-require FIMA_TEMPLATES . '/menu.inc';
-require FIMA_TEMPLATES . '/ledgers_list.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-class Fima_Application extends Horde_Regsitry_Application
-{
- public $version = '1.0.1';
-
- /**
- * Add additional items to the menu.
- *
- * @param Horde_Menu $menu The menu object.
- */
- public function menu($menu)
- {
- return Fima::getMenu();
- }
-
- /**
- * Populate dynamically-generated preference values.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- */
- public function prefsEnum($ui)
- {
- switch ($ui->group) {
- case 'share':
- if (!$GLOBALS['prefs']->isLocked('active_ledger')) {
- $ui->override['active_ledger'] = Fima::listLedgers();
- }
- break;
- }
- }
-
- /**
- * Generate code used to display a special preference.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- * @param string $item The preference name.
- *
- * @return string The HTML code to display on the prefs page.
- */
- public function prefsSpecial($ui, $item)
- {
- switch ($item) {
- case 'closedperiodselect':
- return _("Closed by period:") .
- '<br />' .
- Fima::buildDateWidget('closedperiod', (int)$GLOBALS['prefs']->getValue('closed_period'), '', _("None"), true) .
- '</select><br /><br />';
- }
-
- return '';
- }
-
- /**
- * Special preferences handling on update.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- * @param string $item The preference name.
- *
- * @return boolean True if preference was updated.
- */
- public function prefsSpecialUpdate($ui, $item)
- {
- switch ($item) {
- case 'closedperiodselect':
- $period = $ui->vars->closedperiod;
- $period = ((int)$period['year'] > 0 && (int)$period['month'] > 0)
- ? mktime(0, 0, 0, $period['month'] + 1, 0, $period['year'])
- : 0;
- $GLOBALS['prefs']->setValue('closed_period', $period);
- return true;
- }
- }
-
-}
+++ /dev/null
-<?php
-
-$block_name = _("Finances Results");
-
-/**
- * @package Horde_Block
- */
-class Horde_Block_fima_summary extends Horde_Block {
-
- var $_app = 'fima';
-
- function _title()
- {
- global $registry;
-
- $label = !empty($this->_params['block_title'])
- ? $this->_params['block_title']
- : $registry->get('name');
- return Horde::link(Horde::url($registry->getInitialPage(), true))
- . htmlspecialchars($label) . '</a>';
- }
-
- function _params()
- {
- require_once dirname(__FILE__) . '/../base.php';
- $ledgers = array();
- foreach (Fima::listLedgers() as $id => $ledger) {
- $ledgers[$id] = $ledger->get('name');
- }
-
- return array('block_title' => array(
- 'type' => 'text',
- 'name' => _("Block title"),
- 'default' => $GLOBALS['registry']->get('name')),
- 'show_ledger' => array(
- 'type' => 'enum',
- 'name' => _("Show summary of this ledger"),
- 'default' => $GLOBALS['registry']->getAuth(),
- 'values' => $ledgers),
- 'show_months' => array(
- 'type' => 'enum',
- 'name' => _("Number of months to display"),
- 'default' => '3',
- 'values' => array(
- '1' => '1',
- '2' => '2',
- '3' => '3',
- '4' => '4',
- '5' => '5',
- '6' => '6',
- )));
- }
-
- function _content()
- {
- global $registry, $prefs;
- require_once dirname(__FILE__) . '/../base.php';
-
- $now = time();
- $html = '';
-
- /* Get account types and posting types. */
- $accounttypes = Fima::getAccountTypes();
-
- /* Params. */
- $showmonths = $this->_params['show_months'];
- $datefmt = Fima::convertDateToPeriodFormat($GLOBALS['prefs']->getValue('date_format'));
- $period_start = mktime(0, 0, 0, date('n') - $showmonths + 1, 1);
- $period_end = mktime(0, 0, 0);
-
- /* Rows. */
- $rows = array(FIMA_ACCOUNTTYPE_INCOME => $accounttypes[FIMA_ACCOUNTTYPE_INCOME],
- FIMA_ACCOUNTTYPE_EXPENSE => $accounttypes[FIMA_ACCOUNTTYPE_EXPENSE],
- '__result__' => _("Total Result"),
- '__resultasset__' => _("Asset Result"));
-
- /* Columns. */
- $cols = array();
- $coldummy = array();
-
- for ($period = $period_start; $period <= $period_end; $period = strtotime('+1 month', $period)) {
- $colId = strftime('%Y%m', $period);
- $cols[$colId] = strftime($datefmt, $period);
- $coldummy[$colId] = 0;
- }
-
- /* Initialize matrix. */
- $data = array('__header__' => array('__header__' => ''));
- foreach ($cols as $colId => $col) {
- $data['__header__'][$colId] = $col;
- }
- foreach ($rows as $rowId => $row) {
- $data[$rowId] = array('__header__' => $row) + $coldummy;
- }
-
- /* Results. */
- $filters = array();
- $filters[] = array('account_type', FIMA_ACCOUNTTYPE_ASSET, '<>');
- $filters[] = array('type', FIMA_POSTINGTYPE_ACTUAL);
- $filters[] = array('date', (int)$period_start, '>=');
- $filters[] = array('date', (int)$period_end, '<=');
- $result = Fima::getResults(array('date_month', 'account_type'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return '<em>' . _("Error when retrieving results.") . '</em>';
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $data[$rowId][$colId] = $value;
- $data['__result__'][$colId] += $value;
- }
- }
-
- /* Asset Results. */
- $filters = array();
- $filters[] = array('account_type', FIMA_ACCOUNTTYPE_ASSET, '<>');
- $filters[] = array('type', FIMA_POSTINGTYPE_ACTUAL);
- $filters[] = array('date', (int)$period_start, '<');
- $result = Fima::getResults(array('type'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return '<em>' . _("Error when retrieving results.") . '</em>';
- }
- $assetresult = 0;
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $assetresult += $value;
- }
- }
- foreach ($data['__resultasset__'] as $colId => $col) {
- if (preg_match('/__header.*__/', $colId)) {
- continue;
- }
- $assetresult += $data['__result__'][$colId];
- $data['__resultasset__'][$colId] = $assetresult;
- }
-
- /* Output. */
- foreach ($data as $rowId => $row) {
- $html .= '<tr class="' . (preg_match('/__result(.*)?__/', $rowId) ? 'result' : 'item') . '">';
- foreach ($row as $colId => $value) {
- if ($rowId === '__header__') {
- $html .= '<th class="item">' . htmlspecialchars($value) . '</th>';
- } elseif ($colId === '__header__') {
- $html .= '<td>' . htmlspecialchars($value) . '</td>';
- } else {
- $html .= '<td class="' . (($value < 0) ? 'negative' : 'positive') . ' amount">' . Fima::convertValueToAmount($value) . '</td>';
- }
- }
- $html .= '</tr>';
- }
-
- if (empty($html)) {
- return '<em>' . _("No results to display") . '</em>';
- }
-
- return '<table cellspacing="0" class="reportTable" width="100%">'
- . $html . '</table>';
- }
-
-}
+++ /dev/null
-<?php
-
-$block_name = _("Menu List");
-$block_type = 'tree';
-
-class Horde_Block_fima_tree_menu extends Horde_Block {
-
- var $_app = 'fima';
-
- function _buildTree(&$tree, $indent = 0, $parent = null)
- {
- $menus = array(
- array('add', _("Add Postings"), 'add.png', Horde_Util::addParameter(Horde::url('postings.php'), 'actionID', 'add_postings')),
- array('search', _("Search"), 'search.png', Horde::url('search.php')),
- array('accounts', _("Accounts"), 'accounts.png', Horde::url('accounts.php')),
- array('reports', _("Reports"), 'report.png', Horde::url('report.php'))
- );
-
- foreach ($menus as $menu) {
- $tree->addNode(
- $parent . $menu[0],
- $parent,
- $menu[1],
- $indent + 1,
- false,
- array(
- 'icon' => Horde_Themes::img($menu[2]),
- 'url' => $menu[3]
- )
- );
- }
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_Driver:: defines an API for implementing storage backends for
- * Fima.
- *
- * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_Driver {
-
- /**
- * Array holding the current accounts. Each array entry is a hash
- * describing an account. The array is indexed by accountId.
- *
- * @var array
- */
- var $_accounts = array();
-
- /**
- * Array holding the current postings. Each array entry is a hash
- * describing a posting. The array is indexed by postingId.
- *
- * @var array
- */
- var $_postings = array();
-
- /**
- * Integer containing the current total count of postings.
- *
- * @var integer
- */
- var $_postingsCount = 0;
-
- /**
- * Amount containing the current total result of postings.
- *
- * @var float
- */
- var $_postingsResult = 0;
-
- /**
- * String containing the current ledger.
- *
- * @var string
- */
- var $_ledger = '';
-
- /**
- * Hash containing connection parameters.
- *
- * @var array
- */
- var $_params = array();
-
- /**
- * Constructor - just store the $params in our newly-created
- * object. All other work is done by initialize().
- *
- * @param array $params Any parameters needed for this driver.
- */
- function Fima_Driver($params = array(), $errormsg = null)
- {
- $this->_params = $params;
- if (is_null($errormsg)) {
- $this->_errormsg = _("The Finances backend is not currently available.");
- } else {
- $this->_errormsg = $errormsg;
- }
- }
-
- /**
- * Returns the current driver's additional parameters.
- *
- * @return array Hash containing the driver's additional parameters.
- */
- function getParams()
- {
- return $this->_params;
- }
-
- /**
- * Lists accounts based on the given criteria. All accounts will be
- * returned by default.
- *
- * @return array Returns a list of the requested accounts.
- */
- function listAccounts()
- {
- return $this->_accounts;
- }
-
- /**
- * Lists postings based on the given criteria. All postings will be
- * returned by default.
- *
- * @return array Returns a list of the requested postings.
- */
- function listPostings()
- {
- return $this->_postings;
- }
-
- /**
- * Adds an account.
- *
- * @param string $number The number of the account.
- * @param string $type The type of the account.
- * @param string $name The name (short) of the account.
- * @param boolean $eo Extraordinary account.
- * @param string $desc The description (long) of the account.
- * @param boolean $closed Close account.
- *
- * @return mixed ID of the new account or PEAR_Error
- */
- function addAccount($number, $type, $name, $eo, $desc, $closed)
- {
- $accountId = $this->_addAccount($number, $type, $name, $eo, $desc, $closed);
- if (is_a($accountId, 'PEAR_Error')) {
- return $accountId;
- }
-
- /* Log the creation of this item in the history log. */
- $GLOBALS['injector']->getInstance('Horde_History')->log('fima:' . $this->_ledger . ':' . $accountId, array('action' => 'add'), true);
-
- return $accountId;
- }
-
- /**
- * Modifies an existing account.
- *
- * @param string $accountId The account to modify.
- * @param string $number The number of the account.
- * @param string $type The type of the account.
- * @param string $name The name (short) of the task.
- * @param boolean $eo Extraordinary account.
- * @param string $desc The description (long) of the task.
- * @param boolean $closed Close account.
- *
- * return mixed True or PEAR_Error
- */
- function modifyAccount($accountId, $number, $type, $name, $eo, $desc, $closed)
- {
- $modify = $this->_modifyAccount($accountId, $number, $type, $name, $eo, $desc, $closed);
- if (is_a($modify, 'PEAR_Error')) {
- return $modify;
- }
-
- /* Log the modification of this item in the history log. */
- $account = $this->getAccount($accountId);
- if (!is_a($account, 'PEAR_Error')) {
- $GLOBALS['injector']->getInstance('Horde_History')->log('fima:' . $this->_ledger . ':' . $account['account_id'], array('action' => 'modify'), true);
- }
-
- return true;
- }
-
- /**
- * Deletes an account and deletes/shifts of subaccounts and postings.
- *
- * @param string $accountId The account to delete.
- * @param mixed $dsSubaccounts True/false when deleting subaccounts,
- * accountId when shifting subaccounts
- * @param mixed $dsPostings True/false when deleting postings,
- * accountId when shifting postings
- *
- * @return mixed True or PEAR_Error
- */
- function deleteAccount($accountId, $dsSubaccounts = false, $dsPostings = true)
- {
- /* Get the account's details for use later. */
- $account = $this->getAccount($accountId);
-
- $delete = $this->_deleteAccount($accountId, $dsSubaccounts, $dsPostings);
- if (is_a($delete, 'PEAR_Error')) {
- return $delete;
- }
-
- /* Log the deletion of this item in the history log. */
- if (!is_a($account, 'PEAR_Error')) {
- $GLOBALS['injector']->getInstance('Horde_History')->log('fima:' . $this->_ledger . ':' . $account['account_id'], array('action' => 'delete'), true);
- }
-
- return true;
- }
-
- /**
- * Adds a posting.
- *
- * @param string $type The posting type.
- * @param integer $date The posting date.
- * @param string $asset The ID of the asset account.
- * @param string $account The ID of the account.
- * @param boolean $eo Extraordinary posting.
- * @param float $amount The posting amount.
- * @param string $desc The posting description.
- *
- * @return mixed ID of the new posting or PEAR_Error
- */
- function addPosting($type, $date, $asset, $account, $eo, $amount, $desc)
- {
- $postingId = $this->_addPosting($type, $date, $asset, $account, $eo, $amount, $desc);
- if (is_a($postingId, 'PEAR_Error')) {
- return $postingId;
- }
-
- /* Log the creation of this item in the history log. */
- $GLOBALS['injector']->getInstance('Horde_History')->log('fima:' . $this->_ledger . ':' . $postingId, array('action' => 'add'), true);
-
- return $postingId;
- }
-
- /**
- * Modifies an existing posting.
- *
- * @param string $postingId The posting to modify.
- * @param string $type The posting type.
- * @param integer $date The posting date.
- * @param string $asset The ID of the asset account.
- * @param string $account The ID of the account.
- * @param boolean $eo Extraordinary posting.
- * @param float $amount The posting amount.
- * @param string $desc The posting description.
- *
- * @return mixed True or PEAR_Error
- */
- function modifyPosting($postingId, $type, $date, $asset, $account, $eo, $amount, $desc)
- {
- $modify = $this->_modifyPosting($postingId, $type, $date, $asset, $account, $eo, $amount, $desc);
- if (is_a($modify, 'PEAR_Error')) {
- return $modify;
- }
-
- /* Log the modification of this item in the history log. */
- $posting = $this->getPosting($postingId);
- if (!is_a($posting, 'PEAR_Error')) {
- $GLOBALS['injector']->getInstance('Horde_History')->log('fima:' . $this->_ledger . ':' . $posting['posting_id'], array('action' => 'modify'), true);
- }
-
- return true;
- }
-
- /**
- * Deletes a posting.
- *
- * @param string $postingId The posting to delete.
- *
- * @return mixed True or PEAR_Error
- */
- function deletePosting($postingId)
- {
- /* Get the posting's details for use later. */
- $posting = $this->getPosting($postingId);
-
- $delete = $this->_deletePosting($postingId);
- if (is_a($delete, 'PEAR_Error')) {
- return $delete;
- }
-
- /* Log the deletion of this item in the history log. */
- if (!is_a($posting, 'PEAR_Error')) {
- $GLOBALS['injector']->getInstance('Horde_History')->log('fima:' . $this->_ledger . ':' . $posting['posting_id'], array('action' => 'delete'), true);
- }
-
- return true;
- }
-
- /**
- * Shifts a posting.
- *
- * @param string $postingId The posting to shift.
- * @param string $type The posting type shifting to.
- * @param string $asset The ID of the asset account.
- * @param string $account The ID of the account.
- *
- * @return mixed True or PEAR_Error
- */
- function shiftPosting($postingId, $type, $asset, $account)
- {
- /* Get the posting's details for use later. */
- $posting = $this->getPosting($postingId);
- $shift = $this->_shiftPosting($postingId, $type, $asset, $account);
- if (is_a($shift, 'PEAR_Error')) {
- return $shift;
- }
-
- /* Log the shifting of this item in the history log. */
- if (!is_a($posting, 'PEAR_Error')) {
- $GLOBALS['injector']->getInstance('Horde_History')->log('fima:' . $this->_ledger . ':' . $posting['posting_id'], array('action' => 'shift'), true);
- }
-
- return true;
- }
-
- /**
- * Deletes all postings and accounts.
- *
- * @param mixed $accounts boolean or account_type
- * @param mixed $accounts boolean or posting_type.
- *
- * @return mixed True or PEAR_Error
- */
- function deleteAll($accounts = true, $postings = true)
- {
- $delete = $this->_deleteAll($accounts, $postings);
- if (is_a($delete, 'PEAR_Error')) {
- return $delete;
- }
-
- /* Log the deletion of this item in the history log. */
- $GLOBALS['injector']->getInstance('Horde_History')->log('fima:' . $this->_ledger . ':all', array('action' => 'delete'), true);
-
- return true;
- }
-
- /**
- * Attempts to return a concrete Fima_Driver instance based on $driver.
- *
- * @param string $ledger The name of the ledger to load.
- *
- * @param string $driver The type of the concrete Fima_Driver subclass
- * to return. The class name is based on the
- * storage driver ($driver). The code is
- * dynamically included.
- *
- * @param array $params (optional) A hash containing any additional
- * configuration or connection parameters a
- * subclass might need.
- *
- * @return mixed The newly created concrete Fima_Driver instance, or
- * false on an error.
- */
- function &factory($ledger = '', $driver = null, $params = null)
- {
- if ($driver === null) {
- $driver = $GLOBALS['conf']['storage']['driver'];
- }
- $driver = basename($driver);
-
- if (is_null($params)) {
- $params = Horde::getDriverConfig('storage', $driver);
- }
-
- require_once dirname(__FILE__) . '/Driver/' . $driver . '.php';
- $class = 'Fima_Driver_' . $driver;
- if (class_exists($class)) {
- $fima = new $class($ledger, $params);
- $result = $fima->initialize();
- if (is_a($result, 'PEAR_Error')) {
- $fima = new Fima_Driver($params, sprintf(_("The Finances backend is not currently available: %s"), $result->getMessage()));
- }
- } else {
- $fima = new Fima_Driver($params, sprintf(_("Unable to load the definition of %s."), $class));
- }
-
- return $fima;
- }
-
- /**
- * Attempts to return a reference to a concrete Fima_Driver
- * instance based on $driver. It will only create a new instance
- * if no Fima_Driver instance with the same parameters currently
- * exists.
- *
- * This should be used if multiple storage sources are required.
- *
- * This method must be invoked as: $var = &Fima_Driver::singleton()
- *
- * @param string $ledger The name of the ledger to load.
- *
- * @param string $driver The type of concrete Fima_Driver subclass
- * to return. The is based on the storage
- * driver ($driver). The code is dynamically
- * included.
- *
- * @param array $params (optional) A hash containing any additional
- * configuration or connection parameters a
- * subclass might need.
- *
- * @return mixed The created concrete Fima_Driver instance, or false
- * on error.
- */
- function &singleton($ledger = '', $driver = null, $params = null)
- {
- static $instances;
-
- if (is_null($driver)) {
- $driver = $GLOBALS['conf']['storage']['driver'];
- }
-
- if (is_null($params)) {
- $params = Horde::getDriverConfig('storage', $driver);
- }
-
- if (!isset($instances)) {
- $instances = array();
- }
-
- $signature = serialize(array($ledger, $driver, $params));
- if (!isset($instances[$signature])) {
- $instances[$signature] = &Fima_Driver::factory($ledger, $driver, $params);
- }
-
- return $instances[$signature];
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima storage implementation for PHP's PEAR database abstraction layer.
- *
- * Required values for $params:<pre>
- * 'phptype' The database type (e.g. 'pgsql', 'mysql', etc.).
- * 'table' The name of the foo table in 'database'.
- * 'charset' The database's internal charset.</pre>
- *
- * Required by some database implementations:<pre>
- * 'database' The name of the database.
- * 'hostspec' The hostname of the database server.
- * 'protocol' The communication protocol ('tcp', 'unix', etc.).
- * 'username' The username with which to connect to the database.
- * 'password' The password associated with 'username'.
- * 'options' Additional options to pass to the database.
- * 'tty' The TTY on which to connect to the database.
- * 'port' The port on which to connect to the database.</pre>
- *
- * The table structure can be created by the scripts/sql/fima.sql
- * script.
- *
- * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_Driver_sql extends Fima_Driver {
-
- /**
- * Handle for the current database connection.
- *
- * @var DB
- */
- var $_db;
-
- /**
- * Constructs a new SQL storage object.
- *
- * @param string $ledger The ledger to load.
- * @param array $params A hash containing connection parameters.
- */
- function Fima_Driver_sql($ledger, $params = array())
- {
- $this->_ledger = $ledger;
- $this->_params = $params;
- }
-
- /**
- * Retrieves accounts from the database.
- *
- * @param array $filters Any filters for restricting the retrieved accounts.
- *
- * @return mixed True on success, PEAR_Error on failure.
- */
- function retrieveAccounts($filters = array())
- {
- /* Build the SQL query. */
- $query = sprintf('SELECT * FROM %s WHERE account_owner = ?', $this->_params['table_accounts']);
- $values = array($this->_ledger);
-
- /* Add filters. */
- $this->_addFilters($filters, $query, $values, 'account_');
-
- /* Sorting. */
- $query .= ' ORDER BY account_number ASC';
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::retrieveAccounts(): %s', $query), 'DEBUG');
-
- /* Execute the query. */
- $this->_accounts = array();
- $result = $this->_db->query($query, $values);
-
- if (isset($result) && !is_a($result, 'PEAR_Error')) {
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- if (is_a($row, 'PEAR_Error')) {
- return $row;
- }
-
- /* Store the retrieved values in the accounts variable. */
- $this->_accounts = array();
- while ($row && !is_a($row, 'PEAR_Error')) {
- /* Add this new account to the $_account list. */
- $this->_accounts[$row['account_id']] = $this->_buildAccount($row);
-
- /* Advance to the new row in the result set. */
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- }
- $result->free();
- } else {
- return $result;
- }
-
- return true;
- }
-
- /**
- * Retrieves one account from the database.
- *
- * @param string $accountId The ID of the account to retrieve.
- *
- * @return array The array of account attributes.
- */
- function getAccount($accountId)
- {
- /* Build the SQL query. */
- $query = sprintf('SELECT * FROM %s WHERE account_owner = ? AND account_id = ?',
- $this->_params['table_accounts']);
- $values = array($this->_ledger, $accountId);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::getAccount(): %s', $query), 'DEBUG');
-
- /* Execute the query. */
- $result = $this->_db->query($query, $values);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
-
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- if (is_a($row, 'PEAR_Error')) {
- return $row;
- }
- if ($row === null) {
- return PEAR::raiseError(_("Not found"));
- }
-
- /* Decode and return the account. */
- return $this->_buildAccount($row);
- }
-
- /**
- * Retrieves one account from the database by number.
- *
- * @param string $number The number of the account to retrieve.
- *
- * @return array The array of account attributes.
- */
- function getAccountByNumber($number)
- {
- /* Build the SQL query. */
- $query = sprintf('SELECT * FROM %s WHERE account_owner = ? AND account_number = ?',
- $this->_params['table_accounts']);
- $values = array($this->_ledger, sprintf('%\'04s', $number));
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::getAccountByNumber(): %s', $query), 'DEBUG');
-
- /* Execute the query. */
- $result = $this->_db->query($query, $values);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
-
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- if (is_a($row, 'PEAR_Error')) {
- return $row;
- }
- if ($row === null) {
- return PEAR::raiseError(_("Not found"));
- }
-
- /* Decode and return the account. */
- return $this->_buildAccount($row);
- }
-
- /**
- * Retrieves postings from the database.
- *
- * @param array $filters Any filters for restricting the retrieved postings.
- * @param array $sorting Sort order of retrieved postings.
- * @param array $limit Limit of the retrieved postings, array(page, postings/page).
- *
- * @return mixed True on success, PEAR_Error on failure.
- */
- function retrievePostings($filters = array(), $sorting = array(), $limit = array())
- {
- /* Build the SQL query filter. */
- $queryfilter = ' WHERE posting_owner = ?';
- $values = array($this->_ledger);
-
- /* Add filters. */
- $this->_addFilters($filters, $queryfilter, $values, 'posting_');
-
- $query = sprintf('SELECT count(p.posting_id) posting_count, SUM(p.posting_amount) posting_result FROM %s p',
- $this->_params['table_postings']);
- $query .= $queryfilter;
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::retrievePostings(): %s', $query), 'DEBUG');
-
- /* Execute the query. */
- $result = $this->_db->query($query, $values);
- if (isset($result) && !is_a($result, 'PEAR_Error')) {
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- if (is_a($row, 'PEAR_Error')) {
- return $row;
- }
- $this->_postingsCount = (int)$row['posting_count'];
- $this->_postingsResult = $row['posting_result'];
- $result->free();
-
- // correct result when account is an asset account too
- if ($this->_postingsCount > 0) {
- $query = sprintf('SELECT SUM(p.posting_amount) posting_result ' .
- 'FROM %s p JOIN %s a ON a.account_id = p.posting_account ' .
- $queryfilter . ' AND a.account_type = ?',
- $this->_params['table_postings'], $this->_params['table_accounts']);
- $values2 = $values;
- $values2[] = FIMA_ACCOUNTTYPE_ASSET;
- $result = $this->_db->query($query, $values2);
- if (isset($result) && !is_a($result, 'PEAR_Error')) {
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- if (is_a($row, 'PEAR_Error')) {
- return $row;
- }
- }
- $this->_postingsResult -= $row['posting_result'];
- $result->free();
- }
- } else {
- return $result;
- }
-
- /* Fetch the postings if necessary. */
- $this->_postings = array();
- if ($this->_postingsCount == 0) {
- return true;
- }
-
- $query = sprintf('SELECT p.*, asset.account_number posting_asset_number, account.account_number posting_account_number ' .
- 'FROM %s p LEFT OUTER JOIN %s asset ON p.posting_asset = asset.account_id LEFT OUTER JOIN %s account ON p.posting_account = account.account_id',
- $this->_params['table_postings'], $this->_params['table_accounts'], $this->_params['table_accounts']);
- $query .= $queryfilter;
-
- /* Sorting. */
- if (!is_array($sorting)) {
- $sorting = array($sorting);
- }
- if (count($sorting) == 0) {
- $sorting = array('posting_date ASC');
- }
- $query .= ' ORDER BY ' . implode(', ', $sorting);
-
- /* Limit. */
- if (count($limit) > 0) {
- if ($limit[0] < 0) {
- $limit[0] += ceil($this->_postingsCount / $limit[1]) + 1;
- }
- $limit[0] = ($limit[0] - 1) * $limit[1];
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::retrievePostings() limitQuery: %s', $query), 'DEBUG');
- $result = $this->_db->queryLimit($query, $limit[0], $limit[1], $values);
- } else {
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::retrievePostings(): %s', $query), 'DEBUG');
- $result = $this->_db->query($query, $values);
- }
-
- /* Execute the query. */
- $result = $this->_db->query($query, $values);
- if (isset($result) && !is_a($result, 'PEAR_Error')) {
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- if (is_a($row, 'PEAR_Error')) {
- return $row;
- }
-
- /* Store the retrieved values in the accounts variable. */
- while ($row && !is_a($row, 'PEAR_Error')) {
- /* Add this new posting to the $_posting list. */
- $this->_postings[$row['posting_id']] = $this->_buildPosting($row);
-
- /* Advance to the new row in the result set. */
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- }
- $result->free();
- } else {
- return $result;
- }
-
- return true;
- }
-
- /**
- * Retrieves one posting from the database.
- *
- * @param string $postingId The ID of the posting to retrieve.
- *
- * @return array The array of posting attributes.
- */
- function getPosting($postingId)
- {
- /* Build the SQL query. */
- $query = sprintf('SELECT * FROM %s WHERE posting_owner = ? AND posting_id = ?',
- $this->_params['table_postings']);
- $values = array($this->_ledger, $postingId);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::getPosting(): %s', $query), 'DEBUG');
-
- /* Execute the query. */
- $result = $this->_db->query($query, $values);
-
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
-
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- if (is_a($row, 'PEAR_Error')) {
- return $row;
- }
- if ($row === null) {
- return PEAR::raiseError(_("Not found"));
- }
-
- /* Decode and return the posting. */
- return $this->_buildPosting($row);
- }
-
- /**
- * Get grouped results.
- *
- * @param array $groups Fields to group.
- * @param boolean $filters Filters for postings.
- *
- * @return array A matrix of the grouped results.
- */
- function getResults($groups, $filters = array()) {
- $matrix = array();
-
- /* Fix grouping. */
- if (!is_array($groups)) {
- $groups = array($groups);
- }
- if (!isset($groups[1])) {
- $groups[1] = 'owner';
- }
- foreach ($groups as $groupId => $group) {
- switch($group) {
- case 'date_month': $groups[$groupId] = 'FROM_UNIXTIME(posting_date, \'%Y%m\')'; break;
- case 'date_year': $groups[$groupId] = 'FROM_UNIXTIME(posting_date, \'%Y\')'; break;
- case 'asset_number': $groups[$groupId] = 'asset.account_number'; break;
- case 'asset_parent': $groups[$groupId] = 'CONCAT(LEFT(asset.account_number, 2), \'00\')'; break;
- case 'asset_type': $groups[$groupId] = 'asset.account_type'; break;
- case 'account_number': $groups[$groupId] = 'account.account_number'; break;
- case 'account_parent': $groups[$groupId] = 'CONCAT(LEFT(account.account_number, 2), \'00\')'; break;
- case 'account_type': $groups[$groupId] = 'account.account_type'; break;
- default: $groups[$groupId] = 'posting_'.$group; break;
- }
- }
-
- /* Build the SQL query filter. */
- $query = sprintf('SELECT %s x, %s y, sum(posting_amount) result ' .
- 'FROM %s p LEFT OUTER JOIN %s asset ON p.posting_asset = asset.account_id AND p.posting_owner = asset.account_owner LEFT OUTER JOIN %s account ON p.posting_account = account.account_id AND p.posting_owner = account.account_owner ' .
- 'WHERE posting_owner = ?',
- $groups[0], $groups[1], $this->_params['table_postings'], $this->_params['table_accounts'], $this->_params['table_accounts']);
- $values = array($this->_ledger);
-
- /* Add filters. */
- foreach ($filters as $filterId => $filter) {
- switch($filter[0]) {
- case 'date_month': $filters[$filterId][0] = 'FROM_UNIXTIME(posting_date, \'%Y%m\')'; break;
- case 'date_year': $filters[$filterId][0] = 'FROM_UNIXTIME(posting_date, \'%Y%m\')'; break;
- case 'asset_number': $filters[$filterId][0] = 'asset.account_number'; break;
- case 'asset_parent': $filters[$filterId][0] = 'LEFT(asset.account_number, 2)'; break;
- case 'asset_type': $filters[$filterId][0] = 'asset.account_type'; break;
- case 'account_number': $filters[$filterId][0] = 'account.account_number'; break;
- case 'account_parent': $filters[$filterId][0] = 'LEFT(account.account_number, 2)'; break;
- case 'account_type': $filters[$filterId][0] = 'account.account_type'; break;
- default: $filters[$filterId][0] = 'posting_'.$filter[0]; break;
- }
- }
- $this->_addFilters($filters, $query, $values);
-
- /* Add grouping. */
- $query .= ' GROUP BY ' . implode(', ', $groups);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::getResults(): %s', $query), 'DEBUG');
-
- /* Execute the query. */
- $result = $this->_db->query($query, $values);
- if (isset($result) && !is_a($result, 'PEAR_Error')) {
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- if (is_a($row, 'PEAR_Error')) {
- return $row;
- }
-
- /* Store the retrieved values in the accounts variable. */
- while ($row && !is_a($row, 'PEAR_Error')) {
- /* Add this new posting to the $_posting list. */
- if (!isset($matrix[$row['y']])) {
- $matrix[$row['y']] = array();
- }
- $matrix[$row['y']][$row['x']] = $row['result'];
-
- /* Advance to the new row in the result set. */
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- }
- $result->free();
- }
-
- return $matrix;
- }
-
- /**
- * Get the results of all asset accounts.
- *
- * @param string $postingtype Type of postings.
- * @param boolean $perdate Date of asset results.
- *
- * @return array Array of asset accounts and results
- */
- function getAssetResults($postingtype, $perdate = null)
- {
- $perdate = ($perdate === null) ? mktime() : (int)$perdate;
-
- /* Build the SQL query. */
- $query = sprintf('SELECT account_id, SUM(account_result) account_result FROM ( ' .
- ' SELECT a1.account_id, SUM(p1.posting_amount) account_result ' .
- ' FROM %s a1 LEFT OUTER JOIN %s p1 ON a1.account_id = p1.posting_asset AND p1.posting_owner = ? AND p1.posting_type = ? ' .
- ' WHERE a1.account_owner = ? AND a1.account_type = ? and p1.posting_date <= ?' .
- ' GROUP BY a1.account_id ' .
- ' UNION ' .
- ' SELECT a2.account_id, SUM(p2.posting_amount) * -1 account_result ' .
- ' FROM %s a2 LEFT OUTER JOIN %s p2 ON a2.account_id = p2.posting_account AND p2.posting_owner = ? AND p2.posting_type = ? ' .
- ' WHERE a2.account_owner = ? AND a2.account_type = ? and p2.posting_date <= ?' .
- ' GROUP BY a2.account_id ' .
- ') x ' .
- 'GROUP BY account_id ',
- $this->_params['table_accounts'], $this->_params['table_postings'],
- $this->_params['table_accounts'], $this->_params['table_postings']);
- $values = array($this->_ledger, $postingtype, $this->_ledger, FIMA_ACCOUNTTYPE_ASSET, $perdate,
- $this->_ledger, $postingtype, $this->_ledger, FIMA_ACCOUNTTYPE_ASSET, $perdate);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::getAssetResults(): %s', $query), 'DEBUG');
-
- /* Execute the query. */
- $assetresults = array();
- $result = $this->_db->query($query, $values);
- if (isset($result) && !is_a($result, 'PEAR_Error')) {
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- if (is_a($row, 'PEAR_Error')) {
- return $row;
- }
-
- /* Store the retrieved values in the accounts variable. */
- while ($row && !is_a($row, 'PEAR_Error')) {
- /* Add this new posting to the $_posting list. */
- $assetresults[] = $row;
-
- /* Advance to the new row in the result set. */
- $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
- }
- $result->free();
- } else {
- return $result;
- }
-
- return $assetresults;
- }
-
- /**
- * Build an account.
- *
- * @param array $row Datasbase row holding account attributes.
- * @param boolean $getparent Also get parent account.
- *
- * @return array The array of account attributes.
- */
- function _buildAccount($row, $getparent = true)
- {
- $parent = null;
- if ($getparent) {
- if (($parent_number = Fima::getAccountParent($row['account_number'])) !== null) {
- if (isset($this->_accounts[$parent_number])) {
- $parent = $this->_accounts[$parent_number];
- } else {
- $parent = $this->getAccountByNumber($parent_number);
- if (is_a($parent, 'PEAR_Error')) {
- $parent = null;
- }
- }
- }
- }
-
- /* Create a new account based on $row's values. */
- return array('account_id' => $row['account_id'],
- 'owner' => $row['account_owner'],
- 'number' => sprintf('%\'04d', $row['account_number']),
- 'type' => $row['account_type'],
- 'name' => Horde_String::convertCharset($row['account_name'], $this->_params['charset']),
- 'eo' => $row['account_eo'],
- 'desc' => Horde_String::convertCharset($row['account_desc'], $this->_params['charset']),
- 'closed' => $row['account_closed'],
- 'label' => trim($row['account_number'] . ' ' .
- (($parent === null) ? '' : $parent['name'] . ' - ') .
- Horde_String::convertCharset($row['account_name'], $this->_params['charset'])),
- 'parent_id' => ($parent === null) ? null : $parent['account_id'],
- 'parent_number' => ($parent === null) ? '' : $parent['number'],
- 'parent_name' => ($parent === null) ? '' : $parent['name']);
- }
-
- /**
- * Adds an account to the backend storage.
- *
- * @param string $number The number of the account.
- * @param string $type The type of the account.
- * @param string $name The name (short) of the account.
- * @param boolean $eo Extraordinary account.
- * @param string $desc The description (long) of the account.
- * @param boolean $closed Close account.
- *
- * @return mixed ID of the new account or PEAR_Error
- */
- function _addAccount($number, $type, $name, $eo, $desc, $closed)
- {
- $accountId = strval(new Horde_Support_Uuid());
-
- $query = sprintf(
- 'INSERT INTO %s (account_id, account_owner, account_number, account_type, ' .
- 'account_name, account_eo, account_desc, account_closed) ' .
- 'VALUES (?, ?, ?, ?, ?, ?, ?, ?)',
- $this->_params['table_accounts']);
- $values = array($accountId,
- $this->_ledger,
- sprintf('%\'04d', $number),
- $type,
- Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
- (int)(bool)$eo,
- Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
- (int)(bool)$closed);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_addAccount(): %s', $query), 'DEBUG');
-
- /* Attempt the insertion query. */
- $result = $this->_db->query($query, $values);
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
-
- return $accountId;
- }
-
- /**
- * Modifies an existing account.
- *
- * @param string $accountId The account to modify.
- * @param string $number The number of the account.
- * @param string $type The type of the account.
- * @param string $name The name (short) of the account.
- * @param boolean $eo Extraordinary account.
- * @param string $desc The description (long) of the account.
- * @param boolean $closed Close account.
- *
- * @return mixed True or PEAR_Error
- */
- function _modifyAccount($accountId, $number, $type, $name, $eo, $desc, $closed)
- {
- $query = sprintf('UPDATE %s SET' .
- ' account_number = ?, ' .
- ' account_type = ?, ' .
- ' account_name = ?, ' .
- ' account_eo = ?, ' .
- ' account_desc = ?, ' .
- ' account_closed = ? ' .
- 'WHERE account_owner = ? AND account_id = ?',
- $this->_params['table_accounts']);
- $values = array(sprintf('%\'04d', $number),
- $type,
- Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
- (int)(bool)$eo,
- Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
- (int)(bool)$closed,
- $this->_ledger,
- $accountId);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_modifyAccount(): %s', $query), 'DEBUG');
-
- /* Attempt the update query. */
- $result = $this->_db->query($query, $values);
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
-
- return true;
- }
-
- /**
- * Deletes an account from the backend.
- *
- * @param string $accountId The account to delete.
- * @param mixed $dsSubaccounts True/false when deleting subaccounts,
- * accountId when shifting subaccounts
- * @param mixed $dsPostings True/false when deleting postings,
- * accountId when shifting postings
- *
- * @return mixed True or PEAR_Error
- */
- function _deleteAccount($accountId, $dsSubaccounts = false, $dsPostings = true)
- {
- /* Get the account's details for use later. */
- $account = $this->getAccount($accountId);
-
- /* Handle subaccounts. */
- if ($dsSubaccounts !== false) {
- /* Delete subaccounts. */
- $parent = (int)($account['number'] / 100) . '%';
- $this->retrieveAccounts(array(array('number', $parent, 'LIKE'),
- array('number', (string)$account['number'], '!=')));
-
- foreach ($this->_accounts as $subaccountId => $subaccount) {
- $delete = $this->_deleteAccount($subaccountId, false, $dsSubaccounts);
- if (is_a($delete, 'PEAR_Error')) {
- return $delete;
- }
- }
- }
-
- /* Handle postings. */
- if ($dsPostings !== false) {
- if ($dsPostings === true) {
- /* Delete account postings. */
- $query = sprintf('DELETE FROM %s WHERE posting_owner = ? AND (posting_asset = ? OR posting_account = ?)',
- $this->_params['table_postings']);
- $values = array($this->_ledger, $accountId, $accountId);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_deleteAccount(): %s', $query), 'DEBUG');
-
- /* Attempt the delete query. */
- $result = $this->_db->query($query, $values);
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
- } else {
- /* Shift account postings. */
- $shift = $this->_shiftPostings($accountId, $dsPostings);
- if (is_a($shift, 'PEAR_Error')) {
- return $shift;
- }
- }
- }
-
- /* Delete account. */
- $query = sprintf('DELETE FROM %s WHERE account_owner = ? AND account_id = ?',
- $this->_params['table_accounts']);
- $values = array($this->_ledger, $accountId);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_deleteAccount(): %s', $query), 'DEBUG');
-
- /* Attempt the delete query. */
- $result = $this->_db->query($query, $values);
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
-
- return true;
- }
-
- /**
- * Build a posting.
- *
- * @param array $row Datasbase row holding posting attributes;
- *
- * @return array The array of posting attributes.
- */
- function _buildPosting($row)
- {
- /* Create a new account based on $row's values. */
- return array('posting_id' => $row['posting_id'],
- 'owner' => $row['posting_owner'],
- 'type' => $row['posting_type'],
- 'date' => $row['posting_date'],
- 'asset' => $row['posting_asset'],
- 'account' => $row['posting_account'],
- 'desc' => Horde_String::convertCharset($row['posting_desc'], $this->_params['charset']),
- 'amount' => $row['posting_amount'],
- 'eo' => (int)(bool)$row['posting_eo']);
- }
-
- /**
- * Adds a posting to the backend storage.
- *
- * @param string $type The posting type.
- * @param integer $date The posting date.
- * @param string $asset The ID of the asset account.
- * @param string $account The ID of the account.
- * @param boolean $eo Extraordinary posting.
- * @param float $amount The posting amount.
- * @param string $desc The posting description.
- *
- * @return mixed ID of the new posting or PEAR_Error
- */
- function _addPosting($type, $date, $asset, $account, $eo, $amount, $desc)
- {
- $postingId = strval(new Horde_Support_Uuid());
-
- $query = sprintf(
- 'INSERT INTO %s (posting_id, posting_owner, posting_type, posting_date, ' .
- 'posting_asset, posting_account, posting_eo, posting_amount, posting_desc) ' .
- 'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)',
- $this->_params['table_postings']);
- $values = array($postingId,
- $this->_ledger,
- $type,
- (int)$date,
- $asset,
- $account,
- (int)(bool)$eo,
- (float)$amount,
- Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']));
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_addPosting(): %s', $query), 'DEBUG');
-
- /* Attempt the insertion query. */
- $result = $this->_db->query($query, $values);
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
-
- return $postingId;
- }
-
- /**
- * Modifies an existing posting.
- *
- * @param string $postingId The posting to modify.
- * @param string $type The posting type.
- * @param integer $date The posting date.
- * @param string $asset The ID of the asset account.
- * @param string $account The ID of the account.
- * @param boolean $eo Extraordinary posting.
- * @param float $amount The posting amount.
- * @param string $desc The posting description.
- *
- * @return mixed True or PEAR_Error
- */
- function _modifyPosting($postingId, $type, $date, $asset, $account, $eo, $amount, $desc)
- {
- $query = sprintf('UPDATE %s SET' .
- ' posting_type = ?, ' .
- ' posting_date = ?, ' .
- ' posting_asset = ?, ' .
- ' posting_account = ?, ' .
- ' posting_eo = ?, ' .
- ' posting_amount = ?, ' .
- ' posting_desc = ? ' .
- 'WHERE posting_owner = ? AND posting_id = ?',
- $this->_params['table_postings']);
- $values = array($type,
- (int)$date,
- $asset,
- $account,
- (int)(bool)$eo,
- (float)$amount,
- Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
- $this->_ledger,
- $postingId);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_modifyPosting(): %s', $query), 'DEBUG');
-
- /* Attempt the update query. */
- $result = $this->_db->query($query, $values);
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
-
- return true;
- }
-
- /**
- * Deletes a posting from the backend.
- *
- * @param string $postingId The posting to delete.
- *
- * @return mixed True or PEAR_Error
- */
- function _deletePosting($postingId)
- {
- /* Get the task's details for use later. */
- $posting = $this->getPosting($postingId);
-
- $query = sprintf('DELETE FROM %s WHERE posting_owner = ? AND posting_id = ?',
- $this->_params['table_postings']);
- $values = array($this->_ledger, $postingId);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_deletePosting(): %s', $query), 'DEBUG');
-
- /* Attempt the delete query. */
- $result = $this->_db->query($query, $values);
-
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
-
- return true;
- }
-
- /**
- * Shift an existing posting.
- *
- * @param string $postingId The posting to shift.
- * @param string $type The posting type shifting to.
- * @param string $asset The ID of the asset account.
- * @param string $account The ID of the account.
- *
- * @return mixed True or PEAR_Error
- */
- function _shiftPosting($postingId, $type, $asset, $account)
- {
- if (!$type && !$asset && !$account) {
- return true;
- }
-
- $query = sprintf('UPDATE %s SET' .
- ($type ? ' posting_type = ?, ' : '') .
- ($asset ? ' posting_asset = ?, ' : '') .
- ($account ? ' posting_account = ?, ' : '').
- ' posting_eo = posting_eo ' .
- 'WHERE posting_owner = ? AND posting_id = ?',
- $this->_params['table_postings']);
- $values = array();
- if ($type) { $values[] = $type; }
- if ($asset) { $values[] = $asset; }
- if ($account) { $values[] = $account; }
- $values[] = $this->_ledger;
- $values[] = $postingId;
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_shiftPosting(): %s', $query), 'DEBUG');
-
- /* Attempt the update query. */
- $result = $this->_db->query($query, $values);
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
-
- return true;
- }
-
- /**
- * Shift postings in the backend.
- *
- * @param mixed $accountIdFrom The account(s) to shift postings from.
- * @param string $accountIdTo The account to shift postings to.
- *
- * @return mixed True or PEAR_Error
- */
- function _shiftPostings($accountIdFrom, $accountIdTo)
- {
- if (!is_array($accountIdFrom)) {
- $accountIdFrom = array($accountIdFrom);
- }
-
- foreach ($accountIdFrom as $key => $value) {
- $accountIdFrom[$key] = $this->_db->quoteSmart($value);
- }
-
- $fields = array('posting_asset', 'posting_account');
- foreach ($fields as $field) {
- $query = sprintf('UPDATE %s SET' .
- ' %s = ? ' .
- 'WHERE posting_owner = ? AND %s IN (!)',
- $this->_params['table_postings'], $field, $field);
- $values = array($accountIdTo, $this->_ledger, implode(',', $accountIdFrom));
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_shiftPostings(): %s', $query), 'DEBUG');
-
- /* Attempt the update query. */
- $result = $this->_db->query($query, $values);
-
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
- }
-
- return true;
- }
-
- /**
- * Deletes all postings and accounts.
- *
- * @param mixed $accounts boolean or account_type
- * @param mixed $accounts boolean or posting_type.
- *
- * @return mixed True or PEAR_Error
- */
- function _deleteAll($accounts, $postings)
- {
- /* Delete postings. */
- if ($postings) {
- $query = sprintf('DELETE FROM %s WHERE posting_owner = ?',
- $this->_params['table_postings']);
- $values = array($this->_ledger);
-
- /* Filter. */
- if ($postings !== true) {
- $query .= ' AND posting_type = ?';
- $values[] = $postings;
- }
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_deleteAll(): %s', $query), 'DEBUG');
-
- /* Attempt the delete query. */
- $result = $this->_db->query($query, $values);
-
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
- } else {
- /* If postings aren't deleted, don't delete accounts. */
- return false;
- }
-
- /* Delete Accounts */
- if ($accounts) {
- $query = sprintf('DELETE FROM %s WHERE account_owner = ?',
- $this->_params['table_accounts']);
- $values = array($this->_ledger);
-
- /* Filter. */
- if ($accounts !== true) {
- $query .= ' AND account_type = ?';
- $values[] = $accounts;
- }
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Fima_Driver_sql::_deleteAll(): %s', $query), 'DEBUG');
-
- /* Attempt the delete query. */
- $result = $this->_db->query($query, $values);
-
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
- }
-
- return true;
- }
-
-
- /**
- * Build the where clause for a query using the passed filters
- * Attention: does not include the WHERE keyword, add WHERE 1=1 manually in the query
- *
- * @param array $filters Array of filters, syntax: array(field, value [, operator = '=' [, andor = 'AND']])
- * @param array $prefix optional prefix for fields
- *
- * @return integer number of added filters
- */
- function _addFilters($filters, &$query, &$values, $prefix = '')
- {
- $filtercnt = 0;
-
- foreach ($filters as $filter) {
- // and/or
- if (!isset($filter[3])) {
- $filter[3] = 'AND';
- } else {
- $filter[3] = strtoupper($filter[3]);
- if (!in_array($filter[3], array('AND', 'OR'))) {
- $filter[3] = 'AND';
- }
- }
-
- // subfilter
- if (is_array($filter[0])) {
- $query .= ' ' . $filter[3] . ' (1=1';
- $filtercnt += $this->_addFilters($filter[0], $query, $values, $prefix);
- $query .= ')';
- continue;
- }
-
- // fix operator
- if (!isset($filter[2])) {
- $filter[2] = '=';
- } else {
- $filter[2] = strtoupper($filter[2]);
- if (!in_array($filter[2], array('<', '>', '<=', '>=', '=', '<>', '!=', 'IN', 'NOT IN', 'IS', 'IS NOT', 'LIKE', 'NOT LIKE'))) {
- $filter[2] = '=';
- }
- }
-
- // fix operator for null values
- if ($filter[1] === null) {
- if (!in_array($filter[2], array('IS', 'IS NOT'))) {
- $filter[2] = in_array($filter[2], array('=', 'IN', 'LIKE')) ? 'IS' : 'IS NOT';
- }
- } elseif (in_array($filter[2], array('IS', 'IS NOT'))) {
- $filter[2] = ($filter[2] == 'IS') ? '=' : '!=';
- }
-
- // fix operator for array value + prepare values
- if (is_array($filter[1])) {
- if (!in_array($filter[2], array('IN', 'NOT IN'))) {
- $filter[2] = in_array($filter[2], array('=', 'IS', 'LIKE')) ? 'IN' : 'NOT IN';
- }
- $filterph = '(!)';
- foreach ($filter[1] as $key => $value) {
- $filter[1][$key] = $this->_db->quoteSmart($value);
- }
- $filter[1] = implode(',', $filter[1]);
- } else {
- if (in_array($filter[2], array('IN', 'NOT IN'))) {
- $filter[2] = ($filter[2] == 'IN') ? '=' : '!=';
- }
- $filterph = '?';
- }
-
- // fix != operator
- if ($filter[2] == '!=') {
- $filter[2] = '<>';
- }
-
- $query .= sprintf(' ' . $filter[3] . ' ' . $prefix . '%s %s %s', $filter[0], $filter[2], $filterph);
- $values[] = $filter[1];
- $filtercnt++;
- }
-
- return $filtercnt;
- }
-
- /**
- * Attempts to open a connection to the SQL server.
- *
- * @return boolean True on success; PEAR_Error on failure.
- */
- function initialize()
- {
- try {
- $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'fima', 'storage');
- } catch (Horde_Exception $e) {
- return PEAR::raiseError($e->getMessage());
- }
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-
-/**
- * Sort by.
- */
-define('FIMA_SORT_DATE', 'date');
-define('FIMA_SORT_ASSET', 'asset_number');
-define('FIMA_SORT_ACCOUNT', 'account_number');
-define('FIMA_SORT_AMOUNT', 'amount');
-define('FIMA_SORT_DESC', 'desc');
-
-/**
- * Order by.
- */
-define('FIMA_SORT_ASCEND', 0);
-define('FIMA_SORT_DESCEND', 1);
-
-/**
- * Account types.
- */
-define('FIMA_ACCOUNTTYPE_ASSET', 'asset');
-define('FIMA_ACCOUNTTYPE_INCOME', 'income');
-define('FIMA_ACCOUNTTYPE_EXPENSE', 'expense');
-
-/**
- * Posting types.
- */
-define('FIMA_POSTINGTYPE_ACTUAL', 'actual');
-define('FIMA_POSTINGTYPE_FORECAST', 'forecast');
-define('FIMA_POSTINGTYPE_BUDGET', 'budget');
-
-/**
- * Fima Base Class.
- *
- * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima {
-
- /**
- * Retrieves the current user's ledgers from storage.
- * This function will also sort the resulting list, if requested.
- *
- * @param boolean $filters Filters for accounts.
- *
- * @return array A list of the requested accounts.
- *
- * @see Fima_Driver::listAccounts()
- */
- function listAccounts($filters = array())
- {
- $ledger = Fima::getActiveLedger();
-
- /* Create a Fima storage instance. */
- $storage = &Fima_Driver::singleton($ledger);
- $storage->retrieveAccounts($filters);
-
- /* Retrieve the accounts from storage. */
- $accounts = $storage->listAccounts();
- if (is_a($accounts, 'PEAR_Error')) {
- return $accounts;
- }
-
- return $accounts;
- }
-
- function getAccount($account)
- {
- $ledger = Fima::getActiveLedger();
- $storage = &Fima_Driver::singleton($ledger);
- return $storage->getAccount($account);
- }
-
- /**
- * Retrieves the current user's postings from storage.
- *
- * @param boolean $filters Filters for postings.
- * @param integer $page Page/Recordsset to display.
- *
- * @return array A list of the requested postings.
- *
- * @see Fima_Driver::listPostings()
- */
- function listPostings($filters = array(), $page = null)
- {
- global $prefs;
-
- $ledger = Fima::getActiveLedger();
- $postingtype = $prefs->getValue('active_postingtype');
- if ($page == 0) {
- $limit = null;
- } else {
- $limit = array($page, (int)$prefs->getValue('max_postings'));
- }
-
- /* Create a Fima storage instance. */
- $storage = &Fima_Driver::singleton($ledger);
- $storage->retrievePostings($filters,
- array('posting_' . $prefs->getValue('sortby') . ' ' . ($prefs->getValue('sortdir') ? 'DESC' : 'ASC'),
- 'posting_' . $prefs->getValue('altsortby')),
- $limit);
-
- /* Retrieve the accounts from storage. */
- $postings = $storage->listPostings();
- if (is_a($postings, 'PEAR_Error')) {
- return $postings;
- }
-
- return $postings;
- }
-
- /**
- * Get the total number of postings with the selected filters.
- *
- * @return int The total number of postings.
- */
- function getPostingsCount()
- {
- $ledger = Fima::getActiveLedger();
-
- /* Create a Fima storage instance. */
- $storage = &Fima_Driver::singleton($ledger);
- return $storage->_postingsCount;
- }
-
-
- /**
- * Get grouped results from storage.
- *
- * @param array $groups Fields to group.
- * @param boolean $filters Filters for postings.
- *
- * @return array A matrix of the grouped results.
- *
- * @see Fima_Driver::listPostings()
- */
- function getResults($groups = array(), $filters = array()) {
- $ledger = Fima::getActiveLedger();
-
- /* Create a Fima storage instance. */
- $storage = &Fima_Driver::singleton($ledger);
- return $storage->getResults($groups, $filters);
- }
-
- /**
- * Get the results of all asset accounts.
- *
- * @param string $postingtype Type of postings.
- * @param boolean $perdate Date of asset results.
- *
- * @return array Array of asset accounts and results
- */
- function getAssetResults($postingtype, $perdate = null)
- {
- $ledger = Fima::getActiveLedger();
-
- /* Create a Fima storage instance. */
- $storage = &Fima_Driver::singleton($ledger);
- return $storage->getAssetResults($postingtype, $perdate);
- }
-
- /**
- * Get the total result of postings with the selected filters.
- *
- * @return float The total result of postings.
- */
- function getPostingsResult()
- {
- $ledger = Fima::getActiveLedger();
-
- /* Create a Fima storage instance. */
- $storage = &Fima_Driver::singleton($ledger);
- return $storage->_postingsResult;
- }
-
- /**
- * Lists all ledgers a user has access to.
- *
- * @param boolean $owneronly Only return ledgers that this user owns?
- * Defaults to false.
- * @param integer $permission The permission to filter ledgers by.
- *
- * @return array The list of ledgers.
- */
- function listLedgers($owneronly = false, $permission = Horde_Perms::SHOW)
- {
- $ledgers = $GLOBALS['fima_shares']->listShares($GLOBALS['registry']->getAuth(), $permission, $owneronly ? $GLOBALS['registry']->getAuth() : null);
- if (is_a($ledgers, 'PEAR_Error')) {
- Horde::logMessage($ledgers, 'ERR');
- return array();
- }
-
- return $ledgers;
- }
-
- /**
- * Returns the active ledger for the current user.
- */
- function getActiveLedger($permission = Horde_Perms::SHOW)
- {
- global $prefs;
-
- $active_ledger = $prefs->getValue('active_ledger');
- $ledgers = Fima::listLedgers(false, $permission);
-
- if (isset($ledgers[$active_ledger])) {
- return $active_ledger;
- } elseif ($prefs->isLocked('active_ledger')) {
- return false;
- } elseif (count($ledgers)) {
- return key($ledgers);
- }
-
- return false;
- }
-
- /**
- * Get parent account number
- */
- function getAccountParent($accountNumber)
- {
- if ($accountNumber % 100 == 0) {
- $parent = null;
- } else {
- $parent = sprintf('%\'04d', (int)($accountNumber / 100) * 100);
- }
- return $parent;
- }
-
- /**
- * Builds the HTML for a account selection widget.
- *
- * @param string $name The name of the widget.
- * @param mixed $value The value(s) to select by default.
- * @param string $params Any additional parameters to include in the <select> tag.
- * @param mixed $blank False or label of blank entry.
- * @param boolean $multiple Shall multiple selections be enabled?
- * @param array $filters Filters for acconuts.
- * @param boolean $hideclosed Do not include closed accounts.
- *
- * @return string The HTML <select> widget.
- */
- function buildAccountWidget($name, $value = '', $params = null, $blank = false, $multiple = false, $filters = array(), $hideclosed = false)
- {
- $accounts = Fima::listAccounts($filters);
-
- $html = '<select id="' . $name . '" name="' . $name . '"';
- if (!is_null($params)) {
- $html .= ' ' . $params;
- }
- if ($multiple) {
- $html .= ' multiple="multiple" size="' . min(5, count($accounts)). '"';
- }
- $html .= '>';
- if ($blank !== false) {
- $html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
- }
-
- $accounts = Fima::listAccounts($filters);
- foreach ($accounts as $accountId => $account) {
- if ($hideclosed && $account['closed'] && $accountId != $value) {
- continue;
- }
- $html .= '<option value="' . $accountId . '" class="' . ($account['eo'] ? 'eo' : '') . $account['type'] . ' ' . ($account['closed'] ? 'closed' : '') . '"';
- if ($multiple && is_array($value)) {
- $html .= (in_array($accountId, $value)) ? ' selected="selected">' : '>';
- } else {
- $html .= ($accountId == $value) ? ' selected="selected">' : '>';
- }
- $html .= htmlspecialchars($account['label']) . '</option>';
- }
-
- return $html . "</select>\n";
- }
-
- /**
- * Builds the HTML for a account type selection widget.
- *
- * @param string $name The name of the widget.
- * @param string $value The value to select by default.
- * @param string $params Any additional parameters to include in the <select >tag.
- * @param boolean $blank Shall a blank entry be added?
- * @param boolean $multiple Shall multiple selections be inabled?
- *
- * @return string The HTML <select> widget.
- */
- function buildAccountTypeWidget($name, $value = '', $params = null, $blank = false, $multiple = false)
- {
- $types = Fima::getAccountTypes();
-
- $html = '<select id="' . $name . '" name="' . $name . '"';
- if (!is_null($params)) {
- $html .= ' ' . $params;
- }
- if ($multiple) {
- $html .= ' multiple="multiple" size="' . min(5, count($types)). '"';
- }
- $html .= '>';
- if ($blank !== false) {
- $html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
- }
-
- foreach ($types as $typeValue => $typeLabel) {
- $html .= '<option value="' . $typeValue . '"';
- if ($multiple && is_array($value)) {
- $html .= (in_array($accountId, $value)) ? ' selected="selected">' : '>';
- } else {
- $html .= ($typeValue == $value) ? ' selected="selected">' : '>';
- }
- $html .= htmlspecialchars($typeLabel) . '</option>';
- }
-
- return $html . "</select>\n";
- }
-
- /**
- * Builds the HTML for a posting type selection widget.
- *
- * @param string $name The name of the widget.
- * @param string $value The value to select by default.
- * @param string $params Any additional parameters to include in the <select >tag.
- * @param boolean $blank Shall a blank entry be added?
- * @param boolean $multiple Shall multiple selections be inabled?
- *
- * @return string The HTML <select> widget.
- */
- function buildPostingTypeWidget($name, $value = '', $params = null, $blank = false, $multiple = false)
- {
- $types = Fima::getPostingTypes();
-
- $html = '<select id="' . $name . '" name="' . $name . '"';
- if (!is_null($params)) {
- $html .= ' ' . $params;
- }
- if ($multiple) {
- $html .= ' multiple="multiple" size="' . min(5, count($types)). '"';
- }
- $html .= '>';
- if ($blank !== false) {
- $html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
- }
-
- foreach ($types as $typeValue => $typeLabel) {
- $html .= '<option value="' . $typeValue . '"';
- if ($multiple && is_array($value)) {
- $html .= (in_array($accountId, $value)) ? ' selected="selected">' : '>';
- } else {
- $html .= ($typeValue == $value) ? ' selected="selected">' : '>';
- }
- $html .= htmlspecialchars($typeLabel) . '</option>';
- }
-
- return $html . "</select>\n";
- }
-
- /**
- * Builds the HTML for a date selection widget.
- *
- * @param string $name The name of the widget.
- * @param integer $value The value to select by default.
- * @param string $params Any additional parameters to include in the <select> tag.
- * @param boolean $blank Shall a blank entry be added?
- * @param string $periodonly Don't display the day input field
- *
- * @return string The HTML <select> widget.
- */
- function buildDateWidget($name, $value = 0, $params = null, $blank = false, $periodonly = false)
- {
- $value = ($value !== 0) ? explode('-', date('Y-n-j', $value)) : array(date('Y'), 0, 0);
-
- /* Year. */
- $html = '<input id="' . $name . '[year]" name="' . $name . '[year]" type="text" value="' . $value[0] . '" onchange="updateWday(\'' . $name . '\');" size="4" maxlength="4"';
- if (!is_null($params)) {
- $html .= ' ' . $params;
- }
- $html .= ' />' . "\n";
-
- /* Month. */
- $html .= '- <select id="' . $name . '[month]" name="' . $name . '[month]" onchange="updateWday(\'' . $name . '\');"';
- if (!is_null($params)) {
- $html .= ' ' . $params;
- }
- $html .= '>';
- if ($blank !== false) {
- $html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
- }
- for ($i = 1; $i < 13; ++$i) {
- $html .= '<option value="' . $i . '"';
- $html .= ($i == $value[1]) ? ' selected="selected">' : '>';
- $html .= htmlspecialchars(strftime('%b', mktime(0, 0, 0, $i, 1))) . '</option>';
- }
- $html .= '</select>' . "\n";
-
- /* Period only? */
- if ($periodonly) {
- return $html;
- }
-
- /* Day. */
- $html .= '- <select id="' . $name . '[day]" name="' . $name . '[day]" onchange="updateWday(\'' . $name . '\');"';
- if (!is_null($params)) {
- $html .= ' ' . $params;
- }
- $html .= '>';
- if ($blank !== false) {
- $html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
- }
- for ($i = 1; $i < 32; ++$i) {
- $html .= '<option value="' . $i . '"';
- $html .= ($i == $value[2]) ? ' selected="selected">' : '>';
- $html .= $i . '</option>';
- }
- $html .= '</select>' . "\n";
-
- return $html;
- }
-
- /**
- * Get account types.
- *
- * @param string $accountType Get a specific account type or all.
- *
- * @return mixed Array of account types or a specific account type.
- */
- function getAccountTypes($accountType = null)
- {
- $types = array(FIMA_ACCOUNTTYPE_ASSET => _("Asset"),
- FIMA_ACCOUNTTYPE_INCOME => _("Income"),
- FIMA_ACCOUNTTYPE_EXPENSE => _("Expense"));
-
- if ($accountType !== null) {
- if (isset($types[$accountType])) {
- return $types[$accountType];
- } else {
- return null;
- }
- } else {
- return $types;
- }
- }
-
- /**
- * Get posting types.
- *
- * @param string $postingType Get a specific posting type or all.
- *
- * @return mixed Array of posting types or a specific posting type.
- */
- function getPostingTypes($postingType = null)
- {
- $types = array(FIMA_POSTINGTYPE_ACTUAL => _("Actual"),
- FIMA_POSTINGTYPE_FORECAST => _("Forecast"),
- FIMA_POSTINGTYPE_BUDGET => _("Budget"));
-
- if ($postingType !== null) {
- if (isset($types[$postingType])) {
- return $types[$postingType];
- } else {
- return null;
- }
- } else {
- return $types;
- }
- }
-
- /**
- * Convert an amount from the interface to a float value.
- *
- * @param string $amount Amount to convert.
- *
- * @return float Float value of the amount.
- */
- function convertAmountToValue($amount)
- {
- global $prefs;
-
- $format = $prefs->getValue('amount_format');
- return (float)str_replace(array($format{0}, $format{1}), array('', '.'), $amount);
- }
-
- /**
- * Convert a float number to an amount for the interface.
- *
- * @param float $value Float value to convert.
- *
- * @return string Amount.
- */
- function convertValueToAmount($value)
- {
- global $prefs;
-
- $format = $prefs->getValue('amount_format');
- return number_format($value, 2, $format{1}, $format{0});
- }
-
- /*
- * Convert a formatted date to a unix timestamp.
- *
- * @param string $date Formatted date.
- * @param string $format Date format.
- *
- * @return int Unix timestamp.
- */
- function convertDateToStamp($date, $format)
- {
- if ($date == '') {
- return false;
- }
-
- if (preg_match('/[^%a-zA-Z]/', $format, $seperator) === false) {
- return false;
- }
-
- $formatparts = explode($seperator[0], $format);
- $dateparts = explode($seperator[0], $date);
-
- foreach ($formatparts as $key => $fmt) {
- $dateparts[$fmt] = $dateparts[$key];
- }
-
- $stamp = mktime(0, 0, 0, $dateparts['%m'], $dateparts['%d'], $dateparts['%Y']);
-
- return $stamp;
- }
-
- /**
- * Convert a date format to a format useable when entering postings.
- *
- * @param string $format Date format.
- *
- * @return string The converted date format.
- */
- function convertDateFormat($format)
- {
- switch($format) {
- case '%x':
- case '%Y-%m-%d':
- case '%d/%m/%Y':
- case '%d.%m.%Y':
- case '%m/%d/%Y':
- break;
- case '%a %Y-%m-%d':
- $format = '%Y-%m-%d';
- break;
- case '%A, %d %B %Y':
- case '%a, %e %b %Y':
- case '%a, %e %b %y':
- case '%a %d %b %Y':
- case '%e %b %Y':
- case '%e. %m %Y':
- $format = '%d/%m/%Y';
- break;
- case '%A, %d. %B %Y':
- case '%e. %b %Y':
- case '%e. %m.':
- case '%e. %B':
- case '%e. %B %Y':
- case '%e. %B %y':
- $format = '%d.%m.%Y';
- break;
- case '%A %B %d, %Y':
- case '%a, %b %e, %Y':
- case '%a, %b %e, %y':
- case '%a, %b %e':
- case '%B %e, %Y':
- $format = '%m/%d/%Y';
- break;
- case '%a %x':
- default:
- $format = '%x';
- break;
- }
-
- if ($format == '%x') {
- $fmts = array('%Y-%m-%d', '%d/%m/%Y', '%d.%m.%Y', '%m/%d/%Y');
- foreach ($fmts as $fmt) {
- if (strftime($format) == strftime($fmt)) {
- $format = $fmt;
- break;
- }
- }
- if ($format == '%x') {
- $format = $fmts[0];
- }
- }
-
- return $format;
- }
-
- /**
- * Convert a date format to a period format useable for reports.
- *
- * @param string $format Date format.
- *
- * @return string The converted period format.
- */
- function convertDateToPeriodFormat($format)
- {
- if ($format == '%x') {
- $fmts = array('%Y-%m-%d', '%d/%m/%Y', '%d.%m.%Y', '%m/%d/%Y');
- foreach ($fmts as $fmt) {
- if (strftime($format) == strftime($fmt)) {
- $format = $fmt;
- break;
- }
- }
- if ($format == '%x') {
- $format = $fmts[0];
- }
- }
- $format .= ' ';
-
- $p = preg_match_all('/(%[YymBb])(.)/', $format, $matches);
- $format = '';
- for ($i = 0; $i < $p; $i++) {
- $format .= $matches[1][$i] . (($i < $p - 1) ? $matches[2][$i] : '');
- }
-
- return $format;
- }
-
- /**
- * Convert wildcards in a text to SQL wildcards.
- *
- * @param string $text Text containing wildcards.
- *
- * @return string Converted text with SQL wildcards.
- */
- function convertWildcards($text)
- {
- global $prefs;
-
- $wildcards = $prefs->getValue('wildcard_format');
- if ($wildcards == 'dos') {
- $text = str_replace(array('\\*', '\\?'), array(chr(0xe), chr(0xf)), $text);
- $text = str_replace(array('%', '_'), array('\\%', '\\_'), $text);
- $text = str_replace(array('*', '?'), array('%', '_'), $text);
- $text = str_replace(array(chr(0xe), chr(0xf)), array('*', '?'), $text);
- } elseif ($wildcards == 'sql') {
- } elseif ($wildcards == 'none') {
- $text = str_replace(array('%', '_'), array('\\%', '\\_'), $text);
- }
- return $text;
- }
-
- /**
- * Initial app setup code.
- */
- function initialize()
- {
- /* Store the request timestamp if it's not already present. */
- if (!isset($_SERVER['REQUEST_TIME'])) {
- $_SERVER['REQUEST_TIME'] = time();
- }
-
- // Update the preference for what ledgers to display. If the user
- // doesn't have any selected ledger for view then fall back to
- // some available ledger.
- $GLOBALS['display_ledgers'] = @unserialize($GLOBALS['prefs']->getValue('display_ledgers'));
- if (!$GLOBALS['display_ledgers']) {
- $GLOBALS['display_ledgers'] = array();
- }
- if (($ledgerId = Horde_Util::getFormData('display_ledger')) !== null) {
- if (is_array($ledgerId)) {
- $GLOBALS['display_ledgers'] = $ledgerId;
- } else {
- if (in_array($ledgerId, $GLOBALS['display_ledgers'])) {
- $key = array_search($ledgerId, $GLOBALS['display_ledgers']);
- unset($GLOBALS['display_ledgers'][$key]);
- } else {
- $GLOBALS['display_ledgers'][] = $ledgerId;
- }
- }
- }
-
- // Make sure all ledgers exist now, to save on checking later.
- $_temp = $GLOBALS['display_ledgers'];
- $GLOBALS['all_ledgers'] = Fima::listLedgers();
- $GLOBALS['display_ledgers'] = array();
- foreach ($_temp as $id) {
- if (isset($GLOBALS['all_ledgers'][$id])) {
- $GLOBALS['display_ledgers'][] = $id;
- }
- }
-
- if (count($GLOBALS['display_ledgers']) == 0) {
- $ledgerss = Fima::listLedgers(true);
- if (!$GLOBALS['registry']->getAuth()) {
- /* All ledgers for guests. */
- $GLOBALS['display_ledgers'] = array_keys($ledgers);
- } else {
- /* Make sure at least the active ledger is visible. */
- $active_ledger = Fima::getActiveLedger(Horde_Perms::READ);
- if ($active_ledger) {
- $GLOBALS['display_ledgers'] = array($active_ledger);
- }
-
- /* If the user's personal ledger doesn't exist, then create it. */
- if (!$GLOBALS['fima_shares']->exists($GLOBALS['registry']->getAuth())) {
- $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
- $name = $identity->getValue('fullname');
- if (trim($name) == '') {
- $name = $GLOBALS['registry']->getAuth('original');
- }
- $share = &$GLOBALS['fima_shares']->newShare($GLOBALS['registry']->getAuth());
- $share->set('name', sprintf(_("%s's Ledger"), $name));
- $GLOBALS['fima_shares']->addShare($share);
-
- /* Make sure the personal ledger is displayed by default. */
- if (!in_array($GLOBALS['registry']->getAuth(), $GLOBALS['display_ledgers'])) {
- $GLOBALS['display_ledgers'][] = $GLOBALS['registry']->getAuth();
- }
- }
- }
- }
-
- $GLOBALS['prefs']->setValue('display_ledgers', serialize($GLOBALS['display_ledgers']));
-
- /* Update active ledger. */
- if (($changeledger = Horde_Util::getFormData('changeledger')) !== null) {
- $GLOBALS['prefs']->setValue('active_ledger', $changeledger);
- }
- }
-
- /**
- * Build Fima's list of menu items.
- */
- function getMenu()
- {
- global $conf, $browser, $print_link;
-
- $actionID = Horde_Util::getFormData('actionID');
- $hordeimg = Horde_Themes::img(null, 'horde');
-
- $menu = new Horde_Menu(Horde_Menu::MASK_ALL);
- $menu->add(Horde::url('postings.php'), _("_List Postings"), 'list.png', null, null, null, (basename($_SERVER['PHP_SELF']) == 'index.php' && basename(dirname($_SERVER['PHP_SELF'])) != 'ledgers') ? 'current' : ($actionID === null ? null : '__noselection'));
- $menu->add(Horde_Util::addParameter(Horde::url('postings.php'), 'actionID', 'add_postings'), _("Add _Postings"), 'add.png', null, null, null, $actionID == 'add_postings' ? 'current' : '__noselection');
- $menu->add(Horde::url('search.php'), _("Search"), 'search.png', $hordeimg);
- $menu->add(Horde::url('accounts.php'), _("_Accounts"), 'accounts.png');
-
- if ($GLOBALS['registry']->getAuth()) {
- $menu->add(Horde::url('ledgers/index.php'), _("_My Ledgers"), 'accounts.png');
- }
-
- /* Reports. */
- $menu->add(Horde::url('report.php'), _("_Reports"), 'report.png');
-
- /* Import/Export. */
- $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png', $hordeimg);
-
- /* Print. */
- if (isset($print_link)) {
- $menu->add($print_link, _("_Print"), 'print.png', $hordeimg, '_blank', Horde::popupJs($print_link, array('urlencode' => true)) . 'return false;', '__noselection');
- }
-
- return $menu;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Horde_Form for creating ledgers.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Horde_Form */
-require_once 'Horde/Form.php';
-
-/** Horde_Form_Renderer */
-require_once 'Horde/Form/Renderer.php';
-
-/**
- * The Fima_CreateLedgerForm class provides the form for
- * creating a ledger.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_CreateLedgerForm extends Horde_Form {
-
- function Fima_CreateLedgerForm(&$vars)
- {
- parent::Horde_Form($vars, _("Create Ledger"));
-
- $this->addVariable(_("Name"), 'name', 'text', true);
- $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
-
- $this->setButtons(array(_("Create")));
- }
-
- function execute()
- {
- // Create new share.
- $ledger = $GLOBALS['fima_shares']->newShare(strval(new Horde_Support_Uuid()));
- if (is_a($ledger, 'PEAR_Error')) {
- return $ledger;
- }
- $ledger->set('name', $this->_vars->get('name'));
- $ledger->set('desc', $this->_vars->get('description'));
- return $GLOBALS['fima_shares']->addShare($ledger);
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Horde_Form for deleting ledgers.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Horde_Form */
-require_once 'Horde/Form.php';
-
-/** Horde_Form_Renderer */
-require_once 'Horde/Form/Renderer.php';
-
-/**
- * The Fima_DeleteLedgerForm class provides the form for
- * deleting a ledger.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_DeleteLedgerForm extends Horde_Form {
-
- /**
- * Ledger being deleted
- */
- var $_ledger;
-
- function Fima_DeleteLedgerForm(&$vars, &$ledger)
- {
- $this->_ledger = &$ledger;
- parent::Horde_Form($vars, sprintf(_("Delete %s"), $ledger->get('name')));
-
- $this->addHidden('', 'l', 'text', true);
- $this->addVariable(sprintf(_("Really delete the ledger \"%s\"? This cannot be undone and all data on this ledger will be permanently removed."), $this->_ledger->get('name')), 'desc', 'description', false);
-
- $this->setButtons(array(_("Delete"), _("Cancel")));
- }
-
- function execute()
- {
- // If cancel was clicked, return false.
- if ($this->_vars->get('submitbutton') == _("Cancel")) {
- return false;
- }
-
- if ($this->_ledger->get('owner') != $GLOBALS['registry']->getAuth()) {
- return PEAR::raiseError(_("Permission denied"));
- }
-
- // Delete the ledger.
- $storage = &Fima_Driver::singleton($this->_ledger->getName());
- $result = $storage->deleteAll();
- if (is_a($result, 'PEAR_Error')) {
- return PEAR::raiseError(sprintf(_("Unable to delete \"%s\": %s"), $this->_ledger->get('name'), $result->getMessage()));
- } else {
- // Remove share and all groups/permissions.
- $result = $GLOBALS['fima_shares']->removeShare($this->_ledger);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- }
-
- // Make sure we still own at least one ledger.
- if (count(Fima::listLedgers(true)) == 0) {
- // If the default share doesn't exist then create it.
- if (!$GLOBALS['fima_shares']->exists($GLOBALS['registry']->getAuth())) {
- $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
- $name = $identity->getValue('fullname');
- if (trim($name) == '') {
- $name = $GLOBALS['registry']->getAuth('original');
- }
- $ledger = &$GLOBALS['fima_shares']->newShare($GLOBALS['registry']->getAuth());
- if (is_a($ledger, 'PEAR_Error')) {
- return;
- }
- $ledger->set('name', sprintf(_("%s's Ledger"), $name));
- $GLOBALS['fima_shares']->addShare($ledger);
- }
- }
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Horde_Form for editing ledgers.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Horde_Form */
-require_once 'Horde/Form.php';
-
-/** Horde_Form_Renderer */
-require_once 'Horde/Form/Renderer.php';
-
-/**
- * The Fima_EditLedgerForm class provides the form for
- * editing a ledger.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_EditLedgerForm extends Horde_Form {
-
- /**
- * Ledger being edited
- */
- var $_ledger;
-
- function Fima_EditLedgerForm(&$vars, &$ledger)
- {
- $this->_ledger = &$ledger;
- parent::Horde_Form($vars, sprintf(_("Edit %s"), $ledger->get('name')));
-
- $this->addHidden('', 'l', 'text', true);
- $this->addVariable(_("Name"), 'name', 'text', true);
- $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
-
- $this->setButtons(array(_("Save")));
- }
-
- function execute()
- {
- $this->_ledger->set('name', $this->_vars->get('name'));
- $this->_ledger->set('desc', $this->_vars->get('description'));
- $result = $this->_ledger->save();
- if (is_a($result, 'PEAR_Error')) {
- return PEAR::raiseError(sprintf(_("Unable to save ledger \"%s\": %s"), $id, $result->getMessage()));
- }
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * This file contains all Horde_Form extensions required for editing accounts.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Horde_Form */
-require_once 'Horde/Form.php';
-
-/** Horde_Form_Renderer */
-require_once 'Horde/Form/Renderer.php';
-
-/** Horde_Form_Action */
-require_once 'Horde/Form/Action.php';
-
-/**
- * The Fima_AccountForm class provides the form for adding and editing an account.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_AccountForm extends Horde_Form {
-
- function Fima_AccountForm(&$vars, $title = '', $delete = false)
- {
- parent::Horde_Form($vars, $title);
-
- $this->addHidden('', 'actionID', 'text', true);
- $this->addHidden('', 'account_id', 'text', false);
- $this->addHidden('', 'number', 'text', false);
- $this->addHidden('', 'parent_id', 'text', false);
-
- $this->addVariable(_("Number"), 'number_new', 'text', true, false, false, array('/\d{1,4}/', 4, 4));
- $this->addVariable(_("Type"), 'type', 'enum', true, false, false, array(Fima::getAccountTypes()));
- $this->addVariable(_("Name"), 'name', 'text', true);
- $this->addVariable(_("e.o."), 'eo', 'boolean', false);
- $this->addVariable(_("Description"), 'desc', 'longtext', false);
- $this->addVariable(_("Closed"), 'closed', 'boolean', false);
-
- $buttons = array(_("Save"), _("Save and New"));
- if ($delete) {
- $buttons[] = _("Delete this account");
- }
- $this->setButtons($buttons);
- }
-
- function renderActive()
- {
- return parent::renderActive(new Fima_AccountForm_Renderer(array('varrenderer_driver' => array('fima', 'fima')), $this->_submit, 2), $this->_vars, 'account.php', 'post');
- }
-
-}
-
-/**
- * The Fima_AccountDeleteForm class provides the form for deleting an account.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_AccountDeleteForm extends Horde_Form {
-
- function Fima_AccountDeleteForm(&$vars, $title = '', $edit = false)
- {
- parent::Horde_Form($vars, $title);
-
- $this->addHidden('', 'actionID', 'text', true);
- $this->addHidden('', 'account_id', 'text', false);
- $this->addHidden('', 'number', 'text', false);
- $this->addHidden('', 'name', 'text', false);
- $this->addHidden('', 'type', 'text', false);
-
- $this->addVariable(_("Postings"), 'dspostings', 'fima_dspostings', false);
- $this->addVariable(_("Subaccounts"), 'dssubaccounts', 'fima_dssubaccounts', false);
-
- $buttons = array(_("Delete"));
- if ($edit) {
- $buttons[] = _("Edit this account");
- }
- $this->setButtons($buttons);
- }
-
- function renderActive()
- {
- return parent::renderActive(new Fima_AccountForm_Renderer(array('varrenderer_driver' => array('fima', 'fima')), $this->_submit, 1), $this->_vars, 'account.php', 'post');
- }
-
-}
-class Fima_AccountForm_Renderer extends Horde_Form_Renderer {
-
- var $buttons;
- var $buttonspacer;
-
- function Fima_AccountForm_Renderer($params = array(), $buttons = array(), $buttonspacer = 1)
- {
- parent::Horde_Form_Renderer($params);
- $this->buttons = $buttons;
- $this->buttonspacer = $buttonspacer;
- }
-
- function _renderSubmit($submit, $reset)
- {
-?><div class="control" style="padding:1em;">
-<?php foreach($this->buttons as $key => $button): ?>
- <input class="button <?php echo ($key < $this->buttonspacer) ? 'leftFloat' : 'rightFloat' ?>" name="submitbutton" type="submit" value="<?php echo $button ?>" />
-<?php endforeach; ?>
- <br class="clear" />
-</div>
-<?php
- }
-
-}
-
-/**
- * The Horde_Form_Type_fima_dspostings class provides a form field for selecting
- * the handling (delete/shift) of postings when deleting an account.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Horde_Form_Type_fima_dspostings extends Horde_Form_Type {
-
- function getInfo(&$vars, &$var, &$info)
- {
- $ds = $var->getValue($vars);
- if ($ds['type'] == 'delete') {
- $info = true;
- } elseif ($ds['type'] == 'shift') {
- $info = $ds['account'];
- } else {
- $info = false;
- }
- }
-
- function isValid(&$var, &$vars, $value, &$message)
- {
- if ($value['type'] == 'shift' && $value['account'] == $vars->get('account_id')) {
- $message = _("Select another account where to shift postings to.");
- return false;
- }
-
- return true;
- }
-
-}
-
-/**
- * The Horde_Form_Type_fima_dssubaccounts class provides a form field for selecting
- * the handling (delete/shift) of subaccounts when deleting an account.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Horde_Form_Type_fima_dssubaccounts extends Horde_Form_Type {
-
- function getInfo(&$vars, &$var, &$info)
- {
- $ds = $var->getValue($vars);
- if ($ds['type'] == 'none') {
- $info = false;
- } elseif ($ds['type'] == 'delete') {
- $info = true;
- } elseif ($ds['type'] == 'shift') {
- $info = $ds['account'];
- } else {
- $info = false;
- }
- }
-
- function isValid(&$var, &$vars, $value, &$message)
- {
- if ($value['type'] == 'shift' && $value['account'] == $vars->get('account_id')) {
- $message = _("Select another account where to shift subaccount postings to.");
- return false;
- }
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_Report:: defines an API for implementing reports for Fima.
- *
- * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_Report {
-
- /**
- * Hash containing report parameters.
- *
- * @var array
- */
- var $_params = array();
-
- /**
- * Array containing the data after execution of the report.
- *
- * @var mixed
- */
- var $_data = array();
-
- /**
- * Bytes containing the report graph after execution of the report.
- *
- * @var bytes
- */
- var $_graph = null;
-
- /**
- * Constructor - just store the $params in our newly-created
- * object. All other work is done by initialize().
- *
- * @param array $params Any parameters needed for this driver.
- */
- function Fima_Report($params = array(), $errormsg = null)
- {
- $this->_params = $params;
- if (is_null($errormsg)) {
- $this->_errormsg = _("The Finances reports are not currently available.");
- } else {
- $this->_errormsg = $errormsg;
- }
- }
-
- /**
- * Returns a specific report parameter.
- *
- * @param string $param Paramter to retrieve.
- *
- * @return mixed Report parameter
- */
- function getParam($param)
- {
- if (isset($this->_params[$param])) {
- return $this->_params[$param];
- } else {
- return null;
- }
- }
-
- /**
- * Set a specific report parameter.
- *
- * @param string $param Paramter to set.
- * @param mixed $vale Value to set paramter to.
- *
- * @return mixed Report parameter on success, else null
- */
- function setParam($param, $value)
- {
- $this->_params[$param] = $value;
- return $value;
- }
-
- /*
- * Executes the report.
- *
- * @return mixed True or PEAR Error
- */
- function execute()
- {
- $execute = $this->_execute();
- if (is_a($execute, 'PEAR_Error')) {
- return $execute;
- }
-
- /* Log the execution of the report in the history log. */
- $GLOBALS['injector']->getInstance('Horde_History')->log('fima:report:' . $this->_params['report_id'], array('action' => 'execute'), true);
-
- return true;
- }
-
- /**
- * Returns the data after report is executed.
- *
- * @return array Data matrix
- */
- function getData()
- {
- return $this->_data;
- }
-
- /**
- * Output the graph of this report.
- *
- * @return mixed True or PEAR Error
- */
- function getGraph()
- {
- $execute = $this->_getGraph();
- if (is_a($execute, 'PEAR_Error')) {
- return $execute;
- }
-
- require_once FIMA_BASE . '/lib/ReportGraph.php';
- $graph = &Fima_ReportGraph::factory($this->_params['graph'], $this->data, $this->_params);
- if (is_a($graph, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem creating the report graph: %s."), $report->getMessage()), 'horde.error');
- return $graph;
- }
-
- /* Execute report graph. */
- $graph->execute();
- if (is_a($status, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem executing the report graph: %s."), $status->getMessage()), 'horde.error');
- return $status;
- }
-
- $graph->getGraph();
- return true;
- }
-
- /**
- * Initialization of the report.
- *
- * @return boolean True on success; PEAR_Error on failure.
- */
- function initialize()
- {
- }
-
- /**
- * Attempts to return a concrete Fima_Report instance based on $driver.
- *
- * @param string $driver The type of the concrete Fima_Report subclass
- * to return. The class name is based on the
- * storage driver ($driver). The code is
- * dynamically included.
- *
- * @param array $params (optional) A hash containing any additional
- * configuration or connection parameters a
- * subclass might need.
- *
- * @return mixed The newly created concrete Fima_Driver instance, or
- * false on an error.
- */
- function &factory($driver = null, $params = null)
- {
- if ($driver === null) {
- $report = new Fima_Report($params, _("No report driver loaded"));
- return $report;
- }
-
- require_once dirname(__FILE__) . '/Report/' . $driver . '.php';
- $class = 'Fima_Report_' . $driver;
- if (class_exists($class)) {
- $report = new $class($params);
- $result = $report->initialize();
- if (is_a($result, 'PEAR_Error')) {
- $report = new Fima_Report($params, sprintf(_("The Finances reports are not currently available: %s"), $result->getMessage()));
- }
- } else {
- $report = new Fima_Report($params, sprintf(_("Unable to load the definition of %s."), $class));
- }
-
- return $report;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_Report_AccountOverview.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Fima_Report */
-require_once FIMA_BASE . '/lib/Report.php';
-
-/*
- * Fima_Report_AccountOverview class.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_Report_AccountOverview extends Fima_Report {
-
- /*
- * Constructs a new AccountOverview Report.
- */
- function Fima_Report_AccountOverview($params = array())
- {
- $this->_params = $params;
- }
-
- /*
- * Executes the report.
- *
- * @return mixed True or PEAR Error
- */
- function _execute()
- {
- /* Get posting types. */
- $postingtypes = Fima::getPostingTypes();
-
- /* Params. */
- if (($display = $this->getParam('display')) === null) {
- return PEAR::raiseError(_("No display type"));
- }
- $posting_account = $this->getParam('posting_account');
- $period_start = $this->getParam('period_start');
- $period_end = $this->getParam('period_end');
- $reference_start = $this->getParam('reference_start');
- $reference_end = $this->getParam('reference_end');
- $cumulate = $this->getParam('cumulate');
- $nullrows = $this->getParam('nullrows');
- $yearly = $this->getParam('yearly');
- $graph = $this->getParam('graph');
- $datefmt = $yearly ? '%Y' : Fima::convertDateToPeriodFormat($GLOBALS['prefs']->getValue('date_format'));
- $sortby = $this->getParam('sortby');
- $sortdir = $this->getParam('sortdir');
-
- /* Rows. */
- $rows = array();
- for ($period = $period_start; $period <= $period_end; $period = strtotime($yearly ? '+1 year' : '+1 month', $period)) {
- $rows[strftime($yearly ? '%Y' : '%Y%m', $period)] = strftime($datefmt, $period);
- }
-
- /* Columns. */
- $cols = explode('_', $display);
-
- $displaypostingtypes = array();
- $displayreference = false;
- $displaydiffa = false;
- $displaydiffp = false;
-
- $colheaders = array('__header__' => _("Period"));
- $coldummy = array();
- foreach ($cols as $colPos => $colId) {
- if (isset($postingtypes[$colId])) {
- $displaypostingtypes[] = $colId;
- $colheaders[$colId] = $postingtypes[$colId];
- } elseif ($colId == 'reference') {
- $displayreference = true;
- $colheaders[$colId] = _("Reference");
- } elseif ($colId == 'difference') {
- $displaydiffa = $colPos;
- $colheaders[$colId] = _("Difference");
- } elseif ($colId == '%') {
- $displaydiffp = $colPos;
- $colheaders[$colId] = _("Diff. (%)");
- }
- $coldummy[$colId] = 0;
- }
-
-
- /* Initialize matrix. */
- $data = array();
- $data['__headersort__'] = $colheaders;
- foreach ($rows as $rowId => $rowLabel) {
- $data[$rowId] = array('__header__' => $rowLabel) + $coldummy;
- }
-
- /* Results. */
- $total = array('__header__' => _("Total Result")) + $coldummy;
- $filters = array();
- if ($posting_account) {
- $filters[] = array('account', $posting_account);
- }
- $filters[] = array('account_type', FIMA_ACCOUNTTYPE_ASSET, '<>');
- $filters[] = array('type', $cols);
- if ($period_start !== null) {
- $filters[] = array('date', (int)$period_start, '>=');
- }
- if ($period_end !== null) {
- $filters[] = array('date', (int)$period_end, '<=');
- }
- $result = Fima::getResults(array('type', $yearly ? 'date_year' : 'date_month'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $data[$rowId][$colId] = $value;
- $total[$colId] += $value;
- }
- }
- $data['__result__'] = $total;
-
- /* Reference. */
- if ($displayreference) {
- $filters = array();
- if ($posting_account) {
- $filters[] = array('account', $posting_account);
- }
- $filters[] = array('account_type', $rows);
- $filters[] = array('type', $displaypostingtypes[0]);
- if ($reference_start !== null) {
- $filters[] = array('date', (int)$reference_start, '>=');
- }
- if ($reference_end !== null) {
- $filters[] = array('date', (int)$reference_end, '<=');
- }
-
- $result = Fima::getResults(array('type', $yearly ? 'date_year' : 'date_month'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $colId = 'reference';
- $data[$rowId][$colId] = $value;
- $data['__result__'][$colId] += $value;
- }
- }
- }
-
- /* Difference. */
- if ($displaydiffa > 1 || $displaydiffp > 1) {
- $cola1 = $cols[$displaydiffa - 2];
- $cola2 = $cols[$displaydiffa - 1];
- $colp1 = $cols[$displaydiffp - 2];
- $colp2 = $cols[$displaydiffp - 1];
- foreach ($data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- continue;
- }
- if ($displaydiffa > 1) {
- $data[$rowId]['difference'] = $data[$rowId][$cola1] - $data[$rowId][$cola2];
- }
- if ($displaydiffp > 1) {
- if ($data[$rowId][$colp1] != 0) {
- $data[$rowId]['%'] = $data[$rowId][$colp2] / abs($data[$rowId][$colp1]) * 100;
- } else {
- $data[$rowId]['%'] = null;
- }
- }
- }
- }
-
- /* Null Rows and Cumulate. */
- if (!$nullrows || $cumulate) {
- $cumulatevalue = $coldummy;
- foreach ($data as $rowId => $row) {
- if (preg_match('/__(header|result).*__/', $rowId)) {
- continue;
- }
- $isnullrow = true;
- foreach ($row as $colId => $value) {
- if (preg_match('/__(header).*__/', $colId) || $colId == '__resultasset__') {
- continue;
- }
- if ($cumulate) {
- $data[$rowId][$colId] += $cumulatevalue[$colId];
- $cumulatevalue[$colId] = $data[$rowId][$colId];
- }
- if ($data[$rowId][$colId] != 0) {
- $isnullrow = false;
- }
- }
- if (!$nullrows && $isnullrow) {
- unset($data[$rowId]);
- }
- }
- }
-
- /* Sorting. */
- if ($sortby === null || !isset($colheaders[$sortby])) {
- $sortby = $this->setParam('sortby', '__header__');
- }
- if ($sortdir === null) {
- $sortdir = $this->setParam('sortdir', FIMA_SORT_ASCEND);
- }
- if ($graph) {
- $sortby = '__header__';
- $sortdir = FIMA_SORT_ASCEND;
- }
-
- $x = -1;
- $sortIndex = array();
- foreach ($data as $rowId => $row) {
- if (preg_match('/__(header|result).*__/', $rowId)) {
- $x++;
- $sortIndex[$x] = array($rowId => $row[$sortby]);
- $x++;
- } else {
- if (!isset($sortIndex[$x])) {
- $sortIndex[$x] = array();
- }
- $sortIndex[$x][$rowId] = $row[$sortby];
- }
- }
-
- foreach ($sortIndex as $indexId => $indexGroup) {
- if (count($indexGroup) > 0) {
- if ($sortdir) {
- arsort($indexGroup);
- } else {
- asort($indexGroup);
- }
- }
- foreach ($indexGroup as $rowId => $index) {
- $this->_data[$rowId] = $data[$rowId];
- }
- }
-
- return true;
- }
-
- /*
- * Output the graph.
- *
- * @return mixed True or PEAR Error
- */
- function _getGraph()
- {
- /* Data. */
- $display = explode('_', $this->getParam('display'));
- $display = ($display[0] == 'reference') ? $display[1] : $display[0];
- $postingtypes = Fima::getPostingTypes();
-
- $labels = array();
- $data = $this->_data;
- foreach ($data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- foreach ($row as $colId => $value) {
- if (!(preg_match('/__(header|result).*__/', $colId) && $colId != '__resulttotal__')) {
- $labels[$colId] = $value;
- }
- }
- }
- if (preg_match('/__(header|result).*__/', $rowId)) {
- unset($data[$rowId]);
- } else {
- $labels[$rowId] = isset($row['__header__']) ? $row['__header__'] : $rowId;
- foreach ($row as $colId => $value) {
- if (preg_match('/__(header|result).*__/', $colId) && $colId != '__resulttotal__') {
- unset($data[$rowId][$colId]);
- }
- }
- }
- }
- $this->data = $data;
-
- /* Additional params. */
- $this->setParam('graph', 'Line');
- $this->setParam('labels', $labels);
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_Report_Analysis.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Fima_Report */
-require_once FIMA_BASE . '/lib/Report.php';
-
-/*
- * Fima_Report_Analysis class.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_Report_Analysis extends Fima_Report {
-
- /*
- * Constructs a new Analysis Report.
- */
- function Fima_Report_Analysis($params = array())
- {
- $this->_params = $params;
- }
-
- /*
- * Executes the report.
- *
- * @return mixed True or PEAR Error
- */
- function _execute()
- {
- /* Get account types, posting types and accounts. */
- $accounttypes = Fima::getAccountTypes();
- $postingtypes = Fima::getPostingTypes();
- $accounts = Fima::listAccounts();
- $accountIndex = array();
- foreach ($accounts as $accountId => $account) {
- $accountIndex[$account['number']] = $accountId;
- }
- $groups = array(FIMA_ACCOUNTTYPE_INCOME, FIMA_ACCOUNTTYPE_EXPENSE);
-
- /* Params. */
- if (($display = $this->getParam('display')) === null) {
- return PEAR::raiseError(_("No display type"));
- }
- $posting_account = $this->getParam('posting_account');
- $period_start = $this->getParam('period_start');
- $period_end = $this->getParam('period_end');
- $reference_start = $this->getParam('reference_start');
- $reference_end = $this->getParam('reference_end');
- $subaccounts = $this->getParam('subaccounts');
- $nullrows = $this->getParam('nullrows');
- $graph = $this->getParam('graph');
- $sortby = $this->getParam('sortby');
- $sortdir = $this->getParam('sortdir');
-
- /* Rows. */
- // accounts (dynamically)
-
- /* Columns. */
- $cols = explode('_', $display);
-
- $displaypostingtypes = array();
- $displayreference = false;
- $displaydiffa = false;
- $displaydiffp = false;
-
- $colheaders = array('__header__' => _("Account"));
- $coldummy = array();
- foreach ($cols as $colPos => $colId) {
- if (isset($postingtypes[$colId])) {
- $displaypostingtypes[] = $colId;
- $colheaders[$colId] = $postingtypes[$colId];
- } elseif ($colId == 'reference') {
- $displayreference = true;
- $colheaders[$colId] = _("Reference");
- } elseif ($colId == 'difference') {
- $displaydiffa = $colPos;
- $colheaders[$colId] = _("Difference");
- } elseif ($colId == '%') {
- $displaydiffp = $colPos;
- $colheaders[$colId] = _("Diff. (%)");
- }
- $coldummy[$colId] = 0;
- }
-
- /* Initialize matrix. */
- $data = array();
- $data['__headersort__'] = $colheaders;
- $datagroups = array(FIMA_ACCOUNTTYPE_INCOME => array(), FIMA_ACCOUNTTYPE_EXPENSE => array());
- // add parent accounts
- if ($posting_account) {
- foreach ($posting_account as $accountId => $account) {
- if ($accounts[$account]['parent_id']) {
- $posting_account[] = $accounts[$account]['parent_id'];
- }
- }
- }
- foreach ($accounts as $accountId => $account) {
- if ($posting_account) {
- if (!in_array($account['account_id'], $posting_account)) {
- continue;
- }
- }
- if ($account['type'] == FIMA_ACCOUNTTYPE_ASSET) {
- continue;
- }
- if ($account['parent_id'] === null || !isset($accounts[$account['parent_id']])) {
- $datagroups[$account['type']][$account['number']] = array('__header__' => $account['label']) + $coldummy;
- if ($subaccounts) {
- $datagroups[$account['type']][$account['number']]['__subaccounts__'] = array();
- }
- } elseif ($subaccounts) {
- $datagroups[$account['type']][$accounts[$account['parent_id']]['number']]['__subaccounts__'][$account['number']] = array('__header__' => ' '.$account['label']) + $coldummy;
- }
- }
- foreach ($datagroups as $datagroupId => $datagroup) {
- $datagroups[$datagroupId]['__result' . $datagroupId . '__'] = array('__header__' => sprintf(_("%s Result"), $accounttypes[$datagroupId])) + $coldummy;
- $data += $datagroups[$datagroupId];
- }
-
- /* Results. */
- foreach ($groups as $group) {
- $filters = array();
- if ($posting_account) {
- $filters[] = array('account', $posting_account);
- }
- $filters[] = array('account_type', $group);
- $filters[] = array('type', $displaypostingtypes);
- if ($period_start !== null) {
- $filters[] = array('date', (int)$period_start, '>=');
- }
- if ($period_end !== null) {
- $filters[] = array('date', (int)$period_end, '<=');
- }
-
- $result = Fima::getResults(array('type', $subaccounts ? 'account_number' : 'account_parent'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- if (isset($data[$rowId])) {
- $data[$rowId][$colId] += $value;
- } elseif (($parentId = $accounts[$accountIndex[$rowId]]['parent_id']) !== null) {
- if (!$graph) {
- $data[$accounts[$parentId]['number']][$colId] += $value;
- }
- $data[$accounts[$parentId]['number']]['__subaccounts__'][$rowId][$colId] += $value;
- }
- $data['__result' . $group . '__'][$colId] += $value;
- }
- }
- }
-
- /* Reference. */
- if ($displayreference) {
- foreach ($groups as $group) {
- $groupresult = array();
-
- $filters = array();
- if ($posting_account) {
- $filters[] = array('account', $posting_account);
- }
- $filters[] = array('account_type', $group);
- $filters[] = array('type', $displaypostingtypes);
- if (($reference_start = $this->getParam('reference_start')) !== null) {
- $filters[] = array('date', (int)$reference_start, '>=');
- }
- if (($reference_end = $this->getParam('reference_end')) !== null) {
- $filters[] = array('date', (int)$reference_end, '<=');
- }
-
- $result = Fima::getResults(array('type', $subaccounts ? 'account_number' : 'account_parent'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $colId = 'reference';
- if (isset($data[$rowId])) {
- $data[$rowId][$colId] += $value;
- } elseif (($parentId = $accounts[$accountIndex[$rowId]]['parent_id']) !== null) {
- $data[$accounts[$parentId]['number']][$colId] += $value;
- $data[$accounts[$parentId]['number']]['__subaccounts__'][$rowId][$colId] += $value;
- }
- $data['__result' . $group . '__'][$colId] += $value;
- }
- }
- }
- }
-
- /* Totals. */
- $data['__resulttotal__'] = array('__header__' => _("Total Result")) + $coldummy;
- foreach ($cols as $colId) {
- foreach ($groups as $groupId => $group) {
- $data['__resulttotal__'][$colId] += $data['__result' . $group . '__'][$colId];
- }
- }
-
- /* Difference. */
- if ($displaydiffa > 1 || $displaydiffp > 1) {
- $cola1 = $cols[$displaydiffa - 2];
- $cola2 = $cols[$displaydiffa - 1];
- $colp1 = $cols[$displaydiffp - 2];
- $colp2 = $cols[$displaydiffp - 1];
- foreach ($data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- continue;
- }
- if ($displaydiffa > 1) {
- $data[$rowId]['difference'] = $data[$rowId][$cola1] - $data[$rowId][$cola2];
- }
- if ($displaydiffp > 1) {
- if ($data[$rowId][$colp1] != 0) {
- $data[$rowId]['%'] = $data[$rowId][$colp2] / abs($data[$rowId][$colp1]) * 100;
- } else {
- $data[$rowId]['%'] = null;
- }
- }
- }
- }
-
- /* Null Rows. */
- if (!$nullrows) {
- foreach ($data as $rowId => $row) {
- if (preg_match('/__(header|result).*__/', $rowId)) {
- continue;
- }
- $isnullrow = true;
- foreach ($row as $colId => $value) {
- if (preg_match('/__(header).*__/', $colId) || $colId == '__resultasset__') {
- continue;
- }
- if ($value != 0) {
- $isnullrow = false;
- }
- }
- if (!$nullrows && $isnullrow) {
- unset($data[$rowId]);
- }
- }
- }
-
- /* Sorting. */
- if ($sortby === null || !isset($colheaders[$sortby])) {
- $sortby = $this->setParam('sortby', '__header__');
- }
- if ($sortdir === null) {
- $sortdir = $this->setParam('sortdir', FIMA_SORT_ASCEND);
- }
- $x = -1;
- $sortIndex = array();
- foreach ($data as $rowId => $row) {
- if (preg_match('/__(header|result).*__/', $rowId)) {
- $x++;
- $sortIndex[$x] = array($rowId => $row[$sortby]);
- $x++;
- } else {
- if (!isset($sortIndex[$x])) {
- $sortIndex[$x] = array();
- }
- $sortIndex[$x][$rowId] = $row[$sortby];
- }
- }
-
- foreach ($sortIndex as $indexId => $indexGroup) {
- if (count($indexGroup) > 0) {
- if ($sortdir) {
- arsort($indexGroup);
- } else {
- asort($indexGroup);
- }
- }
- foreach ($indexGroup as $rowId => $index) {
- $this->_data[$rowId] = $data[$rowId];
- if (isset($data[$rowId]['__subaccounts__'])) {
- if (count($data[$rowId]['__subaccounts__']) > 0) {
- $subSortIndex = array();
- foreach ($data[$rowId]['__subaccounts__'] as $subId => $sub) {
- $subSortIndex[$subId] = $sub[$sortby];
- }
- if ($sortdir) {
- arsort($subSortIndex);
- } else {
- asort($subSortIndex);
- }
-
- foreach ($subSortIndex as $subId => $sub) {
- $this->_data[$subId] = $data[$rowId]['__subaccounts__'][$subId];
- }
- }
- }
- unset($this->_data[$rowId]['__subaccounts__']);
- }
- }
-
- return true;
- }
-
- /*
- * Output the graph.
- *
- * @return mixed True or PEAR Error
- */
- function _getGraph()
- {
- /* Data. */
- $display = explode('_', $this->getParam('display'));
-
- $labels = array();
- $data = array();
- $ix = 0;
- foreach ($this->_data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- foreach ($row as $colId => $value) {
- $labels[$colId] = $value;
- }
- } elseif (preg_match('/__(result).*__/', $rowId)) {
- $ix++;
- } else {
- $labels[$rowId] = isset($row['__header__']) ? $row['__header__'] : $rowId;
- if (!isset($data[$ix])) {
- $data[$ix] = array();
- }
- $data[$ix][$rowId] = $row[$display[0]];
- }
- }
-
- // grouping
- $sum = array();
- #for ($i = 0; $i < count($data); $i++) {
- foreach ($data as $i => $d) {
- $sum[$i] = array_sum($data[$i]);
- if ($sum[$i] >= 0) {
- arsort($data[$i]);
- } else {
- asort($data[$i]);
- }
- $topdata = array_slice($data[$i], 0, 5, true);
- $data[$i]['__rest__'] = 0;
- $data[$i]['__blank__'] = ($sum[$i] == 0) ? 0 : $sum[$i] / abs($sum[$i]);
- foreach ($data[$i] as $key => $value) {
- if ((!isset($topdata[$key]) || $value == 0) && $key != '__rest__' && $key != '__blank__') {
- $data[$i]['__rest__'] += $value;
- unset($data[$i][$key]);
- }
- }
- if ($data[$i]['__rest__'] == 0) {
- unset($data[$i]['__rest__']);
- }
- $sum[$i] = abs($sum[$i]);
- }
- $labels['__rest__'] = _("Rest");
- $labels['__blank__'] = _("Difference");
-
- // diff
- $max = max($sum);
- #for ($i = 0; $i < count($sum); $i++) {
- foreach ($sum as $i => $s) {
- if ($max != $sum[$i]) {
- $data[$i]['__blank__'] *= $max - $sum[$i];
- } else {
- unset($data[$i]['__blank__']);
- }
- }
-
- $this->data = $data;
-
- /* Additional params. */
- $this->setParam('graph', 'Pie');
- $this->setParam('labels', $labels);
- $this->setParam('subtitle', $labels[($display[0] == 'reference') ? $display[1] : $display[0]]);
- $this->setParam('marker', true);
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_Report_AssetOverview.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Fima_Report */
-require_once FIMA_BASE . '/lib/Report.php';
-
-/*
- * Fima_Report_AssetOverview class.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_Report_AssetOverview extends Fima_Report {
-
- /*
- * Constructs a new AssetOverview Report.
- */
- function Fima_Report_AssetOverview($params = array())
- {
- $this->_params = $params;
- }
-
- /*
- * Executes the report.
- *
- * @return mixed True or PEAR Error
- */
- function _execute()
- {
- /* Get account types, posting types and accounts. */
- $accounts = Fima::listAccounts(array(array('type', FIMA_ACCOUNTTYPE_ASSET)));
- $accountIndex = array();
- foreach ($accounts as $accountId => $account) {
- $accountIndex[$account['number']] = $accountId;
- }
-
- /* Params. */
- if (($display = $this->getParam('display')) === null) {
- return PEAR::raiseError(_("No display type"));
- }
- $display = explode('_', $display);
- $period_start = ($display[0] == 'reference') ? $this->getParam('reference_start') : $this->getParam('period_start');
- $period_end = ($display[0] == 'reference') ? $this->getParam('reference_end') : $this->getParam('period_end');
- $display = ($display[0] == 'reference') ? $display[1] : $display[0];
- $cumulate = $this->getParam('cumulate');
- $nullrows = $this->getParam('nullrows');
- $subaccounts = $this->getParam('subaccounts');
- $graph = $this->getParam('graph');
- $yearly = $this->getParam('yearly');
- $datefmt = $yearly ? '%Y' : Fima::convertDateToPeriodFormat($GLOBALS['prefs']->getValue('date_format'));
- $sortby = $this->getParam('sortby');
- $sortdir = $this->getParam('sortdir');
-
- /* Rows. */
- // accounts (dynamically)
-
- /* Columns. */
- $cols = array();
- $colheaders = array('__header__' => _("Asset"));
- $coldummy = array();
- for ($period = $period_start; $period <= $period_end; $period = strtotime($yearly ? '+1 year' : '+1 month', $period)) {
- $colId = strftime($yearly ? '%Y' : '%Y%m', $period);
- $cols[] = $colId;
- $colheaders[$colId] = strftime($datefmt, $period);
- $coldummy[$colId] = 0;
- }
- $colheaders['__result__'] = _("Total Result");
- $coldummy['__result__'] = 0;
-
- /* Initialize matrix. */
- $data = array();
- $data['__headersort__'] = $colheaders;
- foreach ($accounts as $accountId => $account) {
- if ($account['parent_id'] === null || !isset($accounts[$account['parent_id']])) {
- $data[$account['number']] = array('__header__' => $account['label']) + $coldummy;
- if ($subaccounts) {
- $data[$account['number']]['__subaccounts__'] = array();
- }
- } elseif ($subaccounts) {
- $data[$accounts[$account['parent_id']]['number']]['__subaccounts__'][$account['number']] = array('__header__' => ' '.$account['label']) + $coldummy;
- }
- }
- $data['__result__'] = array('__header__' => _("Asset Result")) + $coldummy;
-
- /* Initialize asset results. */
- if ($cumulate) {
- $assetresults = Fima::getAssetResults($display, $period_start - 1);
- $period = strftime($yearly ? '%Y' : '%Y%m', $period_start);
- foreach ($assetresults as $assetresult) {
- if (isset($data[$accounts[$assetresult['account_id']]['number']])) {
- $data[$accounts[$assetresult['account_id']]['number']][$period] += $assetresult['account_result'];
- $data[$accounts[$assetresult['account_id']]['number']]['__result__'] += $assetresult['account_result'];
- } elseif (($parentId = $accounts[$assetresult['account_id']]['parent_id']) !== null) {
- $data[$accounts[$parentId]['number']][$period] += $assetresult['account_result'];
- $data[$accounts[$parentId]['number']]['__result__'] += $assetresult['account_result'];
- if ($subaccounts) {
- $data[$accounts[$parentId]['number']]['__subaccounts__'][$accounts[$assetresult['account_id']]['number']][$period] += $assetresult['account_result'];
- $data[$accounts[$parentId]['number']]['__subaccounts__'][$accounts[$assetresult['account_id']]['number']]['__result__'] += $assetresult['account_result'];
- }
- }
- $data['__result__'][$period] += $assetresult['account_result'];
- $data['__result__']['__result__'] += $assetresult['account_result'];
- }
- }
-
- /* Results. */
- $filters = array();
- $filters[] = array('type', $display);
- if ($period_start !== null) {
- $filters[] = array('date', (int)$period_start, '>=');
- }
- if ($period_end !== null) {
- $filters[] = array('date', (int)$period_end, '<=');
- }
-
- // asset accounts
- $result = Fima::getResults(array($yearly ? 'date_year' : 'date_month', $subaccounts ? 'asset_number' : 'asset_parent'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- // asset accounts as posting account
- $filters[] = array('account_type', FIMA_ACCOUNTTYPE_ASSET);
- $result2 = Fima::getResults(array($yearly ? 'date_year' : 'date_month', $subaccounts ? 'account_number' : 'account_parent'), $filters);
- if (is_a($result2, 'PEAR_Error')) {
- return $result2;
- }
- foreach ($result2 as $rowId => $row) {
- if (!isset($result[$rowId])) {
- $result[$rowId] = array();
- }
- foreach ($row as $colId => $value) {
- if (!isset($result[$rowId][$colId])) {
- $result[$rowId][$colId] = 0;
- }
- $result[$rowId][$colId] -= $value;
- }
- }
-
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- if (isset($data[$rowId])) {
- $data[$rowId][$colId] += $value;
- $data[$rowId]['__result__'] += $value;
- } elseif (($parentId = $accounts[$accountIndex[$rowId]]['parent_id']) !== null) {
- $data[$accounts[$parentId]['number']][$colId] += $value;
- $data[$accounts[$parentId]['number']]['__result__'] += $value;
- if ($subaccounts) {
- $data[$accounts[$parentId]['number']]['__subaccounts__'][$rowId][$colId] += $value;
- $data[$accounts[$parentId]['number']]['__subaccounts__'][$rowId]['__result__'] += $value;
- }
- }
- $data['__result__'][$colId] += $value;
- $data['__result__']['__result__'] += $value;
- }
- }
-
- /* Null Rows and Cumulate. */
- if (!$nullrows || $cumulate) {
- foreach ($data as $rowId => $row) {
- if (preg_match('/__(header).*__/', $rowId)) {
- continue;
- }
- $cumulatevalue = 0;
- $isnullrow = true;
- foreach ($row as $colId => $value) {
- if (preg_match('/__(header|result).*__/', $colId)) {
- continue;
- }
- if ($colId == '__subaccounts__') {
- if (count($value) > 0) {
- foreach ($value as $subRowId => $subRow) {
- $subcumulatevalue = 0;
- $subisnullrow = true;
- foreach ($subRow as $subColId => $subValue) {
- if (preg_match('/__(header|result).*__/', $subColId)) {
- continue;
- }
- if ($cumulate) {
- $data[$rowId]['__subaccounts__'][$subRowId][$subColId] += $subcumulatevalue;
- $subcumulatevalue = $data[$rowId]['__subaccounts__'][$subRowId][$subColId];
- }
- if ($data[$rowId]['__subaccounts__'][$subRowId][$subColId] != 0) {
- $subisnullrow = false;
- }
- }
- if (!$nullrows && $subisnullrow) {
- unset($data[$rowId]['__subaccounts__'][$subRowId]);
- }
- }
- }
- } else {
- if ($cumulate) {
- $data[$rowId][$colId] += $cumulatevalue;
- $cumulatevalue = $data[$rowId][$colId];
- }
- if ($data[$rowId][$colId] != 0) {
- $isnullrow = false;
- }
- }
- }
- if (!$nullrows && $isnullrow) {
- unset($data[$rowId]);
- }
- }
- }
-
- /* Sorting. */
- if ($sortby === null || !isset($colheaders[$sortby])) {
- $sortby = $this->setParam('sortby', '__header__');
- }
- if ($sortdir === null) {
- $sortdir = $this->setParam('sortdir', FIMA_SORT_ASCEND);
- }
- $x = -1;
- $sortIndex = array();
- foreach ($data as $rowId => $row) {
- if (preg_match('/__(header|result).*__/', $rowId)) {
- $x++;
- $sortIndex[$x] = array($rowId => $row[$sortby]);
- $x++;
- } else {
- if (!isset($sortIndex[$x])) {
- $sortIndex[$x] = array();
- }
- $sortIndex[$x][$rowId] = $row[$sortby];
- }
- }
-
- foreach ($sortIndex as $indexId => $indexGroup) {
- if (count($indexGroup) > 0) {
- if ($sortdir) {
- arsort($indexGroup);
- } else {
- asort($indexGroup);
- }
- }
- foreach ($indexGroup as $rowId => $index) {
- $this->_data[$rowId] = $data[$rowId];
- if (isset($data[$rowId]['__subaccounts__'])) {
- if (count($data[$rowId]['__subaccounts__']) > 0) {
- $subSortIndex = array();
- foreach ($data[$rowId]['__subaccounts__'] as $subId => $sub) {
- $subSortIndex[$subId] = $sub[$sortby];
- }
- if ($sortdir) {
- arsort($subSortIndex);
- } else {
- asort($subSortIndex);
- }
-
- foreach ($subSortIndex as $subId => $sub) {
- $this->_data[$subId] = $data[$rowId]['__subaccounts__'][$subId];
- }
- }
- }
- unset($this->_data[$rowId]['__subaccounts__']);
- }
- }
-
- return true;
- }
-
- /*
- * Output the graph.
- *
- * @return mixed True or PEAR Error
- */
- function _getGraph()
- {
- /* Data. */
- $display = explode('_', $this->getParam('display'));
- $display = ($display[0] == 'reference') ? $display[1] : $display[0];
- $postingtypes = Fima::getPostingTypes();
-
- $labels = array();
- $data = $this->_data;
- $sum = array();
- foreach ($data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- foreach ($row as $colId => $value) {
- if (!(preg_match('/__(header|result).*__/', $colId) && $colId != '__resulttotal__')) {
- $labels[$colId] = $value;
- }
- }
- }
- if (preg_match('/__(header|result).*__/', $rowId)) {
- unset($data[$rowId]);
- } else {
- $labels[$rowId] = isset($row['__header__']) ? $row['__header__'] : $rowId;
- if ($data[$rowId]['__result__'] != 0) {
- $sum[$rowId] = $data[$rowId]['__result__'];
- }
- unset($data[$rowId]['__header__']);
- unset($data[$rowId]['__result__']);
- }
- }
-
- // grouping
- asort($sum);
- $topdata = array_slice($sum, 0, 5, true) + array_slice($sum, -5, 5, true);
- foreach ($data as $rowId => $row) {
- if (!isset($topdata[$rowId])) {
- unset($data[$rowId]);
- }
- }
-
- $this->data = $data;
-
- /* Additional params. */
- $this->setParam('graph', 'Line');
- $this->setParam('labels', $labels);
- $this->setParam('subtitle', $postingtypes[$display]);
- $this->setParam('invert', true);
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_Report_GeneralOverview.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Fima_Report */
-require_once FIMA_BASE . '/lib/Report.php';
-
-/*
- * Fima_Report_GeneralOverview class.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_Report_GeneralOverview extends Fima_Report {
-
- /*
- * Constructs a new GeneralOverview Report.
- */
- function Fima_Report_GeneralOverview($params = array())
- {
- $this->_params = $params;
- }
-
- /*
- * Executes the report.
- *
- * @return mixed True or PEAR Error
- */
- function _execute()
- {
- /* Get account types and posting types. */
- $accounttypes = Fima::getAccountTypes();
- $postingtypes = Fima::getPostingTypes();
-
- /* Params. */
- if (($display = $this->getParam('display')) === null) {
- return PEAR::raiseError(_("No display type"));
- }
- $posting_account = $this->getParam('posting_account');
- $period_start = $this->getParam('period_start');
- $period_end = $this->getParam('period_end');
- $reference_start = $this->getParam('reference_start');
- $reference_end = $this->getParam('reference_end');
-
- /* Rows. */
- $rows = array(FIMA_ACCOUNTTYPE_INCOME, FIMA_ACCOUNTTYPE_EXPENSE);
- $groups = array('0' => "%s", '1' => "e.o. %s", 'total' => "Total %s");
- $rowheaders = array();
- foreach ($groups as $groupId => $group) {
- foreach ($rows as $rowPos => $rowId) {
- $rowheaders[$rowId . $groupId] = sprintf(_($group), $accounttypes[$rowId]);
- }
- $rowheaders['__result' . $groupId . '__'] = sprintf(_($group), _("Result"));
- }
- $rowheaders['__resultasset__'] = _("Asset Result");
-
- /* Columns. */
- $cols = explode('_', $display);
-
- $displaypostingtypes = array();
- $displayreference = false;
- $displaydiffa = false;
- $displaydiffp = false;
-
- $colheaders = array('__header__' => _("Type"));
- $coldummy = array();
- foreach ($cols as $colPos => $colId) {
- if (isset($postingtypes[$colId])) {
- $displaypostingtypes[] = $colId;
- $colheaders[$colId] = $postingtypes[$colId];
- } elseif ($colId == 'reference') {
- $displayreference = true;
- $colheaders[$colId] = _("Reference");
- } elseif ($colId == 'difference') {
- $displaydiffa = $colPos;
- $colheaders[$colId] = _("Difference");
- } elseif ($colId == '%') {
- $displaydiffp = $colPos;
- $colheaders[$colId] = _("Diff. (%)");
- }
- $coldummy[$colId] = 0;
- }
-
- /* Initialize matrix. */
- $data = array();
- $data['__header__'] = $colheaders;
- foreach ($rowheaders as $rowId => $rowheader) {
- $data[$rowId] = array('__header__' => $rowheader) + $coldummy;;
- }
- $assetresult = array('__header__' => _("Asset Result")) + $coldummy;
-
- /* Results. */
- $groups = array('0', '1');
- foreach ($groups as $group) {
- $filters = array();
- if ($posting_account) {
- $filters[] = array('account', $posting_account);
- }
- $filters[] = array('account_type', $rows);
- $filters[] = array('type', $displaypostingtypes);
- $filters[] = array('eo', $group);
- if ($period_start !== null) {
- $filters[] = array('date', (int)$period_start, '>=');
- }
- if ($period_end !== null) {
- $filters[] = array('date', (int)$period_end, '<=');
- }
-
- $result = Fima::getResults(array('type', 'account_type'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $data[$rowId . $group][$colId] = $value;
- $data['__result' . $group . '__'][$colId] += $value;
- }
- }
- }
-
- // asset results
- $filters = array();
- $filters[] = array('account_type', FIMA_ACCOUNTTYPE_ASSET, '<>');
- $filters[] = array('type', $displaypostingtypes);
- if ($period_end !== null) {
- $filters[] = array('date', (int)$period_end, '<');
- }
-
- $result = Fima::getResults('type', $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $data['__resultasset__'][$colId] = $value;
- }
- }
-
- /* Reference. */
- if ($displayreference) {
- $groups = array('0', '1');
- foreach ($groups as $group) {
- $filters = array();
- if ($posting_account) {
- $filters[] = array('account', $posting_account);
- }
- $filters[] = array('account_type', $rows);
- $filters[] = array('type', $displaypostingtypes[0]);
- $filters[] = array('eo', $group);
- if ($reference_start !== null) {
- $filters[] = array('date', (int)$reference_start, '>=');
- }
- if ($reference_end !== null) {
- $filters[] = array('date', (int)$reference_end, '<=');
- }
-
- $result = Fima::getResults(array('type', 'account_type'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $colId = 'reference';
- $data[$rowId . $group][$colId] = $value;
- $data['__result' . $group . '__'][$colId] += $value;
- }
- }
- }
-
- // asset results
- $filters = array();
- $filters[] = array('account_type', FIMA_ACCOUNTTYPE_ASSET, '<>');
- $filters[] = array('type', $displaypostingtypes[0]);
- if ($reference_end !== null) {
- $filters[] = array('date', (int)$reference_end, '<');
- }
-
- $result = Fima::getResults('type', $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $data['__resultasset__']['reference'] = $value;
- }
- }
- }
-
- /* Totals. */
- foreach ($cols as $colId) {
- foreach ($rows as $rowId) {
- $data[$rowId . 'total'][$colId] = $data[$rowId . '0'][$colId] + $data[$rowId . '1'][$colId];
- }
- $data['__resulttotal__'][$colId] = $data['__result0__'][$colId] + $data['__result1__'][$colId];
- }
-
- /* Difference. */
- if ($displaydiffa > 1 || $displaydiffp > 1) {
- $cola1 = $cols[$displaydiffa - 2];
- $cola2 = $cols[$displaydiffa - 1];
- $colp1 = $cols[$displaydiffp - 2];
- $colp2 = $cols[$displaydiffp - 1];
- foreach ($data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- continue;
- }
- if ($displaydiffa > 1) {
- $data[$rowId]['difference'] = $data[$rowId][$cola1] - $data[$rowId][$cola2];
- }
- if ($displaydiffp > 1) {
- if ($data[$rowId][$colp1] != 0) {
- $data[$rowId]['%'] = $data[$rowId][$colp2] / abs($data[$rowId][$colp1]) * 100;
- } else {
- $data[$rowId]['%'] = null;
- }
- }
- }
- }
-
- $this->_data = $data;
-
- return true;
- }
-
- /*
- * Output the graph.
- *
- * @return mixed True or PEAR Error
- */
- function _getGraph()
- {
- /* Data. */
- $labels = array();
- $data = $this->_data;
- foreach ($data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- foreach ($row as $colId => $value) {
- if (!preg_match('/__(header|result).*__/', $colId)) {
- $labels[$colId] = $value;
- }
- }
- }
- if (preg_match('/__(header|result).*__/', $rowId) && $rowId != '__resulttotal__') {
- unset($data[$rowId]);
- } else {
- $labels[$rowId] = isset($row['__header__']) ? $row['__header__'] : $rowId;
- unset($data[$rowId]['__header__']);
- }
- }
- $this->data = $data;
-
- /* Additional params. */
- $this->setParam('graph', 'Bar');
- $this->setParam('stacked', 'false');
- $this->setParam('labels', $labels);
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_Report_PeriodOverview.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Fima_Report */
-require_once FIMA_BASE . '/lib/Report.php';
-
-/*
- * Fima_Report_PeriodOverview class.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_Report_PeriodOverview extends Fima_Report {
-
- /*
- * Constructs a new PeriodOverview Report.
- */
- function Fima_Report_PeriodOverview($params = array())
- {
- $this->_params = $params;
- }
-
- /*
- * Executes the report.
- *
- * @return mixed True or PEAR Error
- */
- function _execute()
- {
- /* Get account types. */
- $accounttypes = Fima::getAccountTypes();
-
- /* Params. */
- if (($display = $this->getParam('display')) === null) {
- return PEAR::raiseError(_("No display type"));
- }
- $display = explode('_', $display);
- $posting_account = $this->getParam('posting_account');
- $period_start = ($display[0] == 'reference') ? $this->getParam('reference_start') : $this->getParam('period_start');
- $period_end = ($display[0] == 'reference') ? $this->getParam('reference_end') : $this->getParam('period_end');
- $display = ($display[0] == 'reference') ? $display[1] : $display[0];
- $cumulate = $this->getParam('cumulate');
- $nullrows = $this->getParam('nullrows');
- $yearly = $this->getParam('yearly');
- $graph = $this->getParam('graph');
- $datefmt = $yearly ? '%Y' : Fima::convertDateToPeriodFormat($GLOBALS['prefs']->getValue('date_format'));
- $sortby = $this->getParam('sortby');
- $sortdir = $this->getParam('sortdir');
-
- /* Rows. */
- $rows = array();
- for ($period = $period_start; $period <= $period_end; $period = strtotime($yearly ? '+1 year' : '+1 month', $period)) {
- $rows[strftime($yearly ? '%Y' : '%Y%m', $period)] = strftime($datefmt, $period);
- }
-
- /* Columns. */
- $cols = array(FIMA_ACCOUNTTYPE_INCOME, FIMA_ACCOUNTTYPE_EXPENSE);
- $colheaders = array('__header__' => _("Period"));
- $coldummy = array();
- $groups = array('0' => "%s", '1' => "e.o. %s", 'total' => "Total %s");
- foreach ($groups as $groupId => $group) {
- foreach ($cols as $colPos => $colId) {
- $coldummy[$colId . $groupId] = 0;
- $colheaders[$colId . $groupId] = sprintf($group, $accounttypes[$colId]);
- }
- $coldummy['__result' . $groupId . '__'] = 0;
- $colheaders['__result' . $groupId . '__'] = sprintf($group, _("Result"));
- }
- $colheaders['__resultasset__'] = _("Asset Result");
- $coldummy['__resultasset__'] = 0;
-
- /* Initialize matrix. */
- $data = array();
- $data['__headersort__'] = $colheaders;
- foreach ($rows as $rowId => $rowLabel) {
- $data[$rowId] = array('__header__' => $rowLabel) + $coldummy;
- }
-
- /* Results. */
- $groups = array('0', '1');
- $total = array('__header__' => _("Total Result")) + $coldummy;
- foreach ($groups as $group) {
- $filters = array();
- if ($posting_account) {
- $filters[] = array('account', $posting_account);
- }
- $filters[] = array('account_type', $cols);
- $filters[] = array('type', $display);
- $filters[] = array('eo', $group);
- if ($period_start !== null) {
- $filters[] = array('date', (int)$period_start, '>=');
- }
- if ($period_end !== null) {
- $filters[] = array('date', (int)$period_end, '<=');
- }
-
- $result = Fima::getResults(array('account_type', $yearly ? 'date_year' : 'date_month'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $data[$rowId][$colId . $group] = $value;
- $data[$rowId]['__result' . $group . '__'] += $value;
- $total[$colId . $group] += $value;
- $total['__result' . $group . '__'] += $value;
- }
- }
- }
-
- /* Totals. */
- $data['__resulttotal__'] = $total;
- foreach ($data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- continue;
- }
- foreach ($cols as $colId) {
- $data[$rowId][$colId . 'total'] = $data[$rowId][$colId . '0'] + $data[$rowId][$colId . '1'];
-
- }
- $data[$rowId]['__resulttotal__'] = $data[$rowId]['__result0__'] + $data[$rowId]['__result1__'];
- }
-
- /* Asset Results. */
- $filters = array();
- $filters[] = array('account_type', FIMA_ACCOUNTTYPE_ASSET, '<>');
- $filters[] = array('type', $display);
- if ($period_start !== null) {
- $filters[] = array('date', (int)$period_start, '<');
- }
-
- $result = Fima::getResults(array('type'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- $assetresult = 0;
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $assetresult += $value;
- }
- }
-
- foreach ($data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- continue;
- }
- if (!preg_match('/__result.*__/', $rowId)) {
- $assetresult += $data[$rowId]['__resulttotal__'];
- }
- $data[$rowId]['__resultasset__'] = $assetresult;
- }
-
- /* Null Rows and Cumulate. */
- if (!$nullrows || $cumulate) {
- $cumulatevalue = $coldummy;
- foreach ($data as $rowId => $row) {
- if (preg_match('/__(header|result).*__/', $rowId)) {
- continue;
- }
- $isnullrow = true;
- foreach ($row as $colId => $value) {
- if (preg_match('/__(header).*__/', $colId) || $colId == '__resultasset__') {
- continue;
- }
- if ($cumulate) {
- $data[$rowId][$colId] += $cumulatevalue[$colId];
- $cumulatevalue[$colId] = $data[$rowId][$colId];
- }
- if ($data[$rowId][$colId] != 0) {
- $isnullrow = false;
- }
- }
- if (!$nullrows && $isnullrow) {
- unset($data[$rowId]);
- }
- }
- }
-
- /* Sorting. */
- if ($sortby === null || !isset($colheaders[$sortby])) {
- $sortby = $this->setParam('sortby', '__header__');
- }
- if ($sortdir === null) {
- $sortdir = $this->setParam('sortdir', FIMA_SORT_ASCEND);
- }
- if ($graph) {
- $sortby = '__header__';
- $sortdir = FIMA_SORT_ASCEND;
- }
-
- $x = -1;
- $sortIndex = array();
- foreach ($data as $rowId => $row) {
- if (preg_match('/__(header|result).*__/', $rowId)) {
- $x++;
- $sortIndex[$x] = array($rowId => $row[$sortby]);
- $x++;
- } else {
- if (!isset($sortIndex[$x])) {
- $sortIndex[$x] = array();
- }
- $sortIndex[$x][$rowId] = $row[$sortby];
- }
- }
-
- foreach ($sortIndex as $indexId => $indexGroup) {
- if (count($indexGroup) > 0) {
- if ($sortdir) {
- arsort($indexGroup);
- } else {
- asort($indexGroup);
- }
- }
- foreach ($indexGroup as $rowId => $index) {
- $this->_data[$rowId] = $data[$rowId];
- }
- }
-
- return true;
- }
-
- /*
- * Output the graph.
- *
- * @return mixed True or PEAR Error
- */
- function _getGraph()
- {
- /* Data. */
- $display = explode('_', $this->getParam('display'));
- $display = ($display[0] == 'reference') ? $display[1] : $display[0];
- $postingtypes = Fima::getPostingTypes();
-
- $labels = array();
- $data = $this->_data;
- foreach ($data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- foreach ($row as $colId => $value) {
- if (!(preg_match('/__(header|result).*__/', $colId) && $colId != '__resulttotal__')) {
- $labels[$colId] = $value;
- }
- }
- }
- if (preg_match('/__(header|result).*__/', $rowId)) {
- unset($data[$rowId]);
- } else {
- $labels[$rowId] = isset($row['__header__']) ? $row['__header__'] : $rowId;
- foreach ($row as $colId => $value) {
- if (preg_match('/__(header|result).*__/', $colId) && $colId != '__resulttotal__') {
- unset($data[$rowId][$colId]);
- }
- }
- }
- }
- $this->data = $data;
-
- /* Additional params. */
- $this->setParam('graph', 'Line');
- $this->setParam('labels', $labels);
- $this->setParam('subtitle', $postingtypes[$display]);
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_Report_Trend.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Fima_Report */
-require_once FIMA_BASE . '/lib/Report.php';
-
-/*
- * Fima_Report_Trend class.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_Report_Trend extends Fima_Report {
-
- /*
- * Constructs a new Trend Report.
- */
- function Fima_Report_Trend($params = array())
- {
- $this->_params = $params;
- }
-
- /*
- * Executes the report.
- *
- * @return mixed True or PEAR Error
- */
- function _execute()
- {
- /* Get account types, posting types and accounts. */
- $accounttypes = Fima::getAccountTypes();
- $accounts = Fima::listAccounts();
- $accountIndex = array();
- foreach ($accounts as $accountId => $account) {
- $accountIndex[$account['number']] = $accountId;
- }
- $groups = array(FIMA_ACCOUNTTYPE_INCOME, FIMA_ACCOUNTTYPE_EXPENSE);
-
- /* Params. */
- if (($display = $this->getParam('display')) === null) {
- return PEAR::raiseError(_("No display type"));
- }
- $display = explode('_', $display);
- $posting_account = $this->getParam('posting_account');
- $period_start = ($display[0] == 'reference') ? $this->getParam('reference_start') : $this->getParam('period_start');
- $period_end = ($display[0] == 'reference') ? $this->getParam('reference_end') : $this->getParam('period_end');
- $display = ($display[0] == 'reference') ? $display[1] : $display[0];
- $cumulate = $this->getParam('cumulate');
- $nullrows = $this->getParam('nullrows');
- $subaccounts = $this->getParam('subaccounts');
- $graph = $this->getParam('graph');
- $yearly = $this->getParam('yearly');
- $datefmt = $yearly ? '%Y' : Fima::convertDateToPeriodFormat($GLOBALS['prefs']->getValue('date_format'));
- $sortby = $this->getParam('sortby');
- $sortdir = $this->getParam('sortdir');
-
- /* Rows. */
- // accounts (dynamically)
-
- /* Columns. */
- $cols = array();
- $colheaders = array('__header__' => _("Account"));
- $coldummy = array();
- for ($period = $period_start; $period <= $period_end; $period = strtotime($yearly ? '+1 year' : '+1 month', $period)) {
- $colId = strftime($yearly ? '%Y' : '%Y%m', $period);
- $cols[] = $colId;
- $colheaders[$colId] = strftime($datefmt, $period);
- $coldummy[$colId] = 0;
- }
- $colheaders['__result__'] = _("Total Result");
- $coldummy['__result__'] = 0;
-
- /* Initialize matrix. */
- $data = array();
- $data['__headersort__'] = $colheaders;
- $datagroups = array(FIMA_ACCOUNTTYPE_INCOME => array(), FIMA_ACCOUNTTYPE_EXPENSE => array());
- // add parent accounts
- if ($posting_account) {
- foreach ($posting_account as $accountId => $account) {
- if ($accounts[$account]['parent_id']) {
- $posting_account[] = $accounts[$account]['parent_id'];
- }
- }
- }
- foreach ($accounts as $accountId => $account) {
- if ($posting_account) {
- if (!in_array($account['account_id'], $posting_account)) {
- continue;
- }
- }
- if ($account['type'] == FIMA_ACCOUNTTYPE_ASSET) {
- continue;
- }
- if ($account['parent_id'] === null || !isset($accounts[$account['parent_id']])) {
- $datagroups[$account['type']][$account['number']] = array('__header__' => $account['label']) + $coldummy;
- if ($subaccounts) {
- $datagroups[$account['type']][$account['number']]['__subaccounts__'] = array();
- }
- } elseif ($subaccounts) {
- $datagroups[$account['type']][$accounts[$account['parent_id']]['number']]['__subaccounts__'][$account['number']] = array('__header__' => ' '.$account['label']) + $coldummy;
- }
- }
- foreach ($datagroups as $datagroupId => $datagroup) {
- $datagroups[$datagroupId]['__result' . $datagroupId . '__'] = array('__header__' => sprintf(_("%s Result"), $accounttypes[$datagroupId])) + $coldummy;
- $data += $datagroups[$datagroupId];
- }
-
- /* Results. */
- foreach ($groups as $group) {
- $filters = array();
- if ($posting_account) {
- $filters[] = array('account', $posting_account);
- }
- $filters[] = array('account_type', $group);
- $filters[] = array('type', $display);
- if ($period_start !== null) {
- $filters[] = array('date', (int)$period_start, '>=');
- }
- if ($period_end !== null) {
- $filters[] = array('date', (int)$period_end, '<=');
- }
-
- $result = Fima::getResults(array($yearly ? 'date_year' : 'date_month', $subaccounts ? 'account_number' : 'account_parent'), $filters);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- foreach ($result as $rowId => $row) {
- foreach ($row as $colId => $value) {
- if (isset($data[$rowId])) {
- $data[$rowId][$colId] += $value;
- $data[$rowId]['__result__'] += $value;
- } elseif (($parentId = $accounts[$accountIndex[$rowId]]['parent_id']) !== null) {
- $data[$accounts[$parentId]['number']][$colId] += $value;
- $data[$accounts[$parentId]['number']]['__result__'] += $value;
- if ($subaccounts) {
- $data[$accounts[$parentId]['number']]['__subaccounts__'][$rowId][$colId] += $value;
- $data[$accounts[$parentId]['number']]['__subaccounts__'][$rowId]['__result__'] += $value;
- }
- }
- $data['__result' . $group . '__'][$colId] += $value;
- $data['__result' . $group . '__']['__result__'] += $value;
- }
- }
- }
-
- /* Totals. */
- $data['__resulttotal__'] = array('__header__' => _("Total Result")) + $coldummy;
- foreach ($cols as $colId) {
- foreach ($groups as $groupId => $group) {
- $data['__resulttotal__'][$colId] += $data['__result' . $group . '__'][$colId];
- $data['__resulttotal__']['__result__'] += $data['__result' . $group . '__'][$colId];
- }
- }
-
- /* Null Rows and Cumulate. */
- if (!$nullrows || $cumulate) {
- foreach ($data as $rowId => $row) {
- if (preg_match('/__(header).*__/', $rowId)) {
- continue;
- }
- $cumulatevalue = 0;
- $isnullrow = true;
- foreach ($row as $colId => $value) {
- if (preg_match('/__(header|result).*__/', $colId)) {
- continue;
- }
- if ($colId == '__subaccounts__') {
- if (count($value) > 0) {
- foreach ($value as $subRowId => $subRow) {
- $subcumulatevalue = 0;
- $subisnullrow = true;
- foreach ($subRow as $subColId => $subValue) {
- if (preg_match('/__(header|result).*__/', $subColId)) {
- continue;
- }
- if ($cumulate) {
- $data[$rowId]['__subaccounts__'][$subRowId][$subColId] += $subcumulatevalue;
- $subcumulatevalue = $data[$rowId]['__subaccounts__'][$subRowId][$subColId];
- }
- if ($data[$rowId]['__subaccounts__'][$subRowId][$subColId] != 0) {
- $subisnullrow = false;
- }
- }
- if (!$nullrows && $subisnullrow) {
- unset($data[$rowId]['__subaccounts__'][$subRowId]);
- }
- }
- }
- } else {
- if ($cumulate) {
- $data[$rowId][$colId] += $cumulatevalue;
- $cumulatevalue = $data[$rowId][$colId];
- }
- if ($data[$rowId][$colId] != 0) {
- $isnullrow = false;
- }
- }
- }
- if (!$nullrows && $isnullrow) {
- unset($data[$rowId]);
- }
- }
- }
-
- /* Sorting. */
- if ($sortby === null || !isset($colheaders[$sortby])) {
- $sortby = $this->setParam('sortby', '__header__');
- }
- if ($sortdir === null) {
- $sortdir = $this->setParam('sortdir', FIMA_SORT_ASCEND);
- }
- $x = -1;
- $sortIndex = array();
- foreach ($data as $rowId => $row) {
- if (preg_match('/__(header|result).*__/', $rowId)) {
- $x++;
- $sortIndex[$x] = array($rowId => $row[$sortby]);
- $x++;
- } else {
- if (!isset($sortIndex[$x])) {
- $sortIndex[$x] = array();
- }
- $sortIndex[$x][$rowId] = $row[$sortby];
- }
- }
-
- foreach ($sortIndex as $indexId => $indexGroup) {
- if (count($indexGroup) > 0) {
- if ($sortdir) {
- arsort($indexGroup);
- } else {
- asort($indexGroup);
- }
- }
- foreach ($indexGroup as $rowId => $index) {
- $this->_data[$rowId] = $data[$rowId];
- if (isset($data[$rowId]['__subaccounts__'])) {
- if (count($data[$rowId]['__subaccounts__']) > 0) {
- $subSortIndex = array();
- foreach ($data[$rowId]['__subaccounts__'] as $subId => $sub) {
- $subSortIndex[$subId] = $sub[$sortby];
- }
- if ($sortdir) {
- arsort($subSortIndex);
- } else {
- asort($subSortIndex);
- }
-
- foreach ($subSortIndex as $subId => $sub) {
- $this->_data[$subId] = $data[$rowId]['__subaccounts__'][$subId];
- }
- }
- }
- unset($this->_data[$rowId]['__subaccounts__']);
- }
- }
-
- return true;
- }
-
- /*
- * Output the graph.
- *
- * @return mixed True or PEAR Error
- */
- function _getGraph()
- {
- /* Data. */
- $display = explode('_', $this->getParam('display'));
- $display = ($display[0] == 'reference') ? $display[1] : $display[0];
- $postingtypes = Fima::getPostingTypes();
-
- $labels = array();
- $data = $this->_data;
- $sum = array();
- foreach ($data as $rowId => $row) {
- if (preg_match('/__header.*__/', $rowId)) {
- foreach ($row as $colId => $value) {
- if (!(preg_match('/__(header|result).*__/', $colId) && $colId != '__resulttotal__')) {
- $labels[$colId] = $value;
- }
- }
- }
- if (preg_match('/__(header|result).*__/', $rowId)) {
- unset($data[$rowId]);
- } else {
- $labels[$rowId] = isset($row['__header__']) ? $row['__header__'] : $rowId;
- if ($data[$rowId]['__result__'] != 0) {
- $sum[$rowId] = $data[$rowId]['__result__'];
- }
- unset($data[$rowId]['__header__']);
- unset($data[$rowId]['__result__']);
- }
- }
-
- // grouping
- asort($sum);
- $topdata = array_slice($sum, 0, 5, true) + array_slice($sum, -5, 5, true);
- foreach ($data as $rowId => $row) {
- if (!isset($topdata[$rowId])) {
- unset($data[$rowId]);
- }
- }
-
- $this->data = $data;
-
- /* Additional params. */
- $this->setParam('graph', 'Line');
- $this->setParam('labels', $labels);
- $this->setParam('subtitle', $postingtypes[$display]);
- $this->setParam('invert', true);
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-
-/**
- * Fima_ReportGraph:: defines an API for implementing report graphs for Fima.
- *
- * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** PEAR Image Graph */
-require_once 'Image/Graph.php';
-
-/**
- * Fima_ReportGraph class.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_ReportGraph {
-
- /**
- * Hash containing report parameters.
- *
- * @var array
- */
- var $_params = array();
-
- /**
- * Array containing the data after execution of the report.
- *
- * @var mixed
- */
- var $_data = array();
-
- /**
- * Bytes containing the report graph after execution of the report.
- *
- * @var bytes
- */
- var $_graph = null;
- var $_plotarea = null;
- var $_legend = null;
-
- /**
- * Constructor - just store the $params in our newly-created
- * object. All other work is done by initialize().
- *
- * @param array $data The dataset.
- * @param array $params Any parameters needed for this driver.
- */
- function Fima_ReportGraph($data = array(), $params = array(), $errormsg = null)
- {
- $this->_data = $data;
- $this->_params = $params;
- if (is_null($errormsg)) {
- $this->_errormsg = _("The Finances report graphs are not currently available.");
- } else {
- $this->_errormsg = $errormsg;
- }
- }
-
- /*
- * Executes the report.
- *
- * @return mixed True or PEAR Error
- */
- function execute()
- {
- /* Create graph. */
- $this->_graph =& Image_Graph::factory('graph', array($this->_style['width'], $this->_style['height']));
- $this->_graph->displayErrors();
-
- /* Add Font. */
- $font =& $this->_graph->addNew('font', $this->_style['font-family']);
- $font->setColor($this->_style['font-color']);
- $font->setSize($this->_style['font-size']);
- $this->_graph->setFont($font);
-
- /* Plot and Legend. */
- $title =& Image_Graph::factory('title', array(isset($this->_params['title']) ? $this->_params['title'] : _("Report"), $this->_style['header-size']));
- $title->setAlignment(IMAGE_GRAPH_ALIGN_BOTTOM | IMAGE_GRAPH_ALIGN_CENTER_X);
- $subtitle =& Image_Graph::factory('title', array(isset($this->_params['subtitle']) ? $this->_params['subtitle'] : '', $this->_style['subheader-size']));
- $this->_plotarea =& Image_Graph::factory('plotarea');
- $this->_legend =& Image_Graph::factory('legend');
- $this->_graph->add(
- Image_Graph::vertical(
- Image_Graph::vertical(
- $title,
- $subtitle,
- 60
- ),
- Image_Graph::vertical(
- $this->_plotarea,
- $this->_legend,
- 88
- ),
- 10
- )
- );
- $this->_legend->setPlotarea($this->_plotarea);
- $this->_legend->setAlignment(IMAGE_GRAPH_ALIGN_CENTER);
-
- /* Execute. */
- $execute = $this->_execute();
- if (is_a($execute, 'PEAR_Error')) {
- return $execute;
- }
-
- /* Log the execution of the report in the history log. */
- $GLOBALS['injector']->getInstance('Horde_History')->log('fima:reportgraph', array('action' => 'execute'), true);
-
- return true;
- }
-
- /**
- * Returns the graph of this report (if any).
- *
- * @return bytes Image data
- */
- function getGraph()
- {
- header('Expires: Mon, 01 Jan 1970 00:00:00 GMT');
- header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
- header('Pragma: public');
- header('Cache-Control: no-store, no-cache, must-revalidate');
- header('Cache-Control: pre-check=0, post-check=0, max-age=0');
- header('Content-Type: image/jpeg');
- header('Accept-Ranges: bytes');
- #header('Content-Length: ' . );
- header('Content-Disposition: inline');
-
- $this->_graph->done();
-
- return true;
- }
-
- /**
- * Initialization of the report.
- *
- * @return boolean True on success; PEAR_Error on failure.
- */
- function initialize()
- {
- /* Load styles. */
- include_once($GLOBALS['registry']->get('themesfs') . '/report.inc');
- $this->_style = $style;
- }
-
- /**
- * Attempts to return a concrete Fima_ReportGraph instance based on $driver.
- *
- * @param string $driver The type of the concrete Fima_ReportGraph subclass
- * to return. The class name is based on the
- * storage driver ($driver). The code is
- * dynamically included.
- *
- * @param array $data The dataset.
- * @param array $params (optional) A hash containing any additional
- * configuration or connection parameters a
- * subclass might need.
- *
- * @return mixed The newly created concrete Fima_Driver instance, or
- * false on an error.
- */
- function &factory($driver = null, $data = null, $params = null)
- {
- if ($driver === null) {
- $report = new Fima_ReportGraph($data, $params, _("No report driver loaded"));
- return $report;
- }
-
- require_once dirname(__FILE__) . '/ReportGraph/' . $driver . '.php';
- $class = 'Fima_ReportGraph_' . $driver;
- if (class_exists($class)) {
- $report = new $class($data, $params);
- $result = $report->initialize();
- if (is_a($result, 'PEAR_Error')) {
- $report = new Fima_ReportGraph($data, $params, sprintf(_("The Finances report graphs are not currently available: %s"), $result->getMessage()));
- }
- } else {
- $report = new Fima_ReportGraph($data, $params, sprintf(_("Unable to load the definition of %s."), $class));
- }
-
- return $report;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_ReportGraph_Bar.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Fima_Report */
-require_once FIMA_BASE . '/lib/ReportGraph.php';
-
-/*
- * Fima_ReportGraph_Bar class.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_ReportGraph_Bar extends Fima_ReportGraph {
-
- /*
- * Constructs a new Bar ReportGraph.
- */
- function Fima_ReportGraph_Bar($data = array(), $params = array())
- {
- $this->_data = $data;
- $this->_params = $params;
-
- if (!isset($this->_params['invert'])) {
- $this->_params['invert'] = false;
- }
- }
-
- /*
- * Executes the report graph.
- *
- * @return mixed True or PEAR Error
- */
- function _execute()
- {
- /* Grid. */
- $grid =& $this->_plotarea->addNew('line_grid');
- $gridfill =& Image_Graph::factory('Image_Graph_Fill_Array');
- $gridfill->addColor($this->_style['grid']);
- $grid->setFillStyle($gridfill);
-
- /* Datasets. */
- $datasets = array();
- $datasetindex = array();
- $ix = 0;
- foreach ($this->_data as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $xd = $this->_params['invert'] ? $rowId : $colId;
- $xx = $this->_params['invert'] ? $colId : $rowId;
- if (!isset($datasetindex[$xd])) {
- $datasetindex[$xd] = $ix++;
- $datasets[$datasetindex[$xd]] =& Image_Graph::factory('dataset');
- $datasets[$datasetindex[$xd]]->setName($this->_params['labels'][$xd]);
- }
- $datasets[$datasetindex[$xd]]->addPoint($this->_params['labels'][$xx], $value);
- }
- }
-
- $plot =& $this->_plotarea->addNew('bar', $params['stacked'] ? array($datasets, 'stacked') : array($datasets));
- $plot->setLineColor($this->_style['line']);
-
- /* Fill style. */
- $fill =& Image_Graph::factory('Image_Graph_Fill_Array');
- foreach ($datasetindex as $key => $value) {
- if (isset($this->_style[$key])) {
- $fill->addColor($this->_style[$key]);
- } else {
- $fill->addColor($this->_style['color' . $value]);
- }
- }
- $plot->setFillStyle($fill);
-
- /* Axis. */
- $axisx =& $this->_plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
- $axisy =& $this->_plotarea->getAxis(IMAGE_GRAPH_AXIS_Y);
- $axisy->showLabel(IMAGE_GRAPH_LABEL_ZERO);
- $axisy->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Function', create_function('$value', 'return Fima::convertValueToAmount($value);')));
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_ReportGraph_Line.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Fima_Report */
-require_once FIMA_BASE . '/lib/ReportGraph.php';
-
-/*
- * Fima_ReportGraph_Line class.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_ReportGraph_Line extends Fima_ReportGraph {
-
- /*
- * Constructs a new Line ReportGraph.
- */
- function Fima_ReportGraph_Line($data = array(), $params = array())
- {
- $this->_data = $data;
- $this->_params = $params;
-
- if (!isset($this->_params['invert'])) {
- $this->_params['invert'] = false;
- }
- }
-
- /*
- * Executes the report graph.
- *
- * @return mixed True or PEAR Error
- */
- function _execute()
- {
- /* Grid. */
- $grid =& $this->_plotarea->addNew('line_grid');
- $gridfill =& Image_Graph::factory('Image_Graph_Fill_Array');
- $gridfill->addColor($this->_style['grid']);
- $grid->setFillStyle($gridfill);
-
- /* Datasets. */
- $datasets = array();
- $datasetindex = array();
- $ix = 0;
- foreach ($this->_data as $rowId => $row) {
- foreach ($row as $colId => $value) {
- $xd = $this->_params['invert'] ? $rowId : $colId;
- $xx = $this->_params['invert'] ? $colId : $rowId;
- if (!isset($datasetindex[$xd])) {
- $datasetindex[$xd] = $ix++;
- $datasets[$datasetindex[$xd]] =& Image_Graph::factory('dataset');
- $datasets[$datasetindex[$xd]]->setName($this->_params['labels'][$xd]);
- }
- $datasets[$datasetindex[$xd]]->addPoint($this->_params['labels'][$xx], $value);
- }
- }
-
- /* Line style. */
- foreach ($datasetindex as $key => $value) {
- $plot =& $this->_plotarea->addNew('line', $datasets[$value]);
- $plot->setLineColor($this->_style['line']);
-
- $line =& Image_Graph::factory('Image_Graph_Line_Solid', isset($this->_style[$key]) ? $this->_style[$key] : $this->_style['color' . $value]);
- $line->setThickness(2);
- $plot->setLineStyle($line);
- }
-
- /* Axis. */
- $axisx =& $this->_plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
- $axisx->setFontAngle('vertical');
- $axisx->setLabelOption('offset', -20);
- $axisy =& $this->_plotarea->getAxis(IMAGE_GRAPH_AXIS_Y);
- $axisy->showLabel(IMAGE_GRAPH_LABEL_ZERO);
- $axisy->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Function', create_function('$value', 'return Fima::convertValueToAmount($value);')));
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima_ReportGraph_Pie.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/** Fima_Report */
-require_once FIMA_BASE . '/lib/ReportGraph.php';
-
-/*
- * Fima_ReportGraph_Pie class.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Fima_ReportGraph_Pie extends Fima_ReportGraph {
-
- /*
- * Constructs a new Pie ReportGraph.
- */
- function Fima_ReportGraph_Pie($data = array(), $params = array())
- {
- $this->_data = $data;
- $this->_params = $params;
- }
-
- /*
- * Executes the report graph.
- *
- * @return mixed True or PEAR Error
- */
- function _execute()
- {
- /* Datasets. */
- $datasets = array();
- $datasetindex = array();
- $x = 0;
- foreach ($this->_data as $ix => $dataset) {
- $datasets[$ix] =& Image_Graph::factory('dataset');
- foreach ($dataset as $key => $value) {
- $datasetindex[$x++] = $key;
- $datasets[$ix]->addPoint($this->_params['labels'][$key], $value);
- }
- }
- $plot =& $this->_plotarea->addNew('pie', array($datasets));
- $plot->setLineColor($this->_style['line']);
-
- /* Fill style. */
- $fill =& Image_Graph::factory('Image_Graph_Fill_Array');
- foreach ($datasetindex as $key => $value) {
- if (isset($this->_style[$value])) {
- $fill->addColor($this->_style[$value]);
- } else {
- $fill->addColor($this->_style['color' . $key]);
- }
- }
- $plot->setFillStyle($fill);
-
- /* Axis. */
- $this->_plotarea->hideAxis();
-
- /* Explode. */
- if (isset($this->_params['explode'])) {
- if (is_int($this->_params['explode']) || is_array($this->_params['explode'])) {
- $plot->explode($this->_params['explode']);
- } else {
- $plot->explode(10, $this->_params['explode']);
- }
- }
-
- /* Marker. */
- if ($this->_params['marker']) {
- $marker =& $plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_PCT_Y_TOTAL);
- $marker->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Formatted', '%0.1f%%'));
- $marker->setFontSize($this->_style['font-size']);
- $pointingmarker =& $plot->addNew('Image_Graph_Marker_Pointing_Angular', array(30, &$marker));
- $plot->setMarker($pointingmarker);
- }
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * This file contains all Horde_Core_Ui_VarRenderer extensions required for
- * editing accounts.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Fima
- */
-
-/**
- * The Horde_Core_Ui_VarRenderer_fima class provides additional methods for
- * rendering Fima specific Horde_Form_Type fields.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- * @package Fima
- */
-class Horde_Core_Ui_VarRenderer_Fima extends Horde_Core_Ui_VarRenderer_Html {
-
- protected function _renderVarInput_fima_dspostings($form, &$var, &$vars)
- {
- $varname = @htmlspecialchars($var->getVarName(), ENT_QUOTES, $this->_charset);
- $value = $var->getValue($vars);
-
- return sprintf('<input id="%sdelete" type="radio" class="radio" name="%s[type]" value="delete"%s /><label for="%sdelete"> %s</label><br />',
- $varname,
- $varname,
- $value['type'] == 'delete' ? ' checked="checked"' : '',
- $varname,
- _("Delete postings."))
- . sprintf('<input id="%sshift" type="radio" class="radio" name="%s[type]" value="shift"%s /><label for="%sshift"> %s</label><br />',
- $varname,
- $varname,
- $value['type'] == 'shift' ? ' checked="checked"' : '',
- $varname,
- _("Shift postings to"))
- . Fima::buildAccountWidget($varname . '[account]', $value['account'], 'onchange="document.getElementsByName(\'dspostings[type]\')[1].checked = true;"', false, false, array(array('type', $vars->get('type'))));
- }
-
- protected function _renderVarInput_fima_dssubaccounts($form, &$var, &$vars)
- {
- $varname = @htmlspecialchars($var->getVarName(), ENT_QUOTES, $this->_charset);
- $value = $var->getValue($vars);
-
- return sprintf('<input id="%snone" type="radio" class="radio" name="%s[type]" value="none"%s /><label for="%snone"> %s</label><br />',
- $varname,
- $varname,
- $value['type'] == 'none' ? ' checked="checked"' : '',
- $varname,
- _("Keep subaccounts and postings."))
- . sprintf('<input id="%sdelete" type="radio" class="radio" name="%s[type]" value="delete"%s /><label for="%sdelete"> %s</label><br />',
- $varname,
- $varname,
- $value['type'] == 'delete' ? ' checked="checked"' : '',
- $varname,
- _("Delete subaccounts and postings."))
- . sprintf('<input id="%sshift" type="radio" class="radio" name="%s[type]" value="shift"%s /><label for="%sshift"> %s</label><br />',
- $varname,
- $varname,
- $value['type'] == 'shift' ? ' checked="checked"' : '',
- $varname,
- _("Delete subaccounts and shift postings to"))
- . Fima::buildAccountWidget($varname . '[account]', $value['account'], 'onchange="document.getElementsByName(\'dssubaccounts[type]\')[2].checked = true;"', false, false, array(array('type', $vars->get('type'))));
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Fima base application file.
- *
- * This file brings in all of the dependencies that every Fima script will
- * need, and sets up objects that all scripts use.
- */
-
-// Check for a prior definition of HORDE_BASE (perhaps by an auto_prepend_file
-// definition for site customization).
-if (!defined('HORDE_BASE')) {
- @define('HORDE_BASE', dirname(__FILE__) . '/../..');
-}
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$session_control = Horde_Util::nonInputVar('session_control');
-if ($session_control == 'none') {
- $registry = new Horde_Registry(HORDE_SESSION_NONE);
-} elseif ($session_control == 'readonly') {
- $registry = new Horde_Registry(HORDE_SESSION_READONLY);
-} else {
- $registry = new Horde_Registry();
-}
-
-try {
- $registry->pushApp('fima', array('logintasks' => true));
-} catch (Horde_Exception $e) {
- $registry->authenticateFailure('fima', $e);
-}
-$conf = &$GLOBALS['conf'];
-@define('FIMA_TEMPLATES', $registry->get('templates'));
-
-// Find the base file path of Fima.
-if (!defined('FIMA_BASE')) {
- @define('FIMA_BASE', dirname(__FILE__) . '/..');
-}
-
-// Fima base library
-require_once FIMA_BASE . '/lib/Driver.php';
-
-// Start output compression.
-Horde::compressOutput();
-
-// Set the timezone variable.
-$registry->setTimeZone();
-
-// Create a share instance.
-$GLOBALS['fima_shares'] = $GLOBALS['injector']->getInstance('Horde_Share_Factory')->getScope();
-
-Fima::initialize();
+++ /dev/null
-Deny from all
+++ /dev/null
-# German translations for Fima package
-# German messages for Fima.
-# Copyright (C) 2008 Horde Project
-# This file is distributed under the same license as the Fima package.
-# Automatically generated, 2008.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Fima 1.0\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2010-08-17 17:46+0200\n"
-"PO-Revision-Date: 2008-09-04 10:56+0200\n"
-"Last-Translator: Thomas Trethan <thomas@trethan.net>\n"
-"Language-Team: i18n@lists.horde.org\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: report.php:95 report.php:96 report.php:97 report.php:98 report.php:99
-#: report.php:100 report.php:101
-msgid "%"
-msgstr "%"
-
-#: postings.php:267
-#, php-format
-msgid "%d postings not saved."
-msgstr "%d Buchungen wurden nicht gespeichert."
-
-#: templates/postings/shift.inc:5
-#, php-format
-msgid "%d selected Postings"
-msgstr "%d ausgewählte Buchungen"
-
-#: postings.php:573
-#, php-format
-msgid "%s"
-msgstr "%s"
-
-#: lib/Report/Analysis.php:123 lib/Report/Trend.php:111
-#, php-format
-msgid "%s Result"
-msgstr "%s Ergebnis"
-
-#: report.php:93
-#, php-format
-msgid "%s [%s - %s - %s]"
-msgstr "%s [%s - %s - %s]"
-
-#: data.php:199
-#, php-format
-msgid "%s successfully imported"
-msgstr "%s erfolgreich importiert"
-
-#: postings.php:603
-#, php-format
-msgid "%s to %s of %s Postings"
-msgstr "%s bis %s von %s Buchungen"
-
-#: lib/Fima.php:711 lib/Forms/DeleteLedger.php:79
-#, php-format
-msgid "%s's Ledger"
-msgstr "%ss Buch"
-
-#: config/prefs.php.dist:137
-msgid "-12 345 678,90"
-msgstr "-12 345 678,90"
-
-#: config/prefs.php.dist:138
-msgid "-12'345'678.90"
-msgstr "-12'345'678.90"
-
-#: config/prefs.php.dist:136
-msgid "-12,345,678.90"
-msgstr "-12,345,678.90"
-
-#: config/prefs.php.dist:135
-msgid "-12.345.678,90"
-msgstr "-12.345.678,90"
-
-#: config/prefs.php.dist:164
-msgid "1024 x 768 Pixel"
-msgstr "1024 x 768 Pixel"
-
-#: config/prefs.php.dist:165
-msgid "1600 x 1200 Pixel"
-msgstr "1600 x 1200 Pixel"
-
-#: config/prefs.php.dist:162
-msgid "400 x 300 Pixel"
-msgstr "400 x 300 Pixel"
-
-#: config/prefs.php.dist:163
-msgid "800 x 600 Pixel"
-msgstr "800 x 600 Pixel"
-
-#: templates/postings/shift.inc:21 templates/postings/posting_headers.inc:21
-msgid "A_sset Account"
-msgstr "Vermögenskonto"
-
-#: account.php:201
-#, php-format
-msgid "Access denied deleting account from %s."
-msgstr "Zugriff verweigert beim Löschen des Kontos von %s."
-
-#: account.php:168
-msgid "Access denied deleting account."
-msgstr "Zugriff verweigert beim Löschen des Kontos."
-
-#: accounts.php:27
-msgid "Access denied deleting all accounts and postings."
-msgstr "Zugriff verweigert beim Löschen aller Konten und Buchungen."
-
-#: postings.php:284
-#, php-format
-msgid "Access denied deleting postings from %s."
-msgstr "Zugriff verweigert beim Löschen der Buchungen von %s."
-
-#: account.php:69
-msgid "Access denied editing account."
-msgstr "Zugriff verweigert beim Bearbeiten des Kontos."
-
-#: account.php:24
-#, php-format
-msgid "Access denied on account: %s"
-msgstr "Zugriff verweigert für das Konto: %s"
-
-#: accounts.php:19
-#, php-format
-msgid "Access denied on accounts: %s"
-msgstr "Zugriff verweigert für die Konten: %s"
-
-#: account.php:101
-#, php-format
-msgid "Access denied saving account to %s."
-msgstr "Zugriff verweigert beim Speichern des Kontos in %s."
-
-#: postings.php:171
-#, php-format
-msgid "Access denied saving postings to %s."
-msgstr "Zugriff verweigert beim Speichern der Buchungen in %s."
-
-#: postings.php:313
-#, php-format
-msgid "Access denied shifting postings in %s."
-msgstr "Zugriff verweigert beim Umbuchen der Buchungen in %s."
-
-#: postings.php:346 postings.php:350
-#, php-format
-msgid "Access denied transfering postings in %s."
-msgstr "Zugriff verweigert beim Transfer der Buchungen in %s."
-
-#: data.php:36 lib/Report/Analysis.php:73 lib/Report/Trend.php:69
-msgid "Account"
-msgstr "Konto"
-
-#: config/report.php.dist:9
-msgid "Account Overview"
-msgstr "Kontoübersicht"
-
-#: account.php:73 account.php:172
-msgid "Account not found."
-msgstr "Konto nicht gefunden."
-
-#: templates/reports/reports.inc:34 lib/Block/tree_menu.php:15
-msgid "Accounts"
-msgstr "Konten"
-
-#: config/prefs.php.dist:8
-msgid "Active Configuration"
-msgstr "Aktive Konfiguration"
-
-#: lib/Fima.php:456 config/prefs.php.dist:44
-msgid "Actual"
-msgstr "Ist-Abrechnung"
-
-#: postings.php:134 lib/Block/tree_menu.php:13
-msgid "Add Postings"
-msgstr "Neue Buchungen"
-
-#: lib/Fima.php:742
-msgid "Add _Postings"
-msgstr "Neue _Buchungen"
-
-#: templates/postings/navbar.inc:9 templates/postings/transfer.inc:14
-#: templates/postings/transfer.inc:53
-msgid "All"
-msgstr "Alle"
-
-#: templates/postings/posting_headers.inc:36
-msgid "Amo_unt"
-msgstr "Be_trag"
-
-#: data.php:38 config/prefs.php.dist:87 config/prefs.php.dist:101
-msgid "Amount"
-msgstr "Betrag"
-
-#: config/report.php.dist:11
-msgid "Analysis"
-msgstr "Analyse"
-
-#: templates/accounts/accounts.inc:12
-msgid ""
-"Are you sure you wish to PERMANENTLY delete all accounts and all postings?"
-msgstr ""
-"Sind Sie sicher, dass Sie alle Konten und Buchungen UNWIDERRUFLICH löschen "
-"wollen?"
-
-#: templates/postings/javascript_list.inc:45
-msgid "Are you sure you wish to PERMANENTLY delete these postings?"
-msgstr ""
-"Sind Sie sicher, dass Sie diese Buchungen UNWIDERRUFLICH löschen wollen?"
-
-#: config/prefs.php.dist:112
-msgid "Ascending"
-msgstr "Aufsteigend"
-
-#: lib/Fima.php:432 lib/Report/AssetOverview.php:66
-msgid "Asset"
-msgstr "Vermögen"
-
-#: data.php:35 config/prefs.php.dist:85 config/prefs.php.dist:99
-msgid "Asset Account"
-msgstr "Vermögenskonto"
-
-#: config/report.php.dist:10
-msgid "Asset Overview"
-msgstr "Vermögensübersicht"
-
-#: lib/Report/PeriodOverview.php:76 lib/Report/AssetOverview.php:90
-#: lib/Report/GeneralOverview.php:61 lib/Report/GeneralOverview.php:96
-#: lib/Block/summary.php:75
-msgid "Asset Result"
-msgstr "Vermögen"
-
-#: templates/postings/actions.inc:17
-msgid "Autofill"
-msgstr "Auto-Füllen"
-
-#: lib/Block/summary.php:33
-msgid "Block title"
-msgstr "Block Titel"
-
-#: lib/Fima.php:458 config/prefs.php.dist:46
-msgid "Budget"
-msgstr "Budget"
-
-#: data.php:21
-msgid "CSV"
-msgstr "CSV"
-
-#: templates/reports/reports.inc:80
-msgid "C_umulate"
-msgstr "K_umulieren"
-
-#: lib/Forms/DeleteLedger.php:39 lib/Forms/DeleteLedger.php:45
-msgid "Cancel"
-msgstr "Abbrechen"
-
-#: templates/ledgers_list.php:33 ledgers/index.php:33
-msgid "Change Permissions"
-msgstr "Rechte ändern"
-
-#: config/prefs.php.dist:18
-msgid "Change the display and input options."
-msgstr "Anzeige- und Eingabe-Einstellungen ändern."
-
-#: templates/postings/posting_headers.inc:60
-msgid "Check _All/None"
-msgstr "_Alle/Keine auswählen"
-
-#: config/prefs.php.dist:9
-msgid "Choose your active Ledger and Posting Type."
-msgstr "Wählen Sie Ihr aktives Buch und Ihren aktiven Datenkreis aus."
-
-#: templates/search/search.inc:107
-msgid "Clear Form"
-msgstr "Formular zurücksetzen"
-
-#: templates/search/search.inc:8 templates/postings/header.inc:10
-msgid "Clear Search Query"
-msgstr "Suchabfrage zurücksetzen"
-
-#: lib/Forms/account.php:42
-msgid "Closed"
-msgstr "Abgeschlossen"
-
-#: lib/Application.php:34
-msgid "Closed by period:"
-msgstr "Abgeschlossen mit Zeitraum:"
-
-#: templates/data/import.inc:13 templates/data/export.inc:12
-msgid "Comma separated values"
-msgstr "Komme getrennte Werte"
-
-#: lib/Forms/CreateLedger.php:33
-msgid "Create"
-msgstr "Erstellen"
-
-#: lib/Forms/CreateLedger.php:28
-msgid "Create Ledger"
-msgstr "Buch erstellen"
-
-#: templates/accounts/accounts.inc:46
-msgid "Create a New Account"
-msgstr "Neues Konto erstellen"
-
-#: templates/ledgers_list.php:8
-msgid "Create a new Ledger"
-msgstr "Neues Buch erstellen"
-
-#: templates/postings/edit.inc:52
-msgid "Current Result"
-msgstr "Aktuelles Ergebnis"
-
-#: config/prefs.php.dist:123
-msgid "DOS (* and ?)"
-msgstr "DOS (* und ?)"
-
-#: templates/postings/posting_headers.inc:16
-msgid "Da_te"
-msgstr "Da_tum"
-
-#: data.php:34 config/prefs.php.dist:84 config/prefs.php.dist:98
-msgid "Date"
-msgstr "Datum"
-
-#: templates/ledgers_list.php:35 templates/postings/actions.inc:9
-#: templates/accounts/accounts.inc:43 templates/accounts/accounts.inc:45
-#: ledgers/index.php:34 lib/Forms/account.php:79 lib/Forms/DeleteLedger.php:39
-msgid "Delete"
-msgstr "Löschen"
-
-#: templates/accounts/accounts.inc:45 lib/Forms/DeleteLedger.php:34
-#, php-format
-msgid "Delete %s"
-msgstr "%s löschen"
-
-#: templates/accounts/accounts.inc:43
-msgid "Delete all"
-msgstr "Alles lXschen"
-
-#: lib/UI/VarRenderer/fima.php:31
-msgid "Delete postings."
-msgstr "Buchungen löschen"
-
-#: lib/UI/VarRenderer/fima.php:57
-msgid "Delete subaccounts and postings."
-msgstr "Unterkonten und Buchungen löschen."
-
-#: lib/UI/VarRenderer/fima.php:63
-msgid "Delete subaccounts and shift postings to"
-msgstr "Unterkonten löschen und Buchungen umbuchen nach"
-
-#: account.php:87 lib/Forms/account.php:46
-msgid "Delete this account"
-msgstr "Dieses Konto löschen"
-
-#: account.php:178 account.php:194
-#, php-format
-msgid "Delete: %s"
-msgstr "Löschen: %s"
-
-#: postings.php:386
-#, php-format
-msgid "Deleted %d existing postings."
-msgstr "%d existierende Buchungen gelöscht."
-
-#: postings.php:484
-#, php-format
-msgid "Deleted %d original postings."
-msgstr "%d ursprüngliche Buchungen gelöscht."
-
-#: postings.php:300
-#, php-format
-msgid "Deleted %d postings."
-msgstr "%d Buchungen gelöscht."
-
-#: account.php:214
-#, php-format
-msgid "Deleted %s."
-msgstr "%s gelöscht."
-
-#: accounts.php:37
-msgid "Deleted all accounts and postings."
-msgstr "Alle Konten und Buchungen gelöscht."
-
-#: config/prefs.php.dist:113
-msgid "Descending"
-msgstr "Absteigend"
-
-#: templates/postings/posting_headers.inc:31
-msgid "Descriptio_n"
-msgstr "A_nmerkung"
-
-#: data.php:37 lib/Forms/account.php:41 lib/Forms/CreateLedger.php:31
-#: lib/Forms/EditLedger.php:38 config/prefs.php.dist:88
-#: config/prefs.php.dist:102
-msgid "Description"
-msgstr "Anmerkung"
-
-#: lib/Report/Analysis.php:87 lib/Report/AccountOverview.php:85
-#: lib/Report/GeneralOverview.php:85
-msgid "Diff. (%)"
-msgstr "Diff. (%)"
-
-#: report.php:95 report.php:96 report.php:97 report.php:98 report.php:99
-#: report.php:100 report.php:101 lib/Report/Analysis.php:84
-#: lib/Report/Analysis.php:360 lib/Report/AccountOverview.php:82
-#: lib/Report/GeneralOverview.php:82
-msgid "Difference"
-msgstr "Differenz"
-
-#: config/prefs.php.dist:154
-msgid "Do you want to confirm deleting postings?"
-msgstr "Möchten Sie das Löschen von Buchungen bestätigen?"
-
-#: templates/postings/transfer.inc:32
-msgid "Don't summarize."
-msgstr "Nicht summieren."
-
-#: templates/ledgers_list.php:31 templates/postings/actions.inc:10
-#: templates/accounts/accounts.inc:44 ledgers/index.php:32
-msgid "Edit"
-msgstr "Bearbeiten"
-
-#: templates/accounts/accounts.inc:44 lib/Forms/EditLedger.php:34
-#, php-format
-msgid "Edit %s"
-msgstr "%s bearbeiten"
-
-#: postings.php:144 postings.php:176
-msgid "Edit Postings"
-msgstr "Buchungen bearbeiten"
-
-#: templates/postings/header.inc:9
-msgid "Edit Search Query"
-msgstr "Suchabfrage bearbeiten"
-
-#: account.php:187 lib/Forms/account.php:81
-msgid "Edit this account"
-msgstr "Dieses Konto bearbeiten"
-
-#: account.php:78 account.php:94
-#, php-format
-msgid "Edit: %s"
-msgstr "Bearbeiten: %s"
-
-#: config/prefs.php.dist:147
-msgid "Enter expenses with negative sign?"
-msgstr "Ausgaben mit negativem Vorzeichen eingeben?"
-
-#: lib/Block/summary.php:104 lib/Block/summary.php:120
-msgid "Error when retrieving results."
-msgstr "Fehler beim Abfragen der Ergebnisse."
-
-#: lib/Fima.php:434
-msgid "Expense"
-msgstr "Ausgaben"
-
-#: templates/data/export.inc:16
-msgid "Export"
-msgstr "Exportieren"
-
-#: templates/data/export.inc:6
-msgid "Export Postings"
-msgstr "Buchungen exportieren"
-
-#: data.php:61 data.php:118 data.php:148
-#, php-format
-msgid "Failed to access the ledger: %s"
-msgstr "Fehler beim Zugriff auf das Buch: %s"
-
-#: lib/Block/summary.php:3
-msgid "Finances Results"
-msgstr "Finanzen Ergebnisse"
-
-#: postings.php:625 config/prefs.php.dist:73
-msgid "First Page"
-msgstr "Erste Seite"
-
-#: lib/Fima.php:457 config/prefs.php.dist:45
-msgid "Forecast"
-msgstr "Vorschau"
-
-#: templates/postings/javascript_edit.inc:13
-msgid "Friday"
-msgstr "Freitag"
-
-#: config/prefs.php.dist:7 config/prefs.php.dist:16
-msgid "General Options"
-msgstr "Allgemeine Einstellungen"
-
-#: config/report.php.dist:7
-msgid "General Overview"
-msgstr "Gesamtübersicht"
-
-#: templates/data/import.inc:7
-#, php-format
-msgid "Import Postings, Step %d"
-msgstr "Buchungen importieren, Schritt %d"
-
-#: data.php:205
-msgid "Import/Export Postings"
-msgstr "Buchungen importieren/exportieren"
-
-#: lib/Fima.php:433
-msgid "Income"
-msgstr "Einnahmen"
-
-#: config/prefs.php.dist:17
-msgid "Interface Options"
-msgstr "Oberflächen-Einstellungen"
-
-#: templates/postings/navbar.inc:11
-msgid "Invert"
-msgstr "Umkehren"
-
-#: lib/UI/VarRenderer/fima.php:51
-msgid "Keep subaccounts and postings."
-msgstr "Unterkonten und Buchungen behalten."
-
-#: postings.php:636 config/prefs.php.dist:74
-msgid "Last Page"
-msgstr "Letzte Seite"
-
-#: templates/ledgers_list.php:16 ledgers/index.php:31
-msgid "Ledger"
-msgstr "Buch"
-
-#: templates/ledgers_list.php:12
-msgid "Ledger List"
-msgstr "Buch-Liste"
-
-#: templates/ledgers_list.php:2 ledgers/index.php:37
-msgid "Manage Ledgers"
-msgstr "Buch-Verwaltung"
-
-#: lib/Block/tree_menu.php:3
-msgid "Menu List"
-msgstr "Menüliste"
-
-#: templates/postings/javascript_edit.inc:9
-msgid "Monday"
-msgstr "Montag"
-
-#: accounts.php:88
-msgid "My Accounts"
-msgstr "Meine Konten"
-
-#: postings.php:36
-msgid "My Postings"
-msgstr "Meine Buchungen"
-
-#: lib/Forms/account.php:39 lib/Forms/CreateLedger.php:30
-#: lib/Forms/EditLedger.php:37
-msgid "Name"
-msgstr "Name"
-
-#: account.php:63 account.php:94
-msgid "New Account"
-msgstr "Neues Konto"
-
-#: templates/data/import.inc:31
-msgid "Next"
-msgstr "Weiter"
-
-#: postings.php:634
-msgid "Next Page"
-msgstr "Nächste Seite"
-
-#: postings.php:601
-msgid "No Postings"
-msgstr "Keine Buchungen"
-
-#: templates/reports/empty.inc:2
-msgid "No data for this report."
-msgstr "Keine Daten für diese Auswertung."
-
-#: lib/Report/Analysis.php:49 lib/Report/PeriodOverview.php:42
-#: lib/Report/Trend.php:48 lib/Report/AccountOverview.php:42
-#: lib/Report/AssetOverview.php:46 lib/Report/GeneralOverview.php:43
-msgid "No display type"
-msgstr "Kein Anzeigetyp"
-
-#: lib/Report.php:167 lib/ReportGraph.php:172
-msgid "No report driver loaded"
-msgstr "Kein Auswertungstreiber"
-
-#: lib/Block/summary.php:152
-msgid "No results to display"
-msgstr "Keine Ergebnisse"
-
-#: templates/postings/navbar.inc:10 lib/Application.php:36
-msgid "None"
-msgstr "Keine"
-
-#: templates/postings/navbar.inc:15
-#, php-format
-msgid "Not %s"
-msgstr "Nicht %s"
-
-#: lib/Driver/sql.php:129 lib/Driver/sql.php:164 lib/Driver/sql.php:317
-msgid "Not found"
-msgstr "Nicht gefunden"
-
-#: lib/Forms/account.php:37
-msgid "Number"
-msgstr "Nummer"
-
-#: lib/Block/summary.php:42
-msgid "Number of months to display"
-msgstr "Anzahl der anzuzeigenden Monate"
-
-#: templates/menu.inc:19
-msgid "Open Ledger"
-msgstr "Buch öffnen"
-
-#: templates/reports/reports.inc:104
-msgid "Open Report"
-msgstr "Auswertung durchführen"
-
-#: templates/reports/reports.inc:75
-msgid "Other"
-msgstr "Andere"
-
-#: templates/reports/reports.inc:55
-msgid "P_eriod"
-msgstr "Z_eitraum"
-
-#: templates/postings/header.inc:18
-#, php-format
-msgid "Page %d of %d"
-msgstr "Seite %d von %d"
-
-#: lib/Report/PeriodOverview.php:65 lib/Report/AccountOverview.php:71
-msgid "Period"
-msgstr "Zeitraum"
-
-#: config/report.php.dist:8
-msgid "Period Overview"
-msgstr "Periodenübersicht"
-
-#: templates/postings/transfer.inc:11
-msgid "Period from"
-msgstr "Zeitraum von"
-
-#: templates/postings/transfer.inc:50
-msgid "Period to"
-msgstr "Zeitraum bis"
-
-#: lib/Forms/DeleteLedger.php:50
-msgid "Permission denied"
-msgstr "Zugriff verweigert"
-
-#: templates/postings/javascript_transfer.inc:6
-msgid "Please select another posting type where to transfer postings to."
-msgstr ""
-"Bitte wählen Sie einen anderen Datenkreis in welchen den Buchungen "
-"transferiert werden sollen."
-
-#: templates/postings/shift.inc:29 templates/postings/posting_headers.inc:26
-msgid "Posting A_ccount"
-msgstr "Bewe_gungskonto"
-
-#: config/prefs.php.dist:86 config/prefs.php.dist:100
-msgid "Posting Account"
-msgstr "Bewegungskonto"
-
-#: templates/postings/shift.inc:13
-msgid "Posting T_ype"
-msgstr "Daten_kreis"
-
-#: lib/Forms/account.php:76
-msgid "Postings"
-msgstr "Buchungen"
-
-#: config/prefs.php.dist:65
-msgid "Postings per page in the list view."
-msgstr "Anzahl der Buchungen pro Seite."
-
-#: data.php:159
-msgid "Postings successfully purged."
-msgstr "Buchungen erfolgreich gelöscht."
-
-#: postings.php:627
-msgid "Previous Page"
-msgstr "Vorherige Seite"
-
-#: templates/reports/reports.inc:65
-msgid "Re_ference"
-msgstr "Re_ferenz"
-
-#: lib/Forms/DeleteLedger.php:37
-#, php-format
-msgid ""
-"Really delete the ledger \"%s\"? This cannot be undone and all data on this "
-"ledger will be permanently removed."
-msgstr ""
-"Das Buch \"%s\" wirklich löschen? Dieser Vorgang kann nicht rückgängig "
-"gemacht werden, und alle Daten in diesem Buch werden endgültig gelöscht."
-
-#: report.php:94 report.php:97 report.php:99 report.php:100 report.php:101
-#: lib/Report/Analysis.php:81 lib/Report/AccountOverview.php:79
-#: lib/Report/GeneralOverview.php:79
-msgid "Reference"
-msgstr "Referenz"
-
-#: templates/postings/header.inc:5
-msgid "Refresh List"
-msgstr "Liste aktualisieren"
-
-#: templates/data/import.inc:18
-msgid ""
-"Replace existing postings with the imported one? <strong>Warning: This "
-"deletes all existing postings.</strong>"
-msgstr ""
-"Existierenden Buchungen durch die importierten ersetzen? <strong>Achtung: "
-"Dies löscht alle existierenden Buchungen.</strong>"
-
-#: templates/reports/reports.inc:12
-msgid "Repor_t"
-msgstr "Auswer_tung"
-
-#: templates/reports/graph.inc:2 lib/ReportGraph.php:84
-msgid "Report"
-msgstr "Auswertung"
-
-#: report.php:150
-#, php-format
-msgid "Report %s"
-msgstr "Auswertung %s"
-
-#: report.php:109 lib/Block/tree_menu.php:16
-msgid "Reports"
-msgstr "Auswertungen"
-
-#: templates/reports/reports.inc:105
-msgid "Reset"
-msgstr "Zurücksetzen"
-
-#: lib/Report/Analysis.php:359
-msgid "Rest"
-msgstr "Rest"
-
-#: templates/postings/edit.inc:47 lib/Report/PeriodOverview.php:74
-#: lib/Report/GeneralOverview.php:59
-msgid "Result"
-msgstr "Ergebnis"
-
-#: config/prefs.php.dist:124
-msgid "SQL (% and _)"
-msgstr "SQL (% und _)"
-
-#: templates/postings/actions.inc:11
-msgid "S_hift"
-msgstr "Umbuc_hen"
-
-#: templates/postings/javascript_edit.inc:14
-msgid "Saturday"
-msgstr "Samstag"
-
-#: templates/postings/actions.inc:15 lib/Forms/account.php:44
-#: lib/Forms/EditLedger.php:40
-msgid "Save"
-msgstr "Speichern"
-
-#: account.php:156 lib/Forms/account.php:44
-msgid "Save and New"
-msgstr "Speichern und Neu"
-
-#: postings.php:264
-#, php-format
-msgid "Saved %d postings."
-msgstr "%d Buchungen gespeichert."
-
-#: account.php:154
-#, php-format
-msgid "Saved %s."
-msgstr "%s gespeichert."
-
-#: templates/search/search.inc:106 templates/postings/header.inc:7
-#: templates/accounts/accounts.inc:47 lib/Fima.php:743
-#: lib/Block/tree_menu.php:14
-msgid "Search"
-msgstr "Suche"
-
-#: templates/search/search.inc:43
-msgid "Search A_sset Accounts"
-msgstr "Vermögen_skonten suchen"
-
-#: templates/search/search.inc:77
-msgid "Search Amo_unt Start"
-msgstr "Anfangsbetrag suchen"
-
-#: templates/search/search.inc:85
-msgid "Search Amoun_t End"
-msgstr "Endbetrag suchen"
-
-#: templates/search/search.inc:35
-msgid "Search Dat_e End"
-msgstr "Enddatum suchen"
-
-#: templates/search/search.inc:69
-msgid "Search Descriptio_n"
-msgstr "A_nmerkung suchen"
-
-#: templates/search/search.inc:51
-msgid "Search Posting A_ccounts"
-msgstr "Bewe_gungskonten suchen"
-
-#: templates/search/search.inc:15
-msgid "Search Posting T_ype"
-msgstr "_Datenkreis suchen"
-
-#: search.php:73 templates/postings/header.inc:7
-msgid "Search Postings"
-msgstr "Buchungen suchen"
-
-#: postings.php:505
-msgid "Search Results"
-msgstr "Ergebnisse suchen"
-
-#: templates/search/search.inc:27
-msgid "Search _Date Start"
-msgstr "Anfangs_datum suchen"
-
-#: templates/search/search.inc:93
-msgid "Search e.o. Postin_gs"
-msgstr "a.o. Buchun_gen suchen"
-
-#: templates/postings/navbar.inc:8
-msgid "Select"
-msgstr "Auswählen"
-
-#: lib/Forms/account.php:141
-msgid "Select another account where to shift postings to."
-msgstr "Wählen Sie ein anderes Konto zum Umbuchen der Buchungen."
-
-#: lib/Forms/account.php:176
-msgid "Select another account where to shift subaccount postings to."
-msgstr ""
-"Wählen Sie ein anderes Konto zum Umbuchen der Buchungen der Unterkonten."
-
-#: config/prefs.php.dist:167
-msgid "Select the canvas size for chart reports:"
-msgstr "Wählen Sie die Grafikgröße für Auswertungsdiagramme:"
-
-#: templates/data/import.inc:21
-msgid "Select the charset of the source file:"
-msgstr "Wählen Sie den Zeichensatz der importierten Datei:"
-
-#: templates/data/export.inc:10
-msgid "Select the export format:"
-msgstr "Wählen Sie das Exportformat:"
-
-#: templates/data/import.inc:29
-msgid "Select the file to import:"
-msgstr "Wählen Sie die Datei, die importiert werden soll:"
-
-#: config/prefs.php.dist:140
-msgid "Select the format for amounts:"
-msgstr "Wählen Sie das Format für Beträge:"
-
-#: config/prefs.php.dist:127
-msgid "Select the format for wildcards for text search:"
-msgstr "Wählen Sie das Format für Platzhalter in der Textsuche:"
-
-#: templates/data/import.inc:11
-msgid "Select the format of the source file:"
-msgstr "Wählen Sie das Format der importierten Datei:"
-
-#: templates/postings/actions.inc:11
-msgid "Shift"
-msgstr "Umbuchen"
-
-#: postings.php:154
-msgid "Shift Postings"
-msgstr "Buchungen umbuchen"
-
-#: lib/UI/VarRenderer/fima.php:37
-msgid "Shift postings to"
-msgstr "Buchungen umbuchen auf"
-
-#: postings.php:335
-#, php-format
-msgid "Shifted %d postings."
-msgstr "%d Buchungen umgebucht."
-
-#: templates/postings/shift.inc:3
-msgid "Shifting"
-msgstr "Umbuchen"
-
-#: lib/Block/summary.php:37
-msgid "Show summary of this ledger"
-msgstr "Buchübersicht anzeigen"
-
-#: templates/reports/table.inc:23
-#, php-format
-msgid "Sort by %s"
-msgstr "Sortieren nach %s"
-
-#: templates/postings/posting_headers.inc:35
-msgid "Sort by Amount"
-msgstr "Sortieren nach Betrag"
-
-#: templates/postings/posting_headers.inc:20
-msgid "Sort by Asset Account"
-msgstr "Sortieren nach Vermögenskonto"
-
-#: templates/postings/posting_headers.inc:15
-msgid "Sort by Date"
-msgstr "Sortieren nach Datum"
-
-#: templates/postings/posting_headers.inc:30
-msgid "Sort by Description"
-msgstr "Sortieren nach Anmerkung"
-
-#: templates/postings/posting_headers.inc:25
-msgid "Sort by Posting Account"
-msgstr "Sortieren nach Bewegungskonto"
-
-#: config/prefs.php.dist:115
-msgid "Sort direction:"
-msgstr "Sortierrichtung:"
-
-#: config/prefs.php.dist:90
-msgid "Sort postings by:"
-msgstr "Buchungen sortieren nach:"
-
-#: lib/Forms/account.php:77
-msgid "Subaccounts"
-msgstr "Unterkonten"
-
-#: templates/postings/transfer.inc:34
-msgid "Summarize by combining."
-msgstr "Summieren durch Kombination."
-
-#: templates/postings/transfer.inc:36
-msgid "Summarize by posting against"
-msgstr "Summieren durch Buchen gegen"
-
-#: postings.php:419 postings.php:433 postings.php:444
-msgid "Summarized"
-msgstr "Summiert"
-
-#: postings.php:468
-#, php-format
-msgid "Summarized %d postings."
-msgstr "%d Buchungen summiert."
-
-#: templates/postings/javascript_edit.inc:8
-msgid "Sunday"
-msgstr "Sonntag"
-
-#: data.php:22
-msgid "TSV"
-msgstr "TSV"
-
-#: templates/data/import.inc:14 templates/data/export.inc:13
-msgid "Tab separated values"
-msgstr "Tabulator getrennte Werte"
-
-#: data.php:196
-#, php-format
-msgid "The %s file didn't contain any postings."
-msgstr "Die %s-Datei enthielt keine Buchungen."
-
-#: lib/Driver.php:70
-msgid "The Finances backend is not currently available."
-msgstr "Der Finanzserver ist zur Zeit nicht verfügbar."
-
-#: lib/Driver.php:354
-#, php-format
-msgid "The Finances backend is not currently available: %s"
-msgstr "Der Finanzserver ist zur Zeit nicht verfügbar: %s"
-
-#: lib/ReportGraph.php:60
-msgid "The Finances report graphs are not currently available."
-msgstr "Die grafischen Finanzauswertungen sind zur Zeit nicht verfügbar."
-
-#: lib/ReportGraph.php:182
-#, php-format
-msgid "The Finances report graphs are not currently available: %s"
-msgstr "Die grafischen Finanzauswertungen sind zur Zeit nicht verfügbar: %s"
-
-#: lib/Report.php:46
-msgid "The Finances reports are not currently available."
-msgstr "Die Finanzauswertungen sind zur Zeit nicht verfügbar."
-
-#: lib/Report.php:177
-#, php-format
-msgid "The Finances reports are not currently available: %s"
-msgstr "Die Finanzauswertungen sind zur Zeit nicht verfügbar: %s"
-
-#: account.php:115
-#, php-format
-msgid "The account including all postings was shifted from number %s to %s."
-msgstr ""
-"Das Konto wurde inklusive aller Buchungen von Nummer %s nach %s verlagert."
-
-#: account.php:112
-#, php-format
-msgid "The account number %s is already used by the account %s."
-msgstr "Die Kontonummer %s wird bereits verwendet vom Konto %s."
-
-#: account.php:125
-#, php-format
-msgid "The account type was set to %s."
-msgstr "Der Kontotyp wurde auf %s geändert."
-
-#: report.php:145
-msgid "The graphs library could not be loaded."
-msgstr "Die Grafikbibliothek konnte nicht geladen werden."
-
-#: ledgers/create.php:28
-#, php-format
-msgid "The ledger \"%s\" has been created."
-msgstr "Das Buch \"%s\" wurde erstellt."
-
-#: ledgers/delete.php:43
-#, php-format
-msgid "The ledger \"%s\" has been deleted."
-msgstr "Das Buch \"%s\" wurde gelöscht."
-
-#: ledgers/edit.php:38
-#, php-format
-msgid "The ledger \"%s\" has been renamed to \"%s\"."
-msgstr "Das Buch \"%s\" wurde in \"%s\" umbenannt."
-
-#: ledgers/edit.php:40
-#, php-format
-msgid "The ledger \"%s\" has been saved."
-msgstr "Das Buch \"%s\" wurde gespeichert."
-
-#: data.php:157
-#, php-format
-msgid "The postings could not be purged: %s"
-msgstr "Die Buchungen konnte nicht gelöscht werden: %s"
-
-#: config/prefs.php.dist:104
-msgid "Then:"
-msgstr "Dann:"
-
-#: templates/postings/empty.inc:3
-msgid "There are no appropriate postings."
-msgstr "Es existieren keine entsprechenden Buchungen."
-
-#: lib/Report.php:125
-#, php-format
-msgid "There was a problem creating the report graph: %s."
-msgstr "Beim Erstellen der Auswertungsgrafik ist ein Problem aufgetreten: %s"
-
-#: report.php:127
-#, php-format
-msgid "There was a problem creating the report: %s."
-msgstr "Beim Erstellen der Auswertung ist ein Problem aufgetreten: %s"
-
-#: accounts.php:34
-#, php-format
-msgid "There was a problem deleting all accounts and postings: %s"
-msgstr ""
-"Beim Löschen aller Konten und Buchungen ist ein Problem aufgetreten: %s"
-
-#: postings.php:379
-#, php-format
-msgid "There was a problem deleting an existing posting: %s"
-msgstr ""
-"Beim Löschen einer existierenden Buchung ist ein Problem aufgetreten: %s"
-
-#: postings.php:477
-#, php-format
-msgid "There was a problem deleting an original posting: %s"
-msgstr ""
-"Beim Löschen einer ursprünglichen Buchung ist ein Problem aufgetreten: %s"
-
-#: postings.php:293
-#, php-format
-msgid "There was a problem deleting posting #%d: %s"
-msgstr "Beim Löschen der Buchung #%d ist ein Probelm aufgetreten: %s"
-
-#: account.php:212
-#, php-format
-msgid "There was a problem deleting the account: %s."
-msgstr "Beim Löschen des Kontos ist ein Problem aufgetreten: %s."
-
-#: lib/Report.php:132
-#, php-format
-msgid "There was a problem executing the report graph: %s."
-msgstr "Beim Ausführen der Auswertungsgrafik ist ein Problem aufgetreten: %s."
-
-#: report.php:137
-#, php-format
-msgid "There was a problem executing the report: %s."
-msgstr "Beim Ausführen der Auswertung ist ein Problem aufgetreten: %s."
-
-#: account.php:152
-#, php-format
-msgid "There was a problem saving the account: %s."
-msgstr "Beim Speichern des Kontos ist ein Problem aufgetreten: %s."
-
-#: postings.php:241 postings.php:462
-#, php-format
-msgid "There was a problem saving the posting: %s."
-msgstr "Beim Speichern der Buchung ist ein Problem aufgetreten: %s."
-
-#: postings.php:328
-#, php-format
-msgid "There was a problem shifting posting #%d: %s"
-msgstr "Beim Umbuchen der Buchung #%d ist ein Problem aufgetreten: %s"
-
-#: data.php:99
-msgid "There were no postings to export."
-msgstr "Es konnten keine Buchungen zum Exportieren gefunden werden."
-
-#: data.php:137
-msgid "This file format is not supported."
-msgstr "Dieses Dateiformat wird nicht unterstützt."
-
-#: ledgers/delete.php:21
-msgid "This ledger cannot be deleted."
-msgstr "Dieses Buch kann nicht gelöscht werden."
-
-#: templates/postings/javascript_edit.inc:12
-msgid "Thursday"
-msgstr "Donnerstag"
-
-#: templates/postings/list.inc:13 lib/Report/Analysis.php:199
-#: lib/Report/PeriodOverview.php:88 lib/Report/Trend.php:77
-#: lib/Report/Trend.php:154 lib/Report/AccountOverview.php:99
-#: lib/Report/AssetOverview.php:74 lib/Block/summary.php:74
-msgid "Total Result"
-msgstr "Gesamtergebnis"
-
-#: templates/postings/actions.inc:12
-msgid "Trans_fer"
-msgstr "Trans_fer"
-
-#: templates/postings/actions.inc:12
-msgid "Transfer"
-msgstr "Transfer"
-
-#: postings.php:162
-msgid "Transfer Postings"
-msgstr "Buchungen transferieren"
-
-#: templates/postings/transfer.inc:3
-msgid "Transfer from"
-msgstr "Transfer von"
-
-#: templates/postings/transfer.inc:42
-msgid "Transfer to"
-msgstr "Transfer nach"
-
-#: postings.php:468
-#, php-format
-msgid "Transfered %d postings."
-msgstr "%d Buchungen transferiert."
-
-#: config/report.php.dist:12
-msgid "Trend"
-msgstr "Trend"
-
-#: templates/postings/javascript_edit.inc:10
-msgid "Tuesday"
-msgstr "Dienstag"
-
-#: lib/Report/GeneralOverview.php:71 lib/Forms/account.php:38
-msgid "Type"
-msgstr "Typ"
-
-#: lib/Forms/DeleteLedger.php:57
-#, php-format
-msgid "Unable to delete \"%s\": %s"
-msgstr "\"%s\" kann nicht gelöscht werden: %s"
-
-#: lib/Report.php:180 lib/Driver.php:357 lib/ReportGraph.php:185
-#, php-format
-msgid "Unable to load the definition of %s."
-msgstr "Der %s-Treiber konnte nicht geladen werden."
-
-#: lib/Forms/EditLedger.php:49
-#, php-format
-msgid "Unable to save ledger \"%s\": %s"
-msgstr "Das Buch \"%s\" konnte nicht gespeichert werden: %s"
-
-#: postings.php:567 postings.php:576
-msgid "Unknown"
-msgstr "Unbekannt"
-
-#: templates/accounts/accounts.inc:47
-#, php-format
-msgid "View %s"
-msgstr "%s anzeigen"
-
-#: templates/postings/javascript_edit.inc:11
-msgid "Wednesday"
-msgstr "Mittwoch"
-
-#: config/prefs.php.dist:76
-msgid "When displaying the postings, which page do you want to start on?"
-msgstr "Bei der Anzeige von Buchungen, bei welcher Seite möchten Sie beginnen?"
-
-#: ledgers/edit.php:25
-msgid "You are not allowed to change this ledger."
-msgstr "Sie dürfen dieses Buch nicht ändern."
-
-#: ledgers/delete.php:31
-msgid "You are not allowed to delete this ledger."
-msgstr "Sie dürfen dieses Buch nicht löschen."
-
-#: templates/postings/javascript_list.inc:39
-msgid "You must select at least one posting first."
-msgstr "Sie müssen zuerst mindestens eine Buchung auswählen."
-
-#: config/prefs.php.dist:48
-msgid "Your active posting type:"
-msgstr "Ihr aktiver Datenkreis:"
-
-#: lib/Fima.php:744
-msgid "_Accounts"
-msgstr "_Konten"
-
-#: templates/reports/reports.inc:97
-msgid "_Chart"
-msgstr "_Diagramm"
-
-#: templates/postings/actions.inc:9
-msgid "_Delete"
-msgstr "_Löschen"
-
-#: templates/postings/transfer.inc:58
-msgid "_Delete existing Postings"
-msgstr "Existierende Buchungen _löschen"
-
-#: templates/reports/reports.inc:24
-msgid "_Display"
-msgstr "An_zeige"
-
-#: templates/postings/actions.inc:10
-msgid "_Edit"
-msgstr "_Bearbeiten"
-
-#: lib/Fima.php:754
-msgid "_Import/Export"
-msgstr "_Import/Export"
-
-#: templates/postings/transfer.inc:19
-msgid "_Keep original Postings"
-msgstr "Ursprüngliche Buchungen be_halten"
-
-#: lib/Fima.php:741
-msgid "_List Postings"
-msgstr "_Buchungen"
-
-#: lib/Fima.php:747
-msgid "_My Ledgers"
-msgstr "_Meine Bücher"
-
-#: templates/reports/reports.inc:88
-msgid "_Null Rows"
-msgstr "_Leerzeilen"
-
-#: lib/Fima.php:758
-msgid "_Print"
-msgstr "_Drucken"
-
-#: lib/Fima.php:751
-msgid "_Reports"
-msgstr "_Auswertungen"
-
-#: templates/reports/reports.inc:84
-msgid "_Subaccounts"
-msgstr "_Unterkonten"
-
-#: templates/postings/transfer.inc:28
-msgid "_Summarize Accounts"
-msgstr "Konten _summieren"
-
-#: templates/reports/reports.inc:92
-msgid "_Yearly"
-msgstr "_Jährlich"
-
-#: templates/postings/shift.inc:16 templates/postings/shift.inc:24
-#: templates/postings/shift.inc:32
-msgid "don't change"
-msgstr "nicht ändern"
-
-#: data.php:39 templates/postings/posting_headers.inc:43
-#: lib/Forms/account.php:40
-msgid "e.o."
-msgstr "a.o."
-
-#: postings.php:573
-#, php-format
-msgid "e.o. %s"
-msgstr "a.o. %s"
-
-#: search.php:62
-msgid "e.o. postings only"
-msgstr "nur a.o. Buchungen"
-
-#: search.php:63
-msgid "no e.o. postings"
-msgstr "keine a.o. Buchungen"
-
-#: config/prefs.php.dist:125
-msgid "none"
-msgstr "Keine"
-
-#: data.php:106 templates/data/export.inc:1
-msgid "postings.csv"
-msgstr "buchungen.csv"
-
-#: data.php:110
-msgid "postings.tsv"
-msgstr "buchungen.tsv"
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<help>
-
-<entry id="fima-overview" state="uptodate" md5="87c5c25bdb900145515484ea7c6931be">
- <title>Fima: Übersicht</title>
- <heading>Was ist Fima?</heading>
- <para>
- Fima steht für Finanz Manager und dient der doppelten Buchführung. Es ist ein flexibles Werkzeug um Ihre Finanzen zu organisieren sowie Ausgaben, Einkünfte und Vermögensstände zu verfolgen. Es ermöglicht die Erstellung von Budgets und Vorschauwerten und bietet zahlreiche verschiedene Auswertungen zur Analyse.
- </para>
- <heading>Hauptfunktionalitäten:</heading>
- <para>* freie und flexible Struktur des Kontenplans</para>
- <para>* Vermögenswerte organisiersen und nachverfolgen</para>
- <para>* unabhängige Datenkreise: Ist-Abrechnung, Budget, Vorschau</para>
- <para>* flexible and detaillierte Auswertungen mit verschiedenen Parametern</para>
- <para>* grafische Auswertungsdiagramme</para>
-</entry>
-
-<entry id="fima-prefs" state="uptodate" md5="2b3e6590a64b91c50b73414ee604e2e9">
- <title>Fima: Einstellungen</title>
- <heading>Aktive Konfiguration</heading>
- <para>* Ihr aktives Buch: wählen Sie Ihr aktives Buch</para>
- <para>* Ihr aktiver Datenkreis: wählen Sie Ihren aktiven <ref module="fima" entry="postings-postingtypes">Datenkreis</ref></para>
- <para>* Geschlossen mit Zeitraum: wählen Sie das Ende des Zeitraums, innerhalb dessen das Anlegen und Bearbeiten von Buchungen gesperrt ist; wählen Sie "Keine" um alle Buchungen offen zu lassen</para>
- <heading>Oberflächen-Einstellungen</heading>
- <para>* Anzahl der Buchungen pro Seite: geben Sie die Anzahl der Buchungen ein, die pro Seite angezeigt werden</para>
- <para>* Bei der Anzeige von Buchungen, bei welcher Seite möchten Sie beginnen: erste oder letzte Seite</para>
- <para>* Buchungen sortieren nach: wählen Sie die Spalte aus, nach welcher Buchungen sortiert werden</para>
- <para>* Dann: wählen Sie eine alternative Spalte aus, nach welcher Buchungen sortiert werden</para>
- <para>* Sortierrichtung: aufsteigen oder absteigend</para>
- <para>* Wählen Sie das Format für Platzhalter in der Textsuche: DOS Platzhalter (* und ?), SQL Platzhalter (% und _) oder keine</para>
- <para>* Wählen Sie das FOrmat für Beträge: wählen Sie Ihre bevorzugte Notation</para>
- <para>* Ausgaben mit negativem Vorzeichen eingeben: wählen Sie, ob Sie bei beim Eingeben von Buchungen das negative Vorzeichen für Ausgaben weglassen möchten</para>
- <para>* Möchten Sie das Löschen von Buchungen bestätigen: wählen Sie, ob Sie das Löschen von Buchungen bestätigen möchten</para>
- <para>* Wählen Sie die Grafikgröße für Auswertungsdiagramme: die Abmessungen der erstellten Bilder in Pixel</para>
-</entry>
-
-<entry id="accounts-overview" state="uptodate" md5="74688e9bd6426f1d1b20667e8b5c32d0">
- <title>Konten: Übersicht</title>
- <para>
- Der Kontenplan ist in drei Ebenen gegliedert:
- </para>
- <heading>Kontokategorie</heading>
- <para>
- Kontokategorien dienen der allgemeinen Aufsummierungen von verschiedenen Konten. Jedes Konto ist einer einzigen Kategorie zugeordnet. Es existieren drei verschiedene Kontokategorien:
- </para>
- <para>* Einnahmen (zB. Gehalt, Gewinne, Spenden, etc.)</para>
- <para>* Ausgaben (zB. Verpflegung, Miete, Kleidung, etc.)</para>
- <para>* Vermögen (zB. Bargeld, Kreditkarten, Sparbücher, etc.)</para>
- <para>
- Es ist notwendig pro Buchungstransaktion ein Vermögenskonto anzugeben. Dadurch ist es möglich Ihre Vermögensbestände sowie jegliche Geldtransfers (Buchungen von einem Vermögenskonto auf ein anderes) nachzuverfolgen.
- </para>
- <tip>
- Tipp: Wenn Sie nur an Einnahmen und Ausgaben interessiert sind und keine Vermögenswerte verwalten wollen, legen Sie nur ein einziges Vermögenskonto an, welches automatisch für alle Buchungen ausgewählt wird.
- </tip>
- <heading>Kontogruppen, Hauptkonten, Unterkonten</heading>
- <para>
- Ein Konto dient der Summierung von ähnlichen Einnahmens-, Ausgaben- oder Vermögenspositionen. Ein Konto wird durch eine Nummer, einen Namen und eine Kontokategroie definiert. Eine Kontonummer ist unterteilt in zwei Teile: XXYY, wobei XX das Hauptkonto und YY das Unterkonto bezeichnet (zB. in der Kontogruppe 12: 1200 ist das Hauptkonto, 1230 und 1245 sind beides Unterkonten). Es können 100 Kontogruppen zu je 100 Konten angelegt werden, wobei die Nutzung von Unterkonten nicht erforderlich ist.
- </para>
- <para>
- Zusätzlich ist es möglich eine Langbeschreibung pro Konto anzugeben und ob die Buchungen auf diesem Konto standardmäßig als a.o. markiert werden sollen (siehe <ref module="fima" entry="postings-overview">Buchungen Übersicht</ref>). Weiters kann ein Konto abgeschlossen werden um neue Buchungen zu unterbinden, jedoch existierende zu behalten.
- </para>
- <tip>
- Tipp: Bei der Nutzung von Unterkonten vermeiden Sie es direkt auf das Hauptkonto XX00 zu buchen, da Sie sonst diese Buchungen beim Summieren auf Kontogruppen in Auswertungen nicht mehr identifizieren können. Es empfielt sich für allgemeine Buchungen, die zu keinem Unterkonto passen, ein separates Unterkonto zu erstellen (zB. XX99).
- </tip>
-</entry>
-
-<entry id="accounts-delete" state="uptodate" md5="2b0a15a00e2c535220ed68eadf58e235">
- <title>Konten: Löschen eines Kontos</title>
- <para>
- Beim Löschen eines Kontos müssen Sie angeben, wie Sie Buchungen handhaben wollen:
- </para>
- <para>* Buchungen löschen: alle existierenden Buchungen, die auf das betroffene Konto gebucht wurden, löschen</para>
- <para>* Buchungen umbuchen: alle existierenden Buchungen auf ein anderes Konto derselben Kategorie verschieben</para>
- <para>
- Sie müssen auch angeben, wie Sie etwaige Unterkonten und deren Buchungen handhaben wollen:
- </para>
- <para>* Unterkonten und Buchungen behalten: nichts tun</para>
- <para>* Unterkonten und Buchungen löschen: alle existierenden Unterkonten und Buchungen ebenfalls löschen</para>
- <para>* Unterkonten löschen und Buchungen umbuchen: alle existierenden Unterkonten löschen und zuvor jegliche existierenden Buchungen auf ein anderes Konto derselben Kategorie verschieben</para>
-</entry>
-
-<entry id="postings-overview" state="uptodate" md5="d17c7f941da4e303b5f01a91e8bbdd4d">
- <title>Buchungen: Übersicht</title>
- <para>
- Ein Buchungssatz hat folgende Attribute:
- </para>
- <para>* Datenkreis: siehe <ref module="fima" entry="postings-postingtypes">Datenkreise</ref></para>
- <para>* Datum: Datum der Buchung (Tag, Monat, Jahr)</para>
- <para>* Vermögenskonto: für jede Buchung ist die Angabe eines Vermögenskontos zur Verfolgung Ihre Vermögenswerte erforderlich</para>
- <para>* Bewegungskonto: das Konto der Transaktion, üblicherweise vom Typ Einnahmen oder Ausgaben; bei Vermögensumlagen (zB. Bargeldabhebung von einem Bankkonto) wählen Sie das entsprechende Vermögenskonto als Bewegungskonto</para>
- <para>* Anmerkung: pro Buchung kann eine kurze Anmerkung eingegeben werden (max. 255 Zeichen)</para>
- <para>* Betrag: positive Beträge erhöhen und negative Beträge vermindern das gewählte Vermögenskonto</para>
- <para>* a.o.: Buchungen können als außerordentlich markiert werden (besonders groß, nicht geplant, ...)</para>
-</entry>
-
-<entry id="postings-postingtypes" state="uptodate" md5="745346005880a238cd2202eeae517a40">
- <title>Buchungen: Datenkreise</title>
- <para>
- Jede Buchung ist einem einziges Datenkreis zugeordnet. Es existieren drei unterschiedliche Datenkreise:
- </para>
- <heading>Ist-Abrechnung</heading>
- <para>
- Ist-Buchungen bestehen aus derzeitigen Einnahmen und Ausgaben, die mittels verschiedener Auswertungen analysiert werden können. Es spiegelt Ihre aktuelle finanzielle Situation wider.
- </para>
- <tip>
- Tipp: Prüfen Sie stets auf Vermögensdifferenzen, bevor Sie mit der Eingabe neuer Buchungen beginnen. Buchen Sie jegliche Differenzen auf ein spezielles Konto, um wenigstens korrekte Vermögenskonten zu haben. Prüfen Sie auch Ihre Kontoauszüge auf fehlende Buchungen.
- </tip>
- <tip>
- Tipp: Versuchen Sie Ihre Buchungen regelmäßig zu erfassen. Fragen Sie immer nach einem Kassenbon oder schreiben Sie Ihre Ausgaben auf einem Zettel auf, damit Sie keine Ausgaben vergessen, wenn Sie diese nicht sofort erfassen.
- </tip>
- <heading>Budget</heading>
- <para>
- Die Verwendung eines Budgets ist optional und bietet Kontrolle über Ihre zukünftige finanzielle Entwicklung ebenso wie die Analysemöglichkeit Ihrer früheren Finanzziele. Dadurch ist es möglich Ihren finanziellen Spielraum früh zu erkennen.
- </para>
- <tip>
- Tipp: Versuchen Sie Ihre wesentliche Budget-Zielsetzungen zu erreichen. Klammern Sie sich jedoch nicht krampfhaft daran, denn es wird immer Ereignisse geben, die Sie nicht in Ihrem Budget berücksichtigt haben.
- </tip>
- <tip>
- Tipp: Wenn Sie einen detaillierten Kontenplan verwenden, erstellen Sie Ihr Budget auf Basis von Hauptkonten anstelle von Unterkonten, da dies sonst sehr zeitintensiv wäre.
- </tip>
- <tip>
- Tipp: Erfassen Sie jegliche Abweichungen zwischen Ihrer Ist-Abrechnung und Ihrem Budget. Dadurch sind auch Ihre budgetierten Vermögenswerte aktuell.
- </tip>
- <tip>
- Tipp: Es besteht die Möglichkeit Ihr Budget durch die Funktion <ref module="fima" entry="postings-transfer">Buchungen transferieren</ref> als Kopie der Buchungen des Vorjahrs mit optionaler Summierung zu erstellen und nachträglich anzupassen.
- </tip>
- <heading>Vorschau</heading>
- <para>
- Nach der Erstellung des Budget wird dieses in der Regel nicht mehr verändert. Alle weiteren Anpassung können dann in der Vorschaurechnung berücksichtigt werden, welche somit ein aktualisiertes Budget darstellt.
- </para>
- <tip>
- Tipp: Prüfen Sie auf Abweichungen zwischen den Summen von Ist-Abrechnung und Budget/Vorschau und passen Sie die weitere Vorschaurechnung an.
- </tip>
- <tip>
- Tipp: Erfassen Sie jegliche Abweichungen zwischen Ihrer Ist-Abrechnung und Vorschau. Dadurch sind auch Ihre Vorschau-Vermögenswerte aktuell.
- </tip>
- <tip>
- Tipp: Es besteht die Möglichkeit Ihre Vorschaurechnung durch die Funktion <ref module="fima" entry="postings-transfer">Buchungen transferieren</ref> als Kopie Ihres Budgets zu erstellen und nachträglich anzupassen.
- </tip>
-</entry>
-
-<entry id="postings-addedit" state="uptodate" md5="c296f959744987f7c0d90a5fbe813f6a">
- <title>Buchungen: Buchungen erstellen/bearbeiten</title>
- <para>
- Für die vereinfachte Eingabe wird bei neuen Buchungen das Datum und Vermögenskonto vom darüberliegenden Eintrag kopiert, kann aber nachträglich geändert werden.
- </para>
- <para>
- Ausgaben haben üblicherweise negative Beträge, können jedoch aus Komfort ohne negatives Vorzeichen eingegeben werden (siehe <ref module="fima" entry="fima-prefs">Oberflächen-Einstellungen: Ausgaben mit negativem Vorzeichen eingeben?</ref>). Bei Vermögensumlagen (Transfer von einem Vermögenskonto auf ein anderes) betrifft der eingegebene Betrag stets das gewählte Verm*genskonto (zB. -10 bedeutet eine Verminderung des gewählten Vermögenskontos um 10 und folglich eine Erhöhung um 10 des als Bewegungskonto ausgewählten Vermögenskontos).
- </para>
- <tip>
- Tipp: Bei der Eingabe neuer Buchungen können Konten auch ausgewählt werden, indem man einfach die Kontonummer auf der Tastatur eingibt anstatt die Listenfelder zu durchsuchen. Sie werden rasch die am häufigsten verwendeten Kontonummer kennen und sich so eine Menege Zeit bei der Eingabe neuer Buchungen sparen.
- </tip>
- <tip>
- Tipp: Bei der Eingabe neuer Buchungen können Sie mathematische Operationen im Betragsfeld ausführen. Geben Sie einfach den mathematischen Ausdruck (zB. 3+2*5) ein und das Ergebnis wird automatisch berechnet.
- </tip>
- <tip>
- Tipp: Bei der Eingabe neuer Buchungen für <ref module="fima" entry="postings-postingtypes">Budget oder Vorschau</ref> können Sie automatisch einen Satz gleicher Buchungen für jeden Monat eines gezielten Jahres erstellen. In der ersten Zeile geben Sie ein beliebiges Datum des gewünschten Jahres ein, wählen ein Vermögens- und Bewegungskonto und geben eine Anmerkung (optional) und Betrag ein. Drücken Sie anschließend den Knopf "Auto-Füllen", um die eingegeben Werte für alle Monate zu kopieren.
- </tip>
-</entry>
-
-<entry id="postings-shift" state="uptodate" md5="5878a02d23d74c67977c1393eb6f5926">
- <title>Buchungen: Buchungen umbuchen</title>
- <para>
- Buchen Sie mehrere Buchungen um, um diese gemeinsam in einen anderen Datenkreis zu verschieben oder deren Vermögens- oder Bewegungskonto zu ändern.
- </para>
-</entry>
-
-<entry id="postings-transfer" state="uptodate" md5="24db527f199a9e86f4520b3dc9093117">
- <title>Buchungen: Buchungen transferieren</title>
- <para>
- Transferieren Sie alle Buchungen eines bestimmten Datenkreise innerhalb eines gezielten Zeitraums in einen anderen Datenkreis mit folgenden Optionen:
- </para>
- <para>* Transfer von: Quelldatenkreis, von dem die Buchungen transferiert werden sollen</para>
- <para>* Zeitraum von: Quellzeitraum, innerhalb dessen die Buchungen transferiert werden sollen</para>
- <para>* Ursprüngliche Buchungen behalten: auswählen um die gewählten Buchungen zu kopieren, andernfalls um diese zu verschieben</para>
- <para>* Nicht summieren: Buchungen unverändert lassen</para>
- <para>* Summieren durch Kombination: Buchungen summieren durch Gruppierung pro Kombination Vermögens-/Bewegungskonto</para>
- <para>* Summieren durch Buchen gegen: Buchungen summieren durch getrennte Gruppierung pro Vermögens- und Bewegungskonto, wobei jeweils gegen ein spezielle (Dummy-)Konto gebucht wird</para>
- <para>* Transfer nach: Zieldatenkreis, in den die Buchungen transferiert werden sollen</para>
- <para>* Zeitraum bis: Zielzeitraum, inner den die Buchungen transferiert werden sollen</para>
- <para>* Existierende Buchungen löschen: zuvor alle existierenden Buchungen im Zieldatenkreis innerhalb des Zielzeitraums löschen</para>
- <tip>
- Tipp: Sie könnnen das <ref module="fima" entry="postings-postingtypes">Budget (oder die Vorschau)</ref> durch Transfer existiernder Buchungen von der Ist-Abrechnung (oder dem Budget) erstellen. Achten Sie darauf, die ursprünglichen Buchungen zu behalten. Es empfielt sich, die Buchungen für das Budget (oder die Vorschau) zu summieren um lediglich Buchungen auf der Ebene von Hauptkonto zu erhalten. Dies erleichtert später Anpassungen.
- </tip>
- <tip>
- Tipp: Es besteht die Möglichkeit alle Buchungens eines Jahrs auf einmal zu transferieren. Wählen Sie "Alle" als Quell- und Zielmonat, um den Buchungsmonat nicht ändern.
- </tip>
-</entry>
-
-<entry id="postings-search" state="uptodate" md5="258a3ebf5d3f9b7ba42de4da119321d1">
- <title>Buchungen: Buchungen suchen</title>
- <para>
- Bei der Suche von Buchungen können Sie folgende Filter verwenden:
- </para>
- <para>* Datenkreis: zu filternder Datenkreis</para>
- <para>* Anfangsdatum: Beginn des zu filternden Zeitraums</para>
- <para>* Enddatum: Ende des zu filternden Zeitraums</para>
- <para>* Vermögenskonten: es werden Buchungen mit dem/den ausgewählten Konten als Vermögens- oder Bewegungskonto (bei Vermögensumlagen) gefiltert</para>
- <para>* Bewegungskonten: es werden Buchungen mit dem/den ausgewählten Konten als Bewegungskonto gefiltert</para>
- <para>* Anmerkung: Sie können Platzhalter beim Durchsuchen der Anmerkung verwenden (siehe <ref module="fima" entry="fima-prefs">Oberflächen-Einstellungen: Wählen Sie das Format für Platzhalter in der Textsuche</ref>).</para>
- <para>* Anfangsbetrag: minimaler Betrag</para>
- <para>* Endbetrag: maximaler Betrag</para>
- <para>* a.o. Buchungen: alle oder keine a.o. Buchungen filtern; leer lassen um alle Buchungen zu erhalten</para>
- <tip>
- Tipp: Es können mehrere Vermögens- und Bewegungskonten durch Halten der Umschalt- oder Steuerungstaste ausgewählt werden.
- </tip>
- <tip>
- Tipp: Beim Filtern nach Beträgen vergessen Sie nicht Ausgaben mit negativem Vorzeichen einzugeben.
- </tip>
- <tip>
- Tipp: Eine Suchabfrage wird für die derzeitige Sitzung solange gespeichert, bis diese beendet oder eine neue Suche gestartet wird. Ein Anzeichen für eine aktive Sucheabfrage ist das Mistkübel-Symbol in der Überschriftszeile.
- </tip>
-</entry>
-
-<entry id="reports-overview" state="uptodate" md5="ce8078bd6729c67b34b4b43e11a12ca8">
- <title>Auswertungen: Übersicht</title>
- <para>
- Bei der Erstellung von Auswertungen können Sie folgende Parameter verwenden:
- </para>
- <para>* Auswertung: verschiedene <ref module="fima" entry="reports-details">Auswertungen</ref></para>
- <para>* Anzeige: Datenkreis auswählen (manche Auswertungen benutzen nur den ersten Wert, andere alle Werte)</para>
- <para>* Zeitraum: Beginn und Ende des Auswertungszeitraums</para>
- <para>* Referenz: Beginn und Ende des Referenz-Auswertungszeitraums (bei der Verwendung von Referenz als Datenkreis für die Anzeige)</para>
- <para>* Konten: Buchungen mit den ausgewählten Konten als Bewegungskonto werden ausgewertet</para>
- <para>* Kumulieren: Teilergebnisse im gewählten Zeitraum werden summieren</para>
- <para>* Unterkonten: zusätzlich Unterkonten anzeigen anstatt nur Hauptkonten</para>
- <para>* Leerzeilen: Zeilen ohne Ergebnisse anzeigen</para>
- <para>* Jährlich: Ergebnisse nach Jahren anstatt Monaten gruppieren</para>
- <para>* Diagramm: eine Auswertungsgrafik anstelle von einer tabellarischen Ansicht anzeigen</para>
- <para>
- Alle Auswertungen verwenden nur einen Teil der Parameter. Siehe <ref module="fima" entry="reports-details">Auswertungsdetails</ref> für eine Beschreibung jeder Auswertung und der verwendeten Parameter.
- </para>
-</entry>
-
-<entry id="reports-details" state="uptodate" md5="75a481cf5c1c9943c75bb915ba4f1f7f">
- <title>Auswertungen: Details</title>
-
- <heading>Gesamtübersicht</heading>
- <para>* Beschreibung: Kontokategorien, Ergebnisse und Vermögen pro Datenkreis</para>
- <para>* Parameter: Anzeige (alle), Zeitraum, (Referenz), Konten, Diagramm</para>
- <para>* Diagramm: Balkendiagramm</para>
-
- <heading>Periodenübersicht</heading>
- <para>* Beschreibung: Kontokategorien, Ergebnisse und Vermögen pro Zeitraum</para>
- <para>* Paramater: Anzeige (erstes), Zeitraum, (Referenz), Konten, Kumulieren, Leerzeilen, Jährlich, Diagramm</para>
- <para>* Diagramm: Liniendiagramm</para>
-
- <heading>Kontoübersicht</heading>
- <para>* Beschreibung: Datenkreise pro Zeitraum</para>
- <para>* Parameter: Anzeige (alle), Zeitraum, (Referenz), Konten, Kumulieren, Leerzeilen, Jährlich, Diagramm</para>
- <para>* Diagramm: Liniendiagramm</para>
-
- <heading>Vermögensübersicht</heading>
- <para>* Beschreibung: Vermögenskonten pro Zeitraum</para>
- <para>* Parameter: Anzeige (erstes), Zeitraum, (Referenz), Kumulieren, Unterkonten, Leerzeilen, Jährlich, Diagramm</para>
- <para>* Diagramm: Liniendiagramm, Besten 5</para>
-
- <heading>Analyse</heading>
- <para>* Beschreibung: Datenkreise pro Konten</para>
- <para>* Parameter: Anzeige (alle), Zeitraum, (Referenz), Konten, Unterkonten, Leerzeilen, Diagramm</para>
- <para>* Diagramm: Tortendiagramm, Besten 5 (Rest gruppiert) pro Kontokategorie</para>
-
- <heading>Trend</heading>
- <para>* Beschreibung: Zeitraum pro Konto</para>
- <para>* Parameter: Anzeige (erstes), Zeitraum, (Referenz), Konten, Unterkonten, Leerzeilen, Jährlich, Diagramm</para>
- <para>* Diagramm: Liniendiagramm, Besten 5 pro Kontokategorie</para>
-</entry>
-
-<entry id="exemplar-overview" state="uptodate" md5="c5db8c1fac3b92d75490ce2d2842bba5">
- <title>Musterbeispiel: Übersicht</title>
- <para>
- Dieses Musterbeispiel demonstriert die Verwendung der Hauptfunktionalitäten von Fima. Folgen Sie den Anweisungen Schritt für Schritt in der angegebenen Reihenfolge.
- </para>
-</entry>
-
-<entry id="exemplar-accounts" state="uptodate" md5="fe4506577ae10ce864f610b3d0ebe287">
- <title>Musterbeispiel: 1) Konten</title>
- <heading>Vermögen</heading>
- <para>* 0100 Bargeld</para>
- <para>* * 0110 Person A</para>
- <para>* * 0120 Person B</para>
- <para>* 0200 Girkontoo</para>
- <para>* 0300 Sparbuch</para>
- <para>* 0400 Lebensversicherung</para>
- <heading>Einnahmen</heading>
- <para>* 0000 Saldovortrag</para>
- <para>* 1000 Gehalt</para>
- <para>* 1900 Andere Einnahmen</para>
- <para>* * 1910 Beihilfen</para>
- <para>* * 1999 Diverses</para>
- <heading>Ausgaben</heading>
- <para>* 2000 Verpflegung</para>
- <para>* 3000 Heim</para>
- <para>* * 3010 Miete</para>
- <para>* * 3020 Strom</para>
- <para>* * 3030 Einrichtung</para>
- <para>* 3500 Auto</para>
- <para>* * 3510 Versicherung</para>
- <para>* * 3520 Benzin</para>
- <para>* 4000 Person A</para>
- <para>* * 4010 Kleidung</para>
- <para>* * 4020 Freizeit</para>
- <para>* 5000 Person B</para>
- <para>* * 5010 Kleidung</para>
- <para>* * 5020 Freizeit</para>
- <para>* 9900 Andere Ausgaben</para>
- <tip>
- Tipp: Der obige Kontenplan ist nur ein kleines Beispiel. Tatsächlich gibt es eine Menge anderer Sachen zu berücksichtigen (zB. Verkäufe, Spenden, Lotterie, Zinsen, TV/Internet, Elektronik, Renovierung, Reparaturen, Haushalt, Sanitärartikel, Medikamente, Haustiere, Frisör, Parkgebühren, Maut, Autoreparaturen, Ersatzteile, Bildung, Telefonie, Partys, Musik/Video, Spiele, Sport, Bücher, Rauchen, Urlaub, Geschenke, Steuern, etc.)
- </tip>
-</entry>
-
-<entry id="exemplar-opening" state="uptodate" md5="029ca344d99a291fb1fe526119bdfb8a">
- <title>Musterbeispiel: 2) Anfangsbestände</title>
- <para>
- Vor der Eingabe regelmäßiger Buchungen erfassen wir unsere Vermögenswerte und buchen sie gegen das Konto 0000 Saldovortrag (zB. mit dem Datum 01.01.2008):
- </para>
- <para>Vermögenskonto | Bewegungskonto | Betrag</para>
- <para>* 0110 Bargeld - Person A | 0000 Saldovortrag | 133,50</para>
- <para>* 0120 Bargeld - Person B | 0000 Saldovortrag | 420,30</para>
- <para>* 0200 Girokonto | 0000 Saldovortrag | -3.412,50</para>
- <para>* 0300 Sparbuch | 0000 Saldovortrag | 6.850,20</para>
- <para>* 0400 Lebensversicherung | 0000 Saldovortrag | 10.500,00</para>
- <para>In Summe beträgt unser Vermögen daher 14.491,50.</para>
- <tip>
- Tipp: Benutzen Sie ein eigenes Konto der Kategorie Einkommen für die Anfangsbestände. Dadurch weisen Auswertungen korrekte Beträge aus und Vermögensstände können verfolgt werden.
- </tip>
-</entry>
-
-<entry id="exemplar-postings" state="uptodate" md5="dc025443c75600a597a16f03c44f0d54">
- <title>Musterbeispiel: 3) Buchungen</title>
- <para>
- Nach der Erfassung unserer <ref module="fima" entry="exemplar-opening">Anfangsbestände</ref> beginnen wir einige Buchungen einzugeben (mit einem Datum nach dem 01.01.2008):
- </para>
- <para>Vermögenskonto | Bewegungskonto | Betrag</para>
- <para>* 0110 Bargeld - Person A | 2000 Verpflegung | -35,00</para>
- <para>* 0110 Bargeld - Person A | 4020 Person A - Freizeit | -22,20</para>
- <para>* 0110 Bargeld - Person A | 3520 Auto - Benzin | -40,00</para>
- <para>* 0120 Bargeld - Perosn B | 0200 Girokonto | 1.000,00</para>
- <para>* 0120 Bargeld - Person B | 2000 Verpflegung | -320,10</para>
- <para>* 0120 Bargeld - Person B | 5010 Person B - Kleidung | -278,00</para>
- <para>* 0200 Girokonto | 1000 Gehalt | 2.600,00</para>
- <para>* 0200 Girokonto | 3010 Heim - Miete | -520,00</para>
- <tip>
- Tipp: Die vierte Buchung ist eine Vermögensumlage, Person B hebt 1.000,00 vom Girokonto ab. Es wäre auch möglich gewesen die Transaktion aus Sicht des Girokontos zu tätigen, indem man Vermögens- und Bewegungskonto vertauscht und einen negativen Betrag eingibt.
- </tip>
- <tip>
- Tipp: Aus Komfort ist es möglich Ausgaben ohne negativem Vorzeichen einzugeben (siehe <ref module="fima" entry="fima-prefs">Oberflächen-Einstellungen: Ausgaben mit negativem Vorzeichen eingeben?</ref>). Jedenfalls betrifft der eingegeben Betrag bei der vierten Transaktion (Vermögensumlage) stets das ausgewählte Vermögenskonto.
- </tip>
- <tip>
- Tipp: Kontrollieren Sie die Endbeträge der Vermögenskonten mit der Auswertung <ref module="fima" entry="reports-details">Vermögensübersicht</ref> (mit kumulierten Werten).
- </tip>
- <tip>
- Tipp: Verfolgen und analysieren Sie Ihre Einnahmen und Ausgaben mit den Auswertungen <ref module="fima" entry="reports-details">Kontoübersicht und Analyse</ref>. Benutzen Sie die Auswertungen <ref module="fima" entry="reports-details">Periodenübersicht und Trend</ref> zur Analyse und Überprüfung der Entwicklung Ihrer Kosten.
- </tip>
-</entry>
-
-<entry id="exemplar-budget" state="uptodate" md5="0824170665f69b40b0d60546cd7b8ed3">
- <title>Musterbeispiel: 4) Budget</title>
- <para>
- Um Einnahmen und Ausgaben zu planen und analysieren erstellen wir ein Budget für 2008 (normalerweise bevor Buchungen eingegeben werden). Es existieren zwei Möglichkeiten ein Budget zu erstellen:
- </para>
- <para>
- A) Erstellen Sie Ihr Budget ganz neu, indem Sie händisch Buchungen für jeden Monat eingeben. Aus Komfort empfielt es sich nur Hauptkonten zu verwenden. Benutzen Sie die Funktion <ref module="fima" entry="postings-addedit">Auto-Füllen</ref> um die Werte der ersten Zeile in die nächsten elf für das gesamte Jahr zu kopieren. Es ist erforderlich, dass Sie Budget-Buchungen für jedes Konto getrennt auf diese Weise eingeben.
- </para>
- <para>
- B) Erstellen Sie Ihr Budget basierend auf den Einnahmen und Ausgaben des Vorjahrs (sofern verfügbar). Benutzen Sie die Funktion <ref module="fima" entry="postings-transfer">Buchungen transferieren</ref> mit folgenden Parametern:
- </para>
- <para>* Transfer von: Ist-Abrechnung</para>
- <para>* Zeitraum von: 2007 - Alle</para>
- <para>* Ursprüngliche Buchungen behalten: ja</para>
- <para>* Konten summieren: Summieren durch Kombination.</para>
- <para>* Transfer nach: Budget</para>
- <para>* Zeitraum bis: 2008 - Alle</para>
- <para>* Existierende Buchungen löschen: ja</para>
- <tip>
- Tipp: Vergleichen Sie Budgetwerte mit der Ist-Abrechung mithilfe der Auswertungen <ref module="fima" entry="reports-details">Gesamtübersicht, Kontoübersicht oder Analyse</ref>.
- </tip>
-</entry>
-
-<entry id="exemplar-forecast" state="uptodate" md5="47cfb9a782f6fa2d5dbad844d854e786">
- <title>Musterbeispiel: 5) Vorschau</title>
- <para>
- Da ein Budget normalerweise nach der Erstellung unverändert bleibt, wollen wir eine Vorschau zum Anpassen. Es existieren zwei Möglichkeiten eine Vorschau zu erstellen:
- </para>
- <para>
- A) Erstellen Sie Ihre Vorschau ganz neu (siehe <ref module="fima" entry="exemplar-budget">Musterbeispiel: Budget</ref>).
- </para>
- <para>
- B) Erstellen Sie Ihre Vorschau als Kopie Ihres Budgets mittels der Funktion <ref module="fima" entry="postings-transfer">Buchungen transferieren</ref> mit folgenden Parametern:
- </para>
- <para>* Transfer von: Budget</para>
- <para>* Zeitraum von: 2008 - Alle</para>
- <para>* Ursprüngliche Buchungen behalten: ja</para>
- <para>* Konten summieren: Nicht summieren.</para>
- <para>* Transfer nach: Vorschau</para>
- <para>* Zeitraum bis: 2008 - Alle</para>
- <para>* Existierende Buchungen löschen: ja</para>
- <tip>
- Tipp: Vergleichen Sie Vorschauwerte mit dem Budget oder der Ist-Abrechnung mithilfe der Auswertungen <ref module="fima" entry="reports-details">Gesamtübersicht, Kontoübersicht oder Analyse</ref>.
- </tip>
-</entry>
-
-</help>
+++ /dev/null
-<?xml version='1.0'?>
-<help>
-
-<entry id="fima-overview">
- <title>Fima: Overview</title>
- <heading>What is Fima?</heading>
- <para>
- Fima stands for Finance Manager and is a double entry based ledger. It is a fully flexibel tool for managing your finances including keeping track of your expenses, incomes and assets. It offers creation of budgets, forecasts and a range of different reports for analysis.
- </para>
- <heading>Main features:</heading>
- <para>* free and flexible structure of the table of accounts</para>
- <para>* management and tracking of assets</para>
- <para>* independent posting types: actual, budget, forecast</para>
- <para>* flexible and detailled reports using various parameters</para>
- <para>* graphical report charts</para>
-</entry>
-
-<entry id="fima-prefs">
- <title>Fima: Preferences</title>
- <heading>Active Configuration</heading>
- <para>* Your active ledger: select your current ledger</para>
- <para>* Your active posting type: select the current <ref module="fima" entry="postings-postingtypes">posting type</ref></para>
- <para>* Closed by period: select the end of the period until which adding and editing postings will be locked; select "None" to keep all postings changeable</para>
- <heading>Interface Preferences</heading>
- <para>* Postings per page in the list view: enter the number of postings to display per page</para>
- <para>* When displaying the posting, which page do you want to start on: first or last page</para>
- <para>* Sort postings by: select the column which to sort postings by</para>
- <para>* Then: select an alternative column which to sort postings by</para>
- <para>* Sort direction: ascending or descending</para>
- <para>* Select the format for wildcards for text search: DOS wildcards (* and ?), SQL wildcards (% and _) or none</para>
- <para>* Select the format for amounts: select your preferred notation</para>
- <para>* Enter expenses with negative sign: choose whether to omit the negative sign when entering expenses</para>
- <para>* Do you want to confirm deleting postings: choose whether you'd like to confirm deleting postings</para>
- <para>* Select the canvas size for chart reports: the dimensions of the generated image in pixel</para>
-</entry>
-
-<entry id="accounts-overview">
- <title>Accounts: Overview</title>
- <para>
- The table of accounts is structured in three levels:
- </para>
- <heading>Account Types</heading>
- <para>
- Account types are the general aggregation of different accounts. Each account is assigned one single type. There are three different account types:
- </para>
- <para>* income (eg. salary, prizes, donations, etc.)</para>
- <para>* expense (eg. food, rental, clothes, etc.)</para>
- <para>* asset (eg. cash, credit card, bankbook, etc.)</para>
- <para>
- It is necessary to specify an asset account for each posting transaction. This way it is possible to track your assets and money transfers as well (postings from an asset account to another one).
- </para>
- <tip>
- Tip: If you are interested in your incomes and expenses only and don't want to manage any assets, create only one single asset account that will be automatically used for all postings.
- </tip>
- <heading>Account groups, Main Accounts, Subaccounts</heading>
- <para>
- An account is an aggregation of similar types of income, expense or asset positions. An account is defined by its four digit number, a name and an account type. The account number is devided into two parts: XXYY, where XX refers to the account group and YY to the subaccount (eg. in the account group 12: 1200 is the main account, 1230 and 1245 are both subaccounts). It is possible to create 100 account groups each having 100 accounts, whereas the usage of subaccounts is not necessary.
- </para>
- <para>
- Additionally it is possible to save a long description for each account and select whether postings for this account should be marked e.o. by default (see <ref module="fima" entry="postings-overview">Postings Overview</ref>). Also an account may be closed in order to prevent new postings but keep existing ones.
- </para>
- <tip>
- Tip: When using subaccounts avoid posting to the main account XX00, since it won't be possible to identify these postings in reports when aggregated to account groups. It is recommended to create a separate subaccount for general postings that don't fit into any subaccount (eg. XX99).
- </tip>
-</entry>
-
-<entry id="accounts-delete">
- <title>Accounts: Deleting an Account</title>
- <para>
- When deleting an account you need to specify how to handle postings:
- </para>
- <para>* Delete postings: delete all existing postings that were posted to the specific account</para>
- <para>* Shift postings: move all existing postings to another account of the same account type</para>
- <para>
- Also you need to specify how to handle potential subaccounts and their postings:
- </para>
- <para>* Keep subaccounts and postings: don't do anything</para>
- <para>* Delete subaccounts and postings: delete all existing subaccounts and postings too</para>
- <para>* Delete subaccounts and shift postings: delete all existing subaccounts and previously shift any existing postings to another account of the same account type</para>
-</entry>
-
-<entry id="postings-overview">
- <title>Postings: Overview</title>
- <para>
- A posting record has of the following attributes:
- </para>
- <para>* Posting types: see <ref module="fima" entry="postings-postingtypes">Posting Types</ref></para>
- <para>* Date: date of the posting (day, month, year)</para>
- <para>* Asset account: specifying the asset account for each posting is necessary to track your assets</para>
- <para>* Posting account: the account for the transaction, usually of the type income or expense; when shifting assets (eg. draw cash from an bank account) you need to choose the appropriate asset account as posting account</para>
- <para>* Description: it is possible to enter a short description for each posting (max. 255 characters)</para>
- <para>* Amount: positive amounts increase and negative amounts decrease the chosen asset account</para>
- <para>* e.o.: postings may be marked extraordinary (very large, not planned, ...)</para>
-</entry>
-
-<entry id="postings-postingtypes">
- <title>Postings: Posting Types</title>
- <para>
- Each posting is assigned one single type. There are three different posting types:
- </para>
- <heading>Actual</heading>
- <para>
- Actual postings constist of current incomes and expenses which can be analyzed using different reports. It reflects your actual financial situation.
- </para>
- <tip>
- Tip: Always check for asset differences before starting entering new postings. Book any differences to a specific account to guarantee at least correct asset accounts. Also check any bank account statements for missing postings.
- </tip>
- <tip>
- Tip: Try to enter your postings on a regular basis. Always ask for a sales receipt or write down the expense on a piece of paper, so you won't forget any expenses when not entereing postings immediately.
- </tip>
- <heading>Budget</heading>
- <para>
- Using a budget is optional and offers control of your future financial development as well as analyzing your former financial objectives. This way it is possible to identify your financial scope early.
- </para>
- <tip>
- Tip: Try to follow your main budget objectives. However, don' stick to them at all cost, since there will be incidents that won't be included in your budget.
- </tip>
- <tip>
- Tip: If you use a detailed table of accounts, create your budget based on main accounts instead of subaccounts since it would be very time-consuming otherwise.
- </tip>
- <tip>
- Tip: Enter any differences between your actual and budget to your budget. This way also your budget assets are up-to-date.
- </tip>
- <tip>
- Tip: It is possible to create your budget based on the postings of the last year by copying and optionally summarize them using the <ref module="fima" entry="postings-transfer">Transfer Postings</ref> functionality and adapting it afterwards.
- </tip>
- <heading>Forecast</heading>
- <para>
- After creating a budget it usually won't change. All further adaptions can be included in the forecast which therefore is an updated budget.
- </para>
- <tip>
- Tip: Check for any differences between your actual and budget/forecast result regularly and adapt your future forecast.
- </tip>
- <tip>
- Tip: Enter any differences between your actual and forcast to your budget. This way also your forecast assets are up-to-date.
- </tip>
- <tip>
- Tip: It is possible to create your forecast by copying your budget using the <ref module="fima" entry="postings-transfer">Transfer Postings</ref> functionality and afterwards adapting it afterwards.
- </tip>
-</entry>
-
-<entry id="postings-addedit">
- <title>Postings: Add/Edit Postings</title>
- <para>
- When adding new postings the date and asset account will be copied from the entry above for convenience, but may be changed later on.
- </para>
- <para>
- Expenses usually are negative amounts, but may be entered without negative sign for convenience (see <ref module="fima" entry="fima-prefs">Interface Preferences: Enter expenses with negative sign?</ref>). However, when shifting assets (transfer from one asset account to another one) the entered value always applies to the selected asset account (eg. -10 means a decrease of the selected asset account by 10 and subsequently an increase by 10 of the asset account selected as posting account).
- </para>
- <tip>
- Tip: When entering new postings, it is possible to select accounts by simply typing the account number on the keyboard instead of browsing through the drop down field. In a short time you will know the most used account numbers and it will save you a lot of time entering new postings.
- </tip>
- <tip>
- Tip: When entering new postings, it is possible to execute mathematical operations in the amount field. Simply type the mathematical expression (eg. 3+2*5) and the result will automatically be calculated.
- </tip>
- <tip>
- Tip: In order to prevent adding or editing postings with a date in the past unintentionally, enter a closing period (see <ref module="fima" entry="fima-prefs">Preferences: Active Configuration: Closed by period</ref>).
- </tip>
- <tip>
- Tip: When entering new postings for <ref module="fima" entry="postings-postingtypes">budget or forecast</ref>, it is possible to automatically create a set of similar postings for each month of a specific year. In the first row enter any date in the desired year, choose an asset and posting account and enter a description (optionally) and amount. Then press the button "Autofill" to copy the entered values down for alle months.
- </tip>
-</entry>
-
-<entry id="postings-shift">
- <title>Postings: Shift Postings</title>
- <para>
- Shift several selected postings in order to move them to another posting type or to change the asset or posting account all at once.
- </para>
-</entry>
-
-<entry id="postings-transfer">
- <title>Postings: Transfer Postings</title>
- <para>
- Transfer all postings of a specific posting type within a specific period to another posting type using the following options:
- </para>
- <para>* Transfer from: source posting type where to transfer posting from</para>
- <para>* Period from: source period of posting to transfer from</para>
- <para>* Keep original Postings: check to copy selected postings, leave unchecked to move postings</para>
- <para>* Don't summarize: leave postings unchanged</para>
- <para>* Summarize by combining: summarize postings by grouping according to the combination of asset and posting account</para>
- <para>* Summarize by posting against: summarize postings by grouping by asset and posting account seperately, each posting against a specific (dummy) account</para>
- <para>* Transfer to: destination posting type where to transfer posting to</para>
- <para>* Period to: destination period of posting to transfer to</para>
- <para>* Delete existing Postings: previously delete any existing postings of the destination posting type within the destination period</para>
- <tip>
- Tip: You may create a <ref module="fima" entry="postings-postingtypes">budget (or forecast)</ref> by transfering existing posting from actual (or budget). Don't forget to keep the original posting. It is recommended to summarize postings for a budget (or forecast) to have postings on main account level only. This way it is easier to make adaptions later.
- </tip>
- <tip>
- Tip: It is possible to transfer all postings of a year at once. Select "All" as source and destination month in order to keep the posting month unchanged.
- </tip>
-</entry>
-
-<entry id="postings-search">
- <title>Postings: Search Postings</title>
- <para>
- When searching postings it is possible to use the following filters:
- </para>
- <para>* Posting Type: posting type to filter</para>
- <para>* Date Start: start of filter period</para>
- <para>* Date End: end of filter period</para>
- <para>* Asset Accounts: postings with the selected account(s) as asset or posting account (when shifting assets) will be filtered</para>
- <para>* Posting Accounts: postings with the selected account(s) as posting account will be filtered</para>
- <para>* Description: you may use wildcards when search the description (see <ref module="fima" entry="fima-prefs">Interface Preferences: Select the format for wildcards for text search</ref>).</para>
- <para>* Amount Start: minimum amount</para>
- <para>* Amount End: maximum amount</para>
- <para>* e.o. Postings: filter all or none e.o. postings; leave empty to get all postings</para>
- <tip>
- Tip: It is possible to select several asset and posting accounts by holding the shift or control key.
- </tip>
- <tip>
- Tip: When filtering for amounts remember to enter expenses with a negative sign.
- </tip>
- <tip>
- Tip: A search query is saved for the current session until cleaned or a new search is executed. An indicator for an active search query is the trash bin icon located in the header bar.
- </tip>
-</entry>
-
-<entry id="reports-overview">
- <title>Reports: Overview</title>
- <para>
- When creating reports it is possible to use the following parameters:
- </para>
- <para>* Report: different <ref module="fima" entry="reports-details">reports</ref></para>
- <para>* Display: select posting type (some reports use the first value only, other use all values)</para>
- <para>* Period: start and end of report period</para>
- <para>* Reference: start and end of report reference period (when using reference as posting type for display)</para>
- <para>* Accounts: postings with the selected account(s) as posting account will be reported</para>
- <para>* Cumulate: summarize partial results within the selected period</para>
- <para>* Subaccounts: additionally show subaccounts instead of main accounts only</para>
- <para>* Null Rows: display rows containing no results</para>
- <para>* Yearly: group results by years instead of months</para>
- <para>* Chart: display a report graph instead of a table view</para>
- <para>
- All reports use only a set of parameters. See <ref module="fima" entry="reports-details">report details</ref> for a description of each report and used parameters.
- </para>
-</entry>
-
-<entry id="reports-details">
- <title>Reports: Details</title>
-
- <heading>General Overview</heading>
- <para>* Description: account types, totals and asset result by posting types</para>
- <para>* Parameters: Display (all), Period, (Reference), Accounts, Chart</para>
- <para>* Chart: bar chart</para>
-
- <heading>Period Overview</heading>
- <para>* Description: account types, totals and asset result by period</para>
- <para>* Paramaters: Display (first), Period, (Reference), Accounts, Cumulate, Null Rows, Yearly, Chart</para>
- <para>* Chart: line chart</para>
-
- <heading>Account Overview</heading>
- <para>* Description: posting types by period</para>
- <para>* Parameters: Display (all), Period, (Reference), Accounts, Cumulate, Null Rows, Yearly, Chart</para>
- <para>* Chart: line chart</para>
-
- <heading>Asset Overview</heading>
- <para>* Description: asset accounts by period</para>
- <para>* Parameters: Display (first), Period, (Reference), Cumulate, Subaccounts, Null Rows, Yearly, Chart</para>
- <para>* Chart: line chart, top 5</para>
-
- <heading>Analysis</heading>
- <para>* Description: posting types by accounts</para>
- <para>* Parameters: Display (all), Period, (Reference), Accounts, Subaccounts, Null Rows, Chart</para>
- <para>* Chart: pie chart, top 5 (rest grouped) by account type</para>
-
- <heading>Trend</heading>
- <para>* Description: period by accounts</para>
- <para>* Parameters: Display (first), Period, (Reference), Accounts, Subaccounts, Null Rows, Yearly, Chart</para>
- <para>* Chart: line chart, top 5 by account type</para>
-</entry>
-
-<entry id="exemplar-overview">
- <title>Exemplar: Overview</title>
- <para>
- This exemplar demonstrates how to use the main features of Fima. Follow the instructions step by step in the given order.
- </para>
-</entry>
-
-<entry id="exemplar-accounts">
- <title>Exemplar: 1) Accounts</title>
- <heading>Asset</heading>
- <para>* 0100 Cash</para>
- <para>* * 0110 Person A</para>
- <para>* * 0120 Person B</para>
- <para>* 0200 Giro</para>
- <para>* 0300 Bankbook</para>
- <para>* 0400 Life Assurance</para>
- <heading>Income</heading>
- <para>* 0000 Opening Balance</para>
- <para>* 1000 Salary</para>
- <para>* 1900 Other Income</para>
- <para>* * 1910 Subsidy</para>
- <para>* * 1999 Miscellaneous</para>
- <heading>Expense</heading>
- <para>* 2000 Food</para>
- <para>* 3000 Home</para>
- <para>* * 3010 Rental</para>
- <para>* * 3020 Electricity</para>
- <para>* * 3030 Furniture</para>
- <para>* 3500 Car</para>
- <para>* * 3510 Insurance</para>
- <para>* * 3520 Fuel</para>
- <para>* 4000 Person A</para>
- <para>* * 4010 Clothes</para>
- <para>* * 4020 Hobby</para>
- <para>* 5000 Person B</para>
- <para>* * 5010 Clothes</para>
- <para>* * 5020 Hobby</para>
- <para>* 9900 Other Expense</para>
- <tip>
- Tip: The table of accounts shown above is only a small example. In reality there are a lot of other things to consider (eg. sales, donations, lottery, interest, TV/Internet, electrical devices, refurbishment, repairings, housekeeping, sanitary products, drugs, pets, coiffeur, car parking, road tax, car mechanic, spare parts, education, telephony, parties, music/video, games, sports, books, smoking, vacation, presents, taxes, etc.)
- </tip>
-</entry>
-
-<entry id="exemplar-opening">
- <title>Exemplar: 2) Opening</title>
- <para>
- Before starting to enter regular postings we list our assets and post them against the account 0000 Opening Balance (eg. on the date 2008-01-01):
- </para>
- <para>Asset Account | Posting Account | Amount</para>
- <para>* 0110 Cash - Person A | 0000 Opening Balance | 133.50</para>
- <para>* 0120 Cash - Person B | 0000 Opening Balance | 420.30</para>
- <para>* 0200 Giro | 0000 Opening Balance | -3,412.50</para>
- <para>* 0300 Bankbook | 0000 Opening Balance | 6,850.20</para>
- <para>* 0400 Life Assurance | 0000 Opening Balance | 10,500.00</para>
- <para>In total our asset result is therefore 14,491.50.</para>
- <tip>
- Tip: Use a seperate account of type income for your opening balance. This way reports show correct amounts and assets can be tracked.
- </tip>
-</entry>
-
-<entry id="exemplar-postings">
- <title>Exemplar: 3) Postings</title>
- <para>
- After doing our <ref module="fima" entry="exemplar-opening">opening balance</ref> let's start entering some postings (past the date 2008-01-01):
- </para>
- <para>Asset Account | Posting Account | Amount</para>
- <para>* 0110 Cash - Person A | 2000 Food | -35.00</para>
- <para>* 0110 Cash - Person A | 4020 Person A - Hobby | -22.20</para>
- <para>* 0110 Cash - Person A | 3520 Car - Fuel | -40.00</para>
- <para>* 0120 Cash - Perosn B | 0200 Giro | 1,000.00</para>
- <para>* 0120 Cash - Person B | 2000 Food | -320.10</para>
- <para>* 0120 Cash - Person B | 5010 Person B - Clothes | -278.00</para>
- <para>* 0200 Giro | 1000 Salary | 2,600.00</para>
- <para>* 0200 Giro | 3010 Home - Rental | -520.00</para>
- <tip>
- Tip: The fourth posting is a transaction for shifting assets, person B withdraws 1,000.00 from the giro account. It would have also been possible to look on the transaction from the perspective of the giro account by switching asset and posting account and enter a negative amount.
- </tip>
- <tip>
- Tip: It is possible to enter expenses without negative sign for convenience (see <ref module="fima" entry="fima-prefs">Interface Preferences: Enter expenses with negative sign?</ref>). However, with the fourth transaction (shifting assets) the entered value always applies to the selected asset account.
- </tip>
- <tip>
- Tip: Control the final amounts of asset accounts by using the report <ref module="fima" entry="reports-details">Asset Overview</ref> (with cumulated values).
- </tip>
- <tip>
- Tip: Track and analyse your incomes and expenses using the reports <ref module="fima" entry="reports-details">Account Overview and Analysis</ref>. Use the reports <ref module="fima" entry="reports-details">Period Overview and Trend</ref> to analyse and check the development of costs.
- </tip>
-</entry>
-
-<entry id="exemplar-budget">
- <title>Exemplar: 4) Budget</title>
- <para>
- In order to plan and analyze incomes and expenses, we create a budget in 2008 (usually before entering any postings). There are two possibilities for creating a budget:
- </para>
- <para>
- A) Create your budget from scratch by entering postings manually for each month. For convenience it is recommended to use only main accounts. Use the function <ref module="fima" entry="postings-addedit">Autofill</ref> to copy the values from the first line to next eleven for the whole year. It is necessary to enter budget postings for each account seperately this way.
- </para>
- <para>
- B) Create your budget based on incomes and expenses from the last year (if any). Use the function <ref module="fima" entry="postings-transfer">Transfer Postings</ref> with the following parameters:
- </para>
- <para>* Transfer from: Actual</para>
- <para>* Period from: 2007 - All</para>
- <para>* Keep original Postings: yes</para>
- <para>* Summarize Accounts: Summarize by combining.</para>
- <para>* Transfer to: Budget</para>
- <para>* Period to: 2008 - All</para>
- <para>* Delete existing postings: yes</para>
- <tip>
- Tip: Compare budget and actual amounts using the reports <ref module="fima" entry="reports-details">General Overview, Account Overview or Analysis</ref>.
- </tip>
-</entry>
-
-<entry id="exemplar-forecast">
- <title>Exemplar: 5) Forecast</title>
- <para>
- Since a budget usually remains untouched after creation, we want a forecast to adapt. There are two possibilities for ceating a forecast:
- </para>
- <para>
- A) Create your forecast from scratch (see <ref module="fima" entry="exemplar-budget">Exemplar: Budget</ref>).
- </para>
- <para>
- B) Create your forecast by copying the budget using the function <ref module="fima" entry="postings-transfer">Transfer Postings</ref> with the following parameters:
- </para>
- <para>* Transfer from: Budget</para>
- <para>* Period from: 2008 - All</para>
- <para>* Keep original Postings: yes</para>
- <para>* Summarize Accounts: Don't summarize.</para>
- <para>* Transfer to: Forecast</para>
- <para>* Period to: 2008 - All</para>
- <para>* Delete existing postings: yes</para>
- <tip>
- Tip: Compare forecast and budget or actual amounts using the reports <ref module="fima" entry="reports-details">General Overview, Account Overview or Analysis</ref>.
- </tip>
-</entry>
-
-</help>
+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Horde Project
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2010-08-17 17:46+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: report.php:95 report.php:96 report.php:97 report.php:98 report.php:99
-#: report.php:100 report.php:101
-msgid "%"
-msgstr ""
-
-#: postings.php:267
-#, php-format
-msgid "%d postings not saved."
-msgstr ""
-
-#: templates/postings/shift.inc:5
-#, php-format
-msgid "%d selected Postings"
-msgstr ""
-
-#: postings.php:573
-#, php-format
-msgid "%s"
-msgstr ""
-
-#: lib/Report/Analysis.php:123 lib/Report/Trend.php:111
-#, php-format
-msgid "%s Result"
-msgstr ""
-
-#: report.php:93
-#, php-format
-msgid "%s [%s - %s - %s]"
-msgstr ""
-
-#: data.php:199
-#, php-format
-msgid "%s successfully imported"
-msgstr ""
-
-#: postings.php:603
-#, php-format
-msgid "%s to %s of %s Postings"
-msgstr ""
-
-#: lib/Fima.php:711 lib/Forms/DeleteLedger.php:79
-#, php-format
-msgid "%s's Ledger"
-msgstr ""
-
-#: config/prefs.php.dist:137
-msgid "-12 345 678,90"
-msgstr ""
-
-#: config/prefs.php.dist:138
-msgid "-12'345'678.90"
-msgstr ""
-
-#: config/prefs.php.dist:136
-msgid "-12,345,678.90"
-msgstr ""
-
-#: config/prefs.php.dist:135
-msgid "-12.345.678,90"
-msgstr ""
-
-#: config/prefs.php.dist:164
-msgid "1024 x 768 Pixel"
-msgstr ""
-
-#: config/prefs.php.dist:165
-msgid "1600 x 1200 Pixel"
-msgstr ""
-
-#: config/prefs.php.dist:162
-msgid "400 x 300 Pixel"
-msgstr ""
-
-#: config/prefs.php.dist:163
-msgid "800 x 600 Pixel"
-msgstr ""
-
-#: templates/postings/shift.inc:21 templates/postings/posting_headers.inc:21
-msgid "A_sset Account"
-msgstr ""
-
-#: account.php:201
-#, php-format
-msgid "Access denied deleting account from %s."
-msgstr ""
-
-#: account.php:168
-msgid "Access denied deleting account."
-msgstr ""
-
-#: accounts.php:27
-msgid "Access denied deleting all accounts and postings."
-msgstr ""
-
-#: postings.php:284
-#, php-format
-msgid "Access denied deleting postings from %s."
-msgstr ""
-
-#: account.php:69
-msgid "Access denied editing account."
-msgstr ""
-
-#: account.php:24
-#, php-format
-msgid "Access denied on account: %s"
-msgstr ""
-
-#: accounts.php:19
-#, php-format
-msgid "Access denied on accounts: %s"
-msgstr ""
-
-#: account.php:101
-#, php-format
-msgid "Access denied saving account to %s."
-msgstr ""
-
-#: postings.php:171
-#, php-format
-msgid "Access denied saving postings to %s."
-msgstr ""
-
-#: postings.php:313
-#, php-format
-msgid "Access denied shifting postings in %s."
-msgstr ""
-
-#: postings.php:346 postings.php:350
-#, php-format
-msgid "Access denied transfering postings in %s."
-msgstr ""
-
-#: data.php:36 lib/Report/Analysis.php:73 lib/Report/Trend.php:69
-msgid "Account"
-msgstr ""
-
-#: config/report.php.dist:9
-msgid "Account Overview"
-msgstr ""
-
-#: account.php:73 account.php:172
-msgid "Account not found."
-msgstr ""
-
-#: templates/reports/reports.inc:34 lib/Block/tree_menu.php:15
-msgid "Accounts"
-msgstr ""
-
-#: config/prefs.php.dist:8
-msgid "Active Configuration"
-msgstr ""
-
-#: lib/Fima.php:456 config/prefs.php.dist:44
-msgid "Actual"
-msgstr ""
-
-#: postings.php:134 lib/Block/tree_menu.php:13
-msgid "Add Postings"
-msgstr ""
-
-#: lib/Fima.php:742
-msgid "Add _Postings"
-msgstr ""
-
-#: templates/postings/navbar.inc:9 templates/postings/transfer.inc:14
-#: templates/postings/transfer.inc:53
-msgid "All"
-msgstr ""
-
-#: templates/postings/posting_headers.inc:36
-msgid "Amo_unt"
-msgstr ""
-
-#: data.php:38 config/prefs.php.dist:87 config/prefs.php.dist:101
-msgid "Amount"
-msgstr ""
-
-#: config/report.php.dist:11
-msgid "Analysis"
-msgstr ""
-
-#: templates/accounts/accounts.inc:12
-msgid ""
-"Are you sure you wish to PERMANENTLY delete all accounts and all postings?"
-msgstr ""
-
-#: templates/postings/javascript_list.inc:45
-msgid "Are you sure you wish to PERMANENTLY delete these postings?"
-msgstr ""
-
-#: config/prefs.php.dist:112
-msgid "Ascending"
-msgstr ""
-
-#: lib/Fima.php:432 lib/Report/AssetOverview.php:66
-msgid "Asset"
-msgstr ""
-
-#: data.php:35 config/prefs.php.dist:85 config/prefs.php.dist:99
-msgid "Asset Account"
-msgstr ""
-
-#: config/report.php.dist:10
-msgid "Asset Overview"
-msgstr ""
-
-#: lib/Report/PeriodOverview.php:76 lib/Report/AssetOverview.php:90
-#: lib/Report/GeneralOverview.php:61 lib/Report/GeneralOverview.php:96
-#: lib/Block/summary.php:75
-msgid "Asset Result"
-msgstr ""
-
-#: templates/postings/actions.inc:17
-msgid "Autofill"
-msgstr ""
-
-#: lib/Block/summary.php:33
-msgid "Block title"
-msgstr ""
-
-#: lib/Fima.php:458 config/prefs.php.dist:46
-msgid "Budget"
-msgstr ""
-
-#: data.php:21
-msgid "CSV"
-msgstr ""
-
-#: templates/reports/reports.inc:80
-msgid "C_umulate"
-msgstr ""
-
-#: lib/Forms/DeleteLedger.php:39 lib/Forms/DeleteLedger.php:45
-msgid "Cancel"
-msgstr ""
-
-#: templates/ledgers_list.php:33 ledgers/index.php:33
-msgid "Change Permissions"
-msgstr ""
-
-#: config/prefs.php.dist:18
-msgid "Change the display and input options."
-msgstr ""
-
-#: templates/postings/posting_headers.inc:60
-msgid "Check _All/None"
-msgstr ""
-
-#: config/prefs.php.dist:9
-msgid "Choose your active Ledger and Posting Type."
-msgstr ""
-
-#: templates/search/search.inc:107
-msgid "Clear Form"
-msgstr ""
-
-#: templates/search/search.inc:8 templates/postings/header.inc:10
-msgid "Clear Search Query"
-msgstr ""
-
-#: lib/Forms/account.php:42
-msgid "Closed"
-msgstr ""
-
-#: lib/Application.php:34
-msgid "Closed by period:"
-msgstr ""
-
-#: templates/data/import.inc:13 templates/data/export.inc:12
-msgid "Comma separated values"
-msgstr ""
-
-#: lib/Forms/CreateLedger.php:33
-msgid "Create"
-msgstr ""
-
-#: lib/Forms/CreateLedger.php:28
-msgid "Create Ledger"
-msgstr ""
-
-#: templates/accounts/accounts.inc:46
-msgid "Create a New Account"
-msgstr ""
-
-#: templates/ledgers_list.php:8
-msgid "Create a new Ledger"
-msgstr ""
-
-#: templates/postings/edit.inc:52
-msgid "Current Result"
-msgstr ""
-
-#: config/prefs.php.dist:123
-msgid "DOS (* and ?)"
-msgstr ""
-
-#: templates/postings/posting_headers.inc:16
-msgid "Da_te"
-msgstr ""
-
-#: data.php:34 config/prefs.php.dist:84 config/prefs.php.dist:98
-msgid "Date"
-msgstr ""
-
-#: templates/ledgers_list.php:35 templates/postings/actions.inc:9
-#: templates/accounts/accounts.inc:43 templates/accounts/accounts.inc:45
-#: ledgers/index.php:34 lib/Forms/account.php:79 lib/Forms/DeleteLedger.php:39
-msgid "Delete"
-msgstr ""
-
-#: templates/accounts/accounts.inc:45 lib/Forms/DeleteLedger.php:34
-#, php-format
-msgid "Delete %s"
-msgstr ""
-
-#: templates/accounts/accounts.inc:43
-msgid "Delete all"
-msgstr ""
-
-#: lib/UI/VarRenderer/fima.php:31
-msgid "Delete postings."
-msgstr ""
-
-#: lib/UI/VarRenderer/fima.php:57
-msgid "Delete subaccounts and postings."
-msgstr ""
-
-#: lib/UI/VarRenderer/fima.php:63
-msgid "Delete subaccounts and shift postings to"
-msgstr ""
-
-#: account.php:87 lib/Forms/account.php:46
-msgid "Delete this account"
-msgstr ""
-
-#: account.php:178 account.php:194
-#, php-format
-msgid "Delete: %s"
-msgstr ""
-
-#: postings.php:386
-#, php-format
-msgid "Deleted %d existing postings."
-msgstr ""
-
-#: postings.php:484
-#, php-format
-msgid "Deleted %d original postings."
-msgstr ""
-
-#: postings.php:300
-#, php-format
-msgid "Deleted %d postings."
-msgstr ""
-
-#: account.php:214
-#, php-format
-msgid "Deleted %s."
-msgstr ""
-
-#: accounts.php:37
-msgid "Deleted all accounts and postings."
-msgstr ""
-
-#: config/prefs.php.dist:113
-msgid "Descending"
-msgstr ""
-
-#: templates/postings/posting_headers.inc:31
-msgid "Descriptio_n"
-msgstr ""
-
-#: data.php:37 lib/Forms/account.php:41 lib/Forms/CreateLedger.php:31
-#: lib/Forms/EditLedger.php:38 config/prefs.php.dist:88
-#: config/prefs.php.dist:102
-msgid "Description"
-msgstr ""
-
-#: lib/Report/Analysis.php:87 lib/Report/AccountOverview.php:85
-#: lib/Report/GeneralOverview.php:85
-msgid "Diff. (%)"
-msgstr ""
-
-#: report.php:95 report.php:96 report.php:97 report.php:98 report.php:99
-#: report.php:100 report.php:101 lib/Report/Analysis.php:84
-#: lib/Report/Analysis.php:360 lib/Report/AccountOverview.php:82
-#: lib/Report/GeneralOverview.php:82
-msgid "Difference"
-msgstr ""
-
-#: config/prefs.php.dist:154
-msgid "Do you want to confirm deleting postings?"
-msgstr ""
-
-#: templates/postings/transfer.inc:32
-msgid "Don't summarize."
-msgstr ""
-
-#: templates/ledgers_list.php:31 templates/postings/actions.inc:10
-#: templates/accounts/accounts.inc:44 ledgers/index.php:32
-msgid "Edit"
-msgstr ""
-
-#: templates/accounts/accounts.inc:44 lib/Forms/EditLedger.php:34
-#, php-format
-msgid "Edit %s"
-msgstr ""
-
-#: postings.php:144 postings.php:176
-msgid "Edit Postings"
-msgstr ""
-
-#: templates/postings/header.inc:9
-msgid "Edit Search Query"
-msgstr ""
-
-#: account.php:187 lib/Forms/account.php:81
-msgid "Edit this account"
-msgstr ""
-
-#: account.php:78 account.php:94
-#, php-format
-msgid "Edit: %s"
-msgstr ""
-
-#: config/prefs.php.dist:147
-msgid "Enter expenses with negative sign?"
-msgstr ""
-
-#: lib/Block/summary.php:104 lib/Block/summary.php:120
-msgid "Error when retrieving results."
-msgstr ""
-
-#: lib/Fima.php:434
-msgid "Expense"
-msgstr ""
-
-#: templates/data/export.inc:16
-msgid "Export"
-msgstr ""
-
-#: templates/data/export.inc:6
-msgid "Export Postings"
-msgstr ""
-
-#: data.php:61 data.php:118 data.php:148
-#, php-format
-msgid "Failed to access the ledger: %s"
-msgstr ""
-
-#: lib/Block/summary.php:3
-msgid "Finances Results"
-msgstr ""
-
-#: postings.php:625 config/prefs.php.dist:73
-msgid "First Page"
-msgstr ""
-
-#: lib/Fima.php:457 config/prefs.php.dist:45
-msgid "Forecast"
-msgstr ""
-
-#: templates/postings/javascript_edit.inc:13
-msgid "Friday"
-msgstr ""
-
-#: config/prefs.php.dist:7 config/prefs.php.dist:16
-msgid "General Options"
-msgstr ""
-
-#: config/report.php.dist:7
-msgid "General Overview"
-msgstr ""
-
-#: templates/data/import.inc:7
-#, php-format
-msgid "Import Postings, Step %d"
-msgstr ""
-
-#: data.php:205
-msgid "Import/Export Postings"
-msgstr ""
-
-#: lib/Fima.php:433
-msgid "Income"
-msgstr ""
-
-#: config/prefs.php.dist:17
-msgid "Interface Options"
-msgstr ""
-
-#: templates/postings/navbar.inc:11
-msgid "Invert"
-msgstr ""
-
-#: lib/UI/VarRenderer/fima.php:51
-msgid "Keep subaccounts and postings."
-msgstr ""
-
-#: postings.php:636 config/prefs.php.dist:74
-msgid "Last Page"
-msgstr ""
-
-#: templates/ledgers_list.php:16 ledgers/index.php:31
-msgid "Ledger"
-msgstr ""
-
-#: templates/ledgers_list.php:12
-msgid "Ledger List"
-msgstr ""
-
-#: templates/ledgers_list.php:2 ledgers/index.php:37
-msgid "Manage Ledgers"
-msgstr ""
-
-#: lib/Block/tree_menu.php:3
-msgid "Menu List"
-msgstr ""
-
-#: templates/postings/javascript_edit.inc:9
-msgid "Monday"
-msgstr ""
-
-#: accounts.php:88
-msgid "My Accounts"
-msgstr ""
-
-#: postings.php:36
-msgid "My Postings"
-msgstr ""
-
-#: lib/Forms/account.php:39 lib/Forms/CreateLedger.php:30
-#: lib/Forms/EditLedger.php:37
-msgid "Name"
-msgstr ""
-
-#: account.php:63 account.php:94
-msgid "New Account"
-msgstr ""
-
-#: templates/data/import.inc:31
-msgid "Next"
-msgstr ""
-
-#: postings.php:634
-msgid "Next Page"
-msgstr ""
-
-#: postings.php:601
-msgid "No Postings"
-msgstr ""
-
-#: templates/reports/empty.inc:2
-msgid "No data for this report."
-msgstr ""
-
-#: lib/Report/Analysis.php:49 lib/Report/PeriodOverview.php:42
-#: lib/Report/Trend.php:48 lib/Report/AccountOverview.php:42
-#: lib/Report/AssetOverview.php:46 lib/Report/GeneralOverview.php:43
-msgid "No display type"
-msgstr ""
-
-#: lib/Report.php:167 lib/ReportGraph.php:172
-msgid "No report driver loaded"
-msgstr ""
-
-#: lib/Block/summary.php:152
-msgid "No results to display"
-msgstr ""
-
-#: templates/postings/navbar.inc:10 lib/Application.php:36
-msgid "None"
-msgstr ""
-
-#: templates/postings/navbar.inc:15
-#, php-format
-msgid "Not %s"
-msgstr ""
-
-#: lib/Driver/sql.php:129 lib/Driver/sql.php:164 lib/Driver/sql.php:317
-msgid "Not found"
-msgstr ""
-
-#: lib/Forms/account.php:37
-msgid "Number"
-msgstr ""
-
-#: lib/Block/summary.php:42
-msgid "Number of months to display"
-msgstr ""
-
-#: templates/menu.inc:19
-msgid "Open Ledger"
-msgstr ""
-
-#: templates/reports/reports.inc:104
-msgid "Open Report"
-msgstr ""
-
-#: templates/reports/reports.inc:75
-msgid "Other"
-msgstr ""
-
-#: templates/reports/reports.inc:55
-msgid "P_eriod"
-msgstr ""
-
-#: templates/postings/header.inc:18
-#, php-format
-msgid "Page %d of %d"
-msgstr ""
-
-#: lib/Report/PeriodOverview.php:65 lib/Report/AccountOverview.php:71
-msgid "Period"
-msgstr ""
-
-#: config/report.php.dist:8
-msgid "Period Overview"
-msgstr ""
-
-#: templates/postings/transfer.inc:11
-msgid "Period from"
-msgstr ""
-
-#: templates/postings/transfer.inc:50
-msgid "Period to"
-msgstr ""
-
-#: lib/Forms/DeleteLedger.php:50
-msgid "Permission denied"
-msgstr ""
-
-#: templates/postings/javascript_transfer.inc:6
-msgid "Please select another posting type where to transfer postings to."
-msgstr ""
-
-#: templates/postings/shift.inc:29 templates/postings/posting_headers.inc:26
-msgid "Posting A_ccount"
-msgstr ""
-
-#: config/prefs.php.dist:86 config/prefs.php.dist:100
-msgid "Posting Account"
-msgstr ""
-
-#: templates/postings/shift.inc:13
-msgid "Posting T_ype"
-msgstr ""
-
-#: lib/Forms/account.php:76
-msgid "Postings"
-msgstr ""
-
-#: config/prefs.php.dist:65
-msgid "Postings per page in the list view."
-msgstr ""
-
-#: data.php:159
-msgid "Postings successfully purged."
-msgstr ""
-
-#: postings.php:627
-msgid "Previous Page"
-msgstr ""
-
-#: templates/reports/reports.inc:65
-msgid "Re_ference"
-msgstr ""
-
-#: lib/Forms/DeleteLedger.php:37
-#, php-format
-msgid ""
-"Really delete the ledger \"%s\"? This cannot be undone and all data on this "
-"ledger will be permanently removed."
-msgstr ""
-
-#: report.php:94 report.php:97 report.php:99 report.php:100 report.php:101
-#: lib/Report/Analysis.php:81 lib/Report/AccountOverview.php:79
-#: lib/Report/GeneralOverview.php:79
-msgid "Reference"
-msgstr ""
-
-#: templates/postings/header.inc:5
-msgid "Refresh List"
-msgstr ""
-
-#: templates/data/import.inc:18
-msgid ""
-"Replace existing postings with the imported one? <strong>Warning: This "
-"deletes all existing postings.</strong>"
-msgstr ""
-
-#: templates/reports/reports.inc:12
-msgid "Repor_t"
-msgstr ""
-
-#: templates/reports/graph.inc:2 lib/ReportGraph.php:84
-msgid "Report"
-msgstr ""
-
-#: report.php:150
-#, php-format
-msgid "Report %s"
-msgstr ""
-
-#: report.php:109 lib/Block/tree_menu.php:16
-msgid "Reports"
-msgstr ""
-
-#: templates/reports/reports.inc:105
-msgid "Reset"
-msgstr ""
-
-#: lib/Report/Analysis.php:359
-msgid "Rest"
-msgstr ""
-
-#: templates/postings/edit.inc:47 lib/Report/PeriodOverview.php:74
-#: lib/Report/GeneralOverview.php:59
-msgid "Result"
-msgstr ""
-
-#: config/prefs.php.dist:124
-msgid "SQL (% and _)"
-msgstr ""
-
-#: templates/postings/actions.inc:11
-msgid "S_hift"
-msgstr ""
-
-#: templates/postings/javascript_edit.inc:14
-msgid "Saturday"
-msgstr ""
-
-#: templates/postings/actions.inc:15 lib/Forms/account.php:44
-#: lib/Forms/EditLedger.php:40
-msgid "Save"
-msgstr ""
-
-#: account.php:156 lib/Forms/account.php:44
-msgid "Save and New"
-msgstr ""
-
-#: postings.php:264
-#, php-format
-msgid "Saved %d postings."
-msgstr ""
-
-#: account.php:154
-#, php-format
-msgid "Saved %s."
-msgstr ""
-
-#: templates/search/search.inc:106 templates/postings/header.inc:7
-#: templates/accounts/accounts.inc:47 lib/Fima.php:743
-#: lib/Block/tree_menu.php:14
-msgid "Search"
-msgstr ""
-
-#: templates/search/search.inc:43
-msgid "Search A_sset Accounts"
-msgstr ""
-
-#: templates/search/search.inc:77
-msgid "Search Amo_unt Start"
-msgstr ""
-
-#: templates/search/search.inc:85
-msgid "Search Amoun_t End"
-msgstr ""
-
-#: templates/search/search.inc:35
-msgid "Search Dat_e End"
-msgstr ""
-
-#: templates/search/search.inc:69
-msgid "Search Descriptio_n"
-msgstr ""
-
-#: templates/search/search.inc:51
-msgid "Search Posting A_ccounts"
-msgstr ""
-
-#: templates/search/search.inc:15
-msgid "Search Posting T_ype"
-msgstr ""
-
-#: search.php:73 templates/postings/header.inc:7
-msgid "Search Postings"
-msgstr ""
-
-#: postings.php:505
-msgid "Search Results"
-msgstr ""
-
-#: templates/search/search.inc:27
-msgid "Search _Date Start"
-msgstr ""
-
-#: templates/search/search.inc:93
-msgid "Search e.o. Postin_gs"
-msgstr ""
-
-#: templates/postings/navbar.inc:8
-msgid "Select"
-msgstr ""
-
-#: lib/Forms/account.php:141
-msgid "Select another account where to shift postings to."
-msgstr ""
-
-#: lib/Forms/account.php:176
-msgid "Select another account where to shift subaccount postings to."
-msgstr ""
-
-#: config/prefs.php.dist:167
-msgid "Select the canvas size for chart reports:"
-msgstr ""
-
-#: templates/data/import.inc:21
-msgid "Select the charset of the source file:"
-msgstr ""
-
-#: templates/data/export.inc:10
-msgid "Select the export format:"
-msgstr ""
-
-#: templates/data/import.inc:29
-msgid "Select the file to import:"
-msgstr ""
-
-#: config/prefs.php.dist:140
-msgid "Select the format for amounts:"
-msgstr ""
-
-#: config/prefs.php.dist:127
-msgid "Select the format for wildcards for text search:"
-msgstr ""
-
-#: templates/data/import.inc:11
-msgid "Select the format of the source file:"
-msgstr ""
-
-#: templates/postings/actions.inc:11
-msgid "Shift"
-msgstr ""
-
-#: postings.php:154
-msgid "Shift Postings"
-msgstr ""
-
-#: lib/UI/VarRenderer/fima.php:37
-msgid "Shift postings to"
-msgstr ""
-
-#: postings.php:335
-#, php-format
-msgid "Shifted %d postings."
-msgstr ""
-
-#: templates/postings/shift.inc:3
-msgid "Shifting"
-msgstr ""
-
-#: lib/Block/summary.php:37
-msgid "Show summary of this ledger"
-msgstr ""
-
-#: templates/reports/table.inc:23
-#, php-format
-msgid "Sort by %s"
-msgstr ""
-
-#: templates/postings/posting_headers.inc:35
-msgid "Sort by Amount"
-msgstr ""
-
-#: templates/postings/posting_headers.inc:20
-msgid "Sort by Asset Account"
-msgstr ""
-
-#: templates/postings/posting_headers.inc:15
-msgid "Sort by Date"
-msgstr ""
-
-#: templates/postings/posting_headers.inc:30
-msgid "Sort by Description"
-msgstr ""
-
-#: templates/postings/posting_headers.inc:25
-msgid "Sort by Posting Account"
-msgstr ""
-
-#: config/prefs.php.dist:115
-msgid "Sort direction:"
-msgstr ""
-
-#: config/prefs.php.dist:90
-msgid "Sort postings by:"
-msgstr ""
-
-#: lib/Forms/account.php:77
-msgid "Subaccounts"
-msgstr ""
-
-#: templates/postings/transfer.inc:34
-msgid "Summarize by combining."
-msgstr ""
-
-#: templates/postings/transfer.inc:36
-msgid "Summarize by posting against"
-msgstr ""
-
-#: postings.php:419 postings.php:433 postings.php:444
-msgid "Summarized"
-msgstr ""
-
-#: postings.php:468
-#, php-format
-msgid "Summarized %d postings."
-msgstr ""
-
-#: templates/postings/javascript_edit.inc:8
-msgid "Sunday"
-msgstr ""
-
-#: data.php:22
-msgid "TSV"
-msgstr ""
-
-#: templates/data/import.inc:14 templates/data/export.inc:13
-msgid "Tab separated values"
-msgstr ""
-
-#: data.php:196
-#, php-format
-msgid "The %s file didn't contain any postings."
-msgstr ""
-
-#: lib/Driver.php:70
-msgid "The Finances backend is not currently available."
-msgstr ""
-
-#: lib/Driver.php:354
-#, php-format
-msgid "The Finances backend is not currently available: %s"
-msgstr ""
-
-#: lib/ReportGraph.php:60
-msgid "The Finances report graphs are not currently available."
-msgstr ""
-
-#: lib/ReportGraph.php:182
-#, php-format
-msgid "The Finances report graphs are not currently available: %s"
-msgstr ""
-
-#: lib/Report.php:46
-msgid "The Finances reports are not currently available."
-msgstr ""
-
-#: lib/Report.php:177
-#, php-format
-msgid "The Finances reports are not currently available: %s"
-msgstr ""
-
-#: account.php:115
-#, php-format
-msgid "The account including all postings was shifted from number %s to %s."
-msgstr ""
-
-#: account.php:112
-#, php-format
-msgid "The account number %s is already used by the account %s."
-msgstr ""
-
-#: account.php:125
-#, php-format
-msgid "The account type was set to %s."
-msgstr ""
-
-#: report.php:145
-msgid "The graphs library could not be loaded."
-msgstr ""
-
-#: ledgers/create.php:28
-#, php-format
-msgid "The ledger \"%s\" has been created."
-msgstr ""
-
-#: ledgers/delete.php:43
-#, php-format
-msgid "The ledger \"%s\" has been deleted."
-msgstr ""
-
-#: ledgers/edit.php:38
-#, php-format
-msgid "The ledger \"%s\" has been renamed to \"%s\"."
-msgstr ""
-
-#: ledgers/edit.php:40
-#, php-format
-msgid "The ledger \"%s\" has been saved."
-msgstr ""
-
-#: data.php:157
-#, php-format
-msgid "The postings could not be purged: %s"
-msgstr ""
-
-#: config/prefs.php.dist:104
-msgid "Then:"
-msgstr ""
-
-#: templates/postings/empty.inc:3
-msgid "There are no appropriate postings."
-msgstr ""
-
-#: lib/Report.php:125
-#, php-format
-msgid "There was a problem creating the report graph: %s."
-msgstr ""
-
-#: report.php:127
-#, php-format
-msgid "There was a problem creating the report: %s."
-msgstr ""
-
-#: accounts.php:34
-#, php-format
-msgid "There was a problem deleting all accounts and postings: %s"
-msgstr ""
-
-#: postings.php:379
-#, php-format
-msgid "There was a problem deleting an existing posting: %s"
-msgstr ""
-
-#: postings.php:477
-#, php-format
-msgid "There was a problem deleting an original posting: %s"
-msgstr ""
-
-#: postings.php:293
-#, php-format
-msgid "There was a problem deleting posting #%d: %s"
-msgstr ""
-
-#: account.php:212
-#, php-format
-msgid "There was a problem deleting the account: %s."
-msgstr ""
-
-#: lib/Report.php:132
-#, php-format
-msgid "There was a problem executing the report graph: %s."
-msgstr ""
-
-#: report.php:137
-#, php-format
-msgid "There was a problem executing the report: %s."
-msgstr ""
-
-#: account.php:152
-#, php-format
-msgid "There was a problem saving the account: %s."
-msgstr ""
-
-#: postings.php:241 postings.php:462
-#, php-format
-msgid "There was a problem saving the posting: %s."
-msgstr ""
-
-#: postings.php:328
-#, php-format
-msgid "There was a problem shifting posting #%d: %s"
-msgstr ""
-
-#: data.php:99
-msgid "There were no postings to export."
-msgstr ""
-
-#: data.php:137
-msgid "This file format is not supported."
-msgstr ""
-
-#: ledgers/delete.php:21
-msgid "This ledger cannot be deleted."
-msgstr ""
-
-#: templates/postings/javascript_edit.inc:12
-msgid "Thursday"
-msgstr ""
-
-#: templates/postings/list.inc:13 lib/Report/Analysis.php:199
-#: lib/Report/PeriodOverview.php:88 lib/Report/Trend.php:77
-#: lib/Report/Trend.php:154 lib/Report/AccountOverview.php:99
-#: lib/Report/AssetOverview.php:74 lib/Block/summary.php:74
-msgid "Total Result"
-msgstr ""
-
-#: templates/postings/actions.inc:12
-msgid "Trans_fer"
-msgstr ""
-
-#: templates/postings/actions.inc:12
-msgid "Transfer"
-msgstr ""
-
-#: postings.php:162
-msgid "Transfer Postings"
-msgstr ""
-
-#: templates/postings/transfer.inc:3
-msgid "Transfer from"
-msgstr ""
-
-#: templates/postings/transfer.inc:42
-msgid "Transfer to"
-msgstr ""
-
-#: postings.php:468
-#, php-format
-msgid "Transfered %d postings."
-msgstr ""
-
-#: config/report.php.dist:12
-msgid "Trend"
-msgstr ""
-
-#: templates/postings/javascript_edit.inc:10
-msgid "Tuesday"
-msgstr ""
-
-#: lib/Report/GeneralOverview.php:71 lib/Forms/account.php:38
-msgid "Type"
-msgstr ""
-
-#: lib/Forms/DeleteLedger.php:57
-#, php-format
-msgid "Unable to delete \"%s\": %s"
-msgstr ""
-
-#: lib/Report.php:180 lib/Driver.php:357 lib/ReportGraph.php:185
-#, php-format
-msgid "Unable to load the definition of %s."
-msgstr ""
-
-#: lib/Forms/EditLedger.php:49
-#, php-format
-msgid "Unable to save ledger \"%s\": %s"
-msgstr ""
-
-#: postings.php:567 postings.php:576
-msgid "Unknown"
-msgstr ""
-
-#: templates/accounts/accounts.inc:47
-#, php-format
-msgid "View %s"
-msgstr ""
-
-#: templates/postings/javascript_edit.inc:11
-msgid "Wednesday"
-msgstr ""
-
-#: config/prefs.php.dist:76
-msgid "When displaying the postings, which page do you want to start on?"
-msgstr ""
-
-#: ledgers/edit.php:25
-msgid "You are not allowed to change this ledger."
-msgstr ""
-
-#: ledgers/delete.php:31
-msgid "You are not allowed to delete this ledger."
-msgstr ""
-
-#: templates/postings/javascript_list.inc:39
-msgid "You must select at least one posting first."
-msgstr ""
-
-#: config/prefs.php.dist:48
-msgid "Your active posting type:"
-msgstr ""
-
-#: lib/Fima.php:744
-msgid "_Accounts"
-msgstr ""
-
-#: templates/reports/reports.inc:97
-msgid "_Chart"
-msgstr ""
-
-#: templates/postings/actions.inc:9
-msgid "_Delete"
-msgstr ""
-
-#: templates/postings/transfer.inc:58
-msgid "_Delete existing Postings"
-msgstr ""
-
-#: templates/reports/reports.inc:24
-msgid "_Display"
-msgstr ""
-
-#: templates/postings/actions.inc:10
-msgid "_Edit"
-msgstr ""
-
-#: lib/Fima.php:754
-msgid "_Import/Export"
-msgstr ""
-
-#: templates/postings/transfer.inc:19
-msgid "_Keep original Postings"
-msgstr ""
-
-#: lib/Fima.php:741
-msgid "_List Postings"
-msgstr ""
-
-#: lib/Fima.php:747
-msgid "_My Ledgers"
-msgstr ""
-
-#: templates/reports/reports.inc:88
-msgid "_Null Rows"
-msgstr ""
-
-#: lib/Fima.php:758
-msgid "_Print"
-msgstr ""
-
-#: lib/Fima.php:751
-msgid "_Reports"
-msgstr ""
-
-#: templates/reports/reports.inc:84
-msgid "_Subaccounts"
-msgstr ""
-
-#: templates/postings/transfer.inc:28
-msgid "_Summarize Accounts"
-msgstr ""
-
-#: templates/reports/reports.inc:92
-msgid "_Yearly"
-msgstr ""
-
-#: templates/postings/shift.inc:16 templates/postings/shift.inc:24
-#: templates/postings/shift.inc:32
-msgid "don't change"
-msgstr ""
-
-#: data.php:39 templates/postings/posting_headers.inc:43
-#: lib/Forms/account.php:40
-msgid "e.o."
-msgstr ""
-
-#: postings.php:573
-#, php-format
-msgid "e.o. %s"
-msgstr ""
-
-#: search.php:62
-msgid "e.o. postings only"
-msgstr ""
-
-#: search.php:63
-msgid "no e.o. postings"
-msgstr ""
-
-#: config/prefs.php.dist:125
-msgid "none"
-msgstr ""
-
-#: data.php:106 templates/data/export.inc:1
-msgid "postings.csv"
-msgstr ""
-
-#: data.php:110
-msgid "postings.tsv"
-msgstr ""
+++ /dev/null
-<?php
-/**
- * Copyright 2008 Thomas Trethan <thomas@trethan.net>
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Thomas Trethan <thomas@trethan.net>
- */
-
-@define('FIMA_BASE', dirname(__FILE__));
-require_once FIMA_BASE . '/lib/base.php';
-
-$vars = Horde_Variables::getDefaultVariables();
-
-/* Get the current action ID. */
-$actionID = Horde_Util::getFormData('actionID');
-
-/* Change posting type. */
-if (($postingtype = Horde_Util::getFormData('postingtype')) !== null) {
- $postingtypeold = $prefs->getValue('active_postingtype');
- $prefs->setValue('active_postingtype', $postingtype);
-}
-
-/* Get closed period. */
-$closedperiod = (int)$prefs->getValue('closed_period');
-
-/* Create page array. */
-$pageOb = array();
-$pageOb['url'] = Horde::url('postings.php');
-if (($pageOb['page'] = Horde_Util::getFormData('page')) === null) {
- $pageOb['page'] = $prefs->getValue('startpage');
-}
-$pageOb['mode'] = 'list';
-
-$title = _("My Postings");
-$ledger = Fima::getActiveLedger();
-$filters = array();
-
-switch ($actionID) {
-case 'change_sort':
- /* Sort out the sorting values. */
- if (($sortby = Horde_Util::getFormData('sortby')) !== null) {
- $prefs->setValue('sortby', $sortby);
- }
- if (($sortdir = Horde_Util::getFormData('sortdir')) !== null) {
- $prefs->setValue('sortdir', $sortdir);
- }
- break;
-
-case 'search_postings':
- /* If we're searching, only list those postings that match the search result. */
- $_SESSION['fima_search'] = array('type' => Horde_Util::getFormData('search_type'),
- 'date_start' => Horde_Util::getFormData('search_date_start'),
- 'date_end' => Horde_Util::getFormData('search_date_end'),
- 'asset' => Horde_Util::getFormData('search_asset'),
- 'account' => Horde_Util::getFormData('search_account'),
- 'desc' => Horde_Util::getFormData('search_desc'),
- 'amount_start' => Horde_Util::getFormData('search_amount_start'),
- 'amount_end' => Horde_Util::getFormData('search_amount_end'),
- 'eo' => Horde_Util::getFormData('search_eo'));
-
- /* Build filters. */
- if ($_SESSION['fima_search']['type'] !== null) {
- $prefs->setValue('active_postingtype', $_SESSION['fima_search']['type']);
- }
- if ($_SESSION['fima_search']['date_start'] !== null) {
- if (is_array($_SESSION['fima_search']['date_start'])) {
- $_SESSION['fima_search']['date_start'] = mktime(0, 0, 0, $_SESSION['fima_search']['date_start']['month'],
- $_SESSION['fima_search']['date_start']['day'],
- $_SESSION['fima_search']['date_start']['year']);
- } else {
- $_SESSION['fima_search']['date_start'] = (int)$_SESSION['fima_search']['date_start'];
- }
- }
- if ($_SESSION['fima_search']['date_end'] !== null) {
- if (is_array($_SESSION['fima_search']['date_end'])) {
- $_SESSION['fima_search']['date_end'] = mktime(0, 0, 0, $_SESSION['fima_search']['date_end']['month'],
- $_SESSION['fima_search']['date_end']['day'],
- $_SESSION['fima_search']['date_end']['year']);
- } else {
- $_SESSION['fima_search']['date_end'] = (int)$_SESSION['fima_search']['date_end'];
- }
- }
- if ($_SESSION['fima_search']['asset'] !== null) {
- if (count($_SESSION['fima_search']['asset']) == 0) {
- unset($_SESSION['fima_search']['asset']);
- }
- }
- if ($_SESSION['fima_search']['account'] !== null) {
- if (count($_SESSION['fima_search']['account']) == 0) {
- unset($_SESSION['fima_search']['account']);
- }
- }
- if ($_SESSION['fima_search']['desc'] !== null) {
- if ($_SESSION['fima_search']['desc'] === '') {
- unset($_SESSION['fima_search']['desc']);
- }
- }
- if ($_SESSION['fima_search']['amount_start'] !== null) {
- if ($_SESSION['fima_search']['amount_start'] === '') {
- unset($_SESSION['fima_search']['amount_start']);
- }
- }
- if ($_SESSION['fima_search']['amount_end'] !== null) {
- if ($_SESSION['fima_search']['amount_end'] === '') {
- unset($_SESSION['fima_search']['amount_end']);
- }
- }
- if (isset($_SESSION['fima_search']['amount_start']) && isset($_SESSION['fima_search']['amount_end'])) {
- if ((double)$_SESSION['fima_search']['amount_start'] > (double)$_SESSION['fima_search']['amount_end']) {
- $tmp = $_SESSION['fima_search']['amount_start'];
- $_SESSION['fima_search']['amount_start'] = $_SESSION['fima_search']['amount_end'];
- $_SESSION['fima_search']['amount_end'] = $tmp;
- }
- }
- if ($_SESSION['fima_search']['eo'] !== null) {
- if ($_SESSION['fima_search']['eo'] == -1) {
- unset($_SESSION['fima_search']['eo']);
- }
- }
-
- break;
-
-case 'clear_search':
- unset($_SESSION['fima_search']);
- break;
-
-case 'add_postings':
- $pageOb['mode'] = 'edit';
- $pageOb['url'] = Horde_Util::addParameter($pageOb['url'], 'actionID', 'add_postings');
- $actionID = 'save_postings';
- $postings = array();
- $title = _("Add Postings");
- break;
-
-case 'edit_postings':
- $postingset = Horde_Util::getFormData('indices');
- if ($postingset !== null) {
- $pageOb['mode'] = 'edit';
- $pageOb['url'] = Horde_Util::addParameter($pageOb['url'], 'actionID', 'add_postings');
- $actionID = 'save_postings';
- $filters[] = array('id', $postingset);
- $title = _("Edit Postings");
- }
- break;
-
-case 'shift_postings':
- $postingset = Horde_Util::getFormData('indices');
- if ($postingset !== null) {
- $pageOb['mode'] = 'shift';
- $actionID = 'update_postings';
- $filters[] = array('id', $postingset);
- $title = _("Shift Postings");
- }
- break;
-
-case 'transfer_postings':
- $pageOb['mode'] = 'transfer';
- $actionID = 'copymove_postings';
- $postings = array();
- $title = _("Transfer Postings");
- break;
-
-case 'save_postings':
- /* Get the form values. */
- $postingset = Horde_Util::getFormData('posting_id');
-
- $share = &$GLOBALS['fima_shares']->getShare($ledger);
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
- $notification->push(sprintf(_("Access denied saving postings to %s."), $share->get('name')), 'horde.error');
- Horde::url('postings.php', true)->redirect();
- }
- if ($postingset !== null) {
- $pageOb['mode'] = 'edit';
- $title = _("Edit Postings");
- $posting_owner = $ledger;
- $posting_type = $prefs->getValue('active_postingtype');
-
- $posting_dates = Horde_Util::getFormData('date');
- $posting_assets = Horde_Util::getFormData('asset');
- $posting_accounts = Horde_Util::getFormData('account');
- $posting_eos = Horde_Util::getFormData('eo');
- $posting_amounts = Horde_Util::getFormData('amount');
- $posting_descs = Horde_Util::getFormData('desc');
-
- $postings = array();
- $savecount = 0;
-
- $storage = &Fima_Driver::singleton($ledger);
- foreach($postingset as $index => $posting_id) {
- $posting_valid = true;
-
- if ($posting_dates[$index] !== '' || $posting_assets[$index] !== '' || $posting_accounts[$index] !== '' ||
- $posting_amounts[$index] !== '' || $posting_descs[$index] !== '') {
-
- $posting_date = Fima::convertDateToStamp($posting_dates[$index], Fima::convertDateFormat($prefs->getValue('date_format')));
- $posting_asset = $posting_assets[$index];
- $posting_account = $posting_accounts[$index];
- $posting_eo = (int)(bool)$posting_eos[$index];
- $posting_amount = Fima::convertAmountToValue($posting_amounts[$index]);
- $posting_desc = $posting_descs[$index];
-
- /* Check posting date. */
- if ($posting_date === false) {
- $posting_valid = false;
- } elseif ($posting_date <= $closedperiod) {
- $posting_valid = false;
- }
-
- /* Check asset account and account. */
- if ($posting_asset === '' || $posting_account === '') {
- $posting_valid = false;
- } elseif ($posting_asset === $posting_account) {
- continue;
- }
-
- /* Fix amount sign. */
- if ($prefs->getValue('expenses_sign') == 0) {
- $account = Fima::getAccount($posting_account);
- if (!is_a($account, 'PEAR_Error') && $account !== null) {
- if ($account['type'] == FIMA_ACCOUNTTYPE_EXPENSE) {
- $posting_amount *= -1;
- }
- }
- }
-
- /* If $posting_id is set, we're modifying an existing account. Otherwise,
- * we're adding a new posting with the provided attributes. */
- if ($posting_valid) {
- if ($posting_id != null) {
- $result = $storage->modifyPosting($posting_id, $posting_type, $posting_date, $posting_asset,
- $posting_account, $posting_eo, $posting_amount, $posting_desc);
- } else {
- $result = $storage->addPosting($posting_type, $posting_date, $posting_asset, $posting_account,
- $posting_eo, $posting_amount, $posting_desc);
- }
-
- // Check our results.
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem saving the posting: %s."), $result->getMessage()), 'horde.error');
- $posting_valid = false;
- } else {
- $savecount++;
- }
- }
-
- /* Reload invalid or unsaved postings. */
- if (!$posting_valid) {
- $postings[] = array('posting_id' => $posting_id,
- 'owner' => $ledger,
- 'type' => $posting_type,
- 'date' => $posting_date,
- 'asset' => $posting_asset,
- 'account' => $posting_account,
- 'eo' => $posting_eo,
- 'amount' => $posting_amount,
- 'desc' => $posting_desc);
- }
- }
- }
-
- if ($savecount > 0) {
- $notification->push(sprintf(_("Saved %d postings."), $savecount), 'horde.success');
- }
- if (count($postings) > 0) {
- $notification->push(sprintf(_("%d postings not saved."), count($postings)), 'horde.error');
- } else {
- /* Return to the posting list. */
- Horde::url('postings.php', true)->redirect();
- }
- } else {
- /* Return to the posting list. */
- Horde::url('postings.php', true)->redirect();
- }
- break;
-
-case 'delete_postings':
- /* Delete postings if we're provided with valid account IDs. */
- $postingset = Horde_Util::getFormData('indices');
-
- $share = &$GLOBALS['fima_shares']->getShare($ledger);
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
- $notification->push(sprintf(_("Access denied deleting postings from %s."), $share->get('name')), 'horde.error');
- Horde::url('postings.php', true)->redirect();
- }
- if ($postingset !== null) {
- $storage = &Fima_Driver::singleton($ledger);
- $delcount = 0;
- foreach($postingset as $index => $posting_id) {
- $result = $storage->deletePosting($posting_id);
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem deleting posting #%d: %s"),
- $index, $result->getMessage()), 'horde.error');
- } else {
- $delcount++;
- }
- }
- if ($delcount > 0) {
- $notification->push(sprintf(_("Deleted %d postings."), $delcount), 'horde.success');
- }
- }
-
- /* Return to the posting list. */
- Horde::url('postings.php', true)->redirect();
-
-case 'update_postings':
- /* Get the form values. */
- $postingset = Horde_Util::getFormData('posting_id');
-
- $share = &$GLOBALS['fima_shares']->getShare($ledger);
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
- $notification->push(sprintf(_("Access denied shifting postings in %s."), $share->get('name')), 'horde.error');
- Horde::url('postings.php', true)->redirect();
- }
- if ($postingset !== null) {
- $posting_type = Horde_Util::getFormData('type');
- $posting_asset = Horde_Util::getFormData('asset');
- $posting_account = Horde_Util::getFormData('account');
-
- if ($posting_type || $posting_asset || $posting_account) {
- $storage = &Fima_Driver::singleton($ledger);
- $shiftcount = 0;
-
- foreach($postingset as $index => $posting_id) {
- $result = $storage->ShiftPosting($posting_id, $posting_type, $posting_asset, $posting_account);
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem shifting posting #%d: %s"),
- $index, $result->getMessage()), 'horde.error');
- } else {
- $shiftcount++;
- }
- }
- if ($shiftcount > 0) {
- $notification->push(sprintf(_("Shifted %d postings."), $shiftcount), 'horde.success');
- }
- }
- }
-
- /* Return to the posting list. */
- Horde::url('postings.php', true)->redirect();
-
-case 'copymove_postings':
- $share = &$GLOBALS['fima_shares']->getShare($ledger);
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
- $notification->push(sprintf(_("Access denied transfering postings in %s."), $share->get('name')), 'horde.error');
- Horde::url('postings.php', true)->redirect();
- }
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE) && (!Horde_Util::getFormData('keep') || Horde_Util::getFormData('delete'))) {
- $notification->push(sprintf(_("Access denied transfering postings in %s."), $share->get('name')), 'horde.error');
- Horde::url('postings.php', true)->redirect();
- }
- $type_from = Horde_Util::getFormData('type_from');
- $period_from = Horde_Util::getFormData('period_from');
- $keep = Horde_Util::getFormData('keep');
- $summarize = Horde_Util::getFormData('summarize');
- $summarize_account = Horde_Util::getFormData('summarize_post_account');
- $type_to = Horde_Util::getFormData('type_to');
- $period_to = Horde_Util::getFormData('period_to');
- $delete = Horde_Util::getFormData('delete');
-
- $period_from_start = mktime(0, 0, 0, ($period_from['month'] === '') ? 1 : $period_from['month'], 1, (int)$period_from['year']);
- $period_from_end = mktime(0, 0, 0, ($period_from['month'] === '') ? 12 : $period_from['month'] + 1, ($period_from['month'] === '') ? 31 : 0, (int)$period_from['year']);
- $period_to_start = mktime(0, 0, 0, ($period_to['month'] === '') ? 1 : $period_to['month'], 1, (int)$period_to['year']);
- $period_to_end = mktime(0, 0, 0, ($period_to['month'] === '') ? 12 : $period_to['month'] + 1, ($period_to['month'] === '') ? 31 : 0, (int)$period_to['year']);
-
- $storage = &Fima_Driver::singleton($ledger);
-
- /* Delete existing. */
- if ($delete) {
- $transferfilters = array(array('type', $type_to),
- array('date', $period_to_start, '>='),
- array('date', $period_to_end, '<='));
- $postings = Fima::listPostings($transferfilters);
- $delcount = 0;
- foreach ($postings as $postingId => $posting) {
- $result = $storage->deletePosting($postingId);
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem deleting an existing posting: %s"),
- $result->getMessage()), 'horde.error');
- } else {
- $delcount++;
- }
- }
- if ($delcount > 0) {
- $notification->push(sprintf(_("Deleted %d existing postings."), $delcount), 'horde.success');
- }
- }
-
- /* Copy postings. */
- $transferfilters = array(array('type', $type_from),
- array('date', $period_from_start, '>='),
- array('date', $period_from_end, '<='));
- $postings = Fima::listPostings($transferfilters);
-
- if ($summarize != 'none') {
- $accounts = Fima::listAccounts();
- $postingscopy = array();
-
- foreach ($postings as $postingId => $posting) {
- $asset = (isset($accounts[$posting['asset']]))
- ? (($accounts[$posting['asset']]['parent_id'] !== null) ? $accounts[$posting['asset']]['parent_id'] : $accounts[$posting['asset']]['account_id'])
- : $posting['asset'];
- $account = (isset($accounts[$posting['account']]))
- ? (($accounts[$posting['account']]['parent_id'] !== null) ? $accounts[$posting['account']]['parent_id'] : $accounts[$posting['account']]['account_id'])
- : $posting['account'];
-
- if ($summarize == 'combine') {
- $copyId = $asset . '_' . $account . '_' . strftime('%Y%m', $posting['date']);
-
- if (isset($postingscopy[$copyId])) {
- $postingscopy[$copyId]['amount'] += $posting['amount'];
- } else {
- $postingscopy[$copyId] = $posting;
- $postingscopy[$copyId]['date'] = mktime(0, 0, 0, ($period_to['month'] === '') ? strftime('%m', $posting['date']) : $period_to['month'], 1, (int)$period_to['year']);
- $postingscopy[$copyId]['asset'] = $asset;
- $postingscopy[$copyId]['account'] = $account;
- $postingscopy[$copyId]['eo'] = 0;
- $postingscopy[$copyId]['desc'] = _("Summarized");
- }
- } elseif ($summarize == 'post') {
- $copyIdAsset = $asset . '_' . strftime('%Y%m', $posting['date']);
- $copyIdAccount = $account . '_' . strftime('%Y%m', $posting['date']);
-
- if (isset($postingscopy[$copyIdAsset])) {
- $postingscopy[$copyIdAsset]['amount'] += $posting['amount'];
- } else {
- $postingscopy[$copyIdAsset] = $posting;
- $postingscopy[$copyIdAsset]['date'] = mktime(0, 0, 0, ($period_to['month'] === '') ? strftime('%m', $posting['date']) : $period_to['month'], 1, (int)$period_to['year']);
- $postingscopy[$copyIdAsset]['asset'] = $asset;
- $postingscopy[$copyIdAsset]['account'] = $summarize_account;
- $postingscopy[$copyIdAsset]['eo'] = 0;
- $postingscopy[$copyIdAsset]['desc'] = _("Summarized");
- }
-
- if (isset($postingscopy[$copyIdAccount])) {
- $postingscopy[$copyIdAccount]['amount'] += $posting['amount'];
- } else {
- $postingscopy[$copyIdAccount] = $posting;
- $postingscopy[$copyIdAccount]['date'] = mktime(0, 0, 0, ($period_to['month'] === '') ? strftime('%m', $posting['date']) : $period_to['month'], 1, (int)$period_to['year']);
- $postingscopy[$copyIdAccount]['asset'] = $summarize_account;
- $postingscopy[$copyIdAccount]['account'] = $account;
- $postingscopy[$copyIdAccount]['eo'] = 0;
- $postingscopy[$copyIdAccount]['desc'] = _("Summarized");
- }
- }
- }
- } else {
- $postingscopy = &$postings;
- foreach ($postingscopy as $postingId => $posting) {
- $postingscopy[$postingId]['date'] = mktime(0, 0, 0, ($period_to['month'] === '') ? strftime('%m', $posting['date']) : $period_to['month'], strftime('%d', $posting['date']), (int)$period_to['year']);
- }
- }
-
- $addcount = 0;
- foreach ($postingscopy as $postingId => $posting) {
- $result = $storage->addPosting($type_to, $posting['date'], $posting['asset'], $posting['account'],
- $posting['eo'], $posting['amount'], $posting['desc']);
-
- // Check our results.
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem saving the posting: %s."), $result->getMessage()), 'horde.error');
- } else {
- $addcount++;
- }
- }
- if ($addcount > 0) {
- $notification->push(sprintf($summarize ? _("Summarized %d postings.") : _("Transfered %d postings."), $addcount), 'horde.success');
- }
-
- /* Delete original postings. */
- if (!$keep) {
- $delcount = 0;
- foreach ($postings as $postingId => $posting) {
- $result = $storage->deletePosting($postingId);
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem deleting an original posting: %s"),
- $result->getMessage()), 'horde.error');
- } else {
- $delcount++;
- }
- }
- if ($delcount > 0) {
- $notification->push(sprintf(_("Deleted %d original postings."), $delcount), 'horde.success');
- }
- }
-
- /* Return to the posting list. */
- Horde::url('postings.php', true)->redirect();
-
-default:
- break;
-}
-
-/* Print. */
-$print_view = (bool)Horde_Util::getFormData('print');
-if (!$print_view && $pageOb['mode'] == 'list') {
- $print_link = Horde_Util::addParameter(Horde::url('postings.php'), array('print' => 1));
-}
-
-/* Filters. */
-$postingtype = $prefs->getValue('active_postingtype');
-$filters[] = array('type', $postingtype);
-if (isset($_SESSION['fima_search'])) {
- $title = _("Search Results");
- foreach ($_SESSION['fima_search'] as $searchId => $search) {
- if ($search === null) {
- continue;
- }
- switch ($searchId) {
- case 'date_start': $filters[] = array('date', $search, '>='); break;
- case 'date_end': $filters[] = array('date', $search, '<='); break;
- case 'asset': $filters[] = array(array(array('asset', $search), array('account', $search, '=', 'OR'))); break;
- case 'account': $filters[] = array('account', $search); break;
- case 'desc': $filters[] = array('desc', Fima::convertWildcards($search), 'LIKE'); break;
- case 'amount_start': $filters[] = array('amount', Fima::convertAmountToValue($search), '>='); break;
- case 'amount_end': $filters[] = array('amount', Fima::convertAmountToValue($search), '<='); break;
- case 'eo': $filters[] = array('eo', (int)(bool)$search);
- default: break;
- }
- }
-}
-
-/* Retrieve accounts, accounttypes and postings (if not set before). */
-$accounts = Fima::listAccounts();
-$accounttypes = Fima::getAccountTypes();
-if (!isset($postings)) {
- $postings = Fima::listPostings($filters, ($pageOb['mode'] != 'list' || $print_view) ? null : $pageOb['page']);
-}
-
-$pageOb['postings_perpage'] = $prefs->getValue('max_postings');
-$pageOb['postings_total'] = Fima::getPostingsCount();
-
-if ($pageOb['mode'] == 'edit') {
- /* Fix amount sign. */
- if ($prefs->getValue('expenses_sign') == 0) {
- foreach ($postings as $postingId => $posting) {
- if ($accounts[$posting['account']]['type'] == FIMA_ACCOUNTTYPE_EXPENSE) {
- $postings[$postingId]['amount'] *= -1;
- }
- }
- }
- /* Add blank postings. */
- for ($i = count($postings); $i < max($pageOb['postings_perpage'], 12); $i++) {
- $postings[] = array('posting_id' => null,
- 'owner' => $ledger,
- 'type' => $postingtype,
- 'date' => null,
- 'asset' => null,
- 'account' => null,
- 'eo' => null,
- 'amount' => null,
- 'desc' => null);
- }
-}
-
-/* Add account information to postings and create flags list. */
-if ($pageOb['mode'] == 'list') {
- $flags = array();
- foreach ($postings as $postingId => $posting) {
- $postings[$postingId]['desc'] = htmlspecialchars($posting['desc']);
-
- if (isset($accounts[$posting['asset']])) {
- $postings[$postingId]['asset_label'] = htmlspecialchars($accounts[$posting['asset']]['label']);
- $postings[$postingId]['asset_closed'] = $accounts[$posting['asset']]['closed'];
- } else {
- $postings[$postingId]['asset_label'] = _("Unknown");
- $postings[$postingId]['asset_closed'] = false;
- }
- if (isset($accounts[$posting['account']])) {
- $postings[$postingId]['account_label'] = htmlspecialchars($accounts[$posting['account']]['label']);
- $postings[$postingId]['account_type'] = $accounts[$posting['account']]['type'];
- $postings[$postingId]['account_type_eo'] = sprintf($posting['eo'] ? _("e.o. %s") : _("%s") , $accounttypes[$accounts[$posting['account']]['type']]);
- $postings[$postingId]['account_closed'] = $accounts[$posting['account']]['closed'];
- } else {
- $postings[$postingId]['account_label'] = _("Unknown");
- $postings[$postingId]['account_type'] = '';
- $postings[$postingId]['account_type_eo'] = '';
- $postings[$postingId]['account_closed'] = false;
- }
-
- $flag = 0;
- $flagpos = 0;
- foreach ($accounttypes as $typeId => $typeLabel) {
- if ($postings[$postingId]['account_type'] == $typeId) {
- $flag |= pow(2, $flagpos);
- }
- $flagpos++;
- }
- $flags[] = $flag;
- }
-}
-
-/* Set up page information. */
-$pageOb['page_count'] = ceil($pageOb['postings_total'] / $pageOb['postings_perpage']);
-if ($pageOb['page'] < 0) {
- $pageOb['page'] += $pageOb['page_count'] + 1;
-}
-if ($pageOb['mode'] == 'list') {
- if ($pageOb['postings_total'] == 0) {
- $pageOb['postings_count'] = _("No Postings");
- } else {
- $pageOb['postings_count'] = sprintf(_("%s to %s of %s Postings"),
- ($pageOb['page'] - 1) * $pageOb['postings_perpage'] + 1,
- min($pageOb['page'] * $pageOb['postings_perpage'], $pageOb['postings_total']),
- $pageOb['postings_total']);
- }
-}
-
-/* Get sorting. */
-if ($pageOb['mode'] == 'list' || $pageOb['mode'] == 'edit') {
- $sortby = $prefs->getValue('sortby');
- $sortdir = $prefs->getValue('sortdir');
- $sorturl = Horde_Util::addParameter($pageOb['url'], 'sortdir', ($sortdir) ? 0 : 1);
-}
-
-/* Generate page links. */
-if ($pageOb['mode'] == 'list') {
- $graphicsdir = Horde_Themes::img(null, 'horde');
- if ($pageOb['page'] == 1) {
- $pageOb['pages_first'] = Horde::img('nav/first-grey.png', null, null, $graphicsdir);
- $pageOb['pages_prev'] = Horde::img('nav/left-grey.png', null, null, $graphicsdir);
- } else {
- $first_url = Horde_Util::addParameter($pageOb['url'], 'page', 1);
- $pageOb['pages_first'] = Horde::link($first_url, _("First Page")) . Horde::img('nav/first.png', '<<', null, $graphicsdir) . '</a>';
- $prev_url = Horde_Util::addParameter($pageOb['url'], 'page', $pageOb['page'] - 1);
- $pageOb['pages_prev'] = Horde::link($prev_url, _("Previous Page"), '', '', '', '', '', array('id' => 'prev')) . Horde::img('nav/left.png', '<', null, $graphicsdir) . '</a>';
- }
- if ($pageOb['page'] == $pageOb['page_count']) {
- $pageOb['pages_last'] = Horde::img('nav/last-grey.png', null, null, $graphicsdir);
- $pageOb['pages_next'] = Horde::img('nav/right-grey.png', null, null, $graphicsdir);
- } else {
- $next_url = Horde_Util::addParameter($pageOb['url'], 'page', $pageOb['page'] + 1);
- $pageOb['pages_next'] = Horde::link($next_url, _("Next Page"), '', '', '', '', '', array('id' => 'next')) . Horde::img('nav/right.png', '>', null, $graphicsdir) . '</a>';
- $last_url = Horde_Util::addParameter($pageOb['url'], 'page', $pageOb['page_count']);
- $pageOb['pages_last'] = Horde::link($last_url, _("Last Page")) . Horde::img('nav/last.png', '>>', null, $graphicsdir) . '</a>';
- }
-}
-
-/* Some browsers have trouble with hidden overflow in table cells but not in divs. */
-if ($GLOBALS['browser']->hasQuirk('no_hidden_overflow_tables')) {
- $overflow_begin = '<div class="ohide">';
- $overflow_end = '</div>';
-} else {
- $overflow_begin = '';
- $overflow_end = '';
-}
-
-/* Set up row Ids. */
-$rowId = 0;
-
-/* Get date and amount format. */
-$datefmt = $prefs->getValue('date_format');
-$amountfmt = $prefs->getValue('amount_format');
-
-$js_onload = array();
-
-if ($pageOb['mode'] == 'edit') {
- /* Fix date format. */
- $datefmt = Fima::convertDateFormat($datefmt);
-
- /* Add current date in first field if no postings. */
- foreach ($postings as $key => $value) {
- if ($value['date'] == '') {
- $js_onload[] = '$("date1").setValue(' . Horde_Serialize::serialize(strftime($datefmt), Horde_Serialize::JSON, $registry->getCharset()) . ')';
- }
- break;
- }
-
- /* Select first date field. */
- $js_onload[] = 'updateResult()';
- $js_onload[] = 'updateAssetResult(_getall("asset[]")[0])';
- $js_onload[] = '$("date1").focus().select()';
-}
-
-Horde::addInlineScript($js_onload, 'dom');
-
-require FIMA_TEMPLATES . '/common-header.inc';
-if ($print_view) {
- require_once $registry->get('templates', 'horde') . '/javascript/print.js';
-} else {
- require FIMA_TEMPLATES . '/menu.inc';
-}
-if ($browser->hasFeature('javascript')) {
- require FIMA_TEMPLATES . '/postings/javascript_' . $pageOb['mode'] . '.inc';
-}
-
-/* Get current asset results. */
-if ($pageOb['mode'] == 'edit') {
- $assetresults = Fima::getAssetResults($prefs->getValue('active_postingtype'));
-}
-
-/* Generate tabs. */
-if ($pageOb['mode'] != 'transfer' && !$print_view) {
- $tabs = new Horde_Core_Ui_Tabs('postingtype', $vars);
- $postingtypes = Fima::getPostingTypes();
- foreach ($postingtypes as $typeValue => $typeLabel) {
- $tabs->addTab($typeLabel, $pageOb['url'], $typeValue);
- }
- echo $tabs->render($prefs->getValue('active_postingtype'));
-}
-
-/* Generate list. */
-if (!$print_view) {
- require FIMA_TEMPLATES . '/postings/header.inc';
-}
-
-if ($pageOb['mode'] == 'list' && $pageOb['page_count'] == 0) {
- require FIMA_TEMPLATES . '/postings/empty.inc';
-} else {
- $form = 1;
- if (!$print_view) {
- require FIMA_TEMPLATES . '/postings/navbar.inc';
- require FIMA_TEMPLATES . '/postings/actions.inc';
- }
-
- require FIMA_TEMPLATES . '/postings/posting_headers.inc';
- require FIMA_TEMPLATES . '/postings/' . $pageOb['mode'] . '.inc';
- require FIMA_TEMPLATES . '/postings/posting_footers.inc';
-
- /* If there are 20 postings or less, don't show the actions/navbar again. */
- if ((count($postings) > 20 || $pageOb['mode'] != 'list') && !$print_view) {
- $form = 2;
- require FIMA_TEMPLATES . '/postings/actions.inc';
- require FIMA_TEMPLATES . '/postings/navbar.inc';
- } else {
- /* TODO */
- echo '<tr><td class="control" colspan="6"></td></tr>';
- }
-}
-require FIMA_TEMPLATES . '/postings/footer.inc';
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2008 Thomas Trethan <thomas@trethan.net>
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-@define('FIMA_BASE', dirname(__FILE__));
-require_once FIMA_BASE . '/lib/base.php';
-require_once FIMA_BASE . '/config/report.php';
-require_once FIMA_BASE . '/lib/Report.php';
-
-$actionID = Horde_Util::getFormData('actionID');
-
-switch ($actionID) {
-case 'open_report':
- $_SESSION['fima_report'] = array('report_id' => Horde_Util::getFormData('report_id'),
- 'display' => Horde_Util::getFormData('display'),
- 'posting_account' => Horde_Util::getFormData('posting_account'),
- 'period_start' => Horde_Util::getFormData('period_start'),
- 'period_end' => Horde_Util::getFormData('period_end'),
- 'reference_start' => Horde_Util::getFormData('reference_start'),
- 'reference_end' => Horde_Util::getFormData('reference_end'),
- 'cumulate' => Horde_Util::getFormData('cumulate'),
- 'nullrows' => Horde_Util::getFormData('nullrows'),
- 'subaccounts' => Horde_Util::getFormData('subaccounts'),
- 'yearly' => Horde_Util::getFormData('yearly'),
- 'graph' => Horde_Util::getFormData('graph'));
- break;
-case 'clear_report':
- unset($_SESSION['fima_report']);
- break;
-default:
- break;
-}
-
-/* Create params array. */
-$params = isset($_SESSION['fima_report']) ? $_SESSION['fima_report'] : array();
-
-/* Set initial values. */
-if (!isset($params['report_id'])) {
- $params['report_id'] = '';
-}
-if (!isset($params['display'])) {
- $params['display'] = '';
-}
-if (!isset($params['posting_account'])) {
- $params['posting_account'] = array();
-}
-if (!isset($params['period_start'])) {
- $params['period_start'] = mktime(0, 0, 0, 1, 1);
-} elseif (is_array($params['period_start'])) {
- $params['period_start'] = mktime(0, 0, 0, $params['period_start']['month'], 1, $params['period_start']['year']);
-}
-if (!isset($params['period_end'])) {
- $params['period_end'] = mktime(0, 0, 0, 12, 31);
-} elseif (is_array($params['period_end'])) {
- $params['period_end'] = mktime(0, 0, 0, $params['period_end']['month'] + 1, 1, $params['period_end']['year']) - 1;
-}
-if (!isset($params['reference_start'])) {
- $params['reference_start'] = mktime(0, 0, 0, 1, 1, date('Y') - 1);
-} elseif (is_array($params['reference_start'])) {
- $params['reference_start'] = mktime(0, 0, 0, $params['reference_start']['month'], 1, $params['reference_start']['year']);
-}
-if (!isset($params['reference_end'])) {
- $params['reference_end'] = mktime(0, 0, 0, 12, 31, date('Y') - 1);
-} elseif (is_array($params['reference_end'])) {
- $params['reference_end'] = mktime(0, 0, 0, $params['reference_end']['month'] + 1, 1, $params['reference_end']['year']) - 1;
-}
-if (!isset($params['cumulate'])) {
- $params['cumulate'] = 0;
-}
-if (!isset($params['nullrows'])) {
- $params['nullrows'] = 0;
-}
-if (!isset($params['subaccounts'])) {
- $params['subaccounts'] = 0;
-}
-if (!isset($params['yearly'])) {
- $params['yearly'] = 0;
-}
-if (!isset($params['graph'])) {
- $params['graph'] = 0;
-}
-
-$params['out'] = Horde_Util::getFormData('out');
-$params['sortby'] = Horde_Util::getFormData('sortby');
-$params['sortdir'] = Horde_Util::getFormData('sortdir');
-
-/* Get posting types and output displays. */
-$types = Fima::getPostingTypes();
-$displaylabel = _("%s [%s - %s - %s]");
-$displays = array(FIMA_POSTINGTYPE_ACTUAL.'_'.FIMA_POSTINGTYPE_FORECAST.'_'.FIMA_POSTINGTYPE_BUDGET.'_reference' => sprintf($displaylabel, $types[FIMA_POSTINGTYPE_ACTUAL], $types[FIMA_POSTINGTYPE_FORECAST], $types[FIMA_POSTINGTYPE_BUDGET], _("Reference")),
- FIMA_POSTINGTYPE_ACTUAL.'_'.FIMA_POSTINGTYPE_FORECAST.'_difference_%' => sprintf($displaylabel, $types[FIMA_POSTINGTYPE_ACTUAL], $types[FIMA_POSTINGTYPE_FORECAST], _("Difference"), _("%")),
- FIMA_POSTINGTYPE_ACTUAL.'_'.FIMA_POSTINGTYPE_BUDGET.'_difference_%' => sprintf($displaylabel, $types[FIMA_POSTINGTYPE_ACTUAL], $types[FIMA_POSTINGTYPE_BUDGET], _("Difference"), _("%")),
- FIMA_POSTINGTYPE_ACTUAL.'_reference_difference_%' => sprintf($displaylabel, $types[FIMA_POSTINGTYPE_ACTUAL], _("Reference"), _("Difference"), _("%")),
- FIMA_POSTINGTYPE_FORECAST.'_'.FIMA_POSTINGTYPE_BUDGET.'_difference_%' => sprintf($displaylabel, $types[FIMA_POSTINGTYPE_FORECAST], $types[FIMA_POSTINGTYPE_BUDGET], _("Difference"), _("%")),
- FIMA_POSTINGTYPE_FORECAST.'_reference_difference_%' => sprintf($displaylabel, $types[FIMA_POSTINGTYPE_FORECAST], _("Reference"), _("Difference"), _("%")),
- FIMA_POSTINGTYPE_BUDGET.'_reference_difference_%' => sprintf($displaylabel, $types[FIMA_POSTINGTYPE_BUDGET], _("Reference"), _("Difference"), _("%")),
- 'reference_'.FIMA_POSTINGTYPE_ACTUAL.'_difference_%' => sprintf($displaylabel, _("Reference"), $types[FIMA_POSTINGTYPE_ACTUAL], _("Difference"), _("%")));
-
-/* Include graphs library. */
-$error_reporting = ini_get('error_reporting');
-ini_set('error_reporting', $error_reporting & ~E_WARNING);
-$graphs = include_once 'Image/Graph.php';
-ini_set('error_reporting', $error_reporting);
-
-$title = _("Reports");
-
-switch ($actionID) {
-case 'open_report':
-case 'display_report':
- if ($params['report_id'] !== null) {
- /* Title. */
- $params['title'] = $_reports[$params['report_id']];
-
- /* Build report url. */
- $params['url'] = Horde_Util::addParameter(Horde::url('report.php'), 'actionID', 'display_report');
-
- /* Add params from options. */
- $params['graphsize'] = $prefs->getValue('report_graphsize');
-
- /* Execute report. */
- $report = &Fima_Report::factory($params['report_id'], $params);
- if (is_a($report, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem creating the report: %s."), $report->getMessage()), 'horde.error');
- break;
- }
-
- if ($params['graph'] && !$params['out']) {
- break;
- }
-
- $status = $report->execute();
- if (is_a($status, 'PEAR_Error')) {
- $notification->push(sprintf(_("There was a problem executing the report: %s."), $status->getMessage()), 'horde.error');
- break;
- }
-
- if ($params['graph']) {
- if ($graphs) {
- require FIMA_TEMPLATES . '/reports/img.inc';
- } else {
- $notification->push(_("The graphs library could not be loaded."), 'horde.error');
- }
- exit;
- }
-
- $title = sprintf(_("Report %s"), $params['title']);
- }
- break;
-default:
- break;
-}
-
-/* Get date and amount format. */
-$datefmt = $prefs->getValue('date_format');
-$amountfmt = $prefs->getValue('amount_format');
-
-Horde::addInlineScript(array(
- '$("report_id").focus()'
-), 'dom');
-
-require FIMA_TEMPLATES . '/common-header.inc';
-require FIMA_TEMPLATES . '/menu.inc';
-if ($browser->hasFeature('javascript')) {
- require FIMA_TEMPLATES . '/postings/javascript_edit.inc';
-}
-require FIMA_TEMPLATES . '/reports/reports.inc';
-if (isset($report)) {
- if ($params['graph']) {
- require FIMA_TEMPLATES . '/reports/graph.inc';
- } elseif (count($report->getData()) != 0) {
- require FIMA_TEMPLATES . '/reports/table.inc';
- } else {
- require FIMA_TEMPLATES . '/reports/empty.inc';
- }
-}
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-CREATE TABLE fima_accounts (
- account_id VARCHAR(32) NOT NULL,
- account_owner VARCHAR(255) NOT NULL,
- account_number VARCHAR(4) NOT NULL,
- account_type VARCHAR(255) NOT NULL,
- account_name VARCHAR(255) NOT NULL,
- account_desc TEXT NOT NULL,
- account_eo INT NOT NULL DEFAULT 0,
- account_closed INT NOT NULL DEFAULT 0,
---
- PRIMARY KEY (account_id)
-);
-
-CREATE INDEX fima_account_owner_idx ON fima_accounts (account_owner);
-CREATE INDEX fima_account_type_idx ON fima_accounts (account_type);
-
-GRANT SELECT, INSERT, UPDATE, DELETE ON fima_accounts TO horde;
-
-CREATE TABLE fima_postings (
- posting_id VARCHAR(32) NOT NULL,
- posting_owner VARCHAR(255) NOT NULL,
- posting_type VARCHAR(255) NOT NULL,
- posting_date INT NOT NULL,
- posting_asset VARCHAR(32) NOT NULL,
- posting_account VARCHAR(32) NOT NULL,
- posting_eo INT NOT NULL DEFAULT 0,
- posting_amount DECIMAL(10,2) NOT NULL,
- posting_desc VARCHAR(255) NOT NULL,
---
- PRIMARY KEY (posting_id)
-);
-
-CREATE INDEX fima_posting_owner_idx ON fima_postings (posting_owner);
-CREATE INDEX fima_posting_type_idx ON fima_postings (posting_type);
-CREATE INDEX fima_posting_account_idx ON fima_postings (posting_account);
-CREATE INDEX fima_posting_asset_idx ON fima_postings (posting_asset);
-
-
-GRANT SELECT, INSERT, UPDATE, DELETE ON fima_postings TO horde;
-
+++ /dev/null
-<?php
-/**
- * Copyright 2008 Thomas Trethan <thomas@trethan.net>
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-@define('FIMA_BASE', dirname(__FILE__));
-require_once FIMA_BASE . '/lib/base.php';
-
-/* Get the current action ID. */
-$actionID = Horde_Util::getFormData('actionID');
-
-switch ($actionID) {
-case 'clear_search':
- unset($_SESSION['fima_search']);
- break;
-default:
- break;
-}
-
-/* Get search array. */
-$search = isset($_SESSION['fima_search']) ? $_SESSION['fima_search'] : array();
-
-/* Set initial values. */
-if (!isset($search['type'])) {
- $search['type'] = $prefs->getValue('active_postingtype');
-}
-if (!isset($search['date_start'])) {
- $search['date_start'] = mktime(0, 0, 0, 1, 1);
-} elseif (is_array($search['date_start'])) {
- $search['date_start'] = mktime(0, 0, 0, $search['date_start']['month'], $search['date_start']['day'], (int)$search['date_start']['year']);
-}
-if (!isset($search['date_end'])) {
- $search['date_end'] = mktime(0, 0, 0, 12, 31);
-} elseif (is_array($search['date_end'])) {
- $search['date_end'] = mktime(0, 0, 0, $search['date_end']['month'], $search['date_end']['day'], (int)$search['date_end']['year']);
-}
-if (!isset($search['asset'])) {
- $search['asset'] = array();
-}
-if (!isset($search['account'])) {
- $search['account'] = array();
-}
-if (!isset($search['desc'])) {
- $search['desc'] = '';
-}
-if (!isset($search['amount_start'])) {
- $search['amount_start'] = '';
-}
-if (!isset($search['amount_end'])) {
- $search['amount_end'] = '';
-}
-if (!isset($search['eo'])) {
- $search['eo'] = -1;
-}
-
-/* Get posting types and eo. */
-$types = Fima::getPostingTypes();
-$eos = array('-1' => '',
- '1' => _("e.o. postings only"),
- '0' => _("no e.o. postings"));
-
-/* Get date and amount format. */
-$datefmt = $prefs->getValue('date_format');
-$amountfmt = $prefs->getValue('amount_format');
-
-Horde::addInlineScript(array(
- '$("search_type").focus()'
-), 'dom');
-
-$title = _("Search Postings");
-require FIMA_TEMPLATES . '/common-header.inc';
-require FIMA_TEMPLATES . '/menu.inc';
-if ($browser->hasFeature('javascript')) {
- require FIMA_TEMPLATES . '/postings/javascript_edit.inc';
-}
-require FIMA_TEMPLATES . '/search/search.inc';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-
-$perm_edit = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
-$perm_delete = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE);
-
-?>
-<script type="text/javascript">
-<!--
-function Submit(action)
-{
- if (action == "delete_all") {
- if (!confirm("<?php echo _("Are you sure you wish to PERMANENTLY delete all accounts and all postings?") ?>")) {
- return;
- }
- }
-
- document.accounts.actionID.value = action;
- document.accounts.submit();
-}
-//-->
-</script>
-
-<h1 class="header"><?php echo htmlspecialchars($share->get('name')) ?></h1>
-
-<form method="post" name="accounts" action="accounts.php">
-<?php Horde_Util::pformInput() ?>
-<input type="hidden" name="actionID" value="" />
-
-<div id="accountList">
-<?php
-
-$tree = $GLOBALS['injector']->getInstance('Horde_Tree')->getTree('account_tree', 'Javascript');
-
-foreach ($accounts as $accountId => $account) {
- $params = array('icon' => Horde_Themes::img($account['icon']));
- $accountLabel = htmlspecialchars(trim($account['number'] . ' ' . $account['name']));
- if ($account['closed']) {
- $accountLabel = '<span class="closed">' . $accountLabel . '</span>';
- }
- $accountExtra = '';
- if (!$print_view) {
- if ($perm_delete && $accountId == 'root') { $accountExtra .= ' '.Horde::link('#', _("Delete all"), '', '', "Submit('delete_all'); return false;") . Horde::img('delete-small.png', _("Delete")) . '</a>'; }
- if ($perm_edit && isset($account['edit_link'])) { $accountExtra .= ' '.Horde::link(Horde::url($account['edit_link']), sprintf(_("Edit %s"), $accountLabel)) . Horde::img('edit-small.png', _("Edit")) . '</a>'; }
- if ($perm_delete && isset($account['delete_link'])) { $accountExtra .= ' '.Horde::link(Horde::url($account['delete_link']), sprintf(_("Delete %s"), $accountLabel)) . Horde::img('delete-small.png', _("Delete")) . '</a>'; }
- if ($perm_edit && isset($account['add_link'])) { $accountExtra .= ' '.Horde::link(Horde::url($account['add_link']), _("Create a New Account")) . Horde::img('new-small.png', '+') . '</a>'; }
- if ( isset($account['view_link'])) { $accountExtra .= ' '.Horde::link(Horde::url($account['view_link']), sprintf(_("View %s"), $accountLabel)) . Horde::img('search-small.png', _("Search")) . '</a>'; }
- }
- $tree->addNode($accountId, $account['parent_id'], $accountLabel, 0, $print_view ? true : $account['expanded'], $params, $accountExtra);
-}
-
-echo $tree->renderTree();
-
-?>
-</div>
-</form>
+++ /dev/null
-<?php
-if (isset($language)) {
- header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
- header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Fima: Copyright 2007-2008 The Horde Project. Fima is under the GPL. -->
-<!-- Horde Project: http://www.horde.org/ | Fima: http://www.horde.org/fima/ -->
-<!-- Horde Licenses: http://www.horde.org/licenses/ -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
- $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-<link href="<?php echo Horde_Themes::img('favicon.ico', array('nohorde' => true)) ?>" rel="SHORTCUT ICON" />
-<?php Horde_Themes::includeStylesheetFiles() ?>
-</head>
-
-<body>
+++ /dev/null
-<form method="post" name="export" action="<?php echo Horde::downloadUrl(_("postings.csv"), null, Horde::url('data.php')) ?>">
-<?php echo Horde_Util::formInput() ?>
-<input type="hidden" name="actionID" value="export" />
-
-<h1 class="header">
- <?php echo _("Export Postings") ?>
-</h1>
-
-<div class="item">
- <?php echo Horde::label('exportID', _("Select the export format:")) ?><br />
- <select name="exportID" id="exportID">
- <option value="<?php echo EXPORT_CSV ?>"><?php echo _("Comma separated values") ?></option>
- <option value="<?php echo EXPORT_TSV ?>"><?php echo _("Tab separated values") ?></option>
- </select><br />
-
- <input type="submit" value="<?php echo _("Export") ?>" class="button" />
-</div>
-</form>
+++ /dev/null
-<form method="post" name="import_form" enctype="multipart/form-data" action="data.php">
-<?php Horde_Util::pformInput() ?>
-<input type="hidden" name="actionID" value="<?php echo htmlspecialchars($next_step) ?>" />
-<input type="hidden" name="import_step" value="<?php echo (int)$import_step ?>" />
-
-<h1 class="header">
- <?php printf(_("Import Postings, Step %d"), (int)$import_step) ?>
-</h1>
-
-<div class="item">
- <?php echo Horde::label('import_format', _("Select the format of the source file:")) ?><br />
- <select name="import_format" id="import_format">
- <option value="csv"><?php echo _("Comma separated values") ?></option>
- <option value="tsv"><?php echo _("Tab separated values") ?></option>
- </select><br />
-
- <input type="checkbox" align="middle" name="purge" id="purge" value="1" />
- <?php echo Horde::label('purge', _("Replace existing postings with the imported one? <strong>Warning: This deletes all existing postings.</strong>")) ?>
- <br />
-
- <?php echo Horde::label('charset', _("Select the charset of the source file:")) ?><br />
- <select name="charset" id="charset" style="direction: ltr">
-<?php foreach ($charsets as $charset => $charset_name): ?>
- <option value="<?php echo htmlspecialchars($charset) ?>"<?php if ($charset == $my_charset) echo ' selected="selected"' ?>><?php echo htmlspecialchars($charset_name) ?></option>
-<?php endforeach; ?>
- </select>
- <br /><br />
-
- <?php echo Horde::label('import_file', _("Select the file to import:")) ?><br />
- <input type="file" name="import_file" id="import_file" size="40" /><br /><br />
- <input type="submit" value="<?php echo _("Next") ?>" class="button" />
-</div>
-</form>
-
-<br class="spacer" />
+++ /dev/null
-<h1 class="header">
- <?php echo _("Manage Ledgers") ?>
-</h1>
-
-<div id="ledger-list-buttons">
- <form method="get" action="create.php">
-<?php echo Horde_Util::formInput() ?>
- <input type="submit" class="button" value="<?php echo _("Create a new Ledger") ?>" />
- </form>
-</div>
-
-<table summary="<?php echo _("Ledger List") ?>" cellspacing="0" id="ledger-list" class="striped sortable">
- <thead>
- <tr>
- <th class="ledger-list-icon nosort"><?php echo $browse_img ?></th>
-<th class="sortdown"><?php echo _("Ledger") ?></th>
- <th class="ledger-list-icon nosort"><?php echo $edit_img ?></th>
-<?php if (empty($conf['share']['no_sharing'])): ?>
- <th class="ledger-list-icon nosort"><?php echo $perms_img ?></th>
-<?php endif; ?>
- <th class="ledger-list-icon nosort"><?php echo $delete_img ?></th>
- </tr>
- </thead>
-
- <tbody>
-<?php foreach (array_keys($sorted_ledgers) as $ledger_id): ?>
- <?php $ledger = $ledgers[$ledger_id] ?>
- <tr>
- <td><?php echo $browse_img ?></td>
- <td><?php echo htmlspecialchars($ledger->get('name')) ?></td>
- <td><a href="<?php echo Horde_Util::addParameter($edit_url_base, 'l', $ledger->getName()) ?>" title="<?php echo _("Edit") ?>"><?php echo $edit_img ?></a></td>
-<?php if (empty($conf['share']['no_sharing'])): ?>
- <td><a onclick="<?php echo Horde::popupJs($perms_url_base, array('params' => array('share' => $ledger->getName()), 'urlencode' => true)) ?>return false;" href="<?php echo Horde_Util::addParameter($perms_url_base, 'share', $ledger->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
-<?php endif; ?>
- <td><a href="<?php echo Horde_Util::addParameter($delete_url_base, 'l', $ledger->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
- </tr>
-<?php endforeach; ?>
- </tbody>
-</table>
+++ /dev/null
-<form action="<?php echo basename($_SERVER['PHP_SELF']) ?>" method="get" name="menuform">
-<input type="hidden" name="actionID" value="change_ledger" />
-<div id="menu">
- <div class="rightFloat">
- <label for="changeledger">
- <select id="changeledger" name="changeledger" onchange="ledgerSubmit()">
-<?php
-$ledgers = Fima::listLedgers();
-$activeLedger = Fima::getActiveLedger();
-foreach ($ledgers as $ledgerId => $ledger) {
- $selected = ($ledgerId == $activeLedger) ? ' selected="selected"' : '';
- echo ' <option value="' . $ledgerId . '"' . $selected .'>' . $ledger->get('name') . '</option>' . "\n";
-}
-?>
- </select>
- </label>
- </div>
- <div class="rightFloat">
- <ul><li class="rightFloat"><a href="#" onclick="ledgerSubmit(true); return false;"><?php echo Horde::img('list.png', _("Open Ledger"), '') . '<br />' . _("Open Ledger") ?></a></li></ul>
- </div>
-
- <?php echo Fima::getMenu()->render() ?>
- <br class="clear" />
-
-</div>
-</form>
-
-<script type="text/javascript">
-var loading;
-function ledgerSubmit(clear)
-{
- if (document.menuform.changeledger[document.menuform.changeledger.selectedIndex].value != '') {
- if ((loading == null) || (clear != null)) {
- loading = true;
- document.menuform.submit();
- }
- }
-}
-</script>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
-<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
+++ /dev/null
-<table width="100%" cellspacing="0">
- <tr>
- <td class="mboxcontrol <?php if ($form == 1) { echo 'bottombordercollapse'; } else { echo 'topborder'; } ?>">
- <div class="rightFloat">
- </div>
- <div class="leftFloat">
-<?php if ($pageOb['mode'] == 'list'): ?>
- <ul class="msgactions">
- <li><?php echo Horde::widget('#', _("Delete"), 'widget', '', "Submit('delete_postings'); return false;", _("_Delete")); ?></li>
- <li><?php echo Horde::widget('#', _("Edit"), 'widget', '', "Submit('edit_postings'); return false;", _("_Edit")); ?></li>
- <li><?php echo Horde::widget('#', _("Shift"), 'widget', '', "Submit('shift_postings'); return false;", _("S_hift")); ?></li>
- <li class="lastnavbar"><?php echo Horde::widget('#', _("Transfer"), 'widget', '', "Submit('transfer_postings'); return false;", _("Trans_fer")); ?></li>
- </ul>
-<?php else: ?>
- <input type="submit" class="button" value="<?php echo _("Save") ?>" onclick="return Submit('<?php echo $actionID ?>');" />
-<?php if (in_array($prefs->getValue('active_postingtype'), array(FIMA_POSTINGTYPE_FORECAST, FIMA_POSTINGTYPE_BUDGET))): ?>
- <input type="button" class="button" value="<?php echo _("Autofill") ?>" onclick="autofillPostings();" />
-<?php endif; ?>
-<?php endif; ?>
- </div>
- </td>
- </tr>
-</table>
+++ /dev/null
-<?php
-/* Cache created widgets. */
-$assetWidgets = array(-1 => Fima::buildAccountWidget('asset[]', '', 'onfocus="updateAccount(this);" onblur="updateAssetResult(this);"', '', false, array(array('type', FIMA_ACCOUNTTYPE_ASSET)), true));
-$accountWidgets = array(-1 => Fima::buildAccountWidget('account[]', '', 'onblur="updateEo(this);"', '', false, array(), true));
-?>
-<?php foreach($postings as $postingId => $posting): ?>
-<?php $rowId++; ?>
- <tr id="row<?php echo $rowId ?>" class="posting">
- <td>
- <input name="posting_id[]" type="hidden" value="<?php echo $posting['posting_id'] ?>" />
- <input name="date[]" id="date<?php echo $rowId ?>" type="text" value="<?php echo $posting['date'] == '' ? '' : strftime($datefmt, $posting['date']) ?>" onfocus="updateDate(this);" onblur="formatDate(this);" size="10" maxlength="10" />
- </td>
- <td class="ohide">
-<?php
-echo $overflow_begin;
-$a = ($posting['asset'] == '') ? -1 : $posting['asset'];
-if (!isset($assetWidgets[$a])) {
- $assetWidgets[$a] = Fima::buildAccountWidget('asset[]', $posting['asset'], 'onblur="updateAssetResult(this);"', false, false, array(array('type', FIMA_ACCOUNTTYPE_ASSET)), true);
-}
-echo $assetWidgets[$a];
-echo $overflow_end;
-?>
- <td class="ohide">
-<?php
-echo $overflow_begin;
-$a = ($posting['account'] == '') ? -1 : $posting['account'];
-if (!isset($accountWidgets[$a])) {
- $accountWidgets[$a] = Fima::buildAccountWidget('account[]', $posting['account'], 'onblur="updateEo(this);"', false, false, array(), true);
-}
-echo $accountWidgets[$a];
-echo $overflow_end;
-?>
- </td>
- <td class="ohide">
- <?php echo $overflow_begin ?><input name="desc[]" type="text" value="<?php echo $posting['desc'] ?>" size="50" maxlength="250" /><?php echo $overflow_end ?>
- </td>
- <td>
- <input name="amount[]" type="text" value="<?php echo $posting['posting_id'] === null ? '' : Fima::convertValueToAmount($posting['amount']) ?>" onfocus="updateAssetResult(this);" onblur="formatAmount(this); updateResult(); updateAssetResult(this);" size="12" maxlength="255" class="amount" />
- </td>
- <td align="center">
- <input name="eo[<?php echo $rowId-1 ?>]" type="hidden" value="0" />
- <input name="eo[<?php echo $rowId-1 ?>]" id="eo<?php echo $rowId-1 ?>" type="checkbox" value="1" <?php if ($posting['eo']) { echo ' checked="checked"'; } ?> />
- </td>
- </tr>
-<?php endforeach; ?>
- <tr class="postingInfo">
- <td colspan="4" class="rightAlign"><span id="infoasset"></span> <?php echo _("Result") ?>:</td>
- <td><span id="infoassetresult" class="positive postingResult"></span></div>
- <td></td>
- </tr>
- <tr class="postingInfo">
- <td colspan="4" class="rightAlign"><?php echo _("Current Result") ?>:</td>
- <td><span id="inforesult" class="positive postingResult"></span></div>
- <td></td>
- </tr>
+++ /dev/null
-<tr>
- <td class="text" colspan="6">
- <em><?php echo _("There are no appropriate postings.") ?></em>
- </td>
-</tr>
+++ /dev/null
-<?php if ($pageOb['mode'] != 'list'): ?>
-<input type="hidden" name="actionID" value="<?php echo $actionID ?>" />
-</form>
-<?php endif; ?>
-<br />
+++ /dev/null
-<div class="header">
- <div <?php if ($pageOb['page_count'] > 1) { echo 'style="width:40%" '; } ?> class="leftFloat">
- <span dir="ltr"><?php echo htmlspecialchars($title) ?></span>
-<?php if ($pageOb['mode'] == 'list'): ?>
- <?php echo Horde::link($pageOb['url'], _("Refresh List")) . Horde::img('reload.png', _("Refresh List")) ?> </a>
-<?php if (!isset($_SESSION['fima_search'])): ?>
- <?php echo Horde::link(Horde_Util::addParameter(Horde::url('search.php'), 'search_type', $prefs->getValue('active_postingtype')), _("Search Postings")) . Horde::img('search.png', _("Search")) ?></a>
-<?php else: ?>
- <?php echo Horde::link(Horde::url('search.php'), _("Edit Search Query")) . Horde::img('edit.png', _("Edit Search Query")) ?></a>
- <?php echo Horde::link(Horde_Util::addParameter($pageOb['url'], 'actionID', 'clear_search'), _("Clear Search Query")) . Horde::img('delete.png', _("Clear Search Query")) ?></a>
-<?php endif; ?>
-<?php endif; ?>
- </div>
-
-<?php if ($pageOb['mode'] == 'list'): ?>
-<?php if ($pageOb['page_count'] > 1): ?>
- <div style="width:20%" class="leftFloat">
- <?php printf(_("Page %d of %d"), $pageOb['page'], $pageOb['page_count']) ?>
- </div>
- <div style="width:40%" class="rightFloat rightAlign">
-<?php else: ?>
- <div class="rightFloat rightAlign">
-<?php endif; ?>
- <?php echo $pageOb['postings_count'] ?>
- </div>
-<?php endif; ?>
-
-<?php if ( $GLOBALS['browser']->isBrowser('msie') && $GLOBALS['browser']->getMajor() < 7): ?>
- <div class="clear" style="clear:none" /></div>
-<?php else: ?>
- <div class="clear"></div>
-<?php endif; ?>
-</div>
-
-<?php if ($pageOb['mode'] != 'list'): ?>
-<form method="post" name="postings" action="<?php echo $pageOb['url'] ?>">
-<?php Horde_Util::pformInput() ?>
-<?php endif; ?>
-
+++ /dev/null
-<script type="text/javascript">
-<!--
-
-function updateWday(field)
-{
-<?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
- wdays = new Array(
- '<?php echo addslashes(_("Sunday")) ?>',
- '<?php echo addslashes(_("Monday")) ?>',
- '<?php echo addslashes(_("Tuesday")) ?>',
- '<?php echo addslashes(_("Wednesday")) ?>',
- '<?php echo addslashes(_("Thursday")) ?>',
- '<?php echo addslashes(_("Friday")) ?>',
- '<?php echo addslashes(_("Saturday")) ?>'
- );
- spanObj = _get(field + '_wday');
- day = _get(field + '[day]').value;
- month = _get(field + '[month]').value - 1;
- year = _get(field + '[year]').value;
-
- date = new Date(year, month, day)
- spanObj.innerHTML = '(' + wdays[date.getDay()] + ')';
-<?php endif; ?>
-}
-
-function _get(id)
-{
- return document.getElementById ?
- document.getElementById(id) :
- eval('document.all.' + id);
-}
-
-function _getall(fieldname)
-{
- return document.getElementsByName ?
- document.getElementsByName(fieldname) :
- eval('document.all.' + fieldname);
-}
-
-var amountformat = '<?php echo addslashes($amountfmt) ?>';
-var hsign = amountformat.substr(0, 1);
-var comma = amountformat.substr(1, 1);
-
-function convertAmountToValue(amount)
-{
- hsignx = (hsign == '.') ? '\\.' : hsign;
- commax = (comma == '.') ? '\\.' : comma;
- if (hsign != '.' && comma != '.') {
- amount = amount.replace(/\./g, '');
- }
- amount = amount.replace(new RegExp(hsignx, 'g'), '');
- amount = amount.replace(new RegExp(commax, 'g'), '.');
-
- try {
- amounteval = eval(amount);
- amount = amounteval;
- } catch (e) {
- }
-
- val = parseFloat(amount);
- if (isNaN(val)) {
- return 0;
- }
-
- return val;
-}
-
-function convertValueToAmount(val)
-{
- val = val.toString();
- if (val.indexOf('.') == -1) {
- parts = new Array(val, '00');
- } else {
- parts = val.split('.');
- parts[1] += '00';
- }
-
- intpart = '';
- i = parts[0].length;
- while (i > 0) {
- if (i - 3 < 0) {
- d = i;
- i = 0;
- } else {
- d = 3;
- i = i - 3;
- }
- part = parts[0].substr(i, d);
- if (part == '-' || intpart == '') {
- intpart = part + intpart;
- } else {
- intpart = part + hsign + intpart;
- }
- }
- fracpart = parts[1].substr(0, 2);
-
- return intpart + comma + fracpart;
-}
-
-function formatAmount(field)
-{
- if (field.value != '') {
- val = convertAmountToValue(field.value);
- field.value = convertValueToAmount(val);
- }
-}
-
-
-
-var dateformat = '<?php echo addslashes($datefmt) ?>';
-var separator = dateformat.match(/[^%a-zA-Z]/);
-var datepos = new Array();
-
-function convertDateToStamp(datevalue)
-{
- if (separator == '') {
- return;
- }
-
- formatparts = dateformat.split(separator);
-
- datevalue = datevalue.replace(/[^0-9]/g, separator);
- dateparts = datevalue.split(separator);
-
- datepos = new Array();
- for (i = 0, j = 0, p = 0; i < formatparts.length; i++, j++) {
- if (formatparts[i] == '%Y') { d = 0;
- } else if (formatparts[i] == '%m') { d = 1;
- } else if (formatparts[i] == '%d') { d = 2;
- } else { continue; }
-
- datepos[d] = i;
-
- if (datevalue.indexOf(separator) == -1) {
- if (d == 0 && datevalue.length <= 4) {
- dateparts[i] = parseInt((new Date()).getFullYear(), 10);
- } else {
- dp = (d == 0 && datevalue.length > 6) ? 4 : 2;
- dateparts[i] = parseInt(datevalue.substr(p, dp), 10);
- p += dp;
- }
- } else if (d == 0 && dateparts.length < 3) {
- dateparts[i] = parseInt((new Date()).getFullYear(), 10);
- j--;
- } else if (dateparts[j]) {
- dateparts[i] = parseInt(dateparts[j], 10);
- } else {
- dateparts[i] = 1;
- }
- }
-
- if (dateparts[datepos[0]] < 70) {
- dateparts[datepos[0]] += 2000;
- } else if (dateparts[datepos[0]] < 100) {
- dateparts[datepos[0]] += 1900;
- }
-
- stamp = new Date(dateparts[datepos[0]], dateparts[datepos[1]] - 1, dateparts[datepos[2]]);
- return stamp;
-}
-
-function convertStampToDate(stamp)
-{
- dateparts = new Array();
- dateparts[datepos[0]] = stamp.getFullYear().toString();
- dateparts[datepos[1]] = (101 + stamp.getMonth()).toString().substr(1, 2);
- dateparts[datepos[2]] = (100 + stamp.getDate()).toString().substr(1, 2);
-
- return dateparts.join(separator);
-}
-
-function formatDate(field)
-{
- if (field.value == '') {
- return;
- }
-
- stamp = convertDateToStamp(field.value);
- field.value = convertStampToDate(stamp);
-}
-
-function updateDate(field)
-{
- if (field.value != '') {
- return;
- }
-
- if (field.value == '') {
- fields = _getall(field.name);
- for (i = 0; i < fields.length; i++) {
- if (fields[i] == field) {
- if (i > 0) {
- field.value = fields[i - 1].value;
- }
- break;
- }
- }
- }
- return;
-}
-
-function updateAccount(field)
-{
- if (!field.options) {
- return;
- }
-
- if (field.options[field.selectedIndex].value == '') {
- if (field.length == 2) {
- field.options[field.length - 1].selected = true;
- } else {
- fields = _getall(field.name);
- for (i = 0; i < fields.length; i++) {
- if (fields[i] == field) {
- if (i > 0) {
- field.selectedIndex = fields[i - 1].selectedIndex + (fields[i - 1].options[0].value == '' ? 0 : 1);
- }
- break;
- }
- }
- }
- }
-}
-
-function updateEo(field)
-{
- if (!field.options) {
- return;
- }
-
- eo = (field.options[field.selectedIndex].className.indexOf('eo') != -1);
- accountfields = _getall('account[]');
-
- for (i = 0; i < accountfields.length; i++) {
- if (accountfields[i] == field) {
- _get('eo' + i).checked = eo;
- break;
- }
- }
-}
-
-function updateResult()
-{
-<?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
- result = 0;
- amountfields = _getall('amount[]');
- accountfields = _getall('account[]');
- for (i = 0; i < amountfields.length; i++) {
- if (accountfields[i].options[accountfields[i].selectedIndex].className.indexOf('<?php echo FIMA_ACCOUNTTYPE_ASSET ?>') == -1) {
- result += convertAmountToValue(amountfields[i].value) * (<?php if (!$prefs->getValue('expenses_sign')) { ?>(accountfields[i].options[accountfields[i].selectedIndex].className.indexOf('<?php echo FIMA_ACCOUNTTYPE_EXPENSE ?>') != -1) ? -1 : <?php } ?>1);
- }
- }
-
- spanObj = _get('inforesult');
- spanObj.innerHTML = convertValueToAmount(result);
- spanObj.className = ((result >= 0) ? 'positive' : 'negative') + ' postingResult';
-<?php endif; ?>
-}
-
-var AssetIndex;
-var AssetResult;
-
-function updateAssetResult(field)
-{
-<?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
- amountfields = _getall('amount[]');
- assetfields = _getall('asset[]');
- accountfields = _getall('account[]');
-
- for (i = 0; i < amountfields.length; i++) {
- if (amountfields[i] == field || assetfields[i] == field) {
- break;
- }
- }
-
- asset = assetfields[i].options[assetfields[i].selectedIndex];
- if (asset.value == '') {
- assettext = '';
- result = 0;
- } else {
- assettext = asset.text;
- result = 0;
- for (i = 0; i < AssetIndex.length; i++) {
- if (AssetIndex[i] == asset.value) {
- ar = parseFloat(AssetResult[i]);
- if (!isNaN(ar)) {
- result += ar;
- }
- break;
- }
- }
- for (i = 0; i < amountfields.length; i++) {
- if (assetfields[i].options[assetfields[i].selectedIndex].value == asset.value) {
- result += convertAmountToValue(amountfields[i].value) * (<?php if (!$prefs->getValue('expenses_sign')) { ?>(accountfields[i].options[accountfields[i].selectedIndex].className.indexOf('<?php echo FIMA_ACCOUNTTYPE_EXPENSE ?>') != -1) ? -1 : <?php } ?>1);
- }
- if (accountfields[i].options[accountfields[i].selectedIndex].value == asset.value) {
- result -= convertAmountToValue(amountfields[i].value);
- }
- }
- }
-
- spanObj = _get('infoasset');
- spanObj.innerHTML = assettext;
-
- spanObj = _get('infoassetresult');
- spanObj.innerHTML = convertValueToAmount(result);
- spanObj.className = ((result >= 0) ? 'positive' : 'negative') + ' postingResult';
-<?php endif; ?>
-}
-
-function selectAccounts(field, type, active)
-{
- accounts = _get(field);
- for (i = 0; i < accounts.length; i++) {
- if (accounts.options[i].className.indexOf(type) != -1) {
- accounts.options[i].selected = active;
- }
- }
-}
-
-function autofillPostings() {
- datefields = _getall('date[]');
- assetfields = _getall('asset[]');
- accountfields = _getall('account[]');
- descfields = _getall('desc[]');
- amountfields = _getall('amount[]');
-
- for (j = 0; j < 12; j++) {
- if (!datefields[j]) {
- break;
- }
-
- if (j == 0) {
- year = convertDateToStamp(datefields[j].value).getFullYear().toString();
- } else {
- assetfields[j].selectedIndex = assetfields[j - 1].selectedIndex + (assetfields[j - 1].options[0].value == '' ? 0 : 1);
- accountfields[j].selectedIndex = accountfields[j - 1].selectedIndex + (accountfields[j - 1].options[0].value == '' ? 0 : 1);
- if (descfields[j].value == '') {
- descfields[j].value = descfields[j - 1].value;
- }
- if (amountfields[j].value == '') {
- amountfields[j].value = amountfields[j - 1].value;
- }
- }
- datefields[j].value = convertStampToDate(new Date(year, j, 1));
- }
-
- updateResult();
- updateAssetResult(assetfields[0]);
-}
-
-function Submit(action) {
- return true;
-}
-
-// -->
-</script>
+++ /dev/null
-<script type="text/javascript">
-<!--
-
-function AnySelected()
-{
- for (i = 0; i < document.postings.elements.length; i++) {
- if (document.postings.elements[i].checked) return true;
- }
- return false;
-}
-
-var rowColors = new Array();
-function selectRow(rowId)
-{
- rowOb = document.getElementById('row' + rowId);
- if (!rowOb) {
- return;
- }
-
- if (rowOb.className.indexOf('selectedRow') != -1) {
- rowOb.className = rowColors[rowId];
- } else {
- rowColors[rowId] = rowOb.className;
- rowOb.className = 'selectedRow';
- }
-}
-
-function getIndexByElement(elem)
-{
- for (var i = 0; i < elem.form.elements.length; i++) {
- if (elem == elem.form.elements[i]) return i;
- }
- return null;
-}
-
-function Submit(action)
-{
- if (!AnySelected() && action != 'transfer_postings') {
- window.alert('<?php echo addslashes(_("You must select at least one posting first.")) ?>');
- return;
- }
-
-<?php if ($prefs->getValue('delete_opt') == 1): ?>
- if (action == 'delete_postings') {
- if (!window.confirm('<?php echo addslashes(_("Are you sure you wish to PERMANENTLY delete these postings?")) ?>')) {
- return;
- }
- }
-<?php endif; ?>
- document.postings.actionID.value = action;
- document.postings.submit();
-}
-
-function makeSelection(whichForm)
-{
- switch (parseInt(whichForm)) {
- case -1:
- if (document.postings.checkAll.checked) {
- flag = "!0";
- } else {
- flag = "0";
- }
- break;
- case 1:
- flag = document.select1.filter.options[document.select1.filter.selectedIndex].value;
- break;
- default:
- flag = document.select2.filter.options[document.select2.filter.selectedIndex].value;
- }
-
- if (flag.substring(0, 1) == "!") {
- selectFlaged(flag.substring(1), false);
- } else if (flag.substring(0, 1) == "~") {
- selectFlaged(flag.substring(0,1), null);
- } else {
- selectFlaged(flag, true);
- }
-
- // Reset the form.
- switch (parseInt(whichForm)) {
- case -1:
- break;
-
- case 1:
- document.select1.reset();
- break;
-
- default:
- document.select2.reset();
- }
-}
-
-var startrange = -1;
-
-function selectRange(e)
-{
- var checkBox = (e.srcElement || e.target);
- var endrange = getIndexByElement(checkBox);
-
- if (startrange >= 0 && e.shiftKey) {
- if (document.postings.elements[startrange].checked == document.postings.elements[endrange].checked) {
- if (startrange > endrange) {
- var tmp = endrange;
- endrange = startrange;
- startrange = tmp;
- }
- for (var i = startrange + 1; i < endrange; i++) {
- document.postings.elements[i].checked = document.postings.elements[startrange].checked;
- selectRow(document.postings.elements[i].id.replace(/check/, ''));
- }
- }
- startrange = -1;
- } else {
- startrange = getIndexByElement(checkBox);
- }
-}
-
-function onClickHandler(e)
-{
- var e = e || window.event;
- var elem = (e.srcElement || e.target);
-
- // Range selection/deselection.
- if (elem.name == "indices[]") {
- selectRange(e);
- }
-}
-
-document.onclick = onClickHandler;
-
-var Flags;
-
-function selectFlaged(flag, val)
-{
- shift = 0;
- for (var i = 0; i < document.postings.elements.length; i++) {
- while (document.postings.elements[i].name != "indices[]") {
- i++;
- shift++;
- if (!document.postings.elements[i]) {
- return;
- }
- }
-
- if (document.postings.elements[i].disabled) {
- continue;
- }
-
- if (flag == '~') {
- check = !document.postings.elements[i].checked;
- } else if (flag & Flags[i - shift]) {
- check = val;
- } else {
- check = !val;
- }
-
- if (document.postings.elements[i].checked != check) {
- document.postings.elements[i].checked = check;
- selectRow(document.postings.elements[i].id.replace(/check/, ''));
- }
- }
-}
-
-//-->
-</script>
+++ /dev/null
-<script type="text/javascript">
-<!--
-
-function Submit(action) {
- return true;
-}
-
-// -->
-</script>
+++ /dev/null
-<script type="text/javascript">
-<!--
-
-function Submit(action) {
- if (document.postings.type_from.options[document.postings.type_from.selectedIndex].value == document.postings.type_to.options[document.postings.type_to.selectedIndex].value) {
- alert("<?php echo _("Please select another posting type where to transfer postings to.") ?>");
- return false;
- }
- return true;
-}
-
-// -->
-</script>
+++ /dev/null
-<?php foreach($postings as $postingId => $posting): ?>
-<?php $rowId++; ?>
- <tr id="row<?php echo $rowId ?>" class="<?php if (!$print_view) { echo ($posting['eo'] ? 'eo' : '') . $posting['account_type']; } ?>">
- <td><?php if (!$print_view) { ?><input id="check<?php echo $rowId ?>" type="checkbox" class="checkbox" name="indices[]" onclick="selectRow(<?php echo $rowId ?>);" value="<?php echo $postingId ?>"<?php if ($closedperiod >= $posting['date']) echo ' disabled="disabled"' ?> /><?php } echo Horde::img(($posting['eo'] ? 'eo' : '') . $posting['account_type'] . '.png', $posting['account_type_eo'], array('title' => $posting['account_type_eo'])) ?></td>
- <td class="ohide"><?php echo $overflow_begin, strftime($datefmt, $posting['date']), $overflow_end ?></td>
- <td class="ohide <?php echo $posting['asset_closed'] ? 'closed' : ''?>" title="<?php echo strlen($posting['asset_label']) > 25 ? $posting['asset_label'] : '' ?>"><?php echo $overflow_begin, $posting['asset_label'], $overflow_end ?></td>
- <td class="ohide <?php echo $posting['account_closed'] ? 'closed' : ''?>" title="<?php echo strlen($posting['account_label']) > 25 ? $posting['account_label'] : '' ?>"><?php echo $overflow_begin, $posting['account_label'], $overflow_end ?></td>
- <td class="ohide" title="<?php echo strlen($posting['desc']) > 25 ? $posting['desc'] : '' ?>"><?php echo $overflow_begin, $posting['desc'], $overflow_end ?></td>
- <td class="<?php echo ($posting['amount'] < 0) ? 'negative' : 'positive' ?> amount"><?php echo $overflow_begin, Fima::convertValueToAmount($posting['amount']), $overflow_end ?></td>
- </tr>
-<?php endforeach; ?>
- <tr class="postingInfo">
- <td colspan="5" class="rightAlign"><?php echo _("Total Result") ?>:</td>
- <td class="<?php echo (Fima::getPostingsResult() < 0) ? 'negative' : 'positive' ?> amount"><?php echo Fima::convertValueToAmount(Fima::getPostingsResult()) ?></td>
- </tr>
+++ /dev/null
-<?php if ($pageOb['mode'] != 'list') { return; } ?>
-<table width="100%" cellspacing="0">
- <tr class="mboxcontrol">
- <td>
- <div class="leftFloat">
- <form name="select<?php echo $form ?>" action="javascript:void(0)" onsubmit="return false">
- <select name="filter" onchange="makeSelection(<?php echo $form ?>);">
- <option value="" selected="selected"><?php echo _("Select") ?>:</option>
- <option value="!0"><?php echo _("All") ?></option>
- <option value="0"><?php echo _("None") ?></option>
- <option value="~0"><?php echo _("Invert") ?></option>
-<?php $flagpos = 0; ?>
-<?php foreach ($accounttypes as $typeId => $typeLabel): ?>
- <option value="<?php echo pow(2, $flagpos) ?>"><?php echo $typeLabel ?></option>
- <option value="!<?php echo pow(2, $flagpos++) ?>"><?php echo sprintf(_("Not %s"), $typeLabel) ?></option>
-<?php endforeach; ?>
- </select>
- </form>
- </div>
-
- <div class="rightFloat">
-<?php if ($pageOb['page_count'] > 1): ?>
- <form method="get" name="pagenav" action="<?php echo Horde::url('postings.php') ?>">
- <?php Horde_Util::pformInput() ?>
- <?php echo $pageOb['pages_first'] . ' ' . $pageOb['pages_prev'] ?>
- <input type="text" name="page" value="<?php echo htmlspecialchars($pageOb['page']) ?>" size="<?php echo Horde_String::length($pageOb['page_count']) ?>" />
- <?php echo $pageOb['pages_next'] . ' ' . $pageOb['pages_last'] ?>
- </form>
-<?php endif; ?>
- </div>
- </td>
- </tr>
-</table>
+++ /dev/null
-</table>
-<?php if ($pageOb['mode'] == 'list'): ?>
-<input type="hidden" name="page" value="<?php echo $pageOb['page'] ?>" />
-<input type="hidden" name="actionID" value="" />
-</form>
-
-<script type="text/javascript">
-<!--
-
-Flags = new Array(<?php
-if (isset($flags) && is_array($flags)) {
- for ($i = 0; $i < count($flags); $i++) {
- if ($i > 0) {
- echo ', ';
- }
- echo '"' . $flags[$i] . '"';
- }
-}
-?>);
-
-//-->
-</script>
-<?php elseif($pageOb['mode'] == 'edit'): ?>
-<script type="text/javascript">
-<!--
-
-<?php
-$assetindex = '';
-$assetresult = '';
-if (isset($assetresults) && is_array($assetresults)) {
- $now = mktime();
- $currentassets = array();
- foreach ($postings as $postingId => $posting) {
- if ($posting['asset'] && $posting['date'] <= $now) {
- $currentassets[$posting['asset']] = $posting['amount'];
- }
- }
- foreach ($assetresults as $key => $asset) {
- if (isset($currentassets[$asset['account_id']])) {
- $asset['account_result'] -= $currentassets[$asset['account_id']];
- }
- if ($key > 0) {
- $assetindex .= ', ';
- $assetresult .= ', ';
- }
- $assetindex .= '"' . $asset['account_id'] . '"';
- $assetresult .= '"' . (float)$asset['account_result'] . '"';
- }
-}
-?>
-AssetIndex = new Array(<?php echo $assetindex ?>);
-AssetResult = new Array(<?php echo $assetresult ?>);
-
-//-->
-</script>
-<?php endif; ?>
+++ /dev/null
-<?php if ($pageOb['mode'] == 'shift' || $pageOb['mode'] == 'transfer'): ?>
-<tr class="control"><td colspan="6">
-<table cellspacing="0" width="100%" class="linedRow">
-<?php return; endif; ?>
-<?php
-if (!isset($headers_inc_count)) {
- $headers_inc_count = 0;
-} else {
- $headers_inc_count++;
-}
-$sortImg = ($sortdir) ? 'za.png' : 'az.png';
-$sortText = ($sortdir) ? '\/' : '/\\';
-$headers = array(
- FIMA_SORT_DATE => array(
- 'stext' => _("Sort by Date"),
- 'text' => _("Da_te"),
- 'width' => '90'
- ),
- FIMA_SORT_ASSET => array(
- 'stext' => _("Sort by Asset Account"),
- 'text' => _("A_sset Account"),
- 'width' => '33%'
- ),
- FIMA_SORT_ACCOUNT => array(
- 'stext' => _("Sort by Posting Account"),
- 'text' => _("Posting A_ccount"),
- 'width' => '33%'
- ),
- FIMA_SORT_DESC => array(
- 'stext' => _("Sort by Description"),
- 'text' => _("Descriptio_n"),
- 'width' => '33%'
- ),
- FIMA_SORT_AMOUNT => array(
- 'stext' => _("Sort by Amount"),
- 'text' => _("Amo_unt"),
- 'width' => '100'
- )
-);
-
-if ($pageOb['mode'] == 'edit') {
- $headers[] = array(
- 'text' => _("e.o."),
- 'width' => '25'
- );
-}
-
-?>
-<?php if ($pageOb['mode'] == 'list'): ?>
-<form method="post" name="postings" action="<?php echo $pageOb['url'] ?>">
-<?php Horde_Util::pformInput() ?>
-<?php endif; ?>
-<table class="postingList" width="100%" cellspacing="0">
- <tr class="item">
-<?php if ($pageOb['mode'] == 'list'): ?>
-<?php if (!$headers_inc_count): ?>
- <th id="checkheader" width="35" onclick="document.messages.checkAll.checked = !document.messages.checkAll.checked; makeSelection(-1);">
-<?php if (!$print_view): ?>
- <label for="checkAll" class="hidden">_("Check _All/None")</label>
- <input type="checkbox" class="checkbox" id="checkAll" name="checkAll" onclick="makeSelection(-1);" <?php echo Horde::getAccessKeyAndTitle(_("Check _All/None")) ?> />
-<?php endif; ?>
- </th>
-<?php else: ?>
- <th> </th>
-<?php endif; ?>
-<?php endif; ?>
-
-<?php foreach ($headers as $key => $val): ?>
-<?php if ($pageOb['mode'] == 'list'): ?>
- <th class="<?php echo ($sortby == $key) ? 'selected' : 'item' ?>" width="<?php echo $val['width'] ?>" onclick="document.location.href='<?php echo addslashes(Horde_Util::addParameter(($sortby == $key) ? $sorturl : $pageOb['url'], array('sortby' => $key, 'actionID' => 'change_sort'))) ?>';">
- <?php if ($sortby == $key): ?>
- <?php echo Horde::link(Horde_Util::addParameter($sorturl, array('sortby' => $key, 'actionID' => 'change_sort')), $val['stext'], null, null, null, $val['stext']) . Horde::img($sortImg, $sortText) ?></a>
- <?php endif; ?>
- <?php echo Horde::widget(Horde_Util::addParameter(($sortby == $key) ? $sorturl : $pageOb['url'], array('sortby' => $key, 'actionID' => 'change_sort')), $val['stext'], 'widget', null, null, $val['text']) ?>
-<?php else: ?>
- <th class="item" width="<?php echo $val['width'] ?>">
- <?php echo str_replace('_', '', $val['text']) ?>
-<?php endif; ?>
-<?php if (isset($val['extra'])) echo $val['extra']; ?>
- </th>
-<?php endforeach; ?>
- </tr>
+++ /dev/null
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo _("Shifting") ?> </strong>
- </td>
- <td width="100%"><?php echo sprintf(_("%d selected Postings"), count($postings)) ?>
-<?php foreach($postings as $postingId => $posting): ?>
- <input name="posting_id[]" type="hidden" value="<?php echo $posting['posting_id'] ?>" />
-<?php endforeach; ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('type', _("Posting T_ype")) ?></strong>
- </td>
- <td width="100%">
- <?php echo Fima::buildPostingTypeWidget('type', null, '', _("don't change"), false) ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('asset', _("A_sset Account")) ?></strong>
- </td>
- <td width="100%">
- <?php echo Fima::buildAccountWidget('asset', null, '', _("don't change"), false, array(array('type', FIMA_ACCOUNTTYPE_ASSET))) ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('account', _("Posting A_ccount")) ?></strong>
- </td>
- <td width="100%">
- <?php echo Fima::buildAccountWidget('account', null, '', _("don't change")) ?>
- </td>
- </tr>
+++ /dev/null
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('type_from', _("Transfer from")) ?></strong>
- </td>
- <td width="100%">
- <?php echo Fima::buildPostingTypeWidget('type_from', $prefs->getValue('active_postingtype'), ''); ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('period_from', _("Period from")) ?></strong>
- </td>
- <td width="100%">
- <?php echo Fima::buildDateWidget('period_from', 0, null, _("All"), true) ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('keep', _("_Keep original Postings")) ?></strong>
- </td>
- <td width="100%">
- <input name="keep" type="hidden" value="0" />
- <input name="keep" type="checkbox" value="1" id="keep" checked="checked" />
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap" valign="top">
- <strong><?php echo Horde::label('summarize', _("_Summarize Accounts")) ?></strong>
- </td>
- <td valign="top" width="100%">
- <input id="summarize_none" name="summarize" type="radio" value="none" checked="checked" />
- <?php echo Horde::label('summarize_none', _("Don't summarize.")) ?><br />
- <input id="summarize_combine" name="summarize" type="radio" value="combine" />
- <?php echo Horde::label('summarize_combine', _("Summarize by combining.")) ?><br />
- <input id="summarize_post" name="summarize" type="radio" value="post" />
- <?php echo Horde::label('summarize_post', _("Summarize by posting against")) ?><br />
- <?php echo Fima::buildAccountWidget('summarize_post_account', null, 'onchange="document.postings.summarize[2].checked = true;"', false, false, array(array('type', FIMA_ACCOUNTTYPE_ASSET))) ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('type_to', _("Transfer to")) ?></strong>
- </td>
- <td width="100%">
- <?php echo Fima::buildPostingTypeWidget('type_to', null); ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('period_to', _("Period to")) ?></strong>
- </td>
- <td width="100%">
- <?php echo Fima::buildDateWidget('period_to', 0, null, _("All"), true) ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('delete', _("_Delete existing Postings")) ?></strong>
- </td>
- <td width="100%">
- <input name="delete" type="hidden" value="0" />
- <input name="delete" type="checkbox" value="1" />
- </td>
- </tr>
+++ /dev/null
-<br />
-<p><?php echo _("No data for this report.") ?></p>
+++ /dev/null
-<br />
-<p><img class="reportImage" src="<?php echo Horde_Util::addParameter($report->getParam('url'), 'out', '1') ?>" alt="<?php echo _("Report") ?>" title="<?php echo htmlspecialchars($title) ?>" /></p>
-<?php /*<--<p><iframe src="<?php echo Horde_Util::addParameter($report->getParam('url'), 'out', '1') ?>" /></iframe></p>-->*/ ?>
+++ /dev/null
-<?php
-if (!isset($report)) {
-return;
-}
-
-$report->getGraph();
+++ /dev/null
-<form method="post" name="report" action="report.php">
-<?php Horde_Util::pformInput() ?>
-<input type="hidden" name="actionID" value="open_report" />
-<input type="hidden" name="sortby" value="<?php echo $params['sortby'] ?>" />
-<input type="hidden" name="sortdir" value="<?php echo $params['sortdir'] ?>" />
-
-<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
-
-<table cellspacing="0" width="100%" class="linedRow">
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('report_id', _("Repor_t")) ?></strong>
- </td>
- <td width="100%" colspan="4">
- <select name="report_id" id="report_id">
-<?php foreach($_reports as $reportId => $reportLabel): ?>
- <option value="<?php echo $reportId ?>" <?php if ($reportId == $params['report_id']) { echo 'selected="selected"'; } ?>><?php echo $reportLabel; ?></option>
-<?php endforeach; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('type', _("_Display")) ?></strong>
- </td>
- <td>
- <select name="display" id="display">
-<?php foreach($displays as $displayId => $displayLabel): ?>
- <option value="<?php echo $displayId ?>" <?php if ($displayId == $params['display']) { echo 'selected="selected"'; } ?>><?php echo $displayLabel; ?></option>
-<?php endforeach; ?>
- </select>
- </td>
- <td class="rightAlign nowrap" rowspan="4" valign="top">
- <strong><?php echo Horde::label('posting_account[]', _("Accounts")) ?></strong>
- </td>
- <td class="nowrap" rowspan="4">
- <?php echo Fima::buildAccountWidget('posting_account[]', $params['posting_account'], '', false, true, array(array('type', FIMA_ACCOUNTTYPE_ASSET, '<>'))) ?>
- </td>
- <td width="100%" rowspan="4" valign="top">
-<?php if($browser->hasFeature('javascript')): ?>
-<?php
-$types = Fima::getAccountTypes();
-foreach($types as $typeId => $typeLabel):
- if ($typeId == FIMA_ACCOUNTTYPE_ASSET) {
- continue;
- }
-?>
- <input name="account_type_<?php echo $typeId ?>" id="account_type_<?php echo $typeId ?>" onclick="selectAccounts('posting_account[]', '<?php echo $typeId ?>', this.checked)" type="checkbox" value="1" /> <?php echo Horde::img($typeId . '.png', $typeLabel) ?> <?php echo $typeLabel ?><br />
-<?php endforeach; ?>
-<?php endif; ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('period_start', _("P_eriod")) ?></strong>
- </td>
- <td class="nowrap">
- <?php echo Fima::buildDateWidget('period_start', $params['period_start'], null, false, true) ?>
- -  
- <?php echo Fima::buildDateWidget('period_end', $params['period_end'], null, false, true) ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('reference_start', _("Re_ference")) ?></strong>
- </td>
- <td class="nowrap">
- <?php echo Fima::buildDateWidget('reference_start', $params['reference_start'], null, false, true) ?>
- -  
- <?php echo Fima::buildDateWidget('reference_end', $params['reference_end'], null, false, true) ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo _("Other") ?></strong>
- </td>
- <td class="nowrap">
- <input name="cumulate" type="hidden" value="0" />
- <input name="cumulate" type="checkbox" value="1" id="cumulate" <?php if ($params['cumulate']) { echo 'checked="checked"'; } ?>/>
- <?php echo Horde::label('cumulate', _("C_umulate")) ?>
-
- <input name="subaccounts" type="hidden" value="0" />
- <input name="subaccounts" type="checkbox" value="1" id="subaccounts" <?php if ($params['subaccounts']) { echo 'checked="checked"'; } ?>/>
- <?php echo Horde::label('subaccounts', _("_Subaccounts")) ?>
-
- <input name="nullrows" type="hidden" value="0" />
- <input name="nullrows" type="checkbox" value="1" id="nullrows" <?php if ($params['nullrows']) { echo 'checked="checked"'; } ?>/>
- <?php echo Horde::label('nullrows', _("_Null Rows")) ?>
-
- <input name="yearly" type="hidden" value="0" />
- <input name="yearly" type="checkbox" value="1" id="yearly" <?php if ($params['yearly']) { echo 'checked="checked"'; } ?>/>
- <?php echo Horde::label('yearly', _("_Yearly")) ?>
-<?php if ($graphs): ?>
-
- <input name="graph" type="hidden" value="0" />
- <input name="graph" type="checkbox" value="1" id="graph" <?php if ($params['graph']) { echo 'checked="checked"'; } ?>/>
- <?php echo Horde::label('graph', _("_Chart")) ?>
-<?php endif; ?>
- </td>
- </tr>
-</table>
-<br />
-
-<input type="submit" class="button" value="<?php echo _("Open Report") ?>" />
-<input type="submit" class="button" value="<?php echo _("Reset") ?>" onclick="document.report.actionID.value='clear_report';" />
-
-</form>
+++ /dev/null
-<?php
-if (!isset($report)) {
-return;
-}
-
-$data = $report->getData();
-
-$reporturl = $report->getParam('url');
-$sortby = $report->getParam('sortby');
-$sortdir = $report->getParam('sortdir');
-$sorturl = Horde_Util::addParameter($reporturl, 'sortdir', ($sortdir) ? 0 : 1);
-$sortImg = ($sortdir) ? 'za.png' : 'az.png';
-$sortImgText = ($sortdir) ? '\/' : '/\\';
-
-?>
-<br />
-<table class="reportTable" cellspacing="0">
-<?php
-foreach ($data as $rowId => $row) {
- echo '<tr class="' . (preg_match('/__result(.*)?__/', $rowId) ? 'result' : 'item') . '">';
- foreach ($row as $colId => $value) {
- if ($rowId === '__headersort__') {
- $sortText = sprintf(_("Sort by %s"), $value);
- echo '<th class="' . (($sortby == $colId) ? 'selected' : 'item') . ' sortable" onclick="document.location.href=' . addslashes(Horde_Util::addParameter(($sortby == $colId) ? $sorturl : $reporturl, 'sortby', $colId)) . '">';
- if ($sortby == $colId) {
- echo Horde::link(Horde_Util::addParameter($sorturl, 'sortby', $colId), $sortText, null, null, null, $sortText) . Horde::img($sortImg, $sortImgText) . '</a>';
- }
- echo Horde::widget(Horde_Util::addParameter(($sortby == $colId) ? $sorturl : $reporturl, 'sortby', $colId), $sortText, 'widget', null, null, $value);
- echo '</th>';
- } elseif ($rowId === '__header__') {
- echo '<th class="item">' . htmlspecialchars($value) . '</th>';
- } elseif ($colId === '__header__') {
- echo '<td>' . ($value{0} === ' ' ? ' ' : '') . htmlspecialchars($value) . '</td>';
- } elseif ($value === null) {
- echo '<td></td>';
- } else {
- echo '<td class="' . (($value < 0) ? 'negative' : 'positive') . ' amount">' . Fima::convertValueToAmount($value) . '</td>';
- }
- }
- echo "</tr>\n";
-}
-?>
-</table>
-
+++ /dev/null
-<form method="post" name="search" action="postings.php">
-<?php Horde_Util::pformInput() ?>
-<input type="hidden" name="actionID" value="search_postings" />
-
-<div class="header">
-<?php echo htmlspecialchars($title) ?>
-<?php if (isset($_SESSION['fima_search'])): ?>
-<?php echo Horde::link(Horde_Util::addParameter(Horde::url('search.php'), 'actionID', 'clear_search'), _("Clear Search Query")) . Horde::img('delete.png', _("Clear Search Query")) ?></a>
-<?php endif; ?>
-</div>
-
-<table cellspacing="0" width="100%" class="linedRow">
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('search_type', _("Search Posting T_ype")) ?></strong>
- </td>
- <td width="100%" colspan="2">
- <select name="search_type" id="search_type">
-<?php foreach($types as $typeId => $typeLabel): ?>
- <option value="<?php echo $typeId ?>" <?php if ($typeId == $search['type']) { echo 'selected="selected"'; } ?>><?php echo $typeLabel; ?></option>
-<?php endforeach; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap" valign="top">
- <strong><?php echo Horde::label('search_date_start', _("Search _Date Start")) ?></strong>
- </td>
- <td class="nowrap" width="20%">
- <?php echo Fima::buildDateWidget('search_date_start', $search['date_start']) ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap" valign="top">
- <strong><?php echo Horde::label('search_date_end', _("Search Dat_e End")) ?></strong>
- </td>
- <td class="nowrap" width="20%">
- <?php echo Fima::buildDateWidget('search_date_end', $search['date_end']) ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap" valign="top">
- <strong><?php echo Horde::label('search_asset[]', _("Search A_sset Accounts")) ?></strong>
- </td>
- <td width="100%" colspan="2" valign="top">
- <?php echo Fima::buildAccountWidget('search_asset[]', $search['asset'], '', false, true, array(array('type', FIMA_ACCOUNTTYPE_ASSET))) ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap" valign="top">
- <strong><?php echo Horde::label('search_account[]', _("Search Posting A_ccounts")) ?></strong>
- </td>
- <td width="20%" valign="top">
- <?php echo Fima::buildAccountWidget('search_account[]', $search['account'], '', false, true) ?>
- </td>
- <td valign="top">
-<?php if($browser->hasFeature('javascript')): ?>
-<?php
-$types = Fima::getAccountTypes();
-foreach($types as $typeId => $typeLabel):
-?>
- <input name="account_type_<?php echo $typeId ?>" id="account_type_<?php echo $typeId ?>" onclick="selectAccounts('search_account[]', '<?php echo $typeId ?>', this.checked)" type="checkbox" value="1" /> <?php echo Horde::img($typeId . '.png', $typeLabel) ?> <?php echo $typeLabel ?><br />
-<?php endforeach; ?>
-<?php endif; ?>
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('search_desc', _("Search Descriptio_n")) ?></strong>
- </td>
- <td width="100%" colspan="2">
- <input name="search_desc" id="search_desc" type="text" value="<?php echo $search['desc'] ?>" size="50" maxlength="250" />
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('search_amount_start', _("Search Amo_unt Start")) ?></strong>
- </td>
- <td width="100%" colspan="2">
- <input name="search_amount_start" id="search_amount_start" type="text" value="<?php echo $search['amount_start'] ?>" onblur="formatAmount(this);" size="15" maxlength="15" class="amount" />
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('search_amount_end', _("Search Amoun_t End")) ?></strong>
- </td>
- <td width="100%" colspan="2">
- <input name="search_amount_end" id="search_amount_end" type="text" value="<?php echo $search['amount_end'] ?>" onblur="formatAmount(this);" size="15" maxlength="15" class="amount" />
- </td>
- </tr>
- <tr>
- <td class="rightAlign nowrap">
- <strong><?php echo Horde::label('search_eo', _("Search e.o. Postin_gs")) ?></strong>
- </td>
- <td width="100%" colspan="2">
- <select name="search_eo" id="search_eo">
-<?php foreach($eos as $eoId => $eoLabel): ?>
- <option value="<?php echo $eoId ?>" <?php if ($eoId == $search['eo']) { echo 'selected="selected"'; } ?>><?php echo $eoLabel; ?></option>
-<?php endforeach; ?>
- </select>
- </td>
- </tr>
-</table>
-<br />
-
-<input type="submit" class="button" value="<?php echo _("Search") ?>" />
-<input type="reset" class="button" value="<?php echo _("Clear Form") ?>" />
-
-</form>
+++ /dev/null
-<?php
-
-$graphsize = explode('x', $GLOBALS['prefs']->getValue('report_graphsize'));
-
-$style = array('width' => $graphsize[0],
- 'height' => $graphsize[1],
-
- 'font-family' => 'Verdana',
- 'font-size' => '8',
- 'font-color' => '#000000',
- 'header-size' => '14',
- 'subheader-size' => '11',
-
- 'line' => '#888888',
- 'grid' => '#eeeeee',
-
- 'color0' => '#ffff99',
- 'color1' => '#ccffcc',
- 'color2' => '#99ccff',
- 'color3' => '#ffcc99',
- 'color4' => '#ff99cc',
- 'color5' => '#ccffff',
- 'color6' => '#cc99ff',
- 'color7' => '#ffffcc',
- 'color8' => '#00ff00',
- 'color9' => '#3366ff',
- 'color10' => '#ffcc00',
- 'color11' => '#ff00ff',
- 'color12' => '#00ffff',
- 'color13' => '#993366',
- 'color14' => '#99cc00',
- 'color15' => '#339966',
- 'color16' => '#333399',
- 'color17' => '#ff6600',
- 'color18' => '#ff0000',
- 'color19' => '#33cccc',
- 'color20' => '#800080',
- 'color21' => '#808000',
- 'color22' => '#008000',
- 'color23' => '#000080',
- 'color24' => '#993300',
- 'color25' => '#800000',
- 'color26' => '#008080',
- 'color27' => '#666699',
- 'color28' => '#c0c0c0',
- 'color29' => '#808080',
- 'color30' => '#333333',
-
- 'asset' => '#f3f3f3',
- 'income0' => '#ccffcc',
- 'income1' => '#99ee99',
- 'incometotal' => '#33cc33',
- 'expense0' => '#ffcccc',
- 'expense1' => '#ffaaaa',
- 'expensetotal' => '#ff6666',
-
- 'actual' => '#ffe448', // yellow
- 'forecast' => '#4f8bc6', // blue
- 'budget' => '#ee8800', // orange
- 'reference' => '#db5ffd', // purple
-
- 'difference' => '#cccccc', // grey
- '%' => '#999999', // light grey
-
- '__resulttotal__' => '#888888',
- '__rest__' => '#888888',
- '__rest1__' => '#888888',
- '__blank__' => '#ffffff',
- );
+++ /dev/null
-/* Align styles, added for BC. */
-.leftAlign {
- text-align: left;
-}
-.rightAlign {
- text-align: right;
-}
-.leftFloat {
- float: left;
-}
-.rightFloat {
- float: right;
-}
-
-/* Added for BC. */
-.hidden {
- display: none;
-}
-
-.radio {
- border: 0;
- height: 14px;
- width: 14px;
- background: transparent;
-}
-
-/* Menu bottom margin, added for BC. */
-#menu {
- margin-bottom: 8px;
-}
-
-/* Image alignment, added for BC. */
-img {
- vertical-align: middle;
-}
-
-/* Table CSS, added for BC. */
-th {
- color: #333;
- font-size: 90%;
- border-bottom: 1px solid #999;
-}
-
-/* Sort arrow styles, added for BC. */
-.sortup {
- background: #bbcbff url("graphics/za.png") center left no-repeat;
- padding-left: 10px;
-}
-.sortdown {
- background: #bbcbff url("graphics/az.png") center left no-repeat;
- padding-left: 10px;
-}
-
-/* Account list styles. */
-#t_account_tree {
- font-color: inherit;
- background-color: #fff;
-}
-
-/* Message list table styles. */
-.postingList {
- table-layout: fixed;
- width: 100%;
- border-collapse: collapse;
-}
-.postingList tr {
- height: 20px;
-}
-.postingList th {
- text-align: left;
- cursor: pointer;
- white-space: nowrap;
- border: 1px solid #eee;
-}
-.postingList td {
- padding-top: 0;
- padding-bottom: 0;
- text-indent: 1px;
- white-space: nowrap;
- border: 1px solid #ddd;
- vertical-align: middle;
-}
-.postingList td.ohide {
- text-overflow: ellipsis;
- overflow: hidden;
-}
-.postingList img {
- vertical-align: middle;
-}
-
-/* Report table styles. */
-.reportTable {
-}
-
-.reportTable tr {
- height: 20px;
- color: inherit;
- background-color: #fff;
-}
-.reportTable th {
- padding: 0 5px 0 5px;
- text-align: left;
- white-space: nowrap;
- border: 1px solid #eee;
-}
-.reportTable th.sortable {
- cursor: pointer;
-}
-.reportTable td {
- padding: 0 5px 0 5px;
- text-indent: 1px;
- white-space: nowrap;
- border: 1px solid #ddd;
- border-top: 0px none #000;
- border-right: 0px none #000;
- vertical-align: middle;
- border-collapse: collapse;
-}
-.reportTable tr.result {
- color: inherit;
- background-color: #eee;
- /*font-weight: bold;*/
-}
-
-/* Style for div that fixes KHTML browsers. */
-.ohide {
- overflow: hidden;
-}
-
-/* Navbar action styling. */
-ul.msgactions, ul.msgactions ul {
- list-style: none;
-}
-.msgactions li {
- float: left;
- padding: 1px 3px;
- border-right: 1px solid #888;
- position: relative;
-}
-.msgactions li.lastnavbar {
- border-right: 0;
-}
-.msgactions li a {
- font-size: 90%;
- white-space: nowrap;
-}
-.msgactions li ul {
- display: none;
- position: absolute;
- left: -1px;
- margin-top: -2px;
- padding: 2px;
- background: #f4f4f4;
- border: 1px solid #d4d4d4;
- z-index: 99;
-}
-.bottomborder .msgactions li ul {
- top: 1.25em;
-}
-.topborder .msgactions li ul {
- bottom: 1.25em;
-}
-.msgactions li ul a:hover, .msgactions li ul a:active {
- background: gray;
- color: #fff;
-}
-.msgactions li:hover ul, .msgactions li.hover ul {
- display: block;
-}
-.mboxcontrol {
- color: #000;
- background: #ccc;
-}
-.bottomborder {
- border-bottom: 1px solid #999;
-}
-.bottombordercollapse {
- border-bottom: 2px solid #999;
-}
-.topborder {
- border-top: 1px solid #999;
-}
-#msgheaders {
- clear: left;
-}
-
-/* Posting styles. */
-.postingInfo {
- color: inherit;
- background-color: #eee;
- /*font-weight: bold;*/
-}
-span.postingResult {
- display: block;
- width: 90px;
- text-align: right;
- white-space: nowrap;
-}
-.posting {
- background: #fff;
-}
-.asset {
- background: #fff;
-}
-tr.asset:hover, .asset-over {
- background: #f3f3f3;
-}
-.eoasset {
- background: #cfcfcf;
-}
-tr.eoasset:hover, .eoasset-over {
- background: #afafaf;
-}
-.income {
- background: #fff;
-}
-tr.income:hover, .income-over {
- background: #f3f3f3;
-}
-.expense {
- background: #fff;
-}
-tr.expense:hover, .expense-over {
- background: #f3f3f3;
-}
-.eoincome {
- background: #cfc;
-}
-tr.eoincome:hover, .eoincome-over {
- background: #9e9;
-}
-.eoexpense {
- background: #fcc;
-}
-tr.eoexpense:hover, .eoexpense-over {
- background: #faa;
-}
-.closed {
- color: #8f8f8f; background-color: inherit;
-}
-.amount {
- text-align: right;
-}
-.positive {
- color: #000; background-color: inherit;
-}
-.negative {
- color: #e00; background-color: inherit;
-}
-
-/* Tables. */
-table#ledger-list {
- width: 99%;
- margin: 0 0 8px 5px;
- border-top: 1px solid #ddd;
- border-left: 1px solid #ddd;
-}
-table#ledger-list th {
- padding: 3px;
- background: #e9e9e9;
- border-right: 1px solid #ccc;
- text-align: left;
-}
-table#ledger-list td {
- padding: 3px;
- border-right: 1px solid #ddd;
- border-bottom: 1px solid #ddd;
-}
-table#ledger-list th.sortup {
- background: #bbcbff url("graphics/za.png") center left no-repeat;
- padding-left: 10px;
-}
-table#ledger-list th.sortdown {
- background: #bbcbff url("graphics/az.png") center left no-repeat;
- padding-left: 10px;
-}
-
-#ledger-list-buttons {
- padding: 1em;
-}
-#ledger-list-buttons form {
- display: inline;
-}
-.ledger-list-icon {
- width: 1%;
-}
-
-.ledger-info {
- cursor: pointer;
-}
-
+++ /dev/null
-<?php
-
-$horde_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-$v = new Horde_View(array('templatePath' => dirname(__FILE__) . '/garland'));
-new Horde_View_Helper_Block($v);
-
-$v->left = array(array('flexdemo', 'block1'),
- array('flexdemo', 'block2'));
-$v->app = array('list');
-
-echo $v->render('secondary.html.php');
+++ /dev/null
-<?php
-foreach ($this->app as $tpl) {
- echo $this->render($tpl . '.html.php');
-}
+++ /dev/null
-/* $Id: defaults-rtl.css,v 1.3 2007/11/27 12:09:26 goba Exp $ */\r
-\r
-th {\r
- text-align: right;\r
- padding-right: 0;\r
- padding-left: 1em;\r
-}\r
+++ /dev/null
-/* $Id: defaults.css,v 1.5 2007/10/02 12:10:40 dries Exp $ */\r
-\r
-/*\r
-** HTML elements\r
-*/\r
-fieldset {\r
- margin-bottom: 1em;\r
- padding: .5em;\r
-}\r
-form {\r
- margin: 0;\r
- padding: 0;\r
-}\r
-hr {\r
- height: 1px;\r
- border: 1px solid gray;\r
-}\r
-img {\r
- border: 0;\r
-}\r
-table {\r
- border-collapse: collapse;\r
-}\r
-th {\r
- text-align: left; /* LTR */\r
- padding-right: 1em; /* LTR */\r
- border-bottom: 3px solid #ccc;\r
-}\r
-\r
-/*\r
-** Markup free clearing\r
-** Details: http://www.positioniseverything.net/easyclearing.html\r
-*/\r
-.clear-block:after {\r
- content: ".";\r
- display: block;\r
- height: 0;\r
- clear: both;\r
- visibility: hidden;\r
-}\r
-\r
-.clear-block {\r
- display: inline-block;\r
-}\r
-\r
-/* Hides from IE-mac \*/\r
-* html .clear-block {\r
- height: 1%;\r
-}\r
-.clear-block {\r
- display: block;\r
-}\r
-/* End hide from IE-mac */\r
+++ /dev/null
-/* $Id: fix-ie-rtl.css,v 1.2 2007/11/09 22:14:41 goba Exp $ */\r
-\r
-body {\r
- /* Center layout */\r
- text-align: center;\r
- /* Allow text resizing */\r
- font-size: 80%;\r
-}\r
-\r
-#squeeze {\r
- zoom: 1;\r
- direction: ltr;\r
-}\r
-\r
-#squeeze .left-corner{\r
- direction: rtl\r
-}\r
-\r
-#header-region, #wrapper #container {\r
- /* Reset text alignment */\r
- text-align: right;\r
-}\r
-\r
-#wrapper #container #center {\r
- /* Reduce amount of damage done by extremely wide content */\r
- overflow: hidden;\r
-}\r
-\r
-#wrapper #container #center .right-corner .left-corner {\r
- /* Because of the lack of min-height, we use height as an alternative */\r
- height: 400px;\r
-}\r
-\r
-fieldset {\r
- /* Don't draw backgrounds on fieldsets in IE, as they look really bad. */\r
- background: none;\r
-}\r
-\r
-/* Prevent fieldsets from shifting when changing collapsed state. */\r
-html.js fieldset.collapsible {\r
- position: relative;\r
- top: -1em;\r
-}\r
-\r
-html.js fieldset.collapsed {\r
- top: 0;\r
- margin-bottom: 1em;\r
-}\r
-\r
-tr.menu-disabled {\r
- /* Use filter to emulate CSS3 opacity */\r
- filter: alpha(opacity=50);\r
-}\r
-\r
-#header-region {\r
- /* Because of the lack of min-height, we use height as an alternative */\r
- height: 1em;\r
-}\r
-\r
-#attach-hide label, #uploadprogress div.message {\r
- /* Fading elements in IE causes the text to bleed unless they have a background. */\r
- background-color: #ffffff;\r
-}\r
+++ /dev/null
-/* $Id: fix-ie.css,v 1.8.2.1 2008/02/05 09:27:26 goba Exp $ */\r
-\r
-/**\r
- * Garland, for Drupal 6.x\r
- * Stefan Nagtegaal, iStyledThis [dot] nl\r
- * Steven Wittens, acko [dot] net\r
- */\r
-\r
-body {\r
- /* Center layout */\r
- text-align: center;\r
- /* Allow text resizing */\r
- font-size: 80%;\r
-}\r
-\r
-#header-region, #wrapper #container {\r
- /* Reset text alignment */\r
- text-align: left; /* LTR */\r
-}\r
-\r
-#wrapper #container #center {\r
- /* Reduce amount of damage done by extremely wide content */\r
- overflow: hidden;\r
-}\r
-\r
-#wrapper #container #center .right-corner .left-corner {\r
- /* Because of the lack of min-height, we use height as an alternative */\r
- height: 400px;\r
-}\r
-\r
-fieldset {\r
- /* Don't draw backgrounds on fieldsets in IE, as they look really bad. */\r
- background: none;\r
-}\r
-\r
-ul.primary {\r
- /* Fix missing top margin */\r
- position: relative; /* LTR */\r
-/* top: 0.5em; */\r
-}\r
-\r
-/* Prevent fieldsets from shifting when changing collapsed state. */\r
-html.js fieldset.collapsible {\r
- position: relative;\r
- top: -1em;\r
-}\r
-html.js fieldset.collapsed {\r
- top: 0;\r
- margin-bottom: 1em;\r
-}\r
-\r
-tr.menu-disabled {\r
- /* Use filter to emulate CSS3 opacity */\r
- filter: alpha(opacity=50);\r
-}\r
-\r
-#header-region {\r
- /* Because of the lack of min-height, we use height as an alternative */\r
- height: 1em;\r
-}\r
-\r
-tr.taxonomy-term-preview {\r
- filter: alpha(opacity=50);\r
-}\r
-\r
-#attach-hide label, #uploadprogress div.message {\r
- /* Fading elements in IE causes the text to bleed unless they have a background. */\r
- background-color: #ffffff;\r
-}\r
+++ /dev/null
-/* $Id: print.css,v 1.3 2007/09/06 21:23:32 goba Exp $ */\r
-\r
-/**\r
- * Garland, for Drupal 5.0\r
- * Stefan Nagtegaal, iStyledThis [dot] nl\r
- * Steven Wittens, acko [dot] net`\r
- *\r
- * If you use a customized color scheme, you must regenerate it after\r
- * modifying this file.\r
- */\r
-\r
-body, input, textarea, select {\r
- color: #000;\r
- background: none;\r
-}\r
-\r
-ul.primary-links, ul.secondary-links,\r
-#header-region, .sidebar {\r
- display: none;\r
-}\r
-\r
-body.sidebars, body.sideber-left, body.sidebar-right, body {\r
- width: 640px;\r
-}\r
-\r
-body.sidebar-left #center, body.sidebar-right #center, body.sidebars #center,\r
-body.sidebar-left #squeeze, body.sidebar-right #squeeze, body.sidebars #squeeze {\r
- margin: 0;\r
-}\r
-\r
-#wrapper,\r
-#wrapper #container .breadcrumb,\r
-#wrapper #container #center,\r
-#wrapper #container #center .right-corner,\r
-#wrapper #container #center .right-corner .left-corner,\r
-#wrapper #container #footer,\r
-#wrapper #container #center #squeeze {\r
- position: static;\r
- left: 0;\r
- padding: 0;\r
- margin: 0;\r
- width: auto;\r
- float: none;\r
- clear: both;\r
- background: none;\r
-}\r
-\r
-#wrapper #container #header {\r
- height: 130px;\r
-}\r
-\r
-#wrapper #container #header h1, #wrapper #container #header h1 a:link, #wrapper #container #header h1 a:visited {\r
- text-shadow: none;\r
- color: #000;\r
-}\r
+++ /dev/null
-/* $Id: style-rtl.css,v 1.6 2007/12/17 15:05:10 goba Exp $ */\r
-\r
-html {\r
- direction: rtl;\r
-}\r
-\r
-/**\r
- * Generic elements\r
- */\r
-body {\r
- direction: rtl;\r
-}\r
-\r
-ol li, ul li {\r
- margin: 0.4em .5em 0.4em 0;\r
-}\r
-\r
-ul.menu, .item-list ul {\r
- margin: 0.35em -0.5em 0 0;\r
-}\r
-\r
-ul.menu ul, .item-list ul ul {\r
- margin-left: 0;\r
- margin-right: 0em;\r
-}\r
-\r
-ol li, ul li, ul.menu li, .item-list ul li, li.leaf {\r
- margin: 0.15em .5em 0.15em 0;\r
-}\r
-\r
-ul li, ul.menu li, .item-list ul li, li.leaf {\r
- padding: 0 1.5em .2em 0;\r
- background: transparent url("../images/menu-leaf.gif") no-repeat 100% .35em;\r
-}\r
-\r
-ol li {\r
- margin-left: 0;\r
- margin-right: 2em;\r
-}\r
-\r
-ul li.expanded {\r
- background: transparent url("../images/menu-expanded.gif") no-repeat 100% .35em;\r
-}\r
-\r
-ul li.collapsed {\r
- background: transparent url("../images/menu-collapsed-rtl.gif") no-repeat 100% .35em;\r
-}\r
-\r
-ul.inline li {\r
- padding: 0 0 0 1em;\r
-}\r
-\r
-ol.task-list {\r
- margin-left: 0;\r
- margin-right: 0;\r
-}\r
-\r
-ol.task-list li {\r
- padding: 0.5em 2em 0.5em 1em;\r
-}\r
-\r
-ol.task-list li.active {\r
- background: transparent url(../images/task-list.png) no-repeat 97px 50%;\r
-}\r
-\r
-ol.task-list li.done {\r
- background: transparent url(../../misc/watchdog-ok.png) no-repeat 100% 50%;\r
-}\r
-\r
-ol.task-list li.active {\r
- margin-right: 0;\r
- margin-left: 1em;\r
-}\r
-\r
-dl {\r
- margin: 0.5em 1.5em 1em 0;\r
-}\r
-\r
-dl dt {\r
-}\r
-\r
-dl dd {\r
- margin: 0 1.5em .5em 0;\r
-}\r
-\r
-.form-button, .form-submit {\r
- margin: 2em 0 1em 0.5em;\r
-}\r
-\r
-#header-region h2 {\r
- margin: 0 0 0 1em;\r
-}\r
-\r
-#wrapper {\r
- background: #edf5fa url("../images/body.png") repeat-x 50% 0;\r
-}\r
-\r
-#wrapper #container #header h1 img {\r
- padding-right: 0;\r
- padding-left: 20px;\r
- float: right;\r
-}\r
-\r
-#sidebar-left .block-region {\r
- margin: 0 0 0 15px;\r
-}\r
-\r
-#sidebar-right .block-region {\r
- margin: 0 15px 0px 0;\r
-}\r
-\r
-/* Now we add the backgrounds for the main content shading */\r
-#wrapper #container #center #squeeze {\r
- background: #fff url("../images/bg-content.png") repeat-x 50% 0;\r
-}\r
-\r
-#wrapper #container .breadcrumb {\r
- position: absolute;\r
- top: 15px;\r
- left: 0;\r
- right: 35px;\r
- z-index: 3;\r
-}\r
-\r
-/**\r
- * Primary navigation\r
- */\r
-ul.primary-links {\r
- float: left;\r
-width:70%;\r
-}\r
-\r
-ul.primary-links li {\r
- float: right;\r
-}\r
-\r
-/**\r
- * Secondary navigation\r
- */\r
-ul.secondary-links {\r
- float: left;\r
- clear: left;\r
-}\r
-\r
-ul.secondary-links li {\r
- float: right;\r
-}\r
-\r
-ul.primary {\r
- float: right;\r
-}\r
-ul.secondary {\r
- clear: both;\r
- text-align: right;\r
-}\r
-h2.with-tabs {\r
- float: right;\r
- margin: 0 0 0 2em;\r
-}\r
-\r
-ul.primary li a, ul.primary li.active a, ul.primary li a:hover, ul.primary li a:visited,\r
-ul.secondary li a, ul.secondary li.active a, ul.secondary li a:hover, ul.secondary li a:visited {\r
- margin: 0 1px 0 0;\r
-\r
-}\r
-ul.primary li a:after {\r
- /* Fix Firefox 2 RTL bug. */\r
- content: " ";\r
-}\r
-\r
-ul.links li, ul.inline li {\r
- padding-left: 1em;\r
- padding-right: 0;\r
-}\r
-\r
-.node .links, .comment .links {\r
- text-align: right;\r
-}\r
-\r
-.node .links ul.links li, .comment .links ul.links li {}\r
-.terms ul.links li {\r
- padding-right: 1em;\r
- padding-left: 0;\r
-}\r
-\r
-.picture, .comment .submitted {\r
- padding-left: 0;\r
- float: left;\r
- clear: left;\r
- padding-right: 1em;\r
-}\r
-\r
-.new {\r
- float: left;\r
-}\r
-\r
-.terms {\r
- float: left;\r
-}\r
-\r
-.indented {\r
- margin-left: 0;\r
- margin-right: 25px;\r
-}\r
-\r
-html.js fieldset.collapsible legend a {\r
- padding-left: 0;\r
- padding-right: 2em;\r
- background: url("../images/menu-expanded.gif") no-repeat 100% 50%;\r
-}\r
-\r
-html.js fieldset.collapsed legend a {\r
- background: url("../images/menu-collapsed-rtl.gif") no-repeat 100% 50%;\r
-}\r
-\r
-/**\r
- * Syndication Block\r
- */\r
-#block-node-0 h2 {\r
- float: right;\r
- padding-right: 0;\r
- padding-left: 20px;\r
-}\r
-\r
-#block-node-0 img {\r
- float: left;\r
-}\r
-\r
-#block-node-0 .content {\r
- clear: left;\r
-}\r
-\r
-/**\r
- * Login Block\r
- */\r
-#user-login-form ul {\r
- text-align: right;\r
-}\r
-\r
-div.admin .left {\r
- float: right;\r
-}\r
-\r
-div.admin .right {\r
- float: left;\r
-}\r
-\r
-/* Fix Opera, IE6 and IE7 header width */\r
-#wrapper #container #header {\r
- position: relative;\r
- width: 100%;\r
-}\r
-\r
-#wrapper #container #header #logo-floater {\r
- width: 100%;\r
- left: 0;\r
- top:0;\r
-}\r
-\r
-/**\r
- * Fixes for IE7 - Does not break other browsers\r
- */\r
-\r
-/* Position:relative on these breaks IE7. */\r
-ul.primary li a, ul.primary li.active a, ul.primary li a:hover, ul.primary li a:visited,\r
-ul.secondary li a, ul.secondary li.active a, ul.secondary li a:hover, ul.secondary li a:visited {\r
- position: static;\r
-}\r
-\r
-/* Fix right and left cloumns position breaking on window resize */\r
-#container {\r
- position: relative;\r
-}\r
-\r
-#center {\r
- position: relative;\r
-}\r
-\r
-#sidebar-right{\r
- position: absolute;\r
- right: 0;\r
-}\r
-\r
-/**\r
- * Apply hasLayout to elements in IE7, using standard property "min-height"\r
- * (see http://www.satzansatz.de/cssd/onhavinglayout.html)\r
- */\r
-\r
-/* Fix background bleed in center column. */\r
-#squeeze,\r
-#squeeze .right-corner {\r
- min-height: 1%;\r
-}\r
+++ /dev/null
-/* $Id: style.css,v 1.38.2.1 2008/02/05 09:27:26 goba Exp $ */\r
-\r
-/**\r
- * Garland, for Drupal 6.x\r
- * Stefan Nagtegaal, iStyledThis [dot] nl\r
- * Steven Wittens, acko [dot] net`\r
- *\r
- * If you use a customized color scheme, you must regenerate it after\r
- * modifying this file.\r
- */\r
-\r
-/**\r
- * Generic elements\r
- */\r
-body {\r
- margin: 0;\r
- padding: 0;\r
- background: #edf5fa;\r
- font: 12px/170% Verdana, sans-serif;\r
- color: #494949;\r
-}\r
-\r
-input {\r
- font: 12px/100% Verdana, sans-serif;\r
- color: #494949;\r
-}\r
-\r
-textarea, select {\r
- font: 12px/160% Verdana, sans-serif;\r
- color: #494949;\r
-}\r
-\r
-h1, h2, h3, h4, h5, h6 {\r
- margin: 0;\r
- padding: 0;\r
- font-weight: normal;\r
- font-family: Helvetica, Arial, sans-serif;\r
-}\r
-\r
-h1 {\r
- font-size: 170%;\r
-}\r
-\r
-h2 {\r
- font-size: 160%;\r
- line-height: 130%;\r
-}\r
-\r
-h3 {\r
- font-size: 140%;\r
-}\r
-\r
-h4 {\r
- font-size: 130%;\r
-}\r
-\r
-h5 {\r
- font-size: 120%;\r
-}\r
-\r
-h6 {\r
- font-size: 110%;\r
-}\r
-\r
-ul, quote, code, fieldset {\r
- margin: .5em 0;\r
-}\r
-\r
-p {\r
- margin: 0.6em 0 1.2em;\r
- padding: 0;\r
-}\r
-\r
-a:link, a:visited {\r
- color: #027AC6;\r
- text-decoration: none;\r
-}\r
-\r
-a:hover {\r
- color: #0062A0;\r
- text-decoration: underline;\r
-}\r
-\r
-a:active, a.active {\r
- color: #5895be;\r
-}\r
-\r
-hr {\r
- margin: 0;\r
- padding: 0;\r
- border: none;\r
- height: 1px;\r
- background: #5294c1;\r
-}\r
-\r
-ul {\r
- margin: 0.5em 0 1em;\r
- padding: 0;\r
-}\r
-\r
-ol {\r
- margin: 0.75em 0 1.25em;\r
- padding: 0;\r
-}\r
-\r
-ol li, ul li {\r
- margin: 0.4em 0 0.4em .5em; /* LTR */\r
-}\r
-\r
-ul.menu, .item-list ul {\r
- margin: 0.35em 0 0 -0.5em; /* LTR */\r
- padding: 0;\r
-}\r
-\r
-ul.menu ul, .item-list ul ul {\r
- margin-left: 0em; /* LTR */\r
-}\r
-\r
-ol li, ul li, ul.menu li, .item-list ul li, li.leaf {\r
- margin: 0.15em 0 0.15em .5em; /* LTR */\r
-}\r
-\r
-ul li, ul.menu li, .item-list ul li, li.leaf {\r
- padding: 0 0 .2em 1.5em;\r
- list-style-type: none;\r
- list-style-image: none;\r
- background: transparent url(../images/menu-leaf.gif) no-repeat 1px .35em; /* LTR */\r
-}\r
-\r
-ol li {\r
- padding: 0 0 .3em;\r
- margin-left: 2em; /* LTR */\r
-}\r
-\r
-ul li.expanded {\r
- background: transparent url(../images/menu-expanded.gif) no-repeat 1px .35em; /* LTR */\r
-}\r
-\r
-ul li.collapsed {\r
- background: transparent url(../images/menu-collapsed.gif) no-repeat 0px .35em; /* LTR */\r
-}\r
-\r
-ul li.leaf a, ul li.expanded a, ul li.collapsed a {\r
- display: block;\r
-}\r
-\r
-ul.inline li {\r
- background: none;\r
- margin: 0;\r
- padding: 0 1em 0 0; /* LTR */\r
-}\r
-\r
-ol.task-list {\r
- margin-left: 0; /* LTR */\r
- list-style-type: none;\r
- list-style-image: none;\r
-}\r
-ol.task-list li {\r
- padding: 0.5em 1em 0.5em 2em; /* LTR */\r
-}\r
-ol.task-list li.active {\r
- background: transparent url(../images/task-list.png) no-repeat 3px 50%; /* LTR */\r
-}\r
-ol.task-list li.done {\r
- color: #393;\r
- background: transparent url(../../misc/watchdog-ok.png) no-repeat 0px 50%; /* LTR */\r
-}\r
-ol.task-list li.active {\r
- margin-right: 1em; /* LTR */\r
-}\r
-\r
-fieldset ul.clear-block li {\r
- margin: 0;\r
- padding: 0;\r
- background-image: none;\r
-}\r
-\r
-dl {\r
- margin: 0.5em 0 1em 1.5em; /* LTR */\r
-}\r
-\r
-dl dt {\r
-}\r
-\r
-dl dd {\r
- margin: 0 0 .5em 1.5em; /* LTR */\r
-}\r
-\r
-img, a img {\r
- border: none;\r
-}\r
-\r
-table {\r
- margin: 1em 0;\r
- width: 100%;\r
-}\r
-\r
-thead th {\r
- border-bottom: 2px solid #d3e7f4;\r
- color: #494949;\r
- font-weight: bold;\r
-}\r
-\r
-th a:link, th a:visited {\r
- color: #6f9dbd;\r
-}\r
-\r
-td, th {\r
- padding: .3em .5em;\r
-}\r
-\r
-tr.even, tr.odd, tbody th {\r
- border: solid #d3e7f4;\r
- border-width: 1px 0;\r
-}\r
-\r
-tr.odd, tr.info {\r
- background-color: #edf5fa;\r
-}\r
-\r
-tr.even {\r
- background-color: #fff;\r
-}\r
-\r
-tr.drag {\r
- background-color: #fffff0;\r
-}\r
-\r
-tr.drag-previous {\r
- background-color: #ffd;\r
-}\r
-\r
-tr.odd td.active {\r
- background-color: #ddecf5;\r
-}\r
-\r
-tr.even td.active {\r
- background-color: #e6f1f7;\r
-}\r
-\r
-td.region, td.module, td.container, td.category {\r
- border-top: 1.5em solid #fff;\r
- border-bottom: 1px solid #b4d7f0;\r
- background-color: #d4e7f3;\r
- color: #455067;\r
- font-weight: bold;\r
-}\r
-\r
-tr:first-child td.region, tr:first-child td.module, tr:first-child td.container, tr:first-child td.category {\r
- border-top-width: 0;\r
-}\r
-\r
-span.form-required {\r
- color: #ffae00;\r
-}\r
-\r
-span.submitted, .description {\r
- font-size: 0.92em;\r
- color: #898989;\r
-}\r
-\r
-.description {\r
- line-height: 150%;\r
- margin-bottom: 0.75em;\r
- color: #898989;\r
-}\r
-\r
-.messages, .preview {\r
- margin: .75em 0 .75em;\r
- padding: .5em 1em;\r
-}\r
-\r
-.messages ul {\r
- margin: 0;\r
-}\r
-\r
-.form-checkboxes, .form-radios, .form-checkboxes .form-item, .form-radios .form-item {\r
- margin: 0.25em 0;\r
-}\r
-\r
-#center form {\r
- margin-bottom: 2em;\r
-}\r
-\r
-.form-button, .form-submit {\r
- margin: 2em 0.5em 1em 0; /* LTR */\r
-}\r
-\r
-#dblog-form-overview .form-submit,\r
-.confirmation .form-submit,\r
-.search-form .form-submit,\r
-.poll .form-submit,\r
-fieldset .form-button, fieldset .form-submit,\r
-.sidebar .form-button, .sidebar .form-submit,\r
-table .form-button, table .form-submit {\r
- margin: 0;\r
-}\r
-\r
-.box {\r
- margin-bottom: 2.5em;\r
-}\r
-\r
-/**\r
- * Layout\r
- */\r
-#header-region {\r
- min-height: 1em;\r
- background: #d2e6f3 url(../images/bg-navigation.png) repeat-x 50% 100%;\r
-}\r
-\r
-#header-region .block {\r
- display: block;\r
- margin: 0 1em;\r
-}\r
-\r
-#header-region .block-region {\r
- display: block;\r
- margin: 0 0.5em 1em;\r
- padding: 0.5em;\r
- position: relative;\r
- top: 0.5em;\r
-}\r
-\r
-#header-region * {\r
- display: inline;\r
- line-height: 1.5em;\r
- margin-top: 0;\r
- margin-bottom: 0;\r
-}\r
-\r
-/* Prevent the previous directive from showing the content of script elements in Mozilla browsers. */\r
-#header-region script {\r
- display: none;\r
-}\r
-\r
-#header-region p, #header-region img {\r
- margin-top: 0.5em;\r
-}\r
-\r
-#header-region h2 {\r
- margin: 0 1em 0 0; /* LTR */\r
-}\r
-\r
-#header-region h3, #header-region label, #header-region li {\r
- margin: 0 1em;\r
- padding: 0;\r
- background: none;\r
-}\r
-\r
-#wrapper {\r
- background: #edf5fa url(../images/body.png) repeat-x 50% 0;\r
-}\r
-\r
-#wrapper #container {\r
- margin: 0 auto;\r
- padding: 0 20px;\r
- max-width: 1270px;\r
-}\r
-\r
-#wrapper #container #header {\r
- height: 80px;\r
-}\r
-\r
-#wrapper #container #header #logo-floater {\r
- position: absolute;\r
-}\r
-\r
-#wrapper #container #header h1, #wrapper #container #header h1 a:link, #wrapper #container #header h1 a:visited {\r
- line-height: 120px;\r
- position: relative;\r
- z-index: 2;\r
- white-space: nowrap;\r
-}\r
-\r
-#wrapper #container #header h1 span {\r
- font-weight: bold;\r
-}\r
-\r
-#wrapper #container #header h1 img {\r
- padding-top: 16px;\r
- padding-right: 20px; /* LTR */\r
- float: left; /* LTR */\r
-}\r
-\r
-/* With 3 columns, require a minimum width of 1000px to ensure there is enough horizontal space. */\r
-body.sidebars {\r
- min-width: 980px;\r
-}\r
-/* With 2 columns, require a minimum width of 800px. */\r
-body.sidebar-left, body.sidebar-right {\r
- min-width: 780px;\r
-}\r
-\r
-/* We must define 100% width to avoid the body being too narrow for near-empty pages */\r
-#wrapper #container #center {\r
- float: left;\r
- width: 100%;\r
-}\r
-\r
-/* So we move the #center container over the sidebars to compensate */\r
-body.sidebar-left #center {\r
- margin-left: -210px;\r
-}\r
-body.sidebar-right #center {\r
- margin-right: -210px;\r
-}\r
-body.sidebars #center {\r
- margin: 0 -210px;\r
-}\r
-\r
-/* And add blanks left and right for the sidebars to fill */\r
-body.sidebar-left #squeeze {\r
- margin-left: 210px;\r
-}\r
-body.sidebar-right #squeeze {\r
- margin-right: 210px;\r
-}\r
-body.sidebars #squeeze {\r
- margin: 0 210px;\r
-}\r
-\r
-/* We ensure the sidebars are still clickable using z-index */\r
-#wrapper #container .sidebar {\r
- margin: 60px 0 5em;\r
- width: 210px;\r
- float: left;\r
- z-index: 2;\r
- position: relative;\r
-}\r
-\r
-#wrapper #container .sidebar .block {\r
- margin: 0 0 1.5em 0;\r
-}\r
-\r
-#sidebar-left .block {\r
- padding: 0 15px 0 0px;\r
-}\r
-\r
-#sidebar-right .block {\r
- padding: 0 0px 0 15px;\r
-}\r
-\r
-.block .content {\r
- margin: 0.5em 0;\r
-}\r
-\r
-#sidebar-left .block-region {\r
- margin: 0 15px 0 0px; /* LTR */\r
-}\r
-\r
-#sidebar-right .block-region {\r
- margin: 0 0px 0 15px; /* LTR */\r
-}\r
-\r
-.block-region {\r
- padding: 1em;\r
- background: transparent;\r
- border: 2px dashed #b4d7f0;\r
- text-align: center;\r
- font-size: 1.3em;\r
-}\r
-\r
-/* Now we add the backgrounds for the main content shading */\r
-#wrapper #container #center #squeeze {\r
- background: #fff url(../images/bg-content.png) repeat-x 50% 0;\r
- position: relative;\r
-}\r
-\r
-#wrapper #container #center .right-corner {\r
- background: transparent url(../images/bg-content-right.png) no-repeat 100% 0;\r
- position: relative;\r
- left: 10px;\r
-}\r
-\r
-#wrapper #container #center .right-corner .left-corner {\r
- padding: 60px 25px 5em 35px;\r
- background: transparent url(../images/bg-content-left.png) no-repeat 0 0;\r
- margin-left: -10px;\r
- position: relative;\r
- left: -10px;\r
- min-height: 400px;\r
-}\r
-\r
-#wrapper #container #footer {\r
- float: none;\r
- clear: both;\r
- text-align: center;\r
- margin: 4em 0 -3em;\r
- color: #898989;\r
-}\r
-\r
-#wrapper #container .breadcrumb {\r
- position: absolute;\r
- top: 15px;\r
- left: 35px; /* LTR */\r
- z-index: 3;\r
-}\r
-\r
-body.sidebar-left #footer {\r
- margin-left: -210px;\r
-}\r
-\r
-body.sidebar-right #footer {\r
- margin-right: -210px;\r
-}\r
-\r
-body.sidebars #footer {\r
- margin: 0 -210px;\r
-}\r
-\r
-/**\r
- * Header\r
- */\r
-#wrapper #container #header h1, #wrapper #container #header h1 a:link, #wrapper #container #header h1 a:visited {\r
- color: #fff;\r
- font-weight: normal;\r
- text-shadow: #1659ac 0px 1px 3px;\r
- font-size: 1.5em;\r
-}\r
-\r
-#wrapper #container #header h1 a:hover {\r
- text-decoration: none;\r
-}\r
-\r
-#wrapper #container .breadcrumb {\r
- font-size: 0.92em;\r
-}\r
-\r
-#wrapper #container .breadcrumb, #wrapper #container .breadcrumb a {\r
- color: #529ad6;\r
-}\r
-\r
-#mission {\r
- padding: 1em;\r
- background-color: #fff;\r
- border: 1px solid #e0e5fb;\r
- margin-bottom: 2em;\r
-}\r
-\r
-/**\r
- * Primary navigation\r
- */\r
-ul.primary-links {\r
- margin: 0;\r
- padding: 0;\r
- float: right; /* LTR */\r
- position: relative;\r
- z-index: 4;\r
-}\r
-\r
-ul.primary-links li {\r
- margin: 0;\r
- padding: 0;\r
- float: left; /* LTR */\r
- background-image: none;\r
-}\r
-\r
-ul.primary-links li a, ul.primary-links li a:link, ul.primary-links li a:visited {\r
- display: block;\r
- margin: 0 1em;\r
- padding: .75em 0 0;\r
- color: #fff;\r
- background: transparent url(../images/bg-navigation-item.png) no-repeat 50% 0;\r
-}\r
-\r
-ul.primary-links li a:hover, ul.primary-links li a.active {\r
- color: #fff;\r
- background: transparent url(../images/bg-navigation-item-hover.png) no-repeat 50% 0;\r
-}\r
-\r
-/**\r
- * Secondary navigation\r
- */\r
-ul.secondary-links {\r
- margin: 0;\r
- padding: 18px 0 0;\r
- float: right; /* LTR */\r
- clear: right; /* LTR */\r
- position: relative;\r
- z-index: 4;\r
-}\r
-\r
-ul.secondary-links li {\r
- margin: 0;\r
- padding: 0;\r
- float: left; /* LTR */\r
- background-image: none;\r
-}\r
-\r
-ul.secondary-links li a, ul.secondary-links li a:link, ul.secondary-links li a:visited {\r
- display: block;\r
- margin: 0 1em;\r
- padding: .75em 0 0;\r
- color: #cde3f1;\r
- background: transparent;\r
-}\r
-\r
-ul.secondary-links li a:hover, ul.secondary-links li a.active {\r
- color: #cde3f1;\r
- background: transparent;\r
-}\r
-\r
-/**\r
- * Local tasks\r
- */\r
-ul.primary, ul.primary li, ul.secondary, ul.secondary li {\r
- border: 0;\r
- background: none;\r
- margin: 0;\r
- padding: 0;\r
-}\r
-\r
-#tabs-wrapper {\r
- margin: 0 -26px 1em;\r
- padding: 0 26px;\r
- border-bottom: 1px solid #e9eff3;\r
- position: relative;\r
-}\r
-ul.primary {\r
- padding: 0.5em 0 10px;\r
- float: left; /* LTR */\r
-}\r
-ul.secondary {\r
- clear: both;\r
- text-align: left; /* LTR */\r
- border-bottom: 1px solid #e9eff3;\r
- margin: -0.2em -26px 1em;\r
- padding: 0 26px 0.6em;\r
-}\r
-h2.with-tabs {\r
- float: left; /* LTR */\r
- margin: 0 2em 0 0; /* LTR */\r
- padding: 0;\r
-}\r
-\r
-ul.primary li a, ul.primary li.active a, ul.primary li a:hover, ul.primary li a:visited,\r
-ul.secondary li a, ul.secondary li.active a, ul.secondary li a:hover, ul.secondary li a:visited {\r
- border: 0;\r
- background: transparent;\r
- padding: 4px 1em;\r
- margin: 0 0 0 1px; /* LTR */\r
- height: auto;\r
- text-decoration: none;\r
- position: relative;\r
- top: -1px;\r
-}\r
-ul.primary li.active a, ul.primary li.active a:link, ul.primary li.active a:visited, ul.primary li a:hover,\r
-ul.secondary li.active a, ul.secondary li.active a:link, ul.secondary li.active a:visited, ul.secondary li a:hover {\r
- background: url(../images/bg-tab.png) repeat-x 0 50%;\r
- color: #fff;\r
-}\r
-ul.primary li.active a,\r
-ul.secondary li.active a {\r
- font-weight: bold;\r
-}\r
-\r
-/**\r
- * Nodes & comments\r
- */\r
-.node {\r
- border-bottom: 1px solid #e9eff3;\r
- margin: -1.5em -26px 1.5em;\r
- padding: 1.5em 26px;\r
-}\r
-\r
-ul.links li, ul.inline li {\r
- margin-left: 0;\r
- margin-right: 0;\r
- padding-left: 0; /* LTR */\r
- padding-right: 1em; /* LTR */\r
- background-image: none;\r
-}\r
-\r
-.node .links, .comment .links {\r
- text-align: left; /* LTR */\r
-}\r
-\r
-.node .links ul.links li, .comment .links ul.links li {}\r
-.terms ul.links li {\r
- margin-left: 0;\r
- margin-right: 0;\r
- padding-right: 0;\r
- padding-left: 1em;\r
-}\r
-\r
-.picture, .comment .submitted {\r
- float: right; /* LTR */\r
- clear: right; /* LTR */\r
- padding-left: 1em; /* LTR */\r
-}\r
-\r
-.new {\r
- color: #ffae00;\r
- font-size: 0.92em;\r
- font-weight: bold;\r
- float: right; /* LTR */\r
-}\r
-\r
-.terms {\r
- float: right; /* LTR */\r
-}\r
-\r
-.preview .node, .preview .comment, .sticky {\r
- margin: 0;\r
- padding: 0.5em 0;\r
- border: 0;\r
- background: 0;\r
-}\r
-\r
-.sticky {\r
- padding: 1em;\r
- background-color: #fff;\r
- border: 1px solid #e0e5fb;\r
- margin-bottom: 2em;\r
-}\r
-\r
-#comments {\r
- position: relative;\r
- top: -1px;\r
- border-bottom: 1px solid #e9eff3;\r
- margin: -1.5em -25px 0;\r
- padding: 0 25px;\r
-}\r
-\r
-#comments h2.comments {\r
- margin: 0 -25px;\r
- padding: .5em 25px;\r
- background: #fff url(../images/gradient-inner.png) repeat-x 0 0;\r
-}\r
-\r
-.comment {\r
- margin: 0 -25px;\r
- padding: 1.5em 25px 1.5em;\r
- border-top: 1px solid #e9eff3;\r
-}\r
-\r
-.indented {\r
- margin-left: 25px; /* LTR */\r
-}\r
-\r
-.comment h3 a.active {\r
- color: #494949;\r
-}\r
-\r
-.node .content, .comment .content {\r
- margin: 0.6em 0;\r
-}\r
-\r
-/**\r
- * Aggregator.module\r
- */\r
-#aggregator {\r
- margin-top: 1em;\r
-}\r
-#aggregator .feed-item-title {\r
- font-size: 160%;\r
- line-height: 130%;\r
-}\r
-#aggregator .feed-item {\r
- border-bottom: 1px solid #e9eff3;\r
- margin: -1.5em -31px 1.75em;\r
- padding: 1.5em 31px;\r
-}\r
-#aggregator .feed-item-categories {\r
- font-size: 0.92em;\r
-}\r
-#aggregator .feed-item-meta {\r
- font-size: 0.92em;\r
- color: #898989;\r
-}\r
-\r
-/**\r
- * Color.module\r
- */\r
-#palette .form-item {\r
- border: 1px solid #fff;\r
-}\r
-#palette .item-selected {\r
- background: #fff url(../images/gradient-inner.png) repeat-x 0 0;\r
- border: 1px solid #d9eaf5;\r
-}\r
-\r
-/**\r
- * Menu.module\r
- */\r
-tr.menu-disabled {\r
- opacity: 0.5;\r
-}\r
-tr.odd td.menu-disabled {\r
- background-color: #edf5fa;\r
-}\r
-tr.even td.menu-disabled {\r
- background-color: #fff;\r
-}\r
-\r
-/**\r
- * Poll.module\r
- */\r
-.poll .bar {\r
- background: #fff url(../images/bg-bar-white.png) repeat-x 0 0;\r
- border: solid #f0f0f0;\r
- border-width: 0 1px 1px;\r
-}\r
-\r
-.poll .bar .foreground {\r
- background: #71a7cc url(../images/bg-bar.png) repeat-x 0 100%;\r
-}\r
-\r
-.poll .percent {\r
- font-size: .9em;\r
-}\r
-\r
-/**\r
- * Autocomplete.\r
- */\r
-#autocomplete li {\r
- cursor: default;\r
- padding: 2px;\r
- margin: 0;\r
-}\r
-\r
-/**\r
- * Collapsible fieldsets\r
- */\r
-fieldset {\r
- margin: 1em 0;\r
- padding: 1em;\r
- border: 1px solid #d9eaf5;\r
- background: #fff url(../images/gradient-inner.png) repeat-x 0 0;\r
-}\r
-\r
-/* Targets IE 7. Fixes background image in field sets. */\r
-*:first-child+html fieldset {\r
- padding: 0 1em 1em;\r
- background-position: 0 .75em;\r
- background-color: transparent;\r
-}\r
-\r
-*:first-child+html fieldset > .description, *:first-child+html fieldset .fieldset-wrapper .description {\r
- padding-top: 1em;\r
-}\r
-\r
-fieldset legend {\r
- /* Fix disappearing legend in FFox */\r
- display: block;\r
-}\r
-\r
-*:first-child+html fieldset legend, *:first-child+html fieldset.collapsed legend {\r
- display: inline;\r
-}\r
-\r
-html.js fieldset.collapsed {\r
- background: transparent;\r
- padding-top: 0;\r
- padding-bottom: .6em;\r
-}\r
-\r
-html.js fieldset.collapsible legend a {\r
- padding-left: 2em; /* LTR */\r
- background: url(../images/menu-expanded.gif) no-repeat 0% 50%; /* LTR */\r
-}\r
-\r
-html.js fieldset.collapsed legend a {\r
- background: url(../images/menu-collapsed.gif) no-repeat 0% 50%; /* LTR */\r
-}\r
-\r
-/**\r
- * Syndication icons and block\r
- */\r
-#block-node-0 h2 {\r
- float: left; /* LTR */\r
- padding-right: 20px; /* LTR */\r
-}\r
-\r
-#block-node-0 img, .feed-icon {\r
- float: right; /* LTR */\r
- padding-top: 4px;\r
-}\r
-\r
-#block-node-0 .content {\r
- clear: right; /* LTR */\r
-}\r
-\r
-/**\r
- * Login Block\r
- */\r
-#user-login-form {\r
- text-align: center;\r
-}\r
-#user-login-form ul {\r
- text-align: left; /* LTR */\r
-}\r
-\r
-/**\r
- * User profiles.\r
- */\r
-.profile {\r
- margin-top: 1.5em;\r
-}\r
-.profile h3 {\r
- border-bottom: 0;\r
- margin-bottom: 1em;\r
-}\r
-.profile dl {\r
- margin: 0;\r
-}\r
-.profile dt {\r
- font-weight: normal;\r
- color: #898989;\r
- font-size: 0.92em;\r
- line-height: 1.3em;\r
- margin-top: 1.4em;\r
- margin-bottom: 0.45em;\r
-}\r
-.profile dd {\r
- margin-bottom: 1.6em;\r
-}\r
-\r
-/**\r
- * Admin Styles\r
- */\r
-div.admin-panel,\r
-div.admin-panel .description,\r
-div.admin-panel .body,\r
-div.admin,\r
-div.admin .left,\r
-div.admin .right,\r
-div.admin .expert-link,\r
-div.item-list,\r
-.menu {\r
- margin: 0;\r
- padding: 0;\r
-}\r
-\r
-div.admin .left {\r
- float: left; /* LTR */\r
- width: 48%;\r
-}\r
-div.admin .right {\r
- float: right; /* LTR */\r
- width: 48%;\r
-}\r
-\r
-div.admin-panel {\r
- background: #fff url(../images/gradient-inner.png) repeat-x 0 0;\r
- padding: 1em 1em 1.5em;\r
-}\r
-div.admin-panel .description {\r
- margin-bottom: 1.5em;\r
-}\r
-div.admin-panel dl {\r
- margin: 0;\r
-}\r
-div.admin-panel dd {\r
- color: #898989;\r
- font-size: 0.92em;\r
- line-height: 1.3em;\r
- margin-top: -.2em;\r
- margin-bottom: .65em;\r
-}\r
-\r
-table.system-status-report th {\r
- border-color: #d3e7f4;\r
-}\r
-\r
-#autocomplete li.selected, tr.selected td, tr.selected td.active {\r
- background: #027ac6;\r
- color: #fff;\r
-}\r
-\r
-tr.selected td a:link, tr.selected td a:visited, tr.selected td a:active {\r
- color: #d3e7f4;\r
-}\r
-\r
-tr.taxonomy-term-preview {\r
- opacity: 0.5;\r
-}\r
-\r
-tr.taxonomy-term-divider-top {\r
- border-bottom: none;\r
-}\r
-\r
-tr.taxonomy-term-divider-bottom {\r
- border-top: 1px dotted #CCC;\r
-}\r
-\r
-/**\r
- * CSS support\r
- */\r
-\r
-/*******************************************************************\r
- * Color Module: Don't touch *\r
- *******************************************************************/\r
-\r
-/**\r
- * Generic elements.\r
- */\r
-.messages {\r
- background-color: #fff;\r
- border: 1px solid #b8d3e5;\r
-}\r
-\r
-.preview {\r
- background-color: #fcfce8;\r
- border: 1px solid #e5e58f;\r
-}\r
-\r
-div.status {\r
- color: #33a333;\r
- border-color: #c7f2c8;\r
-}\r
-\r
-div.error, tr.error {\r
- color: #a30000;\r
- background-color: #FFCCCC;\r
-}\r
-\r
-.form-item input.error, .form-item textarea.error {\r
- border: 1px solid #c52020;\r
- color: #363636;\r
-}\r
-\r
-/**\r
- * dblog.module\r
- */\r
-tr.dblog-user {\r
- background-color: #fcf9e5;\r
-}\r
-\r
-tr.dblog-user td.active {\r
- background-color: #fbf5cf;\r
-}\r
-\r
-tr.dblog-content {\r
- background-color: #fefefe;\r
-}\r
-\r
-tr.dblog-content td.active {\r
- background-color: #f5f5f5;\r
-}\r
-\r
-tr.dblog-warning {\r
- background-color: #fdf5e6;\r
-}\r
-\r
-tr.dblog-warning td.active {\r
- background-color: #fdf2de;\r
-}\r
-\r
-tr.dblog-error {\r
- background-color: #fbe4e4;\r
-}\r
-\r
-tr.dblog-error td.active {\r
- background-color: #fbdbdb;\r
-}\r
-tr.dblog-page-not-found, tr.dblog-access-denied {\r
- background: #d7ffd7;\r
-}\r
-tr.dblog-page-not-found td.active, tr.dblog-access-denied td.active {\r
- background: #c7eec7;\r
-}\r
-\r
-/**\r
- * Status report colors.\r
- */\r
-table.system-status-report tr.error, table.system-status-report tr.error th {\r
- background-color: #fcc;\r
- border-color: #ebb;\r
- color: #200;\r
-}\r
-table.system-status-report tr.warning, table.system-status-report tr.warning th {\r
- background-color: #ffd;\r
- border-color: #eeb;\r
-}\r
-table.system-status-report tr.ok, table.system-status-report tr.ok th {\r
- background-color: #dfd;\r
- border-color: #beb;\r
-}\r
+++ /dev/null
-<?php
-foreach ($this->left as $block_def) {
- echo $this->blockContent($block_def);
-}
+++ /dev/null
- <div class="breadcrumb">
- Home : Page1 : Page2 : Page3
- </div>
- <h2>Application zone</h2>
- <div class="messages status">
- Welcome to Horde Flex demo.
- </div>
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">\r
- <head>\r
- <title>Administration theme | Drupal6 Test</title>\r
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
-\r
- <link type="text/css" rel="stylesheet" media="all" href="garland/css/style.css?D" />\r
- <link type="text/css" rel="stylesheet" media="print" href="garland/css/print.css?D" />\r
-\r
- <link type="text/css" rel="stylesheet" media="all" href="garland/css/defaults.css?D" />\r
-\r
- <!--[if lt IE 7]>\r
- <link type="text/css" rel="stylesheet" media="all" href="garland/css/fix-ie.css" />\r
- <![endif]-->\r
- </head>\r
- <body class="sidebars">\r
-\r
-<!-- Layout -->\r
- <div id="wrapper">\r
- <div id="container" class="clear-block">\r
-\r
- <div id="header">\r
- <h1 style="font-size:30px;font-weight:bold">Horde Flex</h1>\r
- </div> <!-- /header -->\r
-\r
- <div id="sidebar-left" class="sidebar">\r
- <div class="clear-block block">\r
- <?php echo $this->render('left.html.php') ?>\r
- </div>\r
- </div>\r
-\r
- <div id="center">\r
- <div id="squeeze">\r
- <div class="right-corner">\r
- <div class="left-corner">\r
- <?php echo $this->render('app.html.php') ?>\r
- </div>\r
- </div>\r
- </div>\r
- </div> <!-- /.left-corner, /.right-corner, /#squeeze, /#center -->\r
-\r
- <div id="sidebar-right" class="sidebar">\r
- <div class="clear-block block">\r
- <?php echo $this->render('right.html.php') ?>\r
- </div>\r
- </div>\r
-\r
- </div> <!-- /container -->\r
-</div>\r
-<!-- /layout -->\r
-\r
- </body>\r
-</html>\r
+++ /dev/null
-<?php echo $this->blockContent('flexdemo', 'menu') ?>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">\r
- <head>\r
- <title>Administration theme | Drupal6 Test</title>\r
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
-\r
- <link type="text/css" rel="stylesheet" media="all" href="garland/css/style.css?D" />\r
- <link type="text/css" rel="stylesheet" media="print" href="garland/css/print.css?D" />\r
-\r
- <link type="text/css" rel="stylesheet" media="all" href="garland/css/defaults.css?D" />\r
-\r
-\r
- <!--[if lt IE 7]>\r
- <link type="text/css" rel="stylesheet" media="all" href="garland/css/fix-ie.css" />\r
- <![endif]-->\r
- </head>\r
- <body class="sidebars">\r
-\r
-<!-- Layout -->\r
- <div id="wrapper">\r
- <div id="container" class="clear-block">\r
-\r
- <div id="header">\r
- <div id="logo-floater">\r
- <h1 style="font-size:30px;font-weight:bold">Horde Flex</h1>\r
- </div>\r
- </div> <!-- /header -->\r
-\r
- <div id="center">\r
- <div id="squeeze">\r
- <div class="right-corner">\r
- <div class="left-corner">\r
-\r
- <div class="breadcrumb">\r
- Home : Page1 : Page2 : Page3\r
- </div>\r
- <h2>Application zone</h2>\r
- <div class="messages status">\r
- The configuration options have been reset to their default values.\r
- </div>\r
- </div>\r
- </div>\r
- </div>\r
- </div> <!-- /.left-corner, /.right-corner, /#squeeze, /#center -->\r
-\r
- <div id="sidebar-right" class="sidebar">\r
- <div class="clear-block block">\r
- <h2>Right</h2>\r
- </div>\r
- </div>\r
-\r
- </div> <!-- /container -->\r
-</div>\r
-<!-- /layout -->\r
-\r
- </body>\r
-</html>\r
+++ /dev/null
-<?php
-
-$horde_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-$v = new Horde_View(array('templatePath' => dirname(__FILE__) . '/garland'));
-new Horde_View_Helper_Block($v);
-
-$v->left = array(array('flexdemo', 'block1'),
- array('flexdemo', 'block2'));
-$v->app = array('list');
-
-echo $v->render('main.html.php');
+++ /dev/null
-<?php
-
-$block_name = _("Horde Block1");
-
-/**
- * @package Horde_Block
- */
-class Horde_Block_flexdemo_block1 extends Horde_Block {
-
- var $_app = 'horde';
-
- /**
- * The title to go in this block.
- *
- * @return string The title text.
- */
- function _title()
- {
- return _("Block1");
- }
-
- /**
- * The content to go in this block.
- *
- * @return string The content
- */
- function _content()
- {
- $html = '<h2>Block1</h2><p>foo</p>';
- return $html;
- }
-
-
- function toHtml()
- {
- return $this->_content();
- }
-
-}
+++ /dev/null
-<?php
-
-$block_name = _("Horde Block2");
-
-/**
- * @package Horde_Block
- */
-class Horde_Block_flexdemo_block2 extends Horde_Block {
-
- var $_app = 'horde';
-
- /**
- * The title to go in this block.
- *
- * @return string The title text.
- */
- function _title()
- {
- return _("Block2");
- }
-
- /**
- * The content to go in this block.
- *
- * @return string The content
- */
- function _content()
- {
- $html = '<h2>Block2</h2>';
- return $html;
- }
-
-
- function toHtml()
- {
- return $this->_content();
- }
-
-}
+++ /dev/null
-<?php
-
-$block_name = _("Horde Menu");
-
-/**
- * @package Horde_Block
- */
-class Horde_Block_flexdemo_menu extends Horde_Block {
-
- var $_app = 'horde';
-
- /**
- * The title to go in this block.
- *
- * @return string The title text.
- */
- function _title()
- {
- return _("Menu");
- }
-
- /**
- * The content to go in this block.
- *
- * @return string The content
- */
- function _content()
- {
- $html = '<h2>Menu</h2>';
- return $html;
- }
-
-
- function toHtml()
- {
- return $this->_content();
- }
-
-
-
-}
+++ /dev/null
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-\f
- 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.)
-\f
-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.
-\f
- 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.
-\f
- 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
+++ /dev/null
-What is Jeta?
-=============
-
-:Contact: dev@lists.horde.org
-
-.. contents:: Contents
-.. section-numbering::
-
-Jeta is a Horde wrapper around various Java SSH applets. Currently, Jeta
-supports the SSHTerm applet from the `SSHTools Project`_ and the `JTA`_ applet
-(for non-commercial use only).
-
-This software is OSI Certified Open Source Software. OSI Certified is a
-certification mark of the `Open Source Initiative`_.
-
-.. _`SSHTools Project`: http://sourceforge.net/projects/sshtools
-.. _`JTA`: http://javassh.org/
-.. _`Open Source Initiative`: http://www.opensource.org/
-
-
-Obtaining Jeta
---------------
-
-Further information on Jeta and the latest version can be obtained at:
-
- http://www.horde.org/jeta/
-
-
-Documentation
--------------
-
-The following documentation is available in the Jeta distribution:
-
-:README_: This file
-:COPYING_: Copyright and license information
-:`docs/CHANGES`_: Changes by release
-:`docs/CREDITS`_: Project developers
-:`docs/INSTALL`_: Installation instructions and notes
-
-
-Installation
-------------
-
-Instructions for installing Jeta can be found in the file INSTALL_ in the
-``docs/`` directory of the Jeta distribution.
-
-
-Assistance
-----------
-
-If you encounter problems with Jeta, help is available!
-
-The Horde Frequently Asked Questions List (FAQ), available on the Web at
-
- http://www.horde.org/faq/
-
-The Horde Project runs a number of mailing lists, for individual applications
-and for issues relating to the project as a whole. Information, archives, and
-subscription information can be found at
-
- http://www.horde.org/mail/
-
-Lastly, Horde developers, contributors and users also make occasional
-appearances on IRC, on the channel #horde on the freenode Network
-(irc.freenode.net).
-
-
-Licensing
----------
-
-For licensing and copyright information, please see the file COPYING_ in the
-Jeta distribution.
-
-Thanks,
-
-The Jeta Team
-
-.. _README: ?f=README.html
-.. _COPYING: http://www.horde.org/licenses/gpl.php
-.. _docs/CHANGES: ?f=CHANGES.html
-.. _docs/CREDITS: ?f=CREDITS.html
-.. _INSTALL:
-.. _docs/INSTALL: ?f=INSTALL.html
+++ /dev/null
-Deny from all
+++ /dev/null
-<?xml version="1.0"?>
-<!-- $Id$ -->
-<configuration>
- <configsection name="jeta" desc="Base jeta settings">
- <configheader>Authentication Settings</configheader>
- <configstring name="hordeauth" desc="If you want the full username@realm to
- be used to connect then set this to 'full'; otherwise set this to 'true' and
- just the username will be used to connect">true</configstring>
- </configsection>
-
- <configsection name="menu" desc="Menu settings">
- <configheader>Menu Settings</configheader>
- <configmultienum name="apps" desc="Select any applications that should be
- linked in Jeta's menu">
- <values>
- <configspecial name="list-horde-apps" />
- </values>
- </configmultienum>
- </configsection>
-</configuration>
+++ /dev/null
-<?php
-/**
- * $Id$
- *
- * See horde/config/prefs.php for documentation on the structure of this file.
- */
-
-$prefGroups['base'] = array(
- 'column' => _("General Preferences"),
- 'label' => _("Base Settings"),
- 'desc' => _("Change your base settings."),
- 'members' => array('host', 'port', 'sshdriver')
-);
-
-$prefGroups['sshtools'] = array(
- 'column' => _("Applet Preferences"),
- 'label' => _("SSHTools Preferences"),
- 'desc' => _("Preferences that control the behavior of the SSHTools applet."),
- 'members' => array('sshtools_auth', 'sshtools_connect_immediately',
- 'sshtools_connect_dialog',
- 'sshtools_disable_hostkey_verify',
- 'sshtools_show_toolbar', 'sshtools_show_menubar',
- 'sshtools_show_statusbar', 'sshtools_show_scrollbar',
- 'sshtools_autohide')
-);
-
-$prefGroups['jta'] = array(
- 'column' => _("Applet Preferences"),
- 'label' => _("JTA Preferences"),
- 'desc' => _("Preferences that control the behavior of the JTA applet."),
- 'members' => array('jta_detach', 'jta_detach_fullscreen',
- 'jta_detach_title', 'jta_detach_immediately',
- 'jta_detach_start', 'jta_detach_stop',
- 'jta_detach_menubar', 'jta_detach_disconnect',
- 'jta_disconnect')
-);
-
-//
-$_prefs['host'] = array(
- 'value' => '',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'text',
- 'desc' => _("The default server name to connect to.")
-);
-
-//
-$_prefs['port'] = array(
- 'value' => 22,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'number',
- 'desc' => _("The default port to connect to.")
-);
-
-//
-$_prefs['sshdriver'] = array(
- 'value' => 'sshtools',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'enum',
- 'enum' => array('sshtools' => _("SSHTools"),
- 'jta' => _("JTA (non-commerical use only)")),
- 'desc' => _("SSH application to use:")
-);
-
-//
-$_prefs['sshtools_auth'] = array(
- 'value' => 'password',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'enum',
- 'enum' => array('password' => _("password"),
- 'publickey' => _("publickey")),
- 'desc' => _("Authentication method:")
-);
-
-//
-$_prefs['sshtools_connect_immediately'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Connect immediately when the user loads the page?")
-);
-
-//
-$_prefs['sshtools_connect_dialog'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Show the connection dialog?")
-);
-
-//
-$_prefs['sshtools_disable_hostkey_verify'] = array(
- 'value' => 0,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Disable the hostkey verification?")
-);
-
-//
-$_prefs['sshtools_show_toolbar'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Enable the toolbar?")
-);
-
-//
-$_prefs['sshtools_show_menubar'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Enable the menubar?")
-);
-
-//
-$_prefs['sshtools_show_statusbar'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Enable the statusbar?")
-);
-
-//
-$_prefs['sshtools_show_scrollbar'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Enable the scrollbar?")
-);
-
-//
-$_prefs['sshtools_autohide'] = array(
- 'value' => 0,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Enable auto-hiding of the tool bar, menu bar, status bar and scroll bar?")
-);
-
-//
-$_prefs['jta_detach'] = array(
- 'value' => 0,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Detach the actual terminal display and its components from the browser window and run in a separate window?")
-);
-
-//
-$_prefs['jta_detach_fullscreen'] = array(
- 'value' => 0,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Make the detached window fill the entire screen?")
-);
-
-//
-$_prefs['jta_detach_title'] = array(
- 'value' => _("SSH Terminal"),
- 'locked' => false,
- 'shared' => false,
- 'type' => 'text',
- 'desc' => _("The window title of the detached applet.")
-);
-
-//
-$_prefs['jta_detach_immediately'] = array(
- 'value' => 0,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("If selected, applet will detach immediately from page on load. If not selected, user will need to press start button before applet becomes detached.")
-);
-
-//
-$_prefs['jta_detach_start'] = array(
- 'value' => _("Connect"),
- 'locked' => false,
- 'shared' => false,
- 'type' => 'text',
- 'desc' => _("The text to use for the start button.")
-);
-
-//
-$_prefs['jta_detach_stop'] = array(
- 'value' => _("Disconnect"),
- 'locked' => false,
- 'shared' => false,
- 'type' => 'text',
- 'desc' => _("The text to use for the disconnect button.")
-);
-
-//
-$_prefs['jta_detach_menubar'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Show the menubar in the detached applet?")
-);
-
-//
-$_prefs['jta_detach_disconnect'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Close the detached window if the SSH session is lost?")
-);
-
-//
-$_prefs['jta_disconnect'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Close the SSH session if you leave the page?")
-);
+++ /dev/null
---------
-v2.0-git
---------
-
-
-----
-v1.0
-----
-
-[mms] Move configuration of applets to preferences.
-[jan] Add JTA applet (http://javassh.org/).
-[mms] Use Jeta_Applet:: to generate code necessary to load applets.
-
-
---------
-v1.0-RC1
---------
-
-[mms] Convert to Horde_Template::.
-[jan] Add Czech translation (Pavel Chytil <pavel@chytil.tk>).
-[jan] Add Spanish translation (Manuel Perez Ayala <mperaya@alcazaba.unex.es>).
-[jan] Add German translation.
-[max] Add support for configuring full/bare Auth name as username.
-[jan] Add Finnish translation (Petteri Karttunen <pkarttun@siba.fi>).
-[jan] Replace applet with SSHTerm from SSHTools (www.sshtools.com).
-[jan] Add Romanian translation (Eugen Hoanca <eugenh@urban-grafx.ro>).
-[ejr] Add gettext support and traditional chinese translation
-[ejr] Add horde-style configuration files (not yet used)
-[ejr] Made directories/files to match horde module layout
-[ejr] Added documentation files
-[ejr] Added .htaccess files to deny access to config, lib, and templates.
+++ /dev/null
-=======================
- Jeta Development Team
-=======================
-
-
-Core Developers
-===============
-
-- Eric Rostetter <eric.rostetter@physics.utexas.edu>
- Original design
-- Jan Schneider <jan@horde.org>
- Integration of SSHTools and JTA applets
-- Michael Slusarz <slusarz@horde.org>
- General coding
-
-
-Localization
-============
-
-===================== ======================================================
-Chinese (Traditional) Jonathan Chen
-Czech Pavel Chytil <pavel@chytil.tk>.
-Finnish Petteri Karttunen <pkarttun@siba.fi>
-German Jan Schneider <jan@horde.org>
-Romanian Eugen Hoanca
-Spanish Manuel Perez Ayala <mperaya@alcazaba.unex.es>
-===================== ======================================================
+++ /dev/null
-=================
- Installing Jeta
-=================
-
-:Contact: dev@lists.horde.org
-
-.. contents:: Contents
-.. section-numbering::
-
-This document contains instructions for installing Jeta on your system.
-
-Jeta is based on a java SSH client. It allows shell access to your
-web server, or to another machine if used with a port relay daemon
-(not provided).
-
-For information on the capabilities and features of Jeta, see the file
-README_ in the top-level directory of the Jeta distribution.
-
-
-Obtaining Jeta
-==============
-
-Jeta can be obtained from the Horde website and FTP server, at
-
- http://www.horde.org/jeta/
-
- ftp://ftp.horde.org/jeta/
-
-Or use the mirror closest to you:
-
- http://www.horde.org/mirrors.php
-
-Bleeding-edge development versions of Jeta are available via CVS; see the
-file `horde/docs/HACKING`_ in the Horde distribution, or the website
-http://www.horde.org/source/, for information on accessing the Horde CVS
-repository.
-
-
-Prerequisites
-=============
-
-To function properly, Jeta **REQUIRES** the following:
-
-1. A working Horde installation.
-
- Jeta runs within the `Horde Application Framework`_, a set of common tools
- for Web applications written in PHP. You must install Horde before
- before installing Jeta.
-
- .. Important:: Jeta requires at least version 4.0 of the Horde Framework -
- earlier versions of Horde will **not** work.
-
- The Horde Framework can be obtained from the Horde website and FTP server,
- at
-
- http://www.horde.org/horde/
-
- ftp://ftp.horde.org/pub/horde/
-
- Many of Jeta's prerequisites are also Horde prerequisites.
-
- .. Important:: Be sure to have completed all of the steps in the
- `horde/docs/INSTALL`_ file for the Horde Framework before
- installing Jeta.
-
- .. _`Horde Application Framework`: http://www.horde.org/horde/
-
-
-2. A running, working SSH server on the web server, supporting SSH version 1
- protocol. Jeta requires SSH version 1 protocol at this time. If you have an
- SSH version 2 server, it must provide SSH version 1 failover.
-
-3. A relayd server installed, running, and working on the web server IF AND
- ONLY IF you want to relay to a secondary machine.
-
-
-Installing Jeta
-===============
-
-Jeta is written in PHP, and must be installed in a web-accessible directory.
-The precise location of this directory will differ from system to system.
-Conventionally, Jeta is installed directly underneath Horde in the web
-server's document tree.
-
-Since Jeta is written in PHP, there is no compilation necessary; simply
-expand the distribution where you want it to reside and rename the root
-directory of the distribution to whatever you wish to appear in the URL. For
-example, with the Apache web server's default document root of
-``/usr/local/apache/htdocs``, you would type::
-
- cd /usr/local/apache/htdocs/horde
- tar zxvf /path/to/jeta-1.x.tar.gz
- mv jeta-1.x jeta
-
-and would then find Jeta at the URL::
-
- http://your-server/horde/jeta/
-
-
-Configuring Jeta
-================
-
-1. Configuring Horde for Jeta
-
- a. Register the application
-
- In ``horde/config/registry.php``, find the ``applications['jeta']``
- stanza. The default settings here should be okay, but you can change
- them if desired. If you have changed the location of Jeta relative to
- Horde, either in the URL, in the filesystem or both, you must update the
- ``fileroot`` and ``webroot`` settings to their correct values.
-
-2. Configuring Jeta
-
- To configure Jeta, change to the ``config/`` directory of the installed
- distribution, and make copies of all of the configuration ``dist`` files
- without the ``dist`` suffix::
-
- cd config/
- for foo in *.dist; do cp $foo `basename $foo .dist`; done
-
- Or on Windows::
-
- copy *.dist *.
-
- Documentation on the format and purpose of those files can be found in each
- file. You may edit these files if you wish to customize Jeta's
- appearance and behavior. With one exceptions (``backends.php``) the
- defaults will be correct for most sites.
-
- You must be sure to configure an appropriate backend in ``backends.php``.
-
- You must login to Horde as a Horde Administrator to finish the
- configuration of Jeta. Use the Horde ``Administration`` menu item to get
- to the administration page, and then click on the ``Configuration`` icon to
- get the configuration page. Select ``File Manager`` from the selection
- list of applications. Fill in or change any configuration values as
- needed. When done click on ``Generate File Manager Configuration`` to
- generate Jeta configuration directory or file, it will not be able to
- write the file. In this case, go back to ``Configuration`` and choose one
- of the other methods to create the configuration file
- ``jeta/config/conf.php``.
-
- Note for international users: Jeta uses GNU gettext to provide local
- translations of text displayed by applications; the translations are found
- in the po/ directory. If a translation is not yet available for your
- locale (and you wish to create one), see the ``horde/po/README`` file, or
- if you're having trouble using a provided translation, please see the
- `horde/docs/TRANSLATIONS`_ file for instructions.
-
-3. Securing Jeta
-
- Review the guidelines for security contained in `horde/docs/SECURITY`_.
-
-4. Tuning Jeta (Performance)
-
- See `horde/docs/PERFORMANCE`_.
-
-5. Additional Notes (relaying SSH connections)
-
- .. Important:: The Horde Project cannot provide support for configuration
- of a relay daemon.
-
- Since Java only allows you to connect back to the web server from which
- the applet was downloaded, if you wish to connect to another machine you
- must use a "transparent redirection" application of some sort. The standard
- unix tool for this use is the xinetd server. If you are not running xinetd,
- there are many other redirections tools you can use, some of which can be
- downloaded from the web site at http://www.javassh.org/. The "relayd" and
- "mrealyd" applications available there are C applications and should be
- fairly portable.
-
- To configure xinetd, use a configuration similar to the following::
-
- # default: off
- # description: The relayd deamon redirects ssh connections on port "relayd" \
- # (relayd must be defined in /etc/services) on this host to \
- # the ssh server on host 10.0.0.2 on port 22.
- service relayd
- {
- disabl = no
- flags = REUSE
- socket_type = stream
- wait = no
- user = root
- server = /usr/sbin/sshd
- log_on_success += HOST DURATION
- log_on_failure += HOST
- bind = 10.0.0.1
- redirect = 10.0.0.2 22
- }
-
- The above accpets connections from the java applet to the web server with
- the IP address 10.0.0.1 (on the port "relayd" as defined in /etc/services)
- and then redirects those connections to a second server at IP address
- 10.0.0.2 on port 22.
-
-
-Obtaining Support
-=================
-
-If you encounter problems with Jeta, help is available!
-
-The Horde Frequently Asked Questions List (FAQ), available on the Web at
-
- http://www.horde.org/faq/
-
-The Horde Project runs a number of mailing lists, for individual applications
-and for issues relating to the project as a whole. Information, archives, and
-subscription information can be found at
-
- http://www.horde.org/mail/
-
-Lastly, Horde developers, contributors and users may also be found on IRC,
-on the channel #horde on the Freenode Network (irc.freenode.net).
-
-Please keep in mind that Jeta is free software written by volunteers.
-For information on reasonable support expectations, please read
-
- http://www.horde.org/support.php
-
-Thanks for using Jeta!
-
-The Jeta Team
-
-
-.. _README: ?f=README.html
-.. _`horde/docs/INSTALL`: ../../horde/docs/?f=INSTALL.html
-.. _`horde/docs/HACKING`: ../../horde/docs/?f=HACKING.html
-.. _`horde/docs/TRANSLATIONS`: ../../horde/docs/?f=TRANSLATIONS.html
-.. _`horde/docs/SECURITY`: ../../horde/docs/?f=SECURITY.html
-.. _`horde/docs/PERFORMANCE`: ../../horde/docs/?f=PERFORMANCE.html
+++ /dev/null
-<?php
-/**
- * Release focus. Possible values:
- * 0 - N/A
- * 1 - Initial freshmeat announcement
- * 2 - Documentation
- * 3 - Code cleanup
- * 4 - Minor feature enhancements
- * 5 - Major feature enhancements
- * 6 - Minor bugfixes
- * 7 - Major bugfixes
- * 8 - Minor security fixes
- * 9 - Major security fixes
- */
-$this->notes['fm']['focus'] = 1;
-
-/* Mailing list release notes. */
-$this->notes['ml']['changes'] = <<<ML
-The Horde Team is pleased to announce the second release candidate of the Jeta
-SSH Module version H3 (1.0-RC2).
-
-Jeta is the Horde wrapper around various Java SSH applets. It allows users
-to login via a terminal window to the server on which the Horde application is
-running.
-
-This is a preview version that should not be used on production systems.
-This version is considered feature complete but a few bugs may still exist
-in the code.
-
-We encourage widespread testing and feedback via the mailing lists or our bug
-tracking system. Updated translations are very welcome, though some strings
-will still change before the final release.
-ML;
-
-/* Freshmeat release notes. */
-$this->notes['fm']['changes'] = <<<FM
-Added the JTA applet (http://javassh.org/). Move configuration of applets to preferences.
-FM;
-
-$this->notes['name'] = 'Jeta';
-$this->notes['list'] = 'dev';
-$this->notes['fm']['project'] = 'jeta';
-$this->notes['fm']['branch'] = 'Default';
+++ /dev/null
-<?php
-/**
- * Copyright 2002-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Eric Rostetter <eric.rostetter@physics.utexas.edu>
- */
-
-require_once dirname(__FILE__) . '/lib/Application.php';
-Horde_Registry::appInit('jeta');
-
-$applet = Jeta_Applet::factory($prefs->getValue('sshdriver'));
-
-$template = $injector->createInstance('Horde_Template');
-$template->set('menu', Horde::menu());
-$template->set('notification', $notification->notify(array('listeners' => 'status')));
-$template->set('applet', $applet->generateAppletCode());
-
-require JETA_TEMPLATES . '/common-header.inc';
-echo $template->fetch(JETA_TEMPLATES . '/main.html');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-SSH.user =
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-/**
- * Jeta_Applet:: defines an API to interact with different java applets.
- *
- * Copyright 2006-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file LICENSE for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- *
- * @author Michael Slusarz <slusarz@horde.org>
- * @package Jeta
- */
-abstract class Jeta_Applet
-{
- /**
- * Parameters used by the class.
- *
- * @var array
- */
- protected $_params = array();
-
- /**
- * Attempts to return a concrete Jeta_Applet instance based on $driver.
- *
- * @param string $driver The type of concrete Jeta_Applet subclass to
- * return.
- * @param array $params A hash containing any additional configuration or
- * connection parameters a subclass might need.
- *
- * @return mixed The newly created concrete Jeta_Applet instance, or
- * false on error.
- */
- static public function factory($driver, $params = array())
- {
- $class = 'Jeta_Applet_' . basename($driver);
- return class_exists($class)
- ? new $class($params)
- : false;
- }
-
- /**
- * Constructor.
- */
- public function __construct($params = array())
- {
- $this->_params = array_merge($this->_params, $params);
- }
-
- /**
- * Generate the HTML code used to load the applet.
- *
- * @return string The HTML needed to load the applet.
- */
- abstract public function generateAppletCode();
-
- /**
- * Generate the HTML param tags.
- *
- * @param array $params An array of parameter names and values.
- *
- * @return string The parameters in HTML code.
- */
- protected function _generateParamTags($params = array())
- {
- $out = '';
- foreach ($params as $key => $val) {
- $out .= '<param name="' . $key . '" value="' . $val . '" />';
- }
- return $out;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Jeta_Applet_jta:: provides a driver for the JTA Java Applet.
- *
- * JTA applet (v2.6) located at:
- * http://javassh.org/
- * JTA is released under the GPL license for non-commercial customers.
- *
- * Copyright 2006-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file LICENSE for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- *
- * @author Jan Schneider <jan@horde.org>
- * @package Jeta
- */
-class Jeta_Applet_jta extends Jeta_Applet
-{
- /**
- * Jeta configuration parameters.
- *
- * @var array
- */
- protected $_jtaParams = array(
- 'Socket.host' => array(
- 'pref' => 'host',
- 'bool' => false
- ),
- 'Socket.port' => array(
- 'pref' => 'port',
- 'bool' => false,
- ),
- 'Applet.detach' => array(
- 'pref' => 'jta_detach',
- 'bool' => true
- ),
- 'Applet.detach.fullscreen' => array(
- 'pref' => 'jta_detach_fullscreen',
- 'bool' => true
- ),
- 'Applet.detach.title' => array(
- 'pref' => 'jta_detach_title',
- 'bool' => false
- ),
- 'Applet.detach.immediately' => array(
- 'pref' => 'jta_detach_immediately',
- 'bool' => true
- ),
- 'Applet.detach.startText' => array(
- 'pref' => 'jta_detach_start',
- 'bool' => false
- ),
- 'Applet.detach.stopText' => array(
- 'pref' => 'jta_detach_stop',
- 'bool' => false
- ),
- 'Applet.detach.menuBar' => array(
- 'pref' => 'jta_detach_menubar',
- 'bool' => true
- ),
- 'Applet.disconnect.closeWindow' => array(
- 'pref' => 'jta_detach_disconnect',
- 'bool' => true
- ),
- 'Applet.disconnect' => array(
- 'pref' => 'jta_disconnect',
- 'bool' => true
- )
- );
-
- /**
- * Generate the HTML code used to load the applet.
- *
- * @return string The HTML needed to load the applet.
- */
- public function generateAppletCode()
- {
- $params = array(
- 'config' => 'jta.conf',
- 'plugins' => 'Status,Socket,SSH,Terminal',
- 'SSH.user' => $GLOBALS['registry']->getAuth((empty($GLOBALS['conf']['user']['hordeauth']) || ($GLOBALS['conf']['user']['hordeauth'] === 'full')) ? null : 'bare');
- );
-
- foreach ($this->_jtaParams as $key => $val) {
- $prefval = $GLOBALS['prefs']->getValue($val['pref']);
- $params[$key] = ($val['bool']) ? (($prefval) ? 'true' : 'false') : $prefval;
- }
-
- if (!empty($params['Applet.detach']) &&
- empty($params['Applet.detach.immediately'])) {
- $height = 75;
- $width = 100;
- } else {
- $height = 500;
- $width = 600;
- }
-
- return '<applet code="de.mud.jta.Applet" width="' . $width . '" height="' . $height . '" codebase="jar" archive="jta26.jar">' .
- $this->_generateParamTags($params) . '</applet>';
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Jeta_Applet_sshtools:: provides a driver for the SSHTools Java Applet.
- *
- * SSHTools applet (v0.2.2) located at:
- * http://sourceforge.net/projects/sshtools/
- * SSHTools is released under the GPL license.
- *
- * Copyright 2006-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file LICENSE for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- *
- * @author Michael Slusarz <slusarz@horde.org>
- * @package Jeta
- */
-class Jeta_Applet_sshtools extends Jeta_Applet
-{
- /**
- * SSHTools parameters.
- *
- * @var array
- */
- protected $_sshtoolsParams = array(
- 'sshapps.connection.host' => array(
- 'pref' => 'host',
- 'bool' => false
- ),
- 'sshapps.connection.port' => array(
- 'pref' => 'port',
- 'bool' => false
- ),
- 'sshapps.connection.authenticationMethod' => array(
- 'pref' => 'sshtools_auth',
- 'bool' => false
- ),
- 'sshapps.connection.connectImmediately' => array(
- 'pref' => 'sshtools_connect_immediately',
- 'bool' => true
- ),
- 'sshapps.connection.showConnectionDialog' => array(
- 'pref' => 'sshtools_connect_dialog',
- 'bool' => true
- ),
- 'sshapps.connection.disableHostKeyVerification' => array(
- 'pref' => 'sshtools_disable_hostkey_verify',
- 'bool' => true
- ),
- 'sshapps.ui.toolBar' => array(
- 'pref' => 'sshtools_show_toolbar',
- 'bool' => true
- ),
- 'sshapps.ui.menuBar' => array(
- 'pref' => 'sshtools_show_menubar',
- 'bool' => true
- ),
- 'sshapps.ui.statusBar' => array(
- 'pref' => 'sshtools_show_statusbar',
- 'bool' => true
- ),
- 'sshapps.ui.scrollBar' => array(
- 'pref' => 'sshtools_show_scrollBar',
- 'bool' => true
- ),
- 'sshapps.ui.autoHide' => array(
- 'pref' => 'sshtools_autohide',
- 'bool' => true
- )
- );
-
- /**
- * Generate the HTML code used to load the applet.
- *
- * @return string The HTML needed to load the applet.
- */
- public function generateAppletCode()
- {
- $params = array(
- 'sshapps.connection.userName' => $GLOBALS['registry']->getAuth((empty($GLOBALS['conf']['user']['hordeauth']) || ($GLOBALS['conf']['user']['hordeauth'] === 'full')) ? null : 'bare')
- );
-
- foreach ($this->_sshtoolsParams as $key => $val) {
- $prefval = $GLOBALS['prefs']->getValue($val['pref']);
- $params[$key] = ($val['bool']) ? (($prefval) ? 'true' : 'false') : $prefval;
- }
-
- return '<applet code="com.sshtools.sshterm.SshTermApplet" width="600" height="500" codebase="jar" archive="SSHTermApplet-signed.jar,SSHTermApplet-jdkbug-workaround-signed.jar,SSHTermApplet-jdk1.3.1-dependencies-signed.jar">' .
- $this->_generateParamTags($params) .
- '</applet>';
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Jeta application API.
- *
- * This file defines Horde's core API interface. Other core Horde libraries
- * can interact with Jeta through this API.
- *
- * Copyright 2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Jeta
- */
-
-/* Determine the base directories. */
-if (!defined('JETA_BASE')) {
- define('JETA_BASE', dirname(__FILE__) . '/..');
-}
-
-if (!defined('HORDE_BASE')) {
- /* If Horde does not live directly under the app directory, the HORDE_BASE
- * constant should be defined in config/horde.local.php. */
- if (file_exists(JETA_BASE . '/config/horde.local.php')) {
- include JETA_BASE . '/config/horde.local.php';
- } else {
- define('HORDE_BASE', JETA_BASE . '/..');
- }
-}
-
-/* Load the Horde Framework core (needed to autoload
- * Horde_Registry_Application::). */
-require_once HORDE_BASE . '/lib/core.php';
-
-class Jeta_Application extends Horde_Registry_Application
-{
- /**
- * The application's version.
- *
- * @var string
- */
- public $version = 'H4 (2.0-git)';
-
- /**
- * Add additional items to the menu.
- *
- * @param Horde_Menu $menu The menu object.
- */
- public function menu($menu)
- {
- $menu->addArray(array(
- 'class' => ((basename($_SERVER['PHP_SELF']) == 'index.php') ? 'current' : ''),
- 'icon' => 'jeta.png',
- 'text' => _("_Shell"),
- 'url' => Horde::url('index.php')
- ));
- }
-
-}
+++ /dev/null
-<?php
-/**
- * This class provides the Jeta configuration for the test script.
- *
- * Copyright 2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Michael Slusarz <slusarz@horde.org>
- * @package Jeta
- */
-class Jeta_Test extends Horde_Test
-{
- /**
- * The module list
- *
- * @var array
- */
- protected $_moduleList = array();
-
- /**
- * PHP settings list.
- *
- * @var array
- */
- protected $_settingsList = array();
-
- /**
- * PEAR modules list.
- *
- * @var array
- */
- protected $_pearList = array();
-
- /**
- * Required configuration files.
- *
- * @var array
- */
- protected $_fileList = array(
- 'config/conf.php' => null,
- 'config/prefs.php' => null
- );
-
- /**
- * Inter-Horde application dependencies.
- *
- * @var array
- */
- protected $_appList = array();
-
- /**
- * Any application specific tests that need to be done.
- *
- * @return string HTML output.
- */
- public function appTests()
- {
- }
-
-}
+++ /dev/null
-Deny from all
+++ /dev/null
-# Czech translations for Jeta package.
-# Copyright 2004-2010 The Horde Project
-# This file is distributed under the same license as the Horde package.
-# Pavel Chytil <pavel@chytil.tk>, 2004.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Jeta\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2005-01-03 15:02+0100\n"
-"PO-Revision-Date: 2004-11-25 09:19-0800\n"
-"Last-Translator: Pavel Chytil <pavel@chytil.tk>\n"
-"Language-Team: Czech <i18n@lists.horde.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
-"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+++ /dev/null
-# German translations for Jeta.
-# Copyright 2003-2010 The Horde Project
-# This file is distributed under the same license as the Jeta package.
-# Jan Schneider, 2003-2008.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Jeta H3 (1.0)\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2010-08-17 17:46+0200\n"
-"PO-Revision-Date: 2008-04-01 14:59+0200\n"
-"Last-Translator: Jan Schneider <jan@horde.org>\n"
-"Language-Team: i18n@lists.horde.org\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#: config/prefs.php.dist:16 config/prefs.php.dist:28
-msgid "Applet Options"
-msgstr "Applet Einstellungen"
-
-#: config/prefs.php.dist:75
-msgid "Authentication method:"
-msgstr "Authentifizierungsmethode:"
-
-#: config/prefs.php.dist:10
-msgid "Base Settings"
-msgstr "Grundlegende Einstellungen"
-
-#: config/prefs.php.dist:11
-msgid "Change your base settings."
-msgstr "Ändern Sie Ihre grundlegenden Einstellungen."
-
-#: config/prefs.php.dist:228
-msgid "Close the SSH session if you leave the page?"
-msgstr "SSH-Session beenden, wenn die Seite verlassen wird?"
-
-#: config/prefs.php.dist:219
-msgid "Close the detached window if the SSH session is lost?"
-msgstr ""
-"Das losgelöste Fenster schließen, wenn die SSH-Session unterbrochen wird?"
-
-#: config/prefs.php.dist:188
-msgid "Connect"
-msgstr "Verbinden"
-
-#: config/prefs.php.dist:84
-msgid "Connect immediately when the user loads the page?"
-msgstr "Sofort verbinden, wenn die Seite aufgerufen wird?"
-
-#: config/prefs.php.dist:156
-msgid ""
-"Detach the actual terminal display and its components from the browser "
-"window and run in a separate window?"
-msgstr ""
-"Das Terminal vom Browserfenster lösen und in einem eigenen Fenster anzeigen?"
-
-#: config/prefs.php.dist:102
-msgid "Disable the hostkey verification?"
-msgstr "Hostkey-Überprüfung deaktivieren?"
-
-#: config/prefs.php.dist:197
-msgid "Disconnect"
-msgstr "Trennen"
-
-#: config/prefs.php.dist:147
-msgid ""
-"Enable auto-hiding of the tool bar, menu bar, status bar and scroll bar?"
-msgstr ""
-"Werkzeugleiste, Menüleiste, Statusleiste und Bildlaufleiste automatisch "
-"ausblenden?"
-
-#: config/prefs.php.dist:120
-msgid "Enable the menubar?"
-msgstr "Menüleiste aktivieren?"
-
-#: config/prefs.php.dist:138
-msgid "Enable the scrollbar?"
-msgstr "Bildlaufleiste aktivieren?"
-
-#: config/prefs.php.dist:129
-msgid "Enable the statusbar?"
-msgstr "Statusleiste aktivieren?"
-
-#: config/prefs.php.dist:111
-msgid "Enable the toolbar?"
-msgstr "Werkzeugleiste aktivieren?"
-
-#: config/prefs.php.dist:9
-msgid "General Options"
-msgstr "Allgemeine Einstellungen"
-
-#: config/prefs.php.dist:183
-msgid ""
-"If selected, applet will detach immediately from page on load. If not "
-"selected, user will need to press start button before applet becomes "
-"detached."
-msgstr ""
-"Applet sofort beim Laden der Seite lösen? Anderenfalls muss der Start-Knopf "
-"gedrückt werden, bevor das Applet gelöst wird."
-
-#: config/prefs.php.dist:63
-msgid "JTA (non-commerical use only)"
-msgstr "JTA (nur zur nicht-kommerziellen Benutzung)"
-
-#: config/prefs.php.dist:29
-msgid "JTA Options"
-msgstr "JTA Einstellungen"
-
-#: config/prefs.php.dist:165
-msgid "Make the detached window fill the entire screen?"
-msgstr "Losgelöstes Fenster im Vollbildmodus anzeigen?"
-
-#: config/prefs.php.dist:30
-msgid "Options that control the behavior of the JTA applet."
-msgstr "Einstellungen die das Verhalten des JTA-Applets beeinflussen."
-
-#: config/prefs.php.dist:18
-msgid "Options that control the behavior of the SSHTools applet."
-msgstr "Einstellungen die das Verhalten des SSHTools-Applets beeinflussen."
-
-#: config/prefs.php.dist:170
-msgid "SSH Terminal"
-msgstr "SSH-Terminal"
-
-#: config/prefs.php.dist:64
-msgid "SSH application to use:"
-msgstr "SSH-Anwendung benutzen:"
-
-#: config/prefs.php.dist:62
-msgid "SSHTools"
-msgstr "SSHTools"
-
-#: config/prefs.php.dist:17
-msgid "SSHTools Options"
-msgstr "SSHTools Einstellungen"
-
-#: config/prefs.php.dist:93
-msgid "Show the connection dialog?"
-msgstr "Verbindungsdialog anzeigen?"
-
-#: config/prefs.php.dist:210
-msgid "Show the menubar in the detached applet?"
-msgstr "Die Menüleiste im losgelösten Applet anzeigen?"
-
-#: config/prefs.php.dist:53
-msgid "The default port to connect to."
-msgstr "Der Standardport für die Verbindungen."
-
-#: config/prefs.php.dist:44
-msgid "The default server name to connect to."
-msgstr "Der Standard-Servername für die Verbindungen."
-
-#: config/prefs.php.dist:201
-msgid "The text to use for the disconnect button."
-msgstr "Der Text für den Trennen-Knopf."
-
-#: config/prefs.php.dist:192
-msgid "The text to use for the start button."
-msgstr "Der Text für den Start-Knopf."
-
-#: config/prefs.php.dist:174
-msgid "The window title of the detached applet."
-msgstr "Fenstertitel des losgelösten Applets."
-
-#: lib/Jeta.php:21
-msgid "_Shell"
-msgstr "_Shell"
-
-#: config/prefs.php.dist:73
-msgid "password"
-msgstr "Passwort"
-
-#: config/prefs.php.dist:74
-msgid "publickey"
-msgstr "Öffentlicher Schlüssel"
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<help>
-
-<entry id="Overview" md5="f575e035ab729f987b215b836b659cd1" state="uptodate">
- <title>Übersicht</title>
- <heading>Einführung</heading>
- <para>
- Die SSH-Anwendung ermöglicht einen Shell-Zugang zu Ihrem Konto über ein
- Java-SSH-Applet.
- </para>
-</entry>
-
-</help>
+++ /dev/null
-<?xml version='1.0'?>
-<help>
-
-<entry id="Overview">
- <title>Overview</title>
- <heading>Introduction</heading>
- <para>
- The SSH app provides a Java SSH applet that you can use to access your shell account.
- </para>
-</entry>
-
-</help>
+++ /dev/null
-# Spanish translations for jeta package
-# Traducciones al español para el paquete jeta.
-# Copyright 2008-2010 The Horde Project
-# This file is distributed under the same license as the jeta package.
-# Automatically generated, 2008.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Jeta 1.1-cvs\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2008-03-18 11:35+0100\n"
-"PO-Revision-Date: 2008-03-18 11:35+0100\n"
-"Last-Translator: Manuel P. Ayala <mayala@unex.es>\n"
-"Language-Team: i18n@lists.horde.org\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#: config/.bak/prefs.php.dist:16 config/.bak/prefs.php.dist:28
-msgid "Applet Options"
-msgstr "Opciones del applet"
-
-#: config/.bak/prefs.php.dist:75
-msgid "Authentication method:"
-msgstr "Método de autentificación:"
-
-#: config/.bak/prefs.php.dist:10
-msgid "Base Settings"
-msgstr "Opciones básicas"
-
-#: config/.bak/prefs.php.dist:11
-msgid "Change your base settings."
-msgstr "Cambia sus opciones básicas."
-
-#: config/.bak/prefs.php.dist:228
-msgid "Close the SSH session if you leave the page?"
-msgstr "¿Cerrar sesión SSH al abandonar la página?"
-
-#: config/.bak/prefs.php.dist:219
-msgid "Close the detached window if the SSH session is lost?"
-msgstr "¿Cerrar la ventana separada si se pierde la sesión SSH?"
-
-#: config/.bak/prefs.php.dist:188
-msgid "Connect"
-msgstr "Conectar"
-
-#: config/.bak/prefs.php.dist:84
-msgid "Connect immediately when the user loads the page?"
-msgstr "¿Conectar inmediatamente cuando el usuario cargue la página?"
-
-#: config/.bak/prefs.php.dist:156
-msgid ""
-"Detach the actual terminal display and its components from the browser "
-"window and run in a separate window?"
-msgstr ""
-"¿Separar la visualización del terminal actual y sus componentes de la "
-"ventana del navegador y ejecutarlo en una ventana separada?"
-
-#: config/.bak/prefs.php.dist:102
-msgid "Disable the hostkey verification?"
-msgstr "¿Desactivar la comprobación de clave del servidor?"
-
-#: config/.bak/prefs.php.dist:197
-msgid "Disconnect"
-msgstr "Desconectar"
-
-#: config/.bak/prefs.php.dist:147
-msgid ""
-"Enable auto-hiding of the tool bar, menu bar, status bar and scroll bar?"
-msgstr ""
-"¿Activar la ocultación automática de las barras de herramientas, de menú, de "
-"estado y de desplazamiento?"
-
-#: config/.bak/prefs.php.dist:120
-msgid "Enable the menubar?"
-msgstr "¿Activar la barra de menú?"
-
-#: config/.bak/prefs.php.dist:138
-msgid "Enable the scrollbar?"
-msgstr "¿Activar la barra de desplazamiento?"
-
-#: config/.bak/prefs.php.dist:129
-msgid "Enable the statusbar?"
-msgstr "¿Activar la barra de estado?"
-
-#: config/.bak/prefs.php.dist:111
-msgid "Enable the toolbar?"
-msgstr "¿Activar la barra de herramientas?"
-
-#: config/.bak/prefs.php.dist:9
-msgid "General Options"
-msgstr "Opciones generales"
-
-#: config/.bak/prefs.php.dist:183
-msgid ""
-"If selected, applet will detach immediately from page on load. If not "
-"selected, user will need to press start button before applet becomes "
-"detached."
-msgstr ""
-"Si se selecciona, el applet se separará inmediatamente de la página al "
-"cargarse. Si no se selecciona, el usuario tendrá que pulsar el botón iniciar "
-"antes de que el applet se separe."
-
-#: config/.bak/prefs.php.dist:63
-msgid "JTA (non-commerical use only)"
-msgstr "JTA (sólo para uso no comercial)"
-
-#: config/.bak/prefs.php.dist:29
-msgid "JTA Options"
-msgstr "Opciones JTA"
-
-#: config/.bak/prefs.php.dist:165
-msgid "Make the detached window fill the entire screen?"
-msgstr "¿Ampliar la ventana separada a toda la pantalla?"
-
-#: config/.bak/prefs.php.dist:30
-msgid "Options that control the behavior of the JTA applet."
-msgstr "Opciones que controlan el comportamiento del applet JTA."
-
-#: config/.bak/prefs.php.dist:18
-msgid "Options that control the behavior of the SSHTools applet."
-msgstr "Opciones que controlan el comportamiento del applet SSHTools."
-
-#: config/.bak/prefs.php.dist:170
-msgid "SSH Terminal"
-msgstr "Terminal SSH"
-
-#: config/.bak/prefs.php.dist:64
-msgid "SSH application to use:"
-msgstr "Aplicación SSH a utilizar:"
-
-#: config/.bak/prefs.php.dist:62
-msgid "SSHTools"
-msgstr "SSHTools"
-
-#: config/.bak/prefs.php.dist:17
-msgid "SSHTools Options"
-msgstr "Opciones de SSHTools"
-
-#: config/.bak/prefs.php.dist:93
-msgid "Show the connection dialog?"
-msgstr "¿Mostrar el cuadro de diálogo de conexión?"
-
-#: config/.bak/prefs.php.dist:210
-msgid "Show the menubar in the detached applet?"
-msgstr "¿Mostrar la barra de menú en el applet separado?"
-
-#: config/.bak/prefs.php.dist:53
-msgid "The default port to connect to."
-msgstr "Puerto al que conectarse por omisión."
-
-#: config/.bak/prefs.php.dist:44
-msgid "The default server name to connect to."
-msgstr "Nombre del servidor al que conectarse por omisión."
-
-#: config/.bak/prefs.php.dist:201
-msgid "The text to use for the disconnect button."
-msgstr "Texto utilizado en el botón de desconexión."
-
-#: config/.bak/prefs.php.dist:192
-msgid "The text to use for the start button."
-msgstr "Texto utilizado en el botón de inicio."
-
-#: config/.bak/prefs.php.dist:174
-msgid "The window title of the detached applet."
-msgstr "Título de la ventana del applet separado."
-
-#: lib/Jeta.php:20
-msgid "_Shell"
-msgstr "_Consola"
-
-#: config/.bak/prefs.php.dist:73
-msgid "password"
-msgstr "contraseña"
-
-#: config/.bak/prefs.php.dist:74
-msgid "publickey"
-msgstr "clave pública"
+++ /dev/null
-<?xml version='1.0'?>
-<help>
-
-<entry id="Overview">
- <title>Introducción</title>
- <heading>Introducción</heading>
- <para>La aplicación SSH proporciona un applet JAVA SSH que se puede utilizar para acceder a su cuenta de consola.</para>
-</entry>
-
-</help>
+++ /dev/null
-# Jeta Finnish translation
-# Copyright 2003 Petteri Karttunen.
-# Petteri Karttunen <pkarttun@siba.fi>, 2003.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Jeta \n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2005-01-03 15:02+0100\n"
-"PO-Revision-Date: 2003-06-10 13:08+0200\n"
-"Last-Translator: Petteri Karttunen <pkarttun@siba.fi>\n"
-"Language-Team: Finnish <dev@lists.horde.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Horde Project
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2010-08-17 17:46+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: config/prefs.php.dist:16 config/prefs.php.dist:28
-msgid "Applet Options"
-msgstr ""
-
-#: config/prefs.php.dist:75
-msgid "Authentication method:"
-msgstr ""
-
-#: config/prefs.php.dist:10
-msgid "Base Settings"
-msgstr ""
-
-#: config/prefs.php.dist:11
-msgid "Change your base settings."
-msgstr ""
-
-#: config/prefs.php.dist:228
-msgid "Close the SSH session if you leave the page?"
-msgstr ""
-
-#: config/prefs.php.dist:219
-msgid "Close the detached window if the SSH session is lost?"
-msgstr ""
-
-#: config/prefs.php.dist:188
-msgid "Connect"
-msgstr ""
-
-#: config/prefs.php.dist:84
-msgid "Connect immediately when the user loads the page?"
-msgstr ""
-
-#: config/prefs.php.dist:156
-msgid ""
-"Detach the actual terminal display and its components from the browser "
-"window and run in a separate window?"
-msgstr ""
-
-#: config/prefs.php.dist:102
-msgid "Disable the hostkey verification?"
-msgstr ""
-
-#: config/prefs.php.dist:197
-msgid "Disconnect"
-msgstr ""
-
-#: config/prefs.php.dist:147
-msgid ""
-"Enable auto-hiding of the tool bar, menu bar, status bar and scroll bar?"
-msgstr ""
-
-#: config/prefs.php.dist:120
-msgid "Enable the menubar?"
-msgstr ""
-
-#: config/prefs.php.dist:138
-msgid "Enable the scrollbar?"
-msgstr ""
-
-#: config/prefs.php.dist:129
-msgid "Enable the statusbar?"
-msgstr ""
-
-#: config/prefs.php.dist:111
-msgid "Enable the toolbar?"
-msgstr ""
-
-#: config/prefs.php.dist:9
-msgid "General Options"
-msgstr ""
-
-#: config/prefs.php.dist:183
-msgid ""
-"If selected, applet will detach immediately from page on load. If not "
-"selected, user will need to press start button before applet becomes "
-"detached."
-msgstr ""
-
-#: config/prefs.php.dist:63
-msgid "JTA (non-commerical use only)"
-msgstr ""
-
-#: config/prefs.php.dist:29
-msgid "JTA Options"
-msgstr ""
-
-#: config/prefs.php.dist:165
-msgid "Make the detached window fill the entire screen?"
-msgstr ""
-
-#: config/prefs.php.dist:30
-msgid "Options that control the behavior of the JTA applet."
-msgstr ""
-
-#: config/prefs.php.dist:18
-msgid "Options that control the behavior of the SSHTools applet."
-msgstr ""
-
-#: config/prefs.php.dist:170
-msgid "SSH Terminal"
-msgstr ""
-
-#: config/prefs.php.dist:64
-msgid "SSH application to use:"
-msgstr ""
-
-#: config/prefs.php.dist:62
-msgid "SSHTools"
-msgstr ""
-
-#: config/prefs.php.dist:17
-msgid "SSHTools Options"
-msgstr ""
-
-#: config/prefs.php.dist:93
-msgid "Show the connection dialog?"
-msgstr ""
-
-#: config/prefs.php.dist:210
-msgid "Show the menubar in the detached applet?"
-msgstr ""
-
-#: config/prefs.php.dist:53
-msgid "The default port to connect to."
-msgstr ""
-
-#: config/prefs.php.dist:44
-msgid "The default server name to connect to."
-msgstr ""
-
-#: config/prefs.php.dist:201
-msgid "The text to use for the disconnect button."
-msgstr ""
-
-#: config/prefs.php.dist:192
-msgid "The text to use for the start button."
-msgstr ""
-
-#: config/prefs.php.dist:174
-msgid "The window title of the detached applet."
-msgstr ""
-
-#: lib/Jeta.php:21
-msgid "_Shell"
-msgstr ""
-
-#: config/prefs.php.dist:73
-msgid "password"
-msgstr ""
-
-#: config/prefs.php.dist:74
-msgid "publickey"
-msgstr ""
+++ /dev/null
-# Romanian translations for Jeta package.
-# Copyright 2003-2010 The Horde Project
-# This file is distributed under the same license as the Jeta package.
-# Eugen Hoanca <eugenh@urban-grafx.ro>, 2003.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Jeta 0.0.1\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2005-01-03 15:02+0100\n"
-"PO-Revision-Date: 2003-03-25 10:16+0200\n"
-"Last-Translator: Eugen Hoanca <eugenh@urban-grafx.ro>\n"
-"Language-Team: Romanian <i18n@lists.horde.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Jeta\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2005-01-03 15:02+0100\n"
-"PO-Revision-Date: 2003-03-20 16:34-0600\n"
-"Last-Translator: Jonathan Chen <ccchen@physics.utexas.edu>\n"
-"Language-Team: Traditional Chinese <ccchen@physics.utexas.edu>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
+++ /dev/null
-<?php
-if (isset($language)) {
- header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
- header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<title><?php echo htmlspecialchars($registry->get('name')) ?></title>
-<link href="<?php echo Horde_Themes::img('favicon.ico', array('nohorde' => true)) ?>" rel="SHORTCUT ICON" />
-<?php Horde_Themes::includeStylesheetFiles() ?>
-</head>
-
-<body>
+++ /dev/null
-<tag:menu />
-<tag:notification />
-
-<p>
- <tag:applet />
-</p>
+++ /dev/null
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-\f
- 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.)
-\f
-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.
-\f
- 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.
-\f
- 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
+++ /dev/null
-Version 1.0
-
-Copyright (c) 2006 The Horde Project. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-2. 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.
-
-3. The end-user documentation included with the redistribution, if
-any, must include the following acknowledgment:
-
- "This product includes software developed by the Horde Project
- (http://www.horde.org/)."
-
-Alternately, this acknowledgment may appear in the software itself, if
-and wherever such third-party acknowledgments normally appear.
-
-4. The names "Horde", "The Horde Project", and "Skeleton" must not be
-used to endorse or promote products derived from this software without
-prior written permission. For written permission, please contact
-core@horde.org.
-
-5. Products derived from this software may not be called "Horde" or
-"Skeleton", nor may "Horde" or "Skeleton" appear in their name, without
-prior written permission of the Horde Project.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED 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 HORDE PROJECT OR ITS 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.
-
-This software consists of voluntary contributions made by many
-individuals on behalf of the Horde Project. For more information on
-the Horde Project, please see <http://www.horde.org/>.
+++ /dev/null
-Copyright (c) 2006 The Horde Project. 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.
-
-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 HORDE PROJECT
-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.
+++ /dev/null
-What is Kastalia?
-=================
-
-.. contents:: Contents
-.. section-numbering::
-
-Kastalia is a Horde Framework application for secure file sharing. Every uploaded
-file can be encrypted by Kastalia and stored secure in the datastore. The user
-does not need any additional program for the encryption/decryption.
-
-Obtaining Kastalia
-------------------
-
-Further information on Kastalia and the latest version can be obtained at
-
- http://h4des.org/index.php?inhalt=kastalia
-
-
-Documentation
--------------
-
-The following documentation is available in the Kastalia distribution:
-
-:README_: This file
-:COPYING_: Copyright and license information
-:LICENSE_: Copyright and license information
-:`docs/CHANGES`_: Changes by release
-:`docs/CREDITS`_: Project developers
-:`docs/INSTALL`_: Installation instructions and notes
-:`docs/TODO`_: Development TODO list
-:`docs/UPGRADING`_: Pointers on upgrading from previous Kastalia versions
-
-
-Installation
-------------
-
-Instructions for installing Kastalia can be found in the file INSTALL_ in the
-``docs/`` directory of the Kastalia distribution.
-
-
-Assistance
-----------
-
-If you encounter problems with Kastalia, help is available! Please contact the
-author of Kastalia.
-
-
-Licensing
----------
-
-For licensing and copyright information, please see the file COPYING_/LICENSE_
-in the Kastalia distribution.
-
-Thanks,
-
-the Kastalia team
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */
-$conf['datastore']['location'] = '/home/sqall/projekte/www/horde/kastalia/datastore';
-$conf['datastore']['directoryexcludes'] = array('lost+found', 'testordner', 'testordner2');
-$conf['upload']['uploadenabled'] = true;
-$conf['upload']['maxfilesize'] = 134217728;
-$conf['upload']['tempdir'] = '/home/sqall/projekte/www/horde/kastalia/temp';
-$conf['upload']['tempctime'] = 10;
-$conf['upload']['securestore'] = true;
-$conf['upload']['memorysize'] = 3145728;
-$conf['upload']['refreshcycle'] = 1;
-/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */
+++ /dev/null
-<?xml version="1.0"?>
-<configuration>
- <configsection name="datastore">
- <configheader>Kastalia Datastore Settings</configheader>
- <configstring name="location" desc="The absolute path to the Kastalia Datastore. Default is the directory kastalia/datastore. You can also use a directory outside of the webroot with read-permission for the webserver.">
- /absolute/path/to/horde/kastalia/datastore
- </configstring>
- <configlist name="directoryexcludes" desc="Directories and their content which should not be shown on the download page (lost+found, secretdir, etc.). <strong>WARNING:</strong> the directories and their content are just hidden on the download page. The Content can still be downloaded by manually modifying the URL." required="false">
- lost+found
- </configlist>
- </configsection>
- <configsection name="upload">
- <configheader>Kastalia Upload Settings</configheader>
- <configboolean name="uploadenabled" desc="Should we enable uploads?">
- false
- </configboolean>
- <configinteger name="maxfilesize" desc="The maximum size (in bytes) of each file that users can upload. <strong>NOTICE:</strong> the values upload_max_filesize and post_max_size in php.ini have to be greater than or equal to this value.">
- 0
- </configinteger>
- <configstring name="tempdir" desc="The absolute path to the Kastalia temporary folder. Default is the directory kastalia/temp. You can also use a directory outside of the webroot with write-permission for the webserver. This temporary folder will be used for the encryption/decryption of uploaded files.">
- /absolute/path/to/horde/kastalia/temp
- </configstring>
- <configinteger name="tempctime" desc="How long (in minutes) should Kastalia keep a temporary file? Normally a temporary file will be deleted after its use. Because of connection termination or user error during the encryption/decryption an unencrypted temporary file might be stored in the temporary directory. <strong>WARNING:</strong> a short time can delete a temporary file during the encryption/decryption and will lead to errors. A too long time will delete an unencrypted file late and can lead to a breach of security.">
- 10
- </configinteger>
- <configboolean name="securestore" desc="Should we enable Kastalia to store files encrypted? <strong>WARNING:</strong> This can cause high CPU load by the webserver.">
- false
- </configboolean>
- <configinteger name="memorysize" desc="The memory size which can be used for the encryption/decryption. This value cannot be greater than the memory_limit value in php.ini. If the value is set too large, you will get a php error message. <strong>WARNING:</strong> This value is important for the encryption/decryption. If you change this value and you already have files encrypted by Kastalia, these files can only be decrypted with the old memory size value.">
- 0
- </configinteger>
- <configinteger name="refreshcycle" desc="The refresh cycle of the browser in seconds during the encryption/decryption. A large value increase the waiting till the encryption/decryption will be done. A small value (and a higher number of users) can lead to many requests to the webserver and slow it down.">
- 1
- </configinteger>
- </configsection>
-</configuration>
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-/**
- *
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- */
-
-//das absolute Kastalia directory wird als Konstante definiert
-//um damit config Dateien zu includieren
-@define('KASTALIA_BASE', dirname(__FILE__));
-
-//die Basis von Kastalia wird includiert
-//um die Anmeldung zu ueberpruefen
-require_once(KASTALIA_BASE . '/lib/base.php');
-//die Konfigurationsdatei von Kastalia wird includiert
-//um alle Kastalia Einstellungen in diesem Skript nutzen zu koennen
-require(KASTALIA_BASE . '/config/conf.php');
-//das Menu von Kastalia wird includiert
-//damit das Menu dem Benutzer angezeigt wird
-require_once(KASTALIA_BASE . '/list.php');
-
-echo "<div class=\"header\">Kastalia Datastore - Decryption Password</div>\n";
-echo "<p><b>notice:</b> cookies and javascripts must be enabled to download files!</p>\n";
-
-//nun wird ueberprueft, ob das verschluesseln/entschluesseln von Dateien aktiviert wurde
-//falls nicht, wird eine Meldung ausgegeben und das Skript beendet
-if(!$conf['upload']['securestore']) {
- echo "Encryption/Decryption is disabled!";
- exit(0);
-}
-
-//hier wird ueberprueft, ob die zu herunterladende Datei ueberhaupt
-//uebergeben wurde, damit Manipulation verhindert wird und um Fehler zu vermeiden
-if(isset($_GET['kastalia_filename'])) {
- //hier wird ueber GET der Dateiname ermittelt
- $kastalia_filename = $_GET['kastalia_filename'];
- //hier wird ueberprueft, ob es sich bei der zu herunterladenden Datei um eine ".htaccess" Datei
- //handelt. Dabei werden allerdings auch Dateien herausgefiltert, die die Endung ".htaccess" haben.
- if(substr($kastalia_filename, -9) == ".htaccess") {
- echo "Error: Downloading .htaccess files out of the datastore not allowed!";
- exit(1);
- }
- //Ueberpruefung nach den Zeichenfolgen "/." und "./" damit
- //durch das Manipulieren der Variable kastalia_filename
- //keiner aus dem kastalia Datastore entkommen kann (durch Nutzung von "../")
- if(strpos($kastalia_filename,'/.') === false && strpos($kastalia_filename,'./') === false) {
- //hier wird ueberprueft, ob die zu entschluesselnde Datei existiert oder lesbar ist
- if(!is_readable($conf['datastore']['location'] . "/" . $kastalia_filename)) {
- echo "Error: File $kastalia_filename doesn't exist or is not readable!";
- exit(1);
- }
- //hier wird ueberprueft ob es sich bei dem Download um eine von Kastalia verschluesselte Datei handelt (Endung ".kastaliaenc")
- //falls es sich nicht um die von Kastalia verwendete Endung handelt, wird ein Fehler ausgegeben
- if(substr($kastalia_filename, -12) != ".kastaliaenc") {
- echo "Error: File doesn't have the Kastalia file extension!";
- exit(1);
- }
- }
- else {
- echo "Error: \$kastalia_filename in decrypt_menu.php contains illegal characters!";
- exit(1);
- }
-}
-else {
- echo "Error: \$kastalia_filename in decrypt_menu.php is not set!";
- exit(1);
-}
-?>
-
-<!-- hier werden die JavaScripte zum erzeugen des sha-1 hashes includiert //-->
-<script src="js/sha1.js" type="text/javascript" language="JavaScript"></script>
-
-<script type="text/javascript" language="JavaScript">
-<!--
-//diese function ueberprueft die Werte des Formulars
-function FormularCheck() {
- //hier wird ueberprueft ob das Passworteingabefeld leer nicht ist
- if(document.forms['decryptpassword'].elements['kastalia_password'].value != "") {
- //das eingegebene Passwort wird vor dem abschicken durch den sha-1 hash vom Passwort ersetzt
- //damit das Passwort nie im Klartext uebertragen wird, sondern nur der sha-1 hash zum ver/entschluesseln benutzt wird
- document.forms['decryptpassword'].elements['kastalia_password'].value = hex_sha1(document.forms['decryptpassword'].elements['kastalia_password'].value);
- return true;
- }
- else {
- alert('Error: Empty passwords not allowed!');
- return false;
- }
-}
-//-->
-</script>
-
-<form name="decryptpassword" method="post" action="download.php?kastalia_filename=<?php echo $kastalia_filename;?>" onsubmit="return FormularCheck()">
-<input name="kastalia_password" type="password" />
-<input type="submit" value="send" />
-</form>
-
-<?php
-//der footer wird includiert
-require KASTALIA_TEMPLATES . '/common-footer.inc';
-?>
\ No newline at end of file
+++ /dev/null
----
-v1.0.1
----
-
-[sqall] Fixed a problem with the filesize on the download page.
-[sqall] Alphabetic sorted file list.
-[sqall] Added fake upload loading bar.
-[sqall] w3c conformable HTML output.
-[sqall] JavaScript upload bug with IE 6 solved.
-[sqall] JavaScript bug with unreadable temp dir/disabled encryption solved.
-
-
----
-v1.0
----
-
-[sqall] Added file encryption feature.
-
----
-v0.9.1
----
-
-[sqall] Generate new filenames if file already exists
- (existing files cannot be overwritten).
-[sqall] Forbid uploading .htaccess files due to security reasons.
-
----
-v0.9
----
-
-[sqall] Added upload feature.
-
----
-v0.8
----
-
-[sqall] Finished application.
\ No newline at end of file
+++ /dev/null
-===========================
- Kastalia Development Team
-===========================
-
-
-Core Developers
-===============
-
-- Andre Pawlowski aka sqall <sqall@h4des.org>
\ No newline at end of file
+++ /dev/null
-=========================
- Installing Kastalia 1.0
-=========================
-
-.. contents:: Contents
-.. section-numbering::
-
-This document contains instructions for installing the Kastalia download application
-
-For information on the capabilities and features of Kastalia, see the file
-README_ in the top-level directory of the Kastalia distribution.
-
-
-Obtaining Kastalia
-==================
-
-Kastalia can be obtained from the authors website
-
- http://h4des.org/index.php?inhalt=kastalia
-
-
-Prerequisites
-=============
-
-To function properly, Kastalia **requires** the following:
-
-1. A working Horde installation.
-
- Kastalia runs within the `Horde Application Framework`_, a set of common
- tools for Web applications written in PHP. You must install Horde before
- installing Kastalia.
-
- .. Important:: Kastalia 1.0 requires version 3.0+ of the Horde Framework -
- earlier versions of Horde will **not** work.
-
- .. _`Horde Application Framework`: http://www.horde.org/horde/
-
- The Horde Framework can be obtained from the Horde website and FTP server,
- at
-
- http://www.horde.org/horde/
-
- ftp://ftp.horde.org/pub/horde/
-
- Many of Kastalia's prerequisites are also Horde prerequisites.
-
- .. Important:: Be sure to have completed all of the steps in the
- `horde/docs/INSTALL`_ file for the Horde Framework before
- installing Kastalia.
-
-2. Install the MCrypt module for php. (optional)
-
- Kastalia uses the MCrypt module for php to encrypt/decrypt files on the
- server. If you want to store files encrypted on the server you have to
- install this module.
-
- For further informations and to get MCrypt take a look at
-
- http://mcrypt.sourceforge.net/
-
- and
-
- http://php.net/manual/en/mcrypt.setup.php
-
-
-Installing Kastalia
-===================
-
-Kastalia is written in PHP, and must be installed in a web-accessible
-directory. The precise location of this directory will differ from system to
-system. Kastalia must be installed directly underneath Horde in the
-web server's document tree.
-
-Since Kastalia is written in PHP, there is no compilation necessary; simply
-expand the distribution where you want it to reside and rename the root
-directory of the distribution to whatever you wish to appear in the URL. For
-example, with the Apache web server's default document root of
-``/usr/local/apache/htdocs``, you would type::
-
- cd /usr/local/apache/htdocs/horde
- tar zxvf /path/to/kastalia-1.0.tar.gz
- mv kastalia-1.0 kastalia
-
-and would then find Kastalia at the URL::
-
- http://your-server/horde/kastalia/
-
-
-Configuring Kastalia
-====================
-
-1. Configuring Horde for Kastalia
-
- Register the application
-
- In ``horde/config/registry.php``, add the following lines:
-
- $this->applications['kastalia'] = array(
- 'fileroot' => dirname(__FILE__) . '/../kastalia',
- 'webroot' => $this->applications['horde']['webroot'] . '/kastalia',
- 'name' => _("Datastore"),
- 'status' => 'active',
- );
-
- $this->applications['kastalia-menu'] = array(
- 'status' => 'block',
- 'app' => 'kastalia',
- 'blockname' => 'tree_menu',
- 'menu_parent' => 'kastalia',
- );
-
-2. Configuring Kastalia
-
- You must login to Horde as a Horde Administrator to finish the
- configuration of Kastalia. Use the Horde ``Administration`` menu item to
- get to the administration page, and then click on the ``Configuration``
- icon to get the configuration page. Select ``Datastore`` from the
- selection list of applications. Fill in or change any configuration values
- as needed. When done click on ``Generate Kastalia Name Configuration`` to
- generate the ``conf.php`` file. If your web server doesn't have write
- permissions to the Kastalia configuration directory or file, it will not be
- able to write the file. In this case, go back to ``Configuration`` and
- choose one of the other methods to create the configuration file
- ``kastalia/config/conf.php``.
-
- Note for international users: Kastalia uses GNU gettext to provide local
- translations of text displayed by applications; the translations are found
- in the ``po/`` directory. If a translation is not yet available for your
- locale (and you wish to create one), see the ``horde/po/README`` file, or
- if you're having trouble using a provided translation, please see the
- `horde/docs/TRANSLATIONS`_ file for instructions.
-
-3. Securing Kastalia
-
- Before you can secure Kastalia, you need a secure Horde installation. Please
- read the file in `horde/docs/SECURITY`_ for Horde security information
- before proceeding.
-
- First you have to realize that every directory bellow your chosen Kastalia
- datastore will be downloadable with Kastalia. So if you choose the directory
- ``/`` every authorized Horde user can download everything readable
- from your server. The next point to secure your datastore is to place it
- outside the webroot for example ``/srv/kastalia/datastore``. If you
- do so, make the directory readable by the webserver and the files owned by
- ``root``. If your webserver runs as ``www.www``, do as follows:
-
- chown root:www kastalia/datastore/*
- chmod 440 kastalia/datastore/*
-
- An additional approach is to make Kastalia's configuration files owned by the
- user ``root`` and by a group which only the webserver user belongs to, and
- then making them readable only to owner and group. For example, if your
- webserver runs as ``www.www``, do as follows:
-
- chown root.www config/*
- chmod 440 config/*
-
- To ensure you have a secure file sharing application you should use _https_
- instead of http. We also recomment to use the option to store files encrypted
- (Prerequisites: 2. Install the MCrypt module for php).
-
-5. Testing Kastalia
-
- Once you have configured Kastalia, you can click on the ``Datastore`` link
- in the Horde menu. Kastalia will immediately list every file in the configured
- datastore. Clicking on a file will start the download.
-
-
-Obtaining Support
-=================
-
-If you encounter problems with Kastalia, help is available! Please contact the
-author of Kastalia.
-
-Thanks for using Kastalia!
-
-The Kastalia team
+++ /dev/null
-<?php
-/**
- * Release focus. Possible values:
- * 0 - N/A
- * 1 - Initial freshmeat announcement
- * 2 - Documentation
- * 3 - Code cleanup
- * 4 - Minor feature enhancements
- * 5 - Major feature enhancements
- * 6 - Minor bugfixes
- * 7 - Major bugfixes
- * 8 - Minor security fixes
- * 9 - Major security fixes
- */
+++ /dev/null
-================================
- Kastalia Development TODO List
-================================
-
--permission management
+++ /dev/null
-<?php
-/**
- *
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- */
-
-//das absolute Kastalia directory wird als Konstante definiert
-//um damit config Dateien zu includieren
-@define('KASTALIA_BASE', dirname(__FILE__));
-
-//die Konfigurationsdatei von Kastalia wird includiert
-//um alle Kastalia Einstellungen in diesem Skript nutzen zu koennen
-require(KASTALIA_BASE . '/config/conf.php');
-
-//bei dem download.php Skript macht ein includieren von base.php Probleme
-//und kann zu Fehlerhaften Downloads fuehren, deshalb wird ein manueller Anmeldecheck durchgefuehrt
-//################### <MANUELLER ANMELDE CHECK (WENN base.php NICHT INCLUDIERT WIRD)> ###################
-// Check for a prior definition of HORDE_BASE (perhaps by an auto_prepend_file
-// definition for site customization).
-if (!defined('HORDE_BASE')) {
- @define('HORDE_BASE', dirname(__FILE__) . '/..');
-}
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$registry = new Horde_Registry();
-try {
- $registry->pushApp('kastalia', array('logintasks' => true));
-} catch (Horde_Exception $e) {
- $registry->authenticateFailure('kastalia', $e);
-}
-//################### </MANUELLER ANMELDE CHECK (WENN base.php NICHT INCLUDIERT WIRD)> ###################
-
-//als erstes wird ueberprueft, ob die zu herunterladende Datei durch
-//eine dafuer vorgesehenen SESSION Variable definiert wurde
-//(diese SESSION Variable ist fuer downloads aus dem temporaeren Verzeichnis vorgesehen)
-if(isset($_SESSION['kastalia_temp_download'])) {
- $kastalia_filename = $_SESSION['kastalia_temp_download'];
- //nachdem die SESSION Variable in eine fuer das Skript lokalen Variable gespeichert worden ist
- //wird die SESSION Variable aus Sicherheits- und Konfliktgruenden geloescht
- unset($_SESSION['kastalia_temp_download']);
- //hier wird ueberprueft, ob es sich bei der zu herunterladenden Datei um eine ".htaccess" Datei
- //handelt. Dabei werden allerdings auch Dateien herausgefiltert, die die Endung ".htaccess" haben.
- if(substr($kastalia_filename, -9) == ".htaccess") {
- echo "Error: Downloading .htaccess files out of the temporary directory not allowed!";
- exit(1);
- }
- //hier wird ueberprueft, ob das verschluesselte speichern von Dateien aktiviert ist...
- if($conf['upload']['securestore']) {
- //... falls ja, werden weitere Pruefungen durchgefuerht
- //Ueberpruefung nach den Zeichenfolgen "/." und "./" damit
- //durch das Manipulieren der Variable kastalia_filename
- //keiner aus dem temporaeren Verzeichnis entkommen kann (durch Nutzung von "../")
- if(strpos($kastalia_filename,'/.') === false && strpos($kastalia_filename,'./') === false) {
- //nun wird der Download aus dem temporaeren Verzeichnis gestartet
- DownloadFile($conf['upload']['tempdir'], $kastalia_filename);
- //nachdem die Datei heruntergeladen wurde, muss sie geloescht werden,
- //damit keiner mehr Zugriff auf sie erhaelt
- if(!unlink($conf['upload']['tempdir'] . "/" . $kastalia_filename)) {
- echo "Error: Unable to delete temporary file after downloading!";
- exit(1);
- }
- }
- else {
- echo "Error: \$kastalia_filename in download.php contains illegal characters!";
- exit(1);
- }
- }
- else {
- //... ansonsten wird mit einer Meldung abgebrochen
- echo "Encryption/Decryption is disabled!";
- exit(0);
- }
-}
-//falls die SESSION Variable nicht gesetzt wurde...
-else {
- //...wird hier ueberprueft, ob mittels GET der Dateiname gesetzt worden ist
- if(isset($_GET['kastalia_filename'])) {
- //hier wird ueber GET der Dateiname ermittelt
- $kastalia_filename = $_GET['kastalia_filename'];
- //hier wird ueberprueft, ob es sich bei der zu herunterladenden Datei um eine ".htaccess" Datei
- //handelt. Dabei werden allerdings auch Dateien herausgefiltert, die die Endung ".htaccess" haben.
- if(substr($kastalia_filename, -9) == ".htaccess") {
- echo "Error: Downloading .htaccess files out of the datastore not allowed!";
- exit(1);
- }
- //Ueberpruefung nach den Zeichenfolgen "/." und "./" damit
- //durch das Manipulieren der Variable kastalia_filename
- //keiner aus dem kastalia Datastore entkommen kann (durch Nutzung von "../")
- if(strpos($kastalia_filename,'/.') === false && strpos($kastalia_filename,'./') === false) {
- //hier wird ueberprueft ob es sich bei dem Download um eine von Kastalia verschluesselte Datei handelt (Endung ".kastaliaenc")
- if(substr($kastalia_filename, -12) == ".kastaliaenc") { //SECURE STORED
- //hier wird serverseitig ueberprueft, ob ein leeres Passwort uebergeben wurde
- //falls ja, wird mit einem Error abgebrochen, da leere Passwoerter verboten sind
- if($_POST['kastalia_password'] == "") {
- echo "Error: Empty passwords not allowed!";
- exit(1);
- }
- //hier wird ueberprueft, ob das verschluesselte speichern von Dateien aktiviert ist
- if($conf['upload']['securestore']) {
- $_SESSION['kastalia_mode'] = "decrypt"; //diese Variable gibt den Modus an in welchem das Skript encrypt_decrypt_files.php ausgefuehrt werden soll
- $_SESSION['kastalia_input_name'] = substr($conf['datastore']['location'] . "/" . $kastalia_filename, 0, -12); //diese Variable gibt die zu entschluesselnde Datei an (ohne die Endung ".kastaliaenc")
- $_SESSION['kastalia_output_name'] = substr($conf['upload']['tempdir'] . "/" . basename($kastalia_filename), 0, -12); //diese Variable gibt den Ort fuer die entschluesselte Zieldatei an (der temporaere Ordner von Kastalia, das "basename" ist hier wichtig, da ansonsten auch die unterordner vom datastore im Dateinamen stecken)
- $_SESSION['kastalia_part_number'] = 0; //diese Variable gibt die aktuelle Entschluesselungsrunde an (die Beginnrunde ist immer 0)
- $_SESSION['kastalia_key'] = $_POST['kastalia_password']; //diese Variable gibt den Schluessel zum entschluesseln der Datei an
- //mit der encrypt_decrypt_files.php wird die Entschluesselung fuer die Datei ausgefuehrt
- //(diese besteht aus mehreren Teilschritten wobei der Browser automatisch das Skript in Intervallen neu aufruft)
- include('encrypt_decrypt_files.php');
- }
- else {
- //falls es deaktiviert ist, wird mit einer Meldung abgebrochen
- echo "Encryption/Decryption is disabled!";
- exit(0);
- }
- }
- //falls die zu herunterladende Datei keine von Kastalia verschluesselte Datei ist
- //wird der Download einfach gestartet
- else { //UNSECURE STORED
- DownloadFile($conf['datastore']['location'], $kastalia_filename);
- }
- }
- else {
- echo "Error: \$kastalia_filename in download.php contains illegal characters!";
- exit(1);
- }
- }
- //falls der Dateiname nicht gesetzt wurde, wird mit einer Fehlermeldung abgebrochen
- else{
- echo "Error: \$kastalia_filename in download.php is not set!";
- exit(1);
- }
-}
-
-//diese Funktion setzt die Header zum Download der Datei
-//und gibt die Datei an den Browser
-function DownloadFile($file_location,$file_name) {
- //Ueberpruefung ob Datei existiert und lesbar ist
- if(is_readable($file_location . '/' . $file_name)) {
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
- header('Content-Description: File Transfer');
- header('Content-Type: application/octet-stream');
- header('Content-Length: ' . filesize($file_location . '/' . $file_name));
- header('Content-Disposition: attachment; filename=' . basename($file_name));
- flush();
- readfile($file_location . '/' . $file_name);
- }
- else {
- echo "Error: File $file_name doesn't exist or is not readable!";
- exit(1);
- }
-}
-?>
+++ /dev/null
-<?php
-/**
- *
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- */
-
-//das absolute Kastalia directory wird als Konstante definiert
-//um damit config Dateien zu includieren
-@define('KASTALIA_BASE', dirname(__FILE__));
-
-//die Basis von Kastalia wird includiert
-//um die Anmeldung zu ueberpruefen
-require_once(KASTALIA_BASE . '/lib/base.php');
-//die Konfigurationsdatei von Kastalia wird includiert
-//um alle Kastalia Einstellungen in diesem Skript nutzen zu koennen
-require(KASTALIA_BASE . '/config/conf.php');
-//das Menu von Kastalia wird includiert
-//damit das Menu dem Benutzer angezeigt wird
-require_once(KASTALIA_BASE . '/list.php');
-
-echo "<div class=\"header\">Kastalia Datastore - Encryption/Decryption</div>\n";
-echo "<br />\n";
-
-//nun wird ueberprueft, ob das verschluesseln/entschluesseln von Dateien aktiviert wurde
-//falls nicht, wird eine Meldung ausgegeben und das Skript beendet
-if(!$conf['upload']['securestore']) {
- //mit dieser Funktion werden aus Sicherheitsgruenden nach der Verschluesselung
- //alle SESSION Variablen die damit zu tun haben geloescht
- UnsetSessionVars();
- echo "Encryption/Decryption is disabled!";
- exit(0);
-}
-
-//hier werden die fuer die Weiterverarbeitung noetigen SESSION und config Variablen in lokalen Variablen gespeichert
-$kastalia_mode = $_SESSION['kastalia_mode']; //diese Variable legt fest, ob ver- oder entschluesselt werden soll
-$input_name = $_SESSION['kastalia_input_name']; //gibt den Namen + Ort der Quelldatei an
-$output_name = $_SESSION['kastalia_output_name']; //gibt den Namen + Ort der Zieldatei an
-$kastalia_part_number = $_SESSION['kastalia_part_number']; //gibt die aktuelle ver/entschluesselungsrunde an
-$key = $_SESSION['kastalia_key']; //gibt den key zum ver/entschluesseln an
-$kastalia_memory_size = $conf['upload']['memorysize']; //gibt die groesse des zu Verfuegung stehenden Speichers an, mit diesem Wert wird die groesse des zu ver/entschluesselnden Teiles berechnet
-$refresh_cycle = $conf['upload']['refreshcycle']; //gibt an, wie lange nach Beendigung einer Ver/Entschluesselungsrunde der naechste Aufruf vom Browser gestartet wird
-
-//hier wird ueberprueft, ob der Schluessel fuer die Ver/Entschluesselung gesetzt wurde
-//falls nicht, wird abgebrochen
-if($key == "") {
- echo "Error: \$key in encrypt_decrypt_files.php is empty!<br />\n";
- //falls es sich um die Verschluesselung einer Datei handelt, muss die temporaere unverschluesselte Datei
- //unbedingt geloescht werden. Hier wird ueberprueft ob die Datei verschluesselt werden sollte
- if($kastalia_mode == "encrypt") {
- echo "deleting temporary file...<br />\n";
- //hier wird nun die temporaere Datei geloescht, falls ein Fehler auftreten sollte, wird ein Error ausgegeben
- if(!unlink($input_name)) {
- echo "Error: Unable to delete temporary file!<br />\n";
- echo "This constitutes a <b>breach of security</b> because the content of the uploaded file stored unencrypted.<br />\n";
- echo "Please contact the administrator to have the temporary file " . $input_name . " deleted.\n";
- }
- else {
- echo "...done.\n";
- }
- }
- //mit dieser Funktion werden aus Sicherheitsgruenden nach der Verschluesselung
- //alle SESSION Variablen die damit zu tun haben geloescht
- UnsetSessionVars();
- exit(1);
-}
-
-//in dieser switch-case Anweisung wird durch kastalia_mode entschieden ob ver- oder entschluesselt werden soll
-switch($kastalia_mode) {
- case "encrypt": //######################################### SPLIT AND ENCRYPT FILE #########################################
- //hier wird die Anzahl der Dateiteile berechnet, die auch gleichzeitig die Anzahl der Verschluesselungsrunden angibt
- $max_parts = ceil(filesize($input_name) / $kastalia_memory_size);
- //hier wird ueberprueft, ob alle Verschluesselungsrunden durchlaufen wurden...
- if($kastalia_part_number < $max_parts) {
- //... falls nein, wird die naechste Verschluesselungsrunde eingeleitet
- //mit dieser Funktion wird die Datei in Stuecken ausgelesen und verschluesselt wieder zusammengesetzt
- //je ein Stueck pro Verschluesselungsrunde
- SplitAndEncryptFile($input_name, $conf['upload']['tempdir'] . "/" . basename($output_name), $kastalia_part_number, $max_parts, $key);
- //hier werden die Variablen fuer das weitere vorgehen des Skriptes wieder in die SESSION Variablen gespeichert
- $_SESSION['kastalia_mode'] = "encrypt"; //diese Variable legt fest, ob ver- oder entschluesselt werden soll
- $_SESSION['kastalia_input_name'] = $input_name; //gibt den Namen + Ort der Quelldatei an
- $_SESSION['kastalia_output_name'] = $output_name; //gibt den Namen + Ort der Zieldatei an
- $_SESSION['kastalia_part_number'] = $kastalia_part_number + 1; //gibt die aktuelle ver/entschluesselungsrunde an (+1)
- $_SESSION['kastalia_key'] = $key; //gibt den key zum ver/entschluesseln an
-
- //##################### <HTML HEADER MANIPULATION> #####################
- //Header Manipulation zum aufrufen der naechsten Verschluesselungsrunde
- echo "<head>\n";
- echo "<meta http-equiv=\"refresh\" content=\"" . $refresh_cycle . "; URL=encrypt_decrypt_files.php\">\n";
- echo "</head>\n";
- echo "<body>\n";
- echo "<p>\n";
- echo "encrypting part " . ($kastalia_part_number + 1) . " of " . $max_parts . "<br />";
- echo "please wait...<br />";
- echo "</p>\n";
- echo "</body>\n";
- //##################### </HTML HEADER MANIPULATION> #####################
-
- }
- else {
- //... falls ja, werden die letzten Schritte nach der Verschluesselung durchgefuert
- //mit dieser Funktion werden aus Sicherheitsgruenden nach der Verschluesselung
- //alle SESSION Variablen die damit zu tun haben geloescht
- UnsetSessionVars();
- //hier wird die temporaere verschluesselte Datei an die richtige finale Stelle verschoben,
- //damit sie heruntergeladen werden kann
- if(!rename($conf['upload']['tempdir'] . "/" . basename($output_name) . ".kastaliaenc", $output_name . ".kastaliaenc")) {
- //sollte ein Fehler beim verschieben der temporaeren verschluesselten Datei auftreten
- //wird eine Fehlermeldung ausgegeben, aber nicht abgebrochen, da die nachfolgenden Befehle noch abgearbeitet werden muessen
- echo "Error: Encrypted file couldn't be moved to final position " . $output_name . ".kastaliaenc<br />\n";
- }
- echo "Encryption done...<br />\n";
- echo "File successfully stored under <b>" . substr($output_name, strlen($conf['datastore']['location'] . "/")) . "</b> !\n";
- //hier wird nun die temporaere unverschluesselte Datei geloescht (Wichtig: sollte hier ein Fehler auftreten
- //liegt eine unverschluesselte Version der Datei in dem temporaeren Verzeichnis!)
- if(!unlink($input_name)) {
- echo "Error: Unable to delete temporary file after encryption!<br />\n";
- echo "This constitutes a <b>breach of security</b> because the content of the uploaded file still stored unencrypted.<br />\n";
- echo "Please contact the administrator to have the temporary file " . $input_name . " deleted.\n";
- exit(1);
- }
- }
- break;
- case "decrypt": //######################################### DECRYPT AND MERGE FILES #########################################
- //hier wird die Endung ".kastaliaenc" an den input_name gesetzt, da die von Kastalia verschluesselten
- //Dateien immer diese Endung besitzen
- $temp_input_name = $input_name . ".kastaliaenc";
- //hier wird die Anzahl der Dateiteile berechnet, die auch gleichzeitig die Anzahl der Entschluesselungsrunden angibt
- $max_parts = ceil(filesize($temp_input_name) / $kastalia_memory_size);
- //hier wird ueberprueft, ob alle Entschluesselungsrunden durchlaufen wurden...
- if($kastalia_part_number < $max_parts) {
- //... falls nein, wird die naechste Entschluesselungsrunde eingeleitet
- //mit dieser Funktion wird die Datei in Stuecken ausgelesen und entschluesselt wieder zusammengesetzt
- //je ein Stueck pro Entschluesselungsrunde
- MergeAndDecryptFile($input_name, $output_name, $kastalia_part_number, $max_parts, $key);
- //hier werden die Variablen fuer das weitere vorgehen des Skriptes wieder in die SESSION Variablen gespeichert
- $_SESSION['kastalia_mode'] = "decrypt"; //diese Variable legt fest, ob ver- oder entschluesselt werden soll
- $_SESSION['kastalia_input_name'] = $input_name; //gibt den Namen + Ort der Quelldatei an
- $_SESSION['kastalia_output_name'] = $output_name; //gibt den Namen + Ort der Zieldatei an
- $_SESSION['kastalia_part_number'] = $kastalia_part_number + 1; //gibt die aktuelle ver/entschluesselungsrunde an (+1)
- $_SESSION['kastalia_key'] = $key; //gibt den key zum ver/entschluesseln an
-
- //##################### <HTML HEADER MANIPULATION> #####################
- //Header Manipulation zum aufrufen der naechsten Entschluesselungsrunde
- echo "<head>\n";
- echo "<meta http-equiv=\"refresh\" content=\"" . $refresh_cycle . "; URL=encrypt_decrypt_files.php\">\n";
- echo "</head>\n";
- echo "<body>\n";
- echo "<p>\n";
- echo "decrypting part " . ($kastalia_part_number + 1) . " of " . $max_parts . "<br />";
- echo "please wait...<br />";
- echo "</p>\n";
- echo "</body>\n";
- //##################### </HTML HEADER MANIPULATION> #####################
-
- }
- else {
- //... falls ja, werden die letzten Schritte nach der Entschluesselung durchgefuert
- //mit dieser Funktion werden aus Sicherheitsgruenden nach der Entschluesselung
- //alle SESSION Variablen die damit zu tun haben geloescht
- UnsetSessionVars();
- //diese Variable gibt fuer das download.php Skript den Dateinamen zum herunterladen an
- $_SESSION['kastalia_temp_download'] = basename($output_name);
-
- //##################### <HTML HEADER MANIPULATION> #####################
- //Header Manipulation zum aufrufen des Downloadskriptes
- echo "<head>\n";
- echo "<meta http-equiv=\"refresh\" content=\"" . $refresh_cycle . "; URL=download.php\">\n";
- echo "</head>\n";
- echo "<body>\n";
- echo "<p>\n";
- echo "starting download<br />";
- echo "please wait...<br />";
- echo "</p>\n";
- echo "</body>\n";
- //##################### </HTML HEADER MANIPULATION> #####################
-
- }
- break;
- default:
- //falls der Modus weder "encrypt" noch "decrypt" ist, ist ein unerwarteter Fehler aufgetreten
- echo "Error: Unexpected value of \$kastalia_mode in encrypt_decrypt_files.php!";
- //mit dieser Funktion werden aus Sicherheitsgruenden beim Abbruch
- //alle SESSION Variablen die mit der Ver/Entschluesselung zu tun haben geloescht
- UnsetSessionVars();
- exit(1);
- break;
-}
-
-//diese Funktion verschluesselt die errechneten Dateiteile und fuegt sie in eine Datei an die richtige Stelle
-function SplitAndEncryptFile($input_file_name, $output_name, $part_number, $max_parts, $key) {
- //hier wird der Name fuer die verschluesselte Datei mit der Endung ".kastaliaenc" versehen
- $output_file_name = $output_name . ".kastaliaenc";
- //hier wird ueberprueft ob die verschluesselte Enddatei schon existiert und es die erste Verschluesselungsrunde ist
- //(damit die gerade zu verschluesselnde und erstellte Datei nicht mit in die Pruefung einbezogen wird)
- //falls ja wird mit einem Error abgebrochen
- if($part_number == 0 && file_exists($output_file_name)) {
- echo "Error: File " . $output_file_name . " already exists! Stopping encryption!<br />";
- //wenn die verschluesselte Datei schon existiert, wird die temporaere unverschluesselte Datei
- //geloescht damit diese nicht auf dem Server unverschluesselt gespeichert bleibt
- echo "deleting temporary file...<br />\n";
- //hier wird nun die temporaere Datei geloescht, falls ein Fehler auftreten sollte, wird ein Error ausgegeben
- if(!unlink($input_file_name)) {
- echo "Error: Unable to delete temporary file!<br />\n";
- echo "This constitutes a <b>breach of security</b> because the content of the uploaded file stored unencrypted.<br />\n";
- echo "Please contact the administrator to have the temporary file " . $input_file_name . " deleted.\n";
- }
- else {
- echo "...done.\n";
- }
- //mit dieser Funktion werden aus Sicherheitsgruenden beim Abbruch
- //alle SESSION Variablen die mit der Ver/Entschluesselung zu tun haben geloescht
- UnsetSessionVars();
- exit(1);
- }
- //hier wird die zu verschluesselnde Datei fuer das Lesen geoeffnet
- if($input_file_handle = fopen($input_file_name, 'rb')) {
- $input_file_size = filesize($input_file_name);
- //hier wird die groesse (in Bytes) fuer die einzelnen zu verschluesselnden Datenteile berrechnet
- $parts_size = floor($input_file_size/$max_parts);
- //da durch die Groessenberechnung fuer die einzelnen Datenteile (durch die Nutzung von "floor")
- //ein Rest entstehen kann, wird dieser hier berrechnet um ihn an den letzten Datenteil anzuhaengen
- //damit kein Datenverlust entstehen kann
- $last_bytes = $input_file_size % $max_parts;
- //nun wird die Datei in die die verschluesselten Daten geschrieben werden sollen geoeffnet
- //(der Dateizeiger zeigt in diesem Modus auf das Ende der Datei)
- if($output_file_handle = fopen($output_file_name ,'ab')) {
- //hier wird der Dateizeiger an die richtige Position gesetzt um die Daten fuer die jetzige Verschluesselungsrunde zu lesen
- fseek($input_file_handle, $part_number * $parts_size, SEEK_SET);
- //hier wird ueberprueft, ob es sich um die letzte Verschluesselungsrunde handelt
- if($part_number == ($max_parts-1) ) {
- //die groesse des letzten Datenteils wird um den Rest ($last_bytes) der Groessenberechnung erhoeht
- fwrite($output_file_handle, EncryptData($key, fread($input_file_handle, $parts_size + $last_bytes)));
- }
- else {
- fwrite($output_file_handle, EncryptData($key, fread($input_file_handle, $parts_size)));
- }
- //die verschluesselte Zieldatei wird geschlossen
- fclose($output_file_handle);
- }
- else {
- echo "Error: Can't open file " . $output_file_name . "!";
- //mit dieser Funktion werden aus Sicherheitsgruenden beim Abbruch
- //alle SESSION Variablen die mit der Ver/Entschluesselung zu tun haben geloescht
- UnsetSessionVars();
- exit(1);
- }
- //die zu verschluesselnde Datei wird geschlossen
- fclose($input_file_handle);
- }
- else {
- echo "Error: Can't open file " . $input_file_name . "!";
- //mit dieser Funktion werden aus Sicherheitsgruenden beim Abbruch
- //alle SESSION Variablen die mit der Ver/Entschluesselung zu tun haben geloescht
- UnsetSessionVars();
- exit(1);
- }
- return true;
-}
-
-//diese Funktion entschluesselt die errechneten Dateiteile und fuegt sie in eine Datei an die richtige Stelle
-function MergeAndDecryptFile($input_name, $output_file_name, $part_number, $max_parts, $key) {
- //die Konfigurationsdatei von Kastalia wird includiert
- //um alle Kastalia Einstellungen in dieser function nutzen zu koennen
- require(KASTALIA_BASE . '/config/conf.php');
- //hier wird ueberprueft ob die entschluesselte Enddatei schon existiert (dies kann passieren wenn
- //jemand die Datei gerade entschluesselt um sie herunterzuladen) und es die erste Entschluesselungsrunde ist
- //(damit die gerade zu entschluesselnde und erstellte Datei nicht mit in die Pruefung einbezogen wird)
- //falls ja wird mit einem Error abgebrochen
- if(file_exists($output_file_name) && $part_number == 0) {
- echo "Error: File " . $output_file_name . " already exists! Stopping decryption!<br />\n";
- //mit dieser Funktion werden aus Sicherheitsgruenden beim Abbruch
- //alle SESSION Variablen die mit der Ver/Entschluesselung zu tun haben geloescht
- UnsetSessionVars();
- //hier wird die ctime von der schon existierenden Datei ermittelt um zu berechnen
- //wann Kastalia spaetestens diese Date iloeschen wird und es dem Nutzer mitzuteilen
- if($file_ctime = filectime($output_file_name)) {
- //hier wird berechnet wie lange die Datei noch laengstens bestehen wird bevor sie von Kastalia geloescht wird
- $file_ctime = $file_ctime + (60 * $conf['upload']['tempctime']) - time();
- //sollte die Zeitrechnung negativ werden, ist ein Fehler aufgetreten und eine andere Nachricht wird ausgegeben
- if($file_ctime >= 0) {
- //die Angabe in Minuten wird auf 2 stellen hinter dem Komma gerundet
- echo "Kastalia will delete the file in about " . round($file_ctime / 60, 2) . " minutes at the latest. Then try again.\n";
- }
- else {
- //wird ausgegeben wenn die Zeitrechnung negativ wird
- //und somit die automatische Loeschung nicht funktioniert hat
- echo "Please contact the administrator to have the file deleted.";
- }
- }
- else {
- //wird ausgegeben wenn die ctime Ermittlung erfolglos war und dementsprechend die automatische
- //Loeschung auch nicht erfolgen wird
- echo "Please contact the administrator to have the file deleted.";
- }
- exit(1);
- }
- //hier wird der Name fuer die verschluesselte Datei mit der Endung ".kastaliaenc" versehen
- //da sie so auf dem Dateisystem gespeichert wurde
- $input_file_name = $input_name . ".kastaliaenc";
- //die Datei wird zum schreiben geoeffnet mit dem Dateizeiger auf das Ende der Datei
- if($input_file_handle = fopen($input_file_name, 'rb')) {
- $input_file_size = filesize($input_file_name);
- //hier wird die groesse (in Bytes) fuer die einzelnen zu entschluesselnden Datenteile berrechnet
- $parts_size = floor($input_file_size/$max_parts);
- //da durch die Groessenberechnung fuer die einzelnen Datenteile (durch die Nutzung von "floor")
- //ein Rest entstehen kann, wird dieser hier berrechnet um ihn an den letzten Datenteil anzuhaengen
- //damit kein Datenverlust entstehen kann
- $last_bytes = $input_file_size % $max_parts;
- //nun wird die Datei in die die entschluesselten Daten geschrieben werden sollen geoeffnet
- //(der Dateizeiger zeigt in diesem Modus auf das Ende der Datei)
- if($output_file_handle = fopen($output_file_name, 'ab')) {
- //hier wird der Dateizeiger an die richtige Position gesetzt um die Daten fuer die jetzige Entschluesselungsrunde zu lesen
- fseek($input_file_handle, $part_number * $parts_size, SEEK_SET);
- //hier wird ueberprueft, ob es sich um die letzte Entschluesselungsrunde handelt
- if($part_number == ($max_parts-1) ) {
- //die groesse des letzten Datenteils wird um den Rest ($last_bytes) der Groessenberechnung erhoeht
- fwrite($output_file_handle, DecryptData($key, fread($input_file_handle, $parts_size + $last_bytes)));
- }
- else {
- fwrite($output_file_handle, DecryptData($key, fread($input_file_handle, $parts_size)));
- }
- //der entschluesselte Zieldatei wird geschlossen
- fclose($output_file_handle);
- }
- else {
- echo "Error: Can't open file " . $output_file_name . "!";
- //mit dieser Funktion werden aus Sicherheitsgruenden beim Abbruch
- //alle SESSION Variablen die mit der Ver/Entschluesselung zu tun haben geloescht
- UnsetSessionVars();
- exit(1);
- }
- //die zu entschluesselnde Datei wird geschlossen
- fclose($input_file_handle);
- }
- else {
- echo "Error: Can't open file " . $input_file_name . "!";
- //mit dieser Funktion werden aus Sicherheitsgruenden beim Abbruch
- //alle SESSION Variablen die mit der Ver/Entschluesselung zu tun haben geloescht
- UnsetSessionVars();
- exit(1);
- }
- return true;
-}
-
-//diese Funktion verschluesselt die uebergebenden Daten mit den uebergebenden key
-//und gibt die verschluesselten Daten zurueck
-function EncryptData($key, $plaintext) {
-//erstellt den initialisierungsvektor in der groesse des ausgewaehlten algorithmuses
-//aus der md5 summe des uebergebenden keys
-$iv = substr(md5($key), 0, mcrypt_get_iv_size(MCRYPT_BLOWFISH,MCRYPT_MODE_CFB));
-//verschluesselt die Daten mit dem angegebenen Modus und Algorithmuses
-return mcrypt_cfb(MCRYPT_BLOWFISH, $key, $plaintext, MCRYPT_ENCRYPT, $iv);
-}
-
-//diese Funktion entschluesselt die uebergebenden Daten mit den uebergebenden key
-//und gibt die entschluesselten Daten zurueck
-function DecryptData($key, $ciphertext) {
-//erstellt den initialisierungsvektor in der groesse des ausgewaehlten algorithmuses
-//aus der md5 summe des uebergebenden keys
-$iv = substr(md5($key), 0, mcrypt_get_iv_size(MCRYPT_BLOWFISH,MCRYPT_MODE_CFB));
-//entschluesselt die Daten mit dem angegebenen Modus und Algorithmuses
-return mcrypt_cfb(MCRYPT_BLOWFISH, $key, $ciphertext, MCRYPT_DECRYPT, $iv);
-}
-
-//diese Funktion loescht alle SESSION Variablen die mit der Ver/Entschluesselung zu tun haben
-function UnsetSessionVars() {
- unset($_SESSION['kastalia_mode']);
- unset($_SESSION['kastalia_input_name']);
- unset($_SESSION['kastalia_output_name']);
- unset($_SESSION['kastalia_part_number']);
- unset($_SESSION['kastalia_key']);
-}
-?>
-
-<?php
-//der footer wird includiert
-require KASTALIA_TEMPLATES . '/common-footer.inc';
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- */
-
-require dirname(__FILE__) . '/list.php';
-require KASTALIA_BASE . '/main.php';
+++ /dev/null
-<?php
-class Kastalia_Application extends Horde_Registry_Application
-{
- public $version = '1.0.1';
-
- /**
- * Add additional items to the menu.
- *
- * @param Horde_Menu $menu The menu object.
- */
- public function menu($menu)
- {
- return Kastalia::getMenu();
- }
-
-}
+++ /dev/null
-<?php
-/**
- *
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- * @package Tree_Menu
- */
-
-$block_name = _("Menu List");
-$block_type = 'tree';
-
-class Horde_Block_kastalia_tree_menu extends Horde_Block {
-
- var $_app = 'kastalia';
-
- function _buildTree(&$tree, $indent = 0, $parent = null)
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- $tree->addNode(
- $parent . '__upload',
- $parent,
- _("Upload"),
- $indent + 1,
- false,
- array(
- 'icon' => strval(Horde_Themes::img('menu/upload.png')),
- 'url' => Horde::url('upload_menu.php')
- )
- );
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Kastalia Base Class.
- *
- *
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- * @package Kastalia
- */
-class Kastalia {
-
- /**
- * Build Kastalia's list of menu items.
- */
- function getMenu()
- {
- global $conf, $registry, $browser, $print_link;
-
- $menu = new Horde_Menu(HORDE_MENU_MASK_ALL);
-
- $menu->add(Horde::url('upload_menu.php'), _("Upload"), 'menu/upload.png', Horde_Themes::img());
-
- return $menu;
- }
-
- //diese Funktion entfernt aus einem String alle hier angegebenen Sonderzeichen
- function ReplaceSpecialChars($text) {
- $charstochange = array("Ü","Ö","Ä","ä","ü","ö","ß"," ","'","\\","+","/");
- $changetochars = array("Ue","Oe","Ae","ae","ue","oe","ss","_","_","_","_","_");
- $text = str_replace($charstochange,$changetochars,$text);
- return $text;
- }
-
- //diese Funktion entfernt aus einem String alle hier angegebenen Sonderzeichen
- function ConvertToUriString($text) {
- $charstochange = array(" ");
- $changetochars = array("%20");
- $text = str_replace($charstochange,$changetochars,$text);
- return $text;
- }
-}
+++ /dev/null
-<?php
-/**
- * Kastalia base application file.
- *
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * This file brings in all of the dependencies that every Kastalia script will
- * need, and sets up objects that all scripts use.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- */
-
-// Check for a prior definition of HORDE_BASE (perhaps by an auto_prepend_file
-// definition for site customization).
-if (!defined('HORDE_BASE')) {
- @define('HORDE_BASE', dirname(__FILE__) . '/../..');
-}
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$registry = new Horde_Registry();
-try {
- $registry->pushApp('kastalia', array('logintasks' => true));
-} catch (Horde_Exception $e) {
- $registry->authenticateFailure('kastalia', $e);
-}
-$conf = &$GLOBALS['conf'];
-@define('KASTALIA_TEMPLATES', $registry->get('templates'));
-
-// Define the base file path of Kastalia.
-@define('KASTALIA_BASE', dirname(__FILE__) . '/..');
-
-// Start output compression.
-Horde::compressOutput();
+++ /dev/null
-<?php
-/**
- *
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- */
-
-@define('KASTALIA_BASE', dirname(__FILE__));
-require_once KASTALIA_BASE . '/lib/base.php';
-
-$title = _("List");
-
-require KASTALIA_TEMPLATES . '/common-header.inc';
-require KASTALIA_TEMPLATES . '/menu.inc';
+++ /dev/null
-Deny from all
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<help>
-
-<entry id="overview">
- <title>Übersicht</title>
- <heading>Was ist Kastalia?</heading>
- <para>
- Diese Anwendung erlaubt den sicheren Austausch von Dateien. Jede
- hochgeladene Datei kann verschlüsselt und sicher gespeichert werden. Der
- Benutzer muss keine weiteren Programme für die Ver- oder Entschlüsselung
- installieren.
-</para>
-</entry>
-
-</help>
+++ /dev/null
-<?xml version='1.0'?>
-<help>
-
-<entry id="kastalia-overview">
- <title>Kastalia Overview</title>
-
- <heading>What is Kastalia?</heading>
- <para>Use this module as a secure file sharing application for the Horde Framework.
- Every uploaded file can be encrypted by Kastalia and stored secure in the datastore.
- The user does not need any additional program for the encryption/decryption.</para>
-</entry>
-
-</help>
+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Horde Project
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2009-11-21 13:39+0100\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: list.php:15
-msgid "List"
-msgstr ""
-
-#: lib/Block/tree_menu.php:13
-msgid "Menu List"
-msgstr ""
-
-#: lib/Kastalia.php:25 lib/Block/tree_menu.php:28
-msgid "Upload"
-msgstr ""
+++ /dev/null
-<?php
-/**
- *
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- */
-
-//das absolute Kastalia directory wird als Konstante definiert
-//um damit config Dateien zu includieren
-@define('KASTALIA_BASE', dirname(__FILE__));
-
-//die Basis von Kastalia wird includiert
-//um die Anmeldung zu ueberpruefen
-require_once(KASTALIA_BASE . '/lib/base.php');
-//die Konfigurationsdatei von Kastalia wird includiert
-//um alle Kastalia Einstellungen in diesem Skript nutzen zu koennen
-require(KASTALIA_BASE . '/config/conf.php');
-
-
-
-
-echo $GLOBALS['registry']->getAuth();
-
-echo $registry->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
-if($registry->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
- echo "TASTA";
- exit(0);
-}
-
-?>
-
-<script type="text/javascript" language="JavaScript">
-<!--
-//diese function ist fuer das auf und zuklappen der Dateiauswahl zustaendig
-function OpenCloseMenu(div_name,img_name){
- //falls der Ordner zugeklappt (Auswahlliste ausgeblendet) ist, wird dieser aufgeklappt (Auswahlliste eingeblendet)
- //ansonsten ist er aufgeklappt (Auswahlliste eingeblendet) und wird zugeklappt (Auswahlliste ausgeblendet)
- if (document.getElementById(div_name).style.display=='none') {
- document.getElementById(div_name).style.display='block';
- document.getElementById(img_name).src='themes/graphics/directory_open.gif';
- }
- else {
- document.getElementById(div_name).style.display='none';
- document.getElementById(img_name).src='themes/graphics/directory_closed.gif';
- }
-}
-//-->>
-</script>
-
-<div class="header">Kastalia Datastore - Download</div>
-<p><b>notice:</b> cookies and javascripts must be enabled to download files!</p>
-
-<?php
-//die function die den temporaeren Ordner ausliest und alle temporaeren Dateien
-//loescht die zu lange existieren wird aufgerufen. Dies geschieht, da durch
-//Benutzer seitige Fehler (z.B. schliessen des Browsers beim verschluesseln der Datei)
-//unverschluesselte temporaere Dateien gespeichert bleiben
-CleanDirectory($conf['upload']['tempdir']);
-
-//die function die den Ordner ausliest und ausgibt wird aufgerufen
-ScanDirectory($conf['datastore']['location']);
-
-//diese function liest das Datastore rekursiv aus
-//und gibt den Inhalt aus
-function ScanDirectory($dir_name) {
- //die Konfigurationsdatei von Kastalia wird includiert
- //damit die Konfigurationen auch innerhalb dieser Funktion benutzt werden koennen
- require(KASTALIA_BASE . '/config/conf.php');
- if ($dir_handle = opendir($dir_name)) {
- echo "<ul class=\"kastalia_root\">\n";
- //diese beiden Arrays werden dazu benoetigt, die Ordner- bzw
- //Dateinamen zwischen zu speichern und zu sortieren
- $directory_array = array();
- $file_array = array();
- //der Inhalt des Ordners wird in dieser Schleife durchgegangen und jedes Element bearbeitet
- //falls es sich um einen Ordner handelt, wird dieser wieder rekursiv geoeffnet und die Elemente bearbeitet
- while(false !== ($file = readdir($dir_handle))) {
- //Ueberpruefung ob es sich bei dem Element um einen Ordner handelt
- //und ob dieser nicht in der Liste der Ordner ist, die nicht angezeigt werden sollen
- //falls ja, wird der Name in einem Array gespeichert
- if($file != "." && $file != ".." && is_dir($dir_name . '/' . $file) && !in_array($file, $conf['datastore']['directoryexcludes'])) { //SAVE DIRECTORYNAMES
- $directory_array[] = $file;
- }
- //Ueberpruefung ob es sich bei dem Element um eine Datei handelt (und keine .htaccess Datei)
- //falls ja, wird dieses Element in einem Array gespeichert
- if($file != "." && $file != ".." && $file != ".htaccess" && is_file($dir_name . '/' . $file)) { //SAVE FILENAMES
- $file_array[] = $file;
- }
- }
- //die Arrays mit den Ordnernamen und den Dateinamen werden sortiert
- asort($directory_array);
- asort($file_array);
- //in dieser Schleife werden die Ordnernamen aus dem sortierten Array
- //ausgegeben und deren Inhalt jeweils noch einmal
- //mit Aufruf dieser Funktion ausgelesen
- foreach($directory_array as $directory_element) { //PRINT DIRECTORY
- //hier wird der eindeutige Elementname fuer das JavaScript Menu festgelegt
- //(der Pfad zu dem Ordner mit entfernten Sonderzeichen wie z.B. '/', da dieser einmalig)
- $tempscriptname = Kastalia::ReplaceSpecialChars(substr($dir_name . '/' . $directory_element, strlen($conf['datastore']['location'] . '/')));
- echo "<li class=\"kastalia_directory\">\n";
- echo "<a class=\"kastalia_directory\" href=\"javascript:OpenCloseMenu('". $tempscriptname . "_div','" . $tempscriptname . "_img');\">\n";
- echo "<img id=\"" . $tempscriptname . "_img\" src=\"themes/graphics/directory_closed.gif\" class=\"kastalia_picture\" alt=\"directory image\" />\n";
- echo $directory_element;
- echo "\n</a>\n";
- echo "</li>\n";
- echo "<li style=\"list-style: none; display: inline\">\n";
- echo "<div id=\"". $tempscriptname . "_div\" class=\"kastalia_filelist\" style=\"display: none;\">\n";
- //der Ordner wird nun mit einem erneuten aufrufen der Funktion ausgelesen und der Inhalt bearbeitet
- ScanDirectory($dir_name . '/' . $directory_element);
- echo "</div>\n";
- echo "</li>\n";
- }
- //in dieser Schleife werden die dateinamen aus dem sortierten Array
- //ausgegeben und jeweils nochmal ueberprueft
- //ob diese Dateien mit Kastalia verschluesselt wurden oder nicht
- foreach($file_array as $file_element) {
- //hier wird ueberprueft, ob die Datei von Kastalia verschluesselt wurde (die Endung ".kastaliaenc" wird dafuer benutzt)
- if(substr($file_element, -12) == ".kastaliaenc") { //PRINT ENCRYPTED FILE DOWNLOAD
- echo "<li class=\"kastalia_file_enc\">\n";
- //hier wird der Link fuer das Entschluesselungs Menu fuer diese Datei zusammengesetzt
- //aus dem Link werden vorher alle Zeichen die in der URI nicht stehen duerfen ersetzt (bsp. " " mit "%20")
- echo "<a href=\"decrypt_menu.php?kastalia_filename=" . Kastalia::ConvertToUriString(substr($dir_name . '/' . $file_element, strlen($conf['datastore']['location'] . '/'))) . "\">\n";
- //hier wird bei der Ausgabe des Dateinamens die Endung .kastaliaenc entfernt
- echo substr($file_element, 0, -12);
- //Nutzerfreundliche Ausgabe der Dateigroesse (auf 2 stellen hinter dem Komma gerundet)
- $tempfilesize = filesize($dir_name . "/" . $file_element) / 1024 / 1024;
- if($tempfilesize < 1) {
- //hier wird ueberprueft, ob die ermittelte Dateigroesse negativ ist
- //dies kann passieren, wenn die Datei groesser als 2GB ist und der 32Bit signed integer
- //Wert der Rueckgabe von filesize() zu gross ist
- if($tempfilesize < 0) {
- echo " (>2GB)";
- }
- else {
- echo " (" . round(filesize($dir_name . "/" . $file_element) / 1024, 2) . "kB)";
- }
- }
- else {
- echo " (" . round($tempfilesize, 2) . "MB)";
- }
- echo "</a>\n";
- echo "</li>\n";
- }
- //falls es sich nicht um eine von Kastalia verschluesselte Datei handelt
- else { //PRINT UNENCRYPTED FILE DOWNLOAD
- echo "<li class=\"kastalia_file\">\n";
- //hier wird der Link fuer das herunterladen der Datei zusammengesetzt
- //aus dem Link werden vorher alle Zeichen die in der URI nicht stehen duerfen ersetzt (bsp. " " mit "%20")
- echo "<a href=\"download.php?kastalia_filename=" . Kastalia::ConvertToUriString(substr($dir_name . '/' . $file_element, strlen($conf['datastore']['location'] . '/'))) . "\">\n";
- echo $file_element;
- //Nutzerfreundliche Ausgabe der Dateigroesse (auf 2 stellen hinter dem Komma gerundet)
- $tempfilesize = filesize($dir_name . "/" . $file_element) / 1024 / 1024;
- if($tempfilesize < 1) {
- //hier wird ueberprueft, ob die ermittelte Dateigroesse negativ ist
- //dies kann passieren, wenn die Datei groesser als 2GB ist und der 32Bit signed integer
- //Wert der Rueckgabe von filesize() zu gross ist
- if($tempfilesize < 0) {
- echo " (>2GB)";
- }
- else {
- echo " (" . round(filesize($dir_name . "/" . $file_element) / 1024, 2) . "kB)";
- }
- }
- else {
- echo " (" . round($tempfilesize, 2) . "MB)";
- }
- echo "</a>\n";
- echo "</li>\n";
- }
- }
- echo "</ul>\n";
- //nachdem der Ordner vollstaendig ausgelesen wurde, wird dieser geschlossen
- closedir($dir_handle);
- }
- else {
- echo "Error: Can't open directory \"$dir_name\"!";
- }
-}
-
-//diese Funktion liest den temporaeren Ordner von Kastalia aus
-//und loescht alle Dateien die zu lange existieren
-function CleanDirectory($dir_name) {
- //die Konfigurationsdatei von Kastalia wird includiert
- //damit die Konfigurationen auch innerhalb dieser Funktion benutzt werden koennen
- require(KASTALIA_BASE . '/config/conf.php');
- if($dir_handle = opendir($dir_name)) {
- //der Inhalt des Ordners wird in dieser Schleife durchgegangen und jedes Element bearbeitet
- //falls es sich um eine Datei handelt, wird die ctime von dieser Datei ermittelt
- while(false !== ($file = readdir($dir_handle))) {
- //Ueberpruefung ob es sich bei dem Element um eine Datei handelt (und keine .htaccess Datei)
- if($file != "." && $file != ".." && $file != ".htaccess" && is_file($dir_name . '/' . $file)) {
- //hier wird die ctime der Datei fuer weitere Pruefungen ermittelt
- if($file_ctime = filectime($dir_name . '/' . $file)) {
- //die ctime der Datei (wird angegeben in Sekunden seit January 1 1970 00:00:00 GMT)
- //wird mit der in der Config angegebenen Dauer (in Minuten)
- //wie lange eine temporaere Datei existieren darf addiert...
- $file_ctime = $file_ctime + (60 * $conf['upload']['tempctime']);
- //... um zu ueberpruefen, ob die aktuelle Zeit in Sekunden seit der Unix Epoche
- //(January 1 1970 00:00:00 GMT) groesser oder gleich der errechneten Zeit ist
- //die eine temporaere Datei existieren darf
- if($file_ctime <= time()) {
- //wenn die aktuelle Zeit in Sekunden seit der Unix Epoche groesser ist
- //wird die temporaere Datei geloescht
- if(!unlink($dir_name . '/' . $file)) {
- //falls ein Fehler beim loeschen auftritt, wird eine Error Nachricht ausgegeben
- //aber das Skript nicht abgebrochen, da der Rest noch abgearbeitet werden soll
- echo "Error: Unable to delete temporary file!<br />\n";
- echo "This constitutes a <b>breach of security</b> because the content of the uploaded file stored unencrypted.<br />\n";
- echo "Please contact the administrator to have the temporary file " . $dir_name . '/' . $file . " deleted.\n";
- }
- }
- }
- else {
- //falls die ctime der Datei nicht ermittelt werden kann, wird eine Nachricht ausgegeben
- //aber nicht abgebrochen, da der Rest des Skriptes noch abgearbeitet werden soll
- echo "Error: Unable to get the ctime of the file: " . $dir_name . '/' . $file . "!<br />";
- echo "This constitutes a <b>breach of security</b> because the uploaded file will not be deleted and the content stored unencrypted.<br />\n";
- echo "Please contact the administrator to have the file deleted.\n";
- }
- }
- }
- }
- else {
- echo "Error: Can't open directory \"$dir_name\"!";
- }
-}
-?>
-
-<?php
-//der footer wird includiert
-require KASTALIA_TEMPLATES . '/common-footer.inc';
-?>
\ No newline at end of file
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php if (isset($GLOBALS['notification'])) $GLOBALS['notification']->notify(array('listeners' => array('audio'))); ?>
-</body>
-</html>
+++ /dev/null
-<?php
-if (isset($language)) {
- header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
- header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Kastalia: Copyright 2009 Andre Pawlowski -->
-<!-- Horde Project: http://www.horde.org/ | Kastalia: http://h4des.org/index.php?inhalt=kastalia -->
-<!-- Horde Licenses: http://www.horde.org/licenses/ -->
-<?php echo !empty($language) ? '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . strtr($language, '_', '-') . '" lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-
-
-<head>
-
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
- $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-<link href="<?php echo Horde_Themes::img('favicon.ico', array('nohorde' => true)) ?>" rel="SHORTCUT ICON" />
-<?php Horde_Themes::includeStylesheetFiles() ?>
-</head>
-
-<body>
+++ /dev/null
-<div id="menu">
- <?php echo Kastalia::getMenu()->render() ?>
-</div>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
-<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
+++ /dev/null
-a.kastalia_directory {
- text-decoration: none;
- font-weight: bold;
- color: #000000;
-}
-
-div.kastalia_filelist {
- margin-left: 0px;
-}
-
-img.kastalia_picture {
- border: 0px;
- margin-right: 2px;
-}
-
-li.kastalia_directory {
- list-style: none;
- display: block;
- padding-top: 5px;
- padding-left: 4px;
-}
-
-li.kastalia_file {
-/* list-style: none;*/
- list-style-image: url('graphics/file.gif');
- padding-left: 4px;
-}
-
-li.kastalia_file_enc {
-/* list-style: none;*/
- list-style-image: url('graphics/file_enc.gif');
- padding-left: 4px;
-}
-
-select.kastalia_upload {
- width: 300px;
-}
-
-ul.kastalia_root {
- list-style-position: inside;
- margin-left: 5px;
- padding-left: 10px;
- vertical-align: middle;
-}
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- *
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- */
-
-//das absolute Kastalia directory wird als Konstante definiert
-//um damit config Dateien zu includieren
-@define('KASTALIA_BASE', dirname(__FILE__));
-
-//die Basis von Kastalia wird includiert
-//um die Anmeldung zu ueberpruefen
-require_once(KASTALIA_BASE . '/lib/base.php');
-//die Konfigurationsdatei von Kastalia wird includiert
-//um alle Kastalia Einstellungen in diesem Skript nutzen zu koennen
-require(KASTALIA_BASE . '/config/conf.php');
-//das Menu von Kastalia wird includiert
-//damit das Menu dem Benutzer angezeigt wird
-require_once(KASTALIA_BASE . '/list.php');
-
-echo "<div class=\"header\">Kastalia Datastore - Upload</div>\n";
-echo "<br />\n";
-
-//nun wird ueberprueft, ob das hochladen von Dateien ueberhaupt erlaubt ist
-//falls nicht, wird eine Meldung ausgegeben und das Skript beendet
-if(!$conf['upload']['uploadenabled']) {
- echo "File uploads are disabled!";
- exit(0);
-}
-
-//hier wird ueberprueft, ob der Zielordner zum hochladen gesetzt ist
-if(isset($_POST['kastalia_targetlocation'])) {
- //hier wird mittels POST der uploadzielordner ermittelt
- $kastalia_targetlocation = $_POST['kastalia_targetlocation'];
- //Ueberpruefung nach den Zeichenfolgen "/." und "./" damit
- //durch das Manipulieren der Variable kastalia_targetlocation
- //keiner aus dem kastalia Datastore entkommen kann (durch Nutzung von "../")
- if(strpos($kastalia_targetlocation,'/.') === false && strpos($kastalia_targetlocation,'./') === false) {
- //ueberpruefung ob die Datei eine ".htaccess" ist, falls ja wird zur Sicherheit abgebrochen, damit niemand diese
- //ueberschreiben kann oder damit regeln fuer den webserver festlegen kann
- if(Kastalia::ReplaceSpecialChars($_FILES['userfile']['name']) != ".htaccess") {
- //hier wird serverseitig ueberprueft, ob die hochgeladene Datei die Endung ".kastaliaenc" besitzt
- //falls ja wird mit einem Fehler abgebrochen, da diese intern von Kastalia verwendet wird
- //um von Kastalia verschluesselte Dateien ausfindig zu machen
- if(substr(Kastalia::ReplaceSpecialChars($_FILES['userfile']['name']), -12) == ".kastaliaenc") {
- echo "Error: File extension \".kastaliaenc\" not allowed!";
- exit(1);
- }
- //hier wird der absolute Pfad mit Dateiname (Sonderzeichen werden entfernt) zusammengesetzt
- //wohin die Datei hochgeladen werden soll
- $target_directory = $conf['datastore']['location'] . $kastalia_targetlocation;
- $target_location = $target_directory . "/" . Kastalia::ReplaceSpecialChars($_FILES['userfile']['name']);
- //diese Funktion fuehrt den Upload aus
- UploadFile($target_location);
- }
- else {
- echo "Error: .htaccess files not allowed for upload!";
- exit(1);
- }
- }
- else {
- echo "Error: \$kastalia_targetlocation in upload.php contains illegal characters!";
- exit(1);
- }
-}
-//falls der Dateiname nicht gesetzt wurde, wird mit einer Fehlermeldung abgebrochen
-else {
- echo "Error: \$kastalia_targetlocation in upload.php is not set!";
- exit(1);
-}
-
-//diese Funktion ueberprueft Fehler die beim upload vorkommen koennen
-//und fuehrt den upload durch
-function UploadFile($upload_target) {
- //die Konfigurationsdatei von Kastalia wird includiert
- require(KASTALIA_BASE . '/config/conf.php');
- if(!empty($_FILES)) {
- switch ($_FILES['userfile']['error']) {
- case 0: //UPLOAD_ERR_OK
- //hier wird die in der Config eingestellte maximale Dateigroesse mit
- //der Dateigroesse der hochgeladenen Datei abgeglichen
- if($_FILES['userfile']['size'] <= $conf['upload']['maxfilesize']) {
- //Sicherheitsueberpruefung ob Datei mittels HTTP POST hochgeladen wurde
- //und nicht eine andere Datei weiterbearbeitet wird
- if(is_uploaded_file($_FILES['userfile']['tmp_name'])) {
- //hier wird ueberprueft ob der Upload verschluesselt gespeichert werden soll
- if(isset($_POST['kastalia_secure_store']) && $_POST['kastalia_secure_store'] == true) { //SECURE STORE
- //hier wird ueberprueft, ob das verschluesselte Speichern von Dateien ueberhaupt aktiviert ist
- //falls nicht, wird die Weiterverarbeitung abgebrochen und eine Meldung ausgegeben
- if(!$conf['upload']['securestore']) {
- echo "Encryption/Decryption is disabled!";
- exit(1);
- }
- //sollte die Datei mit der Endung ".kastaliaenc" schon existieren, wird ein "_" an sie drangehaengt,
- //damit die existierende Datei nicht ueberschrieben wird
- while(file_exists($upload_target . ".kastaliaenc")) {
- $upload_target = $upload_target . "_";
- }
- //hier wird serverseitig ueberprueft ob das Passwort fuer die Verschluesselung leer ist
- //falls ja, wird mit einem Fehler abgebrochen, da dies verboten ist (und die temporaere Datei von
- //PHP automatisch geloescht)
- if($_POST['kastalia_password'] == "") {
- echo "Error: Empty passwords not allowed!";
- exit(1);
- }
- //die hochgeladene Datei wird nun ersteinmal in das temporaere Verzeichnis von Kastalia verschoben
- //und mit der Endung "_kastalia" versehen
- if(move_uploaded_file($_FILES['userfile']['tmp_name'], $conf['upload']['tempdir'] . "/" . basename($_FILES['userfile']['tmp_name']) . "_kastalia")) {
- //die SESSION Variablen fuer die Verschluesselung werden gesetzt
- $_SESSION['kastalia_mode'] = "encrypt"; //diese Variable gibt den Modus an in welchem das Skript encrypt_decrypt_files.php ausgefuehrt werden soll
- $_SESSION['kastalia_input_name'] = $conf['upload']['tempdir'] . "/" . basename($_FILES['userfile']['tmp_name']) . "_kastalia"; //diese Variable gibt die zu verschluesselnde Datei an
- $_SESSION['kastalia_output_name'] = $upload_target; //diese Variable gibt das Ziel fuer die verschluesselte Datei an
- $_SESSION['kastalia_part_number'] = 0; //diese Variable gibt die aktuelle Verschluesselungsrunde an (die Beginnrunde ist immer 0)
- $_SESSION['kastalia_key'] = $_POST['kastalia_password']; //diese Variable beinhaltet das Passwort, welches fuer die Verschluesselung benutzt wird
- //mit der encrypt_decrypt_files.php wird die Verschluesselung fuer die Datei ausgefuehrt
- //(diese besteht aus mehreren Teilschritten wobei der Browser automatisch das Skript in Intervallen neu aufruft)
- include('encrypt_decrypt_files.php');
- }
- else {
- echo "Error: File couldn't be moved to temporary directory!";
- //Debuging
- //print_r($_FILES);
- exit(1);
- }
- }
- else { //UNSECURE STORE
- //sollte die Datei schon existieren, wird ein "_" an sie drangehaengt,
- //damit die existierende Datei nicht ueberschrieben wird
- while(file_exists($upload_target)) {
- $upload_target = $upload_target . "_";
- }
- //die hochgeladene Datei wird nun an die dafuer vorgesehene stelle kopiert
- if(move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_target)) {
- echo "File successfully stored under <b>" . substr($upload_target, strlen($conf['datastore']['location'] . "/")) . "</b> !\n";
- }
- else {
- echo "Error: File couldn't be moved!";
- //Debuging
- //print_r($_FILES);
- exit(1);
- }
- }
- }
- else {
- echo "Error: Used file is not uploaded via HTTP POST!";
- exit(1);
- }
-
- }
- else {
- echo "Error: The uploaded file exceeds the configured file size!";
- exit(1);
- }
- break;
- case 1: //UPLOAD_ERR_INI_SIZE
- echo "Error: The uploaded file exceeds the upload_max_filesize directive in php.ini!";
- exit(1);
- break;
- case '2': //UPLOAD_ERR_FORM_SIZE
- echo "Error: The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form!";
- exit(1);
- break;
- case 3: //UPLOAD_ERR_PARTIAL
- echo "Error: The file was only partially uploaded!";
- exit(1);
- break;
- case 4: //UPLOAD_ERR_NO_FILE
- echo "Error: No file was uploaded!";
- exit(1);
- break;
- case 6: //UPLOAD_ERR_NO_TMP_DIR
- echo "Error: Missing a temporary folder!";
- exit(1);
- break;
- case 7: //UPLOAD_ERR_CANT_WRITE
- echo "Error: Failed to write file to disk!";
- exit(1);
- break;
- case 8: //UPLOAD_ERR_EXTENSION
- echo "Error: File upload stopped by extension!";
- exit(1);
- break;
- default:
- echo "Error: Unexpected value of \$_FILES['file']['error'] in upload.php!";
- exit(1);
- break;
- }
- }
- else {
- echo "Error: \$_FILES is empty!<br /><br />";
- echo "Possible reasons:<br />";
- echo "-upload_max_filesize, post_max_size or memory_limit value is too low in php.ini.<br />";
- echo "-file_uploads is set to Off in php.ini.";
- exit(1);
- }
-}
-?>
-
-<?php
-//der footer wird includiert
-require KASTALIA_TEMPLATES . '/common-footer.inc';
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- *
- * This product includes software developed by the Horde Project (http://www.horde.org/).
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Andre Pawlowski aka sqall <sqall@h4des.org>
- */
-
-//das absolute Kastalia directory wird als Konstante definiert
-//um damit config Dateien zu includieren
-@define('KASTALIA_BASE', dirname(__FILE__));
-
-//die Basis von Kastalia wird includiert
-//um die Anmeldung zu ueberpruefen
-require_once(KASTALIA_BASE . '/lib/base.php');
-//die Konfigurationsdatei von Kastalia wird includiert
-//um alle Kastalia Einstellungen in diesem Skript nutzen zu koennen
-require(KASTALIA_BASE . '/config/conf.php');
-//das Menu von Kastalia wird includiert
-//damit das Menu dem Benutzer angezeigt wird
-require_once(KASTALIA_BASE . '/list.php');
-
-echo "<div class=\"header\">Kastalia Datastore - Upload</div>\n";
-
-//nun wird ueberprueft, ob das hochladen von Dateien ueberhaupt erlaubt ist
-//falls nicht, wird eine Meldung ausgegeben und das Skript beendet
-if (!$conf['upload']['uploadenabled']) {
- echo "<br />";
- echo "File uploads are disabled!";
- exit(0);
-}
-?>
-
-<!-- hier werden die JavaScripte zum erzeugen des sha-1 hashes includiert //-->
-<script src="js/sha1.js" type="text/javascript" language="JavaScript"></script>
-
-<script type="text/javascript" language="JavaScript">
-<!--
-//diese function ueberprueft die Werte des Formulars
-function FormularCheck() {
- //hier wird ueberprueft ob eine Datei ausgewaehlt wurde
- if(document.forms['upload'].elements['userfile'].value != "") {
- //nun wird die Dateiendung ".kastaliaenc" extrahiert um zu pruefen, ob die Datei sie besitzt
- var file_extension = document.forms['upload'].elements['userfile'].value;
- file_extension = file_extension.substring(file_extension.length-12,file_extension.length);
- file_extension = file_extension.toLowerCase();
- //hier wird browserseitig ueberprueft, ob die Dateiendung ".kastaliaenc" nicht hochgeladen werden soll
- if(file_extension == '.kastaliaenc') {
- alert('Error: File extension \".kastaliaenc\" not allowed!');
- return false;
- }
- //hier wird ueberprueft ob ein Zielordner fuer den upload ausgewaehlt wurde
- if(document.forms['upload'].elements['kastalia_targetlocation'].selectedIndex != -1) {
- <?php
- //hier wird nun mit PHP ueberprueft, ob die Dateienverschluesselung aktiviert und das temporaere
- //Verzeichnis schreibbar ist, da ansonsten das Element welches im JavaScript abgefragt wird nicht
- //existiert und das JavaScript einen Fehler verursacht
- if($conf['upload']['securestore'] && is_writable($conf['upload']['tempdir'])) {
- //hier wird nun browserseitig ueberprueft, ob das verschluesselte speichern der Daten aktiviert wurde
- echo "if(document.forms['upload'].elements['kastalia_secure_store'].checked == true) {\n";
- //hier wird nun ueberprueft, ob das Passwort leer ist, falls ja, wird ein Error
- //zurueck gegeben und abgebrochen
- echo "if(document.forms['upload'].elements['kastalia_password'].value == '') {\n";
- echo "alert('Error: Empty passwords not allowed!');\n";
- echo "return false;\n";
- echo "}\n";
- echo "else {\n";
- //falls das Passwort gueltig ist und das verschluesselte speichern der Daten aktiviert wurde
- //wird das eingegebene Passwort vor dem abschicken durch einen sha-1 hash des Passwortes ersetzt
- //damit das Passwort nie im Klartext uebertragen wird, sondern nur der sha-1 hash zum ver/entschluesseln benutzt wird
- echo "document.forms['upload'].elements['kastalia_password'].value = hex_sha1(document.forms['upload'].elements['kastalia_password'].value);\n";
- echo "}\n";
- echo "}\n";
- }
- ?>
- //falls das verschluesselte speichern von Daten nicht aktiviert wurde
- //oder die Ueberpruefungen des Passworts schon stattfanden
- //wird true zurueck gegeben und der Loader sichtbar gemacht und das Menu unsichtbar
- document.getElementById("loader").style.display='block';
- document.getElementById("upload_menu").style.display='none';
- return true;
- }
- else {
- alert('Error: No upload directory chosen!');
- return false;
- }
- }
- else {
- alert('Error: No file chosen!');
- return false;
- }
-}
-
-//diese Funktion zeigt im Browser die Passworteingabe an
-//sobald die checkbox zum verschluesselten speichern aktiviert wurde
-function ShowPasswordInput(input_id) {
- //hier wird ueberprueft, ob die checkbox aktiviert ist...
- if(document.forms['upload'].elements['kastalia_secure_store'].checked == true) {
- //...falls ja, wird die Passworteingabe sichtbar
- document.getElementById(input_id).style.display='block';
- }
- else {
- //...falls nein, wird die Passworteingabe unsichtbar
- document.getElementById(input_id).style.display='none';
- }
-}
-
-//diese Funktion kopiert das von Kastalia generierte Passwort in das Passworteingabefeld
-function CopySuggestedPassword() {
- document.forms['upload'].elements['kastalia_password'].value = document.forms['upload'].elements['kastalia_generated_password'].value;
-}
-//-->
-</script>
-
-<!--##################### <Informations Header> #####################//-->
-<p><b>notice:</b> cookies and javascripts must be enabled to upload files! | maximal upload size:
-
-<?php
-//Nutzerfreundlichere Ausgabe der maximalen upload file size auf zwei stellen hinter dem Komma gerundet
-$tempfilesize = $conf['upload']['maxfilesize'] / 1024 / 1024;
-if ($tempfilesize < 1) {
- echo round($conf['upload']['maxfilesize'] / 1024, 2) . "kB";
-}
-else {
- echo round($tempfilesize, 2) . "MB";
-}
-?>
-
-</p>
-<!--##################### </Informations Header> #####################//-->
-
-<!--##################### <Loader> #####################//-->
-<div id="loader" style="display:none;">
-<p>please wait...</p>
-<img border="0" src="themes/graphics/loader.gif" />
-</div>
-<!--##################### </Loader> #####################//-->
-
-<!--##################### <Form> #####################//-->
-<div id="upload_menu" style="display:block;">
-<form name="upload" enctype="multipart/form-data" method="post" action="upload.php" onsubmit="return FormularCheck()">
-<u>choose file:</u><input type="hidden" name="max_file_size" value="<?php echo $conf['upload']['maxfilesize']?>" />
-<input name="userfile" type="file" />
-<input type="submit" value="send" />
-<br />
-
-<?php
-//hier wird ueberprueft, ob die Option die Daten verschluesselt speichern zu lassen aktiviert ist
-//um die Eingabefelder fuer die Verschluesselung anzeigen zu lassen oder nicht
-if($conf['upload']['securestore']) {
- //hier wird ueberprueft ob das temporaere Verzeichnis auch beschreibbar ist
- //denn ansonsten wuerde ein verschluesseln der Daten nicht funktionieren
- if(is_writable($conf['upload']['tempdir'])) {
- //wenn das temporaere Verzeichnis beschreibbar ist, werden die EIngabefelder fuer die Verschluesselung ausgegeben
- echo "<br /><u>encrypt file?:</u>\n";
- echo "<input type=\"checkbox\" name=\"kastalia_secure_store\" onclick=\"ShowPasswordInput('password_input')\" />\n";
- //dieser Teil wird nur angezeigt, wenn die checkbox zum
- //verschluesselten speichern der Daten aktiviert ist
- echo "<div id=\"password_input\" style=\"display:none\">\n";
- echo "<br /><u>password:</u>\n";
- echo "<input name=\"kastalia_password\" type=\"password\" />\n";
- echo "<input type=\"button\" value=\"insert suggested password\" onclick=\"CopySuggestedPassword()\" />\n";
- echo "<br /><u>suggested password:</u>\n";
- echo "<input name=\"kastalia_generated_password\" type=\"text\" value=\"" . CreateRandomPassword(10) . "\" disabled=\"disabled\" />\n";
- echo "</div>\n";
- }
- //falls das temporaere Verzeichnis nicht beschreibbar ist, wird eine Warnmeldung ausgegeben
- //und die Option Daten verschluesselt zu speichern wird ausgeblendet
- else {
- echo "<br />Warning: The option to store files encrypted is enabled by the administrator but still deactivated by Kastalia itself!<br />\n";
- echo "Check if the temporary directory exists and is writable.\n";
- }
-}
-?>
-
-<br />
-<br />
-<p><u>choose folder:</u></p>
-<select name="kastalia_targetlocation" size="20" class="kastalia_upload">
-
-<?php
-//diese if-Verzweigung ueberprueft das datastore selber
-//nach schreibrechten (Sonderfall der in der Scanfunction nicht geprueft werden kann)
-if(is_dir($conf['datastore']['location']) && is_writable($conf['datastore']['location'])) {
- echo "<option>/</option>";
-}
-//diese function scannt den Inhalt vom datastore
-//nach Ordnern mit schreibrechten und gibt diese dann aus
-ScanDirectory($conf['datastore']['location']);
-?>
-
-</select>
-</form>
-</div>
-<!--##################### </Form> #####################//-->
-
-<?php
-//diese function liest das datastore rekursiv aus
-//und gibt alle Ordner mit schreibzugriff in einer Auswahlliste aus
-function ScanDirectory($dir_name) {
- //die Konfigurationsdatei von Kastalia wird includiert
- //damit die Konfigurationen innerhalb dieser Funktion auch benutzt werden koennen
- require(KASTALIA_BASE . '/config/conf.php');
- if($dir_handle = opendir($dir_name)) {
- //hier wird unser Array in dem die Ordnernamen zwischengespeichert werden deklariert
- $directory_array = array();
- //das Verzeichnis wird durchlaufen und der Inhalt untersucht
- while(false !== ($file = readdir($dir_handle))) {
- //Ueberpruefung ob es sich bei dem Element um einen Ordner handelt
- //und dieser nicht in der Liste der nicht aufzulistenden Ordner steht...
- if($file != "." && $file != ".." && is_dir($dir_name . '/' . $file) && !in_array($file, $conf['datastore']['directoryexcludes'])) {
- //...falls ja, wird dieser zu unserem Array hinzugefuegt
- $directory_array[] = $dir_name . '/' . $file;
- }
- }
- //wenn das Verzeichnis ausgelesen wurde, wird unser Array sortiert
- asort($directory_array);
- //nun wird jedes einzelne Element unseres Arrays durchlaufen...
- foreach($directory_array as $directory_element) {
- //...und auf Schreibrechte ueberprueft, sind welche vorhanden
- //wird der Ordner als Uploadordner ausgegeben
- if(is_writable($directory_element)) {
- echo "<option>";
- echo substr($directory_element, strlen($conf['datastore']['location']));
- echo "</option>";
- }
- //die Funktion wird noch einmal aufgerufen mit dem aktuellen Ordner um zu ueberpruefen
- //ob Unterordner Schreibrechte enthalten
- ScanDirectory($directory_element);
- }
- closedir($dir_handle);
- }
- else {
- echo "Error: Can't open directory \"$dir_name\"!";
- exit(1);
- }
-}
-
-//diese Funktion generiert ein zufaelliges Passwort mit der uebergebenden laenge
-function CreateRandomPassword($passwordlength) {
- //diese Zeichen koennen alle in dem Passwort vorkommen (beliebig veraenderbar)
- $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-#*!$%=";
- $password = '';
- for($i=0;$i<$passwordlength;$i++) {
- $randomnumber = mt_rand() % strlen($chars);
- $password = $password . substr($chars, $randomnumber, 1);
- }
- return $password;
-}
-?>
-
-<?php
-//der footer wird includiert
-require KASTALIA_TEMPLATES . '/common-footer.inc';
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * Add
- *
- * $Id: add.php 1186 2009-01-21 10:24:00Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-/**
- * This routine removes all attributes from a given tag except
- * the attributes specified in the array $attr.
- * Author daneel@neezine.net 22-Aug-2005 05:08
- * http://www.php.net/manual/en/function.strip-tags.php
- *
- * @param string $msg text to clean
- * @param string $tag tag to clean
- * @param string $attr attributest to leave
- *
- * @return string $msg cleaned text
- */
-function stripeentag($msg, $tag, $attr = array())
-{
- $lengthfirst = 0;
- while (strstr(substr($msg, $lengthfirst), "<$tag ") != "")
- {
- $imgstart = $lengthfirst + strpos(substr($msg,$lengthfirst), "<$tag ");
- $partafterwith = substr($msg, $imgstart);
- $img = substr($partafterwith, 0, strpos($partafterwith, ">") + 1);
- $img = str_replace(" =", "=", $msg);
- $out = "<$tag";
-
- for ($i=0; $i <= (count($attr) - 1); $i++) {
- $long_val = strpos($img, " ", strpos($img, $attr[$i] . "=")) - (strpos($img, $attr[$i] . "=") + strlen($attr[$i]) + 1);
- $val = substr($img, strpos($img, $attr[$i] . "=") + strlen($attr[$i]) + 1, $long_val);
- if (strlen($val)>0) {
- $attr[$i] = " ".$attr[$i]."=".$val;
- } else {
- $attr[$i] = "";
- }
- $out .= $attr[$i];
- }
-
- $out .= ">";
- $partafter = substr($partafterwith, strpos($partafterwith, ">") + 1);
- $msg = substr($msg, 0, $imgstart) . $out . $partafter;
- $lengthfirst = $imgstart + 3;
- }
-
- return $msg;
-}
-
-/**
- * Max upload size msg
- */
-function _max_upload_size()
-{
- static $msg;
-
- if ($msg) {
- return $msg;
- }
-
- $filesize = ini_get('upload_max_filesize');
- if (substr($filesize, -1) == 'M') {
- $filesize = $filesize * 1048576;
- }
- $filesize = News::format_filesize($filesize);
-
- $postsize = ini_get('post_max_size');
- if (substr($postsize, -1) == 'M') {
- $postsize = $postsize * 1048576;
- }
- $postsize = News::format_filesize($postsize);
-
- $msg = sprintf(_("Maximum file size: %s; with a total of: %s"),
- $filesize, $postsize);
-
- return $msg;
-}
-
-// Is logged it?
-if (!$registry->isAuthenticated()) {
- $notification->push(_("Only authenticated users can post news."), 'horde.warning');
- $registry->authenticateFailure('news');
-}
-
-// Default vars
-$title = _("Add news");
-$default_lang = News::getLang();
-$id = Horde_Util::getFormData('id', false);
-$return = Horde_Util::getFormData('return', false);
-
-// We just delete default image?
-if ($id && Horde_Util::getFormData('submitbutton') == _("Delete existing picture")) {
- $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(0, $id));
- if ($sources instanceof PEAR_Error) {
- $notification->push($sources);
- } else {
- News::deleteImage($id);
- News::getUrlFor('news', $id)->redirect();
- }
-}
-
-// Prepare form
-$vars = Horde_Variables::getDefaultVariables();
-$form = new Horde_Form($vars, '', 'addnews');
-$form->addHidden('', 'return', 'text', false, true);
-
-if ($id) {
- $form->setButtons(array(_("Update"), _("Delete existing picture")), _("Reset"));
-} else {
- $form->setButtons(array(_("Save")), _("Reset"));
-}
-
-// General
-$form->setSection('content', _("Content"), '', false);
-$form->addVariable(_("News content"), 'content', 'header', false);
-
-$v = &$form->addVariable(_("Publish"), 'publish', 'datetime', true, false, false, News::datetimeParams());
-$v->setDefault(date('Y-m-d H:i:s'));
-$form->addVariable(_("Primary category"), 'category1', 'enum', true, false, false, array($news_cat->getEnum(), _("-- select --")));
-
-// Sources
-$sources = $GLOBALS['news']->getSources();
-if ($sources instanceof PEAR_Error) {
- $notification->push($sources);
-} elseif (!empty($sources)) {
- $form->addVariable(_("Source"), 'source', 'enum', false, false, false, array($sources, _("-- select --")));
-}
-$form->addVariable(_("Source link"), 'sourcelink', 'text', false, false);
-
-// Languages
-foreach ($conf['attributes']['languages'] as $key) {
- $flag = (count($conf['attributes']['languages']) > 1) ? News::getFlag($key) . ' ' : '';
- $form->addVariable($flag . _("Title"), "title_$key", 'text', ($key == $default_lang) ? true : false);
- if ($conf['attributes']['tags']) {
- $form->addVariable($flag . _("Tags"), "tags_$key", 'text', false, false, _("Enter one or more keywords that describe your news. Separate them by spaces."));
- }
- $form->addVariable($flag . _("Content"), "content_$key", 'longtext', ($key == $default_lang) ? true : false , false, false, array(20, 120));
-}
-
-// Additional
-$form->setSection('attributes', _("Attributes"), '', true);
-$form->addVariable(_("Additional news attributes"), 'attributes', 'header', false);
-$form->addVariable(_("Secondary category"), 'category2', 'enum', false, false, false, array($news_cat->getEnum(), _("-- select --")));
-$form->addVariable(_("Sort order"), 'sortorder', 'enum', false, false, false, array(range(0, 10)));
-$form->addVariable(_("Parents"), 'parents', 'intList', false, false, _("Enter news ids separated by commas."));
-
-if ($registry->hasMethod('forums/doComments')) {
- $form->addVariable(sprintf(_("Threads in %s"), $registry->get('name', 'agora')), 'threads', 'intList', false, false, _("Enter threads separated by commas."));
-}
-
-$form->setSection('images', _("Images"), '', true);
-$form->addVariable(_("News images"), 'content', 'header', false);
-$form->addVariable(_max_upload_size(), 'description', 'description', false);
-
-$form->addVariable(_("Picture"), 'picture_0', 'image', false, false, false, array(false));
-
-foreach ($conf['attributes']['languages'] as $key) {
- $flag = (count($conf['attributes']['languages']) > 1) ? News::getFlag($key) . ' ' : '';
- $form->addVariable($flag . _("Picture comment"), "caption_0_$key", 'text', false);
-}
-
-// Link to a gallery
-if ($conf['attributes']['ansel-images']
- && $registry->hasMethod('images/listGalleries')
- && $registry->images->countGalleries() > 0) {
-
- $form->addVariable(_("Enter gallery ID or upload images below"), 'description', 'description', false);
-
- if ($registry->images->countGalleries() > 50) {
- $form->addVariable(_("Gallery"), 'gallery', 'int', false, false);
- } else {
- $ansel_galleries = $registry->images->listGalleries();
- $galleries = array();
- foreach ($ansel_galleries as $gallery_id => $gallery) {
- $galleries[$gallery_id] = $gallery['attribute_name'];
- }
- $form->addVariable(_("Gallery"), 'gallery', 'enum', false, false, false, array($galleries, true));
- }
-}
-
-if ($registry->hasMethod('images/listGalleries')) {
- $images = 4;
-}
-
-if ($images > 1) {
- $form->addVariable(_("Images will be added to a gallery linked with this article. You can edit and manage images in gallery."), 'description', 'description', false);
- for ($i = 1; $i < $images; $i++) {
- $form->addVariable(_("Picture") . ' ' . $i, 'picture_' . $i, 'image', false, false, false, array(false));
- $form->addVariable(_("Caption") . ' ' . $i, 'caption_' . $i, 'text', false);
- }
-}
-
-if ($conf['attributes']['attachments']) {
- $form->setSection('files', _("Files"), '', true);
-
- $form->addVariable(_max_upload_size(), 'description', 'description', false);
-
- foreach ($conf['attributes']['languages'] as $key) {
- $flag = (count($conf['attributes']['languages']) > 1) ? News::getFlag($key) . ' ' : '';
- for ($i = 1; $i < 6; $i++) {
- $form->addVariable($flag . ' ' . _("File") . ' ' . $i, 'file_' . $key . '_' . $i, 'file', false);
- }
- }
-}
-
-if ($registry->isAdmin(array('permission' => 'news:admin'))) {
- $form->setSection('admin', _("Admin"), '', true);
- $form->addVariable(_("News administrator settings"), 'content', 'header', false);
-
- if ($conf['attributes']['sponsored']) {
- $form->addVariable(_("Sponsored"), 'sponsored', 'boolean', false);
- }
-
- // Allow commeting this content
- if ($conf['comments']['allow'] != 'never' && $registry->hasMethod('forums/doComments')) {
- $form->addVariable(_("Disallow comments"), 'disable_comments', 'boolean', false, false);
- }
-
- // Link to selling
- $apis = array();
- foreach ($registry->listAPIs() as $api) {
- if ($registry->hasMethod($api . '/getSellingForm')) {
- $apis[$api] = array();
- try {
- $articles = $registry->call($api . '/listCostObjects');
- if (!empty($articles)) {
- foreach ($articles[0]['objects'] as $item) {
- $apis[$api][$item['id']] = $item['name'];
- }
- }
- } catch (Horde_Exception $e) {
- $notification->push($e);
- }
- }
- }
-
- if (!empty($apis)) {
- $v = &$form->addVariable(_("Selling item"), 'selling', 'mlenum', false, false, false, array($apis));
- }
-
- // Show from
- if ($registry->hasMethod('forms/getForms')) {
- $available = $registry->call('forms/getForms');
- if ($available instanceof PEAR_Error) {
- $notification->push($available, 'horde.warning');
- $available = array();
- }
- $forms = array();
- foreach ($available as $f) {
- $forms[$f['form_id']] = $f['form_name'];
- }
-
- $form->addVariable(_("Form ID"), 'form_id', 'enum', false, false, false, array($forms, true));
- $form->addVariable(_("Form to"), 'form_ttl', 'datetime', false);
- }
-}
-
-// Process form
-if ($form->validate()) {
-
- $status_inserted = false;
- $allowed_cats = $news_cat->getAllowed(Horde_Perms::DELETE);
- $form->getInfo(null, $info);
-
- // Check permissions
- $info['status'] = News::UNCONFIRMED;
- $info['editor'] = '';
- $info['category1'] = (int)$info['category1'];
- $info['category2'] = (int)@$info['category2'];
-
- if (!empty($allowed_cats) &&
- (in_array($info['category1'], $allowed_cats) || in_array($info['category2'], $allowed_cats))) {
- $info['editor'] = $GLOBALS['registry']->getAuth();
- $info['status'] = News::CONFIRMED;
- }
-
- // Multi language
- $info['chars'] = strlen(preg_replace('/\s\s+/', '', trim(strip_tags($info["content_$default_lang"]))));
-
- foreach ($conf['attributes']['languages'] as $key) {
- if (!$info["title_$key"]) {
- continue;
- }
- $info['body'][$key]['title'] = $info["title_$key"];
- $info['body'][$key]['content'] = $info["content_$key"];
- $info['body'][$key]['caption'] = empty($info["caption_0_$key"]) ? '' : $info["caption_0_$key"];
- $info['body'][$key]['tags'] = $conf['attributes']['tags'] ? $info["tags_$key"] : '';
- unset($info["title_$key"]);
- unset($info["content_$key"]);
- unset($info["caption_$key"]);
- unset($info["tags_$key"]);
-
- if (strpos($info['body'][$key]['content'], '<') === FALSE) {
- $info['body'][$key]['content'] = nl2br(trim($info['body'][$key]['content']));
- } else {
- $info['body'][$key]['content'] = trim(stripeentag($info['body'][$key]['content'], 'p'));
- $info['body'][$key]['content'] = trim(stripeentag($info['body'][$key]['content'], 'font'));
- }
- $info['chars'] = strlen(strip_tags($info['body'][$key]['content']));
- }
-
- // Selling
- if (empty($info['selling'][1])) {
- $info['selling'] = '';
- } else {
- $info['selling'] = $info['selling'][1] . '|' . $info['selling'][2];
- }
-
- // Clean up parents ID
- if ($info['parents']) {
- $info['parents'] = explode(',', trim($info['parents']));
- foreach ($info['parents'] as $i => $parent_id) {
- if (intval($parent_id) == 0) {
- unset($info['parents'][$i]);
- }
- }
- $info['parents'] = implode(',', array_unique($info['parents']));
- }
-
- // Save as current version
- if (empty($id)) {
-
- $id = $news->write_db->nextID($news->prefix);
- if ($id instanceof PEAR_Error) {
- $notification->push($id);
- Horde::url('browse.php')->redirect();
- }
-
- $query = 'INSERT INTO ' . $news->prefix
- . ' (sortorder, status, publish, submitted, updated, user, editor, sourcelink, source,'
- . ' sponsored, parents, category1, category2, chars, attachments, gallery, selling,'
- . ' threads, form_id, form_ttl) '
- . ' VALUES (?, ?, ?, NOW(), NOW(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
-
- $data = array($info['sortorder'],
- $info['status'],
- $info['publish'],
- $GLOBALS['registry']->getAuth(),
- $info['editor'],
- @$info['sourcelink'],
- isset($info['source']) ? $info['source'] : '',
- empty($info['sponsored']) ? 0 : 1,
- $info['parents'],
- $info['category1'],
- $info['category2'],
- $info['chars'],
- sizeof(@$info['attachments']),
- empty($info['gallery']) ? 0 : $info['gallery'],
- $info['selling'],
- $info['threads'],
- empty($info['form_id']) ? 0 : (int)$info['form_id'],
- empty($info['form_ttl']) ? 0 : (int)$info['form_ttl']);
-
- $status_inserted = true;
-
- } else {
-
- $query = 'UPDATE ' . $news->prefix . ' SET '
- . 'sortorder = ?, publish = ?, updated = NOW(), editor = ?, sourcelink = ?, source = ?, '
- . 'sponsored = ?, parents = ?, category1 = ?, category2 = ?, '
- . 'chars = ?, attachments = ?, gallery = ?, selling = ?, threads = ?, '
- . 'form_id = ?, form_ttl = ? WHERE id = ?';
-
- $data = array($info['sortorder'],
- $info['publish'],
- $info['editor'],
- @$info['sourcelink'],
- isset($info['source']) ? $info['source'] : '',
- empty($info['sponsored']) ? 0 : 1,
- $info['parents'],
- $info['category1'],
- $info['category2'],
- $info['chars'],
- sizeof(@$info['attachments']),
- empty($info['gallery']) ? 0 : $info['gallery'],
- $info['selling'],
- $info['threads'],
- empty($info['form_id']) ? 0 : (int)$info['form_id'],
- empty($info['form_ttl']) ? 0 : (int)$info['form_ttl'],
- $id);
- }
-
- $result = $news->write_db->query($query, $data);
- if ($result instanceof PEAR_Error) {
- $notification->push($result->getDebugInfo(), 'horde.error');
- Horde::url('edit.php')->redirect();
- }
-
- // Picture
- $images_uploaded = array();
- if (isset($info['picture_0']['uploaded'])) {
- if ($info['picture_0']['uploaded'] instanceof PEAR_Error) {
- if ($info['picture_0']['uploaded']->getCode() != UPLOAD_ERR_NO_FILE) {
- $notification->push($info['picture_0']['uploaded']->getMessage(), 'horde.warning');
- }
- } else {
- $images_uploaded[] = 0;
- $result = News::saveImage($id, $info['picture_0']['file']);
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- } else {
- $news->write_db->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(1, $id));
- }
- }
- }
-
- for ($i = 1; $i < $images; $i++) {
- if (isset($info['picture_' . $i]['uploaded'])) {
- if ($info['picture_' . $i]['uploaded'] instanceof PEAR_Error) {
- if ($uploaded->getCode() != UPLOAD_ERR_NO_FILE) {
- $notification->push($uploaded->getMessage(), 'horde.warning');
- }
- } else {
- $images_uploaded[] = $i;
- }
- }
- }
-
- // Don't create a galler if no picture or only default one was uploaded
- if (!empty($images_uploaded) &&
- !(count($images_uploaded) == 1 && $images_uploaded[0] == 0)) {
-
- // Do we have a gallery?
- if (empty($info['gallery'])) {
- $abbr = Horde_String::substr(strip_tags($info['body'][$default_lang]['content']), 0, $conf['preview']['list_content']);
- try {
- $result = $registry->images->createGallery(null,
- array('name' => $info['body'][$default_lang]['title'],
- 'desc' => $abbr));
- $info['gallery'] = $result;
- } catch (Horde_Exception $e) {
- $notification->push(_("There was an error creating gallery: ") . $e->getMessage(), 'horde.warning');
- }
- }
-
- if (!empty($info['gallery'])) {
- $news->write_db->query('UPDATE ' . $news->prefix . ' SET gallery = ? WHERE id = ?', array($info['gallery'], $id));
- foreach ($images_uploaded as $i) {
- try {
- $registry->images->saveImage($info['gallery'],
- array('filename' => $info['picture_' . $i]['file'],
- 'description' => $info['caption_' . ($i == 0 ? $i . '_' . $default_lang: $i)],
- 'type' => $info['picture_' . $i]['type'],
- 'data' => file_get_contents($info['picture_' . $i]['file'])));
- } catch (Horde_Exception $e) {
- $notification->push(_("There was an error with the uploaded image: ") . $e->getMessage(), 'horde.warning');
- }
- }
- }
- }
-
- // Files
- if ($conf['attributes']['attachments']) {
- $uploaded = false;
- $form->setSection('files', _("Files"), '', true);
- foreach ($conf['attributes']['languages'] as $key) {
- for ($i = 1; $i < 6; $i++) {
- $input = 'file_' . $key . '_' . $i;
- try {
- $GLOBALS['browser']->wasFileUploaded($input);
- $file_id = $news->write_db->nextID($news->prefix . '_files');
- if ($file_id instanceof PEAR_Error) {
- $notification->push($file_id);
- } else {
- $result = News::saveFile($file_id, $info[$input]['file']);
- if ($result instanceof PEAR_Error) {
- $notification->push($result->getMessage(), 'horde.warning');
- } else {
- $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_files (file_id, news_id, news_lang, file_name, file_size, file_type) VALUES (?, ?, ?, ?, ?, ?)',
- array($file_id, $id, $key, $info[$input]['name'], $info[$input]['size'], $info[$input]['type']));
- if ($result instanceof PEAR_Error) {
- $notification->push($result->getMessage(), 'horde.warning');
- }
- }
- }
- } catch (Horde_Browser_Exception $e) {
- if ($e->getCode() != UPLOAD_ERR_NO_FILE) {
- $notification->push($e->getMessage(), 'horde.warning');
- }
- }
- }
- }
- if ($uploaded) {
- $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET attachments = ? WHERE id = ?', array(1, $id));
- if ($result instanceof PEAR_Error) {
- $notification->push($result->getMessage(), 'horde.warning');
- }
- }
- }
-
- // Comments
- if (isset($info['disable_comments']) && $info['disable_comments']) {
- $news->write_db->query('UPDATE ' . $news->prefix . ' SET comments = ? WHERE id = ?', array(-1, $id));
- }
-
- // Bodies
- $news->write_db->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id));
- $query_body = $news->write_db->prepare('INSERT INTO ' . $news->prefix . '_body '
- . '(id, lang, title, abbreviation, content, picture_comment, tags) VALUES (?, ?, ?, ?, ?, ?, ?)');
-
- foreach ($info['body'] as $lang => $values) {
- $abbr = Horde_String::substr(strip_tags($values['content']), 0, $conf['preview']['list_content']);
- $news->write_db->execute($query_body, array($id, $lang, $values['title'], $abbr, $values['content'], $values['caption'], $values['tags']));
- }
-
- // Save as future version
- if ($status_inserted === true) {
- $status_version = 'insert';
- } else {
- $status_version = 'update';
- }
- $version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id = ?', array($id));
- $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid, content) VALUES (?, ?, ?, NOW(), ? ,?)',
- array($id, $version + 1, $status_version, $GLOBALS['registry']->getAuth(), serialize($info['body'])));
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
-
- // Expire newscache
- foreach ($conf['attributes']['languages'] as $key) {
- $cache->expire('news_' . $key . '_' . $id);
- }
-
- // Return
- if ($return) {
- $url = $return;
- } elseif (in_array($info['category1'], $allowed_cats) ||
- in_array($info['category2'], $allowed_cats)) {
- $url = Horde_Util::addParameter(Horde::url('edit.php'), 'id', $id);
- } else {
- $url = Horde::url('browse.php');
- }
-
- if ($info['status'] != News::CONFIRMED && $status_inserted == true) {
- $notification->push(_("News added. The editors will check the entry and confirm it if they find it suitable."), 'horde.success');
- } elseif ($info['status'] == News::CONFIRMED && $status_inserted == true) {
- $notification->push(_("News published."), 'horde.success');
- } elseif ($status_inserted == false) {
- $notification->push(_("News updated."), 'horde.success');
- }
-
- $url->redirect();
-
-} elseif ($id && !$form->isSubmitted()) {
-
- $title = _("Edit news");
- $sql = 'SELECT * FROM ' . $news->prefix . ' WHERE id = ?';
- $result = $news->db->getRow($sql, array($id), DB_FETCHMODE_ASSOC);
-
- foreach ($result as $key => $value) {
- if ($key == 'picture') {
- continue;
- } elseif ($key == 'comments' && $value == -1) {
- $key = 'disable_comments';
- $value = true;
- } elseif ($key == 'selling') {
- if (empty($value)) {
- continue;
- } else {
- $value = explode('|', $value);
- $vars->set('selling', array(1 => $value[0], 2 => $value[1]));
- continue;
- }
- }
-
- $vars->set($key, $value);
- }
-
- $sql = 'SELECT lang, title, content, picture_comment, tags FROM ' . $news->prefix . '_body WHERE id = ?';
- $result = $news->db->getAll($sql, array($id), DB_FETCHMODE_ASSOC);
- foreach ($result as $row) {
- $vars->set('title_' . $row['lang'], $row['title']);
- $vars->set('content_' . $row['lang'], $row['content']);
- $vars->set('caption_0_' . $row['lang'], $row['picture_comment']);
- if ($conf['attributes']['tags']) {
- $vars->set('tags_' . $row['lang'], $row['tags']);
- }
- }
-
- $form->setButtons(_("Update"), _("Reset"));
-}
-
-// Add editor now to avoud JS error notifications no redirect
-foreach ($conf['attributes']['languages'] as $key) {
- $injector->getInstance('Horde_Editor')->initialize(array('id' => 'content_' . $key));
-}
-
-require_once NEWS_TEMPLATES . '/common-header.inc';
-require_once NEWS_TEMPLATES . '/menu.inc';
-require_once NEWS_TEMPLATES . '/add/before.inc';
-
-$form->renderActive(null, null, Horde_Util::addParameter(Horde::url('add.php'), 'id', $id, false), 'post');
-
-require_once $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * The News script to delete a category.
- *
- * Copyright 2007 - 2007 Duck <duck@obala.net>
- *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE.
- *
- * $Id: delete.php 183 2008-01-06 17:39:50Z duck $
- */
-define('NEWS_BASE', dirname(__FILE__) . '/../..');
-require_once NEWS_BASE . '/lib/base.php';
-require NEWS_BASE . '/admin/tabs.php';
-
-$vars = Horde_Variables::getDefaultVariables();
-$form = new Horde_Form($vars, _("Do you really wont to delete this category?"), 'delete');
-$form->setButtons(array(_("Remove"), _("Cancel")));
-
-$category_id = Horde_Util::getFormData('category_id');
-$form->addHidden('', 'category_id', 'int', $category_id);
-
-if ($form->validate()) {
- if (Horde_Util::getFormData('submitbutton') == _("Remove")) {
- $news_cat->deleteCategory($category_id);
- if ($result instanceof PEAR_Error) {
- $notification->push(_("Category was not deleted.") . ' ' . $result->getMessage(), 'horde.error');
- } else {
- $notification->push(_("Category deleted."), 'horde.success');
- }
- } else {
- $notification->push(_("Category was not deleted."), 'horde.warning');
- }
- Horde::url('admin/categories/index.php')->redirect();
-}
-
-require NEWS_BASE . '/templates/common-header.inc';
-require NEWS_BASE . '/templates/menu.inc';
-echo $tabs->render('categories');
-$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * The News script to edit categories.
- *
- * Copyright 2007 Duck <duck@obala.net>
- *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE.
- *
- * $Id: edit.php 238 2008-01-16 15:28:51Z duck $
- */
-
-define('NEWS_BASE', dirname(__FILE__) . '/../..');
-require_once NEWS_BASE . '/lib/base.php';
-require NEWS_BASE . '/admin/tabs.php';
-
-$category_id = Horde_Util::getFormData('category_id');
-$title = !empty($category_id) ? _("Edit category") : _("Add category");
-$vars = Horde_Variables::getDefaultVariables();
-$form = new Horde_Form($vars, $title, 'editcategory');
-
-if ($category_id && !$form->isSubmitted()) {
- $category = $news_cat->getCatArray($category_id);
- $vars->merge($category);
-}
-
-$form->addHidden('', 'category_id', 'int', $category_id);
-
-foreach ($GLOBALS['conf']['attributes']['languages'] as $lang) {
- $flag = (count($conf['attributes']['languages']) > 1) ? News::getFlag($lang) . ' ' : '';
- $form->addVariable($flag . _("Name"), 'category_name_' . $lang, 'text', true);
- $form->addVariable($flag . _("Description"), 'category_description_' . $lang, 'text', false);
-}
-
-$form->addVariable(_("Parent"), 'category_parentid', 'radio', false, false, null, array($news_cat->getCategories(), true));
-$v = &$form->addVariable(_("Resize Image"), 'image_resize', 'boolean', false);
-$v->setDefault(true);
-$form->addVariable(_("Image"), 'image', 'image', false);
-
-if ($form->validate()) {
- $form->getInfo(null, $info);
- $result = $news_cat->saveCategory($info);
- if ($result instanceof PEAR_Error) {
- $notification->push($result->getMessage() . ': ' . $result->getDebugInfo(), 'horde.error');
- } else {
- $notification->push(sprintf(_("Category succesfully saved.")));
- Horde::url('admin/categories/index.php', true)->redirect();
- }
-}
-
-require NEWS_BASE . '/templates/common-header.inc';
-require NEWS_BASE . '/templates/menu.inc';
-echo $tabs->render('cetegories');
-$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * The News script to navigate categories.
- *
- * Copyright 2007 Duck <duck@obala.net>
- *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE.
- *
- * $Id: index.php 183 2008-01-06 17:39:50Z duck $
- */
-
-define('NEWS_BASE', dirname(__FILE__) . '/../..');
-require_once NEWS_BASE . '/lib/base.php';
-require NEWS_BASE . '/admin/tabs.php';
-
-// Get category list
-$categories = $news_cat->getCategories(false);
-if ($categories instanceof PEAR_Error) {
- $notification->push($categories->getMessage(), 'horde.error');
- $categories = array();
-}
-
-/* Set up the template fields. */
-$title = _("Category Administration");
-$edit_url = Horde::url('admin/categories/edit.php');
-$edit_img = Horde::img('edit.png', _("Edit"));
-$delete_url = Horde::url('admin/categories/delete.php');
-$delete_img = Horde::img('delete.png', _("Delete"));
-
-foreach ($categories as $category_id => $category) {
- $categories[$category_id]['actions'][] = Horde::link(Horde_Util::addParameter($delete_url, 'category_id', $category_id), _("Delete")) .
- $delete_img . '</a>';
- $categories[$category_id]['actions'][] = Horde::link(Horde_Util::addParameter($edit_url, 'category_id', $category_id), _("Edit")) .
- $edit_img . '</a>';
-}
-
-$view = new News_View();
-$view->categories = $categories;
-$view->add_url = Horde::link($edit_url, _("Add New")) . _("Add New") . '</a>';
-
-Horde::addScriptFile('tables.js', 'horde');
-require NEWS_BASE . '/templates/common-header.inc';
-require NEWS_BASE . '/templates/menu.inc';
-echo $tabs->render('cetegories');
-echo $view->render('/categories/index.php');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * The News script to delete a source.
- *
- * Copyright 2007 - 2007 Duck <duck@obala.net>
- *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE.
- *
- * $Id: delete.php 183 2008-01-06 17:39:50Z duck $
- */
-
-define('NEWS_BASE', dirname(__FILE__) . '/../..');
-require_once NEWS_BASE . '/lib/base.php';
-require '../tabs.php';
-
-$vars = Horde_Variables::getDefaultVariables();
-$form = new Horde_Form($vars, _("Do you really wont to delete this source?"), 'delete');
-$form->setButtons(array(_("Remove"), _("Cancel")));
-
-$source_id = Horde_Util::getFormData('source_id');
-$form->addHidden('', 'source_id', 'int', $source_id);
-
-if ($form->validate()) {
- if (Horde_Util::getFormData('submitbutton') == _("Remove")) {
- $news->deleteSource($source_id);
- if ($result instanceof PEAR_Error) {
- $notification->push(_("Source was not deleted.") . ' ' . $result->getMessage(), 'horde.error');
- } else {
- $notification->push(_("Source deleted."), 'horde.success');
- }
- } else {
- $notification->push(_("Source was not deleted."), 'horde.warning');
- }
- Horde::url('admin/sources/index.php')->redirect();
-}
-
-require NEWS_BASE . '/templates/common-header.inc';
-require NEWS_BASE . '/templates/menu.inc';
-echo $tabs->render('sources');
-$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * The News script to edit sources.
- *
- * Copyright 2007 - 2007 Duck <duck@obala.net>
- *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE.
- *
- * $Id: edit.php 183 2008-01-06 17:39:50Z duck $
- */
-
-define('NEWS_BASE', dirname(__FILE__) . '/../..');
-require_once NEWS_BASE . '/lib/base.php';
-require '../tabs.php';
-
-$vars = Horde_Variables::getDefaultVariables();
-$source_id = $vars->get('source_id');
-$title = !empty($source_id) ? _("Edit Source") : _("Add Source");
-
-$form = new Horde_Form($vars, $title, 'editsource');
-if ($source_id && !$form->isSubmitted()) {
- $sources = $news->getSources(true);
- foreach ($sources[$source_id] as $key => $val) {
- if ($key != 'source_image') {
- $vars->set($key, $val);
- }
- }
-}
-
-$form->addHidden('', 'source_id', 'int', $source_id);
-$form->addVariable(_("Name"), 'source_name', 'text', true);
-$form->addVariable(_("Url"), 'source_url', 'text', true);
-
-$v = &$form->addVariable(_("Resize Image"), 'source_image_resize', 'boolean', false);
-$v->setDefault(true);
-$form->addVariable(_("Image"), 'source_image', 'image', false);
-
-if ($form->validate()) {
- $form->getInfo(null, $info);
- $result = $news->saveSource($info);
- if ($result instanceof PEAR_Error) {
- $notification->push($result->getMessage() . ': ' . $result->getDebugInfo(), 'horde.error');
- } else {
- $notification->push(_("Source saved succesfully."));
- Horde::url('admin/sources/index.php')->redirect();
- }
-}
-
-require NEWS_TEMPLATES . '/common-header.inc';
-require NEWS_TEMPLATES . '/menu.inc';
-echo $tabs->render('sources');
-$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * The News script to navigate source settings.
- *
- * Copyright 2007 Duck <duck@obala.net>
- *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE.
- *
- * $Id: index.php 183 2008-01-06 17:39:50Z duck $
- */
-
-define('NEWS_BASE', dirname(__FILE__) . '/../..');
-require_once NEWS_BASE . '/lib/base.php';
-require '../tabs.php';
-
-$title = _("Sources Administration");
-$sources = $news->getSources(true);
-if ($sources instanceof PEAR_Error) {
- $notification->push($sources->getDebugInfo(), 'horde.error');
- $sources = array();
-}
-
-$edit_url = Horde::url('admin/sources/edit.php');
-$edit_img = Horde::img('edit.png', _("Edit"));
-$delete_url = Horde::url('admin/sources/delete.php');
-$delete_img = Horde::img('delete.png', _("Delete"));
-$view_url = Horde::url('browse.php');
-$view_img = Horde::img('category.png', _("View items"));
-
-foreach ($sources as $source_id => $source) {
- $sources[$source_id]['actions'][] = Horde::link(Horde_Util::addParameter($view_url, 'source_id', $source_id), _("View articles")) .
- $view_img . '</a>';
- $sources[$source_id]['actions'][] = Horde::link(Horde_Util::addParameter($delete_url, 'source_id', $source_id), _("Delete")) .
- $delete_img . '</a>';
- $sources[$source_id]['actions'][] = Horde::link(Horde_Util::addParameter($edit_url, 'source_id', $source_id), _("Edit")) .
- $edit_img . '</a>';
-}
-
-$view = new News_View();
-$view->sources = $sources;
-$view->add_url = Horde::link($edit_url, _("Add New")) . _("Add New") . '</a>';
-
-Horde::addScriptFile('tables.js', 'horde');
-require NEWS_BASE . '/templates/common-header.inc';
-require NEWS_BASE . '/templates/menu.inc';
-echo $tabs->render('sources');
-echo $view->render('/sources/index.php');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * $Id: tabs.php 1175 2009-01-19 15:17:06Z duck $
- *
- * Copyright 2007 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- */
-
-/* Only admin should be using this. */
-if (!$registry->isAdmin(array('permission' => 'news:admin'))) {
- $notification->push(_("You are not authorised for this action."), 'horde.warning');
- $registry->authenticateFailure('news');
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$tabs = new Horde_Core_Ui_Tabs('admin', $vars);
-
-$tabs->addTab(_("Sources"), Horde::url('admin/sources/index.php'), 'sources');
-$tabs->addTab(_("Categories"), Horde::url('admin/categories/index.php'), 'categories');
+++ /dev/null
-<?php
-/**
- * Browse
- *
- * $Id: browse.php 1179 2009-01-20 13:19:34Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-// Default vars
-$title = _("Browse");
-$page = Horde_Util::getGet('news_page', 0);
-$per_page = $prefs->getValue('per_page');
-$browse_url = Horde::url('browse.php');
-$cid = Horde_Util::getGet('cid');
-
-// Define creteria
-if (!empty($_GET)) {
- $criteria = $_GET;
- $browse_url = Horde_Util::addParameter($browse_url, $_GET);
-} else {
- $criteria = array();
-}
-
-// Count rows
-$count = $news->countNews($criteria);
-if ($count instanceof PEAR_Error) {
- echo $count->getMessage() . ': ' . $count->getDebugInfo();
- exit;
-}
-
-// Get news
-$rows = $news->listNews($criteria, $page*$per_page, $per_page);
-if ($rows instanceof PEAR_Error) {
- echo $rows->getMessage() . ': ' . $rows->getDebugInfo();
- exit;
-}
-
-// If we have only one row redirect ot it
-if ($count == 1 && sizeof($cats) < 2 && $page < 1) {
- News::getUrlFor('news', $rows[0]['id'])->redirect();
-}
-
-// Get pager
-$pager = News_Search::getPager(array(), $count, $browse_url);
-
-require_once NEWS_TEMPLATES . '/common-header.inc';
-require_once NEWS_TEMPLATES . '/menu.inc';
-
-$browse_template_path = News::getTemplatePath($cid, 'browse');
-require_once $browse_template_path . 'header.inc';
-foreach ($rows as $row) {
- require $browse_template_path . 'row.inc';
-}
-require_once $browse_template_path . '/footer.inc';
-
-require_once $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * $Id: index.php 31 2007-12-13 14:33:33Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-$cloud = $news->getCloud();
-if ($cloud instanceof PEAR_Error) {
- $notification->push($cloud);
- $cloud = '';
-}
-
-require NEWS_TEMPLATES . '/common-header.inc';
-require NEWS_TEMPLATES . '/menu.inc';
-
-echo $cloud;
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?xml version="1.0"?>
-<configuration>
-
-<configtab name="storage" desc="Storage Settings">
- <configsection name="storage" desc="Storage Settings">
- <configdescription>
- These are the settings for storing all the News data, such as categories,
- items within those categories, item options, etc.
- </configdescription>
- <configswitch name="driver" desc="What storage driver should we use?">sql
- <case name="sql" desc="SQL">
- <configsection name="params">
- <configsql switchname="driverconfig"/>
- <configsection name="categories">
- <configstring name="table" desc="Categories table">horde_datatree</configstring>
- <configstring name="table_attributes" desc="Categories attributes table">horde_datatree_attributes</configstring>
- </configsection>
- </configsection>
- </case>
- </configswitch>
- </configsection>
-</configtab>
-
-<configtab name="news" desc="Content settings">
-
- <configsection name="preview">
- <configheader>Settings for displaying</configheader>
- <configinteger name="list_content" desc="Lenght of abbrevation">130</configinteger>
- </configsection>
-
- <configsection name="attributes">
- <configheader>Enable optional news attributes</configheader>
- <configboolean name="ansel-images" desc="Link to Ansel galleries">TRUE</configboolean>
- <configstring name="ansel-url" desc="Ansel images url">TRUE</configstring>
- <configboolean name="tags" desc="Use tags">false</configboolean>
- <configboolean name="attachments" desc="Allow attachments">true</configboolean>
- <configmultienum name="languages" desc="Select all languages that should be activated">
- <values>
- <configspecial name="list-horde-languages" />
- </values>
- </configmultienum>
- </configsection>
-
- <configsection name="images">
- <configheader>Images settings</configheader>
- <configboolean name="ansel-images" desc="Link items to Ansel Galleries.">true</configboolean>
- <configvfs switchname="type">horde
- <case name="sql">
- <configstring name="table" desc="Table to use">horde_vfs</configstring>
- </case>
- </configvfs>
- <configstring name="direct" desc="If should images be viewed directly out of
- the VFS, specify the alias pointing to the right place on your filesystem
- defined in your webserver. Example: /schedul-images">/schedul-images</configstring>
- <configenum name="image_type" desc="What format should images be generated in? Make
- sure that your server supports whichever format you choose!">png
- <values>
- <value desc="JPEG">jpeg</value>
- <value desc="PNG">png</value>
- </values>
- </configenum>
- <configstring name="thumbnail_width" desc="Thumbnail width">150</configstring>
- <configstring name="thumbnail_height" desc="Thumbnail height">150</configstring>
- <configstring name="image_width" desc="Image width">300</configstring>
- <configstring name="image_height" desc="Image height">300</configstring>
- </configsection>
-
- <configsection name="comments">
- <configheader>Comments</configheader>
- <configenum name="allow" desc="Can users comment news?">authenticated
- <values>
- <value desc="Authenticated users">authenticated</value>
- <value desc="No one">never</value>
- <value desc="All">all</value>
- </values>
- </configenum>
- <configstring name="comment_template" desc="Template file to use for render comments." required="false"></configstring>
- </configsection>
-
-</configtab>
-
-<configtab name="trackback" desc="Trackback">
- <configsection name="trackback">
- <configheader>Trackback Settings</configheader>
- <configinteger name="strictness" desc="Strictness">1</configinteger>
- <configinteger name="timeout" desc="The default timeout for network operations in seconds">30</configinteger>
- <configinteger name="fetchlines" desc="The maximum number of lines to fetch over the network">30</configinteger>
- <configmultienum name="spamcheck" desc="Select spam filters to use">
- <values>
- <value desc="Searches a given trackback for word matches using wordlist">Wordlist</value>
- <value desc="Searches a given trackback for word matches using regex">Regex</value>
- <value desc="Utilize DNS blacklists for detection of hosts used for spamming">DNSBL</value>
- <value desc="Utilizes SUR blacklists for detection of URLs used in spam">SURBL</value>
- </values>
- </configmultienum>
- </configsection>
-</configtab>
-
-<configtab name="menu" desc="Menu">
- <configsection name="menu">
- <configheader>Menu Settings</configheader>
- <configmultienum name="apps" desc="Select any applications that should be linked in news menu">
- <values>
- <configspecial name="list-horde-apps" />
- </values>
- </configmultienum>
- </configsection>
-</configtab>
-
-</configuration>
-
-
+++ /dev/null
-<?php
-/**
- * $Id$
- *
- * See horde/config/prefs.php for documentation on the structure of this file.
- */
-
-$prefGroups['Preview'] = array(
- 'column' => _("Preview"),
- 'label' => _("How to preview news"),
- 'desc' => _("Set news previerw paramaters"),
- 'members' => array('per_page', 'sort_by', 'sort_dir')
-);
-
-$_prefs['per_page'] = array(
- 'value' => 20,
- 'locked' => false,
- 'shared' => true,
- 'type' => 'number',
- 'desc' => _("How many news to show per page")
-);
-
-$_prefs['sort_by'] = array(
- 'value' => 'n.publish',
- 'locked' => false,
- 'shared' => true,
- 'type' => 'enum',
- 'enum' => array('n.publish' => _("Publish date"),
- 'n.id' => _("Id"),
- 'nl.title' => _("Title")),
- 'desc' => _("Sort news by")
-);
-
-$_prefs['sort_dir'] = array(
- 'value' => 'DESC',
- 'locked' => false,
- 'shared' => true,
- 'type' => 'enum',
- 'enum' => array('DESC' => _("Descesending"),
- 'ASC' => _("Ascesending")),
- 'desc' => _("Sort news by")
-);
-
-// the layout of the news portal.
-$_prefs['news_layout'] = array(
- 'value' => 'a:0:{}',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'implicit'
-);
-
+++ /dev/null
-<?php
-/**
- * $Id: content.php 1162 2009-01-14 11:00:29Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-// Default layout.
-$layout = new Horde_Block_Layout_View(
- unserialize($prefs->getValue('news_layout')),
- Horde::url('content_edit.php'),
- Horde::url('content.php'));
-
-$layout_html = $layout->toHtml();
-$title = $registry->get('name');
-require NEWS_TEMPLATES . '/common-header.inc';
-require NEWS_TEMPLATES . '/menu.inc';
-echo '<div id="menuBottom"><a href="' . Horde::url('content_edit.php') . '">' . _("Add Content") . '</a></div><div class="clear"> </div>';
-echo $layout_html;
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * $Id: content_edit.php 803 2008-08-27 08:29:20Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-// Instantiate the blocks objects.
-$blocks = &Horde_Block_Collection::singleton(array('news'));
-$layout = &Horde_Block_Layout_Manager::singleton('news_layout', $blocks, unserialize($prefs->getValue('news_layout')));
-
-// Handle requested actions.
-$layout->handle(Horde_Util::getFormData('action'),
- (int)Horde_Util::getFormData('row'),
- (int)Horde_Util::getFormData('col'));
-if ($layout->updated()) {
- $prefs->setValue('news_layout', $layout->serialize());
-}
-
-$title = sprintf(_("%s :: Add Content"), $registry->get('name'));
-require NEWS_TEMPLATES . '/common-header.inc';
-require NEWS_TEMPLATES . '/menu.inc';
-$notification->notify(array('listeners' => 'status'));
-require $registry->get('templates', 'horde') . '/portal/edit.inc';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Delete a news
- *
- * $Id: delete.php 1184 2009-01-21 09:12:20Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-if (!$registry->isAdmin(array('permission' => 'news:admin'))) {
- $notification->push(_("Only admin can delete a news."));
- Horde::url('edit.php')->redirect();
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$form = new Horde_Form($vars, _("Are you sure you want to delete this news?"), 'delete');
-$form->setButtons(array(_("Remove"), _("Cancel")));
-
-$id = (int)Horde_Util::getFormData('id');
-$form->addHidden('', 'id', 'int', $id);
-
-$row = $news->get($id);
-$form->addVariable($row['title'], 'news', 'description', true);
-$form->addVariable($row['content'], 'content', 'description', true);
-
-if ($form->validate()) {
-
- if (Horde_Util::getFormData('submitbutton') == _("Remove")) {
-
- // Delete attachment
- $sql = 'SELECT file_id FROM ' . $news->prefix . '_files WHERE news_id = ?';
- $files = $news->db->getCol($sql, 0, array($id));
- foreach ($files as $file) {
- $result = News::deleteFile($file_id);
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
- }
-
- // Delete image and gallery
- $sql = 'SELECT picture, gallery FROM ' . $news->prefix . ' WHERE id = ?';
- $image = $news->db->getRow($sql, array($id), DB_FETCHMODE_ASSOC);
- if ($image['picture']) {
- $result = News::deleteImage($id);
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
- }
- if ($image['gallery']) {
- try {
- $registry->call('images/removeGallery', array(null, $image['gallery']));
- } catch (Horde_Exception $e) {
- $notification->push($e);
- }
- }
-
- // Delete from DB
- $news->write_db->query('DELETE FROM ' . $news->prefix . ' WHERE id = ?', array($id));
- $news->write_db->query('DELETE FROM ' . $news->prefix . '_version WHERE id = ?', array($id));
- $news->write_db->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id));
- $news->write_db->query('DELETE FROM ' . $news->prefix . '_user_reads WHERE id = ?', array($id));
- $news->write_db->query('DELETE FROM ' . $news->prefix . '_files WHERE id = ?', array($id));
-
- // Delete forum
- if ($registry->hasMethod('forums/deleteForum')) {
- try {
- $registry->call('forums/deleteForum', array('news', $id));
- } catch (Horde_Exception $e) {
- $notification->push($e);
- }
- }
-
- $notification->push(sprintf(_("News %s: %s"), $id, _("deleted")), 'horde.success');
-
- } else {
-
- $notification->push(sprintf(_("News %s: %s"), $id, _("not deleted")), 'horde.warning');
- }
-
- Horde::url('edit.php')->redirect();
-}
-
-require NEWS_TEMPLATES . '/common-header.inc';
-require NEWS_TEMPLATES . '/menu.inc';
-$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Delete a news
- *
- * $Id: delete_file.php 1186 2009-01-21 10:24:00Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-if (!$registry->isAdmin(array('permission' => 'news:admin'))) {
- $notification->push(_("Only admin can delete a news."));
- Horde::url('edit.php')->redirect();
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$form = new Horde_Form($vars, _("Are you sure you want to delete file?"), 'delete');
-$form->setButtons(array(_("Remove"), _("Cancel")));
-
-$news_id = (int)Horde_Util::getFormData('news_id');
-$form->addHidden('', 'news_id', 'int', true);
-
-$news_lang = Horde_Util::getFormData('lang', News::getLang());
-$form->addHidden('', 'news_lang', 'text', false);
-
-$file_id = Horde_Util::getFormData('file_id');
-$form->addHidden('', 'file_id', 'text', true);
-
-$article = $news->get($news_id);
-$files = $news->getFiles($news_id);
-foreach ($files as $file) {
- if ($file['file_id'] == $file_id) {
- break;
- }
-}
-
-$form->addVariable($file['file_name'], 'file_name', 'description', false);
-$form->addVariable(News::format_filesize($file['file_size']), 'file_size', 'description', false);
-$form->addVariable($article['title'], 'news', 'description', false);
-$form->addVariable($article['content'], 'content', 'description', false);
-
-if ($form->validate()) {
-
- if (Horde_Util::getFormData('submitbutton') == _("Remove")) {
- $result = News::deleteFile($file_id);
- if ($result instanceof PEAR_Error) {
-
- $notification->push(sprintf(_("Error deleteing file \"%s\" from news \"%s\""), $file_id['file_name'], $article['title']), 'horde.success');
-
- } else {
-
- $result = $news->write_db->query('DELETE FROM ' . $news->prefix . '_files WHERE file_id = ?', array($file_id));
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
-
- $count = $news->db->getOne('SELECT COUNT(*) FROM ' . $news->prefix . '_files WHERE news_id = ?', array($news_id));
- if ($count instanceof PEAR_Error) {
- $notification->push($count);
- }
-
- $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET attachments = ? WHERE id = ?', array($count, $news_id));
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
-
- $notification->push(sprintf(_("File \"%s\" was deleted from news \"%s\""), $file_id['file_name'], $article['title']), 'horde.success');
-
- $cache->expire('news_' . $news_lang . '_' . $news_id);
- }
-
- } else {
-
- $notification->push(sprintf(_("File \"%s\" was not deleted from news \"%s\""), $file_id['file_name'], $article['title']), 'horde.success');
-
- }
-
- News::getUrlFor('news', $news_id)->redirect();
-}
-
-require NEWS_TEMPLATES . '/common-header.inc';
-require NEWS_TEMPLATES . '/menu.inc';
-$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Diff
- *
- * $Id: diff.php 803 2008-08-27 08:29:20Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-$title = _("Diff");
-$id = Horde_Util::getFormData('id', 0);
-$version = Horde_Util::getFormData('version', 0);
-
-/* Set up the diff renderer. */
-$render_type = Horde_Util::getFormData('render', 'inline');
-$class = 'Text_Diff_Renderer_' . $render_type;
-$renderer = new $class();
-
-/* get current version content */
-$current_data = array();
-$result = $news->db->getAll('SELECT lang, title, content FROM ' . $news->prefix . '_body WHERE id = ?', array($id), DB_FETCHMODE_ASSOC);
-if ($result instanceof PEAR_Error) {
- var_dump($result);
- exit;
-}
-
-foreach ($result as $row) {
- $current_data[$row['lang']]['title'] = $row['title'];
- $current_data[$row['lang']]['content'] = $row['content'];
-}
-
-/* get version data */
-$version_data = $news->db->getOne('SELECT content FROM ' . $news->prefix . '_versions WHERE id = ? AND version = ?', array($id, $version));
-if ($version_data instanceof PEAR_Error) {
- var_dump($version_data);
- exit;
-}
-
-$version_data = unserialize($version_data);
-
-Horde_Themes::includeStylesheetFiles();
-
-while (list($k, $v) = each($current_data)) {
- echo '<hr><strong>' . $nls['languages'][$k] . '</strong><hr>' . "\n";
- $to = explode("\n", @htmlentities(strip_tags($v['content'])));
- $from = explode("\n", @htmlentities(strip_tags($version_data[$k]['content'])));
- $diff = new Text_Diff($from, $to);
- if (!empty($diff)) {
- echo nl2br($renderer->render($diff));
- } else {
- return _("No change.");
- }
-}
+++ /dev/null
-<?php
-/**
- * Edit browsing
- *
- * $Id: edit.php 1188 2009-01-21 10:33:56Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-// redirect if not an admin
-$allowed_cats = $news_cat->getAllowed(Horde_Perms::DELETE);
-if (empty($allowed_cats)) {
- $notification->push(_("You have not editor permission on any category."));
- Horde::url('add.php')->redirect();
-}
-
-$id = (int)Horde_Util::getFormData('id', 0);
-$page = (int)Horde_Util::getFormData('page', 0);
-$browse_url = Horde_Util::addParameter(Horde::url('edit.php'), array('page' => $page, 'id' => $id), null, false);
-$edit_url = Horde::url('add.php');
-$read_url = Horde::url('reads.php');
-$has_comments = $registry->hasMethod('forums/doComments');
-$actionID = Horde_Util::getFormData('actionID');
-
-// save as future version
-if (!empty($actionID) && $id > 0) {
- $version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id = ?', array($id));
- $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid) VALUES (?,?,?,NOW(),?)',
- array($id, $version + 1, $actionID, $GLOBALS['registry']->getAuth()));
-}
-
-if ($id) {
- $article = $news->get($id);
-}
-
-switch ($actionID) {
-case 'deletepicture';
-
- $result = News::deleteImage($id);
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
-
- $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(0, $id));
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- } else {
- $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("picture deleted")), 'horde.success');
- }
-
- $browse_url->redirect();
-
-break;
-
-case 'deactivate';
-
- $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::UNCONFIRMED, $id));
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
-
- $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("deactivated")), 'horde.success');
- $browse_url->redirect();
-
-break;
-case 'activate';
-
- $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::CONFIRMED, $id));
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
-
- $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("activated")), 'horde.success');
- $browse_url->redirect();
-
-break;
-case 'lock';
-
- $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::LOCKED, $id));
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
-
- $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("locked")), 'horde.success');
- $browse_url->redirect();
-
-break;
-case 'unlock';
-
- $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::UNCONFIRMED, $id));
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
-
- $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("unlocked")), 'horde.success');
- $browse_url->redirect();
-
-
-break;
-case 'renew';
-
- $version = Horde_Util::getFormData('version');
-
- $version_data = $news->db->getRow('SELECT content FROM ' . $news->prefix . '_versions WHERE id = ? AND version = ?',
- array($id, $version), DB_FETCHMODE_ASSOC);
- if ($version_data instanceof PEAR_Error) {
- $notification->push($version_data);
- }
-
- $version_data['content'] = unserialize($version_data['content']);
- $result = $news->write_db->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id));
- if ($result instanceof PEAR_Error) {
- $notification->push($result);
- }
-
- $new_version = array();
- $sql = 'INSERT INTO ' . $news->prefix . '_body (id,lang,title,abbreviation,content) VALUES (?,?,?,?,?)';
-
- foreach ($version_data['content'] as $lang => $values) {
- $new_version[$lang] = $values;
- $data = array($id,
- $lang,
- $values['title'],
- substr(strip_tags($values['content']), 0, $conf['preview']['list_content']),
- $values['content']);
- $news->write_db->query($sql, $data);
- }
-
- /* save as future version */
- $version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id = ?', array($id)) + 1;
- $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, created, user_uid, content) VALUES (?,?,NOW(),?,?)',
- array($id, $version, $GLOBALS['registry']->getAuth(), serialize($new_version)));
-
- $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("renewed")), 'horde.success');
- $browse_url->redirect();
-}
-
-$title = _("Edit");
-$vars = Horde_Variables::getDefaultVariables();
-$form = new News_Search($vars);
-$form->getInfo(null, $info);
-
-/* prepare query */
-$binds = $news->buildQuery(Horde_Perms::DELETE, $info);
-$sql = 'SELECT n.id, n.sortorder, n.category1, n.category2, n.source, n.status, n.editor, n.publish, ' .
- 'n.user, n.comments, n.unpublish, n.picture, n.chars, n.view_count, n.attachments, l.title, n.selling '
- . $binds[0];
-
-if (!isset($info['sort_by'])) {
- $info['sort_by'] = 'n.publish';
-}
-if (!isset($info['sort_dir'])) {
- $info['sort_dir'] = 'DESC';
-}
-
-$sql .= ' ORDER BY ' . $info['sort_by'] . ' ' . $info['sort_dir'];
-
-// Count rows
-$count = $news->countNews($info, Horde_Perms::DELETE);
-if ($count instanceof PEAR_Error) {
- echo $count->getMessage() . ': ' . $count->getDebugInfo();
- exit;
-}
-
-// Select rows
-$page = Horde_Util::getGet('news_page', 0);
-$per_page = $prefs->getValue('per_page');
-$sql = $news->db->modifyLimitQuery($sql, $page*$per_page, $per_page);
-$rows = $news->db->getAll($sql, $binds[1], DB_FETCHMODE_ASSOC);
-if ($rows instanceof PEAR_Error) {
- echo $rows->getMessage() . ': ' . $rows->getDebugInfo();
- exit;
-}
-
-// Get pager
-$pager = News_Search::getPager($binds[1], $count, $browse_url);
-
-// Output
-Horde::addScriptFile('tables.js', 'horde');
-
-require_once NEWS_TEMPLATES . '/common-header.inc';
-require_once NEWS_TEMPLATES . '/menu.inc';
-require_once NEWS_TEMPLATES . '/edit/header.inc';
-
-$img_dir = Horde_Themes::img(null, 'horde');
-foreach ($rows as $row) {
- require NEWS_TEMPLATES . '/edit/row.php';
- if ($row['id'] == $id ) {
- require NEWS_TEMPLATES . '/edit/info.php';
- }
-}
-
-require NEWS_TEMPLATES . '/edit/footer.inc';
-
-$form->renderActive(null, null, null, 'post');
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Show feed
- *
- * $Id: feed.php 1179 2009-01-20 13:19:34Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-function _getStories($feed_id)
-{
- $stories = $GLOBALS['cache']->get('news_feed_' . $feed_id, $GLOBALS['conf']['cache']['default_lifetime']);
- if (!$stories) {
- $stories = $GLOBALS['registry']->call('news/stories', array($feed_id));
- $GLOBALS['cache']->set('news_feed_' . $feed_id, serialize($stories));
- return $stories;
- } else {
- return unserialize($stories);
- }
-}
-
-$feed_id = Horde_Util::getPost('feed_id');
-$stories = _getStories($feed_id);
-$df = $GLOBALS['prefs']->getValue('date_format');
-foreach ($stories as $story) {
- echo strftime($df, $story['story_published'])
- . ' <a href="' . $story['story_url'] . '" target="_blank" title="' . strip_tags($story['story_desc']) . '">'
- . $story['story_title'] . '</a><br />';
-}
+++ /dev/null
-<?php
-/**
- * Download and view files
- *
- * $Id: files.php 1241 2009-01-29 23:27:58Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-$no_compress = true;
-require_once dirname(__FILE__) . '/lib/base.php';
-
-$news_id = Horde_Util::getFormData('news_id', false);
-$actionID = Horde_Util::getFormData('actionID');
-$file_id = Horde_Util::getFormData('file_id');
-$file_name = Horde_Util::getFormData('file_name');
-$news_lang = Horde_Util::getFormData('news_lang', News::getLang());
-$file_type = Horde_Util::getFormData('file_type');
-$file_size = Horde_Util::getFormData('file_size');
-
-/* Run through action handlers. */
-switch ($actionID) {
-case 'download_file':
- $data = News::getFile($file_id);
- if ($data instanceof PEAR_Error) {
- if ($registry->isAdmin(array('permission' => 'news:admin'))) {
- throw new Horde_Exception_Prior($data);
- } else {
- header('HTTP/1.0 404 Not Found');
- echo '<h1>HTTP/1.0 404 Not Found</h1>';
- }
- exit;
- }
-
- $browser->downloadHeaders($file_name, $file_type, false, $file_size);
- echo $data;
- break;
-
-case 'view_file':
-
- $data = News::getFile($file_id);
- if ($data instanceof PEAR_Error) {
- if ($registry->isAdmin(array('permission' => 'news:admin'))) {
- throw new Horde_Exception_Prior($data);
- } else {
- header('HTTP/1.0 404 Not Found');
- echo '<h1>HTTP/1.0 404 Not Found</h1>';
- }
- exit;
- }
-
- $mime_part = new Horde_Mime_Part();
- $mime_part->setName($file_id);
- $mime_part->setType($file_type);
- $mime_part->setContents($data);
-
- $viewer = $injector->getInstance('Horde_Mime_Viewer')->getViewer($mime_part);
- if ($viewer) {
- $render = $viewer->render('full');
- if (!empty($render)) {
- reset($render);
- $key = key($render);
- $browser->downloadHeaders($file_name, $render[$key]['type'], true, strlen($render[$key]['data']));
- echo $render[$key]['data'];
- exit;
- }
- }
-
- // We cannnot see this file, so download it
- $browser->downloadHeaders($file_name, $file_type, false, $file_size);
- echo $data;
-
-break;
-
-case 'download_zip_all':
- $file_id = sprintf(_("FilesOfNews-%s"), $news_id);
- $zipfiles = array();
- foreach ($news->getFiles($news_id) as $file) {
- $data = News::getFile($file_id);
- if ($data instanceof PEAR_Error) {
- continue;
- }
- $zipfiles[] = array('data' => $file_path,
- 'name' => $file);
- }
-
- if (empty($zipfiles)) {
- exit;
- }
-
- $zip = Horde_Compress::factory('zip');
- $body = $zip->compress($zipfiles);
- $browser->downloadHeaders($news_id . '.zip', 'application/zip', false, strlen($body));
- echo $body;
-
-break;
-
-case 'download_zip':
- $data = News::getFile($file_id);
- if ($data instanceof PEAR_Error) {
- if ($registry->isAdmin(array('permission' => 'news:admin'))) {
- throw new Horde_Exception_Prior($data);
- } else {
- header('HTTP/1.0 404 Not Found');
- echo '<h1>HTTP/1.0 404 Not Found</h1>';
- }
- exit;
- }
-
- $zipfiles = array('data' => $data, 'name' => $file_id);
-
- $zip = Horde_Compress::factory('zip');
- $body = $zip->compress($zipfiles);
- $browser->downloadHeaders($file_id . '.zip', 'application/zip', false, strlen($body));
- echo $body;
-
-break;
-}
-
+++ /dev/null
-<?php
-/**
- * $Id: index.php 1162 2009-01-14 11:00:29Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require NEWS_BASE . '/content.php';
+++ /dev/null
-/**
- * Update news source feed
- *
- * $Id:$
- */
-function getFeed() {
-
- RedBox.loading();
-
- new Ajax.Updater('feed_content',
- document.feed_select.action,
- {
- onComplete: function() {
- RedBox.close();
- },
- parameters: {
- feed_id: $F('feed_id')
- },
- onFailure: function() {
- RedBox.close();
- alert('Error');
- },
- asynchronous: true
- });
-}
+++ /dev/null
-<?php
-/**
- * News external API.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-class News_Api extends Horde_Registry_Api
-{
- /**
- * Callback for comment API
- *
- * @param int $id Internal data identifier
- * @param string $type Type of data to retreive (title, owner...)
- * @param array $params Additional parameters
- */
- public function commentCallback($id, $type = 'title', $params = null)
- {
- static $info;
-
- if (!empty($info[$id][$type])) {
- return $info[$id][$type];
- }
-
- require_once dirname(__FILE__) . '/base.php';
-
- $news = $GLOBALS['news']->get($id);
- if ($news instanceof PEAR_Error) {
- return $news;
- }
-
- switch ($type) {
-
- case 'owner':
- return $news['user'];
-
- case 'link':
- return News::getUrlFor('news', $id, true, -1);
-
- case 'messages':
- $GLOBALS['news']->updateComments($id, $params);
-
- if ($GLOBALS['registry']->hasMethod('logActivity', 'folks')) {
- $link = '<a href="' . News::getUrlFor('news', $id) . '">' . $news['title'] . '</a>';
- $message = sprintf(_("Has commented news \"%s\""), $link);
- $GLOBALS['registry']->callByPackage('folks', 'logActivity', array($message, 'news'));
- }
-
- return true;
-
- default:
- $info[$id][$type] = $news['title'];
- return $news['title'];
- }
- }
-
- /**
- * Returns if applications allows comments
- */
- public function hasComments()
- {
- return $GLOBALS['conf']['comments']['allow'];
- }
-
- /**
- * List news
- *
- * @param array $criteria Array of news attributes match
- * @param intiger $from Start fetching from news
- * @param intiger $count The number of news to fetch
- * @param intiger $perms News permission access type
- *
- * @return array | PEAR_Error True on success, PEAR_Error on failure.
- */
- public function listNews($criteria = array(), $from = 0, $count = 0, $perms = Horde_Perms::READ)
- {
- require_once dirname(__FILE__) . '/base.php';
-
- return $GLOBALS['news']->listNews($criteria, $from, $count, $perms);
- }
-
- /**
- * Count news
- *
- * @param array $criteria Array of news attributes match
- * @param integer $perms Permisson level
- *
- * @return integer | PEAR_Error True on success, PEAR_Error on failure.
- */
- public function countNews($criteria = array(), $perms = Horde_Perms::READ)
- {
- require_once dirname(__FILE__) . '/base.php';
-
- return $GLOBALS['news']->countNews($criteria, $perms);
- }
-
-}
+++ /dev/null
-<?php
-/**
- * News application API.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-class News_Application extends Horde_Registry_Application
-{
- public $version = 'H4 (0.1-git)';
-
- /**
- * Returns a list of available permissions.
- *
- * @return array An array describing all available permissions.
- */
- public function perms()
- {
- $perms = array(
- 'admin' => array(
- 'title' => _("Admin")
- ),
- 'categories' => array(
- 'title' => _("Categories")
- ),
- 'editors' => array(
- 'title' => _("Editors")
- )
- );
-
- require_once dirname(__FILE__) . '/base.php';
- $tree = $GLOBALS['news_cat']->getEnum();
-
- foreach ($tree as $cat_id => $cat_name) {
- $perms['categories:' . $cat_id] = array(
- 'title' => $cat_name
- );
- }
-
- return $perms;
- }
-
- /**
- * Add additional items to the menu.
- *
- * @param Horde_Menu $menu The menu object.
- */
- public function menu($menu)
- {
- return News::getMenu();
- }
-
-}
+++ /dev/null
-<?php
-
-$block_name = _("Categories");
-
-/**
- * $Id: categories.php 890 2008-09-23 09:58:23Z duck $
- *
- * @package Horde_Block
- */
-class Horde_Block_News_categories extends Horde_Block {
-
- var $_app = 'news';
-
- /**
- * The title to go in this block.
- *
- * @return string The title text.
- */
- function _title()
- {
- return _("Categories");
- }
-
- /**
- * The content to go in this block.
- *
- * @return string The content
- */
- function _content()
- {
- require_once dirname(__FILE__) . '/../base.php';
- return $GLOBALS['news_cat']->getHtml();
- }
-}
\ No newline at end of file
+++ /dev/null
-<?php
-
-$block_name = _("Last news in category");
-
-/**
- * $Id: category.php 890 2008-09-23 09:58:23Z duck $
- *
- * @package Horde_Block
-*/
-
-class Horde_Block_News_category extends Horde_Block {
-
- var $_app = 'news';
-
- function _title()
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- $url = Horde_Util::addParameter(Horde::url('browse.php'), 'category', $this->_params['category']);
- $name = $GLOBALS['news_cat']->getName($this->_params['category']);
- $html = Horde::link($url, sprintf(_("Last news in %s"), $name), 'header');
- $html .= sprintf(_("Last news in %s"), $name) . '</a>';
-
- return $html;
- }
-
- function _params()
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- return array('limit' => array('type' => 'int',
- 'name' => _("How many news to display?"),
- 'default' => 10),
- 'category' => array('type' => 'enum',
- 'name' => _("Category"),
- 'values' => $GLOBALS['news_cat']->getEnum()));
- }
-
- function _content()
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- $query = 'SELECT n.id, n.publish, n.comments, n.picture, n.category1, nl.title, nl.abbreviation ' .
- 'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS nl WHERE ' .
- 'n.status = ? AND n.publish <= NOW() ' .
- 'AND (n.category1 = ? OR n.category2 = ?) ' .
- 'AND nl.lang = ? AND n.id = nl.id ' .
- 'ORDER BY n.publish DESC';
-
- $params = array(News::CONFIRMED, $this->_params['category'], $this->_params['category'], $GLOBALS['registry']->preferredLang());
- $res = $GLOBALS['news']->db->limitQuery($query, 0, $this->_params['limit'], $params);
- if ($res instanceof PEAR_Error) {
- return $res->getDebugInfo();
- }
- $rows = array();
- while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) {
- $rows[$row['id']] = $row;
- }
- $view = new News_View();
- $view->news = $rows;
- $view->moreurl = Horde_Util::addParameter(Horde::url('browse.php'), 'category', $this->_params['category']);
-
- return $view->render('/block/news.php');
- }
-}
+++ /dev/null
-<?php
-
-if ($GLOBALS['registry']->hasInterface('news')) {
- $block_name = _("Press overview");
-}
-
-/**
- * $Id: jonah.php 890 2008-09-23 09:58:23Z duck $
- *
- * @package Horde_Block
- */
-class Horde_Block_News_jonah extends Horde_Block {
-
- var $_app = 'news';
-
- /**
- * The title to go in this block.
- *
- * @return string The title text.
- */
- function _title()
- {
- $url = $GLOBALS['registry']->get('webroot', 'jonah') . '/';
- return Horde::link($url, _("Press overview")) . _("Press overview") . '</a>';
- }
-
- /**
- * The content to go in this block.
- *
- * @return string The content
- */
- function _content()
- {
- $html = '<div id="feed_content" name="feed_content">';
- $html .= _("Select a feed.");
- $html .= '</div>';
-
- require_once dirname(__FILE__) . '/../base.php';
-
- $sql = 'SELECT channel_id, channel_name '
- . ' FROM jonah_channels WHERE channel_type = 1 ORDER BY channel_name';
- $chanels = $GLOBALS['news']->db->getAll($sql);
-
- $html .= '<form action="' . Horde::url('feed.php') . '" id="feed_select" name="feed_select">'
- . '<select id="feed_id" name="feed_id" onchange="getFeed()">'
- . '<option>- - - - - - - </option>';
- foreach ($chanels as $chanel) {
- $html .= '<option value="' . $chanel[0] . '">' . $chanel[1] . '</option>';
- }
- $html .= '</select></form>';
-
- Horde::addScriptFile('effects.js', 'horde');
- Horde::addScriptFile('redbox.js', 'horde');
- Horde::addScriptFile('feed.js', 'news');
-
- return $html;
- }
-}
+++ /dev/null
-<?php
-
-$block_name = _("Last news");
-
-/**
- * $Id: last.php 890 2008-09-23 09:58:23Z duck $
- *
- * @package Horde_Block
-*/
-
-class Horde_Block_News_last extends Horde_Block {
-
- var $_app = 'news';
-
- function _title()
- {
- return Horde::link(Horde::url('browse.php'), _("Last news"), 'header') . _("Last news") . '</a>';
- }
-
- function _params()
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- return array('limit' => array('type' => 'int',
- 'name' => _("How many news to display?"),
- 'default' => 10),
- 'category' => array('type' => 'enum',
- 'name' => _("Skip category"),
- 'values' => $GLOBALS['news_cat']->getEnum()));
- }
-
- function _content()
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- $params = array(News::CONFIRMED, $GLOBALS['registry']->preferredLang());
- $query = 'SELECT n.id, n.publish, n.comments, n.picture, n.category1, nl.title, nl.abbreviation ' .
- 'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS nl WHERE ' .
- 'n.status = ? AND n.publish <= NOW() ' .
- 'AND nl.lang = ? AND n.id = nl.id ';
-
- if (!empty($this->_params['category'])) {
- $query .= ' AND n.category1 <> ? ';
- $params[] = (int)$this->_params['category'];
- }
-
- $query .= 'ORDER BY n.publish DESC';
- $res = $GLOBALS['news']->db->queryLimit($query, 0, $this->_params['limit'], $params);
- if ($res instanceof PEAR_Error) {
- return $res->getDebugInfo();
- }
- $rows = array();
- while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) {
- $rows[$row['id']] = $row;
- }
- $view = new News_View();
- $view->news = $rows;
- $view->moreurl = Horde::url('browse.php');
-
- return $view->render('/block/news.php');
- }
-}
+++ /dev/null
-<?php
-
-$block_name = _("Last news blogged");
-
-/**
- * @package Horde_Block
-*/
-
-class Horde_Block_News_last_blogs extends Horde_Block {
-
- var $_app = 'news';
-
- function _title()
- {
- return _("Last news blog");
- }
-
- function _params()
- {
- return array('limit' => array('type' => 'int',
- 'name' => _("How many news to display?"),
- 'default' => 10));
- }
-
- function _content()
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- $query = 'SELECT n.id, n.publish, n.comments, n.picture, n.category1, nl.title, nl.abbreviation ' .
- 'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS nl WHERE ' .
- 'n.status = ? AND n.publish <= NOW() AND n.trackbacks > ? ' .
- 'AND nl.lang = ? AND n.id = nl.id ' .
- 'ORDER BY n.publish DESC';
-
- $params = array(News::CONFIRMED, 0, $GLOBALS['registry']->preferredLang());
- $res = $GLOBALS['news']->db->limitQuery($query, 0, $this->_params['limit'], $params);
- if ($res instanceof PEAR_Error) {
- return $res->getDebugInfo();
- }
- while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) {
- $rows[$row['id']] = $row;
- }
- $view = new News_View();
- $view->news = $rows;
-
- return $view->render('/block/news.php');
- }
-}
+++ /dev/null
-<?php
-
-$block_name = _("Last comments");
-
-/**
- * thomas_Minisearch_Block:: Implementation of the Horde_Block API to
- * allows searching of addressbooks from the portal.
- *
- * $Id: last_comments.php 890 2008-09-23 09:58:23Z duck $
- *
- * @package Horde_Block
- */
-class Horde_Block_news_last_comments extends Horde_Block {
-
- var $_app = 'news';
-
- function _params()
- {
- return array('limit' => array('name' => _("Number of comments to display"),
- 'type' => 'int',
- 'default' => 10));
- }
-
- /**
- * The title to go in this block.
- *
- * @return string The title text.
- */
- function _title()
- {
- return _("Last comments");
- }
-
- /**
- * The content to go in this block.
- *
- * @return string The content
- */
- function _content()
- {
- require_once dirname(__FILE__) . '/../News.php';
-
- $comments = News::getLastComments($this->_params['limit']);
- if ($comments instanceof PEAR_Error) {
- return $comments;
- }
-
- $html = '';
- foreach ($comments as $message) {
- $html .= '- '
- . Horde::link($message['read_url']) . $message['message_subject'] . '</a> '
- . ' (' . $message['message_author'] . ') <br />';
- }
- return $html;
- }
-}
\ No newline at end of file
+++ /dev/null
-<?php
-
-$block_name = _("Last most commented news");
-
-/**
- * $Id: most_commented.php 890 2008-09-23 09:58:23Z duck $
- *
- * @package Horde_Block
-*/
-
-class Horde_Block_News_most_commented extends Horde_Block {
-
- var $_app = 'news';
-
- function _title()
- {
- return _("Last most commented news");
- }
-
- function _params()
- {
- return array('limit' => array('type' => 'int',
- 'name' => _("How many news to display?"),
- 'default' => 10),
- 'days' => array('type' => 'int',
- 'name' => _("How many days back to check?"),
- 'default' => 30));
- }
-
- function _content()
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- $query = 'SELECT n.id, n.publish, n.comments, n.picture, n.category1, nl.title, nl.abbreviation ' .
- 'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS nl WHERE ' .
- 'n.status = ? AND n.publish <= NOW() AND n.publish > ?' .
- 'AND nl.lang = ? AND n.id = nl.id ' .
- 'ORDER BY n.comments DESC ';
-
- $younger = $_SERVER['REQUEST_TIME'] - $this->_params['days'] * 86400;
- $params = array(News::CONFIRMED, date('Y-m-d', $younger), $GLOBALS['registry']->preferredLang());
- $res = $GLOBALS['news']->db->limitQuery($query, 0, $this->_params['limit'], $params);
- if ($res instanceof PEAR_Error) {
- return $res->getDebugInfo();
- }
- $rows = array();
- while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) {
- $rows[$row['id']] = $row;
- }
- $view = new News_View();
- $view->news = $rows;
-
- return $view->render('/block/titles.php');
- }
-}
+++ /dev/null
-<?php
-
-$block_name = _("Last most read news");
-
-/**
- * $Id: most_read.php 890 2008-09-23 09:58:23Z duck $
- *
- * @package Horde_Block
-*/
-
-class Horde_Block_News_most_read extends Horde_Block {
-
- var $_app = 'news';
-
- function _title()
- {
- return _("Last most read news");
- }
-
- function _params()
- {
- return array('limit' => array('type' => 'int',
- 'name' => _("How many news to display?"),
- 'default' => 10),
- 'days' => array('type' => 'int',
- 'name' => _("How many days back to check?"),
- 'default' => 30));
- }
-
- function _content()
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- $query = 'SELECT n.id, n.publish, n.comments, n.picture, nl.title, nl.abbreviation ' .
- 'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS nl WHERE ' .
- 'n.status = ? AND n.publish <= NOW() AND n.publish > ?' .
- 'AND nl.lang = ? AND n.id = nl.id ' .
- 'ORDER BY n.view_count DESC';
-
- $younger = $_SERVER['REQUEST_TIME'] - $this->_params['days'] * 86400;
- $params = array(News::CONFIRMED, date('Y-m-d', $younger), $GLOBALS['registry']->preferredLang());
- $res = $GLOBALS['news']->db->queryLimit($query, 0, $this->_params['limit'], $params);
- if ($res instanceof PEAR_Error) {
- return $res->getDebugInfo();
- }
- $rows = array();
- while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) {
- $rows[$row['id']] = $row;
- }
- $view = new News_View();
- $view->news = $rows;
-
- return $view->render('/block/titles.php');
- }
-}
+++ /dev/null
-<?php
-
-$block_name = _("Last comments on my news");
-
-/**
- * Horde_Block_news_my_comments:: Implementation of the Horde_Block API to
- * display last comments on users videos.
- *
- * @package Horde_Block
- */
-class Horde_Block_news_my_comments extends Horde_Block {
-
- var $_app = 'news';
-
- function _params()
- {
- return array('limit' => array('name' => _("Number of comments to display"),
- 'type' => 'int',
- 'default' => 10));
- }
-
- /**
- * The title to go in this block.
- *
- * @return string The title text.
- */
- function _title()
- {
- return ("Last comments on my news");
- }
-
- /**
- * The content to go in this block.
- *
- * @return string The content
- */
- function _content()
- {
- if (!$GLOBALS['registry']->isAuthenticated()) {
- return '';
- }
-
- $GLOBALS['cache'] = $GLOBALS['injector']->getInstance('Horde_Cache');
-
- $cache_key = 'news_myscommetns_' . $this->_params['limit'];
- $threads = $GLOBALS['cache']->get($cache_key, $GLOBALS['conf']['cache']['default_lifetime']);
- if ($threads) {
- return $threads;
- }
-
- Horde::addScriptFile('tables.js', 'horde');
- $html = '<table class="sortable striped" id="my_comment_list" style="width: 100%">'
- . '<thead><tr><th>' . _("Title") . '</th>'
- . '<th>' . _("User") . '</th></tr></thead>';
-
- try {
- $threads = $GLOBALS['registry']->call('forums/getThreadsByForumOwner',
- array($GLOBALS['registry']->getAuth(), 'message_timestamp', 1, false,
- 'news', 0, $this->_params['limit']));
- } catch (Horde_Exception $e) {
- return $e->getMessage();
- }
-
- foreach ($threads as $message) {
- $html .= '<tr><td>'
- . '<a href="' . News::getUrlFor('news', $message['forum_name']) . '" title="' . $message['message_date'] . '">'
- . $message['message_subject'] . '</a> '
- . '</td><td>'
- . $message['message_author'] . '</td></tr>';
- }
- $html .= '</table>';
-
- $GLOBALS['cache']->set($cache_key, $html);
- return $html;
- }
-}
+++ /dev/null
-<?php
-
-$block_name = _("Sources");
-
-/**
- * $Id: sources.php 890 2008-09-23 09:58:23Z duck $
- *
- * @package Horde_Block
- */
-class Horde_Block_News_sources extends Horde_Block {
-
- var $_app = 'news';
-
- /**
- * The title to go in this block.
- *
- * @return string The title text.
- */
- function _title()
- {
- return _("Sources");
- }
-
- /**
- * The content to go in this block.
- *
- * @return string The content
- */
- function _content()
- {
- require_once dirname(__FILE__) . '/../base.php';
- $sources = $GLOBALS['news']->getSources();
-
- $html = '';
- $url = Horde::url('browse.php');
- foreach ($sources as $source_id => $source_name) {
- $html .= '- '
- . Horde::link(Horde_Util::addparameter($url, 'source_id', $source_id), '', '', '_blank')
- . $source_name . '</a><br />';
- }
-
- return $html;
- }
-}
+++ /dev/null
-<?php
-
-$block_name = _("Tags");
-
-/**
- * oscar_tags_cloud:: Implementation of the Horde_Block API to show a tag
- * cloud.
- *
- * $Id: tags_cloud.php 78 2007-12-19 22:44:56Z jan $
- *
- * @package Horde_Block
- */
-class Horde_Block_news_tags_cloud extends Horde_Block {
-
- var $_app = 'news';
-
- /**
- * The title to go in this block.
- *
- * @return string The title text.
- */
- function _title()
- {
- return _("Tags");
- }
-
- /**
- * The content to go in this block.
- *
- * @return string The content
- */
- function _content()
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- return $GLOBALS['news']->getCloud(true);
- }
-}
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * News Category Class.
- *
- * $Id: Categories.php 1261 2009-02-01 23:20:07Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-class News_Categories {
-
- /**
- * Hash containing connection parameters.
- *
- * @var array
- */
- private $_params = array();
-
- /**
- * Handle for the current database connection.
- *
- * @var DB
- */
- private $_db;
-
- /**
- * Handle for the current database connection, used for writing. Defaults
- * to the same handle as $db if a separate write database is not required.
- *
- * @var DB
- */
- private $_write_db;
-
- /**
- * An array containing all the tree nodes.
- *
- * @var array
- */
- private $_nodes = array();
-
- /**
- * The top-level nodes in the tree.
- *
- * @var array
- */
- private $_root_nodes = array();
-
- /**
- * An enumeratic array
- *
- * @var array
- */
- private $_enum = array();
-
- /**
- * Has for view url link
- *
- * @var array
- */
- private $_view_url;
-
- /**
- * Handle for the tables prefix.
- *
- * @var prefix
- */
- private $prefix = 'news';
-
- /**
- * Contruct the News object
- */
- public function __construct($categoreis = null)
- {
- $this->_nodes = $this->getCategories(false);
- if ($this->_nodes instanceof PEAR_Error) {
- return $this->_nodes;
- }
-
- foreach ($this->_nodes as $id => $category) {
- if (empty($category['category_parentid'])) {
- if (!in_array($id, $this->_root_nodes)) {
- $this->_root_nodes[] = $id;
- }
- } else {
- if (empty($this->_nodes[$category['category_parentid']]['children'])) {
- $this->_nodes[$category['category_parentid']]['children'] = array();
- }
- if (!in_array($id, $this->_nodes[$category['category_parentid']]['children'])) {
- $this->_nodes[$category['category_parentid']]['children'][] = $id;
- }
- }
- }
- $this->_buildIndents($this->_root_nodes);
- }
-
- /**
- * Returns the string for category selection
- *
- * @return string
- */
- public function getSelect()
- {
- $output = '';
- foreach ($this->_root_nodes as $node_id) {
- $output .= $this->_buildSelect($node_id);
- }
-
- return $output;
- }
-
- /**
- *
- */
- private function _buildSelect($node_id)
- {
- $output = '<option value="' . $node_id . '">'
- . str_repeat(' - ', $this->_nodes[$node_id]['indent'])
- . $this->_nodes[$node_id]['category_name'] . '</option>';
-
- if (isset($this->_nodes[$node_id]['children'])) {
- $num_subnodes = count($this->_nodes[$node_id]['children']);
- for ($c = 0; $c < $num_subnodes; $c++) {
- $child_node_id = $this->_nodes[$node_id]['children'][$c];
- $output .= $this->_buildSelect($child_node_id);
- }
- }
-
- return $output;
- }
-
- /**
- * Returns the enumeratic array for select form pameter.
- *
- * @return array The category array (cat => name)
- */
- public function getEnum()
- {
- if (empty($this->_enum)) {
- foreach ($this->_root_nodes as $node_id) {
- $this->_buildEnum($node_id);
- }
- }
-
- return $this->_enum;
- }
-
- private function _buildEnum($node_id)
- {
- $this->_enum[$node_id] = str_repeat(' - ', $this->_nodes[$node_id]['indent'])
- . $this->_nodes[$node_id]['category_name'];
-
- if (isset($this->_nodes[$node_id]['children'])) {
- $num_subnodes = count($this->_nodes[$node_id]['children']);
- for ($c = 0; $c < $num_subnodes; $c++) {
- $child_node_id = $this->_nodes[$node_id]['children'][$c];
- $this->_buildEnum($child_node_id);
- }
- }
- }
-
- /**
- * Returns html for category selection
- *
- * @return string
- */
- public function getHtml()
- {
- $this->_view_url = News::getUrlFor('category', '');
-
- $output = '';
- foreach ($this->_root_nodes as $node_id) {
- $output .= $this->_buildHtml($node_id);
- }
-
- return $output;
- }
-
- private function _buildHtml($node_id)
- {
- $output = '';
- if ($this->_nodes[$node_id]['indent'] == 0) {
- $output .= '<strong>';
- }
- $url = $this->_view_url . $node_id;
- $output .= Horde::link($url) . $this->_nodes[$node_id]['category_name'] . '</a>, ';
- if ($this->_nodes[$node_id]['indent'] == 0) {
- $output .= '</strong><br />';
- }
-
- if (isset($this->_nodes[$node_id]['children'])) {
- $num_subnodes = count($this->_nodes[$node_id]['children']);
- for ($c = 0; $c < $num_subnodes; $c++) {
- $child_node_id = $this->_nodes[$node_id]['children'][$c];
- $output .= $this->_buildHtml($child_node_id);
- }
- }
-
- return $output;
- }
-
- /**
- * Set the indent level for each node in the tree.
- */
- private function _buildIndents($nodes, $indent = 0)
- {
- foreach ($nodes as $id) {
- $this->_nodes[$id]['indent'] = $indent;
- if (!empty($this->_nodes[$id]['children'])) {
- $this->_buildIndents($this->_nodes[$id]['children'], $indent + 1);
- }
- }
- }
-
- /**
- * Returns array of cateogriy children id
- *
- * @return array
- */
- public function getChildren($id)
- {
- if (!empty($this->_nodes[$id]['children'])) {
- return $this->_nodes[$id]['children'];
- } else {
- return array();
- }
- }
-
- /**
- * Returns the current language
- *
- * @return string The current language.
- */
- public function getAllowed($perm = Horde_Perms::SHOW)
- {
- $cats = $this->getCategories();
- $perms = $GLOBALS['injector']->getInstance('Horde_Perms');
-
- if ($GLOBALS['registry']->isAdmin(array('permission' => 'news:admin')) ||
- $perms->hasPermission('news', $GLOBALS['registry']->getAuth(), $perm)) {
- return $cats;
- }
-
- foreach ($cats as $key => $value) {
- // user has access?
- if (!$perms->hasPermission('news:categories', $GLOBALS['registry']->getAuth(), $perm) && // master
- !$perms->hasPermission('news:categories:' . $key, $GLOBALS['registry']->getAuth(), $perm) && // child
- !$perms->hasPermission('news:categories:' . $this->_nodes[$key]['category_parentid'], $GLOBALS['registry']->getAuth(), $perm) // father
- ) {
- unset($cats[$key]);
- }
- }
-
- return $cats;
- }
-
- /**
- * Returns the name for category
- *
- * @return string
- */
- public function getName($id)
- {
- $cats = $this->getCategories();
- return $cats[$id];
- }
-
- /**
- * Returns the full name of a category
- *
- * @return string
- */
- public function getFullName($id)
- {
- static $names;
-
- if (isset($names[$id])) {
- return $names[$id];
- } elseif (empty($id)) {
- return $GLOBALS['registry']->get('name');
- }
-
- $cats = $this->getCategories(false);
- $names[$id] = '';
- $parent = $cats[$id]['category_parentid'];
-
- while ($parent) {
- $names[$id] .= $cats[$parent]['category_name'] . ': ';
- $parent = $cats[$parent]['category_parentid'];
- }
-
- $names[$id] .= $cats[$id]['category_name'];
-
- return $names[$id];
- }
-
- /**
- * Save a category data into the backend from edit form.
- *
- * @param array $info The category data to save.
- *
- * @return mixed PEAR error.
- */
- public function saveCategory($info)
- {
- $this->_connect();
-
- /* Update/Insert category. */
- if (!empty($info['category_id'])) {
- $result = $this->_updateCategory($info['category_id'], $info);
- if ($result instanceof PEAR_Error) {
- return $result;
- }
- } else {
- $info['category_id'] = $this->_insertCategory($info);
- if ($info['category_id'] instanceof PEAR_Error) {
- return $info['category_id'];
- }
- }
-
- /* If image uploaded save to backend. */
- if (!empty($info['category_image']['name'])) {
- $image = News::saveImage($info['category_image']['file'], $info['category_id'], 'categories', $info['image_resize']);
- if ($image instanceof PEAR_Error) {
- return $image;
- }
-
- $sql = 'UPDATE ' . $this->prefix . '_categories SET category_image = ? WHERE category_id = ?';
- $this->_write_db->query($sql, array(1, $info['category_id']));
- }
-
- // Clean cache
- $this->_expireCache();
-
- return $info['category_id'];
- }
-
- /**
- * Insert category data.
- *
- * @param mixed $data The category data to insert.
- *
- * @return array Inserted ID or PEAR error.
- */
- private function _insertCategory($data)
- {
- $new_id = $this->_write_db->nextId('news_categories');
- if ($new_id instanceof PEAR_Error) {
- Horde::logMessage($new_id, 'ERR');
- return $new_id;
- }
-
- $sql = 'INSERT INTO ' . $this->prefix . '_categories' .
- ' (category_id, category_parentid) VALUES (?, ?)';
- $values = array($new_id, (int)$data['category_parentid']);
-
- $category = $this->_write_db->query($sql, $values);
- if ($category instanceof PEAR_Error) {
- Horde::logMessage($category, 'ERR');
- return $category;
- }
-
- $sql = 'INSERT INTO ' . $this->prefix . '_categories_nls VALUES (?, ?, ?, ?)';
- foreach ($GLOBALS['conf']['attributes']['languages'] as $lang) {
-
- $values = array($new_id,
- $lang,
- $data['category_name_' . $lang],
- $data['category_description_' . $lang]);
- $result = $this->_write_db->query($sql, $values);
- if ($result instanceof PEAR_Error) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
- }
-
- return $new_id;
- }
-
- /**
- * Update category data.
- *
- * @param integer $category_id The category id to update.
- * @param array $data The category data to update.
- *
- * @return array NULL or PEAR error.
- */
- private function _updateCategory($category_id, $data)
- {
- $sql = 'UPDATE ' . $this->prefix . '_categories' .
- ' SET category_parentid = ? ' .
- ' WHERE category_id = ?';
- $values = array((int)$data['category_parentid'], $category_id);
-
- $category = $this->_write_db->query($sql, $values);
- if ($category instanceof PEAR_Error) {
- Horde::logMessage($category, 'ERR');
- return $category;
- }
-
- $sql = 'UPDATE ' . $this->prefix . '_categories_nls SET '
- . ' category_name = ?, category_description = ? WHERE '
- . ' category_id = ? AND category_nls = ?';
- foreach ($GLOBALS['conf']['attributes']['languages'] as $lang) {
- $values = array($data['category_name_' . $lang],
- $data['category_description_' . $lang],
- $category_id,
- $lang);
- $result = $this->_write_db->query($sql, $values);
- }
-
- return $result;
- }
-
- /**
- * Delete a category
- *
- * @return booelan
- */
- public function deleteCategory($id)
- {
- // Clean cache
- $this->_expireCache();
-
- // Delete image
- News::deleteImage($id, 'categories');
-
- // Delete record
- $this->_connect();
- $this->_write_db->query('DELETE FROM ' . $this->prefix . '_categories WHERE category_id = ?', array($id));
- return $this->_write_db->query('DELETE FROM ' . $this->prefix . '_categories_nls WHERE category_id = ?', array($id));
- }
-
- /**
- * Return an array of data for edit form.
- *
- * @param $cid The category ID.
- *
- * @return mixed Array that hold data for edit form.
- */
- function getCatArray($cid)
- {
- $this->_connect();
-
- $sql = 'SELECT c.category_parentid, c.category_image, '
- . ' l.category_nls, l.category_name, l.category_description '
- . ' FROM news_categories c, news_categories_nls l '
- . ' WHERE c.category_id = ? AND c.category_id = l.category_id';
-
- $category = array('category_id' => $cid);
- $result = $this->_db->getAll($sql, array($cid), DB_FETCHMODE_ASSOC);
-
- foreach ($result as $row) {
- $category['category_parentid'] = $row['category_parentid'];
- $category['category_image'] = $row['category_image'];
- $category['category_name_' . $row['category_nls']] = $row['category_name'];
- $category['category_description_' . $row['category_nls']] = $row['category_description'];
- }
-
- return $category;
- }
-
- /**
- * Return a Horde_Tree representation of the News_Categories tree.
- *
- * @return string The html showing the categories as a Horde_Tree.
- */
- function renderTree($current = null, $click_url = null, $browse_only = false, $have_add_item = false)
- {
- $cats = $this->getCategories(false);
-
- $params = array('icon' => Horde_Themes::img('folder_open.png'));
-
- // Set up the tree
- $tree = $GLOBALS['injector']->getInstance('Horde_Tree')->getTree('news_cats', 'Javascript', array(
- 'alternate' => true,
- 'border' => '0',
- 'cellpadding' => '0',
- 'cellspacing' => '0',
- 'class' => 'item',
- 'width' => '100%'
- ));
-
- // prepare add link
- if ($have_add_item) {
- $add_img = Horde::img('mkdir.png', _("Add New Item"));
- $add_item = Horde::url('items/edit.php');
- }
-
- foreach ($cats as $cid => $category) {
-
- if ($click_url !== null) {
- $name = Horde::link(Horde_Util::addParameter($click_url, 'cid', $cid), _("Select Category")) . $category['category_name'] . '</a>';
- } else {
- $name = $category['category_name'];
- }
-
- $links = array();
- if ($have_add_item) {
- $links[] = Horde::link(Horde_Util::addParameter($add_item, 'cid', $cid), _("Add New Item")) . $add_img . '</a>';
- }
-
- $parent_id = $category['category_parentid'] ? $category['category_parentid'] : null;
- $tree->addNode($cid, $parent_id, $name, $this->_nodes[$cid]['indent'], true, $params, $links);
- }
-
-
- return $tree->renderTree();
- }
-
- /**
- * Get category child list
- */
- public function getChildList($id)
- {
- return isset($this->_nodes[$id]['children']) ? $this->_nodes[$id]['children'] : array();
- }
-
- /**
- * Return a stored image for a category.
- *
- * @param integer $cid The id of the category requested.
- *
- * @return string The image name.
- */
- function getImage($cid)
- {
- /* Check if there is an image for requested category. */
- if (!isset($this->_nodes[$cid]['category_image'])) {
- return '';
- }
-
- /* return url */
- if ($GLOBALS['conf']['images']['direct']) {
- return Horde::img('/categories/' . $cid . '.' . $GLOBALS['conf']['images']['image_type'], $cid, '', $GLOBALS['conf']['images']['direct']);
- } else {
- $img_params = array('f' => $cid . '.' . $GLOBALS['conf']['images']['image_type'],
- 's' => 'vfs',
- 'p' => self::VFS_PATH . '/images/categories/',
- 'c' => 'news');
- return Horde_Util::addParameter(Horde::url('/services/images/view.php'), $img_params);
- }
- }
-
- /**
- * Get available categories
- *
- * @return array An array containing caegories
- */
- public function getCategories($flat = true)
- {
- $lang = News::getLang();
- $cache_key = 'NewsCategories_' . $lang . '_' . (int)$flat;
- $categories = $GLOBALS['cache']->get($cache_key, $GLOBALS['conf']['cache']['default_lifetime']);
- if ($categories) {
- return unserialize($categories);
- }
-
- $this->_connect();
-
- $sql = 'SELECT c.category_id, l.category_name, c.category_parentid, l.category_description, c.category_image '
- . ' FROM ' . $this->prefix . '_categories c, ' . $this->prefix . '_categories_nls l '
- . ' WHERE c.category_id = l.category_id AND l.category_nls = ? ORDER BY category_name ASC';
- $result = $this->_db->getAssoc($sql, false, array($lang), DB_FETCHMODE_ASSOC);
-
- if ($result instanceof PEAR_Error) {
- return $result;
- }
-
- if (!$flat) {
- $GLOBALS['cache']->set($cache_key, serialize($result));
- return $result;
- }
-
- $categories = array();
- foreach ($result as $category_id => $row) {
- if (!empty($row['category_description']) && $row['category_name'] != $row['category_description']) {
- $row['category_name'] .= ' [ ' . $row['category_description'] . ' ]';
- }
- $categories[$category_id] = $row['category_name'];
- }
-
- $GLOBALS['cache']->set($cache_key, serialize($categories));
- return $categories;
- }
-
- /**
- * Expire categories cache
- */
- private function _expireCache()
- {
- $langs = $GLOBALS['conf']['attributes']['languages'];
- $langs[] = News::getLang();
-
- foreach ($langs as $lang) {
- $GLOBALS['cache']->expire('NewsCategories_' . $lang . '_0');
- $GLOBALS['cache']->expire('NewsCategories_' . $lang . '_1');
- }
- }
-
- /**
- * Attempts to open a persistent connection to the SQL server.
- *
- * @return boolean True on success.
- */
- private function _connect()
- {
- $this->_db = $GLOBALS['news']->db;
- $this->_write_db = $GLOBALS['news']->write_db;
- }
-}
+++ /dev/null
-<?php
-/**
- * $Id: News.php 1263 2009-02-01 23:25:56Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license inion (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-class News_Driver {
-
- /**
- * Hash containing connection parameters.
- *
- * @var array
- */
- protected $_params = array();
-
- /**
- * Attempts to return a concrete News_Driver instance based on $driver.
- *
- * @param string $driver The type of the concrete News_Driver subclass
- * to return. The class name is based on the
- * storage driver ($driver). The code is
- * dynamically included.
- *
- * @param array $params A hash containing any additional configuration
- * or connection parameters a subclass might need.
- *
- * @return News_Driver The newly created concrete News_Driver.
- * @throws Horde_Exception
- */
- static function factory($driver = 'sql', $params = array())
- {
- $class_name = 'News_Driver_' . $driver;
- require_once NEWS_BASE . '/lib/Driver/' . $driver . '.php';
-
- if (!class_exists($class_name)) {
- throw new Horde_Exception('DRIVER MISSING');
- }
-
- return new $class_name($params);
- }
-
- /**
- * Get news
- *
- * @param int $news news id
- *
- * @return true on succes PEAR_Error on failure
- */
- public function get($id)
- {
- // Admins bypass the cache (can read nonpublished and locked news)
- if (!$GLOBALS['registry']->isAdmin(array('permission' => 'news:admin'))) {
- $key = 'news_' . News::getLang() . '_' . $id;
- $data = $GLOBALS['cache']->get($key, $GLOBALS['conf']['cache']['default_lifetime']);
- if ($data) {
- return unserialize($data);
- }
- }
-
- $data = $this->_get($id);
- if ($data instanceof PEAR_Error) {
- return $data;
- }
-
- if (!$GLOBALS['registry']->isAdmin(array('permission' => 'news:admin'))) {
- $GLOBALS['cache']->set($key, serialize($data));
- }
-
- return $data;
- }
-}
+++ /dev/null
-<?php
-/**
- * $Id: News.php 1263 2009-02-01 23:25:56Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license inion (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-class News_Driver_sql extends News_Driver {
-
- /**
- * Handle for the current database connection.
- *
- * @var DB
- */
- public $db;
-
- /**
- * Handle for the current database connection, used for writing. Defaults
- * to the same handle as $db if a separate write database is not required.
- *
- * @var DB
- */
- public $write_db;
-
- /**
- * Handle for the tables prefix.
- *
- * @var prefix
- */
- public $prefix = 'news';
-
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->_params = Horde::getDriverConfig('storage', 'sql');
- $this->_connect();
- }
-
- /**
- * Updates schedul comments counter
- *
- * @param int $id schedul id
- *
- * @return true on succes PEAR_Error on failure
- */
- public function updateComments($id, $count)
- {
- return $this->write_db->query('UPDATE ' . $this->prefix . ' SET comments = ? WHERE id = ?', array($count, $id));
- }
-
- /**
- * Get news
- *
- * @param int $news news id
- *
- * @return true on succes PEAR_Error on failure
- */
- protected function _get($id)
- {
- $query = 'SELECT n.publish, n.user, n.source, n.sourcelink, n.category1, n.parents, ' .
- ' n.category2, n.attachments, n.picture, n.comments, n.gallery, n.sponsored, ' .
- ' l.title, l.content, l.picture_comment, l.tags, n.selling, n.trackbacks, n.threads, ' .
- ' n.form_id, n.form_ttl FROM ' . $this->prefix . ' AS n, ' . $this->prefix . '_body AS l ' .
- ' WHERE n.id = ? AND n.id=l.id AND l.lang = ?';
-
- /** TODO Allow for now to allow static linked news, but not shown in list
- if (!$registry->isAdmin(array('permission' => 'news:admin'))) {
- $query .= ' AND n.status = ' . News::CONFIRMED;
- }
- */
-
- $data = $this->db->getRow($query, array($id, News::getLang()), DB_FETCHMODE_ASSOC);
- if ($data instanceof PEAR_Error) {
- return $data;
- }
-
- if (empty($data)) {
- return PEAR::raiseError(sprintf(_("There requested news %s don't exist."), $id));
- }
-
- /* Get talks backs */
- if ($data['trackbacks']) {
- $sql = 'SELECT excerpt, created, title, url, blog_name FROM ' . $this->prefix . '_trackback WHERE id = ?';
- $data['trackback'] = $this->db->getAll($sql, array($id), DB_FETCHMODE_ASSOC);
- if ($data['trackback'] instanceof PEAR_Error) {
- return $data['trackback'];
- }
- }
-
- /* Get parents */
- if ($data['parents']) {
- $sql = 'SELECT n.id, n.publish, n.comments, l.title ' .
- ' FROM ' . $this->prefix . ' AS n, ' . $this->prefix . '_body AS l ' .
- ' WHERE n.id IN (' . $data['parents'] . ') AND n.id = l.id AND l.lang = ?';
- $data['parents'] = $this->db->getAssoc($sql, false, array(News::getLang()), DB_FETCHMODE_ASSOC);
- if ($data['parents'] instanceof PEAR_Error) {
- return $data['parents'];
- }
- }
-
- /* Get threads */
- if ($data['threads']) {
- $sql = 'SELECT message_id, forum_id, message_subject, message_seq ' .
- ' FROM agora_messages WHERE message_id IN (' . $data['threads'] . ')';
- $data['threads'] = $this->db->getAssoc($sql, false, null, DB_FETCHMODE_ASSOC);
- if ($data['threads'] instanceof PEAR_Error) {
- return $data['threads'];
- }
- }
-
- return $data;
- }
-
- /**
- * Get news attached files
- *
- * @param int $news_id news id
- * @param string $news_lang news language
- *
- * @return true on succes PEAR_Error on failure
- */
- public function getFiles($news_id, $news_lang = null)
- {
- if (is_null($news_lang)) {
- $news_lang = News::getLang();
- }
-
- $sql = 'SELECT file_id, news_id, news_lang, file_name, file_size, file_type FROM ' . $this->prefix . '_files'
- . ' WHERE news_id = ? AND news_lang = ?';
-
- return $this->db->getAll($sql, array($news_id, $news_lang), DB_FETCHMODE_ASSOC);
- }
-
- /**
- * Get version
- *
- * @param intiger $id news id
- * @param array $info array with all news info
- *
- * @return result of the insert
- */
- public function getVerison($id, $version)
- {
- $sql = 'SELECT id, created, user_uid, content FROM ' . $this->prefix . '_versions WHERE id = ? AND version = ?';
- $result = $this->db->getRow($sql, array($id, $version), DB_FETCHMODE_ASSOC);
- $result['content'] = unserialize($result['content']);
- return $result;
- }
-
- /**
- * Get versions
- *
- * @param intiger $id news id
- * @param array $info array with all news info
- *
- * @return result of the insert
- */
- public function getVerisons($id)
- {
- $sql = 'SELECT version, created, user_uid, content, action FROM ' . $this->prefix . '_versions WHERE id = ? ORDER BY version DESC';
- return $this->db->getAll($sql, array($id), DB_FETCHMODE_ASSOC);
- }
-
- /**
- * Logs a news view.
- *
- * @return boolean True, if the view was logged, false if the message was aleredy seen
- */
- public function logView($id)
- {
- if ($GLOBALS['browser']->isRobot()) {
- exit;
- }
-
- /* We already read this story? */
- if (isset($_COOKIE['news_viewed_news']) &&
- strpos($_COOKIE['news_viewed_news'], ':' . $id . '|') !== false) {
- return false;
- }
-
- /* Rembember when we see a story */
- if (!isset($_COOKIE['news_viewed_news'])) {
- $_COOKIE['news_viewed_news'] = ':';
- }
- $_COOKIE['news_viewed_news'] .= $id . '|' . $_SERVER['REQUEST_TIME'] . ':';
-
- setcookie('news_viewed_news', $_COOKIE['news_viewed_news'], $_SERVER['REQUEST_TIME'] + 22896000, $GLOBALS['conf']['cookie']['path'],
- $GLOBALS['conf']['cookie']['domain'], $GLOBALS['conf']['use_ssl'] == 1 ? 1 : 0);
-
- /* Update the count */
- $sql = 'UPDATE ' . $this->prefix . ' SET view_count = view_count + 1 WHERE id = ?';
- $result = $this->write_db->query($sql, array($id));
- if ($result instanceof PEAR_Error) {
- return $result;
- }
-
- /* Log it */
- $sql = 'INSERT INTO ' . $this->prefix . '_user_reads (id,user,ip,useragent,readdate) VALUES (?, ?, ? , ?, NOW())';
- $result = $this->write_db->query($sql, array($id, $GLOBALS['registry']->getAuth(), $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']));
- if ($result instanceof PEAR_Error) {
- return $result;
- }
-
- return true;
- }
-
- /**
- * Attach a trackback
- */
- public function saveTrackback($id, $title, $url, $excerpt, $blog_name, $trackback_url)
- {
- $sql = 'SELECT COUNT(*) FROM ' . $this->prefix . '_trackback WHERE id = ? AND url = ?';
- $result = $this->db->getOne($sql, array($id, $url));
- if ($result > 0) {
- return PEAR::raiseError(sprintf(_("URL already trackbacked: %s"), $url));
- }
-
- $params = array('id' => $id,
- 'title' => $title,
- 'url' => $url,
- 'excerpt' => $excerpt,
- 'blog_name' => $blog_name,
- 'created' => date('Y-m-d H:i:s'));
-
- $sql = 'INSERT INTO ' . $this->prefix . '_trackback (' . implode(',', array_keys($params)) . ') VALUES (?, ?, ?, ?, ?, ?)';
- $result = $this->write_db->query($sql, $params);
- if ($result instanceof PEAR_Error) {
- return $result;
- }
-
- /* Update trackback count */
- $GLOBALS['cache']->expire('news_' . News::getLang() . '_' . $id);
- return $this->write_db->query('UPDATE ' . $this->prefix . ' SET trackbacks = trackbacks + 1 WHERE id = ?', array($id));
- }
-
- /**
- * Delete a source
- *
- * @param integer $id The source id to delete.
- *
- * @return boolean
- */
- public function deleteSource($id)
- {
- $GLOBALS['cache']->expire('newsSources');
- $this->deleteImage($id, 'sources');
- $sql = 'DELETE FROM ' . $this->prefix . '_sources WHERE sources_id = ?';
- return $this->write_db->query($sql, array($id));
- }
-
- /**
- * Fetches sources list
- *
- * @return array An array containing all sources names
- */
- public function getSources($flat = false)
- {
- $sources = $GLOBALS['cache']->get('newsSources');
- if (empty($sources)) {
- $sql = 'SELECT source_id, source_name, source_url FROM ' . $this->prefix . '_sources ORDER BY source_name ASC';
- $sources = $this->db->getAssoc($sql, true, array(), DB_FETCHMODE_ASSOC);
- $GLOBALS['cache']->set('newsSources', serialize($sources));
- } else {
- $sources = unserialize($sources);
- }
-
- if (!$flat) {
- foreach ($sources as $source_id => $source) {
- $sources[$source_id] = $source['source_name'];
- }
- }
-
- return $sources;
- }
-
- /**
- * Save a source data into the backend from edit form.
- *
- * @param array $info The source data to save.
- *
- * @return mixed PEAR error.
- */
- public function saveSource($info)
- {
- /* Update/Insert source. */
- if (!empty($info['source_id'])) {
- $result = $this->_updateSource($info['source_id'], $info);
- if ($result instanceof PEAR_Error) {
- return $result;
- }
- } else {
- $info['source_id'] = $this->_insertSource($info);
- if ($info['source_id'] instanceof PEAR_Error) {
- return $info['source_id'];
- }
- }
-
- /* If image uploaded save to backend. */
- if (!empty($info['source_image']['name'])) {
- $image = $this->_saveImage($info['source_id'], $info['source_image']['file'], 'sources', $info['source_image_resize']);
- if ($image instanceof PEAR_Error) {
- return $image;
- }
-
- $sql = 'UPDATE ' . $this->prefix . '_sources SET source_image = ? WHERE source_id = ?';
- $this->write_db->query($sql, array(1, $info['source_id']));
- }
-
- $GLOBALS['cache']->expire('newsSources');
- return $info['source_id'];
- }
-
- /**
- * Insert source data.
- *
- * @param mixed $data The source data to insert.
- *
- * @return array Inserted ID or PEAR error.
- */
- private function _insertSource($data)
- {
- $new_id = $this->write_db->nextId('news_sources');
-
- $sql = 'INSERT INTO ' . $this->prefix . '_sources' .
- ' (source_id, source_name, source_url)' .
- ' VALUES (?, ?, ?)';
- $values = array($new_id,
- $data['source_name'],
- $data['source_url']);
-
- $source = $this->write_db->query($sql, $values);
- if ($source instanceof PEAR_Error) {
- Horde::logMessage($source, 'ERR');
- return $source;
- }
-
- return $new_id;
- }
-
- /**
- * Update source data.
- *
- * @param integer $source_id The source id to update.
- * @param array $data The source data to update.
- *
- * @return array NULL or PEAR error.
- */
- private function _updateSource($source_id, $data)
- {
- $sql = 'UPDATE ' . $this->prefix . '_sources' .
- ' SET source_name = ?, source_url = ?' .
- ' WHERE source_id = ?';
- $values = array($data['source_name'],
- $data['source_url'],
- $source_id);
-
- $source = $this->write_db->query($sql, $values);
- if ($source instanceof PEAR_Error) {
- Horde::logMessage($source, 'ERR');
- return $source;
- }
- }
-
- /**
- * Attempts to open a persistent connection to the SQL server.
- *
- * @return boolean True on success.
- * @throws Horde_Exception
- */
- private function _connect()
- {
- $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'news', 'storage');
- $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'news', 'storage');
-
- if (isset($this->_params['prefix'])) {
- $this->prefix = $this->_params['prefix'];
- }
-
- return true;
- }
-
- /**
- * Build whare search
- */
- public function buildQuery($perms = Horde_Perms::READ, $criteria = array())
- {
- static $parts;
-
- $id = serialize($criteria);
- if (isset($parts[$id])) {
- return $parts[$id];
- }
-
- $sql = 'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS l '
- . ' WHERE n.id = l.id AND l.lang = ?';
- $params = array('_lang' => $GLOBALS['registry']->preferredLang());
-
- if ($perms == Horde_Perms::READ) {
- $sql .= ' AND n.publish <= ? ';
- $params['_perms'] = date('Y-m-d H:i:s');
- $sql .= ' AND n.status = ? ';
- $params['_status'] = News::CONFIRMED;
- }
-
- if (empty($criteria)) {
- $parts[$id] = array($sql, $params);
- return $parts[$id];
- }
-
- /* check status */
- if (isset($criteria['status'])) {
- $sql .= ' AND n.status = ?';
- $params['status'] = $criteria['status'];
- }
-
- /* check status */
- if (isset($criteria['source'])) {
- $sql .= ' AND n.source = ?';
- $params['source'] = $criteria['source'];
- }
-
- /* get category */
- if (isset($criteria['category'])) {
- $sql .= ' AND (n.category1 = ? OR n.category2 = ?)';
- $params['category'] = $criteria['category'];
- $params['_category'] = $criteria['category'];
- }
-
- /* seaching for a pericolar word */
- if (isset($criteria['word'])) {
- $sql .= ' AND (l.title LIKE ? OR l.content LIKE ? OR l.tags LIKE ?)';
- $params['word'] = '%' . $criteria['word'] . '%';
- $params['_word'] = '%' . $criteria['word'] . '%';
- $params['tags'] = '%' . $criteria['word'] . '%';
- }
-
- /* submitter */
- if (isset($criteria['user'])) {
- $sql .= ' AND n.user = ? ';
- $params['user'] = $criteria['user'];
- }
-
- /* editor */
- if (isset($criteria['editor'])) {
- $sql .= ' AND n.editor = ? ';
- $params['editor'] = $criteria['editor'];
- }
-
- /* publish time */
- if (isset($criteria['published_to'])) {
- $sql .= ' AND n.publish <= ? ';
- $params['published_to'] = $criteria['published_to'];
- }
-
- if (isset($criteria['published_from'])) {
- $sql .= ' AND n.publish >= ? ';
- $params['published_from'] = $criteria['published_from'];
- }
-
- $parts[$id] = array($sql, $params);
-
- return $parts[$id];
- }
-
- /**
- * Count news
- *
- * @param array $criteria Filter parameter
-
- * @param int $perms Permissions filter
- *
- * @return Nimber of news
- */
- public function countNews($criteria = array(), $perms = Horde_Perms::READ)
- {
- $binds = $this->buildQuery($perms, $criteria);
- $binds[0] = 'SELECT COUNT(*) ' . $binds[0];
-
- return $this->db->getOne($binds[0], $binds[1]);
- }
-
- /**
- * List news
- *
- * @param array $criteria Filter parameter
- * @param int $from Offset
- * @param int $count Limit rows
- * @param int $perms Permissions filter
- *
- * @return array of news data
- */
- public function listNews($criteria = array(), $from = 0, $count = 0, $perms = Horde_Perms::READ)
- {
- $binds = $this->buildQuery($perms, $criteria);
-
- if (!isset($criteria['sort_by'])) {
- $criteria['sort_by'] = 'n.publish';
- }
- if (!isset($criteria['sort_dir'])) {
- $criteria['sort_dir'] = 'DESC';
- }
-
- $binds[0] = 'SELECT n.id, n.publish, n.user, n.category1, n.category2, n.comments, '
- . ' n.picture, n.chars, l.title, l.abbreviation ' . $binds[0]
- . ' ORDER BY ' . $criteria['sort_by']
- . ' ' . $criteria['sort_dir'];
-
- if ($count) {
- $binds[0] = $this->db->modifyLimitQuery($binds[0], $from, $count);
- }
-
- return $this->db->getAll($binds[0], $binds[1], DB_FETCHMODE_ASSOC);
- }
-
- /**
- * Construct tag cloud
- *
- * @param boolean $minimize Minimize tag cloud
- * (remove 1 length strings, and single occurrence)
- *
- * @return mixed The HTML for the tag cloud | PEAR_Error
- */
- public function getCloud($minimize = false)
- {
- $cache_key = 'news_cloud_' . $minimize;
- $cloud = $GLOBALS['cache']->get($cache_key, $GLOBALS['conf']['cache']['default_lifetime']);
- if ($cloud) {
- return $cloud;
- }
-
- $sql = 'SELECT l.tags, n.publish FROM ' . $this->prefix . '_body AS l, '
- . $this->prefix . ' AS n WHERE l.lang = ? AND n.id = l.id AND n.status = ? ORDER BY n.publish DESC';
-
- $result = $this->db->limitQuery($sql, 0, ($minimize ? '100' : '500'), array($GLOBALS['registry']->preferredLang(), News::CONFIRMED));
- if ($result instanceof PEAR_Error) {
- return $result;
- }
-
- $tags_elemets = array();
- while ($news = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
- foreach (explode(' ', $news['tags']) as $tag) {
- if ($minimize && strlen($tag) < 2) {
- continue;
- }
- $tags_elemets[$tag][] = strtotime($news['publish']);
- }
- }
-
- if ($minimize) {
- foreach ($tags_elemets as $tag => $content) {
- if (count($content) == 1) {
- unset($tags_elemets[$tag]);
- }
- }
- }
-
- if (empty($tags_elemets)) {
- return '';
- }
-
- $i = 0;
- $tags = new News_TagCloud();
- $tag_link = Horde::url('search.php');
- foreach ($tags_elemets as $tag => $time) {
- sort($time);
- $tags->addElement($tag, Horde_Util::addParameter($tag_link, array('word' => $tag)),
- count($tags_elemets[$tag]), $time[0]);
- }
-
- $cloud = $tags->buildHTML();
- $GLOBALS['cache']->set($cache_key, $cloud);
-
- return $cloud;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * News search form
- *
- * $Id: Search.php 1175 2009-01-19 15:17:06Z duck $
- *
- * Copyright Obala d.o.o. (www.obala.si)
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-class News_Search extends Horde_Form {
-
- /**
- * Creator
- */
- public function __construct($vars)
- {
- parent::__construct($vars, _("Search"), 'news_search');
-
- $this->_submit = _("Search");
-
- $this->addVariable(_("Search world"), 'word', 'text', false, false, false);
-
- $s = array(News::UNCONFIRMED => _("Unconfirmed"),
- News::CONFIRMED => _("Confirmed"),
- News::LOCKED => _("Locked"));
- $this->addVariable(_("Status"), 'status', 'enum', false, false, false, array($s, _("-- select --")));
-
- $allowed_cats = $GLOBALS['news_cat']->getAllowed(Horde_Perms::DELETE);
- $this->addVariable(_("Category"), 'category', 'enum', false, false, false, array($allowed_cats, _("-- select --")));
-
- $sources = $GLOBALS['news']->getSources();
- if (!empty($sources)) {
- $this->addVariable(_("Source"), 'source', 'enum', false, false, false, array($sources, _("-- select --")));
- }
-
- $this->addVariable(_("Order by"), 'sort_by', 'enum', false, false, false, array(array('n.publish' => _("Publish date"),
- 'n.id' => _("Id"),
- 'l.title' => _("Title"),
- 'n.comments' => _("Comments"),
- 'n.reads' => _("Reads"),
- 'n.attachemt' => _("Attachments"))));
-
- $this->addVariable(_("Sort order"), 'sort_dir', 'enum', false, false, false, array(array('DESC' => _("Descending"),
- 'ASC' => _("Ascending"))));
-
- $this->addVariable(_("Publish"), 'publish', 'datetime', false, false, false, $GLOBALS['news']->datetimeParams());
- $this->addVariable(_("Unpublish"), 'unpublish', 'datetime', false, false, false, $GLOBALS['news']->datetimeParams());
- $this->addVariable(_("User"), 'user', 'text', false, false, false);
-
- if ($GLOBALS['registry']->isAdmin()) {
- $this->addVariable(_("Editor"), 'editor', 'text', false, false, false);
- }
-
- }
-
- /**
- * Get pager
- */
- public function getPager($info, $count, $url)
- {
- $pager = new Horde_Core_Ui_Pager('news_page',
- Horde_Variables::getDefaultVariables(),
- array('num' => $count,
- 'url' => $url,
- 'page_count' => 10,
- 'perpage' => $GLOBALS['prefs']->getValue('per_page')));
-
- foreach ($info as $key => $value) {
- if (substr($key, 0, 1) == '_') {
- continue;
- } elseif ($key == 'word') {
- $pager->preserve($key, substr($value, 1, -1));
- } else {
- $pager->preserve($key, $value);
- }
- }
-
- return $pager;
- }
- /**
- * Fetch the field values of the submitted form.
- *
- * @param Horde_Variables $vars A Horde_Variables instance, optional since Horde 3.2.
- * @param array $info Array to be filled with the submitted field
- * values.
- */
- function getInfo($vars, &$info)
- {
- $this->_getInfoFromVariables($this->getVariables(), $this->_vars, $info);
- }
-
- /**
- * Fetch the field values from a given array of variables.
- *
- * @access private
- *
- * @param array $variables An array of Horde_Form_Variable objects to
- * fetch from.
- * @param object $vars The Horde_Variables object.
- * @param array $info The array to be filled with the submitted
- * field values.
- */
- function _getInfoFromVariables($variables, &$vars, &$info)
- {
- foreach ($variables as $var) {
- $value = $var->getValue($vars);
- if (empty($value)) {
- continue;
- }
-
- if (Horde_Array::getArrayParts($var->getVarName(), $base, $keys)) {
- if (!isset($info[$base])) {
- $info[$base] = array();
- }
- $pointer = &$info[$base];
- while (count($keys)) {
- $key = array_shift($keys);
- if (!isset($pointer[$key])) {
- $pointer[$key] = array();
- }
- $pointer = &$pointer[$key];
- }
- $var->getInfo($vars, $pointer);
- } else {
- $var->getInfo($vars, $info[$var->getVarName()]);
- }
-
- }
- }
-
-}
+++ /dev/null
-<?php
-/**
- * News base class
- *
- * $Id: News.php 1263 2009-02-01 23:25:56Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license inion (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-class News {
-
- const UNCONFIRMED = 0;
- const CONFIRMED = 1;
- const LOCKED = 2;
-
- const VFS_PATH = '.horde/news';
-
- /**
- * Returns the current language
- *
- * @return string The current language.
- */
- static public function getLang()
- {
- global $conf;
-
- static $lang;
-
- if ($lang === null) {
- $lang = $GLOBALS['registry']->preferredLang();
- if (!empty($conf['attributes']['languages']) &&
- !in_array($lang, $conf['attributes']['languages'])) {
- $lang = $conf['attributes']['languages'][0];
- }
- }
-
- return $lang;
- }
-
- /**
- * Returns a flag image for a country.
- *
- * @param string $lang The language to return the flag for, e.g. 'us'.
- */
- static public function getFlag($country)
- {
- $flag = 'flags/' . strtolower(substr($country, -2)) . '.png';
- return Horde::img($flag, $country);
- }
-
- /**
- * Load trackback object
- *
- * @param array $data Data to pass to the communication
- */
- static public function loadTrackback($data = array())
- {
- include_once 'Services/Trackback.php';
- if (!class_exists('Services_Trackback')) {
- return PEAR::raiseError(_("Services/Trackback is not installed."));
- }
-
- $trackback_conf = $GLOBALS['conf']['trackback'];
- unset($trackback_conf['spamcheck']);
- $trackback_conf['httprequest'] = array(
- 'allowRedirects' => true,
- 'maxRedirects' => 2,
- 'useragent' => 'HORDE News'
- );
-
- return Services_Trackback::create($data, $trackback_conf);
- }
-
- /**
- * Return a properly formatted link depending on the global pretty url
- * configuration
- *
- * @param string $controller The controller to generate a URL for.
- * @param array $data The data needed to generate the URL.
- * @param boolean $full Generate a full URL.
- * @param integer $append_session 0 = only if needed, 1 = always,
- * -1 = never.
- *
- * @param string The generated URL
- */
- static public function getUrlFor($controller, $data, $full = false, $append_session = 0)
- {
- switch ($controller) {
-
- case 'news':
- if (empty($GLOBALS['conf']['urls']['pretty'])) {
- return Horde_Util::addParameter(Horde::url('news.php', $full, $append_session), 'id', $data);
- } else {
- return Horde::url('article/' . $data, $full, $append_session);
- }
-
- case 'category':
- if (empty($GLOBALS['conf']['urls']['pretty'])) {
- return Horde_Util::addParameter(Horde::url('browse.php', $full, $append_session), 'category', $data);
- } else {
- return Horde::url('category/' . $data, $full, $append_session);
- }
-
- case 'source':
- if (empty($GLOBALS['conf']['urls']['pretty'])) {
- return Horde_Util::addParameter(Horde::url('browse.php', $full, $append_session), 'source', $data);
- } else {
- return Horde::url('source/' . $data, $full, $append_session);
- }
- }
- }
-
- /**
- * Template path
- *
- * @param intiger $id $category id
- * @param string $type browse/news
- *
- * @return string $template template path
- */
- static public function getTemplatePath($cid, $type)
- {
- $template = NEWS_TEMPLATES . '/' . $type . '/';
- if (file_exists($template . $cid)) {
- $template .= $cid . '/';
- }
-
- return $template;
- }
-
- /**
- * Format file size
- *
- * @param int $size File size
- *
- * @return boolean formatted file_size.
- */
- static public function format_filesize($size)
- {
- $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
- $pass = 0; // set zero, for Bytes
- while ($size >= 1024) {
- $size /= 1024;
- $pass++;
- }
-
- return round($size, 2) . ' ' . $units[$pass];
- }
-
- /**
- * Formats time according to user preferences.
- *
- * @param int $timestamp Message timestamp.
- *
- * @return string Formatted date.
- */
- static public function dateFormat($timestamp)
- {
- static $df, $tf;
-
- if ($df === null) {
- $df = $GLOBALS['prefs']->getValue('date_format');
- $tf = $GLOBALS['prefs']->getValue('twentyFour');
- }
-
- if (is_string($timestamp)) {
- $timestamp = strtotime($timestamp);
- }
-
- return strftime($df, $timestamp)
- . ' '
- . (date($tf ? 'G:i' : 'g:ia', $timestamp));
- }
-
- /**
- * Format file size
- *
- * @param int $id News ID
- *
- * @return boolean formatted file_size.
- */
- public function format_attached($id)
- {
- $files = $GLOBALS['news']->getFiles($id);
- if (empty($files)) {
- return '';
- }
-
- if ($GLOBALS['registry']->isAdmin(array('permission' => 'news:admin'))) {
- $delete_img = Horde::img('delete.png', _("Delete"), ' style="width: 16px height: 16px"');
- $delete_url = Horde::url('delete_file.php');
- }
-
- $dowload_img = Horde::img('save.png', _("Dowload"), ' style="width: 16px height: 16px"');
- $dowload_zip = Horde::img('mime/compressed.png', _("Dowload Zip Compressed"), 'style="width: 16px height: 16px"');
- $view_url = Horde::url('files.php');
-
- $html = '<table><tr valign="top"><td>';
- $html .= Horde::link(Horde_Util::addParameter($view_url, array('actionID' => 'download_zip_all', 'news_id' => $id)), _("Compress and dowload all files at once")) . $dowload_zip . '</a> ' . "\n";
- $html .= _("Attached files: ") . '</td><td>' . "\n";
-
- foreach ($files as $file) {
- $view_url = Horde_Util::addParameter($view_url, $file);
- $html .= ' - ' . "\n";
- $html .= Horde::link(Horde_Util::addParameter($view_url, 'actionID', 'download_zip'), sprintf(_("Compress and dowload %s"), $file['file_name'])) . $dowload_zip . '</a> ' . "\n";
- $html .= Horde::link(Horde_Util::addParameter($view_url, 'actionID', 'download_file'), sprintf(_("Dowload %s"), $file['file_name'])) . $dowload_img . '</a> ' . "\n";
- $html .= Horde::link(Horde_Util::addParameter($view_url, 'actionID', 'view_file'), sprintf(_("Preview %s"), $file['file_name']), '', '_file_view');
- $html .= Horde::img($GLOBALS['injector']->getInstance('Horde_Mime_Viewer')->getIcon($file['file_type']), $file['file_name'], 'width="16" height="16"', '') . ' ';
- if ($GLOBALS['registry']->isAdmin(array('permission' => 'news:admin'))) {
- $html .= Horde::link(Horde_Util::addParameter($delete_url, $file), sprintf(_("Delete %s"), $file['file_name'])) . $delete_img . '</a> ' . "\n";
- }
- $html .= $file['file_name'] . '</a> ' . "\n";
- $html .= ' (' . self::format_filesize($file['file_size']) . ')';
- $html .= '<br /> ' . "\n";
- }
-
- $html .= ' </td></tr></table>';
-
- return $html;
- }
-
- /**
- * Store image
- *
- * @param $id Image owner record id
- * @param $file['file_name'] Horde_Form_Type_image::getInfo() result
- * @param $type Image type ('events', 'categories' ...)
- * @param $resize Resize the big image?
- */
- static public function saveImage($id, $file, $type = 'news', $resize = true)
- {
- global $conf;
-
- $vfs = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images');
- $vfspath = self::VFS_PATH . '/images/' . $type;
- $vfs_name = $id . '.' . $conf['images']['image_type'];
-
- $context = array('tmpdir' => Horde::getTempDir());
- if (!empty($conf['image']['convert'])) {
- $context['convert'] = $conf['image']['convert'];
- $context['identify'] = $conf['image']['identify'];
- }
- $params = array('type' => $conf['images']['image_type'],
- 'context' => $context);
- $driver = $conf['image']['driver'];
- $img = Horde_Image::factory($driver, $params);
- $result = $img->loadFile($file);
-
- // Store big image for articles
- if ($type == 'news') {
-
- // Store full image
- $vfs->writeData($vfspath . '/full/', $vfs_name, $img->raw(), true);
-
- // Resize big image?
- if ($resize) {
- $dimensions = $img->getDimensions();
- if ($dimensions instanceof PEAR_Error) {
- return $dimensions;
- }
-
- $resize = $img->resize(min($conf['images']['image_width'], $dimensions['width']),
- min($conf['images']['image_height'], $dimensions['height']));
- if ($resize instanceof PEAR_Error) {
- return $resize;
- }
- }
-
- // Store big image
- $vfs->writeData($vfspath . '/big/', $vfs_name, $img->raw(), true);
- }
-
- // Resize thumbnail
- $dimensions = $img->getDimensions();
- $resize = $img->resize(min($conf['images']['thumbnail_width'], $dimensions['width']),
- min($conf['images']['thumbnail_height'], $dimensions['height']));
- if ($resize instanceof PEAR_Error) {
- return $resize;
- }
-
- // Trick path for articles
- if ($type == 'news') {
- $vfspath .= '/small';
- }
-
- // Store thumbnail
- return $vfs->writeData($vfspath, $vfs_name, $img->raw(), true);
- }
-
- /**
- * Delete image
- *
- * @param $id Image id (item id)
- */
- static public function deleteImage($id)
- {
- $vfs = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images');
- $vfs_name = $id . '.' . $GLOBALS['conf']['images']['image_type'];
- $vfs->deleteFile(self::VFS_PATH . '/images/news/full', $vfs_name);
- $vfs->deleteFile(self::VFS_PATH . '/images/news/small', $vfs_name);
- $vfs->deleteFile(self::VFS_PATH . '/images/news/big', $vfs_name);
- }
-
- /**
- * Store file
- *
- * @param $file_id File id
- * @param $file_src File path
- */
- static public function saveFile($file_id, $file_src)
- {
- $vfs = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images');
- $vfs->writeData(self::VFS_PATH . '/files/', $file_id, file_get_contents($file_src), true);
- }
-
- /**
- * Get file contents
- *
- * @param $file_id File ID
- */
- static public function getFile($file_id)
- {
- $vfs = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images');
- $vfs->read(self::VFS_PATH . '/files/', $file_id);
- }
-
- /**
- * Delete file
- *
- * @param $id File ID
- */
- static public function deleteFile($file_id)
- {
- $vfs = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images');
- if ($vfs->exists(self::VFS_PATH . '/files/', $file_id)) {
- $vfs->deleteFile(self::VFS_PATH . '/files/', $file_id);
- }
- }
-
- /**
- * Returns image path
- */
- static public function getImageUrl($id, $view = 'small', $type = 'news')
- {
- if (empty($GLOBALS['conf']['images']['direct'])) {
- return Horde_Util::addParameter(Horde::url('view.php'),
- array('type' => $type,
- 'view' => $view,
- 'id' => $id),
- null, false);
- } else {
- return $GLOBALS['conf']['images']['direct'] .
- '/' . $type . '/' . $view . '/' .
- $id . '.' . $GLOBALS['conf']['images']['image_type'];
- }
- }
-
- /**
- * Returns gallery images
- */
- static public function getGalleyImages($id)
- {
- $images = $GLOBALS['cache']->get("news_gallery_$id", 0);
- if ($images) {
- return unserialize($images);
- }
-
- $images = $GLOBALS['registry']->call('images/listImages', array('ansel', $id, Horde_Perms::SHOW, 'thumb'));
- $GLOBALS['cache']->set("news_gallery_$id", serialize($images));
-
- return $images;
- }
-
-
-
- /**
- * Fomates time accoring to user prefs
- *
- * @param int $timestamp message timestamp
- *
- * @return string $date fromatted date
- */
- public function datetimeParams()
- {
- static $params;
-
- if (!is_array($params)) {
- $sql = 'SELECT MIN(YEAR(publish)) FROM ' . $GLOBALS['news']->prefix;
- $params = array('start_year' => $GLOBALS['news']->db->getOne($sql),
- 'end_year' => date('Y') + 1,
- 'picker' => true,
- 'format_in' => '%Y-%m-%d %H:%M:%S',
- 'format_out' => '%Y-%m-%d %H:%M:%S');
- }
-
- return $params;
- }
-
- /**
- * Get last submitted comments
- *
- * @param int $limit How many comments to show
- */
- static public function getLastComments($limit = 10)
- {
- $cache_key = 'news_lastcommetns_' . $limit;
- $threads = $GLOBALS['cache']->get($cache_key, $GLOBALS['conf']['cache']['default_lifetime']);
- if ($threads) {
- return unserialize($threads);
- }
-
- global $registry;
-
- if (!$registry->hasMethod('forums/getForumName')) {
- return PEAR::raiseError(_("Comments are not supported."));
- }
-
- $params = array(0, 'message_timestamp', 1, false, 'news', null, 0, $limit);
- $threads = $registry->call('forums/getThreads', $params);
-
- foreach ($threads as $id => $message) {
- try {
- $news_id = $registry->call('forums/getForumName', array('news', $message['forum_id']));
- } catch (Horde_Exception $e) {
- unset($threads[$id]);
- continue;
- }
-
- $threads[$id]['news_id'] = $news_id;
- $threads[$id]['read_url'] = self::getUrlFor('news', $news_id, true);
- }
-
- $GLOBALS['cache']->set($cache_key, serialize($threads));
- return $threads;
- }
-
- /**
- * Build News's list of menu articles
- */
- static public function getMenu()
- {
- $menu = new Horde_Menu();
- $img_dir = Horde_Themes::img(null, 'horde');
-
- if ($GLOBALS['prefs']->getValue('news_layout') != '') {
- $menu->add(Horde::url('content.php'), _("Overview"), 'layout.png', $img_dir);
- }
- $menu->add(Horde::url('browse.php'), _("Archive"), 'info.png', $img_dir);
- $menu->add(Horde::url('search.php'), _("Search"), 'search.png', $img_dir);
- $menu->add(Horde::url('add.php'), _("Add"), 'edit.png', $img_dir);
-
- if ($GLOBALS['conf']['attributes']['tags']) {
- $menu->add(Horde::url('cloud.php'), _("Tag cloud"), 'colorpicker.png', $img_dir);
- }
-
- if ($GLOBALS['registry']->isAdmin(array('permission' => 'news:admin'))) {
- $menu->add(Horde::url('edit.php'), _("Editorship"), 'config.png', $img_dir);
- $menu->add(Horde::url('admin/categories/index.php'), _("Administration"), 'administration.png', $img_dir);
- }
-
- return $menu;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * News search form
- *
- * $Id: Search.php 1175 2009-01-19 15:17:06Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-class News_Search extends Horde_Form {
-
- /**
- * Creator
- */
- public function __construct($vars)
- {
- parent::__construct($vars, _("Search"), 'news_search');
-
- $this->_submit = _("Search");
-
- $this->addVariable(_("Search world"), 'word', 'text', false, false, false);
-
- $s = array(News::UNCONFIRMED => _("Unconfirmed"),
- News::CONFIRMED => _("Confirmed"),
- News::LOCKED => _("Locked"));
- $this->addVariable(_("Status"), 'status', 'enum', false, false, false, array($s, _("-- select --")));
-
- $allowed_cats = $GLOBALS['news_cat']->getAllowed(Horde_Perms::DELETE);
- $this->addVariable(_("Category"), 'category', 'enum', false, false, false, array($allowed_cats, _("-- select --")));
-
- $sources = $GLOBALS['news']->getSources();
- if (!empty($sources)) {
- $this->addVariable(_("Source"), 'source', 'enum', false, false, false, array($sources, _("-- select --")));
- }
-
- $this->addVariable(_("Order by"), 'sort_by', 'enum', false, false, false, array(array('n.publish' => _("Publish date"),
- 'n.id' => _("Id"),
- 'l.title' => _("Title"),
- 'n.comments' => _("Comments"),
- 'n.reads' => _("Reads"),
- 'n.attachemt' => _("Attachments"))));
-
- $this->addVariable(_("Sort order"), 'sort_dir', 'enum', false, false, false, array(array('DESC' => _("Descending"),
- 'ASC' => _("Ascending"))));
-
- $this->addVariable(_("Publish"), 'publish', 'datetime', false, false, false, News::datetimeParams());
- $this->addVariable(_("Unpublish"), 'unpublish', 'datetime', false, false, false, News::datetimeParams());
- $this->addVariable(_("User"), 'user', 'text', false, false, false);
-
- if ($GLOBALS['registry']->isAdmin()) {
- $this->addVariable(_("Editor"), 'editor', 'text', false, false, false);
- }
- }
-
- /**
- * Get pager
- */
- static public function getPager($info, $count, $url)
- {
- $pager = new Horde_Core_Ui_Pager('news_page',
- Horde_Variables::getDefaultVariables(),
- array('num' => $count,
- 'url' => $url,
- 'page_count' => 10,
- 'perpage' => $GLOBALS['prefs']->getValue('per_page')));
-
- foreach ($info as $key => $value) {
- if (substr($key, 0, 1) == '_') {
- continue;
- } elseif ($key == 'word') {
- $pager->preserve($key, substr($value, 1, -1));
- } else {
- $pager->preserve($key, $value);
- }
- }
-
- return $pager;
- }
- /**
- * Fetch the field values of the submitted form.
- *
- * @param Horde_Variables $vars A Horde_Variables instance, optional since Horde 3.2.
- * @param array $info Array to be filled with the submitted field
- * values.
- */
- function getInfo($vars, &$info)
- {
- $this->_getInfoFromVariables($this->getVariables(), $this->_vars, $info);
- }
-
- /**
- * Fetch the field values from a given array of variables.
- *
- * @access private
- *
- * @param array $variables An array of Horde_Form_Variable objects to
- * fetch from.
- * @param object $vars The Horde_Variables object.
- * @param array $info The array to be filled with the submitted
- * field values.
- */
- function _getInfoFromVariables($variables, &$vars, &$info)
- {
- foreach ($variables as $var) {
- $value = $var->getValue($vars);
- if (empty($value)) {
- continue;
- }
-
- if (Horde_Array::getArrayParts($var->getVarName(), $base, $keys)) {
- if (!isset($info[$base])) {
- $info[$base] = array();
- }
- $pointer = &$info[$base];
- while (count($keys)) {
- $key = array_shift($keys);
- if (!isset($pointer[$key])) {
- $pointer[$key] = array();
- }
- $pointer = &$pointer[$key];
- }
- $var->getInfo($vars, $pointer);
- } else {
- $var->getInfo($vars, $info[$var->getVarName()]);
- }
-
- }
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Extend Horde TagCloud to allow complete css font sizes
- *
- * $Id: News.php 1263 2009-02-01 23:25:56Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license inion (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-class News_TagCloud extends Horde_Core_Ui_TagCloud {
-
- /**
- * create a Element of HTML part
- *
- * @return string a Element of Tag HTML
- * @param array $tag
- * @param string $type css class of time line param
- * @param int $fontsize
- */
- protected function _createHTMLTag($tag, $type, $fontsize)
- {
- return sprintf("<a class=\"%s\" href=\"%s\">%s</a>\n",
- $type,
- $tag['url'],
- htmlspecialchars($tag['name']));
- }
-
- /**
- * wrap div tag
- *
- * @return string
- * @param string $html
- */
- protected function _wrapDiv($html)
- {
- return $html;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * News General View Class
- *
- * $Id: View.php 1260 2009-02-01 23:15:50Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-class News_View extends Horde_View {
-
- /**
- * Constructor
- */
- public function __construct()
- {
- /* Set parents defualt data */
- parent::__construct(array('templatePath' => NEWS_TEMPLATES,
- 'encoding' => $GLOBALS['registry']->preferredLang()));
- }
-
- /**
- * Formats time according to user preferences.
- *
- * @param int $timestamp Message timestamp.
- *
- * @return string Formatted date.
- */
- public function format_date($timestamp)
- {
- return strftime($GLOBALS['prefs']->getValue('date_format'), $timestamp);
- }
-
- /**
- * Formats time according to user preferences.
- *
- * @param int $timestamp Message timestamp.
- *
- * @return string Formatted date.
- */
- public function format_datetime($timestamp)
- {
- return strftime($GLOBALS['prefs']->getValue('date_format'), $timestamp)
- . ' '
- . (date($GLOBALS['prefs']->getValue('twentyFour') ? 'G:i' : 'g:ia', $timestamp));
- }
-
- /**
- * Link tags
- *
- * @param string $tags Video's tags
- */
- public function getTagsLinks($tags)
- {
- if (empty($tags)) {
- return '';
- }
-
- $html = '';
- $search = Horde::url('search.php');
- foreach (explode(' ', $tags) as $tag) {
- $html .= '<a href="'
- . Horde_Util::addParameter($search, array('word' => $tag))
- . '">' . $tag . '</a> ';
- }
-
- return $html;
- }
-}
+++ /dev/null
-<?php
-/**
- * News base
- *
- * $Id: base.php 1260 2009-02-01 23:15:50Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-// Check for a prior definition of HORDE_BASE (perhaps by an
-// auto_prepend_file definition for site customization).
-if (!defined('HORDE_BASE')) {
- define('HORDE_BASE', dirname(__FILE__) . '/../..');
-}
-
-// Load the Horde Framework core.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$registry = new Horde_Registry();
-try {
- $registry->pushApp('news', array('check_perms' => (Horde_Util::nonInputVar('news_authentication') != 'none'), 'logintasks' => true));
-} catch (Horde_Exception $e) {
- $registry->authenticateFailure('news', $e);
-}
-$conf = &$GLOBALS['conf'];
-define('NEWS_TEMPLATES', $registry->get('templates'));
-
-// Define the base file path of News.
-if (!defined('NEWS_BASE')) {
- define('NEWS_BASE', dirname(__FILE__) . '/..');
-}
-
-// Cache
-$GLOBALS['cache'] = $injector->getInstance('Horde_Cache');
-
-// Set up News drivers.
-$GLOBALS['news'] = News_Driver::factory();
-$GLOBALS['news_cat'] = new News_Categories();
-
-// Start compression.
-if (!Horde_Util::nonInputVar('no_compress')) {
- Horde::compressOutput();
-}
+++ /dev/null
-Deny from all
+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Horde Project
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2010-08-17 17:46+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: templates/edit/info.php:103
-msgid " at "
-msgstr ""
-
-#: news.php:38 templates/edit/info.php:103
-msgid " by "
-msgstr ""
-
-#: content_edit.php:28
-#, php-format
-msgid "%s :: Add Content"
-msgstr ""
-
-#: mail.php:48
-#, php-format
-msgid ""
-"%s would you like to invite you to read the news\n"
-" Title: %s\n"
-"\n"
-" Published: %s \n"
-"Link: %s"
-msgstr ""
-
-#: templates/news/news.php:21
-msgid "* Sponsored news"
-msgstr ""
-
-#: add.php:130 add.php:137 add.php:154 lib/Search.php:31 lib/Search.php:34
-#: lib/Search.php:38 lib/Forms/Search.php:28 lib/Forms/Search.php:31
-#: lib/Forms/Search.php:35
-msgid "-- select --"
-msgstr ""
-
-#: templates/edit/header.inc:5
-msgid "Action"
-msgstr ""
-
-#: templates/edit/row.php:20
-msgid "Activate"
-msgstr ""
-
-#: lib/News.php:455
-msgid "Add"
-msgstr ""
-
-#: content.php:26
-msgid "Add Content"
-msgstr ""
-
-#: admin/categories/index.php:40 admin/sources/index.php:42
-msgid "Add New"
-msgstr ""
-
-#: lib/Categories.php:491 lib/Categories.php:505
-msgid "Add New Item"
-msgstr ""
-
-#: admin/sources/edit.php:19
-msgid "Add Source"
-msgstr ""
-
-#: admin/categories/edit.php:18
-msgid "Add category"
-msgstr ""
-
-#: add.php:97
-msgid "Add news"
-msgstr ""
-
-#: templates/news/tools.php:18
-msgid "Add to bookmarks."
-msgstr ""
-
-#: templates/news/tools.php:24
-msgid "Add to notes."
-msgstr ""
-
-#: add.php:153
-msgid "Additional news attributes"
-msgstr ""
-
-#: add.php:218 lib/Application.php:30
-msgid "Admin"
-msgstr ""
-
-#: lib/News.php:463
-msgid "Administration"
-msgstr ""
-
-#: templates/edit/info.php:32
-msgid "Allow comments"
-msgstr ""
-
-#: lib/News.php:453
-msgid "Archive"
-msgstr ""
-
-#: delete_file.php:24
-msgid "Are you sure you want to delete file?"
-msgstr ""
-
-#: delete.php:24
-msgid "Are you sure you want to delete this news?"
-msgstr ""
-
-#: lib/Search.php:49 lib/Forms/Search.php:46
-msgid "Ascending"
-msgstr ""
-
-#: config/prefs.php.dist:40
-msgid "Ascesending"
-msgstr ""
-
-#: lib/News.php:205
-msgid "Attached files: "
-msgstr ""
-
-#: lib/Search.php:46 lib/Forms/Search.php:43
-msgid "Attachments"
-msgstr ""
-
-#: add.php:152
-msgid "Attributes"
-msgstr ""
-
-#: templates/news/info.php:10
-msgid "Besed"
-msgstr ""
-
-#: trackback.php:68
-#, php-format
-msgid "Blog entry %s does not exist."
-msgstr ""
-
-#: templates/news/blog.php:3
-msgid "Blogs"
-msgstr ""
-
-#: browse.php:19 search.php:17
-msgid "Browse"
-msgstr ""
-
-#: templates/news/info.php:4
-msgid "By"
-msgstr ""
-
-#: delete_file.php:25 delete.php:25 admin/categories/delete.php:18
-#: admin/sources/delete.php:19
-msgid "Cancel"
-msgstr ""
-
-#: add.php:200
-msgid "Caption"
-msgstr ""
-
-#: admin/tabs.php:23 lib/Application.php:38 lib/Block/categories.php:3
-#: lib/Block/categories.php:21 templates/categories/edit.html:5
-#: templates/categories/index.html:4 templates/categories/delete.html:5
-msgid "Categories"
-msgstr ""
-
-#: templates/menu.inc:4 templates/news/info.php:6 lib/Search.php:34
-#: lib/Forms/Search.php:31 lib/Block/category.php:35
-msgid "Category"
-msgstr ""
-
-#: admin/categories/index.php:25
-msgid "Category Administration"
-msgstr ""
-
-#: admin/categories/delete.php:29
-msgid "Category deleted."
-msgstr ""
-
-#: admin/categories/edit.php:46
-#, php-format
-msgid "Category succesfully saved."
-msgstr ""
-
-#: admin/categories/delete.php:27 admin/categories/delete.php:32
-msgid "Category was not deleted."
-msgstr ""
-
-#: templates/browse/row.inc:9 templates/news/info.php:9
-msgid "Chars"
-msgstr ""
-
-#: templates/news/news.php:10 templates/edit/info.php:8
-msgid "Click for full picture"
-msgstr ""
-
-#: templates/browse/row.inc:10 templates/edit/header.inc:13 lib/Search.php:44
-#: lib/Forms/Search.php:41
-msgid "Comments"
-msgstr ""
-
-#: lib/News.php:420
-msgid "Comments are not supported."
-msgstr ""
-
-#: lib/News.php:210
-#, php-format
-msgid "Compress and dowload %s"
-msgstr ""
-
-#: lib/News.php:204
-msgid "Compress and dowload all files at once"
-msgstr ""
-
-#: templates/edit/row.php:46 lib/Search.php:29 lib/Forms/Search.php:26
-msgid "Confirmed"
-msgstr ""
-
-#: add.php:125 add.php:148
-msgid "Content"
-msgstr ""
-
-#: templates/reads/header.inc:8
-msgid "Date"
-msgstr ""
-
-#: templates/edit/row.php:17
-msgid "Deactivate"
-msgstr ""
-
-#: templates/edit/row.php:23 admin/categories/index.php:29
-#: admin/categories/index.php:32 admin/sources/index.php:27
-#: admin/sources/index.php:34 lib/News.php:195
-msgid "Delete"
-msgstr ""
-
-#: lib/News.php:215
-#, php-format
-msgid "Delete %s"
-msgstr ""
-
-#: add.php:103 add.php:119
-msgid "Delete existing picture"
-msgstr ""
-
-#: templates/edit/info.php:11
-msgid "Delete picture"
-msgstr ""
-
-#: lib/Search.php:48 lib/Forms/Search.php:45
-msgid "Descending"
-msgstr ""
-
-#: config/prefs.php.dist:39
-msgid "Descesending"
-msgstr ""
-
-#: templates/categories/index.php:8 admin/categories/edit.php:32
-msgid "Description"
-msgstr ""
-
-#: diff.php:18 templates/edit/info.php:112
-msgid "Diff"
-msgstr ""
-
-#: add.php:227
-msgid "Disallow comments"
-msgstr ""
-
-#: templates/edit/info.php:11
-msgid "Do you really want to delete this picture?"
-msgstr ""
-
-#: admin/categories/delete.php:17
-msgid "Do you really wont to delete this category?"
-msgstr ""
-
-#: admin/sources/delete.php:18
-msgid "Do you really wont to delete this source?"
-msgstr ""
-
-#: lib/News.php:199
-msgid "Dowload"
-msgstr ""
-
-#: lib/News.php:211
-#, php-format
-msgid "Dowload %s"
-msgstr ""
-
-#: lib/News.php:200
-msgid "Dowload Zip Compressed"
-msgstr ""
-
-#: edit.php:146 templates/edit/row.php:6 templates/edit/row.php:7
-#: admin/categories/index.php:27 admin/categories/index.php:34
-#: admin/sources/index.php:25 admin/sources/index.php:36
-msgid "Edit"
-msgstr ""
-
-#: admin/sources/edit.php:19
-msgid "Edit Source"
-msgstr ""
-
-#: admin/categories/edit.php:18
-msgid "Edit category"
-msgstr ""
-
-#: templates/edit/info.php:91
-msgid "Edit history: "
-msgstr ""
-
-#: add.php:557
-msgid "Edit news"
-msgstr ""
-
-#: templates/edit/info.php:36 lib/Search.php:56 lib/Forms/Search.php:53
-msgid "Editor"
-msgstr ""
-
-#: lib/Application.php:33
-msgid "Editors"
-msgstr ""
-
-#: lib/News.php:462
-msgid "Editorship"
-msgstr ""
-
-#: add.php:178
-msgid "Enter gallery ID or upload images below"
-msgstr ""
-
-#: add.php:156
-msgid "Enter news ids separated by commas."
-msgstr ""
-
-#: add.php:146
-msgid ""
-"Enter one or more keywords that describe your news. Separate them by spaces."
-msgstr ""
-
-#: add.php:159
-msgid "Enter threads separated by commas."
-msgstr ""
-
-#: delete_file.php:55
-#, php-format
-msgid "Error deleteing file \"%s\" from news \"%s\""
-msgstr ""
-
-#: templates/news/today.php:11
-msgid "Events on this day."
-msgstr ""
-
-#: add.php:212
-msgid "File"
-msgstr ""
-
-#: delete_file.php:74
-#, php-format
-msgid "File \"%s\" was deleted from news \"%s\""
-msgstr ""
-
-#: delete_file.php:81
-#, php-format
-msgid "File \"%s\" was not deleted from news \"%s\""
-msgstr ""
-
-#: add.php:205 add.php:466
-msgid "Files"
-msgstr ""
-
-#: files.php:82
-#, php-format
-msgid "FilesOfNews-%s"
-msgstr ""
-
-#: add.php:264
-msgid "Form ID"
-msgstr ""
-
-#: add.php:265
-msgid "Form to"
-msgstr ""
-
-#: templates/news/blog.php:10
-msgid "From: "
-msgstr ""
-
-#: add.php:181 add.php:188
-msgid "Gallery"
-msgstr ""
-
-#: lib/Api.php:50
-#, php-format
-msgid "Has commented news \"%s\""
-msgstr ""
-
-#: lib/Block/most_commented.php:26 lib/Block/most_read.php:26
-msgid "How many days back to check?"
-msgstr ""
-
-#: lib/Block/last_blogs.php:21 lib/Block/most_commented.php:23
-#: lib/Block/most_read.php:23 lib/Block/last.php:25 lib/Block/category.php:32
-msgid "How many news to display?"
-msgstr ""
-
-#: config/prefs.php.dist:20
-msgid "How many news to show per page"
-msgstr ""
-
-#: config/prefs.php.dist:10
-msgid "How to preview news"
-msgstr ""
-
-#: templates/reads/header.inc:7
-msgid "IP"
-msgstr ""
-
-#: templates/categories/index.php:5 templates/sources/index.php:5
-#: lib/Search.php:42 lib/Forms/Search.php:39 config/prefs.php.dist:29
-msgid "Id"
-msgstr ""
-
-#: admin/categories/edit.php:38 admin/sources/edit.php:37
-msgid "Image"
-msgstr ""
-
-#: add.php:162
-msgid "Images"
-msgstr ""
-
-#: add.php:197
-msgid ""
-"Images will be added to a gallery linked with this article. You can edit and "
-"manage images in gallery."
-msgstr ""
-
-#: templates/edit/row.php:9 templates/edit/row.php:10
-msgid "Info"
-msgstr ""
-
-#: templates/edit/info.php:100
-msgid "Insert"
-msgstr ""
-
-#: templates/common-header.inc:27 rss/index.php:43 rss/comments.php:20
-#: lib/Block/last_comments.php:3 lib/Block/last_comments.php:31
-msgid "Last comments"
-msgstr ""
-
-#: lib/Block/my_comments.php:3
-msgid "Last comments on my news"
-msgstr ""
-
-#: lib/Block/most_commented.php:3 lib/Block/most_commented.php:17
-msgid "Last most commented news"
-msgstr ""
-
-#: lib/Block/most_read.php:3 lib/Block/most_read.php:17
-msgid "Last most read news"
-msgstr ""
-
-#: templates/common-header.inc:26 rss/index.php:37 rss/news.php:32
-#: lib/Block/last.php:3 lib/Block/last.php:17
-#, php-format
-msgid "Last news"
-msgstr ""
-
-#: lib/Block/last_blogs.php:15
-msgid "Last news blog"
-msgstr ""
-
-#: lib/Block/last_blogs.php:3
-msgid "Last news blogged"
-msgstr ""
-
-#: lib/Block/category.php:21 lib/Block/category.php:22
-#, php-format
-msgid "Last news in %s"
-msgstr ""
-
-#: lib/Block/category.php:3
-msgid "Last news in category"
-msgstr ""
-
-#: note.php:27 pdf.php:56
-msgid "Link"
-msgstr ""
-
-#: templates/edit/row.php:30
-msgid "Lock"
-msgstr ""
-
-#: templates/edit/row.php:50 lib/Search.php:30 lib/Forms/Search.php:27
-msgid "Locked"
-msgstr ""
-
-#: add.php:84
-#, php-format
-msgid "Maximum file size: %s; with a total of: %s"
-msgstr ""
-
-#: templates/categories/index.php:6 templates/sources/index.php:6
-#: admin/categories/edit.php:31 admin/sources/edit.php:32
-msgid "Name"
-msgstr ""
-
-#: templates/reads/header.inc:5
-msgid "News"
-msgstr ""
-
-#: edit.php:56 edit.php:70 edit.php:81 edit.php:92 edit.php:103 edit.php:142
-#, php-format
-msgid "News \"%s\" (%s): %s"
-msgstr ""
-
-#: reads.php:30
-#, php-format
-msgid "News %s"
-msgstr ""
-
-#: delete.php:81 delete.php:85
-#, php-format
-msgid "News %s: %s"
-msgstr ""
-
-#: add.php:546
-msgid ""
-"News added. The editors will check the entry and confirm it if they find it "
-"suitable."
-msgstr ""
-
-#: add.php:219
-msgid "News administrator options"
-msgstr ""
-
-#: add.php:126
-msgid "News content"
-msgstr ""
-
-#: templates/news/info.php:3
-msgid "News data"
-msgstr ""
-
-#: add.php:163
-msgid "News images"
-msgstr ""
-
-#: templates/news/today.php:5
-msgid "News of this day."
-msgstr ""
-
-#: add.php:548
-msgid "News published."
-msgstr ""
-
-#: mail.php:57
-#, php-format
-msgid "News succesfully send to %s"
-msgstr ""
-
-#: note.php:38
-msgid "News sucessfuly added to you notes."
-msgstr ""
-
-#: add.php:550
-msgid "News updated."
-msgstr ""
-
-#: templates/edit/info.php:32
-msgid "No"
-msgstr ""
-
-#: diff.php:59
-msgid "No change."
-msgstr ""
-
-#: mail.php:38
-msgid "No mail entered."
-msgstr ""
-
-#: lib/Block/my_comments.php:17 lib/Block/last_comments.php:19
-msgid "Number of comments to display"
-msgstr ""
-
-#: note.php:26 pdf.php:55 templates/news/info.php:5
-msgid "On"
-msgstr ""
-
-#: templates/news/today.php:3
-msgid "On this day"
-msgstr ""
-
-#: delete_file.php:19 delete.php:19
-msgid "Only admin can delete a news."
-msgstr ""
-
-#: add.php:92
-msgid "Only authenticated users can post news."
-msgstr ""
-
-#: mail.php:33
-msgid "Only authenticated users can send mails."
-msgstr ""
-
-#: lib/Search.php:41 lib/Forms/Search.php:38
-msgid "Order by"
-msgstr ""
-
-#: lib/News.php:451
-msgid "Overview"
-msgstr ""
-
-#: templates/news/tools.php:9
-msgid "PDF"
-msgstr ""
-
-#: templates/categories/index.php:7 admin/categories/edit.php:35
-msgid "Parent"
-msgstr ""
-
-#: add.php:156 templates/news/parents.php:5 templates/edit/info.php:44
-msgid "Parents"
-msgstr ""
-
-#: add.php:166 add.php:199
-msgid "Picture"
-msgstr ""
-
-#: add.php:170
-msgid "Picture comment"
-msgstr ""
-
-#: lib/Block/jonah.php:4 lib/Block/jonah.php:24
-msgid "Press overview"
-msgstr ""
-
-#: config/prefs.php.dist:9
-msgid "Preview"
-msgstr ""
-
-#: lib/News.php:212
-#, php-format
-msgid "Preview %s"
-msgstr ""
-
-#: add.php:130 templates/edit/info.php:18 templates/edit/info.php:20
-msgid "Primary category"
-msgstr ""
-
-#: templates/news/tools.php:6
-msgid "Printer firendly"
-msgstr ""
-
-#: add.php:128 lib/Search.php:51 lib/Forms/Search.php:48
-msgid "Publish"
-msgstr ""
-
-#: templates/edit/header.inc:8
-msgid "Publish at"
-msgstr ""
-
-#: lib/Search.php:41 lib/Forms/Search.php:38 config/prefs.php.dist:28
-msgid "Publish date"
-msgstr ""
-
-#: templates/news/parents.php:8 templates/edit/row.php:54
-msgid "Read"
-msgstr ""
-
-#: templates/edit/header.inc:10 lib/Search.php:45 lib/Forms/Search.php:42
-msgid "Reads"
-msgstr ""
-
-#: delete_file.php:25 delete_file.php:51 delete.php:25 delete.php:36
-#: admin/categories/delete.php:18 admin/categories/delete.php:24
-#: admin/sources/delete.php:19 admin/sources/delete.php:25
-msgid "Remove"
-msgstr ""
-
-#: templates/edit/info.php:109
-msgid "Renew"
-msgstr ""
-
-#: add.php:119 add.php:121 add.php:591
-msgid "Reset"
-msgstr ""
-
-#: admin/categories/edit.php:36 admin/sources/edit.php:35
-msgid "Resize Image"
-msgstr ""
-
-#: add.php:121
-msgid "Save"
-msgstr ""
-
-#: lib/News.php:454 lib/Search.php:22 lib/Search.php:24
-#: lib/Forms/Search.php:19 lib/Forms/Search.php:21
-msgid "Search"
-msgstr ""
-
-#: lib/Search.php:26 lib/Forms/Search.php:23
-msgid "Search world"
-msgstr ""
-
-#: add.php:154 templates/edit/info.php:24
-msgid "Secondary category"
-msgstr ""
-
-#: lib/Categories.php:498
-msgid "Select Category"
-msgstr ""
-
-#: lib/Block/jonah.php:35
-msgid "Select a feed."
-msgstr ""
-
-#: add.php:249 templates/edit/info.php:58
-msgid "Selling item"
-msgstr ""
-
-#: templates/news/mail.php:2
-msgid "Send by mail"
-msgstr ""
-
-#: lib/News.php:65
-msgid "Services/Trackback is not installed."
-msgstr ""
-
-#: config/prefs.php.dist:11
-msgid "Set news previerw paramaters"
-msgstr ""
-
-#: lib/Block/last.php:28
-msgid "Skip category"
-msgstr ""
-
-#: config/prefs.php.dist:31 config/prefs.php.dist:41
-msgid "Sort news by"
-msgstr ""
-
-#: add.php:155 templates/edit/info.php:40 lib/Search.php:48
-#: lib/Forms/Search.php:45
-msgid "Sort order"
-msgstr ""
-
-#: add.php:137 templates/edit/info.php:48 lib/Search.php:38
-#: lib/Forms/Search.php:35
-msgid "Source"
-msgstr ""
-
-#: admin/sources/delete.php:30
-msgid "Source deleted."
-msgstr ""
-
-#: add.php:139 templates/edit/info.php:52
-msgid "Source link"
-msgstr ""
-
-#: templates/news/info.php:18
-msgid "Source media"
-msgstr ""
-
-#: templates/news/info.php:13
-msgid "Source news"
-msgstr ""
-
-#: admin/sources/edit.php:45
-msgid "Source saved succesfully."
-msgstr ""
-
-#: admin/sources/delete.php:28 admin/sources/delete.php:33
-msgid "Source was not deleted."
-msgstr ""
-
-#: admin/tabs.php:22 lib/Block/sources.php:3 lib/Block/sources.php:21
-msgid "Sources"
-msgstr ""
-
-#: admin/sources/index.php:17
-msgid "Sources Administration"
-msgstr ""
-
-#: add.php:222
-msgid "Sponsored"
-msgstr ""
-
-#: templates/edit/header.inc:6 lib/Search.php:31 lib/Forms/Search.php:28
-msgid "Status"
-msgstr ""
-
-#: lib/News.php:458
-msgid "Tag cloud"
-msgstr ""
-
-#: add.php:146 lib/Block/tags_cloud.php:3 lib/Block/tags_cloud.php:24
-msgid "Tags"
-msgstr ""
-
-#: templates/news/blog.php:7
-msgid "Talkbacks to this article:"
-msgstr ""
-
-#: templates/news/ulaform.php:13
-msgid "Thanks"
-msgstr ""
-
-#: templates/block/news.php:18 templates/block/titles.php:20
-msgid "There are no news to display."
-msgstr ""
-
-#: lib/Driver/sql.php:85
-#, php-format
-msgid "There requested news %s don't exist."
-msgstr ""
-
-#: news.php:32
-msgid "There requested version don't exist."
-msgstr ""
-
-#: add.php:443
-msgid "There was an error creating gallery: "
-msgstr ""
-
-#: add.php:457
-msgid "There was an error with the uploaded image: "
-msgstr ""
-
-#: add.php:159 templates/news/threads.php:6
-#, php-format
-msgid "Threads in %s"
-msgstr ""
-
-#: add.php:144 templates/edit/header.inc:7 lib/Search.php:43
-#: lib/Forms/Search.php:40 lib/Block/my_comments.php:53
-#: config/prefs.php.dist:30
-msgid "Title"
-msgstr ""
-
-#: templates/news/tools.php:3
-msgid "Tools"
-msgstr ""
-
-#: templates/news/blog.php:22
-msgid "Trackback this blog on this site."
-msgstr ""
-
-#: lib/Driver/sql.php:222
-#, php-format
-msgid "URL already trackbacked: %s"
-msgstr ""
-
-#: templates/edit/row.php:42 lib/Search.php:28 lib/Forms/Search.php:25
-msgid "Unconfirmed"
-msgstr ""
-
-#: templates/edit/row.php:27
-msgid "Unlock"
-msgstr ""
-
-#: lib/Search.php:52 lib/Forms/Search.php:49
-msgid "Unpublish"
-msgstr ""
-
-#: templates/edit/info.php:28
-msgid "Unpublish date"
-msgstr ""
-
-#: add.php:119 add.php:591 templates/edit/info.php:97
-msgid "Update"
-msgstr ""
-
-#: templates/sources/index.php:7 admin/sources/edit.php:33
-msgid "Url"
-msgstr ""
-
-#: templates/news/blog.php:16
-msgid "Use the following link to trackback from your own site: "
-msgstr ""
-
-#: templates/reads/header.inc:6 templates/edit/header.inc:9 lib/Search.php:53
-#: lib/Forms/Search.php:50 lib/Block/my_comments.php:54
-msgid "User"
-msgstr ""
-
-#: templates/edit/info.php:106
-msgid "View"
-msgstr ""
-
-#: admin/sources/index.php:32
-msgid "View articles"
-msgstr ""
-
-#: admin/sources/index.php:29
-msgid "View items"
-msgstr ""
-
-#: templates/edit/info.php:32
-msgid "Yes"
-msgstr ""
-
-#: admin/tabs.php:15
-msgid "You are not authorised for this action."
-msgstr ""
-
-#: mail.php:44
-msgid "You have no email set."
-msgstr ""
-
-#: edit.php:21
-msgid "You have not editor permission on any category."
-msgstr ""
-
-#: edit.php:81
-msgid "activated"
-msgstr ""
-
-#: edit.php:70
-msgid "deactivated"
-msgstr ""
-
-#: delete.php:81
-msgid "deleted"
-msgstr ""
-
-#: edit.php:92
-msgid "locked"
-msgstr ""
-
-#: delete.php:85
-msgid "not deleted"
-msgstr ""
-
-#: edit.php:56
-msgid "picture deleted"
-msgstr ""
-
-#: edit.php:142
-msgid "renewed"
-msgstr ""
-
-#: edit.php:103
-msgid "unlocked"
-msgstr ""
+++ /dev/null
-# translation of sl_SI.po to Slovene
-# Marko Milost <marko.milost@obala.si>, 2007, 2008.
-msgid ""
-msgstr ""
-"Project-Id-Version: sl_SI\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2009-01-21 01:31+0100\n"
-"PO-Revision-Date: 2008-01-15 14:13+0100\n"
-"Last-Translator: Marko Milost <marko.milost@obala.si>\n"
-"Language-Team: Slovene <sl@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.11.4\n"
-"Plural-Forms: nplurals=3;\n"
-
-#: templates/edit/info.php:91
-msgid " at "
-msgstr " ob "
-
-#: templates/edit/info.php:91
-msgid " by "
-msgstr " od "
-
-#: content_edit.php:26
-#, php-format
-msgid "%s :: Add Content"
-msgstr "%s :: Dodaj vsebino"
-
-#: mail.php:46
-#, php-format
-msgid ""
-"%s would you like to invite you to read the news\n"
-" Title: %s\n"
-"\n"
-" Published: %s \n"
-"Link: %s"
-msgstr ""
-"%s vas vabi, da si preberete to novico\n"
-"\n"
-" Naslov: %s\n"
-" Objavljeno: %s\n"
-" Povezava: %s"
-
-#: templates/news/news.php:18
-msgid "* Sponsored news"
-msgstr "* Komercialna objava"
-
-#: add.php:129 add.php:136 add.php:153 lib/Forms/Search.php:31
-#: lib/Forms/Search.php:34 lib/Forms/Search.php:38
-msgid "-- select --"
-msgstr "-- izberi --"
-
-#: templates/edit/header.inc:5
-msgid "Action"
-msgstr "Ukaz"
-
-#: templates/edit/row.php:20
-msgid "Activate"
-msgstr "Aktiviraj"
-
-#: lib/News.php:1123
-msgid "Add"
-msgstr "Vpis"
-
-#: content.php:24
-msgid "Add Content"
-msgstr "Dodaj vsebino"
-
-#: admin/categories/index.php:40 admin/sources/index.php:42
-msgid "Add New"
-msgstr "Dodaj novo"
-
-#: lib/Categories.php:471 lib/Categories.php:485
-msgid "Add New Item"
-msgstr "Dodaj novo"
-
-#: admin/sources/edit.php:19
-msgid "Add Source"
-msgstr "Dodaj vir"
-
-#: admin/categories/edit.php:18
-msgid "Add category"
-msgstr "Dodaj kategorije"
-
-#: add.php:95
-msgid "Add news"
-msgstr "Dodaj novice"
-
-#: templates/news/tools.php:18
-msgid "Add to bookmarks."
-msgstr "Dodaj med priljubljene"
-
-#: templates/news/tools.php:24
-msgid "Add to notes."
-msgstr "Dodaj med zapiske"
-
-#: add.php:152
-msgid "Additional news attributes"
-msgstr "Dodatne lastnosti novice"
-
-#: add.php:218 lib/api.php:49
-msgid "Admin"
-msgstr "Administracija"
-
-#: lib/News.php:1131
-msgid "Administration"
-msgstr "Administracija"
-
-#: templates/edit/info.php:21
-msgid "Allow comments"
-msgstr "Dovoli komentarje"
-
-#: lib/News.php:1121
-msgid "Archive"
-msgstr "Arhiv"
-
-#: delete_file.php:22
-msgid "Are you sure you want to delete file?"
-msgstr "Resnično želite to datoteko?"
-
-#: delete.php:22
-msgid "Are you sure you want to delete this news?"
-msgstr "Resnično želite izbrisati to novico?"
-
-#: lib/Forms/Search.php:49
-msgid "Ascending"
-msgstr "Naraščajoče"
-
-#: config/prefs.php.dist:40
-msgid "Ascesending"
-msgstr "Naraščajoče"
-
-#: lib/News.php:216
-msgid "Attached files: "
-msgstr "Pripete datoteke: "
-
-#: edit.php:44
-msgid "Attachment deleted"
-msgstr "Pripeta datoteka je bila izbrisana"
-
-#: lib/Forms/Search.php:46
-msgid "Attachments"
-msgstr "Pripete datoteke"
-
-#: add.php:151
-msgid "Attributes"
-msgstr "Lastnosti"
-
-#: templates/news/info.php:10
-msgid "Besed"
-msgstr "Besed"
-
-#: trackback.php:65
-#, php-format
-msgid "Blog entry %s does not exist."
-msgstr "Blog vpis %s ne obstaja."
-
-#: templates/news/blog.php:3
-msgid "Blogs"
-msgstr "Blogi"
-
-#: browse.php:16 search.php:16
-msgid "Browse"
-msgstr "Prebrskaj"
-
-#: templates/news/info.php:4
-msgid "By"
-msgstr "Od"
-
-#: delete_file.php:23 delete.php:23 admin/categories/delete.php:18
-#: admin/sources/delete.php:19
-msgid "Cancel"
-msgstr "Prekliči"
-
-#: files.php:52
-#, php-format
-msgid "Cannot read file %s"
-msgstr "Ne morem prebrati datoteke %s"
-
-#: add.php:199
-msgid "Caption"
-msgstr "Komentar k sliki"
-
-#: admin/tabs.php:25 lib/api.php:57 lib/Block/categories.php:3
-#: lib/Block/categories.php:21
-msgid "Categories"
-msgstr "Kategorije"
-
-#: templates/menu.inc:4 templates/news/info.php:6 lib/Forms/Search.php:34
-#: lib/Block/category.php:35
-msgid "Category"
-msgstr "Kategorija"
-
-#: admin/categories/index.php:25
-msgid "Category Administration"
-msgstr "Urejanje kategorij"
-
-#: admin/categories/delete.php:29
-msgid "Category deleted."
-msgstr "Kategorija je bila izbrisana."
-
-#: admin/categories/edit.php:46
-#, php-format
-msgid "Category succesfully saved."
-msgstr "Kategorija je bila uspešno shranjena."
-
-#: admin/categories/delete.php:27 admin/categories/delete.php:32
-msgid "Category was not deleted."
-msgstr "Kategorija ni bila izbrisana."
-
-#: templates/browse/row.inc:9 templates/news/info.php:9
-msgid "Chars"
-msgstr "Znakov"
-
-#: templates/browse/row.inc:10 templates/edit/header.inc:13
-#: lib/Forms/Search.php:44
-msgid "Comments"
-msgstr "Komentarjev"
-
-#: lib/News.php:487
-msgid "Comments are not supported."
-msgstr "Komentarji niso podprti."
-
-#: lib/News.php:222
-#, php-format
-msgid "Compress and dowload %s"
-msgstr "Kompresiraj in prenesi datoteko %s"
-
-#: lib/News.php:215
-msgid "Compress and dowload all files at once"
-msgstr "Kompresiraj in prenesi vse datoteke naenkrat"
-
-#: templates/edit/row.php:46 lib/Forms/Search.php:29
-msgid "Confirmed"
-msgstr "Potrjena"
-
-#: add.php:124 add.php:147
-msgid "Content"
-msgstr "Vsebina"
-
-#: templates/reads/header.inc:8
-msgid "Date"
-msgstr "Datum"
-
-#: templates/edit/row.php:17
-msgid "Deactivate"
-msgstr "Deaktiviraj"
-
-#: templates/edit/row.php:23 admin/categories/index.php:29
-#: admin/categories/index.php:32 admin/sources/index.php:27
-#: admin/sources/index.php:34 lib/News.php:206
-msgid "Delete"
-msgstr "Izbriši"
-
-#: lib/News.php:227
-#, php-format
-msgid "Delete %s"
-msgstr "Izbriši %s"
-
-#: add.php:101 add.php:118
-msgid "Delete existing picture"
-msgstr "Zbriši obstoječo sliko"
-
-#: lib/Forms/Search.php:48
-msgid "Descending"
-msgstr "Padajoče"
-
-#: config/prefs.php.dist:39
-msgid "Descesending"
-msgstr "Padajoče"
-
-#: templates/categories/index.php:8 admin/categories/edit.php:32
-msgid "Description"
-msgstr "Opis"
-
-#: diff.php:14 templates/edit/info.php:100
-msgid "Diff"
-msgstr "Razlike"
-
-#: add.php:227
-msgid "Disallow comments"
-msgstr "Ne dovoli komentarjev"
-
-#: admin/categories/delete.php:17
-msgid "Do you really wont to delete this category?"
-msgstr "Resnično želite izbrisati izbrano kategorijo?"
-
-#: admin/sources/delete.php:18
-msgid "Do you really wont to delete this source?"
-msgstr "Resnično želite izbrisati ta vir?"
-
-#: lib/News.php:210
-msgid "Dowload"
-msgstr "Prenesi"
-
-#: lib/News.php:223
-#, php-format
-msgid "Dowload %s"
-msgstr "Prenesi datoteko %s"
-
-#: lib/News.php:211
-msgid "Dowload Zip Compressed"
-msgstr "Presnemi Zip kompresirano datoteko"
-
-#: edit.php:116 templates/edit/row.php:6 templates/edit/row.php:7
-#: admin/categories/index.php:27 admin/categories/index.php:34
-#: admin/sources/index.php:25 admin/sources/index.php:36
-msgid "Edit"
-msgstr "Uredi"
-
-#: admin/sources/edit.php:19
-msgid "Edit Source"
-msgstr "Uredi vir"
-
-#: admin/categories/edit.php:18
-msgid "Edit category"
-msgstr "Uredi kategoijo"
-
-#: templates/edit/info.php:80
-msgid "Edit history: "
-msgstr "Zgodovina urejanja:"
-
-#: add.php:542
-msgid "Edit news"
-msgstr "Uredi novico"
-
-#: templates/edit/info.php:25 lib/Forms/Search.php:56
-msgid "Editor"
-msgstr "Urednik"
-
-#: lib/api.php:52
-msgid "Editors"
-msgstr "Uredniki"
-
-#: lib/News.php:1130
-msgid "Editorship"
-msgstr "Uredništvo"
-
-#: add.php:177
-msgid "Enter gallery ID or upload images below"
-msgstr "Vnesite ID galerija ali naložite slike"
-
-#: add.php:155
-msgid "Enter news ids separated by commas."
-msgstr "Vnesi id-je novic ločene z vejico."
-
-#: add.php:145
-msgid ""
-"Enter one or more keywords that describe your news. Separate them by spaces."
-msgstr "Vnesite eno ali več besed ločenih s presledki."
-
-#: add.php:158
-msgid "Enter threads separated by commas."
-msgstr "Vnesi id-je debat ločene z vejico."
-
-#: delete_file.php:44
-#, php-format
-msgid "Error deleteing file \"%s\" from news \"%s\""
-msgstr "Napaka pri brisanju datoteke \"%s\" z novice \"%s\""
-
-#: templates/news/today.php:11
-msgid "Events on this day."
-msgstr "Dogodki tega dne"
-
-#: add.php:211
-msgid "File"
-msgstr "Datoteka"
-
-#: delete_file.php:49
-#, php-format
-msgid "File \"%s\" was deleted from news \"%s\""
-msgstr "Datoteke \"%s\" je bila odstranjena od novice \"%s\""
-
-#: delete_file.php:53
-#, php-format
-msgid "File \"%s\" was not deleted from news \"%s\""
-msgstr "Datoteke \"%s\" ni bila odstranjena od novice \"%s\""
-
-#: add.php:204 add.php:458
-msgid "Files"
-msgstr "Datoteke"
-
-#: files.php:60
-#, php-format
-msgid "FilesOfNews-%s"
-msgstr "DatotekeNovice-%s"
-
-#: add.php:258
-msgid "Form ID"
-msgstr "Formular"
-
-#: add.php:259
-msgid "Form to"
-msgstr "Veljavnost formularja "
-
-#: templates/news/blog.php:10
-msgid "From: "
-msgstr "Od: "
-
-#: add.php:180 add.php:187
-msgid "Gallery"
-msgstr "Galerija"
-
-#: lib/api.php:101
-#, php-format
-msgid "Has commented news \"%s\""
-msgstr "Je komentiral novico \"%s\""
-
-#: lib/Block/most_commented.php:26 lib/Block/most_read.php:26
-msgid "How many days back to check?"
-msgstr "Koliko dni stare novice naj pregledam?"
-
-#: lib/Block/last_blogs.php:23 lib/Block/most_commented.php:23
-#: lib/Block/most_read.php:23 lib/Block/last.php:25 lib/Block/category.php:32
-msgid "How many news to display?"
-msgstr "Koliko novic naj pikažem?"
-
-#: config/prefs.php.dist:20
-msgid "How many news to show per page"
-msgstr "Koliko novic naj pikažem na stran?"
-
-#: config/prefs.php.dist:10
-msgid "How to preview news"
-msgstr "Kako naj prikažem novice"
-
-#: templates/reads/header.inc:7
-msgid "IP"
-msgstr "ID"
-
-#: templates/categories/index.php:5 templates/sources/index.php:5
-#: lib/Forms/Search.php:42 config/prefs.php.dist:29
-msgid "Id"
-msgstr "Id"
-
-#: admin/categories/edit.php:38 admin/sources/edit.php:37
-msgid "Image"
-msgstr "Slika"
-
-#: add.php:161
-msgid "Images"
-msgstr "Slike"
-
-#: add.php:196
-msgid ""
-"Images will be added to a gallery linked with this article. You can edit and "
-"manage images in gallery."
-msgstr ""
-"Slike bodo naložene v galerijo, ki bo povezana z člankom. Slike lahko "
-"urajate v galeriji"
-
-#: templates/edit/row.php:9 templates/edit/row.php:10
-msgid "Info"
-msgstr "Info"
-
-#: templates/edit/info.php:88
-msgid "Insert"
-msgstr "Dodana"
-
-#: templates/common-header.inc:27 rss/index.php:44 rss/comments.php:22
-#: lib/Block/last_comments.php:3 lib/Block/last_comments.php:31
-msgid "Last comments"
-msgstr "Zadnji komentarji"
-
-#: lib/Block/my_comments.php:3
-msgid "Last comments on my news"
-msgstr "Zadnji komentarji na moje novice"
-
-#: lib/Block/most_commented.php:3 lib/Block/most_commented.php:17
-msgid "Last most commented news"
-msgstr "Zadnje najbolj komentirane"
-
-#: lib/Block/most_read.php:3 lib/Block/most_read.php:17
-msgid "Last most read news"
-msgstr "Zadnje najbolj brane"
-
-#: templates/common-header.inc:26 rss/index.php:38 rss/news.php:33
-#: lib/Block/last.php:3 lib/Block/last.php:17
-#, php-format
-msgid "Last news"
-msgstr "Zadnje novice"
-
-#: lib/Block/last_blogs.php:17
-msgid "Last news blog"
-msgstr "Zadnje novice z blogi"
-
-#: lib/Block/last_blogs.php:3
-msgid "Last news blogged"
-msgstr "Zadnje novice z blogi"
-
-#: lib/Block/category.php:21 lib/Block/category.php:22
-#, php-format
-msgid "Last news in %s"
-msgstr "Zadnje novice v %s"
-
-#: lib/Block/category.php:3
-msgid "Last news in category"
-msgstr "Zadnje novice v kategoriji"
-
-#: note.php:24 pdf.php:51
-msgid "Link"
-msgstr "Povezava"
-
-#: templates/edit/row.php:30
-msgid "Lock"
-msgstr "Zakleni"
-
-#: templates/edit/row.php:50 lib/Forms/Search.php:30
-msgid "Locked"
-msgstr "Zaklenjena"
-
-#: add.php:82
-#, php-format
-msgid "Maximum file size: %s; with a total of: %s"
-msgstr "Največja velikost datoteke: %s; skupno: %s"
-
-#: templates/categories/index.php:6 templates/sources/index.php:6
-#: admin/categories/edit.php:31 admin/sources/edit.php:32
-msgid "Name"
-msgstr "Ime"
-
-#: templates/reads/header.inc:5
-msgid "News"
-msgstr "Novica"
-
-#: reads.php:28
-#, php-format
-msgid "News %s"
-msgstr "Novica %s"
-
-#: edit.php:44 edit.php:52 edit.php:60 edit.php:68 edit.php:76 edit.php:109
-#: delete.php:73 delete.php:75
-#, php-format
-msgid "News %s: %s"
-msgstr "Novica %s: %s"
-
-#: add.php:530
-msgid ""
-"News added. The editors will check the entry and confirm it if they find it "
-"suitable."
-msgstr ""
-"Novica je bila vpisana. Uredniki bodo pregledali vaš vpis in ga potrdili, če "
-"je le-ta primeren za objavo pri nas."
-
-#: add.php:219
-msgid "News administrator options"
-msgstr "Adminstratorske lastnosti"
-
-#: add.php:125
-msgid "News content"
-msgstr "Vsebina novice"
-
-#: templates/news/info.php:3
-msgid "News data"
-msgstr "O novici"
-
-#: add.php:162
-msgid "News images"
-msgstr "Slike k novici"
-
-#: templates/news/today.php:5
-msgid "News of this day."
-msgstr "Novice tega dne"
-
-#: add.php:532
-msgid "News published."
-msgstr "Novica objavljena."
-
-#: mail.php:57
-#, php-format
-msgid "News succesfully send to %s"
-msgstr "Novice je bila uspešno poslana na %s."
-
-#: note.php:40
-msgid "News sucessfuly added to you notes."
-msgstr "Novica je bila uspešno dodana med vaše zapiske"
-
-#: add.php:534
-msgid "News updated."
-msgstr "Novica osvežena."
-
-#: templates/edit/info.php:21
-msgid "No"
-msgstr "Št."
-
-#: diff.php:55
-msgid "No change."
-msgstr "Ni spremembe."
-
-#: mail.php:36
-msgid "No mail entered."
-msgstr "Pozabili ste vnesti email."
-
-#: lib/Block/my_comments.php:19 lib/Block/last_comments.php:19
-msgid "Number of comments to display"
-msgstr "Število komentarjev"
-
-#: note.php:23 pdf.php:50 templates/news/info.php:5
-msgid "On"
-msgstr "Objavljena"
-
-#: templates/news/today.php:3
-msgid "On this day"
-msgstr "Na današnji dan"
-
-#: delete_file.php:16 delete.php:16
-msgid "Only admin can delete a news."
-msgstr "Samo administratorji lahko brišejo novice."
-
-#: add.php:90
-msgid "Only authenticated users can post news."
-msgstr "Samo ragistrirani uporabniki lahko vpisujejo novice."
-
-#: mail.php:31
-msgid "Only authenticated users can send mails."
-msgstr "Samo ragistrirani uporabniki lahko pošiljajo novice."
-
-#: lib/Forms/Search.php:41
-msgid "Order by"
-msgstr "Razvrsti po"
-
-#: lib/News.php:1119
-msgid "Overview"
-msgstr "Pregled"
-
-#: templates/news/tools.php:9
-msgid "PDF"
-msgstr "PDF"
-
-#: templates/categories/index.php:7 admin/categories/edit.php:35
-msgid "Parent"
-msgstr "Sorodne"
-
-#: add.php:155 templates/news/parents.php:5 templates/edit/info.php:33
-msgid "Parents"
-msgstr "Sorodne novice"
-
-#: add.php:165 add.php:198
-msgid "Picture"
-msgstr "Slika"
-
-#: add.php:169
-msgid "Picture comment"
-msgstr "Komentar k sliki"
-
-#: lib/Block/jonah.php:4 lib/Block/jonah.php:24
-msgid "Press overview"
-msgstr "Pregled tiska"
-
-#: config/prefs.php.dist:9
-msgid "Preview"
-msgstr "Pregled %s"
-
-#: lib/News.php:224
-#, php-format
-msgid "Preview %s"
-msgstr "Pregled %s"
-
-#: add.php:129 templates/edit/info.php:10
-msgid "Primary category"
-msgstr "Primarna kategorija"
-
-#: templates/news/tools.php:6
-msgid "Printer firendly"
-msgstr "Tiskanju prijazen izpis"
-
-#: add.php:127 lib/Forms/Search.php:51
-msgid "Publish"
-msgstr "Objavi ob"
-
-#: templates/edit/header.inc:8
-msgid "Publish at"
-msgstr "Objavi ob"
-
-#: lib/Forms/Search.php:41 config/prefs.php.dist:28
-msgid "Publish date"
-msgstr "Objavi ob"
-
-#: templates/news/parents.php:8 templates/edit/row.php:54
-msgid "Read"
-msgstr "Preberi"
-
-#: templates/edit/header.inc:10 lib/Forms/Search.php:45
-msgid "Reads"
-msgstr "Branj"
-
-#: delete_file.php:23 delete_file.php:41 delete.php:23 delete.php:34
-#: admin/categories/delete.php:18 admin/categories/delete.php:24
-#: admin/sources/delete.php:19 admin/sources/delete.php:25
-msgid "Remove"
-msgstr "Odstrani"
-
-#: templates/edit/info.php:97
-msgid "Renew"
-msgstr "Obnovi"
-
-#: add.php:118 add.php:120 add.php:577
-msgid "Reset"
-msgstr "Povrni"
-
-#: admin/categories/edit.php:36 admin/sources/edit.php:35
-msgid "Resize Image"
-msgstr "Spremeni velikost slike"
-
-#: add.php:120
-msgid "Save"
-msgstr "Shrani"
-
-#: lib/News.php:1122 lib/Forms/Search.php:22 lib/Forms/Search.php:24
-msgid "Search"
-msgstr "Najdi"
-
-#: lib/Forms/Search.php:26
-msgid "Search world"
-msgstr "Iskana beseda"
-
-#: add.php:153 templates/edit/info.php:13
-msgid "Secondary category"
-msgstr "Pomožna kategorija"
-
-#: lib/Categories.php:478
-msgid "Select Category"
-msgstr "Izberite kategorijo"
-
-#: lib/Block/jonah.php:35
-msgid "Select a feed."
-msgstr "Izberite vir."
-
-#: add.php:247 templates/edit/info.php:47
-msgid "Selling item"
-msgstr "Prodajani artikel"
-
-#: templates/news/mail.php:2
-msgid "Send by mail"
-msgstr "Pošlji po emailu"
-
-#: lib/News.php:100
-msgid "Services/Trackback is not installed."
-msgstr "Services/Trackback ni nameščen."
-
-#: config/prefs.php.dist:11
-msgid "Set news previerw paramaters"
-msgstr "Nastavitve prikazovanja novic"
-
-#: lib/Block/last.php:28
-msgid "Skip category"
-msgstr "Preskoči kategorijo"
-
-#: config/prefs.php.dist:31 config/prefs.php.dist:41
-msgid "Sort news by"
-msgstr "Razvrsti novice po"
-
-#: add.php:154 templates/edit/info.php:29 lib/Forms/Search.php:48
-msgid "Sort order"
-msgstr "Vrstni red"
-
-#: add.php:136 templates/edit/info.php:37 lib/Forms/Search.php:38
-msgid "Source"
-msgstr "Vir"
-
-#: admin/sources/delete.php:30
-msgid "Source deleted."
-msgstr "Vir je bil izbrisan."
-
-#: add.php:138 templates/edit/info.php:41
-msgid "Source link"
-msgstr "Izvirna novica"
-
-#: templates/news/info.php:18
-msgid "Source media"
-msgstr "Vir novice"
-
-#: templates/news/info.php:13
-msgid "Source news"
-msgstr "Izvirna novica"
-
-#: admin/sources/edit.php:45
-msgid "Source saved succesfully."
-msgstr "Vir je bil uspešno osvežen."
-
-#: admin/sources/delete.php:28 admin/sources/delete.php:33
-msgid "Source was not deleted."
-msgstr "Vir ni bil izbrisan."
-
-#: admin/tabs.php:24 lib/Block/sources.php:3 lib/Block/sources.php:21
-msgid "Sources"
-msgstr "Viri"
-
-#: admin/sources/index.php:17
-msgid "Sources Administration"
-msgstr "Urejanje virov"
-
-#: add.php:222
-msgid "Sponsored"
-msgstr "Komercialna"
-
-#: templates/edit/header.inc:6 lib/Forms/Search.php:31
-msgid "Status"
-msgstr "Status"
-
-#: lib/News.php:1126
-msgid "Tag cloud"
-msgstr "Tagi novic"
-
-#: add.php:145 lib/Block/tags_cloud.php:3 lib/Block/tags_cloud.php:24
-msgid "Tags"
-msgstr "Tagi"
-
-#: templates/news/blog.php:7
-msgid "Talkbacks to this article:"
-msgstr "Talkback na to novico:"
-
-#: templates/news/ulaform.php:13
-msgid "Thanks"
-msgstr "Hvala"
-
-#: templates/block/news.php:18 templates/block/titles.php:20
-msgid "There are no news to display."
-msgstr "Ni novic za prikaz."
-
-#: lib/News.php:557
-#, php-format
-msgid "There requested news %s don't exist."
-msgstr "Izbrana novica ne %s obstaja."
-
-#: news.php:29
-msgid "There requested version don't exist."
-msgstr "Izbrana verzja ne obstaja."
-
-#: add.php:433
-msgid "There was an error creating gallery: "
-msgstr "Prišlo je do napake pri tvorjenju galerije: "
-
-#: add.php:449
-#, fuzzy
-msgid "There was an error with the uploaded image: "
-msgstr "Pršlo je do napake pri nalaganju slike: "
-
-#: add.php:158 templates/news/threads.php:6
-#, php-format
-msgid "Threads in %s"
-msgstr "Debate v %s"
-
-#: add.php:143 templates/edit/header.inc:7 lib/Forms/Search.php:43
-#: lib/Block/my_comments.php:56 config/prefs.php.dist:30
-msgid "Title"
-msgstr "Naslov"
-
-#: templates/news/tools.php:3
-msgid "Tools"
-msgstr "Orodja"
-
-#: templates/news/blog.php:22
-msgid "Trackback this blog on this site."
-msgstr "Vpišite blog na to novico."
-
-#: lib/News.php:703
-#, php-format
-msgid "URL already trackbacked: %s"
-msgstr "URL je bil že zapisan: %s"
-
-#: templates/edit/row.php:42 lib/Forms/Search.php:28
-msgid "Unconfirmed"
-msgstr "Nepotrjena"
-
-#: templates/edit/row.php:27
-msgid "Unlock"
-msgstr "Odkleni"
-
-#: lib/Forms/Search.php:52
-msgid "Unpublish"
-msgstr "Odstrani ob"
-
-#: templates/edit/info.php:17
-msgid "Unpublish date"
-msgstr "Odstrani dne"
-
-#: add.php:118 add.php:576 templates/edit/info.php:86
-msgid "Update"
-msgstr "Ažuriraj"
-
-#: templates/sources/index.php:7 admin/sources/edit.php:33
-msgid "Url"
-msgstr "Url"
-
-#: templates/news/blog.php:16
-msgid "Use the following link to trackback from your own site: "
-msgstr "Uporabite sledeči naslov za trakback z vaše strani: "
-
-#: templates/reads/header.inc:6 templates/edit/header.inc:9
-#: lib/Forms/Search.php:53 lib/Block/my_comments.php:57
-msgid "User"
-msgstr "Uporabnik"
-
-#: templates/edit/info.php:94
-msgid "View"
-msgstr "Preglej"
-
-#: admin/sources/index.php:32
-msgid "View articles"
-msgstr "Preglej novice"
-
-#: admin/sources/index.php:29
-msgid "View items"
-msgstr "Preglej novice"
-
-#: templates/edit/info.php:21
-msgid "Yes"
-msgstr "Da"
-
-#: admin/tabs.php:15
-msgid "You are not authorised for this action."
-msgstr "Niste avtorizirani za ta ukaz."
-
-#: mail.php:42
-msgid "You have no email set."
-msgstr "Nimate nastavljenega email naslova."
-
-#: edit.php:18
-msgid "You have not editor permission on any category."
-msgstr "Nimate uredniških pravic do nobene kategorije."
-
-#: edit.php:60
-msgid "activated"
-msgstr "aktivirana"
-
-#: edit.php:52
-msgid "deactivated"
-msgstr "deaktivirana"
-
-#: delete.php:73
-msgid "deleted"
-msgstr "izbrisana"
-
-#: edit.php:68
-msgid "locked"
-msgstr "zaklenjena"
-
-#: delete.php:75
-msgid "not deleted"
-msgstr "ni zbrisana"
-
-#: edit.php:109
-msgid "renewed"
-msgstr "povrnjena"
-
-#: edit.php:76
-msgid "unlocked"
-msgstr "odklenjena"
+++ /dev/null
-<?php
-/**
- * News
- *
- * $Id: mail.php 1174 2009-01-19 15:11:03Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-$id = Horde_Util::getFormData('id');
-$row = $news->get($id);
-if ($row instanceof PEAR_Error) {
- $notification->push($row);
- Horde::url('browse.php')->redirect();
-}
-
-/* Error handler */
-function _error($msg)
-{
- $GLOBALS['notification']->push($msg, 'horde.error');
- News::getUrlFor('news', $GLOBALS['id'])->redirect();
-}
-
-if (!$registry->isAuthenticated()) {
- _error(_("Only authenticated users can send mails."));
-}
-
-$to = Horde_Util::getFormData('email');
-if (empty($to)) {
- _error(_("No mail entered."));
- exit;
-}
-
-$from = $prefs->getValue('from_addr');
-if (empty($from)) {
- _error(_("You have no email set."));
- exit;
-}
-
-$body = sprintf(_("%s would you like to invite you to read the news\n Title: %s\n\n Published: %s \nLink: %s"),
- $GLOBALS['registry']->getAuth(),
- $row['title'],
- $row['publish'],
- News::getUrlFor('news', $id, true, -1));
-
-$mail = new Horde_Mime_Mail(array('subject' => $row['title'], 'body' => $body, 'to' => $to, 'from' => $from, 'charset' => $GLOBALS['registry']->getCharset()));
-try {
- $mail->send($injector->getInstance('Horde_Mail'));
- $notification->push(sprintf(_("News succesfully send to %s"), $to), 'horde.success');
-} catch (Horde_Mime_Exception $e) {
- $notification->push($e);
-}
-
-News::getUrlFor('news', $id)->redirect();
+++ /dev/null
-<?php
-/**
- * News
- *
- * $Id: news.php 1190 2009-01-21 16:10:50Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-$id = Horde_Util::getFormData('id');
-$row = $news->get($id);
-
-// check if the news exists
-if ($row instanceof PEAR_Error) {
- $notification->push($row);
- Horde::url('index.php')->redirect();
-}
-
-// check if the news exists
-if (($version = Horde_Util::getFormData('version')) !== null) {
- $sql = 'SELECT created, user_uid, content FROM ' . $news->prefix . '_versions WHERE id = ? AND version = ?';
- $version_data = $news->db->getRow($sql, array($id, $version), DB_FETCHMODE_ASSOC);
- if (empty($version_data)) {
- $notification->push(_("There requested version don't exist."), 'horde.error');
- exit;
- } else {
- $version_data['content'] = unserialize($version_data['content']);
- $row['content'] = $version_data['content'][NLS::select()]['content'];
- $row['title'] = $version_data['content'][NLS::select()]['title'] .
- ' (v.' . $version . _(" by ") . $version_data['user_uid'] .
- ' @ ' . News::dateFormat($version_data['created']) . ')';
- }
-} else {
- $news->logView($id);
-}
-
-$title = $row['title'];
-$template_path = News::getTemplatePath($row['category1'], 'news');
-$browse_url = Horde::url('browse.php');
-
-require_once NEWS_TEMPLATES . '/common-header.inc';
-require_once NEWS_TEMPLATES . '/menu.inc';
-
-require $template_path . 'news.php';
-
-require_once $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * News
- *
- * $Id: note.php 1241 2009-01-29 23:27:58Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-$id = Horde_Util::getFormData('id');
-$row = $news->get($id);
-if ($row instanceof PEAR_Error) {
- $notification->push($row);
- Horde::url('browse.php')->redirect();
-}
-
-$body = $row['title'] . "\n\n"
- . _("On") . ': ' . News::dateFormat($row['publish']) . "\n"
- . _("Link") . ': ' . News::getUrlFor('news', $id) . "\n\n"
- . strip_tags($row['content']);
-
-/* Create a new vNote object using this message's contents. */
-$vCal = new Horde_iCalendar();
-$vNote = &Horde_iCalendar::newComponent('vnote', $vCal);
-$vNote->setAttribute('BODY', $body);
-
-/* Attempt to add the new vNote item to the requested notepad. */
-try {
- $registry->call('notes/import', array($vNote, 'text/x-vnote'));
- $notification->push(_("News sucessfuly added to you notes."), 'horde.success');
- header('Location: ' . $registry->getInitialPage('mnemo'));
-} catch (Horde_Exception $e) {
- $notification->push($e);
- News::getUrlFor('news', $id)->redirect();
-}
+++ /dev/null
-<?php
-/**
- * News
- *
- * $Id: pdf.php 1191 2009-01-21 16:45:21Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-$no_compress = true;
-require_once dirname(__FILE__) . '/lib/base.php';
-
-$id = Horde_Util::getFormData('id');
-$row = $news->get($id);
-
-// Check if the news exists
-if ($row instanceof PEAR_Error) {
- $notification->push($row);
- Horde::url('browse.php')->redirect();
-}
-
-// Set up the PDF object.
-$pdf = new Horde_Pdf_Writer();
-
-$pdf->setInfo('title', $row['title']);
-$pdf->setInfo('author', $row['user']);
-$pdf->setInfo('CreationDate', 'D:' . date('Ymdhis'));
-
-$pdf->open();
-$pdf->addPage();
-$pdf->setAutoPageBreak(true);
-$pdf->setFont('Arial', '', 12);
-
-if ($row['picture']) {
- $file = $conf['vfs']['params']['vfsroot'] . '/'
- . News::VFS_PATH . '/images/news/big/'
- . $id . '.' . $conf['images']['image_type'];
- try {
- $pdf->image($file, 120, 20);
- } catch (Horde_Pdf_Exception $e) {
- Horde::logMessage($e, 'INFO');
- }
-}
-
-$pdf->setFillColor('rgb', 200/255, 220/255, 255/255);
-$pdf->cell(0, 6, $row['title'], 0, 1, 'L', 1);
-$pdf->newLine(4);
-
-$pdf->write(12, _("On") . ': ' . News::dateFormat($row['publish']) . "\n");
-$pdf->write(12, _("Link") . ': ' . News::getUrlFor('news', $id, true) . "\n\n", News::getUrlFor('news', $id, true));
-$pdf->multiCell(0, 12, Horde_String::convertCharset(strip_tags($row['content']), $GLOBALS['registry']->getCharset(), 'UTF-8'));
-
-$browser->downloadHeaders($id . '.pdf', 'application/pdf');
-echo $pdf->getOutput();
+++ /dev/null
-<?php
-/**
- * Print news
- *
- * $Id: print.php 803 2008-08-27 08:29:20Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-$id = Horde_Util::getFormData('id');
-$version = Horde_Util::getFormData('version', false);
-$row = $news->get($id);
-$template_path = News::getTemplatePath($row['category1'], 'news');
-
-require_once NEWS_TEMPLATES . '/print/header.inc';
-require $template_path . 'news.inc';
-require_once NEWS_TEMPLATES . '/print/footer.inc';
+++ /dev/null
-<?php
-/**
- * News reads
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-if (!$registry->isAuthenticated()) {
- $registry->authenticateFailure('news');
-}
-
-$id = Horde_Util::getFormData('id', 0);
-$actionID = Horde_Util::getFormData('actionID', false);
-$url = Horde::url('reads.php');
-
-$sql = 'SELECT id, user, ip, readdate FROM ' . $news->prefix . '_user_reads WHERE ';
-if ($actionID) {
- $title = $actionID;
- $result = $news->db->getAll($sql . 'user = ? ORDER BY readdate DESC', array($actionID), DB_FETCHMODE_ASSOC);
-} else {
- $result = $news->db->getAll($sql . 'id = ? ORDER BY readdate DESC', array($id), DB_FETCHMODE_ASSOC);
- $title = sprintf(_("News %s"), $id);
-}
-
-if ($result instanceof PEAR_Error) {
- var_dump($result);
- exit;
-}
-
-Horde::addScriptFile('tables.js', 'horde');
-Horde::includeScriptFiles();
-Horde_Themes::includeStylesheetFiles();
-
-// require_once NEWS_TEMPLATES . '/common-header.inc';
-require_once NEWS_TEMPLATES . '/reads/header.inc';
-
-foreach ($result as $row) {
- require NEWS_TEMPLATES . '/reads/row.inc';
-}
-
-// require_once $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * $Id: comments.php 1263 2009-02-01 23:25:56Z duck $
- *
- * Copyright 2007 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- */
-
-$news_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-$cache_key = 'news_rss_comments';
-$rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
-if (!$rss) {
- $list = News::getLastComments(50);
- $title = _("Last comments");
-
- $rss = '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '" ?>
-<rss version="2.0">
-<channel>
- <title>' . htmlspecialchars($title) . '</title>
- <language>' . str_replace('_', '-', strtolower($registry->preferredLang())) . '</language>
- <lastBuildDate>' . date('r') . '</lastBuildDate>
- <description>' . htmlspecialchars($title) . '</description>
- <link>' . Horde::url('index.php', true, -1) . '</link>
- <generator>' . htmlspecialchars($registry->get('name')) . '</generator>';
-
- foreach ($list as $comment) {
- $rss .= '
- <item>
- <title>' . htmlspecialchars($comment['message_subject']) . ' </title>
- <link>' . $comment['read_url'] . '</link>
- <guid isPermaLink="true">' . $comment['read_url'] . '</guid>
- <pubDate>' . date('r', strtotime($comment['message_date'])) . '</pubDate>
- <description><![CDATA[' . $comment['message_author'] . ': ' . strip_tags($comment['body']) . ']]></description>
- </item>';
- }
-
- $rss .= '
-</channel>
-</rss>';
-
- $cache->set($cache_key, $rss);
-}
-
-header('Content-type: text/xml; charset=' . $GLOBALS['registry']->getCharset());
-echo $rss;
+++ /dev/null
-<?php
-/**
- * $Id: index.php 183 2008-01-06 17:39:50Z duck $
- *
- * Copyright 2007 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- */
-
-$news_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-// Show a specific user?
-$cache_key = 'news_rss_index';
-
-$rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
-if (!$rss) {
-
- $title = $registry->get('name', 'horde');
-
- $read_url = Horde::url('read.php', true, -1);
- $rss = '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '" ?>
- <rss version="2.0">
- <channel>
- <title>' . htmlspecialchars($title) . '</title>
- <language>' . str_replace('_', '-', strtolower($registry->preferredLang())) . '</language>
- <lastBuildDate>' . date('r') . '</lastBuildDate>
- <description>' . htmlspecialchars($title) . '</description>
- <link>' . Horde::url('index.php', true, -1) . '</link>
- <generator>' . htmlspecialchars($registry->get('name')) . '</generator>';
-
- $rss .= '
- <item>
- <title>' . _("Last news") . ' </title>
- <link>' . Horde::url('rss/news.php', true, -1) . '</link>
- </item>';
-
- $rss .= '
- <item>
- <title>' . _("Last comments") . ' </title>
- <link>' . Horde::url('rss/comments.php', true, -1) . '</link>
- </item>';
-
- $rss .= '
- </channel>
- </rss>';
-
- $cache->set($cache_key, $rss);
-}
-
-header('Content-type: text/xml');
-echo $rss;
+++ /dev/null
-<?php
-/**
- * $Id: news.php 1263 2009-02-01 23:25:56Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @author McLion <mclion@obala.net>
- */
-
-$news_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-$cache_key = 'news_rss_news';
-$rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
-if (empty($rss)) {
-
- /* query preparation */
- $query = 'SELECT n.id, publish, n.user, n.source, n.sourcelink, ' .
- 'n.category1, n.category2, n.comments, n.picture, n.chars, nl.content, ' .
- 'nl.title, nl.abbreviation ' .
- 'FROM ' . $news->prefix . ' AS n, ' . $news->prefix . '_body AS nl ' .
- 'WHERE n.status="' . News::CONFIRMED . '" AND n.publish<=NOW() ' .
- 'AND nl.lang="' . $registry->preferredLang() . '" AND n.id=nl.id ORDER BY publish DESC';
- $rssbody = '';
- $query = $news->db->modifyLimitQuery($query, 0, 10);
- $list = $news->db->getAssoc($query, true, array(), DB_FETCHMODE_ASSOC);
- $categories = $news_cat->getCategories(false);
- $title = sprintf(_("Last news"), $registry->get('name', 'horde'));
-
- $lastnewstime = 0;
- foreach ($list as $news_id => $news) {
- $news_link = News::getUrlFor('news', $news_id, true);
- $rssbody .= '
- <item>
- <enclosure url="http://' . $_SERVER['SERVER_NAME'] . News::getImageUrl($news_id) . '" type="image/jpg" />
- <title>' . htmlspecialchars($news['title']) . ' </title>
- <dc:creator>' . htmlspecialchars($news['user']). '</dc:creator>
- <link>' . $news_link . '</link>
- <guid isPermaLink="true">' . $news_link . '</guid>
- <comments>' . $news_link . '#comments</comments>
- <description><![CDATA[' . trim(substr(htmlspecialchars(strip_tags($news['content'])), 0, 512)) . ']]></description>
- <pubDate>' . date('r', strtotime($news['publish'])) . '</pubDate>
- <category><![CDATA[' . $categories[$news['category1']]['category_name'] . ']]></category>
- </item>';
-
- if (strtotime($news['publish']) > $lastnewstime) {
- $lastnewstime = strtotime($news['publish']);
- }
- }
-
- // Wee need the last published news time
- $rssheader = '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '" ?>
-<rss version="2.0"
- xmlns:content="http://purl.org/rss/1.0/modules/content/"
- xmlns:wfw="http://wellformedweb.org/CommentAPI/"
- xmlns:dc="http://purl.org/dc/elements/1.1/" >
-<channel>
- <title>' . htmlspecialchars($title) . '</title>
- <language>' . str_replace('_', '-', strtolower($registry->preferredLang())) . '</language>
- <lastBuildDate>' . date('r', $lastnewstime) . '</lastBuildDate>
- <description>' . htmlspecialchars($title) . '</description>
- <link>' . Horde::url('index.php', true, -1) . '</link>
- <generator>' . htmlspecialchars($registry->get('name')) . '</generator>';
-
- $rssfooter = '
-</channel>
-</rss>';
-
- // build rss
- $rss = $rssheader . $rssbody . $rssfooter;
-
- $cache->set($cache_key, $rss);
-}
-
-header('Content-type: text/xml; charset=utf-8');
-echo $rss;
+++ /dev/null
-CREATE TABLE news (
- id smallint(5) UNSIGNED NOT NULL auto_increment,
- sortorder tinyint(2) NOT NULL DEFAULT '0',
- status tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
- view_count smallint(5) UNSIGNED NOT NULL DEFAULT '0',
- publish datetime DEFAULT NULL,
- unpublish datetime DEFAULT NULL,
- submitted datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
- user varchar(11) NOT NULL DEFAULT '',
- editor varchar(11) NOT NULL DEFAULT '',
- sourcelink varchar(34) NOT NULL DEFAULT '',
- source varchar(11) DEFAULT NULL,
- category1 smallint(5) UNSIGNED NOT NULL DEFAULT '0',
- category2 smallint(5) UNSIGNED NOT NULL DEFAULT '0',
- comments smallint(5) NOT NULL DEFAULT '0',
- chars smallint(5) UNSIGNED NOT NULL DEFAULT '0',
- attachments tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
- picture int(4) NOT NULL DEFAULT '0',
- gallery int(10) UNSIGNED NOT NULL DEFAULT '0',
- selling varchar(50) DEFAULT NULL,
- trackbacks int(10) UNSIGNED NOT NULL DEFAULT '0',
- form_id smallint(5) UNSIGNED NOT NULL DEFAULT '0',
- form_ttl int(10) UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (id),
- KEY datum (publish),
- KEY sortorder (sortorder),
- KEY status (status),
- KEY user (user),
- KEY cat (category1)
-);
-
-CREATE TABLE news_files (
- file_id int(10) UNSIGNED NOT NULL DEFAULT '0',
- news_id int(10) UNSIGNED NOT NULL DEFAULT '0',
- news_lang varchar(5) NOT NULL,
- file_name varchar(85) NOT NULL DEFAULT '',
- file_size int(10) UNSIGNED NOT NULL DEFAULT '0',
- file_type varchar(85) NOT NULL DEFAULT '',
- PRIMARY KEY (file_id),
- KEY news (news_id, news_lang)
-);
-
-CREATE TABLE news_body (
- id smallint(5) UNSIGNED NOT NULL DEFAULT '0',
- lang varchar(5) NOT NULL DEFAULT '0',
- title varchar(67) NOT NULL DEFAULT '',
- abbreviation text NOT NULL,
- content text NOT NULL,
- picture_comment varchar(255);
- tags varchar(255);
- PRIMARY KEY (id,lang)
-);
-
-CREATE TABLE news_categories (
- category_id int(10) UNSIGNED NOT NULL auto_increment,
- category_name varchar(50) NOT NULL,
- category_description varchar(255) DEFAULT NULL,
- category_parentid int(10) UNSIGNED NOT NULL,
- category_form varchar(50) NOT NULL,
- category_image int(1) UNSIGNED NOT NULL,
- PRIMARY KEY (category_id)
-);
-
-CREATE TABLE news_categories_nls (
- category_id int(10) UNSIGNED NOT NULL,
- category_nls char(5) NOT NULL,
- category_name varchar(50) NOT NULL,
- category_description varchar(255) NOT NULL,
- PRIMARY KEY (category_id, category_nls),
- KEY category_nls (category_nls)
-);
-
-CREATE TABLE news_sources (
- source_id int(10) UNSIGNED NOT NULL,
- source_name varchar(255) NOT NULL,
- source_url varchar(255) NOT NULL,
- PRIMARY KEY (source_id)
-);
-
-CREATE TABLE news_trackback (
- id int(11) NOT NULL,
- excerpt text,
- created datetime NOT NULL,
- title varchar(255) NOT NULL,
- url varchar(255) NOT NULL,
- blog_name varchar(255) NOT NULL,
- KEY created (created),
- KEY id (id)
-);
-
-CREATE TABLE news_user_reads (
- id int(10) UNSIGNED NOT NULL DEFAULT '0',
- user varchar(85) NOT NULL DEFAULT '',
- ip varchar(9) NOT NULL DEFAULT '',
- readdate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- KEY id (id)
-);
-
-CREATE TABLE news_versions (
- id int(10) UNSIGNED NOT NULL DEFAULT '0',
- version float UNSIGNED NOT NULL DEFAULT '0',
- created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- user_uid varchar(85) NOT NULL DEFAULT '',
- content text NOT NULL,
- PRIMARY KEY (id,version)
-);
+++ /dev/null
-ALTER TABLE `news` CHANGE `reads` `view_count` SMALLINT( 5 ) UNSIGNED NOT NULL DEFAULT '0';
-ALTER TABLE `news` ADD `trackbacks` SMALLINT NOT NULL DEFAULT '0';
-
-CREATE TABLE `news_trackback` (
- `id` int(11) NOT NULL,
- `excerpt` text,
- `created` datetime NOT NULL,
- `title` varchar(255) NOT NULL,
- `url` varchar(255) NOT NULL,
- `blog_name` varchar(255) NOT NULL,
- KEY `created` (`created`),
- KEY `id` (`id`)
-);
+++ /dev/null
-ALTER TABLE `news2` ADD `sponsored` TINYINT( 1 ) UNSIGNED NOT NULL AFTER `sourcelink` ;
-ALTER TABLE `news2` ADD `parents` VARCHAR( 255 ) NOT NULL AFTER `sponsored` ;
\ No newline at end of file
+++ /dev/null
-ALTER TABLE `news_body` ADD `tags` VARCHAR( 255 ) AFTER `picture_comment` ;
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * Search
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-// Default vars
-$title = _("Browse");
-$page = Horde_Util::getGet('news_page', 0);
-$per_page = $prefs->getValue('per_page');
-$browse_url = Horde::url('browse.php');
-$cid = Horde_Util::getGet('cid');
-
-$vars = Horde_Variables::getDefaultVariables();
-$form = new News_Search($vars);
-$form->getInfo(null, $criteria);
-
-// Count rows
-$count = $news->countNews($criteria);
-if ($count instanceof PEAR_Error) {
- echo $count->getMessage() . ': ' . $count->getDebugInfo();
- exit;
-}
-
-// Select rows
-$rows = $news->listNews($criteria, $page*$per_page, $per_page, null);
-if ($rows instanceof PEAR_Error) {
- echo $rows->getMessage() . ': ' . $rows->getDebugInfo();
- exit;
-}
-
-$pager = News_Search::getPager($criteria, $count, 'search.php');
-
-$pager->preserve($criteria);
-
-// If we have only one row redirect ot it
-if ($count == 1 && sizeof($cats) < 2 && $page < 1) {
- News::getUrlFor('news', $rows[0]['id'])->redirect();
-}
-
-
-require_once NEWS_TEMPLATES . '/common-header.inc';
-require_once NEWS_TEMPLATES . '/menu.inc';
-
-$form->renderActive(null, null, null, 'post');
-
-$browse_template_path = News::getTemplatePath($cid, 'browse');
-require_once $browse_template_path . 'header.inc';
-foreach ($rows as $row) {
- require $browse_template_path . 'row.inc';
-}
-require_once $browse_template_path . '/footer.inc';
-
-require_once $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Browse
- *
- * Copyright 2007 Duck <duck@obala.net>
- *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE.
- *
- * $Id: browse.php 76 2007-12-19 13:57:35Z duck $
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
-
-$remove = array("!", "'", '"', "?", ".", ",", ";", ":", ')', '(', 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, '«', '»', '&', '+', '-', '*');
-
-$result = $news->db->query('UPDATE news_body SET tags = ""');
-$result = $news->db->query('SELECT id, title FROM news_body WHERE tags = "" ORDER BY id ASC');
-while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
- $row['title'] = Horde_String::lower($row['title'], true);
- $row['title'] = str_replace($remove, '', $row['title']);
- $tags = explode(' ', $row['title']);
- foreach ($tags as $i => $tag) {
- if (strlen($tag) < 4) {
- unset($tags[$i]);
- }
- }
- if (empty($tags)) {
- continue;
- }
- $tags = implode(' ', $tags);
- echo $tags . '<br />';
- $params = array($tags, $row['id']);
- $news->db->query('UPDATE news_body SET tags = ? WHERE id = ?', $params);
-}
-
-echo 'done';
+++ /dev/null
-<?php if (!empty($this->news)): ?>
-
-<?php foreach ($this->news as $news_id => $news) { ?>
-<p>
-<?php
-echo Horde::link(News::getUrlFor('news', $news['id']), $news['title']);
-if ($news['picture']) {
- echo Horde::img(News::getImageUrl($news['id']), $news['title'], 'style="float: left; padding-right: 3px;"','');
-}
-echo '<strong>' . $news['title'] . '</a></strong> - ' . $news['abbreviation'] . '... (' . $news['comments'] . ')<br /> ';
-?>
-</p>
-
-<?php } ?>
-
-
-<?php else: ?>
- <p><?php echo _("There are no news to display.") ?></p>
-<?php endif; ?>
\ No newline at end of file
+++ /dev/null
-<?php if (!empty($this->news)): ?>
-
-<table>
-
-<?php foreach ($this->news as $news_id => $news) { ?>
-<tr>
-<td>
-<?php
-echo strftime($GLOBALS['prefs']->getValue('date_format'), strtotime($news['publish'])) . ' - ';
-echo Horde::link(News::getUrlFor('news', $news['id']), $news['abbreviation']);
-echo $news['title'] . '</a>';
-?>
-</td>
-</tr>
-
-<?php } ?>
-</table>
-
-<?php else: ?>
- <p><?php echo _("There are no news to display.") ?></p>
-<?php endif; ?>
+++ /dev/null
-<?php echo $pager->render(); ?>
+++ /dev/null
-<div class="header"><?php echo $title ?> (<?php echo number_format($count) ?>)</div>
-<?php echo $pager->render(); ?>
-
+++ /dev/null
-<p style="clear: both;">
-<img src="<?php echo News::getImageUrl($row['id'], 'small'); ?>" style="float: left; margin: 5px;" />
-<strong>
-<?php echo Horde::link(News::getUrlFor('news', $row['id']), $row['title']) . $row['title'] . '</a>'; ?>
-</strong> - <?php echo News::dateFormat($row['publish'], false) ?>
- <br />
-<?php echo $row['abbreviation'] ?> ...<br />
-<span class="small">
-<?php echo _("Chars") . ': ' . number_format($row['chars']) . ' | '; ?>
-<?php echo _("Comments") . ': ' . $row['comments']; ?>
-</span>
-</p>
\ No newline at end of file
+++ /dev/null
-<div id="menu"><tag:menu /></div>
-<tag:notify />
-
-<div style="float: left;">
-<div class="header"><gettext>Categories</gettext></div>
-<tag:tree />
-</div>
-
-<tag:form />
\ No newline at end of file
+++ /dev/null
-<div id="menu"><tag:menu /></div>
-<tag:notify />
-
-<div style="float: left;">
-<div class="header"><gettext>Categories</gettext></div>
-<tag:tree />
-</div>
-
-<tag:form />
\ No newline at end of file
+++ /dev/null
-<div id="menu"><tag:menu /></div>
-<tag:notify />
-
-<div class="header"><gettext>Categories</gettext></div>
-<tag:tree />
+++ /dev/null
-<table style="width: 100%;" id="categories_list" class="sortable striped">
-<thead>
-<tr>
-<th><?php echo $this->add_url ?></th>
-<th><?php echo _("Id") ?></th>
-<th><?php echo _("Name") ?></th>
-<th><?php echo _("Parent") ?></th>
-<th><?php echo _("Description") ?></th>
-</tr>
-</thead>
-<?php foreach ($this->categories as $category_id => $category) { ?>
-<tr>
-<td><?php foreach ($category['actions'] as $action ) { echo $action . ' '; } ?></td>
-<td><?php echo $category_id ?></td>
-<td><a href="<?php echo News::getUrlFor('category', $category_id) ?>" target="_blank"><?php echo $category['category_name'] ?></a></td>
-<td>
-<?php
-if ($category['category_parentid']) {
- echo $this->categories[$category['category_parentid']]['category_name'] .
- ' - ' . $category['category_parentid'];
-}
-?></td>
-<td><?php echo $category['category_description'] ?></td>
-</tr>
-<?php } ?>
-
-</table>
\ No newline at end of file
+++ /dev/null
-<?php
-if (isset($language)) {
- header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
- header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- news: Copyright 2004-2010 The Horde Project. news is under a Horde license. -->
-<!-- Horde Project: http://www.horde.org/ | news: http://www.horde.org/horde/ -->
-<!-- Horde Licenses: http://www.horde.org/licenses/ -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
- $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-<link href="<?php echo Horde_Themes::img('favicon.ico', array('nohorde' => true)) ?>" rel="SHORTCUT ICON" />
-<link rel="alternate" title="<?php echo _("Last news") ?>" href="<?php echo Horde::url('rss/news.php', true, -1) ?>" type="application/rss+xml" />
-<link rel="alternate" title="<?php echo _("Last comments") ?>" href="<?php echo Horde::url('rss/comments.php', true, -1) ?>" type="application/rss+xml" />
-<?php Horde_Themes::includeStylesheetFiles() ?>
-</head>
-
-<body>
+++ /dev/null
-</table>
-<?php echo $pager->render(); ?>
-
-<br />
+++ /dev/null
-<div class="header"><?php echo $title ?></div>
-<table class="striped sortable" id="news_list" style="width: 100%">
-<thead>
-<tr>
-<th><?php echo _("Action") ?></th>
-<th><?php echo _("Status") ?></th>
-<th><?php echo _("Title") ?></th>
-<th><?php echo _("Publish at") ?></th>
-<th><?php echo _("User") ?></th>
-<th><?php echo _("Reads") ?></th>
-<?php
-if ($has_comments) {
- echo '<th>' . _("Comments") . '</th>';
-}
-?>
-</tr>
-</thead>
\ No newline at end of file
+++ /dev/null
-<tr valign="top">
-<td colspan="7">
-
-<table style="width: 100%;">
-<tr valign="top">
-<td style="text-align: center">
-<?php if ($row['picture']): ?>
-<a href="<?php echo News::getImageUrl($id, 'big'); ?>" target="_blank" title="<?php echo _("Click for full picture") ?>">
- <img src="<?php echo News::getImageUrl($id, 'small'); ?>" style="height: 50px; width: 50px;" />
-</a><br />
-<a href="<?php echo Horde_Util::addParameter($browse_url, array('id' => $id, 'actionID' => 'deletepicture')) ?>" onclick="confirm('<?php echo _("Do you really want to delete this picture?") ?>');"><?php echo _("Delete picture") ?></a>
-<?php endif; ?>
-</td>
-<td>
-<?php
-
-if (isset($allowed_cats[$row['category1']])) {
- echo _("Primary category") . ': ' . $allowed_cats[$row['category1']] . "<br />\n";
-} else {
- echo _("Primary category") . ': ' . $row['category1'] . '!!!<br />' . "\n";
-}
-
-if ($row['category2']>0) {
- echo _("Secondary category") . ': ' . $allowed_cats[$row['category2']] . "<br />\n";
-}
-
-if (substr($row['unpublish'], 0, 1) != 0) {
- echo _("Unpublish date") . ': ' . $row['unpublish'] . "<br />\n";
-}
-
-if ($conf['comments']['allow']) {
- echo _("Allow comments") . ': ' . ($row['comments']>-1 ? _("Yes") : _("No")) . "<br />\n";
-}
-
-if ($row['editor']) {
- echo _("Editor") . ': ' . $row['editor'] . "<br />\n";
-}
-
-if ($row['sortorder']) {
- echo _("Sort order") . ': ' . $row['sortorder'] . "<br />\n";
-}
-
-if (isset($row['parents'])) {
- echo _("Parents") . ': ' . sizeof($row['parents']) . "<br />\n";
-}
-
-if (!empty($row['source']) && isset($GLOBALS['cfgSources'][$row['source']])) {
- echo _("Source") . ': ' . $GLOBALS['cfgSources'][$row['source']]['title'] . '<br />';
-}
-
-if (isset($row['sourcelink'])) {
- echo _("Source link") . ': <a href="' . $row['sourcelink'] . '" target="_blank">' . $row['sourcelink'] . '</a><br />';
-}
-
-// schedul
-if (!empty($row['selling'])) {
- $item = explode('|', $row['selling']);
- echo _("Selling item") . ': ' . $registry->get('name', $registry->hasInterface($item[0]));
- $articles = $registry->call($item[0] . '/listCostObjects');
- foreach ($articles[0]['objects'] as $item_data) {
- if ($item_data['id'] == $item[1]) {
- echo ' - ' . $item_data['name'];
- break;
- }
- }
-}
-
-// Form
-if (!empty($row['form'])) {
- //
-}
-
-if ($row['attachments']) {
- echo News::format_attached($id);
-}
-
-?>
-</td>
-<td>
-<?php
-
-$versions = $news->getVerisons($id);
-if ($versions instanceof PEAR_Error) {
- echo $versions->getMessage();
- echo $versions->getDebugInfo();
-}
-
-unset($versions[0]); // current version
-
-if (sizeof($versions)>0) {
- echo _("Edit history: ") . '<br />';
-
- foreach ($versions as $version) {
-
- switch ($version['action']) {
- case 'update':
- echo _("Update");
- break;
- default:
- echo _("Insert");
- break;
- }
- echo _(" by ") . $version['user_uid'] . _(" at ") . $version['created'] . "\n(";
-
- $url = Horde_Util::addParameter(Horde::url('news.php'), array('id' => $id, 'version' => $version['version']));
- echo Horde::link($url, _("View"), '', '_blank', '', _("View")) . _("View") . '</a> | ';
-
- $url = Horde_Util::addParameter(Horde::url('edit.php'), array('id' => $id, 'actionID' => 'renew'));
- echo Horde::link(Horde_Util::addParameter($url,'version', $version['version']),_("Renew")) . _("Renew") . '</a> | ';
-
- $url = Horde_Util::addParameter(Horde::url('diff.php'), array('id' => $id, 'version' => $version['version']));
- echo Horde::link('#', _("Diff"), '', '', Horde::popupJs($url, array('urlencode' => true)) . 'return false;') . _("Diff") . '</a> ';
-
- echo ')<br />' . "\n";
- }
-}
-
-?>
-</td>
-</tr>
-</table>
-
-</td>
-
+++ /dev/null
-<tr valign="top">
-<td nowrap="nowrap">
-<?php
-
-$url = Horde_Util::addParameter($edit_url, array('page' => $page, 'id' => $row['id']));
-echo Horde::link($url,_("Edit")) .
- Horde::img('edit.png', _("Edit"), '', $img_dir) . '</a> ';
-
-echo Horde::link(Horde_Util::addParameter($browse_url, 'id', $row['id']), _("Info")) .
- Horde::img('devel.png', _("Info"), '', $img_dir). '</a> ';
-
-/* admins options */
-if ($registry->isAdmin() || isset($allowed_cats[$row['category1']]) || isset($allowed_cats[$row['category2']])) {
-
- if ($row['status'] == News::CONFIRMED) {
- $url = Horde_Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'deactivate', 'id' => $row['id']));
- echo Horde::link($url,_("Deactivate")) . Horde::img('cross.png', _("Deactivate"), '', $img_dir) . '</a> ';
- } else {
- $url = Horde_Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'activate', 'id' => $row['id']));
- echo Horde::link($url,_("Activate")) . Horde::img('tick.png', _("Activate"), '', $img_dir) . '</a> ';
-
- $url = Horde_Util::addParameter(Horde::url('delete.php'), 'id', $row['id']);
- echo Horde::link($url,_("Delete"), '', '', '', _("Delete")) . Horde::img('delete.png', _("Delete"), '', $img_dir) . '</a> ';
-
- if ($row['status'] == News::LOCKED) {
- $url = Horde_Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'unlock', 'id' => $row['id']));
- echo Horde::link($url,_("Unlock")) . Horde::img('map.png', '', '', $img_dir) . '</a> ';
- } else {
- $url = Horde_Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'lock', 'id' => $row['id']));
- echo Horde::link($url,_("Lock")) . Horde::img('locked.png', '', '', $img_dir) . '</a> ';
- }
- }
-}
-
-?>
-</td>
-<td>
-<?php
-
-switch ($row['status']) {
-case News::UNCONFIRMED:
- echo _("Unconfirmed");
- break;
-
-case News::CONFIRMED:
- echo _("Confirmed");
- break;
-
-case News::LOCKED:
- echo _("Locked");
- break;
-}
-?></td>
-<td><?php echo Horde::link(News::getUrlFor('news', $row['id']), _("Read"), '', '_blank') . $row['title']; ?></a></td>
-<td><?php echo News::dateFormat($row['publish']) ?></td>
-<td><?php echo $row['user'] ?></td>
-<td>
-<?php
-$url = Horde_Util::addParameter($read_url, 'id', $row['id']);
-echo Horde::link('#', $row['view_count'], '', '', Horde::popupJs($url, array('urlencode' => true)) . 'return false', $row['view_count']) . number_format($row['view_count']) . '</a>';
-?>
-</td>
-<?php
-if ($has_comments) {
- echo '<td>' . $row['comments'] . '</td>';
-}
-?>
-</tr>
+++ /dev/null
-<div id="menu">
-<div style="float: right;">
-<form action="<?php echo Horde::url('browse.php') ?>" method="get" id="menu_category" name="menu_category">
-<?php echo _("Category") ?>:
-<select id="category" name="category" onchange="document.menu_category.submit()">
-<option>- - - - - - - </option>
-<?php echo $news_cat->getSelect(); ?>
-</select>
-</form>
-</div>
-<?php echo News::getMenu()->render() ?>
-</div>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
-<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
+++ /dev/null
-<?php
-
-if ($row['attachments']) {
- echo '<br /> <br />' . News::format_attached($id);
-}
+++ /dev/null
-<br />
-<?php
-echo '<div class="header">' . _("Blogs") . '</div>';
-
-// Blogs
-if (!empty($row['trackback'])) {
- echo _("Talkbacks to this article:") . '<ul>';
- foreach ($row['trackback'] as $trackback) {
- echo '<li>' . Horde::link($trackback['url'], $trackback['excerpt']) . $trackback['title'] . '</a> '
- . _("From: ") . $trackback['blog_name'] . ' @ ' . News::dateFormat($trackback['created']) . '</li>';
- }
- echo '</ul><br />';
-}
-
-$trackback_url = Horde_Util::addParameter(Horde::url('trackback.php', true), 'id', $id);
-echo _("Use the following link to trackback from your own site: ") .
- '<br> <input value="' . $trackback_url . '" /><br />';
-
-if ($registry->hasMethod('blogs/createUrl')) {
- $intro = substr($plain_text, 0, 255) . '...';
- $blog_url = $registry->callByPackage('thomas', 'createUrl', array($trackback_url, $row['title'], $intro));
- echo Horde::link($blog_url) . '<strong>' . _("Trackback this blog on this site.") . '</strong></a><br/>';
-}
-
-$read_url = News::getUrlFor('news', $id);
-?>
-
-<!--
-Auto-Discovery of TrackBack Ping URLs
-<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
- <rdf:Description
- rdf:about="<?php echo $read_url; ?>"
- dc:identifier="<?php echo $read_url; ?>"
- dc:title="<?php echo $row['title'] ?>"
- trackback:ping="<?php echo $trackback_url; ?>" />
-</rdf:RDF>
--->
+++ /dev/null
-<br />
-<?php
-// show comments only of allowd for api, for current news and if agora exists
-if ($conf['comments']['allow'] != 'never' &&
- $row['comments']>-1 &&
- $registry->hasMethod('forums/doComments')) {
-
- $params = array('news', $id, 'commentCallback', true, null, null,
- array('message_subject' => $row['title']), $conf['comments']['comment_template']);
-
- $comments = $registry->call('forums/doComments', $params);
-
- if (!empty($comments['threads'])) {
- echo $comments['threads'];
- }
-
- if (!empty($comments['comments'])) {
- echo $comments['comments'];
- }
-}
-
+++ /dev/null
-<?php
-// output the gallery
-if (empty($row['gallery'])
- || !is_array($images = News::getGalleyImages($row['gallery']))) {
- return;
-}
-
-$path = $GLOBALS['registry']->get('webroot', 'horde') . '/vfs/.horde/ansel/';
-
-echo '<br /><div style="text-lign: center;">';
-foreach ($images as $image_id => $image) {
- $img_url = substr($image_id, -2) . '/%s/' . $image_id . '.jpg';
- echo "\n" . '<div class="imggallery">' .
- Horde::link('#', $image['name'], '', '', Horde::popupJs($path . sprintf($img_url, 'screen'), array('width' => $conf['images']['image_width'], 'height' => $conf['images']['image_height'], 'urlencode' => true)). 'return false') . "\n" .
- '<img src="' . $path . sprintf($img_url, 'thumb') . '" />' .
- $image['caption']. '</a></div>';
-}
-echo '</div>';
-
+++ /dev/null
-<?php
-
-echo '<div class="header">' . _("News data") . '</div>';
-echo _("By") . ': ' . Horde::link(Horde_Util::addParameter($browse_url, 'user', $row['user'])) . $row['user'] . '</a><br />';
-echo _("On") . ': ' . Horde::link(Horde_Util::addParameter($browse_url, 'publish', $row['publish'])) . News::dateFormat($row['publish']) . '</a><br />';
-echo _("Category") . ': ' . Horde::link(Horde_Util::addParameter($browse_url, 'cid', $row['category1'])) . $GLOBALS['news_cat']->getName($row['category1']) . '</a><br />';
-
-$plain = preg_replace('/\s\s+/', ' ', trim(strip_tags($row['content'])));
-echo _("Chars") . ': ' . number_format(strlen($plain)) . '<br />';
-echo _("Besed") . ': ' . number_format(substr_count($plain, ' ')) . '<br />';
-
-if ($row['sourcelink']) {
- echo _("Source news") . ': ' . Horde::externalUrl($row['sourcelink'], true) . _("Source news") . '</a><br />';
-}
-
-if ($row['source']) {
- $sources = $news->getSources(true);
- echo _("Source media") . ': ' . Horde::externalUrl($sources[$row['source']]['source_url'], true) .
- $sources[$row['source']]['source_name'] . '</a><br />';
-}
+++ /dev/null
-<br />
-<div class="header"><?php echo _("Send by mail") ?></div>
-<form id="mail_send" name="mail_send" method="post" action="<?php echo Horde::url('mail.php') ?>">
-<input type="text" name="email" id="email" size="15" />
-<input type="hidden" name="id" id="id" value="<?php echo $id ?>" />
-<input type="image" src="<?php echo Horde_Themes::img('mail.png') ?>"></a>
-</form>
+++ /dev/null
-<br />
-<h1 class="header"><?php echo $row['title'] ?></h1>
-<table style="width: 100%">
-<tr valign="top">
-<td>
-<?php
-
-if ($row['picture']) {
- echo '<div id="news_picture">'
- . '<a href="' . News::getImageUrl($id, 'full') . '" title="' . _("Click for full picture") . '" target="_blank">'
- . '<img src="' . News::getImageUrl($id, 'big') . '" /></a><br />'
- . $row['picture_comment']
- . '</div>';
-}
-
-$plain_text = trim(strip_tags($row['content']));
-echo '<div id="capital">' . substr($plain_text, 0, 1) . '</div>';
-echo $row['content'];
-
-if ($row['sponsored']) {
- echo '<span class="sposored">' . _("* Sponsored news") . '</span>';
-}
-
-require NEWS_TEMPLATES . '/news/parents.php';
-require NEWS_TEMPLATES . '/news/attachments.php';
-require NEWS_TEMPLATES . '/news/ulaform.php';
-require NEWS_TEMPLATES . '/news/selling.php';
-require NEWS_TEMPLATES . '/news/gallery.php';
-require NEWS_TEMPLATES . '/news/threads.php';
-require NEWS_TEMPLATES . '/news/comments.php';
-
-?>
-</td>
-<td style="border-left: 1px solid #cccccc; padding-left: 5px; width: 150px;">
-<?php
-
-require NEWS_TEMPLATES . '/news/info.php';
-require NEWS_TEMPLATES . '/news/today.php';
-require NEWS_TEMPLATES . '/news/blog.php';
-require NEWS_TEMPLATES . '/news/tools.php';
-require NEWS_TEMPLATES . '/news/mail.php';
-
-?>
-</td>
-</tr>
-</table>
\ No newline at end of file
+++ /dev/null
-<br />
-<?php
-// output the gallery
-if ($row['parents']) {
- echo _("Parents") . ':<ul>';
- foreach ($row['parents'] as $parent_id => $data) {
- echo '<li>' . News::dateFormat($data['publish']) . ' '
- . Horde::link(News::getUrlFor('news', $parent_id), _("Read"))
- . $data['title'] . '</a> (' . ($data['comments']> -1 ? $data['comments'] : 0) . ')';
- }
- echo '</ul>';
-}
+++ /dev/null
-<br />
-<br />
-<?php
-// schedul
-if ($row['selling']) {
- $item = explode('|', $row['selling']);
- try {
- echo $registry->call($item[0] . '/getSellingForm', $item[1]);
- } catch (Horde_Exception $e) {
- echo $e->getMessage();
- }
-}
-
+++ /dev/null
-<br />
-<?php
-// show threads
-if ($row['threads']) {
-
- echo '<strong>' . sprintf(_("Threads in %s"), $registry->get('name', 'agora')) . ':</strong>';
- $agore_link = $registry->get('webroot', 'agora');
- echo '<ul>';
- foreach ($row['threads'] as $thread_id => $thread) {
- echo '<li>- <a href="' . $agore_link . '/messages/index.php?scope=agora&agora=' . $thread['forum_id'] . '.' . $thread_id . '">'
- . $thread['message_subject'] . '</a> (' . $thread['message_seq'] . ')' . '</li>';
- }
- echo '</ul>';
-}
+++ /dev/null
-<?php
-
-echo '<br /><div class="header">' . _("On this day") . '</div>';
-$img = Horde::img('news.png');
-echo $img . ' ' . Horde::link(Horde_Util::addParameter($browse_url, 'date', $row['publish'])) . _("News of this day.") . '</a><br />';
-
-if ($registry->hasInterface('schedul')) {
- $img = Horde::img('schedul.png');
- $url = $registry->get('webroot', 'schedul') . '/browse.php';
- $url = Horde_Util::addParameter($url, array('actionID' => 'date', 'date' => $row['publish']));
- echo $img . ' ' . Horde::link($url) . _("Events on this day.") . '</a><br />';
-}
-
+++ /dev/null
-<?php
-
-echo '<br /><div class="header">' . _("Tools") . '</div>';
-
-$img = Horde::img('print.png');
-echo $img . ' ' . Horde::link('javascript:window.print()') . _("Printer firendly") . '</a><br />';
-
-$img = Horde::img('mime/pdf.png');
-echo $img . ' ' . Horde::link(Horde_Util::addParameter(Horde::url('pdf.php'), 'id', $id)) . _("PDF") . '</a><br />';
-
-/* Bookmark link */
-if ($registry->hasMethod('bookmarks/getAddUrl')) {
- $api_params = array(
- 'url' => News::getUrlFor('news', $id, true),
- 'title' => $row['title']);
- $url = $registry->call('bookmarks/getAddUrl', array($api_params));
- $img = Horde::img(Horde_Themes::img('trean.png', 'trean'));
- echo $img . ' ' . Horde::link($url) . _("Add to bookmarks.") . '</a><br />';
-}
-
-if ($registry->hasInterface('notes')) {
- $img = Horde::img(Horde_Themes::img('mnemo.png', 'mnemo'));
- $url = Horde_Util::addParameter(Horde::url('note.php', true), 'id', $id);
- echo $img . ' ' . Horde::link($url) . _("Add to notes.") . '</a><br />';
-}
+++ /dev/null
-<?php
-
-$row['forum_id'] = 9;
-
-if (empty($row['form_id']) || ($row['form_ttl'] > $_SERVER['REQUEST_TIME'])) {
- return;
-}
-
-$form = $registry->callByPackage('ulaform', 'display', array($row['form_id']));
-if ($form instanceof PEAR_Error) {
- echo $form;
-} elseif ($form === true) {
- echo _("Thanks");
-} else {
- echo '<h1 class="header">' . $form['title'] . '</h1>';
- echo $form['form'];
-}
+++ /dev/null
-<div class="header"><?php echo $title ?></div>
-<table class="striped sortable" style="width: 100%;">
-<thead>
-<tr>
-<th><?php echo _("News") ?></th>
-<th><?php echo _("User") ?></th>
-<th><?php echo _("IP") ?></th>
-<th><?php echo _("Date") ?></th>
-</tr>
-</thead>
+++ /dev/null
-<tr>
-<td><?php echo Horde::link(Horde_Util::addParameter($url, 'id', $row['id']), $row['title']) . $row['id'] . '</a>'; ?></td>
-<td><?php echo Horde::link(Horde_Util::addParameter($url, 'actionID', $row['user']), $row['user']) . $row['user'] . '</a>'; ?></td>
-<td><?php echo $row['ip'] ?></td>
-<td><?php echo $row['readdate'] ?></td>
-</tr>
+++ /dev/null
-<table style="width: 100%;" id="sources_list" class="sortable striped">
-<thead>
-<tr>
-<th><?php echo $this->add_url ?></th>
-<th><?php echo _("Id") ?></th>
-<th><?php echo _("Name") ?></th>
-<th><?php echo _("Url") ?></th>
-</tr>
-</thead>
-<?php foreach ($this->sources as $source_id => $source) { ?>
-<tr>
-<td><?php foreach ($source['actions'] as $action ) { echo $action . ' '; } ?></td>
-<td><?php echo $source_id ?></td>
-<td><a href="<?php echo News::getUrlFor('source', $source_id) ?>" target="_blank"><?php echo $source['source_name'] ?></a></td>
-<td><?php echo $source['source_url'] ?></td>
-</tr>
-<?php } ?>
-</table>
+++ /dev/null
-div#capital {
- float: left;
- font-size: 350%;
- font-weight: bold;
- color: black;
- width: 1.2em;
- text-align: center;
- background: #eeeeee;
- padding: 5;
- border-width: 0 0.1em 0.1em 0;
- margin: 0 0.1em 0.1em 0;
- text-transform: uppercase;
-}
-
-div#news_picture {
- float: right;
- border: 1px;
- font-style: italic;
- background-color : rgb(238, 238, 238);
- margin-bottom : 2px;
- margin-left : 3px;
- margin-right : 0px;
- margin-top : 0px;
- text-align : justify;
- vertical-align : top;
- max-width: 300px;
- margin-left-ltr-source: physical;
- margin-left-rtl-source: physical;
- margin-right-ltr-source: physical;
- margin-right-rtl-source: physical;
-}
-
-#news_picture img {
- border: 1px solid black;
-}
-
-.imggallery {
- margin: 5px;
- text-align: center;
- border: 1px solid black;
- width: 24%;
- display: inline;
-}
-
-.imggallery img, .imggallery a {
- margin: 15px;
- display: inline;
-}
-
-.blogs {
- padding: 5px;
- margin-top: 15px;
- margin-bottom: 25px;
- border: 1px solid #ccc;
- background: #eee;
-}
-
-.sposored {
- font-size: 80%;
- font-style: italic;
- clear: both;
-}
-
-/* HTMLTAG. */
-a.earliest:link, a.earliest:visited, a.earliest:hover, a.earliest:active {
- color: #ccc;
- font-size: 140%;
-}
-
-a.earlier:link, a.earlier:visited, a.earlier:hover, a.earlier:active {
- color: #99c;
- font-size: 120%;
-}
-
-a.later:link, a.later:visited, a.later:hover, a.later:active {
- color: #99f;
-}
-
-a.latest:link, a.latest:visited, a.latest:hover, a.latest:active {
- color: #00f;
- font-size: 80%;
-}
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * $Id: trackback.php 803 2008-08-27 08:29:20Z duck $
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Duck <duck@obala.net>
- * @package News
- */
-
-$news_authentication = 'none';
-require_once dirname(__FILE__) . '/lib/base.php';
-
-if ($browser->isRobot()) {
- exit;
-}
-
-header('Content-type: text/xml');
-
-/* Try to create object */
-$trackback_data = array(
- 'id' => Horde_Util::getFormData('id'),
- 'host' => $_SERVER['REMOTE_ADDR'],
- 'title' => Horde_Util::getFormData('title'),
- 'excerpt' => Horde_Util::getFormData('excerpt'),
- 'url' => Horde_Util::getFormData('url'),
- 'blog_name' => Horde_Util::getFormData('blog_name')
-);
-
-$trackback = News::loadTrackback($trackback_data);
-if ($trackback instanceof PEAR_Error) {
- echo Services_Trackback::getResponseError($trackback->getMessage(), 1);
- exit;
-}
-
-/* Check if the needed data is posted */
-foreach ($trackback_data as $key => $value) {
- if ($key != 'excerpt' && empty($value)) {
- echo Services_Trackback::getResponseError($key . ' is required', 2);
- exit;
- }
-}
-
-/* Get the response and check if the request has all data */
-$request = $trackback->receive();
-if ($trackback instanceof PEAR_Error) {
- echo Services_Trackback::getResponseError($request->getMessage(), 3);
- exit;
-}
-
-/* Check if the message is a spam */
-if (!empty($conf['trackback']['spamcheck'])) {
- foreach ($conf['trackback']['spamcheck'] as $type) {
- $trackback->createSpamCheck($type);
- }
- if ($trackback->checkSpam()) {
- echo Services_Trackback::getResponseError('SPAM', 4);
- exit;
- }
-}
-
-/* Check if the forum exists */
-$id = (int)$trackback->get('id');
-if ($id == 0) {
- echo Services_Trackback::getResponseError(sprintf(_("Blog entry %s does not exist."), $id), 5);
-}
-
-$news_data = $news->get($id);
-if ($news_data instanceof PEAR_Error) {
- echo Services_Trackback::getResponseError($news_data->getMessage(), 5);
- exit;
-}
-
-/* Store the trackback data */
-$result = $news->saveTrackback($id,
- $trackback->get('title'),
- $trackback->get('url'),
- $trackback->get('excerpt'),
- $trackback->get('blog_name'),
- $trackback->get('trackback_url'));
-if ($result instanceof PEAR_Error) {
- echo Services_Trackback::getResponseError($result->getMessage(), 6);
- exit;
-}
-
-/* All done */
-echo Services_Trackback::getResponseSuccess();
+++ /dev/null
-Version 1.0
-
-Copyright (c) 2002-2005 The Horde Project. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-2. 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.
-
-3. The end-user documentation included with the redistribution, if
-any, must include the following acknowledgment:
-
- "This product includes software developed by the Horde Project
- (http://www.horde.org/)."
-
-Alternately, this acknowledgment may appear in the software itself, if
-and wherever such third-party acknowledgments normally appear.
-
-4. The names "Horde", "The Horde Project", and "Mnemo" must not be
-used to endorse or promote products derived from this software without
-prior written permission. For written permission, please contact
-core@horde.org.
-
-5. Products derived from this software may not be called "Horde" or
-"Mnemo", nor may "Horde" or "Mnemo" appear in their name, without
-prior written permission of the Horde Project.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED 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 HORDE PROJECT OR ITS 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.
-
-This software consists of voluntary contributions made by many
-individuals on behalf of the Horde Project. For more information on
-the Horde Project, please see <http://www.horde.org/>.
+++ /dev/null
-What is Skoli?
-==============
-
-:Contact: horde@lists.horde.org
-
-.. contents:: Contents
-.. section-numbering::
-
-Skoli is a simple administrative module for teachers. Several contacts
-(students) will be summarized to a class. To each student one can then
-enter marks, objectives, outcomes and absences. Besides offering a search
-function Skoli also offers an export option in the CSV and TSV formats.
-
-This software is OSI Certified Open Source Software. OSI Certified is a
-certification mark of the `Open Source Initiative`_.
-
-.. _`Open Source Initiative`: http://www.opensource.org/
-
-
-Obtaining Skoli
----------------
-
-Further information on Skoli and the latest version can be obtained at
-
- http://www.horde.org/skoli/
-
-
-Documentation
--------------
-
-The following documentation is available in the Skoli distribution:
-
-:README_: This file
-:LICENSE_: Copyright and license information
-:`docs/CHANGES`_: Changes by release
-:`docs/CREDITS`_: Project developers
-:`docs/INSTALL`_: Installation instructions and notes
-:`docs/TODO`_: Development TODO list
-:`docs/UPGRADING`_: Pointers on upgrading from previous Skoli versions
-
-
-Installation
-------------
-
-Instructions for installing Skoli can be found in the file INSTALL_ in the
-``docs/`` directory of the Skoli distribution.
-
-
-Assistance
-----------
-
-If you encounter problems with Skoli, help is available!
-
-The Horde Frequently Asked Questions List (FAQ), available on the Web at
-
- http://www.horde.org/faq/
-
-The Horde Project runs a number of mailing lists, for individual applications
-and for issues relating to the project as a whole. Information, archives, and
-subscription information can be found at
-
- http://www.horde.org/mail/
-
-Lastly, Horde developers, contributors and users also make occasional
-appearances on IRC, on the channel #horde on the freenode Network
-(irc.freenode.net).
-
-
-Licensing
----------
-
-For licensing and copyright information, please see the file LICENSE_
-in the Skoli distribution.
-
-Thanks,
-
-The Skoli team
-
-
-.. _README: ?f=README.html
-.. _LICENSE: http://www.horde.org/licenses/asl.php
-.. _docs/CHANGES: ?f=CHANGES.html
-.. _docs/CREDITS: ?f=CREDITS.html
-.. _INSTALL:
-.. _docs/INSTALL: ?f=INSTALL.html
-.. _docs/TODO: ?f=TODO.html
-.. _docs/UPGRADING: ?f=UPGRADING.html
+++ /dev/null
-<?php
-/**
- * Copyright 2001-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- */
-
-@define('SKOLI_BASE', dirname(__FILE__));
-require_once SKOLI_BASE . '/lib/base.php';
-require_once SKOLI_BASE . '/lib/Forms/Entry.php';
-
-/* Redirect to create a new class if we don't have access to any class */
-if (count(Skoli::listClasses(false, Horde_Perms::EDIT)) == 0 && $GLOBALS['registry']->getAuth()) {
- $notification->push(_("Please create a new Class first."), 'horde.message');
- Horde::url('classes/create.php', true)->redirect();
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$form = new Skoli_EntryForm($vars);
-
-// Execute if the form is valid.
-if ($form->validate($vars)) {
- $result = $form->execute();
- if (is_a($result, 'PEAR_Error')) {
- $notification->push($result, 'horde.error');
- } else {
- $notification->push(sprintf(_("The new entry for \"%s\" has been added."), $result), 'horde.success');
- }
-
- Horde::url('add.php', true)
- ->add('class', $vars->get('class_id'))
- ->redirect();
- exit;
-}
-
-$title = $form->getTitle();
-require SKOLI_TEMPLATES . '/common-header.inc';
-require SKOLI_TEMPLATES . '/menu.inc';
-echo $form->renderActive($form->getRenderer(), $vars, 'add.php', 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2002-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-@define('SKOLI_BASE', dirname(dirname(__FILE__)));
-require_once SKOLI_BASE . '/lib/base.php';
-require_once SKOLI_BASE . '/lib/Forms/CreateClass.php';
-
-// Exit if this isn't an authenticated user.
-if (!$GLOBALS['registry']->getAuth()) {
- Horde::url('list.php', true)->redirect();
-}
-
-// Exit if we don't have access to addressbooks.
-require_once SKOLI_BASE . '/lib/School.php';
-if (!count(Skoli_School::listAddressBooks())) {
- $notification->push(_("You don't have access to any valid addressbook."), 'horde.error');
- Horde::url('classes/', true)->redirect();
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$form = new Skoli_CreateClassForm($vars);
-
-// Execute if the form is valid.
-if ($form->validate($vars)) {
- $result = $form->execute();
- if (is_a($result, 'PEAR_Error')) {
- $notification->push($result, 'horde.error');
- } else {
- $notification->push(sprintf(_("The class \"%s\" has been created."), $vars->get('name')), 'horde.success');
- $GLOBALS['display_classes'][] = $form->shareid;
- $prefs->setValue('display_classes', serialize($GLOBALS['display_classes']));
- }
-
- Horde::url('classes/', true)->redirect();
-}
-
-$title = $form->getTitle();
-require SKOLI_TEMPLATES . '/common-header.inc';
-require SKOLI_TEMPLATES . '/menu.inc';
-echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2002-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-@define('SKOLI_BASE', dirname(dirname(__FILE__)));
-require_once SKOLI_BASE . '/lib/base.php';
-require_once SKOLI_BASE . '/lib/Forms/DeleteClass.php';
-
-// Exit if this isn't an authenticated user.
-if (!$GLOBALS['registry']->getAuth()) {
- Horde::url('list.php', true)->redirect();
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$class_id = $vars->get('c');
-
-$class = $skoli_shares->getShare($class_id);
-if (is_a($class, 'PEAR_Error')) {
- $notification->push($class, 'horde.error');
- Horde::url('classes/', true)->redirect();
-} elseif (!$class->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
- $notification->push(_("You are not allowed to delete this class."), 'horde.error');
- Horde::url('classes/', true)->redirect();
-}
-
-$form = new Skoli_DeleteClassForm($vars, $class);
-
-// Execute if the form is valid (must pass with POST variables only).
-if ($form->validate(new Horde_Variables($_POST))) {
- $result = $form->execute();
- if (is_a($result, 'PEAR_Error')) {
- $notification->push($result, 'horde.error');
- } elseif ($result) {
- $notification->push(sprintf(_("The class \"%s\" has been deleted."), $class->get('name')), 'horde.success');
- }
-
- Horde::url('classes/', true)->redirect();
-}
-
-$title = $form->getTitle();
-require SKOLI_TEMPLATES . '/common-header.inc';
-require SKOLI_TEMPLATES . '/menu.inc';
-echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2002-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-@define('SKOLI_BASE', dirname(dirname(__FILE__)));
-require_once SKOLI_BASE . '/lib/base.php';
-require_once SKOLI_BASE . '/lib/Forms/EditClass.php';
-
-// Exit if this isn't an authenticated user.
-if (!$GLOBALS['registry']->getAuth()) {
- Horde::url('list.php', true)->redirect();
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$class = $skoli_shares->getShare($vars->get('c'));
-if (is_a($class, 'PEAR_Error')) {
- $notification->push($class, 'horde.error');
- Horde::url('classes/', true)->redirect();
-} elseif (!$class->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
- $notification->push(_("You are not allowed to change this class."), 'horde.error');
- Horde::url('classes/', true)->redirect();
-}
-$vars->set('school', $class->get('school'));
-if (!$vars->exists('marks')) {
- $vars->set('marks', $class->get('marks'));
-}
-if (!$vars->exists('address_book')) {
- $vars->set('address_book', $class->get('address_book'));
-}
-
-$form = new Skoli_EditClassForm($vars, $class);
-
-// Execute if the form is valid.
-if ($form->validate($vars)) {
- $original_name = $class->get('name');
- $result = $form->execute();
- if (is_a($result, 'PEAR_Error')) {
- $notification->push($result, 'horde.error');
- } else {
- if ($class->get('name') != $original_name) {
- $notification->push(sprintf(_("The class \"%s\" has been renamed to \"%s\"."), $original_name, $class->get('name')), 'horde.success');
- } else {
- $notification->push(sprintf(_("The class \"%s\" has been saved."), $original_name), 'horde.success');
- }
- }
-
- Horde::url('classes/', true)->redirect();
-}
-
-if (!$vars->exists('name')) {
- $vars->set('name', $class->get('name'));
- $vars->set('description', $class->get('desc'));
- $vars->set('category', $class->get('category'));
- foreach ($form->_schoolproperties as $name) {
- if ($name != 'marks') {
- $vars->set($name, $class->get($name));
- }
- }
- $studentslist = current(Skoli::listStudents($vars->get('c')));
- $studentsvars = array();
- foreach ($studentslist['_students'] as $student) {
- $studentsvars[] = $student['__key'];
- }
- $vars->set('students', $studentsvars);
-}
-
-$title = $form->getTitle();
-require SKOLI_TEMPLATES . '/common-header.inc';
-require SKOLI_TEMPLATES . '/menu.inc';
-echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2002-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-@define('SKOLI_BASE', dirname(dirname(__FILE__)));
-require_once SKOLI_BASE . '/lib/base.php';
-
-// Exit if this isn't an authenticated user.
-if (!$GLOBALS['registry']->getAuth()) {
- Horde::url('list.php', true)->redirect();
-}
-
-$edit_url_base = Horde::url('classes/edit.php');
-$perms_url_base = Horde::url($registry->get('webroot', 'horde') . '/services/shares/edit.php?app=skoli', true);
-$delete_url_base = Horde::url('classes/delete.php');
-
-$classes = Skoli::listClasses(true);
-$sorted_classes = array();
-foreach ($classes as $class) {
- $sorted_classes[$class->getName()] = $class->get('name');
-}
-asort($sorted_classes);
-
-$edit_img = Horde::img('edit.png', _("Edit"));
-$perms_img = Horde::img('perms.png', _("Change Permissions"));
-$delete_img = Horde::img('delete.png', _("Delete"));
-
-Horde::addScriptFile('tables.js', 'horde');
-$title = _("Manage Classes");
-require SKOLI_TEMPLATES . '/common-header.inc';
-require SKOLI_TEMPLATES . '/menu.inc';
-require SKOLI_TEMPLATES . '/classes/list.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?xml version="1.0"?>
-<configuration>
- <configsection name="storage">
- <configheader>
- Storage System Settings
- </configheader>
- <configswitch name="driver" desc="What storage driver should we use?">sql
- <case name="sql" desc="SQL">
- <configsection name="params">
- <configsql switchname="driverconfig">
- </configsql>
- </configsection>
- </case>
- </configswitch>
- </configsection>
-
- <configsection name="objects">
- <configheader>
- Settings for new Objects
- </configheader>
- <configboolean name="allow_marks" desc="Allow users to add marks?">true</configboolean>
- <configboolean name="allow_objectives" desc="Allow users to add objectives?">true</configboolean>
- <configboolean name="allow_outcomes" desc="Allow users to add outcomes?">true</configboolean>
- <configboolean name="allow_absences" desc="Allow users to add absences?">true</configboolean>
- </configsection>
-
- <configsection name="addresses">
- <configheader>
- Address settings
- </configheader>
- <configswitch name="storage" desc="In what address book should we store students?">ask
- <case name="ask" desc="Ask user">
- </case>
- <case name="custom" desc="One address book for all students">
- <configstring name="address_book" desc="Name of a client address book. If this is a shared address book, use the share id, not the source name.">localsql</configstring>
- </case>
- </configswitch>
- <configstring name="name_field" desc="Field name from the client address book to display as name field.">name</configstring>
- <configswitch name="contact_list" desc="When a new class is created should we also create a new contact list?">user
- <case name="user" desc="Per user preferences setting">
- </case>
- <case name="none" desc="Don't create contact lists">
- </case>
- <case name="auto" desc="Automatically create a new contact list">
- <configstring name="contact_list_name" desc="Enter a default name for new contact lists.<br />NOTE: You can use %c, %g or %s as substitution for the class, grade respectively semester name.">%c - %g - %s</configstring>
- </case>
- </configswitch>
- </configsection>
-
- <configsection name="menu">
- <configheader>
- Menu settings
- </configheader>
- <configboolean name="export" desc="Should we display an Export link in the Horde application menus?">true</configboolean>
- <configmultienum name="apps" desc="Select any applications that should be linked in Skoli's menu">
- <values>
- <configspecial name="list-horde-apps" />
- </values>
- </configmultienum>
- </configsection>
-</configuration>
+++ /dev/null
-<?php
-/**
- * See horde/config/prefs.php for documentation on the structure of this file.
- */
-
-$prefGroups['display'] = array(
- 'column' => _("General Preferences"),
- 'label' => _("Display Preferences"),
- 'desc' => _("Change your sorting and display preferences."),
- 'members' => array('initial_page', 'class_columns', 'sortby_class', 'sortdir_class', 'student_columns', 'sortby_student', 'sortdir_student', 'entry_details_wrap'),
-);
-
-$prefGroups['contactlists'] = array(
- 'column' => _("General Preferences"),
- 'label' => _("Contact Lists"),
- 'desc' => _("Change your settings for automatically create contact lists."),
- 'members' => $GLOBALS['conf']['addresses']['contact_list'] == 'user' ? array('contact_list', 'contact_list_name') : array(),
-);
-
-$prefGroups['marks'] = array(
- 'column' => _("General Preferences"),
- 'label' => _("Marks"),
- 'desc' => _("Define a format for marks"),
- 'members' => array('marks_roundby')
-);
-
-// default view
-$_prefs['initial_page'] = array(
- 'value' => 'list',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'enum',
- 'enum' => array('list' => _("List Classes"),
- 'add' => _("New Entry"),
- 'search' => _("Search")),
- 'desc' => _("Select the view to display after login:")
-);
-
-// Load constants from lib/Skoli.php
-require_once dirname(__FILE__) . '/../lib/Skoli.php';
-
-// columns in the class list view
-$_prefs['class_columns'] = array(
- 'value' => 'a:6:{i:0;s:13:"semesterstart";i:1;s:11:"semesterend";i:2;s:5:"grade";i:3;s:8:"semester";i:4;s:8:"location";i:5;s:8:"category";}',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'multienum',
- 'enum' => array(SKOLI_SORT_SEMESTERSTART => _("Semester Start"),
- SKOLI_SORT_SEMESTEREND => _("Semester End"),
- SKOLI_SORT_GRADE => _("Grade"),
- SKOLI_SORT_SEMESTER => _("Semester"),
- SKOLI_SORT_LOCATION => _("Location"),
- SKOLI_SORT_CATEGORY => _("Category")),
- 'desc' => _("Select the columns that should be shown in the class list view:")
-);
-
-// user preferred sorting column for classes
-$_prefs['sortby_class'] = array(
- 'value' => SKOLI_SORT_SEMESTERSTART,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'enum',
- 'enum' => array(SKOLI_SORT_SEMESTERSTART => _("Semester Start"),
- SKOLI_SORT_SEMESTEREND => _("Semester End"),
- SKOLI_SORT_NAME => _("Name"),
- SKOLI_SORT_GRADE => _("Grade"),
- SKOLI_SORT_SEMESTER => _("Semester"),
- SKOLI_SORT_LOCATION => _("Location"),
- SKOLI_SORT_CATEGORY => _("Category")),
- 'desc' => _("Sort classes by:"),
-);
-
-// user preferred sorting direction for classes
-$_prefs['sortdir_class'] = array(
- 'value' => SKOLI_SORT_ASCEND,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'enum',
- 'enum' => array(SKOLI_SORT_ASCEND => _("Ascending"),
- SKOLI_SORT_DESCEND => _("Descending")),
- 'desc' => _("Sort direction for classes:"),
-);
-
-// columns in the student list view
-$_prefs['student_columns'] = array(
- 'value' => 'a:3:{i:0;s:9:"lastentry";i:1;s:8:"summarks";i:2;s:11:"sumabsences";}',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'multienum',
- 'enum' => array(SKOLI_SORT_LASTENTRY => _("Last Entry"),
- SKOLI_SORT_SUMMARKS => _("Mark average"),
- SKOLI_SORT_SUMABSENCES => _("Absences")),
- 'desc' => _("Select the columns that should be shown in the student list view:")
-);
-
-// user preferred sorting column for students
-$_prefs['sortby_student'] = array(
- 'value' => SKOLI_SORT_NAME,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'enum',
- 'enum' => array(SKOLI_SORT_NAME => _("Name"),
- SKOLI_SORT_LASTENTRY => _("Last Entry"),
- SKOLI_SORT_SUMMARKS => _("Mark average"),
- SKOLI_SORT_SUMABSENCES => _("Absences")),
- 'desc' => _("Sort students by:"),
-);
-
-// user preferred sorting direction for students
-$_prefs['sortdir_student'] = array(
- 'value' => SKOLI_SORT_ASCEND,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'enum',
- 'enum' => array(SKOLI_SORT_ASCEND => _("Ascending"),
- SKOLI_SORT_DESCEND => _("Descending")),
- 'desc' => _("Sort direction for students:"),
-);
-
-// preference for wrapping the details for an entry.
-$_prefs['entry_details_wrap'] = array(
- 'value' => 100,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'number',
- 'desc' => _("How many characters of the entry details in search view should we allow to see?")
-);
-
-// preference for contact lists.
-$_prefs['contact_list'] = array(
- 'value' => 'ask',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'enum',
- 'enum' => array('ask' => _("Ask every time"),
- 'none' => _("Don't create contact lists"),
- 'auto' => _("Automatically create a new contact list")),
- 'desc' => _("When a new class is created should we also create a new contact list?")
-);
-
-// template for new contact lists.
-$_prefs['contact_list_name'] = array(
- 'value' => "%c - %g - %s",
- 'locked' => false,
- 'shared' => false,
- 'type' => 'text',
- 'desc' => _("Enter a default name for new contact lists.<br />NOTE: You can use %c, %g or %s as substitution for the class, grade respectively semester name.")
-);
-
-// preference for rounding marks.
-$_prefs['marks_roundby'] = array(
- 'value' => 2,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'number',
- 'desc' => _("How many decimal digits should we round marks to?")
-);
-
-// custom settings for marks
-$_prefs['marks_format_custom'] = array(
- 'value' => "6, 5.5, 5, 4.5, 4, 3.5, 3, 2.5, 2, 1.5, 1",
- 'locked' => false,
- 'shared' => false,
- 'type' => 'text',
- 'desc' => _("Enter some custom marks and separate them by comma (best mark first).<br />NOTE: You also need to choose \"Custom settings\" above.")
-);
-
-/**
- * Hidden preferences
- */
-
-// show the class list options panel?
-// a value of 0 = no, 1 = yes
-$_prefs['show_panel'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Show class list options panel?")
-);
-
-// show students in the class list view?
-$_prefs['show_students'] = array(
- 'value' => 1,
- 'locked' => false,
- 'shared' => false,
- 'type' => 'checkbox',
- 'desc' => _("Show students in the class list?"),
-);
-
-// store the class lists to diplay
-$_prefs['display_classes'] = array(
- 'value' => 'a:0:{}',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'implicit'
-);
-
-// store the last object format when adding a new entry
-$_prefs['default_objects_format'] = array(
- 'value' => 'mark',
- 'locked' => false,
- 'shared' => false,
- 'type' => 'implicit'
-);
+++ /dev/null
-<?php
-/**
- * This file is where you specify default informations needed to create a
- * new class. It contains one EXAMPLE. Please remove or comment out that
- * example if YOU DON'T NEED IT. There are a number of properties that you
- * can set for each school, including:
- *
- * title: The name of the school template.
- *
- * grade: List of grades for this school.
- *
- * semester: List of semesters. Specify each semester with:
- *
- * name: The semester name.
- *
- * start: Semester startdate. Currently supported formats are:
- * timestamp -- Timestamp
- * ISO week -- ISO week date format: e.g. 'W33-2' is Tuesday
- * of week 33.
- * strtotime -- A string who can be parsed by 'strtotime'. See
- * http://www.php.net/strtotime for more informations.
- *
- * end: Semester enddate (same format as 'start').
- *
- * location: List of locations, e.g. schoolhouses.
- *
- * marks: The format to use for marks. Currently supported formats are:
- * numbers -- In numbers: e.g. 4.4
- * percent -- In percent: e.g. 74%
- * custom -- List with custom marks separated by comma (best mark first):
- * e.g. 6, 5.5, 5, 4.5, 4, 3.5, 3, 2.5, 2, 1.5, 1
- *
- * subjects: List of subjects.
- *
- * objectives: Each subject may have a list of objectives.
- *
- * objectives: List of objectives without a specific subject.
- */
-
-/**
- * If a property is not defined then the user will be able to enter the
- * missing informations as free text. E.g. the following school template
- * will accept any user input:
- */
-$cfgSchools['custom'] = array(
- 'title' => _("Custom school")
-);
-
-/**
- * The following school may be used for primary schools in Bern, Switzerland.
- */
-$cfgSchools['prim_be'] = array(
- 'title' => _("Sample school"),
- 'grade' => array(
- _("1. class"),
- _("2. class"),
- _("3. class"),
- _("4. class"),
- _("5. class"),
- _("6. class")
- ),
- 'semester' => array(
- array(
- 'name' => _("1. term"),
- 'start' => 'W33-1',
- 'end' => 'W05-5'
- ),
- array(
- 'name' => _("2. term"),
- 'start' => 'W07-1',
- 'end' => 'W27-5'
- )
- ),
- 'location' => array(
- _("Schoolhouse 1"),
- _("Schoolhouse 2")
- ),
- 'marks' => '6, 5.5, 5, 4.5, 4, 3.5, 3, 2.5, 2, 1.5, 1',
- 'subjects' => array(
- _("German") => array(
- _("Hearing and Talking"),
- _("Reading"),
- _("Writing"),
- ),
- _("Mathematics") => array(
- _("Imagination"),
- _("Skills"),
- _("Appliance"),
- _("Problem solving behavior"),
- ),
- _("Nature-Human-Environment"),
- _("Music"),
- _("Sport"),
- _("Construct"),
- _("French") => array(
- _("Hearing"),
- _("Talking"),
- _("Reading"),
- _("Writing"),
- ),
- _("English") => array(
- _("Hearing"),
- _("Talking"),
- _("Reading"),
- _("Writing"),
- ),
- ),
- 'objectives' => array(
- _("Motivation to learn and dedication"),
- _("Concentration, attention, perseverance"),
- _("Exercise processing"),
- _("Teamwork and autonomy"),
- ),
-);
+++ /dev/null
-<?php
-/**
- * Copyright 2001-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file LICENSE for license information (ASL). If you
- * did not receive this file, see http://www.horde.org/licenses/asl.php.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-if (!$conf['menu']['export']) {
- Horde::url('list.php', true)->redirect();
-}
-
-$classes = Skoli::listClasses();
-
-/* If there are no valid classes, abort. */
-if (count($classes) == 0) {
- $notification->push(_("No classes are currently available. Export is disabled."), 'horde.error');
- require SKOLI_TEMPLATES . '/common-header.inc';
- require SKOLI_TEMPLATES . '/menu.inc';
- require $registry->get('templates', 'horde') . '/common-footer.inc';
- exit;
-}
-
-$class_options = array();
-foreach ($classes as $key=>$class) {
- $class_options[] = '<option value="' . htmlspecialchars($key) . '"' . (Horde_Util::getFormData('class') == $key ? ' selected="selected"' : '') . '>' .
- htmlspecialchars($class->get('name')) . "</option>\n";
-}
-
-$wholeclass_option = '<option value="all">' .
- htmlspecialchars(_("Whole class")) . "</option>\n";
-$student_options = array();
-$student_options[] = $wholeclass_option;
-if (Horde_Util::getFormData('class') != '') {
- $class = Horde_Util::getFormData('class');
-} else {
- reset($classes);
- $class = key($classes);
-}
-$export_class = current(Skoli::listStudents($class, SKOLI_SORT_NAME, SKOLI_SORT_ASCEND));
-foreach ($export_class['_students'] as $address) {
- $student_options[] = '<option value="' . htmlspecialchars($address['student_id']) . '">' .
- htmlspecialchars($address[$conf['addresses']['name_field']]) . "</option>\n";
-}
-
-$actionID = Horde_Util::getFormData('actionID');
-
-/* Loop through the action handlers. */
-switch ($actionID) {
-case 'export':
- $data = array();
- $driver = &Skoli_Driver::singleton($class);
- if (Horde_Util::getFormData('student') == 'all') {
- /* Export whole class. */
- $subjects = $driver->getSubjects('mark');
- foreach ($export_class['_students'] as $student) {
- $row = array();
- $row[_("Class")] = $export_class['name'];
- $row[_("Firstname")] = $student['firstname'];
- $row[_("Lastname")] = $student['lastname'];
-
- /* Absences */
- $absences = Skoli::sumAbsences($class, $student['student_id']);
- $row[_("Excused absences")] = $absences[0];
- $row[_("Absences without valid excuse")] = $absences[1];
-
- /* Marks */
- foreach ($subjects as $subject) {
- $row[$subject] = Skoli::sumMarks($class, $student['student_id'], $subject);
- }
-
- /* Outcomes */
- $outcomes = Skoli::sumOutcomes($class, $student['student_id']);
- $row[_("Completed outcomes")] = $outcomes[0];
- $row[_("Open outcomes")] = $outcomes[1];
-
- $data[] = $row;
- }
- /* Make sure that only columns with data are exportet. */
- if (count($data)) {
- foreach ($data[0] as $key=>$value) {
- $emptycolumn = true;
- foreach ($data as $row) {
- if ($row[$key] !== '') {
- $emptycolumn = false;
- break;
- }
- }
- if ($emptycolumn) {
- foreach ($data as $rowkey=>$row) {
- unset($data[$rowkey][$key]);
- }
- }
- }
- }
- } else {
- /* Export all entries for the selected student. */
- $data[] = array(_("Marks"));
- $subjects = $driver->getSubjects('mark');
- foreach ($subjects as $subject) {
- $params = array(array('name' => 'subject', 'value' => $subject, 'strict' => 1));
- $marks = Skoli::listEntries($class, Horde_Util::getFormData('student'), 'mark', $params, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
- foreach ($marks as $mark) {
- $data[] = array($subject, $mark['date'], $mark['title'], Skoli::convertNumber($mark['mark']), Skoli::convertNumber($mark['weight']));
- }
- }
-
- $data[] = array(_("Objectives"));
- $subjects = $driver->getSubjects('objective');
- foreach ($subjects as $subject) {
- $params = array(array('name' => 'subject', 'value' => $subject, 'strict' => 1));
- $objectives = Skoli::listEntries($class, Horde_Util::getFormData('student'), 'objective', $params, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
- foreach ($objectives as $objective) {
- $data[] = array($subject, $objective['date'], $objective['category'], $objective['objective']);
- }
- }
-
- $data[] = array(_("Outcomes"));
- $outcomes = Skoli::listEntries($class, Horde_Util::getFormData('student'), 'outcome', null, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
- foreach ($outcomes as $outcome) {
- $completed = isset($outcome['completed']) && $outcome['completed'] != '' ? _("Completed") : _("Open");
- $comment = isset($outcome['comment']) ? $outcome['comment'] : '';
- $data[] = array($outcome['date'], $outcome['outcome'], $completed, $comment);
- }
-
- $data[] = array(_("Absences"));
- $absences = Skoli::listEntries($class, Horde_Util::getFormData('student'), 'absence', null, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
- foreach ($absences as $absence) {
- $excused = isset($absence['excused']) && $absence['excused'] != '' ? _("Excused") : _("Not excused");
- $comment = isset($absence['comment']) ? $absence['comment'] : '';
- $data[] = array($absence['date'], Skoli::convertNumber($absence['absence']), $excused, $comment);
- }
-
- /* Make sure that all rows have the same number of columns. */
- $maxcols = 0;
- for ($i=0; $i < count($data); $i++) {
- if (count($data[$i]) > $maxcols) {
- $maxcols = count($data[$i]);
- }
- }
- for ($i=0; $i < count($data); $i++) {
- for ($irow=0; $irow < $maxcols; $irow++) {
- if (!isset($data[$i][$irow])) {
- $data[$i][$irow] = '';
- }
- }
- }
- }
- if (!count($data)) {
- $notification->push(_("There were no entries to export."), 'horde.message');
- break;
- }
-
- switch (Horde_Util::getFormData('exportID')) {
- case EXPORT_CSV:
- $injector->getInstance('Horde_Data')->getData('Csv')->exportFile(_("class.csv"), $data, (Horde_Util::getFormData('student') == 'all'));
- exit;
-
- case EXPORT_TSV:
- $injector->getInstance('Horde_Data')->getData('Tsv')->exportFile(_("class.tsv"), $data, (Horde_Util::getFormData('student') == 'all'));
- exit;
-
- }
- break;
-}
-
-$title = _("Export Classes");
-
-Horde::addScriptFile('effects.js', 'horde');
-Horde::addScriptFile('redbox.js', 'horde');
-require SKOLI_TEMPLATES . '/common-header.inc';
-require SKOLI_TEMPLATES . '/menu.inc';
-require SKOLI_TEMPLATES . '/data/export.inc';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-----
-v0.1
-----
-
-[xyz] Initial Release
+++ /dev/null
-===========================
- Skoli Development Team
-===========================
-
-
-Core Developers
-===============
-
-- Martin Blumenthal <tinu@humbapa.ch>
-
-
-Localization
-============
-
-===================== ======================================================
-German Martin Blumenthal <tinu@humbapa.ch>
-===================== ======================================================
+++ /dev/null
-======================
- Installing Skoli 0.1
-======================
-
-:Contact: horde@lists.horde.org
-
-.. contents:: Contents
-.. section-numbering::
-
-This document contains instructions for installing the Skoli administrative
-application for teachers on your system.
-
-For information on the capabilities and features of Skoli, see the file
-README_ in the top-level directory of the Skoli distribution.
-
-
-Obtaining Skoli
-==================
-
-Skoli can be obtained from the Horde website and FTP server, at
-
- http://www.horde.org/skoli/
-
- ftp://ftp.horde.org/pub/skoli/
-
-Or use the mirror closest to you:
-
- http://www.horde.org/mirrors.php
-
-Bleeding-edge development versions of Skoli are available via CVS; see the
-file `docs/HACKING`_ in the Horde distribution, or the website
-http://www.horde.org/source/, for information on accessing the Horde CVS
-repository.
-
-
-Prerequisites
-=============
-
-To function properly, Skoli **requires** the following:
-
-1. A working Horde installation.
-
- Skoli runs within the `Horde Application Framework`_, a set of common
- tools for Web applications written in PHP. You must install Horde before
- installing Skoli.
-
- .. Important:: Skoli 0.1 requires version 3.0+ of the Horde Framework -
- earlier versions of Horde will **not** work.
-
- .. _`Horde Application Framework`: http://www.horde.org/horde/
-
- The Horde Framework can be obtained from the Horde website and FTP server,
- at
-
- http://www.horde.org/horde/
-
- ftp://ftp.horde.org/pub/horde/
-
- Many of Skoli's prerequisites are also Horde prerequisites.
-
- .. Important:: Be sure to have completed all of the steps in the
- `horde/docs/INSTALL`_ file for the Horde Framework before
- installing Skoli.
-
-2. SQL support in PHP.
-
- Skoli stores its data in an SQL database. Build PHP with whichever SQL
- driver you require; see the Horde INSTALL_ file for details.
-
-3. Turba, the Horde contacts manager.
-
- Turba is the Horde contact management application, designed to be
- integrated with other Horde applications to provide a unified interface to
- contact management throughout the Horde suite.
-
- Turba is available from:
-
- http://www.horde.org/turba/
-
- ftp://ftp.horde.org/pub/turba/
-
- Turba provides a local address book and an LDAP directory search function
- to IMP.
-
- You must use the 2.x branch of Turba with Skoli 0.1.
-
-
-Installing Skoli
-================
-
-Skoli is written in PHP, and must be installed in a web-accessible
-directory. The precise location of this directory will differ from system to
-system. Conventionally, Skoli is installed directly underneath Horde in the
-web server's document tree.
-
-Since Skoli is written in PHP, there is no compilation necessary; simply
-expand the distribution where you want it to reside and rename the root
-directory of the distribution to whatever you wish to appear in the URL. For
-example, with the Apache web server's default document root of
-``/usr/local/apache/htdocs``, you would type::
-
- cd /usr/local/apache/htdocs/horde
- tar zxvf /path/to/skoli-x.y.z.tar.gz
- mv skoli-x.y.z skoli
-
-and would then find Skoli at the URL::
-
- http://your-server/horde/skoli/
-
-
-Configuring Skoli
-====================
-
-1. Configuring Horde for Skoli
-
- a. Register the application
-
- In ``horde/config/registry.php``, find the ``applications['skoli']``
- stanza. The default settings here should be okay, but you can change
- them if desired. If you have changed the location of Skoli relative
- to Horde, either in the URL, in the filesystem or both, you must update
- the ``fileroot`` and ``webroot`` settings to their correct values.
-
- If Skoli is not yet present in ``horde/config/registry.php`` you can
- use something like:
-
- $this->applications['skoli'] = array(
- 'fileroot' => dirname(__FILE__) . '/../skoli',
- 'webroot' => $this->applications['horde']['webroot'] . '/skoli',
- 'name' => _("School"),
- 'status' => 'active',
- 'menu_parent' => 'office'
- );
-
- $this->applications['skoli-menu'] = array(
- 'status' => 'block',
- 'app' => 'skoli',
- 'blockname' => 'tree_menu',
- 'menu_parent' => 'skoli',
- );
-
-2. Creating the database tables
-
- The specific steps to create Skoli's database tables depend on which
- database you've chosen to use.
-
- First, look in ``scripts/sql/`` to see if a script already exists for your
- database type. If so, you should be able to simply execute that script as
- superuser in your database. (Note that executing the script as the "horde"
- user will probably fail when granting privileges.)
-
- If such a script does not exist, you'll need to build your own, using the
- file ``skoli.sql`` as a starting point. If you need assistance in
- creating database tables, you may wish to let us know on the Skoli
- mailing list.
-
-3. Configuring Skoli
-
- To configure Skoli, change to the ``config/`` directory of the installed
- distribution, and make copies of all of the configuration ``dist`` files
- without the ``dist`` suffix::
-
- cd config/
- for foo in *.dist; do cp $foo `basename $foo .dist`; done
-
- Or on Windows::
-
- copy *.dist *.
-
- Documentation on the format and purpose of those files can be found in each
- file. You may edit these files if you wish to customize Skoli's
- appearance and behavior. With one exception (``foo.php``) the defaults will
- be correct for most sites.
-
- You must login to Horde as a Horde Administrator to finish the
- configuration of Skoli. Use the Horde ``Administration`` menu item to
- get to the administration page, and then click on the ``Configuration``
- icon to get the configuration page. Select ``Skoli Name`` from the
- selection list of applications. Fill in or change any configuration values
- as needed. When done click on ``Generate Skoli Name Configuration`` to
- generate the ``conf.php`` file. If your web server doesn't have write
- permissions to the Skoli configuration directory or file, it will not be
- able to write the file. In this case, go back to ``Configuration`` and
- choose one of the other methods to create the configuration file
- ``skoli/config/conf.php``.
-
- Note for international users: Skoli uses GNU gettext to provide local
- translations of text displayed by applications; the translations are found
- in the ``po/`` directory. If a translation is not yet available for your
- locale (and you wish to create one), see the ``horde/po/README`` file, or
- if you're having trouble using a provided translation, please see the
- `horde/docs/TRANSLATIONS`_ file for instructions.
-
-4. School templates
-
- To customize your school edit the file ``skoli/config/school.php``. It
- contains some examples you can start from.
-
-5. Testing Skoli
-
- Use Skoli to create a class and add some entries. Test at least the
- following:
-
- - Creating a new Class
- - Adding a new entry for each desired type
- - Modifying an entry
- - Deleting an entry
-
-
-Obtaining Support
-=================
-
-If you encounter problems with Skoli, help is available!
-
-The Horde Frequently Asked Questions List (FAQ), available on the Web at
-
- http://www.horde.org/faq/
-
-The Horde Project runs a number of mailing lists, for individual applications
-and for issues relating to the project as a whole. Information, archives, and
-subscription information can be found at
-
- http://www.horde.org/mail/
-
-Lastly, Horde developers, contributors and users may also be found on IRC,
-on the channel #horde on the Freenode Network (irc.freenode.net).
-
-Please keep in mind that Skoli is free software written by volunteers.
-For information on reasonable support expectations, please read
-
- http://www.horde.org/support.php
-
-Thanks for using Skoli!
-
-The Skoli team
-
-
-.. _README: ?f=README.html
-.. _`horde/docs/HACKING`: ../../horde/docs/?f=HACKING.html
-.. _`horde/docs/INSTALL`: ../../horde/docs/?f=INSTALL.html
-.. _`horde/docs/TRANSLATIONS`: ../../horde/docs/?f=TRANSLATIONS.html
+++ /dev/null
-<?php
-/**
- * Release focus. Possible values:
- * 0 - N/A
- * 1 - Initial freshmeat announcement
- * 2 - Documentation
- * 3 - Code cleanup
- * 4 - Minor feature enhancements
- * 5 - Major feature enhancements
- * 6 - Minor bugfixes
- * 7 - Major bugfixes
- * 8 - Minor security fixes
- * 9 - Major security fixes
- */
-$this->notes['fm']['focus'] = 4;
-
-/* Mailing list release notes. */
-$this->notes['ml']['changes'] = <<<ML
-The Horde Team is pleased to announce the [first release candidate|final
-release] of the Skoli Foo Bar Application version H3 (x.x).
-
-Skoli is a simple administrative module for teachers. Several contacts
-(students) will be summarized to a class. To each student one can then
-enter marks, objectives, outcomes and absences. Besides offering a search
-function Skoli also offers an export option in the CSV and TSV formats.
-
-[For alpha/beta releases:
-This is a preview version that should not be used on production systems. This
-version is considered feature complete but there might still be a few bugs.
-You should not use this preview version over existing production data.
-
-We encourage widespread testing and feedback via the mailing lists or our bug
-tracking system. Updated translations are very welcome, though some strings
-might still change before the final release.]
-
-[For release candidates:
-Barring any problems, this code will be released as Skoli H3 (x.x).
-Testing is requested and comments are encouraged.
-Updated translations would also be great.]
-
-The major changes compared to the Skoli version H3 (x.x) are:
-[or: Changes in this release:]
- * ...
-ML;
-
-/* Freshmeat release notes, not more than 600 characters. */
-$this->notes['fm']['changes'] = <<<FM
-FM;
-
-$this->notes['name'] = 'Skoli';
-$this->notes['fm']['project'] = 'skoli';
-$this->notes['fm']['branch'] = 'Default';
+++ /dev/null
-=============================
- Skoli Development TODO List
-=============================
-
-:Contact: horde@lists.horde.org
-
-- When adding new entries allow users to add different values for more than one student (e.g. adding marks for the whole class)
-
-- Tune up the search form with type dependent options (e.g. drop-down with used subjects).
-
-- Implement an easy form to create timetables in e.g. Kronolith.
-
-- Allow users to search for an address to add to classes (e.g. like the compose addressbook window in imp).
+++ /dev/null
-<?php
-/**
- * Copyright 2000-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file LICENSE for license information (ASL). If you
- * did not receive this file, see http://www.horde.org/licenses/asl.php.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- */
-
-@define('SKOLI_BASE', dirname(__FILE__));
-require_once SKOLI_BASE . '/lib/base.php';
-
-// Exit if this isn't an authenticated user.
-if (!$GLOBALS['registry']->getAuth()) {
- Horde::url('list.php', true)->redirect();
-}
-
-$vars = Horde_Variables::getDefaultVariables();
-$driver = &Skoli_Driver::singleton();
-$entry = $driver->getEntry($vars->get('entry'));
-if (is_a($entry, 'PEAR_Error') || !count($entry)) {
- $notification->push(_("Entry not found."), 'horde.error');
- Horde::url('search.php', true)->redirect();
-}
-$share = $GLOBALS['skoli_shares']->getShare($entry['class_id']);
-
-// Check permissions
-if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
- $notification->push(_("You are not allowed to view this entry."), 'horde.error');
- Horde::url('search.php', true)
- ->add('actionID', 'search')
- ->redirect();
-}
-
-$studentdetails = Skoli::getStudent($share->get('address_book'), $entry['student_id']);
-
-// Get view.
-$viewName = Horde_Util::getFormData('view', 'Entry');
-
-if ($viewName != 'DeleteEntry') {
- require_once SKOLI_BASE . '/lib/Forms/Entry.php';
- if (!$vars->exists('class_id')) {
- foreach ($entry as $key=>$val) {
- if (!is_array($val)) {
- $vars->set($key, $val);
- }
- }
- foreach ($entry['_attributes'] as $key=>$val) {
- $vars->set('attribute_' . $key, $val);
- }
- }
- $form = new Skoli_EntryForm($vars);
- if ($viewName == 'EditEntry') {
- if ($form->validate($vars)) {
- $driver = &Skoli_Driver::singleton($vars->get('class_id'));
- $result = $driver->updateEntry($entry['object_id'], $vars);
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(sprintf(_("Couldn't update this entry: %s"), $result->getMessage()), 'horde.error');
- } else {
- $notification->push(sprintf(_("The entry for \"%s\" has been saved."), $studentdetails[$conf['addresses']['name_field']]), 'horde.success');
- Horde::url('search.php', true)
- ->add('actionID', 'search')
- ->redirect();
- }
- }
- }
-}
-
-// Entry actions.
-$actionID = Horde_Util::getFormData('actionID');
-if ($actionID == 'delete') {
- if (is_a($deleted = $driver->deleteEntry($entry['object_id']), 'PEAR_Error')) {
- $notification->push(sprintf(_("There was an error deleting this entry: %s"), $deleted->getMessage()), 'horde.error');
- } else {
- $notification->push(sprintf(_("The entry for \"%s\" has been deleted."), $studentdetails[$conf['addresses']['name_field']]), 'horde.success');
- Horde::url('search.php', true)
- ->add('actionID', 'search')
- ->redirect();
- }
-}
-
-// Get tabs.
-$url = Horde_Util::addParameter(Horde::url('entry.php'), 'entry', $entry['object_id']);
-$tabs = new Horde_Core_Ui_Tabs('view', $vars);
-$tabs->addTab(_("View"), $url, array('tabname' => 'Entry', 'id' => 'tabEntry'));
-if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
- $tabs->addTab(_("Edit"), $url, array('tabname' => 'EditEntry', 'id' => 'tabEditEntry'));
-}
-if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
- $tabs->addTab(_("Delete"), $url, array('tabname' => 'DeleteEntry', 'id' => 'tabDeleteEntry'));
-}
-
-$title = _("Edit Entry");
-require SKOLI_TEMPLATES . '/common-header.inc';
-require SKOLI_TEMPLATES . '/menu.inc';
-
-echo '<div id="page">';
-echo $tabs->render($viewName);
-echo '<h1 class="header">' . sprintf(_("Entry for \"%s\""), $studentdetails[$conf['addresses']['name_field']]) . '</h1>';
-
-// View output
-switch ($viewName) {
-case 'Entry':
- echo $form->renderInactive($form->getRenderer(), $vars);
- break;
-
-case 'EditEntry':
- echo $form->renderActive($form->getRenderer(), $vars, 'entry.php', 'post');
- break;
-
-case 'DeleteEntry':
- require SKOLI_TEMPLATES . '/entry/delete.inc';
- break;
-}
-
-echo '</div>';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<?php
-/**
- * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-require SKOLI_BASE . '/' . $prefs->getValue('initial_page') . '.php';
+++ /dev/null
-<?php
-/**
- * Defines the AJAX interface for Skoli.
- *
- * Copyright 2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Michael Slusarz <slusarz@horde.org>
- * @category Horde
- * @license http://www.fsf.org/copyleft/gpl.html GPL
- * @package Skoli
- */
-class Skoli_Ajax_Application extends Horde_Core_Ajax_Application {}
+++ /dev/null
-<?php
-class Skoli_Application extends Horde_Registry_Application
-{
- public $version = 'H4 (0.1-git)';
-
- /**
- * Add additional items to the menu.
- *
- * @param Horde_Menu $menu The menu object.
- */
- public function menu($menu)
- {
- return Skoli::getMenu();
- }
-
-}
+++ /dev/null
-<?php
-
-$block_name = _("Menu List");
-$block_type = 'tree';
-
-/**
- * @package Horde_Block
- */
-class Horde_Block_skoli_tree_menu extends Horde_Block {
-
- var $_app = 'skoli';
-
- function _buildTree(&$tree, $indent = 0, $parent = null)
- {
- require_once dirname(__FILE__) . '/../base.php';
-
- $add = Horde::url('add.php');
- $add_img = Horde_Themes::img('add.png');
-
- $classes = Skoli::listClasses(false, Horde_Perms::EDIT);
- if (count($classes) > 0) {
- $tree->addNode(
- $parent . '__new',
- $parent,
- _("New Entry"),
- $indent + 1,
- false,
- array(
- 'icon' => $add_img,
- 'url' => $add
- )
- );
-
- foreach ($classes as $name => $class) {
- $tree->addNode(
- $parent . $name . '__new',
- $parent . '__new',
- sprintf(_("in %s"), $class->get('name')),
- $indent + 2,
- false,
- array(
- 'icon' => $add_img,
- 'url' => $add->copy()->add('class', $name)
- )
- );
- }
-
- $tree->addNode(
- $parent . '__search',
- $parent,
- _("Search"),
- $indent + 1,
- false,
- array(
- 'icon' => Horde_Themes::img('search.png'),
- 'url' => Horde::url('search.php')
- )
- );
- }
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Skoli_Driver:: defines an API for implementing storage backends for
- * Skoli.
- *
- * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- * @package Skoli
- */
-class Skoli_Driver {
-
- /**
- * String containing the current class name.
- *
- * @var string
- */
- var $_class = '';
-
- /**
- * An error message to throw when something is wrong.
- *
- * @var string
- */
- var $_errormsg;
-
- /**
- * Constructor - All real work is done by initialize().
- */
- function Skoli_Driver($errormsg = null)
- {
- if (is_null($errormsg)) {
- $this->_errormsg = _("The School backend is not currently available.");
- } else {
- $this->_errormsg = $errormsg;
- }
- }
-
- /**
- * Attempts to return a concrete Skoli_Driver instance based on $driver.
- *
- * @param string $class The name of the class to load.
- *
- * @param string $driver The type of the concrete Skoli_Driver subclass
- * to return. The class name is based on the
- * storage driver ($driver). The code is
- * dynamically included.
- *
- * @param array $params A hash containing any additional configuration
- * or connection parameters a subclass might need.
- *
- * @return Skoli_Driver The newly created concrete Skoli_Driver
- * instance, or false on an error.
- */
- function &factory($class = '', $driver = null, $params = null)
- {
- /* Check if we have access to the given class */
- static $classes;
- if (!is_array($classes)) {
- $classes = Skoli::listClasses();
- }
- if ($class != '' && !isset($classes[$class])) {
- $class = new Skoli_Driver(sprintf(_("Access for class \"%s\" is denied"), $class));
- return $class;
- }
-
- if (is_null($driver)) {
- $driver = $GLOBALS['conf']['storage']['driver'];
- }
- $driver = basename($driver);
-
- if (is_null($params)) {
- $params = Horde::getDriverConfig('storage', $driver);
- }
-
- require_once dirname(__FILE__) . '/Driver/' . $driver . '.php';
- $objclass = 'Skoli_Driver_' . $driver;
- if (class_exists($objclass)) {
- $class = new $objclass($class, $params);
- $result = $class->initialize();
- if (is_a($result, 'PEAR_Error')) {
- $class = new Skoli_Driver(sprintf(_("The School backend is not currently available: %s"), $result->getMessage()));
- }
- } else {
- $class = new Skoli_Driver(sprintf(_("Unable to load the definition of %s."), $objclass));
- }
-
- return $class;
- }
-
- /**
- * Attempts to return a reference to a concrete Skoli_Driver
- * instance based on $driver. It will only create a new instance
- * if no Skoli_Driver instance with the same parameters currently
- * exists.
- *
- * This should be used if multiple storage sources are required.
- *
- * This method must be invoked as: $var = &Skoli_Driver::singleton()
- *
- * @param string $class The name of the class to load.
- *
- * @param string $driver The type of concrete Skoli_Driver subclass
- * to return. The is based on the storage
- * driver ($driver). The code is dynamically
- * included.
- *
- * @param array $params (optional) A hash containing any additional
- * configuration or connection parameters a
- * subclass might need.
- *
- * @return mixed The created concrete Skoli_Driver instance, or false
- * on error.
- */
- function &singleton($class = '', $driver = null, $params = null)
- {
- static $instances = array();
-
- if (is_null($driver)) {
- $driver = $GLOBALS['conf']['storage']['driver'];
- }
-
- if (is_null($params)) {
- $params = Horde::getDriverConfig('storage', $driver);
- }
-
- $signature = serialize(array($class, $driver, $params));
- if (!isset($instances[$signature])) {
- $instances[$signature] = &Skoli_Driver::factory($class, $driver, $params);
- }
-
- return $instances[$signature];
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Skoli storage implementation for PHP's PEAR database abstraction layer.
- *
- * Optional parameters:<pre>
- * 'objects_table' The name of the objects table in 'database'.
- * Default is 'skoli_objects'.
- * 'object_attributes_table' The name of the attributes table in 'database'.
- * Default ist 'skoli_object_attributes'.
- * 'students_table' The name of the students table in 'database'.
- * Default is 'skoli_classes_students'.</pre>
- *
- * The table structure can be created by the scripts/sql/skoli.sql script.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- * @package Skoli
- */
-class Skoli_Driver_sql extends Skoli_Driver {
-
- /**
- * Handle for the current database connection.
- *
- * @var DB
- */
- var $_db;
-
- /**
- * Handle for the current database connection, used for writing. Defaults
- * to the same handle as $_db if a separate write database is not required.
- *
- * @var DB
- */
- var $_write_db;
-
- /**
- * Constructs a new SQL storage object.
- *
- * @param string $classlist The classlist to load.
- * @param array $params A hash containing connection parameters.
- */
- function Skoli_Driver_sql($class, $params = array())
- {
- $this->_class = $class;
- $this->_params = $params;
- }
-
- /**
- * Attempts to open a connection to the SQL server.
- *
- * @return boolean True on success, PEAR_Error on failure.
- */
- function initialize()
- {
- try {
- $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'skoli', 'storage');
- $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'skoli', 'storage');
- } catch (Horde_Exception $e) {
- return PEAR::raiseError($e->getMessage());
- }
-
- $this->_params = array_merge(array(
- 'objects_table' => 'skoli_objects',
- 'object_attributes_table' => 'skoli_object_attributes',
- 'students_table' => 'skoli_classes_students'
- ), $this->_params);
-
- return true;
- }
-
- /**
- * Get all students from the backend storage.
- *
- * @return array List with all student IDs.
- */
- function getStudents()
- {
- $query = 'SELECT student_id FROM ' . $this->_params['students_table'] .
- ' WHERE class_id = ?';
- $values = array($this->_class);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::getStudents(): %s', $query), 'DEBUG');
-
- /* Attempt the select query. */
- $students = $this->_db->getAll($query, $values, DB_FETCHMODE_ASSOC);
-
- /* Return an error immediately if the query failed. */
- if (is_a($students, 'PEAR_Error')) {
- Horde::logMessage($students, 'ERR');
- return $students;
- }
-
- return $students;
- }
-
- /**
- * Add students to the backend storage.
- *
- * @param array $students List with students.
- *
- * @return boolean True on success, PEAR_Error on failure.
- */
- function addStudents($students)
- {
- /* Delete any existing Students */
- $query = 'DELETE FROM ' . $this->_params['students_table'] .
- ' WHERE class_id=?';
- $result = $this->_write_db->query($query, array($this->_class));
-
- foreach ($students as $addressid) {
- $query = 'INSERT INTO ' . $this->_params['students_table'] .
- ' (class_id, student_id)' .
- ' VALUES (?, ?)';
- $values = array($this->_class, $addressid);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::addStudents(): %s', $query), 'DEBUG');
-
- /* Attempt the insertion query. */
- $result = $this->_write_db->query($query, $values);
-
- /* Return an error immediately if the query failed. */
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
- }
-
- return true;
- }
-
- /**
- * Get an entry from the backend storage.
- *
- * @param string $entryid The entry ID.
- *
- * @return array List with all entry fields.
- */
- function getEntry($entryid)
- {
- $query = 'SELECT * FROM ' . $this->_params['objects_table'] .
- ' WHERE object_id = ?';
- $values = array($entryid);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::getEntry(): %s', $query), 'DEBUG');
-
- /* Attempt the select query. */
- $entry = $this->_db->getRow($query, $values, DB_FETCHMODE_ASSOC);
-
- /* Return an error immediately if the query failed. */
- if (is_a($entry, 'PEAR_Error')) {
- Horde::logMessage($entry, 'ERR');
- return $entry;
- } else if (!is_array($entry)) {
- return array();
- }
-
- $query = 'SELECT * FROM ' . $this->_params['object_attributes_table'] .
- ' WHERE object_id = ?';
- $values = array($entryid);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::getEntry(): %s', $query), 'DEBUG');
-
- /* Attempt the select query. */
- $attributes = $this->_db->getAll($query, $values, DB_FETCHMODE_ASSOC);
-
- /* Return an error immediately if the query failed. */
- if (is_a($attributes, 'PEAR_Error')) {
- Horde::logMessage($attributes, 'ERR');
- return $attributes;
- }
-
- $entry['_attributes'] = array();
- foreach ($attributes as $attribute) {
- $entry['_attributes'][$attribute['attr_name']] = $attribute['attr_value'];
- }
-
- if (empty($this->_class)) {
- $this->_class = $entry['class_id'];
- }
-
- return $entry;
- }
-
- /**
- * Get all entries for the current class or student from the backend storage.
- *
- * @param string $studentid The student ID.
- *
- * @param string $type The entry type to search in.
- *
- * @param array $searchparams Some additional search parameters.
- *
- * @return array List with all entries.
- */
- function getEntries($studentid = null, $type = null, $searchparams = array())
- {
- if (is_null($studentid)) {
- $students = $this->getStudents();
- } else {
- $students = array(array('student_id' => $studentid));
- }
-
- foreach ($students as $studentkey=>$student) {
- /* Build the search parameter */
- if (count($searchparams)) {
- $where = '';
- $search_values = array();
- if (count($searchparams) === 1 && !is_array($searchparams[0])) {
- /* search all attributes for the specified text */
- $where = ' AND a.attr_value LIKE ?';
- $search_values[] = '%' . $searchparams[0] . '%';
- } else {
- /* search only in the specified fields */
- $where = ' AND ';
- for ($i = 0; $i < count($searchparams); $i++) {
- $strict = !empty($searchparams[$i]['strict']);
- $where .= '(a.attr_name = ? AND a.attr_value ' . ($strict ? '=' : 'LIKE') . ' ?) OR ';
- $search_values[] = $searchparams[$i]['name'];
- if ($strict) {
- $search_values[] = $searchparams[$i]['value'];
- } else {
- $search_values[] = '%' . $searchparams[$i]['value'] . '%';
- }
- }
- $where = substr($where, 0, -4);
- }
- $query = 'SELECT o.* FROM ' . $this->_params['object_attributes_table'] . ' AS a, ' .
- $this->_params['objects_table'] . ' AS o' .
- ' WHERE o.object_id = a.object_id AND o.class_id = ? AND o.student_id = ?' . (!is_null($type) ? ' AND o.object_type = ?' : '') . $where .
- ' GROUP BY o.object_id';
- $values = array($this->_class, $student['student_id']);
- if (!is_null($type)) {
- $values[] = $type;
- }
- $values = array_merge($values, $search_values);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::getEntries(): %s', $query), 'DEBUG');
-
- /* Attempt the select query. */
- $entries = $this->_db->getAll($query, $values, DB_FETCHMODE_ASSOC);
-
- /* Return an error immediately if the query failed. */
- if (is_a($entries, 'PEAR_Error')) {
- Horde::logMessage($entries, 'ERR');
- return $entries;
- }
- } else {
- $query = 'SELECT * FROM ' . $this->_params['objects_table'] .
- ' WHERE class_id = ? AND student_id = ?' .
- (!is_null($type) ? ' AND object_type = ?' : '');
- $values = array($this->_class, $student['student_id']);
- if (!is_null($type)) {
- $values[] = $type;
- }
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::getEntries(): %s', $query), 'DEBUG');
-
- /* Attempt the select query. */
- $entries = $this->_db->getAll($query, $values, DB_FETCHMODE_ASSOC);
-
- /* Return an error immediately if the query failed. */
- if (is_a($entries, 'PEAR_Error')) {
- Horde::logMessage($entries, 'ERR');
- return $entries;
- }
- }
-
- $students[$studentkey]['_entries'] = $entries;
-
- foreach ($entries as $entrykey=>$entry) {
- $query = 'SELECT * FROM ' . $this->_params['object_attributes_table'] .
- ' WHERE object_id = ?';
- $values = array($entry['object_id']);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::getEntries(): %s', $query), 'DEBUG');
-
- /* Attempt the select query. */
- $attributes = $this->_db->getAll($query, $values, DB_FETCHMODE_ASSOC);
-
- /* Return an error immediately if the query failed. */
- if (is_a($attributes, 'PEAR_Error')) {
- Horde::logMessage($attributes, 'ERR');
- return $attributes;
- }
-
- $students[$studentkey]['_entries'][$entrykey]['_attributes'] = array();
- foreach ($attributes as $attribute) {
- $students[$studentkey]['_entries'][$entrykey]['_attributes'][$attribute['attr_name']] = $attribute['attr_value'];
- }
- }
- }
-
- return $students;
- }
-
- /**
- * Get the timestamp of the last entry for the given student.
- *
- * @param string $studentid The student ID.
- *
- * @return int The last entry.
- */
- function lastEntry($studentid)
- {
- $query = 'SELECT object_time FROM ' . $this->_params['objects_table'] .
- ' WHERE class_id = ? AND student_id = ? ORDER BY object_time DESC';
- $values = array($this->_class, $studentid);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::lastEntry(): %s', $query), 'DEBUG');
-
- /* Attempt the select query. */
- $lastentry = $this->_db->limitQuery($query, 0, 1);
- $lastentry = $lastentry->fetchRow(DB_FETCHMODE_ORDERED);
-
- /* Return an error immediately if the query failed. */
- if (is_a($lastentry, 'PEAR_Error')) {
- Horde::logMessage($lastentry, 'ERR');
- return $lastentry;
- }
-
- if (count($lastentry)) {
- return $lastentry[0];
- }
-
- return null;
- }
-
- /**
- * Add or update a new entry to the backend storage.
- *
- * @param string $entryid The entry ID.
- *
- * @param Variables $vars List with form variables.
- *
- * @return boolean True on success, PEAR_Error on failure.
- */
- function updateEntry($entryid, $vars)
- {
- $attributes = array();
- foreach ($vars->_vars as $key=>$value) {
- if (strpos($key, 'attribute_') === 0 && $value != '') {
- $attribute = substr($key, 10);
- $attributes[$attribute] = $value;
- }
- }
-
- $query = 'UPDATE ' . $this->_params['objects_table'] . ' SET' .
- ' class_id = ?, student_id = ?, object_time = ?, object_type = ?' .
- ' WHERE object_id = ?';
- require_once 'Horde/Date.php';
- $date = new Horde_Date($vars->get('object_time'));
- $values = array($this->_class, $vars->get('student_id'), $date->datestamp(), $vars->get('object_type'), $entryid);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::updateEntry(): %s', $query), 'DEBUG');
-
- /* Attempt the insertion query. */
- $result = $this->_write_db->query($query, $values);
-
- /* Return an error immediately if the query failed. */
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
-
- $query = 'DELETE FROM ' . $this->_params['object_attributes_table'] .
- ' WHERE object_id = ?';
- $values = array($entryid);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::updateEntry(): %s', $query), 'DEBUG');
-
- /* Attempt the delete query. */
- $result = $this->_write_db->query($query, $values);
-
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
-
- foreach ($attributes as $attribute=>$value) {
- $query = 'INSERT INTO ' . $this->_params['object_attributes_table'] .
- ' (object_id, attr_name, attr_value)' .
- ' VALUES (?, ?, ?)';
- $values = array($entryid, $attribute, $value);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::addEntry(): %s', $query), 'DEBUG');
-
- /* Attempt the insertion query. */
- $result = $this->_write_db->query($query, $values);
-
- /* Return an error immediately if the query failed. */
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
- }
-
- return true;
- }
-
- /**
- * Add a new entry to the backend storage.
- *
- * @param Variables $vars List with form variables.
- *
- * @return Mixed Studentnames on success, PEAR_Error on failure.
- */
- function addEntry($vars)
- {
- $names = '';
- $class = current(Skoli::listStudents($this->_class));
-
- $attributes = array();
- foreach ($vars->_vars as $key=>$value) {
- if (strpos($key, 'attribute_') === 0 && $value != '') {
- $attribute = substr($key, 10);
- $attributes[$attribute] = $value;
- }
- }
-
- require_once 'Horde/Date.php';
- foreach ($vars->get('student_id') as $studentid) {
- $query = 'INSERT INTO ' . $this->_params['objects_table'] .
- ' (object_id, object_owner, object_uid, class_id, student_id, object_time, object_type)' .
- ' VALUES (?, ?, ?, ?, ?, ?, ?)';
- $entryId = strval(new Horde_Support_Uuid());
- $date = new Horde_Date($vars->get('object_time'));
- $values = array($entryId, $GLOBALS['registry']->getAuth(), strval(new Horde_Support_Uuid()), $this->_class, $studentid, $date->datestamp(), $vars->get('object_type'));
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::addEntry(): %s', $query), 'DEBUG');
-
- /* Attempt the insertion query. */
- $result = $this->_write_db->query($query, $values);
-
- /* Return an error immediately if the query failed. */
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
-
- foreach ($attributes as $attribute=>$value) {
- $query = 'INSERT INTO ' . $this->_params['object_attributes_table'] .
- ' (object_id, attr_name, attr_value)' .
- ' VALUES (?, ?, ?)';
- $values = array($entryId, $attribute, $value);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::addEntry(): %s', $query), 'DEBUG');
-
- /* Attempt the insertion query. */
- $result = $this->_write_db->query($query, $values);
-
- /* Return an error immediately if the query failed. */
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, 'ERR');
- return $result;
- }
- }
-
- $studentdetails = Skoli::getStudent($class['address_book'], $studentid);
- $names .= $studentdetails[$GLOBALS['conf']['addresses']['name_field']] . ', ';
- }
-
- return substr($names, 0, -2);
- }
-
- /**
- * Get all currently used subjects from the current class.
- *
- * @param string $type Get subjects only from this type.
- *
- * @return array List with all subjects.
- */
- function getSubjects($type = null)
- {
- $where = !is_null($type) ? ' AND o.object_type = ?' : '';
- $query = 'SELECT DISTINCT a.attr_value FROM ' . $this->_params['object_attributes_table'] . ' AS a, ' .
- $this->_params['objects_table'] . ' AS o' .
- ' WHERE a.object_id = o.object_id AND o.class_id = ? AND a.attr_name = ?' . $where;
- $values = array($this->_class, 'subject');
- if (!is_null($type)) {
- $values[] = $type;
- }
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::getSubjects(): %s', $query), 'DEBUG');
-
- /* Attempt the select query. */
- $subjects = $this->_db->getAll($query, $values, DB_FETCHMODE_ORDERED);
-
- /* Return an error immediately if the query failed. */
- if (is_a($subjects, 'PEAR_Error')) {
- Horde::logMessage($subjects, 'ERR');
- return $subjects;
- }
-
- $subjectlist = array();
- foreach ($subjects as $subject) {
- $subjectlist[] = $subject[0];
- }
-
- return $subjectlist;
- }
-
- /**
- * Deletes all data from the current class.
- *
- * @return boolean True on success, PEAR_Error on failure.
- */
- function deleteAll()
- {
- $query = 'DELETE FROM ' . $this->_params['students_table'] .
- ' WHERE class_id = ?';
- $values = array($this->_class);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::deleteAll(): %s', $query), 'DEBUG');
-
- /* Attempt the delete query. */
- $result = $this->_write_db->query($query, $values);
-
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
-
- $query = 'SELECT object_id FROM ' . $this->_params['objects_table'] .
- ' WHERE class_id = ?';
- $values = array($this->_class);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::deleteAll(): %s', $query), 'DEBUG');
-
- /* Attempt the select query. */
- $entries = $this->_db->getAll($query, $values, DB_FETCHMODE_ASSOC);
-
- /* Return an error immediately if the query failed. */
- if (is_a($entries, 'PEAR_Error')) {
- Horde::logMessage($entries, 'ERR');
- return $entries;
- }
-
- foreach ($entries as $entry) {
- $result = $this->deleteEntry($entry['object_id']);
-
- /* Return an error immediately if the query failed. */
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
- }
-
- return true;
- }
-
- /**
- * Deletes an entry from the current class.
- *
- * @param string $object_id The entry ID to delete.
- *
- * @return boolean True on success, PEAR_Error on failure.
- */
- function deleteEntry($object_id)
- {
- $query = 'DELETE FROM ' . $this->_params['objects_table'] .
- ' WHERE object_id = ? AND class_id = ?';
- $values = array($object_id, $this->_class);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::deleteEntry(): %s', $query), 'DEBUG');
-
- /* Attempt the delete query. */
- $result = $this->_write_db->query($query, $values);
-
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
-
- $query = 'DELETE FROM ' . $this->_params['object_attributes_table'] .
- ' WHERE object_id = ?';
- $values = array($object_id);
-
- /* Log the query at a DEBUG log level. */
- Horde::logMessage(sprintf('Skoli_Driver_sql::deleteEntry(): %s', $query), 'DEBUG');
-
- /* Attempt the delete query. */
- $result = $this->_write_db->query($query, $values);
-
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
-
- return true;
- }
-}
+++ /dev/null
-<?php
-/**
- * Horde_Form for creating classes.
- *
- * See the enclosed file LICENSE for license information (ASL). If you
- * did not receive this file, see http://www.horde.org/licenses/asl.php.
- *
- * @package Skoli
- */
-
-/** Horde_Form */
-require_once 'Horde/Form.php';
-
-/** Horde_Form_Renderer */
-require_once 'Horde/Form/Renderer.php';
-
-/**
- * The Skoli_CreateClassForm class provides the form for
- * creating a class.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- * @package Skoli
- */
-class Skoli_CreateClassForm extends Horde_Form {
-
- /**
- * Name of the new share.
- *
- * @var int
- */
- var $shareid;
-
- /**
- * List of school properties.
- *
- * @var array
- */
- var $_schoolproperties = array(
- 'grade',
- 'semester',
- 'start',
- 'end',
- 'location',
- 'marks');
-
-
- function Skoli_CreateClassForm(&$vars)
- {
- global $conf, $prefs, $registry;
-
- parent::Horde_Form($vars, _("Create Class"));
-
- $this->setSection('properties', _("Properties"));
-
- $this->addVariable(_("General Settings"), null, 'header', false);
-
- $this->addVariable(_("Name"), 'name', 'text', true);
- $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
-
- $this->addVariable(_("Category"), 'category', 'category', false);
- // A new category doesn't survive a reload action, so reset it
- // @TODO: Could this be a bug?
- if (strpos($this->_vars->get('category'), '*new*') !== false) {
- $this->_vars->set('category', $this->_vars->get('new_category'));
- }
-
- $this->addVariable(_("School Specific Settings"), null, 'header', false);
-
- // Load Skoli_School
- require_once SKOLI_BASE . '/lib/School.php';
-
- // List schools
- $schoollist = Skoli_School::listSchools();
- $actionvariable = &$this->addVariable(_("Schools"), 'school', 'enum', true, count($schoollist)>1 ? false : true, null, array($schoollist, _("Choose:")));
- if (count($schoollist) > 1) {
- require_once 'Horde/Form/Action.php';
- $actionvariable->setAction(Horde_Form_Action::factory('reload'));
- } else {
- $this->_vars->set('school', key($schoollist));
- }
-
- // Load the selected school
- if ($this->_vars->exists('school')) {
- $school = new Skoli_School($this->_vars->get('school'));
- foreach ($this->_schoolproperties as $name) {
- $school->addFormVariable($this, $name);
- }
- }
-
- $this->setSection('students', _("Students"));
-
- $this->addVariable(_("Address Book"), null, 'header', false);
-
- $addressbooklist = Skoli_School::listAddressBooks();
- $actionvariable = &$this->addVariable(_("Address Book"), 'address_book', 'enum', true, count($addressbooklist)>1 ? false : true, null, array($addressbooklist, _("Choose:")));
- if (count($addressbooklist) > 1) {
- require_once 'Horde/Form/Action.php';
- $actionvariable->setAction(Horde_Form_Action::factory('reload'));
- } else {
- $this->_vars->set('address_book', key($addressbooklist));
- }
-
- $this->addVariable(_("Students"), null, 'header', false);
-
- if ($this->_vars->get('address_book') != '') {
- $searchargs = array(
- 'addresses' => array(''),
- 'addressbooks' => array($this->_vars->get('address_book')),
- 'fields' => array()
- );
- if ($search_fields_pref = $prefs->getValue('search_fields')) {
- foreach (explode("\n", $search_fields_pref) as $s) {
- $s = trim($s);
- $s = explode("\t", $s);
- if (!empty($s[0]) && ($s[0] == $this->_vars->get('address_book'))) {
- $searchargs['fields'][array_shift($s)] = $s;
- break;
- }
- }
- }
- $resultstmp = $registry->call('contacts/search', $searchargs);
- // contacts/search seems to return an array entry for each source.
- $results = array();
- foreach ($resultstmp as $r) {
- $results = array_merge($results, $r);
- }
- foreach ($results as $address) {
- if (isset($address['__type']) && $address['__type'] == 'Object') {
- $addresses[$address['__key']] = $address[$conf['addresses']['name_field']];
- }
- }
- } else {
- $addresses = array();
- }
-
- $this->addVariable(_("Students"), 'students', 'multienum', false, false, null, array($addresses, 20));
-
- if ($conf['addresses']['contact_list'] != 'none' && $prefs->getValue('contact_list') != 'none') {
- $this->addVariable(_("Contact List"), null, 'header', false);
- if ($conf['addresses']['contact_list'] == 'user' && $prefs->getValue('contact_list') == 'ask') {
- $this->addVariable(_("Create Contact List?"), 'contact_list_create', 'boolean', true, false);
- if (!$this->_vars->exists('contact_list')) {
- $this->_vars->set('contact_list_create', true);
- }
- }
- $this->addVariable(_("Name"), 'contact_list', 'text', false,
- $conf['addresses']['contact_list'] == 'auto' || $prefs->getValue('contact_list') == 'auto' ? true : false, _("The substitutions %c, %g or %s will be replaced automatically by the class, grade respectively semester name."));
- if (!$this->_vars->exists('contact_list')) {
- $contactlist = $conf['addresses']['contact_list'] == 'auto' ? $conf['addresses']['contact_list_name'] : $prefs->getValue('contact_list_name');
- } else {
- $contactlist = $this->_vars->get('contact_list');
- }
- $this->_vars->set('contact_list', Skoli_School::parseContactListName($contactlist, $this->_vars));
- }
-
- $this->setButtons(array(_("Create")));
- }
-
- function execute()
- {
- global $conf, $prefs, $registry, $notification;
-
- /* Add new category. */
- if (strpos($this->_vars->get('category'), '*new*') !== false || $this->_vars->get('category') == $this->_vars->get('new_category')) {
- $cManager = new Horde_Prefs_CategoryManager();
- $cManager->add($this->_vars->get('new_category'));
- $this->_vars->set('category', $this->_vars->get('new_category'));
- }
-
- // Create new share.
- $this->shareid = strval(new Horde_Support_Uuid());
- $class = $GLOBALS['skoli_shares']->newShare($this->shareid);
- if (is_a($class, 'PEAR_Error')) {
- return $class;
- }
- $class->set('name', $this->_vars->get('name'));
- $class->set('desc', $this->_vars->get('description'));
- $class->set('category', $this->_vars->get('category'));
- $class->set('school', $this->_vars->get('school'));
- $class->set('address_book', $this->_vars->get('address_book'));
-
- require_once 'Horde/Date.php';
- foreach ($this->_schoolproperties as $property) {
- if ($property == 'start' || $property == 'end') {
- $date = new Horde_Date($this->_vars->get($property));
- $this->_vars->set($property, $date->datestamp());
- } else if ($property == 'marks' && $this->_vars->get($property . '_custom') != '') {
- $this->_vars->set($property, $this->_vars->get($property . '_custom'));
- }
- $class->set($property, $this->_vars->get($property) == '' ? null : $this->_vars->get($property));
- }
-
- $result = $GLOBALS['skoli_shares']->addShare($class);
-
- // Save students
- if ($this->_vars->exists('students') && $result) {
- $driver = &Skoli_Driver::singleton($this->shareid);
- $result = $driver->addStudents($this->_vars->get('students'));
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(_("Couldn't add the selected students to the class."), 'horde.warning');
- }
-
- // Add new contact list
- if ($conf['addresses']['contact_list'] != 'none' && $prefs->getValue('contact_list') != 'none' && $this->_vars->get('contact_list') != '') {
- $createlist = true;
- if ($conf['addresses']['contact_list'] == 'user' && $prefs->getValue('contact_list') == 'ask' && $this->_vars->get('contact_list_create') == '') {
- $createlist = false;
- }
- } else {
- $createlist = false;
- }
- if ($createlist) {
- $apiargs = array(
- 'content' => array(
- '__type' => 'Group',
- '__members' => serialize($this->_vars->get('students')),
- 'name' => Skoli_School::parseContactListName($this->_vars->get('contact_list'), $this->_vars, true),
- ),
- 'contentType' => 'array',
- 'source' => $this->_vars->get('address_book')
- );
-
- try {
- $registry->call('contacts/import', $apiargs);
- } catch (Horde_Exception $e) {
- $notification->push(sprintf(_("Couldn't create the contact list \"%s\"."), $this->_vars->get('contact_list')), 'horde.warning');
- }
- }
- }
-
- return $result;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Horde_Form for deleting classs.
- *
- * See the enclosed file LICENSE for license information (ASL). If you
- * did not receive this file, see http://www.horde.org/licenses/asl.php.
- *
- * @package Skoli
- */
-
-/** Horde_Form */
-require_once 'Horde/Form.php';
-
-/** Horde_Form_Renderer */
-require_once 'Horde/Form/Renderer.php';
-
-/**
- * The Skoli_DeleteClassForm class provides the form for
- * deleting a class.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- * @package Skoli
- */
-class Skoli_DeleteClassForm extends Horde_Form {
-
- /**
- * Class being deleted
- */
- var $_class;
-
- function Skoli_DeleteClassForm(&$vars, &$class)
- {
- $this->_class = &$class;
- parent::Horde_Form($vars, sprintf(_("Delete %s"), $class->get('name')));
-
- $this->addHidden('', 'c', 'text', true);
- $this->addVariable(sprintf(_("Really delete the class \"%s\"? This cannot be undone and all data on this class will be permanently removed."), $this->_class->get('name')), 'desc', 'description', false);
-
- $this->setButtons(array(_("Delete"), _("Cancel")));
- }
-
- function execute()
- {
- // If cancel was clicked, return false.
- if ($this->_vars->get('submitbutton') == _("Cancel")) {
- return false;
- }
-
- if (!$GLOBALS['registry']->getAuth() ||
- $this->_class->get('owner') != $GLOBALS['registry']->getAuth()) {
- return PEAR::raiseError(_("Permission denied"));
- }
-
- // Delete the class.
- $storage = &Skoli_Driver::singleton($this->_class->getName());
- $result = $storage->deleteAll();
- if (is_a($result, 'PEAR_Error')) {
- return PEAR::raiseError(sprintf(_("Unable to delete \"%s\": %s"), $this->_class->get('name'), $result->getMessage()));
- } else {
- // Remove share and all groups/permissions.
- $result = $GLOBALS['skoli_shares']->removeShare($this->_class);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- } else {
- // Remove class from the display list if it exists
- $key = array_search($this->_class->getName(), $GLOBALS['display_classes']);
- if ($key !== false) {
- unset($GLOBALS['display_classes'][$key]);
- $GLOBALS['prefs']->setValue('display_classes', serialize($GLOBALS['display_classes']));
- }
- }
- }
-
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Horde_Form for editing classs.
- *
- * See the enclosed file LICENSE for license information (ASL). If you
- * did not receive this file, see http://www.horde.org/licenses/asl.php.
- *
- * @package Skoli
- */
-
-/** Horde_Form */
-require_once 'Horde/Form.php';
-
-/** Horde_Form_Renderer */
-require_once 'Horde/Form/Renderer.php';
-
-/**
- * The Skoli_EditClassForm class provides the form for
- * editing a class.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- * @package Skoli
- */
-class Skoli_EditClassForm extends Horde_Form {
-
- /**
- * Class being edited
- */
- var $_class;
-
- /**
- * List of school properties.
- *
- * @var array
- */
- var $_schoolproperties = array(
- 'grade',
- 'semester',
- 'start',
- 'end',
- 'location',
- 'marks');
-
- function Skoli_EditClassForm(&$vars, &$class)
- {
- global $conf, $prefs, $registry;
-
- $this->_class = &$class;
-
- parent::Horde_Form($vars, sprintf(_("Edit %s"), $class->get('name')));
-
- $this->addHidden('', 'c', 'text', true);
-
- $this->setSection('properties', _("Properties"));
-
- $this->addVariable(_("General Settings"), null, 'header', false);
-
- $this->addVariable(_("Name"), 'name', 'text', true);
- $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
-
- $this->addVariable(_("Category"), 'category', 'category', false);
-
- $this->addVariable(_("School Specific Settings"), null, 'header', false);
-
- // Load Skoli_School
- require_once SKOLI_BASE . '/lib/School.php';
-
- // List schools
- $schoollist = Skoli_School::listSchools();
- $this->addVariable(_("School"), 'school', 'enum', true, true, null, array($schoollist, _("Choose:")));
-
- $school = new Skoli_School($this->_vars->get('school'));
- foreach ($this->_schoolproperties as $name) {
- $school->addFormVariable($this, $name);
- }
-
- $this->setSection('students', _("Students"));
-
- $this->addVariable(_("Address Book"), null, 'header', false);
-
- $addressbooklist = Skoli_School::listAddressBooks(true);
- $actionvariable = &$this->addVariable(_("Address Book"), 'address_book', 'enum', true, count($addressbooklist)>1 ? false : true, null, array($addressbooklist, _("Choose:")));
- if (count($addressbooklist) > 1) {
- require_once 'Horde/Form/Action.php';
- $actionvariable->setAction(Horde_Form_Action::factory('reload'));
- } else {
- $this->_vars->set('address_book', key($addressbooklist));
- }
-
- $this->addVariable(_("Students"), null, 'header', false);
-
- if ($this->_vars->get('address_book') != '') {
- $searchargs = array(
- 'addresses' => array(''),
- 'addressbooks' => array($this->_vars->get('address_book')),
- 'fields' => array()
- );
- if ($search_fields_pref = $prefs->getValue('search_fields')) {
- foreach (explode("\n", $search_fields_pref) as $s) {
- $s = trim($s);
- $s = explode("\t", $s);
- if (!empty($s[0]) && ($s[0] == $this->_vars->get('address_book'))) {
- $searchargs['fields'][array_shift($s)] = $s;
- break;
- }
- }
- }
- $resultstmp = $registry->call('contacts/search', $searchargs);
- // contacts/search seems to return an array entry for each source.
- $results = array();
- foreach ($resultstmp as $r) {
- $results = array_merge($results, $r);
- }
- foreach ($results as $address) {
- if (isset($address['__type']) && $address['__type'] == 'Object') {
- $addresses[$address['__key']] = $address[$conf['addresses']['name_field']];
- }
- }
- } else {
- $addresses = array();
- }
-
- $this->addVariable(_("Students"), 'students', 'multienum', false, false, null, array($addresses, 20));
-
- $this->setButtons(array(_("Save")));
- }
-
- function execute()
- {
- global $conf, $prefs, $registry, $notification;
-
- /* Add new category. */
- if (strpos($this->_vars->get('category'), '*new*') !== false || $this->_vars->get('category') == $this->_vars->get('new_category')) {
- $cManager = new Horde_Prefs_CategoryManager();
- $cManager->add($this->_vars->get('new_category'));
- $this->_vars->set('category', $this->_vars->get('new_category'));
- }
-
- $this->_class->set('name', $this->_vars->get('name'));
- $this->_class->set('desc', $this->_vars->get('description'));
- $this->_class->set('category', $this->_vars->get('category'));
- $this->_class->set('address_book', $this->_vars->get('address_book'));
-
- require_once 'Horde/Date.php';
- foreach ($this->_schoolproperties as $property) {
- if ($property == 'start' || $property == 'end') {
- $date = new Horde_Date($this->_vars->get($property));
- $this->_vars->set($property, $date->datestamp());
- } else if ($property == 'marks' && $this->_vars->get($property . '_custom') != '') {
- $this->_vars->set($property, $this->_vars->get($property . '_custom'));
- }
- $this->_class->set($property, $this->_vars->get($property) == '' ? null : $this->_vars->get($property));
- }
-
- // Save students
- $driver = &Skoli_Driver::singleton($this->_vars->get('c'));
- $result = $driver->addStudents($this->_vars->get('students'));
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(_("Couldn't add the selected students to the class."), 'horde.warning');
- }
-
- $result = $this->_class->save();
- if (is_a($result, 'PEAR_Error')) {
- return PEAR::raiseError(sprintf(_("Unable to save class \"%s\": %s"), $id, $result->getMessage()));
- }
- return true;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Horde_Form for adding and updateing entries.
- *
- * See the enclosed file LICENSE for license information (ASL). If you
- * did not receive this file, see http://www.horde.org/licenses/asl.php.
- *
- * @package Skoli
- */
-
-/** Horde_Form */
-require_once 'Horde/Form.php';
-
-/** Horde_Form_Renderer */
-require_once 'Horde/Form/Renderer.php';
-
-/**
- * The Skoli_EntryForm class provides the form for
- * adding and updateing a new entry.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- * @package Skoli
- */
-class Skoli_EntryForm extends Horde_Form {
-
- function Skoli_EntryForm(&$vars)
- {
- global $conf, $prefs, $registry;
-
- $update = $vars->exists('entry') && $vars->exists('view');
-
- if ($vars->get('view') != 'Entry') {
- parent::Horde_Form($vars, $update ? _("Update Entry") : _("Add Entry"));
- } else {
- parent::Horde_Form($vars);
- }
-
- if ($update) {
- $this->addHidden('', 'entry', 'text', true);
- $this->addHidden('', 'view', 'text', true);
- }
-
- $classes = Skoli::listClasses(false, Horde_Perms::EDIT);
- $classes_enums = array();
- foreach ($classes as $class) {
- if ($class->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
- $classes_enums[$class->getName()] = $class->get('name');
- }
- }
-
- if (!$this->_vars->exists('class_id') && $vars->exists('class')) {
- $this->_vars->set('class_id', $vars->get('class'));
- if (!$this->_vars->exists('student_id') && $vars->exists('student')) {
- $this->_vars->set('student_id', array($vars->get('student')));
- } else {
- $this->_vars->set('student_id', array());
- }
- }
-
- // List classes
- $actionvariable = &$this->addVariable(_("Class"), 'class_id', 'enum', true, count($classes)>1 ? false : true, null, array($classes_enums, _("Choose:")));
- if (count($classes) > 1) {
- require_once 'Horde/Form/Action.php';
- $actionvariable->setAction(Horde_Form_Action::factory('reload'));
- } else {
- reset($classes);
- $this->addHidden('', 'class_id', 'text', true);
- $this->_vars->set('class_id', key($classes));
- }
-
- // Load the selected students
- if ($this->_vars->get('class_id') != '') {
- $class = current(Skoli::listStudents($vars->get('class_id')));
- foreach ($class['_students'] as $address) {
- $addresses[$address['student_id']] = $address[$conf['addresses']['name_field']];
- }
- if ($update) {
- $this->addVariable(_("Student"), 'student_id', 'enum', true, false, null, array($addresses));
- } else {
- $this->addVariable(_("Student"), 'student_id', 'multienum', true, false, null, array($addresses, 14));
- }
- } else {
- $addresses = array();
- }
-
- $this->addVariable(_("Date"), 'object_time', 'monthdayyear', true, false, null, array(date('Y') - 10));
- if (!$this->_vars->exists('object_time')) {
- $date = new Horde_Date(time());
- $this->_vars->set('object_time', array('month' => $date->month, 'day' => $date->mday, 'year' => $date->year));
- }
-
- // Load last type from preferences
- if (!$this->_vars->exists('object_type')) {
- $this->_vars->set('object_type', $prefs->getValue('default_objects_format'));
- }
- if ($conf['objects']['allow_marks']) {
- $types['mark'] = _("Mark");
- }
- if ($conf['objects']['allow_objectives']) {
- $types['objective'] = _("Objective");
- }
- if ($conf['objects']['allow_outcomes']) {
- $types['outcome'] = _("Outcome");
- }
- if ($conf['objects']['allow_absences']) {
- $types['absence'] = _("Absence");
- }
- $actionvariable = &$this->addVariable(_("Type"), 'object_type', 'radio', true, false, null, array($types));
- require_once 'Horde/Form/Action.php';
- $actionvariable->setAction(Horde_Form_Action::factory('reload'));
-
- if ($this->_vars->get('object_type') != '' && $this->_vars->get('class_id') != '') {
- switch ($this->_vars->get('object_type')) {
-
- case 'mark':
- $this->addVariable(_("Title"), 'attribute_title', 'text', true, false);
- switch ($class['marks']) {
- case 'numbers':
- $this->addVariable(_("Mark"), 'attribute_mark', 'number', true, false, _("Mark in numbers"));
- break;
-
- case 'percent':
- $this->addVariable(_("Mark"), 'attribute_mark', 'number', true, false, _("Mark in percent"));
- break;
-
- default:
- $marks_enums = preg_split('/\s*,\s*/', $class['marks']);
- $this->addVariable(_("Mark"), 'attribute_mark', 'enum', true, false, null, array(array_combine($marks_enums, $marks_enums), _("Choose:")));
- }
- // Load Skoli_School
- require_once SKOLI_BASE . '/lib/School.php';
- $school = new Skoli_School($class['school']);
- $school->addFormVariable($this, 'subject', array(true));
- $this->addVariable(_("Weight"), 'attribute_weight', 'number', true, false);
- if (!$this->_vars->exists('attribute_weight')) {
- $this->_vars->set('attribute_weight', 1);
- }
- break;
-
- case 'objective':
- // Load Skoli_School
- require_once SKOLI_BASE . '/lib/School.php';
- $school = new Skoli_School($class['school']);
- $school->addFormVariable($this, 'subject', array(false, true));
- $school->addFormVariable($this, 'category', array($this->_vars->get('attribute_subject')));
- $this->addVariable(_("Objective"), 'attribute_objective', 'longtext', true, false, null, array(4, 60));
- break;
-
- case 'outcome':
- $this->addVariable(_("Outcome"), 'attribute_outcome', 'longtext', true, false, null, array(2, 60));
- $this->addVariable(_("Completed?"), 'attribute_completed', 'boolean', true, false);
- $this->addVariable(_("Comment"), 'attribute_comment', 'longtext', false, false, null, array(4, 60));
- break;
-
- case 'absence':
- $this->addVariable(_("Absence"), 'attribute_absence', 'number', true, false, _("Absence in number of lessons"));
- $this->addVariable(_("Excused?"), 'attribute_excused', 'boolean', true, false);
- if (!$this->_vars->exists('attribute_absence')) {
- $this->_vars->set('attribute_excused', true);
- }
- $this->addVariable(_("Comment"), 'attribute_comment', 'longtext', false, false, null, array(4, 60));
- break;
- }
- }
-
- $this->setButtons(array($update ? _("Save") : _("Add")));
- }
-
- function execute()
- {
- global $conf, $prefs, $registry, $notification;
-
- // Save last type to preferences
- $prefs->setValue('default_objects_format', $this->_vars->get('object_type'));
-
- $driver = &Skoli_Driver::singleton($this->_vars->get('class_id'));
- $result = $driver->addEntry($this->_vars);
- if (is_a($result, 'PEAR_Error')) {
- $notification->push(_("Couldn't add the new entry."), 'horde.warning');
- }
-
- return $result;
- }
-}
+++ /dev/null
-<?php
-/**
- * Skoli School Class.
- *
- * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- * @package Skoli
- */
-class Skoli_School {
-
- /**
- * School list from template.
- *
- * @var array
- */
- public static $schools;
-
- /**
- * Current school from template.
- *
- * @var array
- */
- var $school;
-
- /**
- * Load the school list from template.
- */
- function Skoli_School($schoolName)
- {
- self::_loadSchools();
- if (!isset(self::$schools[$schoolName]) || !is_array(self::$schools[$schoolName])) {
- return PEAR::raiseError(sprintf(_("Error loading the school \"%s\" from template."), $schoolName));
- } else {
- $this->school = self::$schools[$schoolName];
- }
- }
-
- /**
- * Adds a variable to the current form.
- *
- * @param Horde_Form $form The current form.
- *
- * @param string $property The property to add.
- *
- * @param array $params Property dependent parameters.
- */
- function addFormVariable(&$form, $property, $params = array())
- {
- switch ($property) {
- case 'start':
- case 'end':
- $form->addVariable(_(ucfirst($property)), $property, 'monthdayyear', true, false, null, array(date('Y') - 10));
- if ($form->_vars->exists('semester') && isset($this->school['semester']) && is_array($this->school['semester'])) {
- foreach ($this->school['semester'] as $semester) {
- if ($semester['name'] == $form->_vars->get('semester')) {
- $activesemester = $semester;
- break;
- }
- }
- $datevars = $form->_vars->get($property);
- if (isset($activesemester[$property]) && empty($datevars['day'])) {
- require_once 'Horde/Date.php';
- if ($property == 'start') {
- $startdate = 0;
- } else {
- $startdate = new Horde_Date($form->_vars->get('start'));
- $startdate = $startdate->datestamp();
- }
- $date = new Horde_Date($this->_getSemesterTime($activesemester[$property], $startdate));
- $form->_vars->set($property, array('month' => $date->month, 'day' => $date->mday, 'year' => $date->year));
- }
- }
- break;
-
- case 'marks':
- $marksformat = array(
- 'numbers' => _("Format in numbers"),
- 'percent' => _("Format in percent"),
- 'custom' => _("Custom format:")
- );
- if (isset($this->school[$property])) {
- $form->_vars->set($property, $this->school[$property]);
- if (!isset($marksformat[$this->school[$property]])) {
- $marksformat['custom'] .= ' ' . $this->school[$property];
- $marksformat[$this->school[$property]] = $marksformat['custom'];
- unset($marksformat['custom']);
- }
- $form->addVariable(_(ucfirst($property)), $property, 'enum', true, true, null, array($marksformat, _("Choose:")));
- } else {
- require_once 'Horde/Form/Action.php';
- if ($form->_vars->exists($property) && !isset($marksformat[$form->_vars->get($property)])) {
- $form->_vars->set($property . '_custom', $form->_vars->get($property));
- $form->_vars->set($property, 'custom');
- }
- $actionvariable = &$form->addVariable(_(ucfirst($property)), $property, 'enum', true, false, null, array($marksformat, _("Choose:")));
- $actionvariable->setAction(Horde_Form_Action::factory('reload'));
- if ($form->_vars->get($property) == 'custom') {
- $form->addVariable('', $property . '_custom', 'text', true, false, _("List with custom marks separated by comma (best mark first)"));
- }
- }
- break;
-
- case 'subject':
- $obligatory = isset($params[0]) ? $params[0] : true;
- $onlywithobjectives = isset($params[1]) ? $params[1] : false;
- if (isset($this->school['subjects'])) {
- $values = array();
- foreach ($this->school['subjects'] as $key=>$value) {
- if (!$onlywithobjectives || ($onlywithobjectives && is_array($value))) {
- $subject = is_array($value) ? $key : $value;
- $values[$subject] = $subject;
- }
- }
- if ($onlywithobjectives) {
- if (count($values) > 0) {
- require_once 'Horde/Form/Action.php';
- $actionvariable = &$form->addVariable(_(ucfirst($property)), 'attribute_subject', 'enum', $obligatory, false, null, array(array_merge(array(_("Interdisciplinary")=>_("Interdisciplinary")), $values)));
- $actionvariable->setAction(Horde_Form_Action::factory('reload'));
- } else {
- $form->addVariable(_(ucfirst($property)), 'attribute_subject', 'text', true, true);
- $form->_vars->set('attribute_subject', _("Interdisciplinary"));
- }
- } else {
- $form->addVariable(_(ucfirst($property)), 'attribute_subject', 'enum', $obligatory, false, null, array($values, _("Choose:")));
- }
- } else {
- $form->addVariable(_(ucfirst($property)), 'attribute_subject', 'text', $obligatory, false);
- }
- break;
-
- case 'category':
- $subject = !empty($params[0]) ? $params[0] : _("Interdisciplinary");
- if ($subject != _("Interdisciplinary") && isset($this->school['subjects'][$subject]) && is_array($this->school['subjects'][$subject])) {
- $values = array();
- foreach ($this->school['subjects'][$subject] as $value) {
- $values[$value] = $value;
- }
- $form->addVariable(_(ucfirst($property)), 'attribute_category', 'enum', true, false, null, array($values, _("Choose:")));
- } else if ($subject == _("Interdisciplinary") && isset($this->school['objectives'])) {
- $values = array();
- foreach ($this->school['objectives'] as $value) {
- $values[$value] = $value;
- }
- $form->addVariable(_(ucfirst($property)), 'attribute_category', 'enum', true, false, null, array($values, _("Choose:")));
- } else {
- $form->addVariable(_(ucfirst($property)), 'attribute_category', 'text', true, false);
- }
- break;
-
- default:
- if (isset($this->school[$property]) && is_array($this->school[$property])) {
- if (count($this->school[$property]) > 1) {
- $values = array();
- foreach ($this->school[$property] as $value) {
- $key = is_array($value) ? $value['name'] : $value;
- $values[$key] = $key;
- }
- if (is_array(current($this->school[$property]))) {
- require_once 'Horde/Form/Action.php';
- $actionvariable = &$form->addVariable(_(ucfirst($property)), $property, 'enum', false, false, null, array($values, _("Choose:")));
- $actionvariable->setAction(Horde_Form_Action::factory('reload'));
- } else {
- $form->addVariable(_(ucfirst($property)), $property, 'enum', false, false, null, array($values, _("Choose:")));
- }
- } else {
- $form->addVariable(_(ucfirst($property)), $property, 'text', false, true);
- $value = current($this->school[$property]);
- $form->_vars->set($property, is_array($value) ? $value['name'] : $value);
- }
- } else {
- $form->addVariable(_(ucfirst($property)), $property, 'text', false, false);
- }
- }
- }
-
- /**
- * Returns a timestamp for the specified semester start- or enddate.
- *
- * @param mixed The dateformat specified in conf/schools.php for this date.
- *
- * @return int The timestamp.
- */
- private function _getSemesterTime($format, $startdate)
- {
- if (is_int($format)) {
- // Timestamp format
- $timestamp = $format;
- } else if (preg_match('/^W([0-9]{2})\-[0-9]$/', $format, $m)) {
- $year = date('Y');
- if (date('W') > $m[1]) {
- $year++;
- }
- $timestamp = strtotime($year . '-' . $format);
- } else {
- $timestamp = strtotime($format);
- }
- if (is_int($timestamp) && $timestamp > 0) {
- if ($startdate >= $timestamp) {
- $timestamp = strtotime('+1 year', $timestamp);
- }
- return $timestamp;
- } else {
- return '';
- }
- }
-
- /**
- * Returns all schools specified in conf/schools.php.
- *
- * @return array The school list.
- */
- public static function listSchools()
- {
- self::_loadSchools();
- $schools = array();
- foreach (self::$schools as $key=>$val) {
- $schools[$key] = $val['title'];
- }
- return $schools;
- }
-
- /**
- * Loads the schools specified in conf/schools.php
- */
- private static function _loadSchools()
- {
- if (!isset(self::$schools)) {
- require_once SKOLI_BASE . '/config/schools.php';
- self::$schools = $cfgSchools;
- }
- }
-
- /**
- * Returns all addressbooks skoli is defined to use.
- *
- * @param boolean $all If set to true return all addressbooks a user has access to.
- *
- * @return array The address book list.
- */
- public static function listAddressBooks($all = false)
- {
- global $conf, $prefs, $registry;
-
- $addressbooks = $registry->call('contacts/sources');
-
- if (!$all && $conf['addresses']['storage'] == 'custom') {
- if (isset($addressbooks[$conf['addresses']['address_book']])) {
- $addressbooks = array($conf['addresses']['address_book'] => $addressbooks[$conf['addresses']['address_book']]);
- } else {
- $addressbooks = array();
- }
- }
-
- return $addressbooks;
- }
-
- /**
- * Returns the parsed contact list name.
- *
- * @param string $contactlist The contact list name to parse.
- *
- * @param Horde_Variables $vars The variables to use as replacement.
- *
- * @param boolean $force If set to true also replaces empty fields.
- *
- * @return string The parsed contact list name.
- */
- public static function parseContactListName($contactlist, $vars, $force = false)
- {
- $contactlistsubs = array(
- '%c' => 'name',
- '%g' => 'grade',
- '%s' => 'semester'
- );
- foreach ($contactlistsubs as $pattern=>$field) {
- if (strpos($contactlist, $pattern) !== false && ($vars->get($field) != '' || $force)) {
- $contactlist = str_replace($pattern, $vars->get($field), $contactlist);
- }
- }
- return $contactlist;
- }
-
-}
+++ /dev/null
-<?php
-/**
- * Sort by student or class name.
- */
-define('SKOLI_SORT_NAME', 'name');
-
-/**
- * Sort by last entry date.
- */
-define('SKOLI_SORT_LASTENTRY', 'lastentry');
-
-/**
- * Sort by mark average.
- */
-define('SKOLI_SORT_SUMMARKS', 'summarks');
-
-/**
- * Sort by absences.
- */
-define('SKOLI_SORT_SUMABSENCES', 'sumabsences');
-
-/**
- * Sort by semester start date.
- */
-define('SKOLI_SORT_SEMESTERSTART', 'semesterstart');
-
-/**
- * Sort by semester end date.
- */
-define('SKOLI_SORT_SEMESTEREND', 'semesterend');
-
-/**
- * Sort by grade.
- */
-define('SKOLI_SORT_GRADE', 'grade');
-
-/**
- * Sort by semester.
- */
-define('SKOLI_SORT_SEMESTER', 'semester');
-
-/**
- * Sort by location.
- */
-define('SKOLI_SORT_LOCATION', 'location');
-
-/**
- * Sort by category.
- */
-define('SKOLI_SORT_CATEGORY', 'category');
-
-/**
- * Sort by entry class name.
- */
-define('SKOLI_SORT_CLASS', 'class');
-
-/**
- * Sort by entry student name.
- */
-define('SKOLI_SORT_STUDENT', 'student');
-
-/**
- * Sort by entry date.
- */
-define('SKOLI_SORT_DATE', 'date');
-
-/**
- * Sort by entry type.
- */
-define('SKOLI_SORT_TYPE', 'type');
-
-/**
- * Sort in ascending order.
- */
-define('SKOLI_SORT_ASCEND', 0);
-
-/**
- * Sort in descending order.
- */
-define('SKOLI_SORT_DESCEND', 1);
-
-/**
- * Skoli Base Class.
- *
- * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- * @package Skoli
- */
-class Skoli {
-
- /**
- * Initial app setup code.
- */
- function initialize()
- {
- // Update the preference for what classes to display. If the user
- // doesn't have any selected class then do nothing.
- $GLOBALS['display_classes'] = @unserialize($GLOBALS['prefs']->getValue('display_classes'));
- if (!$GLOBALS['display_classes']) {
- $GLOBALS['display_classes'] = array();
- }
- if (($classId = Horde_Util::getFormData('display_class')) !== null) {
- if (is_array($classId)) {
- $GLOBALS['display_classes'] = $classId;
- } else {
- if (in_array($classId, $GLOBALS['display_classes'])) {
- $key = array_search($classId, $GLOBALS['display_classes']);
- unset($GLOBALS['display_classes'][$key]);
- } else {
- $GLOBALS['display_classes'][] = $classId;
- }
- }
- $GLOBALS['prefs']->setValue('show_students', Horde_Util::getFormData('show_students') ? 1 : 0);
- }
-
- $GLOBALS['prefs']->setValue('display_classes', serialize($GLOBALS['display_classes']));
- }
-
- /**
- * Returns all classes a user has access to, according to several
- * parameters/permission levels.
- *
- * @param boolean $owneronly Only return classes that this user owns?
- * Defaults to false.
- * @param integer $permission The permission to filter classes by.
- *
- * @return array The class list.
- */
- function listClasses($owneronly = false, $permission = Horde_Perms::SHOW)
- {
- if ($owneronly && !$GLOBALS['registry']->getAuth()) {
- return array();
- }
-
- $classes = $GLOBALS['skoli_shares']->listShares($GLOBALS['registry']->getAuth(), $permission, $owneronly ? $GLOBALS['registry']->getAuth() : null, 0, 0, 'name');
- if (is_a($classes, 'PEAR_Error')) {
- Horde::logMessage($classes, 'ERR');
- return array();
- }
-
- // Check if we have access to the attached addressbook.
- $addressbooks = $GLOBALS['registry']->call('contacts/sources');
- foreach ($classes as $key=>$val) {
- if (!isset($addressbooks[$val->get('address_book')])) {
- unset($classes[$key]);
- }
- }
-
- return $classes;
- }
-
- /**
- * Retrieves the current user's student list from storage.
- *
- * This function will also sort the resulting list, if requested.
- *
- * @param array $classes An array of classes to display, a
- * single classname or null/empty to
- * display classes $GLOBALS['display_classes'].
- * @param string $sortby_student The field by which to sort
- * (SKOLI_SORT_PRIORITY, SKOLI_SORT_NAME
- * SKOLI_SORT_DUE, SKOLI_SORT_COMPLETION).
- * @param integer $sortdir_student The direction by which to sort
- * (SKOLI_SORT_ASCEND, SKOLI_SORT_DESCEND).
- * @param string $sortby_class The field by which to sort
- * (SKOLI_SORT_PRIORITY, SKOLI_SORT_NAME
- * SKOLI_SORT_DUE, SKOLI_SORT_COMPLETION).
- * @param integer $sortdir_class The direction by which to sort
- * (SKOLI_SORT_ASCEND, SKOLI_SORT_DESCEND).
- *
- * @return array A list of the requested classes with students.
- */
- function listStudents($classes = null,
- $sortby_student = null,
- $sortdir_student = null,
- $sortby_class = null,
- $sortdir_class = null)
- {
- global $prefs, $registry;
-
- if (is_null($classes)) {
- $classes = $GLOBALS['display_classes'];
- } else if (!is_array($classes)) {
- $classes = array($classes);
- }
- if (is_null($sortby_student)) {
- $sortby_student = $prefs->getValue('sortby_student');
- }
- if (is_null($sortdir_student)) {
- $sortdir_student = $prefs->getValue('sortdir_student');
- }
- if (is_null($sortby_class)) {
- $sortby_class = $prefs->getValue('sortby_class');
- }
- if (is_null($sortdir_class)) {
- $sortdir_class = $prefs->getValue('sortdir_class');
- }
-
- $list = array();
- $i = 0;
- $addressbooks = $registry->call('contacts/sources');
- foreach ($classes as $class) {
- /* Get all data about the shared class */
- $share = $GLOBALS['skoli_shares']->getShare($class);
-
- /* Check permissions */
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ) || !isset($addressbooks[$share->get('address_book')])) {
- continue;
- }
-
- $list[$i] = $share->datatreeObject->data;
- $list[$i]['_id'] = $class;
- $list[$i]['_edit'] = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
-
- /* Add all students to the list */
- $driver = &Skoli_Driver::singleton($class);
- $list[$i]['_students'] = $driver->getStudents();
- $student_columns = @unserialize($prefs->getValue('student_columns'));
- foreach ($list[$i]['_students'] as $key=>$student) {
- $studentdetails = Skoli::getStudent($list[$i]['address_book'], $student['student_id']);
- if (count($studentdetails) > 0) {
- $list[$i]['_students'][$key] += $studentdetails;
- if (in_array('lastentry', $student_columns)) {
- $list[$i]['_students'][$key]['_lastentry'] = $driver->lastEntry($student['student_id']);
- }
- if (in_array('summarks', $student_columns)) {
- $list[$i]['_students'][$key]['_summarks'] = Skoli::sumMarks($class, $student['student_id']);
- }
- if (in_array('sumabsences', $student_columns)) {
- $list[$i]['_students'][$key]['_sumabsences'] = Skoli::sumAbsences($class, $student['student_id']);
- }
- } else {
- unset($list[$i]['_students'][$key]);
- }
- }
- $i++;
- }
-
- /* Sort the array if we have a sort function defined for this
- * field. */
- $prefix = ($sortdir_class == SKOLI_SORT_DESCEND) ? '_rsort' : '_sort';
- usort($list, array('Skoli', $prefix . '_class_' . $sortby_class));
- $prefix = ($sortdir_student == SKOLI_SORT_DESCEND) ? '_rsort' : '_sort';
- for ($i = 0; $i < count($list); $i++) {
- usort($list[$i]['_students'], array('Skoli', $prefix . '_student_' . $sortby_student));
- }
-
- return $list;
- }
-
- /**
- * Retrieves all data about a student.
- *
- * @param string $addressbook The addressbook.
- *
- * @param string $id An ID from the student contact.
- *
- * @return array A list with the data from the requested student.
- */
- function getStudent($addressbook, $id)
- {
- global $registry;
-
- $student = array();
- $apiargs = array(
- 'source' => $addressbook,
- 'objectId' => $id
- );
- try {
- $student = $registry->call('contacts/getContact', $apiargs);
- } catch (Horde_Exception $e) {
- $notification->push(sprintf(_("Couldn't create the contact list \"%s\"."), $this->_vars->get('contact_list')), 'horde.info');
- }
- return $student;
- }
-
- /**
- * Retrieves a sorted entry list from storage.
- *
- * @param string $classid The class ID.
- *
- * @param string $studentid The student ID.
- *
- * @param string $type The entry type to search in.
- *
- * @param array $searchparams Some additional search parameters.
- *
- * @param string $sortby The field by which to sort
- * (SKOLI_SORT_CLASS, SKOLI_SORT_STUDENT
- * SKOLI_SORT_DATE, SKOLI_SORT_TYPE).
- * @param integer $sortdir The direction by which to sort
- * (SKOLI_SORT_ASCEND, SKOLI_SORT_DESCEND).
- *
- * @return array Sorted list with all entries.
- */
- function listEntries($classid = null,
- $studentid = null,
- $type = null,
- $searchparams = array(),
- $sortby = null,
- $sortdir = null)
- {
- global $conf, $prefs, $registry;
-
- $dateFormat = $prefs->getValue('date_format');
- $entryTypes = array(
- 'mark' => _("Mark"),
- 'objective' => _("Objective"),
- 'outcome' => _("Outcome"),
- 'absence' => _("Absence")
- );
-
- if (is_null($classid)) {
- $classes = Skoli::listClasses();
- } else {
- $share = $GLOBALS['skoli_shares']->getShare($classid);
- $classes = array($classid => $share);
- }
-
- if (is_null($sortby)) {
- $sortby = SKOLI_SORT_CLASS;
- }
- if (is_null($sortdir)) {
- $sortdir = SKOLI_SORT_ASCEND;
- }
-
- $entrylist = array();
- $i = 0;
- $addressbooks = $registry->call('contacts/sources');
- foreach ($classes as $class_id=>$share) {
- /* Check permissions */
- if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ) || !isset($addressbooks[$share->get('address_book')])) {
- continue;
- }
-
- $share_permissions_edit = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
- $share_permissions_delete = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE);
-
- $driver = &Skoli_Driver::singleton($class_id);
- $entries = $driver->getEntries($studentid, $type, $searchparams);
- foreach ($entries as $student) {
- $studentdetails = Skoli::getStudent($share->get('address_book'), $student['student_id']);
- foreach ($student['_entries'] as $entry) {
- $entrylist[$i] = $entry['_attributes'];
- $entrylist[$i]['class'] = $share->get('name');
- $entrylist[$i]['classid'] = $class_id;
- $entrylist[$i]['student'] = $studentdetails[$conf['addresses']['name_field']];
- $entrylist[$i]['date'] = strftime($dateFormat, $entry['object_time']);
- $entrylist[$i]['timestamp'] = $entry['object_time'];
- $entrylist[$i]['typename'] = $entryTypes[$entry['object_type']];
- $entrylist[$i]['type'] = $entry['object_type'];
- $entrylist[$i]['_edit'] = $share_permissions_edit;
- $entrylist[$i]['_delete'] = $share_permissions_delete;
- $entrylist[$i]['_id'] = $entry['object_id'];
- $i++;
- }
- }
- }
-
- /* Sort the array if we have a sort function defined for this
- * field. */
- $prefix = ($sortdir == SKOLI_SORT_DESCEND) ? '_rsort' : '_sort';
- usort($entrylist, array('Skoli', $prefix . '_entry_' . $sortby));
-
- return $entrylist;
- }
-
- /**
- * Sum up all excused and not excused absences for a given student.
- *
- * @param string $classid An ID from the class.
- *
- * @param string $studentid An ID from the student contact.
- *
- * @return array A list with the requested data.
- */
- function sumAbsences($classid, $studentid)
- {
- $driver = &Skoli_Driver::singleton($classid);
- $entries = current($driver->getEntries($studentid, 'absence'));
-
- $excused = 0;
- $notexcused = 0;
- foreach($entries['_entries'] as $entry) {
- $entry['_attributes']['absence'] = Skoli::convertNumber($entry['_attributes']['absence']);
- if (empty($entry['_attributes']['excused'])) {
- $notexcused += $entry['_attributes']['absence'];
- } else {
- $excused += $entry['_attributes']['absence'];
- }
- }
-
- return array($excused, $notexcused, $excused + $notexcused);
- }
-
- /**
- * Sum up all completed and open outcomes for a given student.
- *
- * @param string $classid An ID from the class.
- *
- * @param string $studentid An ID from the student contact.
- *
- * @return array A list with the requested data.
- */
- function sumOutcomes($classid, $studentid)
- {
- $driver = &Skoli_Driver::singleton($classid);
- $entries = current($driver->getEntries($studentid, 'outcome'));
-
- $completed = 0;
- $open = 0;
- foreach($entries['_entries'] as $entry) {
- if (empty($entry['_attributes']['completed'])) {
- $open++;
- } else {
- $completed++;
- }
- }
-
- return array($completed, $open, $completed + $open);
- }
-
- /**
- * Sum up all marks for a given student.
- *
- * @param string $classid An ID from the class.
- *
- * @param string $studentid An ID from the student contact.
- *
- * @param string $subject Only sum up marks from this subject.
- *
- * @return float The requested data.
- */
- function sumMarks($classid, $studentid, $subject = null)
- {
- global $prefs;
-
- $driver = &Skoli_Driver::singleton($classid);
- if (!is_null($subject)) {
- $params = array(array('name' => 'subject', 'value' => $subject, 'strict' => 1));
- } else {
- $params = null;
- }
- $entries = current($driver->getEntries($studentid, 'mark', $params));
-
- /* Count weights */
- $totalweight = 0;
- foreach($entries['_entries'] as $entry) {
- $totalweight += Skoli::convertNumber($entry['_attributes']['weight']);
- }
-
- if ($totalweight <= 0) {
- return '';
- }
-
- $sum = 0;
- $weight = 100 / $totalweight;
- foreach($entries['_entries'] as $entry) {
- $sum += $weight * Skoli::convertNumber($entry['_attributes']['weight']) * Skoli::convertNumber($entry['_attributes']['mark']);
- }
-
- if ($sum > 0) {
- return round($sum / 100, $prefs->getValue('marks_roundby'));
- } else {
- return '';
- }
- }
-
- /**
- * Converts numbers with a comma to a valid php number.
- *
- * @param string $number The number to convert.
- *
- * @return string The converted number
- */
- function convertNumber($number)
- {
- $number = str_replace(',', '.', $number);
- return $number;
- }
-
- /**
- * Build Skoli's list of menu items.
- */
- function getMenu()
- {
- global $conf, $registry, $browser, $print_link;
-
- $menu = new Horde_Menu(Horde_Menu::MASK_ALL);
- $menu->add(Horde::url('list.php'), _("List Classes"), 'skoli.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
- if (count(Skoli::listClasses(false, Horde_Perms::EDIT))) {
- $menu->add(Horde::url('add.php'), _("_New Entry"), 'add.png', null, null, null, Horde_Util::getFormData('entry') ? '__noselection' : null);
- }
-
- /* Search. */
- $menu->add(Horde::url('search.php'), _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'));
-
- /* Import/Export. */
- if ($conf['menu']['export']) {
- $menu->add(Horde::url('data.php'), _("_Export"), 'data.png', Horde_Themes::img(null, 'horde'));
- }
-
- // @TODO Implement an easy form to create timetables in e.g. Kronolith
- /* Timetable.
- * Show this item only if an application provides 'calendar/show' and we have permissions to view it.
- $app = $registry->hasMethod('calendar/show');
- if ($app !== false && $registry->get('status', $app) != 'inactive' && $registry->hasPermission($app, Horde_Perms::EDIT)) {
- $menu->add(Horde::url(Horde_Util::addParameter('timetable.php', 'actionID', 'new_timetable')), _("_New Timetable"), 'timetable.png');
- }
- */
-
- return $menu;
- }
-
- /**
- * Comparison function for sorting classes by semester start date.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer 1 if class one is greater, -1 if class two is greater;
- * 0 if they are equal.
- */
- function _sort_class_semesterstart($a, $b)
- {
- if ($a['start'] == $b['start'] ) {
- return 0;
- }
-
- // Treat empty start dates as farthest into the future.
- if ($a['start'] == 0) {
- return 1;
- }
- if ($b['start'] == 0) {
- return -1;
- }
-
- return ($a['start'] > $b['start']) ? 1 : -1;
- }
-
- /**
- * Comparison function for reverse sorting classes by semester start date.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer -1 if class one is greater, 1 if class two is greater,
- * 0 if they are equal.
- */
- function _rsort_class_semesterstart($a, $b)
- {
- if ($a['start'] == $b['start']) {
- return 0;
- }
-
- // Treat empty start dates as farthest into the future.
- if ($a['start'] == 0) {
- return -1;
- }
- if ($b['start'] == 0) {
- return 1;
- }
-
- return ($a['start'] < $b['start']) ? 1 : -1;
- }
-
- /**
- * Comparison function for sorting classes by semester end date.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer 1 if class one is greater, -1 if class two is greater;
- * 0 if they are equal.
- */
- function _sort_class_semesterend($a, $b)
- {
- if ($a['end'] == $b['end'] ) {
- return 0;
- }
-
- // Treat empty end dates as farthest into the future.
- if ($a['end'] == 0) {
- return 1;
- }
- if ($b['end'] == 0) {
- return -1;
- }
-
- return ($a['end'] > $b['end']) ? 1 : -1;
- }
-
- /**
- * Comparison function for reverse sorting classes by semester end date.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer -1 if class one is greater, 1 if class two is greater,
- * 0 if they are equal.
- */
- function _rsort_class_semesterend($a, $b)
- {
- if ($a['end'] == $b['end']) {
- return 0;
- }
-
- // Treat empty end dates as farthest into the future.
- if ($a['end'] == 0) {
- return -1;
- }
- if ($b['end'] == 0) {
- return 1;
- }
-
- return ($a['end'] < $b['end']) ? 1 : -1;
- }
-
- /**
- * Comparison function for sorting classes by name.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer 1 if class one is greater, -1 if class two is greater;
- * 0 if they are equal.
- */
- function _sort_class_name($a, $b)
- {
- return strcasecmp($a['name'], $b['name']);
- }
-
- /**
- * Comparison function for reverse sorting classes by name.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer -1 if class one is greater, 1 if class two is greater;
- * 0 if they are equal.
- */
- function _rsort_class_name($a, $b)
- {
- return strcasecmp($b['name'], $a['name']);
- }
-
- /**
- * Comparison function for sorting classes by grade.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer 1 if class one is greater, -1 if class two is greater;
- * 0 if they are equal.
- */
- function _sort_class_grade($a, $b)
- {
- return strcasecmp($a['grade'], $b['grade']);
- }
-
- /**
- * Comparison function for reverse sorting classes by grade.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer -1 if class one is greater, 1 if class two is greater;
- * 0 if they are equal.
- */
- function _rsort_class_grade($a, $b)
- {
- return strcasecmp($b['grade'], $a['grade']);
- }
-
- /**
- * Comparison function for sorting classes by semester.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer 1 if class one is greater, -1 if class two is greater;
- * 0 if they are equal.
- */
- function _sort_class_semester($a, $b)
- {
- return strcasecmp($a['semester'], $b['semester']);
- }
-
- /**
- * Comparison function for reverse sorting classes by semester.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer -1 if class one is greater, 1 if class two is greater;
- * 0 if they are equal.
- */
- function _rsort_class_semester($a, $b)
- {
- return strcasecmp($b['semester'], $a['semester']);
- }
-
- /**
- * Comparison function for sorting classes by location.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer 1 if class one is greater, -1 if class two is greater;
- * 0 if they are equal.
- */
- function _sort_class_location($a, $b)
- {
- return strcasecmp($a['location'], $b['location']);
- }
-
- /**
- * Comparison function for reverse sorting classes by location.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer -1 if class one is greater, 1 if class two is greater;
- * 0 if they are equal.
- */
- function _rsort_class_location($a, $b)
- {
- return strcasecmp($b['location'], $a['location']);
- }
-
- /**
- * Comparison function for sorting classes by category.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer 1 if class one is greater, -1 if class two is greater;
- * 0 if they are equal.
- */
- function _sort_class_category($a, $b)
- {
- return strcasecmp($a['category'] ? $a['category'] : _("Unfiled"),
- $b['category'] ? $b['category'] : _("Unfiled"));
- }
-
- /**
- * Comparison function for reverse sorting classes by category.
- *
- * @param array $a Class one.
- * @param array $b Class two.
- *
- * @return integer -1 if class one is greater, 1 if class two is greater;
- * 0 if they are equal.
- */
- function _rsort_class_category($a, $b)
- {
- return strcasecmp($b['category'] ? $b['category'] : _("Unfiled"),
- $a['category'] ? $a['category'] : _("Unfiled"));
- }
-
- /**
- * Comparison function for sorting students by name.
- *
- * @param array $a Student one.
- * @param array $b Student two.
- *
- * @return integer 1 if student one is greater, -1 if student two is greater;
- * 0 if they are equal.
- */
- function _sort_student_name($a, $b)
- {
- return strcasecmp($a['name'], $b['name']);
- }
-
- /**
- * Comparison function for reverse sorting students by name.
- *
- * @param array $a Student one.
- * @param array $b Student two.
- *
- * @return integer -1 if student one is greater, 1 if student two is greater;
- * 0 if they are equal.
- */
- function _rsort_student_name($a, $b)
- {
- return strcasecmp($b['name'], $a['name']);
- }
-
- /**
- * Comparison function for sorting students by last entry date.
- *
- * @param array $a Student one.
- * @param array $b Student two.
- *
- * @return integer 1 if student one is greater, -1 if student two is greater;
- * 0 if they are equal.
- */
- function _sort_student_lastentry($a, $b)
- {
- // Treat empty dates as farthest into the past.
- if (!isset($a['_lastentry']) || $a['_lastentry'] == 0) {
- return -1;
- }
- if (!isset($b['_lastentry']) || $b['_lastentry'] == 0) {
- return 1;
- }
-
- if ($a['_lastentry'] == $b['_lastentry'] ) {
- return 0;
- }
-
- return ($a['_lastentry'] > $b['_lastentry']) ? 1 : -1;
- }
-
- /**
- * Comparison function for reverse sorting students by last entry date.
- *
- * @param array $a Student one.
- * @param array $b Student two.
- *
- * @return integer -1 if student one is greater, 1 if student two is greater,
- * 0 if they are equal.
- */
- function _rsort_student_lastentry($a, $b)
- {
- // Treat empty dates as farthest into the past.
- if (!isset($a['_lastentry']) || $a['_lastentry'] == 0) {
- return 1;
- }
- if (!isset($b['_lastentry']) || $b['_lastentry'] == 0) {
- return -1;
- }
-
- if ($a['_lastentry'] == $b['_lastentry']) {
- return 0;
- }
-
- return ($a['_lastentry'] < $b['_lastentry']) ? 1 : -1;
- }
-
- /**
- * Comparison function for sorting students by sumabsences.
- *
- * @param array $a Student one.
- * @param array $b Student two.
- *
- * @return integer 1 if student one is greater, -1 if student two is greater;
- * 0 if they are equal.
- */
- function _sort_student_sumabsences($a, $b)
- {
- if ($a['_sumabsences'] == $b['_sumabsences'] ) {
- return 0;
- }
-
- return ($a['_sumabsences'] > $b['_sumabsences']) ? 1 : -1;
- }
-
- /**
- * Comparison function for reverse sorting students by sumabsences.
- *
- * @param array $a Student one.
- * @param array $b Student two.
- *
- * @return integer -1 if student one is greater, 1 if student two is greater,
- * 0 if they are equal.
- */
- function _rsort_student_sumabsences($a, $b)
- {
- if ($a['_sumabsences'] == $b['_sumabsences']) {
- return 0;
- }
-
- return ($a['_sumabsences'] < $b['_sumabsences']) ? 1 : -1;
- }
-
- /**
- * Comparison function for sorting students by summarks.
- *
- * @param array $a Student one.
- * @param array $b Student two.
- *
- * @return integer 1 if student one is greater, -1 if student two is greater;
- * 0 if they are equal.
- */
- function _sort_student_summarks($a, $b)
- {
- // Treat empty sums as lowest mark.
- if ($a['_summarks'] == '') {
- return -1;
- }
- if ($b['_summarks'] == '') {
- return 1;
- }
-
- if ($a['_summarks'] == $b['_summarks'] ) {
- return 0;
- }
-
- return ($a['_summarks'] > $b['_summarks']) ? 1 : -1;
- }
-
- /**
- * Comparison function for reverse sorting students by summarks.
- *
- * @param array $a Student one.
- * @param array $b Student two.
- *
- * @return integer -1 if student one is greater, 1 if student two is greater,
- * 0 if they are equal.
- */
- function _rsort_student_summarks($a, $b)
- {
- // Treat empty sums as lowest mark.
- if ($a['_summarks'] == '') {
- return 1;
- }
- if ($b['_summarks'] == '') {
- return -1;
- }
-
- if ($a['_summarks'] == $b['_summarks']) {
- return 0;
- }
-
- return ($a['_summarks'] < $b['_summarks']) ? 1 : -1;
- }
-
- /**
- * Comparison function for sorting entries by date.
- *
- * @param array $a Entry one.
- * @param array $b Entry two.
- *
- * @return integer 1 if entry one is greater, -1 if entry two is greater;
- * 0 if they are equal.
- */
- function _sort_entry_date($a, $b)
- {
- if ($a['timestamp'] == $b['timestamp'] ) {
- return 0;
- }
-
- return ($a['timestamp'] > $b['timestamp']) ? -1 : 1;
- }
-
- /**
- * Comparison function for reverse sorting entries by date.
- *
- * @param array $a Entry one.
- * @param array $b Entry two.
- *
- * @return integer -1 if entry one is greater, 1 if entry two is greater,
- * 0 if they are equal.
- */
- function _rsort_entry_date($a, $b)
- {
- if ($a['timestamp'] == $b['timestamp']) {
- return 0;
- }
-
- return ($a['timestamp'] < $b['timestamp']) ? -1 : 1;
- }
-
- /**
- * Comparison function for sorting entries by class.
- *
- * @param array $a Entry one.
- * @param array $b Entry two.
- *
- * @return integer 1 if entry one is greater, -1 if entry two is greater;
- * 0 if they are equal.
- */
- function _sort_entry_class($a, $b)
- {
- if ($a['class'] == $b['class'] ) {
- return Skoli::_sort_entry_date($a, $b);
- }
-
- return ($a['class'] > $b['class']) ? 1 : -1;
- }
-
- /**
- * Comparison function for reverse sorting entries by class.
- *
- * @param array $a Entry one.
- * @param array $b Entry two.
- *
- * @return integer -1 if entry one is greater, 1 if entry two is greater,
- * 0 if they are equal.
- */
- function _rsort_entry_class($a, $b)
- {
- if ($a['class'] == $b['class']) {
- return Skoli::_rsort_entry_date($a, $b);
- }
-
- return ($a['class'] < $b['class']) ? 1 : -1;
- }
-
- /**
- * Comparison function for sorting entries by student.
- *
- * @param array $a Entry one.
- * @param array $b Entry two.
- *
- * @return integer 1 if entry one is greater, -1 if entry two is greater;
- * 0 if they are equal.
- */
- function _sort_entry_student($a, $b)
- {
- if ($a['student'] == $b['student'] ) {
- return Skoli::_sort_entry_date($a, $b);
- }
-
- return ($a['student'] > $b['student']) ? 1 : -1;
- }
-
- /**
- * Comparison function for reverse sorting entries by student.
- *
- * @param array $a Entry one.
- * @param array $b Entry two.
- *
- * @return integer -1 if entry one is greater, 1 if entry two is greater,
- * 0 if they are equal.
- */
- function _rsort_entry_student($a, $b)
- {
- if ($a['student'] == $b['student']) {
- return Skoli::_rsort_entry_date($a, $b);
- }
-
- return ($a['student'] < $b['student']) ? 1 : -1;
- }
-
- /**
- * Comparison function for sorting entries by type.
- *
- * @param array $a Entry one.
- * @param array $b Entry two.
- *
- * @return integer 1 if entry one is greater, -1 if entry two is greater;
- * 0 if they are equal.
- */
- function _sort_entry_type($a, $b)
- {
- if ($a['type'] == $b['type'] ) {
- return Skoli::_sort_entry_date($a, $b);
- }
-
- return ($a['type'] > $b['type']) ? 1 : -1;
- }
-
- /**
- * Comparison function for reverse sorting entries by type.
- *
- * @param array $a Entry one.
- * @param array $b Entry two.
- *
- * @return integer -1 if entry one is greater, 1 if entry two is greater,
- * 0 if they are equal.
- */
- function _rsort_entry_type($a, $b)
- {
- if ($a['type'] == $b['type']) {
- return Skoli::_rsort_entry_date($a, $b);
- }
-
- return ($a['type'] < $b['type']) ? 1 : -1;
- }
-}
+++ /dev/null
-<?php
-/**
- * Skoli base application file.
- *
- * This file brings in all of the dependencies that every Skoli script will
- * need, and sets up objects that all scripts use.
- */
-
-// Check for a prior definition of HORDE_BASE (perhaps by an auto_prepend_file
-// definition for site customization).
-if (!defined('HORDE_BASE')) {
- @define('HORDE_BASE', dirname(__FILE__) . '/../..');
-}
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$registry = new Horde_Registry();
-try {
- $registry->pushApp('skoli', array('check_perms' => (Horde_Util::nonInputVar('skoli_authentication') != 'none'), 'logintasks' => true));
-} catch (Horde_Exception $e) {
- $registry->authenticateFailure('skoli', $e);
-}
-$conf = &$GLOBALS['conf'];
-@define('SKOLI_TEMPLATES', $registry->get('templates'));
-
-// Define the base file path of Skoli.
-@define('SKOLI_BASE', dirname(__FILE__) . '/..');
-
-// Start output compression.
-Horde::compressOutput();
-
-// Create a share instance.
-$GLOBALS['skoli_shares'] = $GLOBALS['injector']->getInstance('Horde_Share_Factory')->getScope();
-
-Skoli::initialize();
+++ /dev/null
-<?php
-/**
- * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- */
-
-@define('SKOLI_BASE', dirname(__FILE__));
-require_once SKOLI_BASE . '/lib/base.php';
-
-$title = _("My Classes");
-
-/* Get and set Variables */
-$vars = Horde_Variables::getDefaultVariables();
-
-/* Get the current action ID. */
-$actionID = Horde_Util::getFormData('actionID');
-
-/* Sort out the sorting values */
-if (($sortby_class = Horde_Util::getFormData('sortby_class')) !== null) {
- if ($sortby_class == $prefs->getValue('sortby_class')) {
- $prefs->setValue('sortdir_class', !$prefs->getValue('sortdir_class'));
- } else {
- $prefs->setValue('sortdir_class', SKOLI_SORT_ASCEND);
- }
- $prefs->setValue('sortby_class', $sortby_class);
- if ($sortby_class == 'name') {
- if ($sortby_class == $prefs->getValue('sortby_student')) {
- $prefs->setValue('sortdir_student', !$prefs->getValue('sortdir_student'));
- } else {
- $prefs->setValue('sortdir_student', SKOLI_SORT_ASCEND);
- }
- $prefs->setValue('sortby_student', $sortby_class);
- }
-}
-if (($sortby_student = Horde_Util::getFormData('sortby_student')) !== null) {
- $prefs->setValue('sortby_student', $sortby_student);
- if ($sortby_student == $prefs->getValue('sortby_student')) {
- $prefs->setValue('sortdir_student', !$prefs->getValue('sortdir_student'));
- } else {
- $prefs->setValue('sortdir_student', SKOLI_SORT_ASCEND);
- }
-}
-
-/* Check if we have access to an application who provides contacts/getContact */
-$app = $registry->hasMethod('contacts/getContact');
-if ($app == false || $registry->get('status', $app) == 'inactive' || !$registry->hasPermission($app, Horde_Perms::SHOW)) {
- $notification->push(_("Skoli needs an applications who provides contacts (e.g. turba)."), 'horde.warning');
-}
-
-/* Redirect to create a new class if we don't have access to any class */
-if (count(Skoli::listClasses()) == 0 && $GLOBALS['registry']->getAuth()) {
- $notification->push(_("Please create a new Class first."), 'horde.message');
- Horde::url('classes/create.php', true)->redirect();
-}
-
-switch ($actionID) {
-case 'search_classes':
- /* Get the search parameters. */
- $search_pattern = Horde_Util::getFormData('search_pattern');
-
- /* Get the full, sorted student list for all classes. */
- $list = Skoli::listStudents(null,
- $prefs->getValue('sortby_student'),
- $prefs->getValue('sortdir_student'),
- $prefs->getValue('sortby_class'),
- $prefs->getValue('sortdir_class'));
-
- if (!empty($search_pattern)) {
- $pattern = '/' . preg_quote($search_pattern, '/') . '/i';
- $search_results = array();
- foreach ($list as $class) {
- $search_results_students = array();
- if (($search_name && preg_match($pattern, $task->name)) ||
- ($search_desc && preg_match($pattern, $task->desc)) ||
- ($search_category && preg_match($pattern, $task->category))) {
- $search_results->add($task);
- }
- }
-
- /* Reassign $list to the search result. */
- $list = $search_results;
- $title = sprintf(_("Search: Results for \"%s\""), $search_pattern);
- }
- break;
-
-default:
- /* Get the full, sorted list for all classes. */
- $list = Skoli::listStudents(null,
- $prefs->getValue('sortby_student'),
- $prefs->getValue('sortdir_student'),
- $prefs->getValue('sortby_class'),
- $prefs->getValue('sortdir_class'));
- break;
-}
-
-Horde::addScriptFile('tooltips.js', 'horde');
-Horde::addScriptFile('effects.js', 'horde');
-Horde::addScriptFile('quickfinder.js', 'horde');
-
-require SKOLI_TEMPLATES . '/common-header.inc';
-require SKOLI_TEMPLATES . '/menu.inc';
-echo '<div id="page">';
-require SKOLI_TEMPLATES . '/list/header.inc';
-
-if (count($list) > 0) {
- $sortby_class = $prefs->getValue('sortby_class');
- $sortdir_class = $prefs->getValue('sortdir_class');
- $sortby_student = $prefs->getValue('sortby_student');
- $sortdir_student = $prefs->getValue('sortdir_student');
- $dateFormat = $prefs->getValue('date_format');
- $class_columns = @unserialize($prefs->getValue('class_columns'));
- $show_students = $prefs->getValue('show_students');
- $student_columns = $show_students ? @unserialize($prefs->getValue('student_columns')) : array();
- $dynamic_sort = true;
-
- $baseurl = 'list.php';
- if ($actionID == 'search_classes') {
- $baseurl = Horde_Util::addParameter(
- $baseurl,
- array('actionID' => 'search_classes',
- 'search_pattern' => $search_pattern));
- }
-
- require SKOLI_TEMPLATES . '/list/headers.inc';
-
- foreach ($list as $class) {
- $dynamic_sort &= !$show_students;
- $style = 'linedRow';
- require SKOLI_TEMPLATES . '/list/classes.inc';
-
- if ($show_students) {
- $treedir = Horde_Themes::img(null, 'horde');
- $counter = 0;
- foreach ($class['_students'] as $student) {
- if (++$counter < count($class['_students'])) {
- $treeIcon = Horde::img(empty($GLOBALS['registry']->nlsconfig['rtl'][$GLOBALS['language']]) ? 'tree/join.png' : 'tree/rev-join.png', '+', '', $treedir);
- } else {
- $treeIcon = Horde::img(empty($GLOBALS['registry']->nlsconfig['rtl'][$GLOBALS['language']]) ? 'tree/joinbottom.png' : 'tree/rev-joinbottom.png', '\\', '', $treedir);
- }
- require SKOLI_TEMPLATES . '/list/students.inc';
- }
- }
- }
-
- require SKOLI_TEMPLATES . '/list/footers.inc';
-
- if ($dynamic_sort) {
- Horde::addScriptFile('tables.js', 'horde');
- }
-} else {
- require SKOLI_TEMPLATES . '/list/empty.inc';
-}
-
-require SKOLI_TEMPLATES . '/panel.inc';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-Deny from all
+++ /dev/null
-# German translations for Skoli package
-# German messages for Skoli.
-# Copyright (C) 2009 Horde Project
-# This file is distributed under the same license as the Skoli package.
-# Automatically generated, 2009.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Skoli 0.1-cvs\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2010-08-17 17:46+0200\n"
-"PO-Revision-Date: 2009-04-16 11:04+0200\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: i18n@lists.horde.org\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#: config/schools.php.dist:55
-msgid "1. class"
-msgstr "1. Klasse"
-
-#: config/schools.php.dist:64
-msgid "1. term"
-msgstr "1. Halbjahr"
-
-#: config/schools.php.dist:56
-msgid "2. class"
-msgstr "2. Klasse"
-
-#: config/schools.php.dist:69
-msgid "2. term"
-msgstr "2. Halbjahr"
-
-#: config/schools.php.dist:57
-msgid "3. class"
-msgstr "3. Klasse"
-
-#: config/schools.php.dist:58
-msgid "4. class"
-msgstr "4. Klasse"
-
-#: config/schools.php.dist:59
-msgid "5. class"
-msgstr "5. Klasse"
-
-#: config/schools.php.dist:60
-msgid "6. class"
-msgstr "6. Klasse"
-
-#: lib/Skoli.php:314 lib/Forms/Entry.php:106 lib/Forms/Entry.php:156
-msgid "Absence"
-msgstr "Abwesenheit"
-
-#: lib/Forms/Entry.php:156
-msgid "Absence in number of lessons"
-msgstr "Abwesenheit in Anzahl Lektionen"
-
-#: data.php:130 search.php:117 templates/list/headers.inc:68
-#: config/prefs.php.dist:92 config/prefs.php.dist:105
-msgid "Absences"
-msgstr "Abwesenheiten"
-
-#: data.php:69
-msgid "Absences without valid excuse"
-msgstr "Unentschuldigte Abwesenheiten"
-
-#: lib/Driver.php:66
-#, php-format
-msgid "Access for class \"%s\" is denied"
-msgstr "Zugriff auf die Klasse \"%s\" wurde verweigert."
-
-#: lib/Forms/Entry.php:166
-msgid "Add"
-msgstr "Hinzufügen"
-
-#: lib/Forms/Entry.php:33
-msgid "Add Entry"
-msgstr "Eintrag hinzufügen"
-
-#: lib/Forms/EditClass.php:79 lib/Forms/EditClass.php:82
-#: lib/Forms/CreateClass.php:92 lib/Forms/CreateClass.php:95
-msgid "Address Book"
-msgstr "Adressbuch"
-
-#: search.php:102
-msgid "All Types"
-msgstr "Alle Typen"
-
-#: search.php:66
-msgid "All classes"
-msgstr "Alle Klassen"
-
-#: search.php:75
-msgid "All students"
-msgstr "Alle Studenten"
-
-#: config/schools.php.dist:88
-msgid "Appliance"
-msgstr "Anwenden"
-
-#: config/prefs.php.dist:79 config/prefs.php.dist:115
-msgid "Ascending"
-msgstr "Aufsteigend"
-
-#: config/prefs.php.dist:135
-msgid "Ask every time"
-msgstr "Jedes Mal nachfragen"
-
-#: config/prefs.php.dist:137
-msgid "Automatically create a new contact list"
-msgstr "Erstelle automatisch eine neue Kontaktliste."
-
-#: lib/Forms/DeleteClass.php:39 lib/Forms/DeleteClass.php:45
-msgid "Cancel"
-msgstr "Abbrechen"
-
-#: templates/list/headers.inc:84 lib/Forms/EditClass.php:61
-#: lib/Forms/CreateClass.php:60 config/prefs.php.dist:53
-#: config/prefs.php.dist:69
-msgid "Category"
-msgstr "Kategorie"
-
-#: templates/classes/list.php:28 classes/index.php:29
-msgid "Change Permissions"
-msgstr "Rechte Ändern"
-
-#: config/prefs.php.dist:16
-msgid "Change your settings for automatically create contact lists."
-msgstr ""
-"Ändern Sie die Einstellungen zum automatischen Erstellen einer Kontaktliste."
-
-#: config/prefs.php.dist:9
-msgid "Change your sorting and display options."
-msgstr "Ändern Sie die Sortierreihenfolge und andere Anzeigeeinstellungen."
-
-#: lib/School.php:92 lib/School.php:99 lib/School.php:128 lib/School.php:142
-#: lib/School.php:148 lib/School.php:164 lib/School.php:167
-#: lib/Forms/EditClass.php:70 lib/Forms/EditClass.php:82
-#: lib/Forms/Entry.php:61 lib/Forms/Entry.php:128 lib/Forms/CreateClass.php:74
-#: lib/Forms/CreateClass.php:95
-msgid "Choose:"
-msgstr "Auswählen:"
-
-#: data.php:62 templates/classes/list.php:16 templates/search/headers.inc:34
-#: lib/Forms/Entry.php:61
-msgid "Class"
-msgstr "Klasse"
-
-#: templates/classes/list.php:13
-msgid "Class List"
-msgstr "Klassenliste"
-
-#: templates/panel.inc:32 templates/panel.inc:33
-msgid "Classes"
-msgstr "Klassen"
-
-#: templates/search/header.inc:8 templates/list/header.inc:7
-msgid "Close Search"
-msgstr "Suche beenden"
-
-#: templates/data/export.inc:11
-msgid "Comma separated values (CSV)"
-msgstr "Kommagetrennte Werte (CSV)"
-
-#: lib/Forms/Entry.php:152 lib/Forms/Entry.php:161
-msgid "Comment"
-msgstr "Kommentar"
-
-#: data.php:125 search.php:162
-msgid "Completed"
-msgstr "Erledigt"
-
-#: data.php:78
-msgid "Completed outcomes"
-msgstr "Erledigte Lernziele"
-
-#: lib/Forms/Entry.php:151
-msgid "Completed?"
-msgstr "Erledigt?"
-
-#: config/schools.php.dist:110
-msgid "Concentration, attention, perseverance"
-msgstr "Konzentration, Aufmerksamkeit, Ausdauer"
-
-#: config/schools.php.dist:94
-msgid "Construct"
-msgstr "Gestalten"
-
-#: lib/Forms/CreateClass.php:139
-msgid "Contact List"
-msgstr "Kontaktliste"
-
-#: config/prefs.php.dist:15
-msgid "Contact Lists"
-msgstr "Kontaktlisten"
-
-#: lib/Forms/Entry.php:179
-msgid "Couldn't add the new entry."
-msgstr "Ein neuer Eintrag konnte nicht erstellt werden."
-
-#: lib/Forms/EditClass.php:159 lib/Forms/CreateClass.php:200
-msgid "Couldn't add the selected students to the class."
-msgstr ""
-"Die ausgewählten Studenten konnten nicht zur Klasse hinzugefügt werden."
-
-#: lib/Skoli.php:276 lib/Forms/CreateClass.php:226
-#, php-format
-msgid "Couldn't create the contact list \"%s\"."
-msgstr "Die Kontaktliste \"%s\" konnte nicht erstellt werden."
-
-#: entry.php:59
-#, php-format
-msgid "Couldn't update this entry: %s"
-msgstr "Der Eintrag konnte nicht aktualisiert werden. %s"
-
-#: lib/Forms/CreateClass.php:156
-msgid "Create"
-msgstr "Erstellen"
-
-#: lib/Forms/CreateClass.php:51
-msgid "Create Class"
-msgstr "Klasse erstellen"
-
-#: lib/Forms/CreateClass.php:141
-msgid "Create Contact List?"
-msgstr "Kontaktliste erstellen?"
-
-#: templates/classes/list.php:8
-msgid "Create a new Class"
-msgstr "Neue Klasse erstellen"
-
-#: lib/School.php:83
-msgid "Custom format:"
-msgstr "Eigenes Format:"
-
-#: config/schools.php.dist:46
-msgid "Custom school"
-msgstr "Eigene Schule"
-
-#: templates/search/headers.inc:40 lib/Forms/Entry.php:86
-msgid "Date"
-msgstr "Datum"
-
-#: config/prefs.php.dist:23
-msgid "Define a format for marks"
-msgstr "Formatdefinition für Noten"
-
-#: entry.php:91 templates/classes/list.php:30 templates/entry/delete.inc:8
-#: classes/index.php:30 lib/Forms/DeleteClass.php:39
-msgid "Delete"
-msgstr "Löschen"
-
-#: lib/Forms/DeleteClass.php:34
-#, php-format
-msgid "Delete %s"
-msgstr "%s löschen"
-
-#: config/prefs.php.dist:80 config/prefs.php.dist:116
-msgid "Descending"
-msgstr "Absteigend"
-
-#: lib/Forms/EditClass.php:59 lib/Forms/CreateClass.php:58
-msgid "Description"
-msgstr "Beschreibung"
-
-#: config/prefs.php.dist:8
-msgid "Display Options"
-msgstr "Anzeige-Einstellungen"
-
-#: config/prefs.php.dist:136
-msgid "Don't create contact lists"
-msgstr "Kein Erstellen von Kontaktlisten"
-
-#: entry.php:88 templates/classes/list.php:26 classes/index.php:28
-msgid "Edit"
-msgstr "Bearbeiten"
-
-#: templates/list/classes.inc:13
-#, php-format
-msgid "Edit \"%s\""
-msgstr "\"%s\" bearbeiten"
-
-#: lib/Forms/EditClass.php:50
-#, php-format
-msgid "Edit %s"
-msgstr "%s bearbeiten"
-
-#: templates/search/headers.inc:31 templates/list/headers.inc:44
-msgid "Edit Class"
-msgstr "Klasse bearbeiten"
-
-#: entry.php:94 templates/search/entries.inc:5
-msgid "Edit Entry"
-msgstr "Eintrag bearbeiten"
-
-#: templates/list/headers.inc:89
-msgid "Edit categories and colors"
-msgstr "Kategorien und Farben bearbeiten"
-
-#: config/schools.php.dist:101
-msgid "English"
-msgstr "Englisch"
-
-#: config/prefs.php.dist:147
-msgid ""
-"Enter a default name for new contact lists.<br />NOTE: You can use %c, %g or "
-"%s as substitution for the class, grade respectively semester name."
-msgstr ""
-"Eingabe eines Standardnamens für neue Kontaktlisten.<br />HINWEIS: Sie "
-"können %c, %g oder %s als Ersatz für die Klasse (class), Stufe (grade) und "
-"Semester (semester) verwenden."
-
-#: config/prefs.php.dist:165
-msgid ""
-"Enter some custom marks and separate them by comma (best mark first).<br /"
-">NOTE: You also need to choose \"Custom settings\" above."
-msgstr ""
-"Eingabe eines eigenen Notenformats. Jede Note wird mit einem Komma getrennt "
-"(beste Note zuerst).<br />HINWEIS: Sie müssen auch den Punkt \"Eigene "
-"Einstellungen\" weiter oben auswählen."
-
-#: templates/search/headers.inc:46
-msgid "Entry"
-msgstr "Eintrag"
-
-#: entry.php:100
-#, php-format
-msgid "Entry for \"%s\""
-msgstr "Eintrag für \"%s\""
-
-#: entry.php:23
-msgid "Entry not found."
-msgstr "Eintrag nicht gefunden."
-
-#: lib/School.php:36
-#, php-format
-msgid "Error loading the school \"%s\" from template."
-msgstr "Fehler beim Laden der Schule \"%s\" aus der Vorlage."
-
-#: data.php:133 search.php:167
-msgid "Excused"
-msgstr "Entschuldigt"
-
-#: data.php:68
-msgid "Excused absences"
-msgstr "Entschuldigte Abwesenheiten"
-
-#: lib/Forms/Entry.php:157
-msgid "Excused?"
-msgstr "Entschuldigt?"
-
-#: config/schools.php.dist:111
-msgid "Exercise processing"
-msgstr "Aufgabenbearbeitung"
-
-#: templates/data/export.inc:32
-msgid "Export"
-msgstr "Exportieren"
-
-#: data.php:171 templates/data/export.inc:5
-msgid "Export Classes"
-msgstr "Klassen exportieren"
-
-#: data.php:63
-msgid "Firstname"
-msgstr "Vorname"
-
-#: lib/School.php:81
-msgid "Format in numbers"
-msgstr "Format in Zahlen"
-
-#: lib/School.php:82
-msgid "Format in percent"
-msgstr "Format in Prozent"
-
-#: config/schools.php.dist:95
-msgid "French"
-msgstr "Französisch"
-
-#: config/prefs.php.dist:7 config/prefs.php.dist:14 config/prefs.php.dist:21
-msgid "General Options"
-msgstr "Allgemeine Einstellungen"
-
-#: lib/Forms/EditClass.php:56 lib/Forms/CreateClass.php:55
-msgid "General Settings"
-msgstr "Allgemeine Angaben"
-
-#: config/schools.php.dist:80
-msgid "German"
-msgstr "Deutsch"
-
-#: templates/list/headers.inc:72 config/prefs.php.dist:50
-#: config/prefs.php.dist:66
-msgid "Grade"
-msgstr "Stufe"
-
-#: config/schools.php.dist:96 config/schools.php.dist:102
-msgid "Hearing"
-msgstr "Hörverstehen"
-
-#: config/schools.php.dist:81
-msgid "Hearing and Talking"
-msgstr "Hören und Sprechen"
-
-#: config/prefs.php.dist:126
-msgid ""
-"How many characters of the entry details in search view should we allow to "
-"see?"
-msgstr ""
-"Wieviele Zeichen sollen bei den Eintragdetails in der Suchansicht gezeigt "
-"werden?"
-
-#: config/prefs.php.dist:156
-msgid "How many decimal digits should we round marks to?"
-msgstr "Auf wieviele Stellen sollen die Noten gerundet werden?"
-
-#: config/schools.php.dist:86
-msgid "Imagination"
-msgstr "Vorstellungsvermögen"
-
-#: lib/School.php:121 lib/School.php:125 lib/School.php:136 lib/School.php:137
-#: lib/School.php:143
-msgid "Interdisciplinary"
-msgstr "Fächerübergreifend"
-
-#: templates/list/headers.inc:60 config/prefs.php.dist:90
-#: config/prefs.php.dist:103
-msgid "Last Entry"
-msgstr "Letzter Eintrag"
-
-#: data.php:64
-msgid "Lastname"
-msgstr "Nachname"
-
-#: lib/Skoli.php:494 config/prefs.php.dist:33
-msgid "List Classes"
-msgstr "Klassen anzeigen"
-
-#: lib/School.php:102
-msgid "List with custom marks separated by comma (best mark first)"
-msgstr "Kommagetrennte Liste mit eigenen Noten (beste Note zuerst)"
-
-#: templates/list/headers.inc:80 config/prefs.php.dist:52
-#: config/prefs.php.dist:68
-msgid "Location"
-msgstr "Ort"
-
-#: templates/classes/list.php:2 classes/index.php:33
-msgid "Manage Classes"
-msgstr "Klassen-Verwaltung"
-
-#: lib/Skoli.php:311 lib/Forms/Entry.php:97 lib/Forms/Entry.php:119
-#: lib/Forms/Entry.php:123 lib/Forms/Entry.php:128
-msgid "Mark"
-msgstr "Note"
-
-#: templates/list/headers.inc:64 config/prefs.php.dist:91
-#: config/prefs.php.dist:104
-msgid "Mark average"
-msgstr "Notendurchschnitt"
-
-#: lib/Forms/Entry.php:119
-msgid "Mark in numbers"
-msgstr "Note in Zahlen"
-
-#: lib/Forms/Entry.php:123
-msgid "Mark in percent"
-msgstr "Note in Prozent"
-
-#: data.php:102 search.php:105 config/prefs.php.dist:22
-msgid "Marks"
-msgstr "Noten"
-
-#: config/schools.php.dist:85
-msgid "Mathematics"
-msgstr "Mathematik"
-
-#: lib/Block/tree_menu.php:3
-msgid "Menu List"
-msgstr "Menüliste"
-
-#: config/schools.php.dist:109
-msgid "Motivation to learn and dedication"
-msgstr "Lernmotivation und Einsatz"
-
-#: config/schools.php.dist:92
-msgid "Music"
-msgstr "Musik"
-
-#: list.php:14
-msgid "My Classes"
-msgstr "Meine Klassen"
-
-#: templates/panel.inc:53
-msgid "My Classes:"
-msgstr "Meine Klassen:"
-
-#: templates/list/headers.inc:56 lib/Forms/EditClass.php:58
-#: lib/Forms/CreateClass.php:57 lib/Forms/CreateClass.php:146
-#: config/prefs.php.dist:65 config/prefs.php.dist:102
-msgid "Name"
-msgstr "Name"
-
-#: config/schools.php.dist:91
-msgid "Nature-Human-Environment"
-msgstr "Natur-Mensch-Mitwelt"
-
-#: templates/list/students.inc:5 templates/list/classes.inc:5
-#: templates/list/headers.inc:41 lib/Block/tree_menu.php:25
-#: config/prefs.php.dist:34
-msgid "New Entry"
-msgstr "Neuer Eintrag"
-
-#: data.php:21
-msgid "No classes are currently available. Export is disabled."
-msgstr ""
-"Zur Zeit sind keine Klassen verfügbar. Export steht nicht zur Verfügung."
-
-#: search.php:17
-msgid "No classes are currently available. Searching is disabled."
-msgstr ""
-"Zur Zeit sind keine Klassen verfügbar. Die Suche steht nicht zur Verfügung."
-
-#: templates/list/footers.inc:4
-msgid "No classes match"
-msgstr "Keine Treffer"
-
-#: templates/search/footers.inc:4
-msgid "No entries match"
-msgstr "Keine Treffer"
-
-#: data.php:133 search.php:167
-msgid "Not excused"
-msgstr "Unentschuldigt"
-
-#: lib/Skoli.php:312 lib/Forms/Entry.php:100 lib/Forms/Entry.php:146
-msgid "Objective"
-msgstr "Beobachtung"
-
-#: data.php:112 search.php:109
-msgid "Objectives"
-msgstr "Beobachtungen"
-
-#: data.php:125 search.php:162
-msgid "Open"
-msgstr "Offen"
-
-#: data.php:79
-msgid "Open outcomes"
-msgstr "Offene Lernziele"
-
-#: lib/Skoli.php:313 lib/Forms/Entry.php:103 lib/Forms/Entry.php:150
-msgid "Outcome"
-msgstr "Lernziel"
-
-#: data.php:122 search.php:113
-msgid "Outcomes"
-msgstr "Lernziele"
-
-#: templates/entry/delete.inc:7
-msgid "Permanently delete this entry?"
-msgstr "Diesen Eintrag unwiederbringlich löschen?"
-
-#: lib/Forms/DeleteClass.php:51
-msgid "Permission denied"
-msgstr "Zugriff verweigert"
-
-#: list.php:56 add.php:17
-msgid "Please create a new Class first."
-msgstr "Bitte erstellen Sie zuerst eine neue Klasse."
-
-#: config/schools.php.dist:89
-msgid "Problem solving behavior"
-msgstr "Problemlöseverhalten"
-
-#: lib/Forms/EditClass.php:54 lib/Forms/CreateClass.php:53
-msgid "Properties"
-msgstr "Eigenschaften"
-
-#: config/schools.php.dist:82 config/schools.php.dist:98
-#: config/schools.php.dist:104
-msgid "Reading"
-msgstr "Lesen"
-
-#: lib/Forms/DeleteClass.php:37
-#, php-format
-msgid ""
-"Really delete the class \"%s\"? This cannot be undone and all data on this "
-"class will be permanently removed."
-msgstr ""
-"Die Klasse \"%s\" wirklich löschen? Dieser Vorgang kann nicht rückgängig "
-"gemacht werden, und alle Daten in dieser Klasse werden endgültig gelöscht."
-
-#: templates/search/criteria.inc:39
-msgid "Reset to Defaults"
-msgstr "Zurücksetzen"
-
-#: config/schools.php.dist:53
-msgid "Sample school"
-msgstr "Beispiel Schule"
-
-#: templates/panel.inc:71 lib/Forms/EditClass.php:125 lib/Forms/Entry.php:166
-msgid "Save"
-msgstr "Speichern"
-
-#: lib/Forms/EditClass.php:70
-msgid "School"
-msgstr "Schule"
-
-#: lib/Forms/EditClass.php:63 lib/Forms/CreateClass.php:67
-msgid "School Specific Settings"
-msgstr "Schulabhängige Einstellungen"
-
-#: config/schools.php.dist:75
-msgid "Schoolhouse 1"
-msgstr "Schulhaus 1"
-
-#: config/schools.php.dist:76
-msgid "Schoolhouse 2"
-msgstr "Schulhaus 2"
-
-#: lib/Forms/CreateClass.php:74
-msgid "Schools"
-msgstr "Schulen"
-
-#: search.php:124 templates/search/criteria.inc:38
-#: templates/search/header.inc:4 templates/list/header.inc:3
-#: lib/Block/tree_menu.php:44 config/prefs.php.dist:35
-msgid "Search"
-msgstr "Suche"
-
-#: templates/search/criteria.inc:9
-msgid "Search Criterias"
-msgstr "Suchkriterien"
-
-#: templates/search/header.inc:3
-msgid "Search Result"
-msgstr "Suchergebnisse"
-
-#: templates/panel.inc:38
-msgid "Search for Classes:"
-msgstr "Nach Klassen suchen:"
-
-#: templates/search/criteria.inc:13
-msgid "Search in"
-msgstr "Suchen in"
-
-#: list.php:86
-#, php-format
-msgid "Search: Results for \"%s\""
-msgstr "Suche: Ergebnisse für \"%s\""
-
-#: templates/data/export.inc:26
-msgid "Select a student or the whole class to export:"
-msgstr "Wählen Sie einen Studenten oder die ganze Klasse zum Exportieren:"
-
-#: templates/data/export.inc:17
-msgid "Select the class to export from:"
-msgstr "Wählen Sie die Klasse die exportiert werden soll"
-
-#: config/prefs.php.dist:54
-msgid "Select the columns that should be shown in the class list view:"
-msgstr ""
-"Wählen Sie die Spalten, die in der Listenansicht der Klassen angezeigt "
-"werden sollen:"
-
-#: config/prefs.php.dist:93
-msgid "Select the columns that should be shown in the student list view:"
-msgstr ""
-"Wählen Sie die Spalten, die in der Listenansicht der Studierenden angezeigt "
-"werden sollen:"
-
-#: templates/data/export.inc:9
-msgid "Select the export format:"
-msgstr "Wählen Sie das Exportformat:"
-
-#: config/prefs.php.dist:36
-msgid "Select the view to display after login:"
-msgstr "Wählen Sie die Ansicht aus, die beim Start angezeigt werden soll:"
-
-#: templates/list/headers.inc:76 config/prefs.php.dist:51
-#: config/prefs.php.dist:67
-msgid "Semester"
-msgstr "Semester"
-
-#: templates/list/headers.inc:52 config/prefs.php.dist:49
-#: config/prefs.php.dist:64
-msgid "Semester End"
-msgstr "Semesterende"
-
-#: templates/list/headers.inc:48 config/prefs.php.dist:48
-#: config/prefs.php.dist:63
-msgid "Semester Start"
-msgstr "Semesterstart"
-
-#: templates/panel.inc:62
-msgid "Shared Classes:"
-msgstr "Gemeinsame Klassen:"
-
-#: templates/list/students.inc:13
-#, php-format
-msgid "Show \"%s\""
-msgstr "\"%s\" anzeigen"
-
-#: config/prefs.php.dist:179
-msgid "Show class list options panel?"
-msgstr "Kasten mit Klassenlisteninstellungen anzeigen?"
-
-#: config/prefs.php.dist:188
-msgid "Show students in the class list?"
-msgstr "Studierende in der Klassenliste anzeigen?"
-
-#: templates/panel.inc:43
-msgid "Show students?"
-msgstr "Studierende anzeigen?"
-
-#: config/schools.php.dist:87
-msgid "Skills"
-msgstr "Kenntnisse, Fertigkeiten"
-
-#: list.php:51
-msgid "Skoli needs an applications who provides contacts (e.g. turba)."
-msgstr "Skoli benötigt eine Applikation mit Kontakten (z.B. turba)."
-
-#: templates/list/headers.inc:68
-msgid "Sort by Absences"
-msgstr "Sortieren nach Abwesenheiten"
-
-#: templates/list/headers.inc:84
-msgid "Sort by Category"
-msgstr "Sortieren nach Kategorie"
-
-#: templates/search/headers.inc:34
-msgid "Sort by Class"
-msgstr "Sortieren nach Klasse"
-
-#: templates/search/headers.inc:40
-msgid "Sort by Date"
-msgstr "Sortieren nach Datum"
-
-#: templates/list/headers.inc:72
-msgid "Sort by Grade"
-msgstr "Sortieren nach Stufe"
-
-#: templates/list/headers.inc:60
-msgid "Sort by Last Entry"
-msgstr "Sortieren nach letztem Eintrag"
-
-#: templates/list/headers.inc:80
-msgid "Sort by Location"
-msgstr "Sortieren nach Ort"
-
-#: templates/list/headers.inc:64
-msgid "Sort by Mark"
-msgstr "Sortieren nach Noten"
-
-#: templates/list/headers.inc:56
-msgid "Sort by Name"
-msgstr "Sortieren nach Name"
-
-#: templates/list/headers.inc:76
-msgid "Sort by Semester"
-msgstr "Sortieren nach Semester"
-
-#: templates/list/headers.inc:52
-msgid "Sort by Semester End Date"
-msgstr "Sortieren nach Semesterenddatum"
-
-#: templates/list/headers.inc:48
-msgid "Sort by Semester Start Date"
-msgstr "Sortieren nach Semesterstartdatum"
-
-#: templates/search/headers.inc:37
-msgid "Sort by Student Name"
-msgstr "Sortieren nach Studierenden"
-
-#: templates/search/headers.inc:43
-msgid "Sort by Type"
-msgstr "Sortieren nach Typ"
-
-#: config/prefs.php.dist:70
-msgid "Sort classes by:"
-msgstr "Klassen sortieren nach:"
-
-#: config/prefs.php.dist:81
-msgid "Sort direction for classes:"
-msgstr "Sortierrichtung für Klassen:"
-
-#: config/prefs.php.dist:117
-msgid "Sort direction for students:"
-msgstr "Sortierrichtung für Studierende:"
-
-#: config/prefs.php.dist:106
-msgid "Sort students by:"
-msgstr "Studierende sortieren nach:"
-
-#: config/schools.php.dist:93
-msgid "Sport"
-msgstr "Sport"
-
-#: templates/search/headers.inc:37 lib/Forms/Entry.php:78
-#: lib/Forms/Entry.php:80
-msgid "Student"
-msgstr "Studierender"
-
-#: lib/Forms/EditClass.php:77 lib/Forms/EditClass.php:90
-#: lib/Forms/EditClass.php:123 lib/Forms/CreateClass.php:90
-#: lib/Forms/CreateClass.php:103 lib/Forms/CreateClass.php:136
-msgid "Students"
-msgstr "Studierende"
-
-#: templates/data/export.inc:12
-msgid "Tab separated values (TSV)"
-msgstr "Tabgetrennte Werte (TSV)"
-
-#: config/schools.php.dist:97 config/schools.php.dist:103
-msgid "Talking"
-msgstr "Sprechen"
-
-#: config/schools.php.dist:112
-msgid "Teamwork and autonomy"
-msgstr "Zusammenarbeit und Selbstständigkeit"
-
-#: lib/Driver.php:36
-msgid "The School backend is not currently available."
-msgstr "Der Schuleserver ist zur Zeit nicht verfügbar."
-
-#: lib/Driver.php:85
-#, php-format
-msgid "The School backend is not currently available: %s"
-msgstr "Der Schuleserver ist zur Zeit nicht verfügbar: %s"
-
-#: classes/create.php:34
-#, php-format
-msgid "The class \"%s\" has been created."
-msgstr "Die Klasse \"%s\" wurde erstellt."
-
-#: classes/delete.php:38
-#, php-format
-msgid "The class \"%s\" has been deleted."
-msgstr "Die Klasse \"%s\" wurde gelöscht."
-
-#: classes/edit.php:45
-#, php-format
-msgid "The class \"%s\" has been renamed to \"%s\"."
-msgstr "Die Klasse \"%s\" wurde nach \"%s\" umbenannt."
-
-#: classes/edit.php:47
-#, php-format
-msgid "The class \"%s\" has been saved."
-msgstr "Die Klasse \"%s\" wurde gespeichert."
-
-#: entry.php:76
-#, php-format
-msgid "The entry for \"%s\" has been deleted."
-msgstr "Der Eintrag \"%s\" wurde gelöscht."
-
-#: entry.php:61
-#, php-format
-msgid "The entry for \"%s\" has been saved."
-msgstr "Der Eintrag für \"%s\" wurde gespeichert."
-
-#: add.php:30
-#, php-format
-msgid "The new entry for \"%s\" has been added."
-msgstr "Der neue Eintrag für \"%s\" wurde hinzugefügt."
-
-#: lib/Forms/CreateClass.php:147
-msgid ""
-"The substitutions %c, %g or %s will be replaced automatically by the class, "
-"grade respectively semester name."
-msgstr ""
-"Die Substitutionen %c, %g oder %s werden automatisch mit der Klasse (class), "
-"Stufe (grade) bzw. dem Semester (semester) ersetzt."
-
-#: templates/list/empty.inc:2
-msgid "There are no classes matching the current criteria."
-msgstr "Es gibt keine Klassen, die den Suchkriterien entsprechen."
-
-#: templates/search/empty.inc:2
-msgid "There are no entries matching the current criteria."
-msgstr "Es wurden keine passenden Einträge gefunden."
-
-#: entry.php:74
-#, php-format
-msgid "There was an error deleting this entry: %s"
-msgstr "Beim Löschen des Eintrags ist ein Fehler aufgetreten: %s"
-
-#: data.php:154
-msgid "There were no entries to export."
-msgstr "Es konnten keine Einträge zum Exportieren gefunden werden."
-
-#: lib/Forms/Entry.php:116
-msgid "Title"
-msgstr "Titel"
-
-#: templates/search/headers.inc:43 lib/Forms/Entry.php:108
-msgid "Type"
-msgstr "Typ"
-
-#: lib/Forms/DeleteClass.php:58
-#, php-format
-msgid "Unable to delete \"%s\": %s"
-msgstr "\"%s\" kann nicht gelöscht werden: %s"
-
-#: lib/Driver.php:88
-#, php-format
-msgid "Unable to load the definition of %s."
-msgstr "Der %s-Treiber konnte nicht geladen werden."
-
-#: lib/Forms/EditClass.php:164
-#, php-format
-msgid "Unable to save class \"%s\": %s"
-msgstr "Die Klasse \"%s\" kann nicht gespeichert werden: %s"
-
-#: templates/list/classes.inc:47 lib/Skoli.php:746 lib/Skoli.php:747
-#: lib/Skoli.php:761 lib/Skoli.php:762
-msgid "Unfiled"
-msgstr "Nicht zugeordnet"
-
-#: lib/Forms/Entry.php:33
-msgid "Update Entry"
-msgstr "Eintrag aktualisieren"
-
-#: entry.php:86
-msgid "View"
-msgstr "Anzeigen"
-
-#: templates/list/students.inc:27
-#, php-format
-msgid "View Entries for \"%s\""
-msgstr "Einträge anzeigen für \"%s\""
-
-#: templates/list/classes.inc:25
-#, php-format
-msgid "View Entries in \"%s\""
-msgstr "Einträge anzeigen in \"%s\""
-
-#: templates/search/entries.inc:21
-msgid "View Entry"
-msgstr "Eintrag anzeigen"
-
-#: lib/Forms/Entry.php:134
-msgid "Weight"
-msgstr "Gewichtung"
-
-#: config/prefs.php.dist:138
-msgid "When a new class is created should we also create a new contact list?"
-msgstr ""
-"Soll beim Erstellen einer neuen Klasse auch eine neue Kontaktliste angelegt "
-"werden?"
-
-#: data.php:35
-msgid "Whole class"
-msgstr "Ganze Klasse"
-
-#: config/schools.php.dist:83 config/schools.php.dist:99
-#: config/schools.php.dist:105
-msgid "Writing"
-msgstr "Schreiben"
-
-#: classes/edit.php:24
-msgid "You are not allowed to change this class."
-msgstr "Sie dürfen diese Klasse nicht ändern."
-
-#: classes/delete.php:26
-msgid "You are not allowed to delete this class."
-msgstr "Sie dürfen diese Klasse nicht löschen."
-
-#: entry.php:30
-msgid "You are not allowed to view this entry."
-msgstr "Sie dürfen diesen Eintrag nicht ansehen."
-
-#: classes/create.php:21
-msgid "You don't have access to any valid addressbook."
-msgstr "Sie haben keinen Zugriff auf ein gültiges Adressbuch."
-
-#: templates/panel.inc:48
-msgid "[Manage Classes]"
-msgstr "[Klassen verwalten]"
-
-#: lib/Skoli.php:504
-msgid "_Export"
-msgstr "_Exportieren"
-
-#: lib/Skoli.php:496
-msgid "_New Entry"
-msgstr "_Neuer Eintrag"
-
-#: lib/Skoli.php:500
-msgid "_Search"
-msgstr "_Suche"
-
-#: templates/search/criteria.inc:21
-msgid "and"
-msgstr "und"
-
-#: templates/search/criteria.inc:35
-msgid "and for Entries with:"
-msgstr "und für Einträge mit:"
-
-#: data.php:160 templates/data/export.inc:1
-msgid "class.csv"
-msgstr "klasse.csv"
-
-#: data.php:164
-msgid "class.tsv"
-msgstr "klasse.tsv"
-
-#: templates/search/criteria.inc:25
-msgid "for"
-msgstr "für"
-
-#: lib/Block/tree_menu.php:35
-#, php-format
-msgid "in %s"
-msgstr "in %s"
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<help>
-
-<entry id="Overview" state="uptodate" md5="e53c2b1aed0d5a7001ff25b698798139">
- <title>Skoli Übersicht</title>
- <heading>Was ist Skoli?</heading>
- <para>
- Skoli ist ein einfaches Verwaltungsmodul für Lehrpersonen. Mehrere
- Kontakte (Studierende) werden zu einer Klasse zusammengefasst. Zu
- jedem Studierenden können anschließend Noten, Beobachtungen, Lernziele
- und Absenzen eingetragen werden. Neben einer Suchfunktion bietet Skoli
- auch eine Exportmöglichkeit im CSV und TSV Format.
- </para>
- </entry>
-
-</help>
+++ /dev/null
-<?xml version='1.0'?>
-<help>
-
-<entry id="Overview">
- <title>Skoli Overview</title>
- <heading>What is Skoli?</heading>
- <para>
- Skoli is a simple administrative module for teachers. Several
- contacts (students) will be summarized to a class. To each
- student one can then enter marks, objectives, outcomes and
- absences. Besides offering a search function Skoli also offers
- an export option in the CSV and TSV formats.
- </para>
-</entry>
-
-</help>
+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Horde Project
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2010-08-17 17:46+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: config/schools.php.dist:55
-msgid "1. class"
-msgstr ""
-
-#: config/schools.php.dist:64
-msgid "1. term"
-msgstr ""
-
-#: config/schools.php.dist:56
-msgid "2. class"
-msgstr ""
-
-#: config/schools.php.dist:69
-msgid "2. term"
-msgstr ""
-
-#: config/schools.php.dist:57
-msgid "3. class"
-msgstr ""
-
-#: config/schools.php.dist:58
-msgid "4. class"
-msgstr ""
-
-#: config/schools.php.dist:59
-msgid "5. class"
-msgstr ""
-
-#: config/schools.php.dist:60
-msgid "6. class"
-msgstr ""
-
-#: lib/Skoli.php:314 lib/Forms/Entry.php:106 lib/Forms/Entry.php:156
-msgid "Absence"
-msgstr ""
-
-#: lib/Forms/Entry.php:156
-msgid "Absence in number of lessons"
-msgstr ""
-
-#: data.php:130 search.php:117 templates/list/headers.inc:68
-#: config/prefs.php.dist:92 config/prefs.php.dist:105
-msgid "Absences"
-msgstr ""
-
-#: data.php:69
-msgid "Absences without valid excuse"
-msgstr ""
-
-#: lib/Driver.php:66
-#, php-format
-msgid "Access for class \"%s\" is denied"
-msgstr ""
-
-#: lib/Forms/Entry.php:166
-msgid "Add"
-msgstr ""
-
-#: lib/Forms/Entry.php:33
-msgid "Add Entry"
-msgstr ""
-
-#: lib/Forms/EditClass.php:79 lib/Forms/EditClass.php:82
-#: lib/Forms/CreateClass.php:92 lib/Forms/CreateClass.php:95
-msgid "Address Book"
-msgstr ""
-
-#: search.php:102
-msgid "All Types"
-msgstr ""
-
-#: search.php:66
-msgid "All classes"
-msgstr ""
-
-#: search.php:75
-msgid "All students"
-msgstr ""
-
-#: config/schools.php.dist:88
-msgid "Appliance"
-msgstr ""
-
-#: config/prefs.php.dist:79 config/prefs.php.dist:115
-msgid "Ascending"
-msgstr ""
-
-#: config/prefs.php.dist:135
-msgid "Ask every time"
-msgstr ""
-
-#: config/prefs.php.dist:137
-msgid "Automatically create a new contact list"
-msgstr ""
-
-#: lib/Forms/DeleteClass.php:39 lib/Forms/DeleteClass.php:45
-msgid "Cancel"
-msgstr ""
-
-#: templates/list/headers.inc:84 lib/Forms/EditClass.php:61
-#: lib/Forms/CreateClass.php:60 config/prefs.php.dist:53
-#: config/prefs.php.dist:69
-msgid "Category"
-msgstr ""
-
-#: templates/classes/list.php:28 classes/index.php:29
-msgid "Change Permissions"
-msgstr ""
-
-#: config/prefs.php.dist:16
-msgid "Change your settings for automatically create contact lists."
-msgstr ""
-
-#: config/prefs.php.dist:9
-msgid "Change your sorting and display options."
-msgstr ""
-
-#: lib/School.php:92 lib/School.php:99 lib/School.php:128 lib/School.php:142
-#: lib/School.php:148 lib/School.php:164 lib/School.php:167
-#: lib/Forms/EditClass.php:70 lib/Forms/EditClass.php:82
-#: lib/Forms/Entry.php:61 lib/Forms/Entry.php:128 lib/Forms/CreateClass.php:74
-#: lib/Forms/CreateClass.php:95
-msgid "Choose:"
-msgstr ""
-
-#: data.php:62 templates/classes/list.php:16 templates/search/headers.inc:34
-#: lib/Forms/Entry.php:61
-msgid "Class"
-msgstr ""
-
-#: templates/classes/list.php:13
-msgid "Class List"
-msgstr ""
-
-#: templates/panel.inc:32 templates/panel.inc:33
-msgid "Classes"
-msgstr ""
-
-#: templates/search/header.inc:8 templates/list/header.inc:7
-msgid "Close Search"
-msgstr ""
-
-#: templates/data/export.inc:11
-msgid "Comma separated values (CSV)"
-msgstr ""
-
-#: lib/Forms/Entry.php:152 lib/Forms/Entry.php:161
-msgid "Comment"
-msgstr ""
-
-#: data.php:125 search.php:162
-msgid "Completed"
-msgstr ""
-
-#: data.php:78
-msgid "Completed outcomes"
-msgstr ""
-
-#: lib/Forms/Entry.php:151
-msgid "Completed?"
-msgstr ""
-
-#: config/schools.php.dist:110
-msgid "Concentration, attention, perseverance"
-msgstr ""
-
-#: config/schools.php.dist:94
-msgid "Construct"
-msgstr ""
-
-#: lib/Forms/CreateClass.php:139
-msgid "Contact List"
-msgstr ""
-
-#: config/prefs.php.dist:15
-msgid "Contact Lists"
-msgstr ""
-
-#: lib/Forms/Entry.php:179
-msgid "Couldn't add the new entry."
-msgstr ""
-
-#: lib/Forms/EditClass.php:159 lib/Forms/CreateClass.php:200
-msgid "Couldn't add the selected students to the class."
-msgstr ""
-
-#: lib/Skoli.php:276 lib/Forms/CreateClass.php:226
-#, php-format
-msgid "Couldn't create the contact list \"%s\"."
-msgstr ""
-
-#: entry.php:59
-#, php-format
-msgid "Couldn't update this entry: %s"
-msgstr ""
-
-#: lib/Forms/CreateClass.php:156
-msgid "Create"
-msgstr ""
-
-#: lib/Forms/CreateClass.php:51
-msgid "Create Class"
-msgstr ""
-
-#: lib/Forms/CreateClass.php:141
-msgid "Create Contact List?"
-msgstr ""
-
-#: templates/classes/list.php:8
-msgid "Create a new Class"
-msgstr ""
-
-#: lib/School.php:83
-msgid "Custom format:"
-msgstr ""
-
-#: config/schools.php.dist:46
-msgid "Custom school"
-msgstr ""
-
-#: templates/search/headers.inc:40 lib/Forms/Entry.php:86
-msgid "Date"
-msgstr ""
-
-#: config/prefs.php.dist:23
-msgid "Define a format for marks"
-msgstr ""
-
-#: entry.php:91 templates/classes/list.php:30 templates/entry/delete.inc:8
-#: classes/index.php:30 lib/Forms/DeleteClass.php:39
-msgid "Delete"
-msgstr ""
-
-#: lib/Forms/DeleteClass.php:34
-#, php-format
-msgid "Delete %s"
-msgstr ""
-
-#: config/prefs.php.dist:80 config/prefs.php.dist:116
-msgid "Descending"
-msgstr ""
-
-#: lib/Forms/EditClass.php:59 lib/Forms/CreateClass.php:58
-msgid "Description"
-msgstr ""
-
-#: config/prefs.php.dist:8
-msgid "Display Options"
-msgstr ""
-
-#: config/prefs.php.dist:136
-msgid "Don't create contact lists"
-msgstr ""
-
-#: entry.php:88 templates/classes/list.php:26 classes/index.php:28
-msgid "Edit"
-msgstr ""
-
-#: templates/list/classes.inc:13
-#, php-format
-msgid "Edit \"%s\""
-msgstr ""
-
-#: lib/Forms/EditClass.php:50
-#, php-format
-msgid "Edit %s"
-msgstr ""
-
-#: templates/search/headers.inc:31 templates/list/headers.inc:44
-msgid "Edit Class"
-msgstr ""
-
-#: entry.php:94 templates/search/entries.inc:5
-msgid "Edit Entry"
-msgstr ""
-
-#: templates/list/headers.inc:89
-msgid "Edit categories and colors"
-msgstr ""
-
-#: config/schools.php.dist:101
-msgid "English"
-msgstr ""
-
-#: config/prefs.php.dist:147
-msgid ""
-"Enter a default name for new contact lists.<br />NOTE: You can use %c, %g or "
-"%s as substitution for the class, grade respectively semester name."
-msgstr ""
-
-#: config/prefs.php.dist:165
-msgid ""
-"Enter some custom marks and separate them by comma (best mark first).<br /"
-">NOTE: You also need to choose \"Custom settings\" above."
-msgstr ""
-
-#: templates/search/headers.inc:46
-msgid "Entry"
-msgstr ""
-
-#: entry.php:100
-#, php-format
-msgid "Entry for \"%s\""
-msgstr ""
-
-#: entry.php:23
-msgid "Entry not found."
-msgstr ""
-
-#: lib/School.php:36
-#, php-format
-msgid "Error loading the school \"%s\" from template."
-msgstr ""
-
-#: data.php:133 search.php:167
-msgid "Excused"
-msgstr ""
-
-#: data.php:68
-msgid "Excused absences"
-msgstr ""
-
-#: lib/Forms/Entry.php:157
-msgid "Excused?"
-msgstr ""
-
-#: config/schools.php.dist:111
-msgid "Exercise processing"
-msgstr ""
-
-#: templates/data/export.inc:32
-msgid "Export"
-msgstr ""
-
-#: data.php:171 templates/data/export.inc:5
-msgid "Export Classes"
-msgstr ""
-
-#: data.php:63
-msgid "Firstname"
-msgstr ""
-
-#: lib/School.php:81
-msgid "Format in numbers"
-msgstr ""
-
-#: lib/School.php:82
-msgid "Format in percent"
-msgstr ""
-
-#: config/schools.php.dist:95
-msgid "French"
-msgstr ""
-
-#: config/prefs.php.dist:7 config/prefs.php.dist:14 config/prefs.php.dist:21
-msgid "General Options"
-msgstr ""
-
-#: lib/Forms/EditClass.php:56 lib/Forms/CreateClass.php:55
-msgid "General Settings"
-msgstr ""
-
-#: config/schools.php.dist:80
-msgid "German"
-msgstr ""
-
-#: templates/list/headers.inc:72 config/prefs.php.dist:50
-#: config/prefs.php.dist:66
-msgid "Grade"
-msgstr ""
-
-#: config/schools.php.dist:96 config/schools.php.dist:102
-msgid "Hearing"
-msgstr ""
-
-#: config/schools.php.dist:81
-msgid "Hearing and Talking"
-msgstr ""
-
-#: config/prefs.php.dist:126
-msgid ""
-"How many characters of the entry details in search view should we allow to "
-"see?"
-msgstr ""
-
-#: config/prefs.php.dist:156
-msgid "How many decimal digits should we round marks to?"
-msgstr ""
-
-#: config/schools.php.dist:86
-msgid "Imagination"
-msgstr ""
-
-#: lib/School.php:121 lib/School.php:125 lib/School.php:136 lib/School.php:137
-#: lib/School.php:143
-msgid "Interdisciplinary"
-msgstr ""
-
-#: templates/list/headers.inc:60 config/prefs.php.dist:90
-#: config/prefs.php.dist:103
-msgid "Last Entry"
-msgstr ""
-
-#: data.php:64
-msgid "Lastname"
-msgstr ""
-
-#: lib/Skoli.php:494 config/prefs.php.dist:33
-msgid "List Classes"
-msgstr ""
-
-#: lib/School.php:102
-msgid "List with custom marks separated by comma (best mark first)"
-msgstr ""
-
-#: templates/list/headers.inc:80 config/prefs.php.dist:52
-#: config/prefs.php.dist:68
-msgid "Location"
-msgstr ""
-
-#: templates/classes/list.php:2 classes/index.php:33
-msgid "Manage Classes"
-msgstr ""
-
-#: lib/Skoli.php:311 lib/Forms/Entry.php:97 lib/Forms/Entry.php:119
-#: lib/Forms/Entry.php:123 lib/Forms/Entry.php:128
-msgid "Mark"
-msgstr ""
-
-#: templates/list/headers.inc:64 config/prefs.php.dist:91
-#: config/prefs.php.dist:104
-msgid "Mark average"
-msgstr ""
-
-#: lib/Forms/Entry.php:119
-msgid "Mark in numbers"
-msgstr ""
-
-#: lib/Forms/Entry.php:123
-msgid "Mark in percent"
-msgstr ""
-
-#: data.php:102 search.php:105 config/prefs.php.dist:22
-msgid "Marks"
-msgstr ""
-
-#: config/schools.php.dist:85
-msgid "Mathematics"
-msgstr ""
-
-#: lib/Block/tree_menu.php:3
-msgid "Menu List"
-msgstr ""
-
-#: config/schools.php.dist:109
-msgid "Motivation to learn and dedication"
-msgstr ""
-
-#: config/schools.php.dist:92
-msgid "Music"
-msgstr ""
-
-#: list.php:14
-msgid "My Classes"
-msgstr ""
-
-#: templates/panel.inc:53
-msgid "My Classes:"
-msgstr ""
-
-#: templates/list/headers.inc:56 lib/Forms/EditClass.php:58
-#: lib/Forms/CreateClass.php:57 lib/Forms/CreateClass.php:146
-#: config/prefs.php.dist:65 config/prefs.php.dist:102
-msgid "Name"
-msgstr ""
-
-#: config/schools.php.dist:91
-msgid "Nature-Human-Environment"
-msgstr ""
-
-#: templates/list/students.inc:5 templates/list/classes.inc:5
-#: templates/list/headers.inc:41 lib/Block/tree_menu.php:25
-#: config/prefs.php.dist:34
-msgid "New Entry"
-msgstr ""
-
-#: data.php:21
-msgid "No classes are currently available. Export is disabled."
-msgstr ""
-
-#: search.php:17
-msgid "No classes are currently available. Searching is disabled."
-msgstr ""
-
-#: templates/list/footers.inc:4
-msgid "No classes match"
-msgstr ""
-
-#: templates/search/footers.inc:4
-msgid "No entries match"
-msgstr ""
-
-#: data.php:133 search.php:167
-msgid "Not excused"
-msgstr ""
-
-#: lib/Skoli.php:312 lib/Forms/Entry.php:100 lib/Forms/Entry.php:146
-msgid "Objective"
-msgstr ""
-
-#: data.php:112 search.php:109
-msgid "Objectives"
-msgstr ""
-
-#: data.php:125 search.php:162
-msgid "Open"
-msgstr ""
-
-#: data.php:79
-msgid "Open outcomes"
-msgstr ""
-
-#: lib/Skoli.php:313 lib/Forms/Entry.php:103 lib/Forms/Entry.php:150
-msgid "Outcome"
-msgstr ""
-
-#: data.php:122 search.php:113
-msgid "Outcomes"
-msgstr ""
-
-#: templates/entry/delete.inc:7
-msgid "Permanently delete this entry?"
-msgstr ""
-
-#: lib/Forms/DeleteClass.php:51
-msgid "Permission denied"
-msgstr ""
-
-#: list.php:56 add.php:17
-msgid "Please create a new Class first."
-msgstr ""
-
-#: config/schools.php.dist:89
-msgid "Problem solving behavior"
-msgstr ""
-
-#: lib/Forms/EditClass.php:54 lib/Forms/CreateClass.php:53
-msgid "Properties"
-msgstr ""
-
-#: config/schools.php.dist:82 config/schools.php.dist:98
-#: config/schools.php.dist:104
-msgid "Reading"
-msgstr ""
-
-#: lib/Forms/DeleteClass.php:37
-#, php-format
-msgid ""
-"Really delete the class \"%s\"? This cannot be undone and all data on this "
-"class will be permanently removed."
-msgstr ""
-
-#: templates/search/criteria.inc:39
-msgid "Reset to Defaults"
-msgstr ""
-
-#: config/schools.php.dist:53
-msgid "Sample school"
-msgstr ""
-
-#: templates/panel.inc:71 lib/Forms/EditClass.php:125 lib/Forms/Entry.php:166
-msgid "Save"
-msgstr ""
-
-#: lib/Forms/EditClass.php:70
-msgid "School"
-msgstr ""
-
-#: lib/Forms/EditClass.php:63 lib/Forms/CreateClass.php:67
-msgid "School Specific Settings"
-msgstr ""
-
-#: config/schools.php.dist:75
-msgid "Schoolhouse 1"
-msgstr ""
-
-#: config/schools.php.dist:76
-msgid "Schoolhouse 2"
-msgstr ""
-
-#: lib/Forms/CreateClass.php:74
-msgid "Schools"
-msgstr ""
-
-#: search.php:124 templates/search/criteria.inc:38
-#: templates/search/header.inc:4 templates/list/header.inc:3
-#: lib/Block/tree_menu.php:44 config/prefs.php.dist:35
-msgid "Search"
-msgstr ""
-
-#: templates/search/criteria.inc:9
-msgid "Search Criterias"
-msgstr ""
-
-#: templates/search/header.inc:3
-msgid "Search Result"
-msgstr ""
-
-#: templates/panel.inc:38
-msgid "Search for Classes:"
-msgstr ""
-
-#: templates/search/criteria.inc:13
-msgid "Search in"
-msgstr ""
-
-#: list.php:86
-#, php-format
-msgid "Search: Results for \"%s\""
-msgstr ""
-
-#: templates/data/export.inc:26
-msgid "Select a student or the whole class to export:"
-msgstr ""
-
-#: templates/data/export.inc:17
-msgid "Select the class to export from:"
-msgstr ""
-
-#: config/prefs.php.dist:54
-msgid "Select the columns that should be shown in the class list view:"
-msgstr ""
-
-#: config/prefs.php.dist:93
-msgid "Select the columns that should be shown in the student list view:"
-msgstr ""
-
-#: templates/data/export.inc:9
-msgid "Select the export format:"
-msgstr ""
-
-#: config/prefs.php.dist:36
-msgid "Select the view to display after login:"
-msgstr ""
-
-#: templates/list/headers.inc:76 config/prefs.php.dist:51
-#: config/prefs.php.dist:67
-msgid "Semester"
-msgstr ""
-
-#: templates/list/headers.inc:52 config/prefs.php.dist:49
-#: config/prefs.php.dist:64
-msgid "Semester End"
-msgstr ""
-
-#: templates/list/headers.inc:48 config/prefs.php.dist:48
-#: config/prefs.php.dist:63
-msgid "Semester Start"
-msgstr ""
-
-#: templates/panel.inc:62
-msgid "Shared Classes:"
-msgstr ""
-
-#: templates/list/students.inc:13
-#, php-format
-msgid "Show \"%s\""
-msgstr ""
-
-#: config/prefs.php.dist:179
-msgid "Show class list options panel?"
-msgstr ""
-
-#: config/prefs.php.dist:188
-msgid "Show students in the class list?"
-msgstr ""
-
-#: templates/panel.inc:43
-msgid "Show students?"
-msgstr ""
-
-#: config/schools.php.dist:87
-msgid "Skills"
-msgstr ""
-
-#: list.php:51
-msgid "Skoli needs an applications who provides contacts (e.g. turba)."
-msgstr ""
-
-#: templates/list/headers.inc:68
-msgid "Sort by Absences"
-msgstr ""
-
-#: templates/list/headers.inc:84
-msgid "Sort by Category"
-msgstr ""
-
-#: templates/search/headers.inc:34
-msgid "Sort by Class"
-msgstr ""
-
-#: templates/search/headers.inc:40
-msgid "Sort by Date"
-msgstr ""
-
-#: templates/list/headers.inc:72
-msgid "Sort by Grade"
-msgstr ""
-
-#: templates/list/headers.inc:60
-msgid "Sort by Last Entry"
-msgstr ""
-
-#: templates/list/headers.inc:80
-msgid "Sort by Location"
-msgstr ""
-
-#: templates/list/headers.inc:64
-msgid "Sort by Mark"
-msgstr ""
-
-#: templates/list/headers.inc:56
-msgid "Sort by Name"
-msgstr ""
-
-#: templates/list/headers.inc:76
-msgid "Sort by Semester"
-msgstr ""
-
-#: templates/list/headers.inc:52
-msgid "Sort by Semester End Date"
-msgstr ""
-
-#: templates/list/headers.inc:48
-msgid "Sort by Semester Start Date"
-msgstr ""
-
-#: templates/search/headers.inc:37
-msgid "Sort by Student Name"
-msgstr ""
-
-#: templates/search/headers.inc:43
-msgid "Sort by Type"
-msgstr ""
-
-#: config/prefs.php.dist:70
-msgid "Sort classes by:"
-msgstr ""
-
-#: config/prefs.php.dist:81
-msgid "Sort direction for classes:"
-msgstr ""
-
-#: config/prefs.php.dist:117
-msgid "Sort direction for students:"
-msgstr ""
-
-#: config/prefs.php.dist:106
-msgid "Sort students by:"
-msgstr ""
-
-#: config/schools.php.dist:93
-msgid "Sport"
-msgstr ""
-
-#: templates/search/headers.inc:37 lib/Forms/Entry.php:78
-#: lib/Forms/Entry.php:80
-msgid "Student"
-msgstr ""
-
-#: lib/Forms/EditClass.php:77 lib/Forms/EditClass.php:90
-#: lib/Forms/EditClass.php:123 lib/Forms/CreateClass.php:90
-#: lib/Forms/CreateClass.php:103 lib/Forms/CreateClass.php:136
-msgid "Students"
-msgstr ""
-
-#: templates/data/export.inc:12
-msgid "Tab separated values (TSV)"
-msgstr ""
-
-#: config/schools.php.dist:97 config/schools.php.dist:103
-msgid "Talking"
-msgstr ""
-
-#: config/schools.php.dist:112
-msgid "Teamwork and autonomy"
-msgstr ""
-
-#: lib/Driver.php:36
-msgid "The School backend is not currently available."
-msgstr ""
-
-#: lib/Driver.php:85
-#, php-format
-msgid "The School backend is not currently available: %s"
-msgstr ""
-
-#: classes/create.php:34
-#, php-format
-msgid "The class \"%s\" has been created."
-msgstr ""
-
-#: classes/delete.php:38
-#, php-format
-msgid "The class \"%s\" has been deleted."
-msgstr ""
-
-#: classes/edit.php:45
-#, php-format
-msgid "The class \"%s\" has been renamed to \"%s\"."
-msgstr ""
-
-#: classes/edit.php:47
-#, php-format
-msgid "The class \"%s\" has been saved."
-msgstr ""
-
-#: entry.php:76
-#, php-format
-msgid "The entry for \"%s\" has been deleted."
-msgstr ""
-
-#: entry.php:61
-#, php-format
-msgid "The entry for \"%s\" has been saved."
-msgstr ""
-
-#: add.php:30
-#, php-format
-msgid "The new entry for \"%s\" has been added."
-msgstr ""
-
-#: lib/Forms/CreateClass.php:147
-msgid ""
-"The substitutions %c, %g or %s will be replaced automatically by the class, "
-"grade respectively semester name."
-msgstr ""
-
-#: templates/list/empty.inc:2
-msgid "There are no classes matching the current criteria."
-msgstr ""
-
-#: templates/search/empty.inc:2
-msgid "There are no entries matching the current criteria."
-msgstr ""
-
-#: entry.php:74
-#, php-format
-msgid "There was an error deleting this entry: %s"
-msgstr ""
-
-#: data.php:154
-msgid "There were no entries to export."
-msgstr ""
-
-#: lib/Forms/Entry.php:116
-msgid "Title"
-msgstr ""
-
-#: templates/search/headers.inc:43 lib/Forms/Entry.php:108
-msgid "Type"
-msgstr ""
-
-#: lib/Forms/DeleteClass.php:58
-#, php-format
-msgid "Unable to delete \"%s\": %s"
-msgstr ""
-
-#: lib/Driver.php:88
-#, php-format
-msgid "Unable to load the definition of %s."
-msgstr ""
-
-#: lib/Forms/EditClass.php:164
-#, php-format
-msgid "Unable to save class \"%s\": %s"
-msgstr ""
-
-#: templates/list/classes.inc:47 lib/Skoli.php:746 lib/Skoli.php:747
-#: lib/Skoli.php:761 lib/Skoli.php:762
-msgid "Unfiled"
-msgstr ""
-
-#: lib/Forms/Entry.php:33
-msgid "Update Entry"
-msgstr ""
-
-#: entry.php:86
-msgid "View"
-msgstr ""
-
-#: templates/list/students.inc:27
-#, php-format
-msgid "View Entries for \"%s\""
-msgstr ""
-
-#: templates/list/classes.inc:25
-#, php-format
-msgid "View Entries in \"%s\""
-msgstr ""
-
-#: templates/search/entries.inc:21
-msgid "View Entry"
-msgstr ""
-
-#: lib/Forms/Entry.php:134
-msgid "Weight"
-msgstr ""
-
-#: config/prefs.php.dist:138
-msgid "When a new class is created should we also create a new contact list?"
-msgstr ""
-
-#: data.php:35
-msgid "Whole class"
-msgstr ""
-
-#: config/schools.php.dist:83 config/schools.php.dist:99
-#: config/schools.php.dist:105
-msgid "Writing"
-msgstr ""
-
-#: classes/edit.php:24
-msgid "You are not allowed to change this class."
-msgstr ""
-
-#: classes/delete.php:26
-msgid "You are not allowed to delete this class."
-msgstr ""
-
-#: entry.php:30
-msgid "You are not allowed to view this entry."
-msgstr ""
-
-#: classes/create.php:21
-msgid "You don't have access to any valid addressbook."
-msgstr ""
-
-#: templates/panel.inc:48
-msgid "[Manage Classes]"
-msgstr ""
-
-#: lib/Skoli.php:504
-msgid "_Export"
-msgstr ""
-
-#: lib/Skoli.php:496
-msgid "_New Entry"
-msgstr ""
-
-#: lib/Skoli.php:500
-msgid "_Search"
-msgstr ""
-
-#: templates/search/criteria.inc:21
-msgid "and"
-msgstr ""
-
-#: templates/search/criteria.inc:35
-msgid "and for Entries with:"
-msgstr ""
-
-#: data.php:160 templates/data/export.inc:1
-msgid "class.csv"
-msgstr ""
-
-#: data.php:164
-msgid "class.tsv"
-msgstr ""
-
-#: templates/search/criteria.inc:25
-msgid "for"
-msgstr ""
-
-#: lib/Block/tree_menu.php:35
-#, php-format
-msgid "in %s"
-msgstr ""
+++ /dev/null
-Deny from all
+++ /dev/null
-CREATE TABLE skoli_classes_students (
- class_id VARCHAR(255) NOT NULL,
- student_id VARCHAR(255) NOT NULL
-);
-
-CREATE INDEX skoli_classlist_idx ON skoli_classes_students (class_id);
-CREATE INDEX skoli_studentlist_idx ON skoli_classes_students (student_id);
-
-CREATE TABLE skoli_objects (
- object_id VARCHAR(32) NOT NULL,
- object_owner VARCHAR(255) NOT NULL,
- object_uid VARCHAR(255) NOT NULL,
- class_id VARCHAR(255) NOT NULL,
- student_id VARCHAR(255) NOT NULL,
- object_time INT NOT NULL,
- object_type VARCHAR(255) NOT NULL,
- PRIMARY KEY (object_id)
-);
-
-CREATE INDEX skoli_objectlist_idx ON skoli_objects (object_owner);
-CREATE INDEX skoli_uid_idx ON skoli_objects (object_uid);
-CREATE INDEX skoli_classlist_idx ON skoli_objects (class_id);
-CREATE INDEX skoli_studentlist_idx ON skoli_objects (student_id);
-
-CREATE TABLE skoli_object_attributes (
- object_id VARCHAR(32) NOT NULL,
- attr_name VARCHAR(50) NOT NULL,
- attr_value VARCHAR(255),
- PRIMARY KEY (object_id, attr_name)
-);
-CREATE INDEX skoli_object_attributes_object_idx ON skoli_object_attributes (object_id);
-
-CREATE TABLE skoli_shares (
- share_id INT NOT NULL,
- share_name VARCHAR(255) NOT NULL,
- share_owner VARCHAR(32) NOT NULL,
- share_flags SMALLINT NOT NULL DEFAULT 0,
- perm_creator SMALLINT NOT NULL DEFAULT 0,
- perm_default SMALLINT NOT NULL DEFAULT 0,
- perm_guest SMALLINT NOT NULL DEFAULT 0,
- attribute_name VARCHAR(255) NOT NULL,
- attribute_desc VARCHAR(255),
- attribute_school VARCHAR(255) NOT NULL,
- attribute_grade VARCHAR(255),
- attribute_semester VARCHAR(255),
- attribute_start INT NOT NULL,
- attribute_end INT NOT NULL,
- attribute_category VARCHAR(255) NULL,
- attribute_location VARCHAR(255),
- attribute_marks VARCHAR(255),
- attribute_address_book VARCHAR(255) NOT NULL,
- PRIMARY KEY (share_id)
-);
-
-CREATE INDEX skoli_shares_share_name_idx ON skoli_shares (share_name);
-CREATE INDEX skoli_shares_share_owner_idx ON skoli_shares (share_owner);
-CREATE INDEX skoli_shares_perm_creator_idx ON skoli_shares (perm_creator);
-CREATE INDEX skoli_shares_perm_default_idx ON skoli_shares (perm_default);
-CREATE INDEX skoli_shares_perm_guest_idx ON skoli_shares (perm_guest);
-CREATE INDEX skoli_shares_attribute_category_idx ON skoli_shares (attribute_category);
-CREATE INDEX skoli_shares_attribute_address_book_idx ON skoli_shares (attribute_address_book);
-
-CREATE TABLE skoli_shares_groups (
- share_id INT NOT NULL,
- group_uid VARCHAR(255) NOT NULL,
- perm SMALLINT NOT NULL
-);
-
-CREATE INDEX skoli_shares_groups_share_id_idx ON skoli_shares_groups (share_id);
-CREATE INDEX skoli_shares_groups_group_uid_idx ON skoli_shares_groups (group_uid);
-CREATE INDEX skoli_shares_groups_perm_idx ON skoli_shares_groups (perm);
-
-CREATE TABLE skoli_shares_users (
- share_id INT NOT NULL,
- user_uid VARCHAR(255) NOT NULL,
- perm SMALLINT NOT NULL
-);
-
-CREATE INDEX skoli_shares_users_share_id_idx ON skoli_shares_users (share_id);
-CREATE INDEX skoli_shares_users_user_uid_idx ON skoli_shares_users (user_uid);
-CREATE INDEX skoli_shares_users_perm_idx ON skoli_shares_users (perm);
+++ /dev/null
-<?php
-/**
- * Copyright 2000-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file LICENSE for license information (ASL). If you
- * did not receive this file, see http://www.horde.org/licenses/asl.php.
- *
- * @author Martin Blumenthal <tinu@humbapa.ch>
- */
-
-require_once dirname(__FILE__) . '/lib/base.php';
-
-$classes = Skoli::listClasses();
-
-/* If there are no valid classes, abort. */
-if (count($classes) == 0) {
- $notification->push(_("No classes are currently available. Searching is disabled."), 'horde.error');
- require SKOLI_TEMPLATES . '/common-header.inc';
- require SKOLI_TEMPLATES . '/menu.inc';
- require $registry->get('templates', 'horde') . '/common-footer.inc';
- exit;
-}
-
-$actionID = Horde_Util::getFormData('actionID');
-
-if (!isset($_SESSION['skoli'])) {
- $_SESSION['skoli'] = array();
-}
-
-if (($classid = Horde_Util::getFormData('class')) !== null) {
- $_SESSION['skoli']['search_classid'] = $classid;
-} else if (isset($_SESSION['skoli']['search_classid'])) {
- $classid = $_SESSION['skoli']['search_classid'];
-}
-if (($studentid = Horde_Util::getFormData('student')) !== null) {
- $_SESSION['skoli']['search_studentid'] = $studentid;
-} else if (isset($_SESSION['skoli']['search_studentid'])) {
- $studentid = $_SESSION['skoli']['search_studentid'];
-}
-if (($type = Horde_Util::getFormData('type')) !== null) {
- $_SESSION['skoli']['search_type'] = $type;
-} else if (isset($_SESSION['skoli']['search_type'])) {
- $type = $_SESSION['skoli']['search_type'];
-}
-if (($search = Horde_Util::getFormData('stext')) !== null) {
- $_SESSION['skoli']['search_stext'] = $search;
-} else if (isset($_SESSION['skoli']['search_stext'])) {
- $search = $_SESSION['skoli']['search_stext'];
-}
-
-/* Sort out the sorting values */
-$sortby = Horde_Util::getFormData('sortby');
-$sortdir = Horde_Util::getFormData('sortdir');
-if ($sortby === null) {
- $sortby = SKOLI_SORT_CLASS;
-} else if ($sortby == Horde_Util::getFormData('sortby')) {
- $sortdir = !$sortdir;
-}
-if ($sortdir === null) {
- $sortdir = SKOLI_SORT_ASCEND;
-}
-
-$class_options = array();
-if (count($classes) > 1) {
- $class_options[] = '<option value="all">' .
- htmlspecialchars(_("All classes")) . "</option>\n";
-}
-foreach ($classes as $key=>$class) {
- $class_options[] = '<option value="' . htmlspecialchars($key) . '"' . ($classid == $key ? ' selected="selected"' : '') . '>' .
- htmlspecialchars($class->get('name')) . "</option>\n";
-}
-
-$student_options = array();
-$student_options[] = '<option value="all">' .
- htmlspecialchars(_("All students")) . "</option>\n";
-if ($classid == '' || $classid == 'all') {
- $studentslist = Skoli::listStudents(null, SKOLI_SORT_NAME, SKOLI_SORT_ASCEND);
- $students = array();
- foreach ($studentslist as $val) {
- $students = array_merge($students, $val['_students']);
- }
-} else {
- $studentslist = current(Skoli::listStudents($classid, SKOLI_SORT_NAME, SKOLI_SORT_ASCEND));
- $students = $studentslist['_students'];
-}
-$foundstudent = false;
-foreach ($students as $address) {
- if ($studentid == $address['student_id']) {
- $foundstudent = true;
- }
- $student_options[] = '<option value="' . htmlspecialchars($address['student_id']) . '"' . ($studentid == $address['student_id'] ? ' selected="selected"' : '') . '">' .
- htmlspecialchars($address[$conf['addresses']['name_field']]) . "</option>\n";
-}
-if (!$foundstudent && $studentid != 'all') {
- $actionID = '';
- $studentid = '';
- $_SESSION['skoli']['search_studentid'] = $studentid;
-}
-
-$type_options = array();
-$type_options[] = '<option value="all">' .
- htmlspecialchars(_("All Types")) . "</option>\n";
-if ($conf['objects']['allow_marks']) {
- $type_options[] = '<option value="mark"' . ($type == 'mark' ? ' selected="selected"' : '') . '>' .
- htmlspecialchars(_("Marks")) . "</option>\n";
-}
-if ($conf['objects']['allow_objectives']) {
- $type_options[] = '<option value="objective"' . ($type == 'objective' ? ' selected="selected"' : '') . '>' .
- htmlspecialchars(_("Objectives")) . "</option>\n";
-}
-if ($conf['objects']['allow_outcomes']) {
- $type_options[] = '<option value="outcome"' . ($type == 'outcome' ? ' selected="selected"' : '') . '>' .
- htmlspecialchars(_("Outcomes")) . "</option>\n";
-}
-if ($conf['objects']['allow_absences']) {
- $type_options[] = '<option value="absence"' . ($type == 'absence' ? ' selected="selected"' : '') . '>' .
- htmlspecialchars(_("Absences")) . "</option>\n";
-}
-
-Horde::addInlineScript(array(
- '$("stext").focus()'
-), 'dom');
-
-$title = _("Search");
-
-Horde::addScriptFile('quickfinder.js', 'horde');
-Horde::addScriptFile('effects.js', 'horde');
-Horde::addScriptFile('redbox.js', 'horde');
-require SKOLI_TEMPLATES . '/common-header.inc';
-require SKOLI_TEMPLATES . '/menu.inc';
-reset($classes);
-require SKOLI_TEMPLATES . '/search/criteria.inc';
-
-if ($actionID == 'search') {
- $params = array($search);
- $list = Skoli::listEntries($classid == 'all' ? null : $classid, $studentid == 'all' ? null : $studentid, $type == 'all' ? null : $type, $params, $sortby, $sortdir);
-
- $dynamic_sort = false;
- $params = array('actionID' => 'search');
- $baseurl = Horde_Util::addParameter('search.php', $params);
- echo '<div id="page">';
- require SKOLI_TEMPLATES . '/search/header.inc';
- if (count($list) > 0) {
- require SKOLI_TEMPLATES . '/search/headers.inc';
- foreach ($list as $entry) {
- $style = 'linedRow';
- $details = '';
-
- switch ($entry['type']) {
- case 'mark':
- $details = $entry['subject'] . ': ' . $entry['mark'] .
- ($classes[$entry['classid']]->get('marks') == 'percent' ? '%' : '') .
- ' (' . $entry['weight'] . '), ' . $entry['title'];
- break;
-
- case 'objective':
- $details = $entry['category'] . ' (' . $entry['subject'] . '): ' . $entry['objective'];
- break;
-
- case 'outcome':
- $details = $entry['outcome'] . ': ' .
- (isset($entry['completed']) && $entry['completed'] != '' ? _("Completed") : _("Open")) .
- (isset($entry['comment']) && $entry['comment'] != '' ? ', ' . $entry['comment'] : '');
- break;
-
- case 'absence':
- $details = (isset($entry['excused']) && $entry['excused'] != '' ? _("Excused") : _("Not excused")) .
- ': ' . $entry['absence'] .
- (isset($entry['comment']) && $entry['comment'] != '' ? ', ' . $entry['comment'] : '');
- break;
- }
- $detailswrapped = Horde_String::wordwrap($details, $prefs->getValue('entry_details_wrap'), '<br />', true);
- $entry['details'] = current(explode('<br />', $detailswrapped));
- require SKOLI_TEMPLATES . '/search/entries.inc';
- }
-
- require SKOLI_TEMPLATES . '/search/footers.inc';
-
- if ($dynamic_sort) {
- Horde::addScriptFile('tables.js', 'horde');
- }
- } else {
- require SKOLI_TEMPLATES . '/search/empty.inc';
- }
-}
-
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<h1 class="header">
- <?php echo _("Manage Classes") ?>
-</h1>
-
-<div id="class-list-buttons">
- <form method="get" action="create.php">
-<?php echo Horde_Util::formInput() ?>
- <input type="submit" class="button" value="<?php echo _("Create a new Class") ?>" />
- </form>
-</div>
-
-<?php if (count($sorted_classes) > 0): ?>
-<table summary="<?php echo _("Class List") ?>" cellspacing="0" id="class-list" class="striped sortable">
- <thead>
- <tr>
- <th class="sortdown"><?php echo _("Class") ?></th>
- <th class="class-list-icon nosort" colspan="<?php echo empty($conf['share']['no_sharing']) ? 3 : 2 ?>"> </th>
- </tr>
- </thead>
-
- <tbody>
-<?php foreach (array_keys($sorted_classes) as $class_id): ?>
- <?php $class = $classes[$class_id] ?>
- <tr>
- <td><?php echo htmlspecialchars($class->get('name')) ?></td>
- <td><a href="<?php echo Horde_Util::addParameter($edit_url_base, 'c', $class->getName()) ?>" title="<?php echo _("Edit") ?>"><?php echo $edit_img ?></a></td>
-<?php if (empty($conf['share']['no_sharing'])): ?>
- <td><a onclick="<?php echo Horde::popupJs($perms_url_base, array('params' => array('share' => $class->getName()), 'urlencode' => true)) ?>return false;" href="<?php echo Horde_Util::addParameter($perms_url_base, 'share', $class->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
-<?php endif; ?>
- <td><a href="<?php echo Horde_Util::addParameter($delete_url_base, 'c', $class->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
- </tr>
-<?php endforeach; ?>
- </tbody>
-</table>
-<?php endif; ?>
+++ /dev/null
-<?php
-if (isset($language)) {
- header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
- header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Skoli: Copyright 2004-2008 The Horde Project. Skoli is under a Horde license. -->
-<!-- Horde Project: http://www.horde.org/ | Skoli: http://www.horde.org/horde/ -->
-<!-- Horde Licenses: http://www.horde.org/licenses/ -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
- $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-
-$bc = $prefs->getValue('show_panel')
- ? 'rightPanel'
- : '';
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-<link href="<?php echo Horde_Themes::img('favicon.ico', array('nohorde' => true)) ?>" rel="SHORTCUT ICON" />
-<?php Horde_Themes::includeStylesheetFiles() ?>
-<link href="<?php echo Horde::url('themes/categoryCSS.php') ?>" rel="stylesheet" type="text/css" />
-</head>
-
-<body<?php if ($bc) echo ' class="' . $bc . '"' ?>>
+++ /dev/null
-<form method="post" name="skoli_exportform" id="skoli_exportform" action="<?php echo Horde::downloadUrl(_("class.csv"), null, Horde::url('data.php')) ?>">
-<input type="hidden" name="actionID" value="export" />
-
-<h1 class="header">
- <?php echo _("Export Classes") ?>
-</h1>
-
-<div class="item" style="padding:1em">
- <?php echo Horde::label('exportID', _("Select the export format:")) ?><br />
- <select name="exportID" id="exportID">
- <option value="<?php echo EXPORT_CSV ?>"<?php echo Horde_Util::getFormData('exportID') == EXPORT_CSV ? ' selected="selected"' : '' ?>><?php echo _("Comma separated values (CSV)") ?></option>
- <option value="<?php echo EXPORT_TSV ?>"<?php echo Horde_Util::getFormData('exportID') == EXPORT_TSV ? ' selected="selected"' : '' ?>><?php echo _("Tab separated values (TSV)") ?></option>
- </select><br />
-
-<?php if (count($classes) > 1): ?>
- <br />
- <?php echo Horde::label('class', _("Select the class to export from:")) ?><br />
- <select name="class" id="class" onchange="if (this.value) { document.skoli_exportform.actionID.value=''; RedBox.loading(); document.skoli_exportform.submit() }">
- <?php echo implode('', $class_options) ?>
- </select><br />
-<?php else: ?>
- <input type="hidden" name="class" value="<?php echo key($classes) ?>" />
-<?php endif; ?>
- <br />
-
- <?php echo Horde::label('student', _("Select a student or the whole class to export:")) ?><br />
- <select name="student" id="student">
- <?php echo implode('', $student_options) ?>
- </select><br />
- <br />
-
- <input type="submit" value="<?php echo _("Export") ?>" class="button" />
-</div>
-</form>
+++ /dev/null
-<form action="entry.php" method="post">
-<?php echo Horde_Util::formInput() ?>
-<input type="hidden" name="actionID" value="delete" />
-<input type="hidden" name="entry" value="<?php echo $entry['object_id'] ?>" />
-<input type="hidden" name="view" value="<?php echo $viewName ?>" />
-<div class="headerbox" style="padding: 8px">
- <p><?php echo _("Permanently delete this entry?") ?></p>
- <input type="submit" class="button" name="delete" value="<?php echo _("Delete") ?>" />
-</div>
-</form>
+++ /dev/null
-<tr class="<?php echo $style ?>">
- <td>
- <?php
- if ($class['_edit']) {
- $label = _("New Entry");
- echo Horde::link(Horde_Util::addParameter(Horde::url('add.php'), 'class', $class['_id']), $label) . Horde::img('add.png', $label) . '</a>';
- }
- ?>
- </td>
- <td>
- <?php
- if ($class['_edit']) {
- $label = sprintf(_("Edit \"%s\""), $class['name']);
- echo Horde::link(Horde_Util::addParameter(Horde::url('classes/edit.php'), 'c', $class['_id']), $label) . Horde::img('edit.png', $label) . '</a>';
- }
- ?>
- </td>
-<?php if (in_array('semesterstart', $class_columns)): ?>
- <td><?php echo strftime($dateFormat, $class['start']) ?> </td>
-<?php endif; if (in_array('semesterend', $class_columns)): ?>
- <td><?php echo strftime($dateFormat, $class['end']) ?> </td>
-<?php endif; ?>
- <td>
- <?php
- $label = sprintf(_("View Entries in \"%s\""), $class['name']);
- $params = array(
- 'actionID' => 'search',
- 'class' => $class['_id'],
- 'student' => 'all'
- );
- echo Horde::link(Horde_Util::addParameter(Horde::url('search.php'), $params), $label) . htmlspecialchars($class['name']) . '</a>';
- ?>
- </td>
-<?php if (in_array('lastentry', $student_columns)): ?>
- <td> </td>
-<?php endif; if (in_array('summarks', $student_columns)): ?>
- <td> </td>
-<?php endif; if (in_array('sumabsences', $student_columns)): ?>
- <td> </td>
-<?php endif; if (in_array('grade', $class_columns)): ?>
- <td><?php echo htmlspecialchars($class['grade']) ?> </td>
-<?php endif; if (in_array('semester', $class_columns)): ?>
- <td><?php echo htmlspecialchars($class['semester']) ?> </td>
-<?php endif; if (in_array('location', $class_columns)): ?>
- <td><?php echo htmlspecialchars($class['location']) ?> </td>
-<?php endif; if (in_array('category', $class_columns)): ?>
- <td class="category<?php echo md5($class['category']) ?>"><?php echo isset($class['category']) ? htmlspecialchars($class['category']) : _("Unfiled") ?></td>
-<?php endif; ?>
-</tr>
+++ /dev/null
-<p class="text">
- <em><?php echo _("There are no classes matching the current criteria.") ?></em>
-<p>
+++ /dev/null
-</tbody>
-</table>
-<div id="classes_empty">
- <?php echo _("No classes match") ?>
-</div>
-</div>
+++ /dev/null
-<div class="header leftAlign">
- <?php echo htmlspecialchars($title) ?>
- <a id="quicksearchL" href="<?php echo Horde::url('search.php') ?>" title="<?php echo _("Search") ?>" onclick="$('quicksearchL').hide(); $('quicksearch').show(); $('quicksearchT').focus(); return false;"><?php echo Horde::img('search.png', _("Search")) ?></a>
- <div id="quicksearch" style="display:none">
- <input type="text" name="quicksearchT" id="quicksearchT" for="classes-body" empty="classes_empty" />
- <small>
- <a title="<?php echo _("Close Search") ?>" href="#" onclick="$('quicksearch').hide(); $('quicksearchT').value = ''; QuickFinder.filter($('quicksearchT')); $('quicksearchL').show(); return false;">X</a>
- </small>
- </div>
-</div>
+++ /dev/null
-<?php $sortdirclass_class = $sortdir_class ? 'sortup' : 'sortdown' ?>
-<?php $sortdirclass_student = $sortdir_student ? 'sortup' : 'sortdown' ?>
-
-<script type="text/javascript">
-
-var PREFS_UPDATE_TIMEOUT;
-
-function table_sortCallback(tableId, column, sortDown)
-{
- if (typeof PREFS_UPDATE_TIMEOUT != "undefined") {
- window.clearTimeout(PREFS_UPDATE_TIMEOUT);
- }
-
- PREFS_UPDATE_TIMEOUT = window.setTimeout('doPrefsUpdate("' + column + '", "' + sortDown + '")', 300);
-}
-
-function doPrefsUpdate(column, sortDown)
-{
- baseurl = '<?php echo Horde::getServiceLink('prefsui', 'skoli') ?>';
- try {
- column = column.substring(1);
- prefscope = 'class';
- if (column == 'lastentry' || column == 'comment') {
- prefscope = 'student';
- }
- new Ajax.Request(baseurl, { parameters: { pref: 'sortby_' + prefscope, value: encodeURIComponent(column) } });
- new Ajax.Request(baseurl, { parameters: { pref: 'sortdir_' + prefscope, value: encodeURIComponent(sortDown) } });
- if (column == 'name') {
- new Ajax.Request(baseurl, { parameters: { pref: 'sortby_student', value: encodeURIComponent(column) } });
- new Ajax.Request(baseurl, { parameters: { pref: 'sortdir_student', value: encodeURIComponent(sortDown) } });
- }
- } catch (e) {}
-}
-
-</script>
-
-<table id="classes" cellspacing="0" class="sortable nowrap">
-<thead>
- <tr class="item leftAlign">
- <th width="2%" class="nosort">
- <?php echo Horde::img('add.png', _("New Entry")) ?>
- </th>
- <th width="2%" class="nosort">
- <?php echo Horde::img('edit.png', _("Edit Class")) ?>
- </th>
-<?php if (in_array('semesterstart', $class_columns)): ?>
- <th id="s<?php echo SKOLI_SORT_SEMESTERSTART ?>"<?php if ($sortby_class == SKOLI_SORT_SEMESTERSTART) echo ' class="' . $sortdirclass_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_SEMESTERSTART)), _("Sort by Semester Start Date"), 'sortlink', '', '', _("Semester Start")) ?>
- </th>
-<?php endif; if (in_array('semesterend', $class_columns)): ?>
- <th id="s<?php echo SKOLI_SORT_SEMESTEREND ?>"<?php if ($sortby_class == SKOLI_SORT_SEMESTEREND) echo ' class="' . $sortdirclass_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_SEMESTEREND)), _("Sort by Semester End Date"), 'sortlink', '', '', _("Semester End")) ?>
- </th>
-<?php endif; ?>
- <th id="s<?php echo SKOLI_SORT_NAME ?>"<?php if ($sortby_class == SKOLI_SORT_NAME) echo ' class="' . $sortdirclass_class . '"' ?>>
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_NAME)), _("Sort by Name"), 'sortlink', '', '', _("Name")) ?>
- </th>
-<?php if (in_array('lastentry', $student_columns)): ?>
- <th id="s<?php echo SKOLI_SORT_LASTENTRY ?>"<?php if ($sortby_student == SKOLI_SORT_LASTENTRY) echo ' class="' . $sortdirclass_student . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby_student', SKOLI_SORT_LASTENTRY)), _("Sort by Last Entry"), 'sortlink', '', '', _("Last Entry")) ?>
- </th>
-<?php endif; if (in_array('summarks', $student_columns)): ?>
- <th id="s<?php echo SKOLI_SORT_SUMMARKS ?>"<?php if ($sortby_student == SKOLI_SORT_SUMMARKS) echo ' class="' . $sortdirclass_student . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby_student', SKOLI_SORT_SUMMARKS)), _("Sort by Mark"), 'sortlink', '', '', _("Mark average")) ?>
- </th>
-<?php endif; if (in_array('sumabsences', $student_columns)): ?>
- <th id="s<?php echo SKOLI_SORT_SUMABSENCES ?>"<?php if ($sortby_student == SKOLI_SORT_SUMABSENCES) echo ' class="' . $sortdirclass_student . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby_student', SKOLI_SORT_SUMABSENCES)), _("Sort by Absences"), 'sortlink', '', '', _("Absences")) ?>
- </th>
-<?php endif; if (in_array('grade', $class_columns)): ?>
- <th id="s<?php echo SKOLI_SORT_GRADE ?>"<?php if ($sortby_class == SKOLI_SORT_GRADE) echo ' class="' . $sortdirclass_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_GRADE)), _("Sort by Grade"), 'sortlink', '', '', _("Grade")) ?>
- </th>
-<?php endif; if (in_array('semester', $class_columns)): ?>
- <th id="s<?php echo SKOLI_SORT_SEMESTER ?>"<?php if ($sortby_class == SKOLI_SORT_SEMESTER) echo ' class="' . $sortdirclass_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_SEMESTER)), _("Sort by Semester"), 'sortlink', '', '', _("Semester")) ?>
- </th>
-<?php endif; if (in_array('location', $class_columns)): ?>
- <th id="s<?php echo SKOLI_SORT_LOCATION ?>"<?php if ($sortby_class == SKOLI_SORT_LOCATION) echo ' class="' . $sortdirclass_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_LOCATION)), _("Sort by Location"), 'sortlink', '', '', _("Location")) ?>
- </th>
-<?php endif; if (in_array('category', $class_columns)): ?>
- <th id="s<?php echo SKOLI_SORT_CATEGORY ?>"<?php if ($sortby_class == SKOLI_SORT_CATEGORY) echo ' class="' . $sortdirclass_class . '"' ?> width="10%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_CATEGORY)), _("Sort by Category"), 'sortlink', '', '', _("Category")) ?>
- <?php
- if ($GLOBALS['registry']->getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
- !$GLOBALS['prefs']->isLocked('category_colors'))) {
- $categoryUrl = Horde_Util::addParameter(Horde::getServiceLink('prefs', 'horde'), array('group' => 'categories'));
- echo ' ' . Horde::link($categoryUrl, _("Edit categories and colors"), '', '_blank', Horde::popupJs($categoryUrl, array('urlencode' => true)) . 'return false;') . Horde::img('colorpicker.png', _("Edit categories and colors")) . '</a>';
- }
- ?>
- </th>
-<?php endif; ?>
- </tr>
-</thead>
-<tbody id="classes-body">
+++ /dev/null
-<tr class="<?php echo $style ?>">
- <td>
- <?php
- if ($class['_edit']) {
- $label = _("New Entry");
- echo Horde::link(Horde_Util::addParameter(Horde::url('add.php'), array('class'=>$class['_id'], 'student'=>$student['__key'])), $label) . Horde::img('add.png', $label) . '</a>';
- }
- ?>
- </td>
- <td>
- <?php
- if ($registry->hasMethod('contacts/show')) {
- $label = sprintf(_("Show \"%s\""), $student[$conf['addresses']['name_field']]);
- $url = $registry->link('contacts/show', array('source' => $class['address_book'],
- 'key' => $student['__key']));
- echo Horde::link($url, $label) . Horde::img('user.png', $label) . '</a>';
- }
- ?>
- </td>
-<?php if (in_array('semesterstart', $class_columns)): ?>
- <td> </td>
-<?php endif; if (in_array('semesterend', $class_columns)): ?>
- <td> </td>
-<?php endif; ?>
- <td>
- <?php
- $label = sprintf(_("View Entries for \"%s\""), $student[$conf['addresses']['name_field']]);
- $params = array(
- 'actionID' => 'search',
- 'class' => $class['_id'],
- 'student' => $student['__key']
- );
- echo $treeIcon . ' ' . Horde::link(Horde_Util::addParameter(Horde::url('search.php'), $params), $label) . htmlspecialchars($student[$conf['addresses']['name_field']]) . '</a>';
- ?>
- </td>
-<?php if (in_array('lastentry', $student_columns)): ?>
- <td><?php echo isset($student['_lastentry']) ? strftime($dateFormat, $student['_lastentry']) : '' ?> </td>
-<?php endif; if (in_array('summarks', $student_columns)): ?>
- <td style="text-align: center;"><?php echo $student['_summarks'] != '' ? $student['_summarks'] : ' ' ?></td>
-<?php endif; if (in_array('sumabsences', $student_columns)): ?>
- <td style="text-align: center;"><?php echo $student['_sumabsences'][2] ?></td>
-<?php endif; if (in_array('grade', $class_columns)): ?>
- <td> </td>
-<?php endif; if (in_array('semester', $class_columns)): ?>
- <td> </td>
-<?php endif; if (in_array('location', $class_columns)): ?>
- <td> </td>
-<?php endif; if (in_array('category', $class_columns)): ?>
- <td> </td>
-<?php endif; ?>
-</tr>
+++ /dev/null
-<div id="menu">
- <?php echo Skoli::getMenu()->render() ?>
-</div>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
-<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
+++ /dev/null
-<?php
-Horde::addScriptFile('quickfinder.js', 'horde');
-
-$current_user = $GLOBALS['registry']->getAuth();
-$my_classes = array();
-$shared_classes = array();
-foreach (Skoli::listClasses() as $id => $cl) {
- if ($cl->get('owner') && $cl->get('owner') == $current_user) {
- $my_classes[$id] = $cl;
- } else {
- $shared_classes[$id] = $cl;
- }
-}
-?>
-
-<div id="pageControls">
-<script type="text/javascript">
-function sbarToggle()
-{
- var pref_value;
- if (Element.hasClassName(document.body, 'rightPanel')) {
- pref_value = 0;
- Element.removeClassName(document.body, 'rightPanel');
- } else {
- pref_value = 1;
- Element.addClassName(document.body, 'rightPanel');
- }
-
- new Ajax.Request('<?php echo Horde::getServiceLink('ajax', 'skoli')->url ?>setPrefValue', { parameters: { pref: 'show_panel', value: pref_value } });
-}
-</script>
-<a id="sbarShow" href="#" onclick="sbarToggle(); return false;"><?php echo _("Classes") ?></a>
-<a id="sbarHide" href="#" onclick="sbarToggle(); return false;"><?php echo _("Classes") ?></a>
-
-<div id="pageControlsInner">
-<form action="<?php echo Horde::selfUrl() ?>" method="post">
-<?php echo Horde_Util::formInput() ?>
- <h4><?php echo _("Search for Classes:") ?></h4>
- <p>
- <input id="classSearch" type="text" for="myclasses,sharedclasses" />
- </p>
- <p>
- <label><input type="checkbox" class="checkbox" name="show_students" value="1"<?php echo ($prefs->getValue('show_students') ? ' checked="checked"' : '') . ' /> ' . _("Show students?") ?></label>
- </p>
-
-<?php if ($GLOBALS['registry']->getAuth()): ?>
- <p>
- <a href="<?php echo Horde::url('classes/') ?>"><?php echo _("[Manage Classes]") ?></a>
- </p>
-<?php endif; ?>
-
-<?php if (count($my_classes)): ?>
- <h4><?php echo _("My Classes:") ?></h4>
- <ul id="myclasses">
-<?php foreach ($my_classes as $id => $cl): ?>
- <li><label><input type="checkbox" class="checkbox" name="display_class[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_classes) ? ' checked="checked"' : '') . ' /> ' . htmlspecialchars($cl->get('name')) ?></label></li>
-<?php endforeach; ?>
- </ul>
-<?php endif; ?>
-
-<?php if (count($shared_classes)): ?>
- <h4><?php echo _("Shared Classes:") ?></h4>
- <ul id="sharedclasses">
-<?php foreach ($shared_classes as $id => $cl): ?>
- <li><label><input type="checkbox" class="checkbox" name="display_class[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_classes) ? ' checked="checked"' : '') . ' /> ' . ($cl->get('owner') ? '[' . htmlspecialchars($registry->convertUsername($cl->get('owner'), false)) . '] ' : '') . htmlspecialchars($cl->get('name')) ?></label></li>
-<?php endforeach; ?>
- </ul>
-<?php endif; ?>
-
- <p>
- <input type="submit" value="<?php echo _("Save") ?>" class="button" />
- </p>
-</form>
-
-</div>
-</div>
+++ /dev/null
-<?php
-/* Build the directory sources select widget. */
-
-?>
-<form name="skoli_searchform" action="search.php" method="get" onsubmit="RedBox.loading(); return true;">
-<input type="hidden" name="actionID" value="search" />
-
-<h1 class="header">
- <?php echo _("Search Criterias") ?>
-</h1>
-
-<div class="text" style="padding:1em">
-<strong><?php echo Horde::label('class', _("Search in")) ?></strong>
-<?php if (count($classes) > 1): ?>
- <select name="class" id="class" onchange="if (this.value) { document.skoli_searchform.actionID.value='<?php echo $actionID ?>'; RedBox.loading(); document.skoli_searchform.submit() }">
- <?php echo implode('', $class_options) ?>
- </select>
-<?php else: ?>
- <strong><?php echo current($classes)->get('name') ?></strong>
-<?php endif; ?>
-<strong> <?php echo Horde::label('student', _("and")) ?></strong>
-<select name="student" id="student">
- <?php echo implode('', $student_options) ?>
-</select>
-<strong> <?php echo Horde::label('type', _("for")) ?></strong>
-<select name="type" id="type">
- <?php echo implode('', $type_options) ?>
-</select><br />
-
-<br />
-
-<table cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td>
- <strong><?php echo Horde::label('stext', _("and for Entries with:")) ?></strong>
- <input type="text" size="30" id="stext" name="stext" value="<?php echo htmlspecialchars($search) ?>" />
- <td style="text-align: center;">
- <input type="submit" class="button" name="search" value="<?php echo _("Search") ?>" />
- <input type="reset" class="button" name="reset" value="<?php echo _("Reset to Defaults") ?>" />
- </td>
- </tr>
-</table>
-</div>
-</form>
+++ /dev/null
-<p class="text">
- <em><?php echo _("There are no entries matching the current criteria.") ?></em>
-<p>
+++ /dev/null
-<tr class="<?php echo $style ?>">
- <td>
- <?php
- if ($entry['_edit']) {
- $label = _("Edit Entry");
- $params = array(
- 'view' => 'EditEntry',
- 'entry' => $entry['_id']
- );
- echo Horde::link(Horde_Util::addParameter(Horde::url('entry.php'), $params), $label) . Horde::img('edit.png', $label) . '</a>';
- }
- ?>
- </td>
- <td><?php echo htmlspecialchars($entry['class']) ?> </td>
- <td>
- <?php
- $params = array(
- 'view' => 'Entry',
- 'entry' => $entry['_id']
- );
- echo Horde::link(Horde_Util::addParameter(Horde::url('entry.php'), $params), _("View Entry")) . htmlspecialchars($entry['student']) . '</a> ';
- ?>
- </td>
- <td><?php echo htmlspecialchars($entry['date']) ?> </td>
- <td><?php echo htmlspecialchars($entry['typename']) ?> </td>
- <td><?php echo htmlspecialchars($entry['details']) ?> </td>
-</tr>
+++ /dev/null
-</tbody>
-</table>
-<div id="entries_empty">
- <?php echo _("No entries match") ?>
-</div>
-</div>
+++ /dev/null
-<br />
-<div class="header leftAlign">
- <?php echo htmlspecialchars(_("Search Result")) ?>
- <a id="quicksearchL" href="<?php echo Horde::url('search.php') ?>" title="<?php echo _("Search") ?>" onclick="$('quicksearchL').hide(); $('quicksearch').show(); $('quicksearchT').focus(); return false;"><?php echo Horde::img('search.png', _("Search")) ?></a>
- <div id="quicksearch" style="display:none">
- <input type="text" name="quicksearchT" id="quicksearchT" for="entries-body" empty="entries_empty" />
- <small>
- <a title="<?php echo _("Close Search") ?>" href="#" onclick="$('quicksearch').hide(); $('quicksearchT').value = ''; QuickFinder.filter($('quicksearchT')); $('quicksearchL').show(); return false;">X</a>
- </small>
- </div>
-</div>
+++ /dev/null
-<?php $sortdir_class = $sortdir ? 'sortup' : 'sortdown' ?>
-
-<script type="text/javascript">
-
-var PREFS_UPDATE_TIMEOUT;
-
-function table_sortCallback(tableId, column, sortDown)
-{
- if (typeof PREFS_UPDATE_TIMEOUT != "undefined") {
- window.clearTimeout(PREFS_UPDATE_TIMEOUT);
- }
-
- PREFS_UPDATE_TIMEOUT = window.setTimeout('doPrefsUpdate("' + column + '", "' + sortDown + '")', 300);
-}
-
-function doPrefsUpdate(column, sortDown)
-{
- try {
- column = column.substring(1);
- new Ajax.Request('<?php echo Horde::getServiceLink('ajax', 'skoli')->url ?>setPrefValue', { parameters: { pref: 'sortby', value: column } });
- } catch (e) {}
-}
-
-</script>
-
-<table id="entries" cellspacing="0" class="sortable nowrap">
-<thead>
- <tr class="item leftAlign">
- <th width="2%" class="nosort">
- <?php echo Horde::img('edit.png', _("Edit Class")) ?>
- </th>
- <th id="s<?php echo SKOLI_SORT_CLASS ?>"<?php if ($sortby == SKOLI_SORT_CLASS) echo ' class="' . $sortdir_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby', SKOLI_SORT_CLASS)), _("Sort by Class"), 'sortlink', '', '', _("Class")) ?>
- </th>
- <th id="s<?php echo SKOLI_SORT_STUDENT ?>"<?php if ($sortby == SKOLI_SORT_STUDENT) echo ' class="' . $sortdir_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby', SKOLI_SORT_STUDENT)), _("Sort by Student Name"), 'sortlink', '', '', _("Student")) ?>
- </th>
- <th id="s<?php echo SKOLI_SORT_DATE ?>"<?php if ($sortby == SKOLI_SORT_DATE) echo ' class="' . $sortdir_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby', SKOLI_SORT_DATE)), _("Sort by Date"), 'sortlink', '', '', _("Date")) ?>
- </th>
- <th id="s<?php echo SKOLI_SORT_TYPE ?>"<?php if ($sortby == SKOLI_SORT_TYPE) echo ' class="' . $sortdir_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::url(Horde_Util::addParameter($baseurl, 'sortby', SKOLI_SORT_TYPE)), _("Sort by Type"), 'sortlink', '', '', _("Type")) ?>
- </th>
- <th class="nosort">
- <?php echo _("Entry") ?>
- </th>
- </tr>
-</thead>
-<tbody id="entries-body">
+++ /dev/null
-<?php
-/**
- * Copyright 1999-2008 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Chuck Hagenbuch <chuck@horde.org>
- */
-
-$skoli_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-header('Content-Type: text/css');
-
-$cManager = new Horde_Prefs_CategoryManager();
-
-$colors = $cManager->colors();
-$fgColors = $cManager->fgColors();
-foreach ($colors as $category => $color) {
- if ($category == '_unfiled_' || $category == '_default_') {
- continue;
- }
-
- $class = '.category' . md5($category);
-
- echo "$class, .linedRow td$class, .overdue td$class, .closed td$class { "
- . 'color: ' . (isset($fgColors[$category]) ? $fgColors[$category] : $fgColors['_default_']) . '; '
- . 'background: ' . $color . '; '
- . "padding: 0 4px; }\n";
-}
+++ /dev/null
-#classes {
- width: 100%;
-}
-
-.QuickFinderNoMatch {
- display: none;
-}
-#classes_empty {
- padding: 4px;
- font-style: italic;
-}
-
-#quicksearch {
- display: inline;
-}
-#quicksearch input {
- background-image: url("graphics/search.png");
- background-repeat: no-repeat;
- background-position: 2px center;
- padding: 1px 0 1px 20px;
-}
-#quicksearch a {
- display: inline-block;
- padding: 2px 4px;
-}
-
-/* Added for class list panel */
-body.rightPanel #page {
- margin-right: 10em;
-}
-body #pageControlsInner {
- display: none;
-}
-body #sbarShow, body #sbarHide {
- padding-left: 18px;
- white-space: nowrap;
-}
-body #sbarShow {
- display: block;
- background: transparent url("graphics/plus.png") center left no-repeat;
-}
-body #sbarHide {
- display: none;
- background: transparent url("graphics/minus.png") center left no-repeat;
-}
-body.rightPanel #pageControlsInner {
- display: block;
-}
-body.rightPanel #sbarShow {
- display: none;
-}
-body.rightPanel #sbarHide {
- display: block;
-}
-body.rightPanel ul {
- list-style-type: none;
-}
-
-#pageControls {
- position: absolute;
- top: -8px;
- right: 0;
- background: #eee;
- border: 1px solid #ccc;
- padding: 4px;
- -moz-border-radius-bottomleft: 10px;
- -webkit-border-bottom-left-radius: 10px;
-}
-#pageControls #classSearch {
- background-image: url("graphics/search.png");
- background-repeat: no-repeat;
- background-position: 2px center;
- border: 1px solid #ccc;
- padding: 2px 0 2px 20px;
-}
-#pageControls h3 {
- font-size: 100%;
- margin-top: 1em;
-}
-#pageControls h4 {
- font-size: 90%;
- margin-top: .5em;
-}
-
-/* Tables. */
-table#class-list {
- width: 99%;
- margin: 0 0 8px 5px;
- border-top: 1px solid #ddd;
- border-left: 1px solid #ddd;
-}
-table#class-list th {
- padding: 3px;
- background: #e9e9e9;
- border-right: 1px solid #ccc;
- text-align: left;
-}
-table#class-list td {
- padding: 3px;
- border-right: 1px solid #ddd;
- border-bottom: 1px solid #ddd;
-}
-table#class-list th.sortup {
- background: #bbcbff url("graphics/za.png") center left no-repeat;
- padding-left: 10px;
-}
-table#class-list th.sortdown {
- background: #bbcbff url("graphics/az.png") center left no-repeat;
- padding-left: 10px;
-}
-
-#class-list-buttons {
- padding: 1em;
-}
-#class-list-buttons form {
- display: inline;
-}
-.class-list-icon {
- width: 1%;
-}
-
-.class-info {
- cursor: pointer;
-}