From: Chuck Hagenbuch Date: Sun, 3 Oct 2010 16:27:10 +0000 (-0400) Subject: Remove unmaintained/dead applications X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0d3a559c058aa995b7764d85b80df42f50324938;p=horde.git Remove unmaintained/dead applications --- diff --git a/babel/COPYING b/babel/COPYING deleted file mode 100644 index a6b67561a..000000000 --- a/babel/COPYING +++ /dev/null @@ -1,280 +0,0 @@ - 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. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/babel/README b/babel/README deleted file mode 100644 index e05f7f649..000000000 --- a/babel/README +++ /dev/null @@ -1,86 +0,0 @@ -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 diff --git a/babel/commit.php b/babel/commit.php deleted file mode 100644 index 05879697d..000000000 --- a/babel/commit.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @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'; diff --git a/babel/config/hooks.php.dist b/babel/config/hooks.php.dist deleted file mode 100644 index f67eae5be..000000000 --- a/babel/config/hooks.php.dist +++ /dev/null @@ -1,28 +0,0 @@ - - -Thanks to Michael Wallner for File_Gettext PEAR library. - - -Localization -============ - -===================== ====================================================== -French Joel Vandal -===================== ====================================================== diff --git a/babel/docs/TODO b/babel/docs/TODO deleted file mode 100644 index 44a17420c..000000000 --- a/babel/docs/TODO +++ /dev/null @@ -1,8 +0,0 @@ -============================= - Babel Development TODO List -============================= - -:Contact: joel@scopsev.com - -- Add support for Obsolete strings. - diff --git a/babel/download.php b/babel/download.php deleted file mode 100644 index 8a3a2e3b0..000000000 --- a/babel/download.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @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; diff --git a/babel/edit.php b/babel/edit.php deleted file mode 100644 index 83a4df105..000000000 --- a/babel/edit.php +++ /dev/null @@ -1,108 +0,0 @@ - - * @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'; diff --git a/babel/extract.php b/babel/extract.php deleted file mode 100644 index 3c3f91995..000000000 --- a/babel/extract.php +++ /dev/null @@ -1,119 +0,0 @@ - - * @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'; diff --git a/babel/index.php b/babel/index.php deleted file mode 100644 index a6d12cd52..000000000 --- a/babel/index.php +++ /dev/null @@ -1,21 +0,0 @@ - - * @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'; diff --git a/babel/lib/Application.php b/babel/lib/Application.php deleted file mode 100644 index 9b4289515..000000000 --- a/babel/lib/Application.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @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; - } - -} diff --git a/babel/lib/Babel.php b/babel/lib/Babel.php deleted file mode 100644 index a906131aa..000000000 --- a/babel/lib/Babel.php +++ /dev/null @@ -1,304 +0,0 @@ - - * @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 .= ''; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - - $html .= '' . "\n"; - return $html; - } - - function LanguageSelection() { - global $app; - - $html = ''; - $html .= ''; - $html .= '
'; - $html .= ' '; - $html .= ''; - $html .= ''; - $html .= ' '; - $html .= '
'; - $html .= '
'; - - $html .= '' . "\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 .= '
'; - $msg .= '' . _("Please be patient ...") . ''; - $msg .= '
'; - $msg .= '
'; - 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 .= '
'; - - $msg .= '
'; - echo ''; - flush(); - } - - function RB_close() { - echo ''; - } - -} diff --git a/babel/lib/Display.php b/babel/lib/Display.php deleted file mode 100644 index fd1fe09ca..000000000 --- a/babel/lib/Display.php +++ /dev/null @@ -1,136 +0,0 @@ - - * @package Babel - */ - -class Translate_Display { - - function header($msg, $msg2 = '') { - global $cnt_i, $registry; - $select_img = Horde::img('alerts/message.png'); - print sprintf('
%s%s%s
', $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('
%s%s
', $item, $msg, $select_img); - } else { - print sprintf('
%s%s
', $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('
%s%s
', $item, $msg, $select_img); - flush(); - } - - function info($msg = "", $bold = true) { - - global $cnt_i, $registry; - - if (empty($msg)) { - echo "
"; - } else { - - $item = ($cnt_i++ % 2); - - $select_img = Horde::img('alerts/select.png'); - if ($bold) { - print sprintf('
%s%s
', $item, $msg, $select_img); - } else { - print sprintf('
%s%s
', $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 = '', $r1, $r2); - } else { - $r .= sprintf('', $r1, $r2); - } - } - - $r = '
'; - $html .= ''; - $html .= ''; - - if ($percent > 0) { - $html .= ''; - } - - if ($percent != 100) { - $html .= ''; - } - } - - $html .= '
'; - } else { - $html .= ' ' . $percent .'%
'; - - return $html; - } - -} diff --git a/babel/lib/Translate.php b/babel/lib/Translate.php deleted file mode 100644 index 21ea23fb1..000000000 --- a/babel/lib/Translate.php +++ /dev/null @@ -1,748 +0,0 @@ - - * @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, '', $offset)) !== false) { - $left += 9; - $buffer = ''; - $linespan = 0; - while (($end = strpos($line, '', $left)) === false) { - $buffer .= substr($line, $left); - $left = 0; - $line = fgets($fp, 4096); - $linespan++; - if ($line === false) { - Translate_Display::error((sprintf(_(" 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 '
'; - echo ''; - echo sprintf('', 'Module', 'Language', 'Translated', 'Fuzzy', 'Untranslated'); - - $i = 0; - foreach($stats_array as $app => $info) { - foreach($info as $locale => $message) { - echo sprintf('', - ($i++ %2), $app, $locale, $messages[0], $messages[1], $messages[2]); - } - } - echo '
%s%s%s%s%s
%s%s%s%s%s
'; - - 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(); - } - } - } -} - diff --git a/babel/lib/Translate_Help.php b/babel/lib/Translate_Help.php deleted file mode 100644 index 36cf332ea..000000000 --- a/babel/lib/Translate_Help.php +++ /dev/null @@ -1,238 +0,0 @@ - - * @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, '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, '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(); - } - } - } -} diff --git a/babel/lib/base.php b/babel/lib/base.php deleted file mode 100644 index 149b82885..000000000 --- a/babel/lib/base.php +++ /dev/null @@ -1,110 +0,0 @@ - - * @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; -} diff --git a/babel/locale/.htaccess b/babel/locale/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/babel/locale/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/babel/locale/babel.pot b/babel/locale/babel.pot deleted file mode 100644 index 2d8647c3d..000000000 --- a/babel/locale/babel.pot +++ /dev/null @@ -1,563 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Horde Project -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , 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 \n" -"Language-Team: LANGUAGE \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 "" -" 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 "" diff --git a/babel/locale/fr/LC_MESSAGES/babel.mo b/babel/locale/fr/LC_MESSAGES/babel.mo deleted file mode 100644 index e93d8fd23..000000000 Binary files a/babel/locale/fr/LC_MESSAGES/babel.mo and /dev/null differ diff --git a/babel/locale/fr/LC_MESSAGES/babel.po b/babel/locale/fr/LC_MESSAGES/babel.po deleted file mode 100644 index 16dbc8c81..000000000 --- a/babel/locale/fr/LC_MESSAGES/babel.po +++ /dev/null @@ -1,493 +0,0 @@ -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 "" -" tag not closed in file %s.\n" -"Opening tag found in line %d." -msgstr "" -"La balise 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" diff --git a/babel/make.php b/babel/make.php deleted file mode 100644 index 151dad8b5..000000000 --- a/babel/make.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @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'; diff --git a/babel/reset.php b/babel/reset.php deleted file mode 100644 index 5f1a0927c..000000000 --- a/babel/reset.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @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'; diff --git a/babel/stats.php b/babel/stats.php deleted file mode 100644 index b97664028..000000000 --- a/babel/stats.php +++ /dev/null @@ -1,120 +0,0 @@ - - * @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 ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - $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"; - } else { - echo "\n"; - } - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\t"; - $last_key = $key; - } - - echo '
' . _("Language") . '' . _("Locale") . '' . _("Status") . '' . _("Translated") . '' . _("Fuzzy") . '' . _("Untranslated") . '' . _("Obsolete") . '
" . Horde_Nls::$config['languages'][$key] . "" . Horde::link(Horde_Util::addParameter(Horde::url('view.php'), array('display_language' => $key, 'module' => $_app))) . $key . '' . "" . Translate_Display::create_bargraph($value[2], $value[0]) . "" . $value[2] . "" . $value [3] . "" . $value[4] . "" . $value[5] . "
'; - - Translate_Display::info(); - } - - Babel::RB_close(); -} - -require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/babel/templates/common-header.inc b/babel/templates/common-header.inc deleted file mode 100644 index 3a4bd4491..000000000 --- a/babel/templates/common-header.inc +++ /dev/null @@ -1,25 +0,0 @@ -getCharset()); - header('Vary: Accept-Language'); -} -?> - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); - -?> -<?php echo $page_title ?> - - - - diff --git a/babel/templates/index.php b/babel/templates/index.php deleted file mode 100644 index c6bd159ac..000000000 --- a/babel/templates/index.php +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - _("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 ''; - echo ''; - echo ''; - echo ''; - } -} -?> -
-

- Command -

-
-

- Description -

-
' . $cmd['text'] . '
diff --git a/babel/templates/layout.html b/babel/templates/layout.html deleted file mode 100644 index ec84ebc8e..000000000 --- a/babel/templates/layout.html +++ /dev/null @@ -1,14 +0,0 @@ - -
- - - - - -
-
diff --git a/babel/themes/graphics/babel.png b/babel/themes/graphics/babel.png deleted file mode 100644 index 8e4f3923d..000000000 Binary files a/babel/themes/graphics/babel.png and /dev/null differ diff --git a/babel/themes/graphics/checked.gif b/babel/themes/graphics/checked.gif deleted file mode 100644 index 56cacd3b5..000000000 Binary files a/babel/themes/graphics/checked.gif and /dev/null differ diff --git a/babel/themes/graphics/config.png b/babel/themes/graphics/config.png deleted file mode 100644 index c26fabf75..000000000 Binary files a/babel/themes/graphics/config.png and /dev/null differ diff --git a/babel/themes/graphics/down.png b/babel/themes/graphics/down.png deleted file mode 100644 index b6892f0b9..000000000 Binary files a/babel/themes/graphics/down.png and /dev/null differ diff --git a/babel/themes/graphics/edit.png b/babel/themes/graphics/edit.png deleted file mode 100644 index 3a082d3ec..000000000 Binary files a/babel/themes/graphics/edit.png and /dev/null differ diff --git a/babel/themes/graphics/extract.png b/babel/themes/graphics/extract.png deleted file mode 100644 index 1248de057..000000000 Binary files a/babel/themes/graphics/extract.png and /dev/null differ diff --git a/babel/themes/graphics/list.png b/babel/themes/graphics/list.png deleted file mode 100644 index 8f29061da..000000000 Binary files a/babel/themes/graphics/list.png and /dev/null differ diff --git a/babel/themes/graphics/locked.png b/babel/themes/graphics/locked.png deleted file mode 100644 index b1a998397..000000000 Binary files a/babel/themes/graphics/locked.png and /dev/null differ diff --git a/babel/themes/graphics/make.png b/babel/themes/graphics/make.png deleted file mode 100644 index 9fc79ccbf..000000000 Binary files a/babel/themes/graphics/make.png and /dev/null differ diff --git a/babel/themes/graphics/sample.png b/babel/themes/graphics/sample.png deleted file mode 100644 index 21cfa0096..000000000 Binary files a/babel/themes/graphics/sample.png and /dev/null differ diff --git a/babel/themes/graphics/unchecked.gif b/babel/themes/graphics/unchecked.gif deleted file mode 100644 index bb87f1c5e..000000000 Binary files a/babel/themes/graphics/unchecked.gif and /dev/null differ diff --git a/babel/themes/graphics/up.png b/babel/themes/graphics/up.png deleted file mode 100644 index 35acc28ba..000000000 Binary files a/babel/themes/graphics/up.png and /dev/null differ diff --git a/babel/themes/graphics/upload.png b/babel/themes/graphics/upload.png deleted file mode 100644 index e1cce6da3..000000000 Binary files a/babel/themes/graphics/upload.png and /dev/null differ diff --git a/babel/themes/graphics/view.png b/babel/themes/graphics/view.png deleted file mode 100644 index 8f29061da..000000000 Binary files a/babel/themes/graphics/view.png and /dev/null differ diff --git a/babel/upload.php b/babel/upload.php deleted file mode 100644 index a9b979ca7..000000000 --- a/babel/upload.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @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'; diff --git a/babel/view.php b/babel/view.php deleted file mode 100644 index 8d976408c..000000000 --- a/babel/view.php +++ /dev/null @@ -1,504 +0,0 @@ - - * @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 . ' '; - } else { - $hmenu = ''; - } - - Translate_Display::header(_("Meta Informations"), $hmenu); - echo ''; - $i = 0; - foreach($po->meta as $k => $v) { - echo ''; - } - echo '
'; - echo $k; - echo ''; - echo htmlentities($v); - echo '
'; - Translate_Display::info(); - - Translate_Display::header(_("Statistic")); - - $report = Translate::stats($app, $lang); - - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - echo "\n"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\t"; - - echo '
' . _("Language") . '' . _("Locale") . '' . _("Status") . '' . _("Translated") . '' . _("Fuzzy") . '' . _("Untranslated") . '' . _("Obsolete") . '
" . Horde_Nls::$config['languages'][$lang] . "" . $lang . "" . Translate_Display::create_bargraph(@$report[$lang][2], @$report[$lang][0]) . "" . @$report[$lang][2] . "" . @$report[$lang] [3] . "" . @$report[$lang][4] . "" . @$report[$lang][5] . "
'; - Translate_Display::info(); - - $filter_html = ''; - $filter_html .= '
'; - $filter_html .= ''; - $filter_html .= Horde::img('edit.png') . ' '; - $filter_html .= '' . _("Filter: ") . ''; - $filter_html .= '[ '; - if (!$filter) { - $hmenu_desc = '' . _("All") . ''; - } 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 . ' '; - $filter_html .= '| '; - - if ($filter == 'translated') { - $hmenu_desc = '' . _("Translated") . ''; - } 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 . ' '; - $filter_html .= '| '; - - - if ($filter == 'fuzzy') { - $hmenu_desc = '' . _("Fuzzy") . ''; - } 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 . ' '; - $filter_html .= '| '; - - if ($filter == 'untranslated') { - $hmenu_desc = '' . _("Untranslated") . ''; - } 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 . ' '; - $filter_html .= '] '; - - $filter_html .= ''; - $filter_html .= ''; - $filter_html .= ''; - $filter_html .= ''; - $filter_html .= ''; - $filter_html .= ''; - $filter_html .= '
'; - - $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 = ' [' . sprintf(_("%s to %s of %s"), $start, $end, $numitem) . ']'; - 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 '
'; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - - - ?> - - - - - - - - - - - - - - - -
MSGIDREFERENCESSTATUS
-
  -
- - -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 . ''; - $surl = str_replace('&', '&', $surl); - } else { - $surl = $sline; - } - - $ref[$sfile][] = $surl; - } - } - - $i = 0; - foreach($ref as $k => $v) { - echo sprintf("", ($i++ %2), $k, implode(' | ', $v)); - } - ?> -
%s[ %s ]
-
-status[$msgid])) { - echo '' . ' php-format
'; - } else { - echo '' . ' php-format
'; - } - if (in_array('fuzzy', $po->status[$msgid])) { - echo '' . ' fuzzy
'; - } else { - echo '' . ' fuzzy
'; - } - } else { - echo implode('
', $po->status[$msgid]); - } - ?> - -
- - - - - -
MSGSTR - $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") . ""; - } elseif ($editmode && $cstring == $encstr) { - echo ''; - echo ' '; - echo ''; - } - } - } -?>
-
-' . Translate_Display::display_string($msgstr) . '
'; - } 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
", $m[4], $m[2]); - } - } else { - echo Translate_Display::display_string($msgstr) . "
"; - } - } -?>  -
-

-'; - } - - // print "STAT " . implode(', ', $po->status[$msgid]) . "
"; - } -} - -?> - - $perpage): ?> - -
- $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); -?> -
- - -get('templates', 'horde') . '/common-footer.inc'; diff --git a/babel/viewsource.php b/babel/viewsource.php deleted file mode 100644 index 74228d7b5..000000000 --- a/babel/viewsource.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @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)."
"; - } else { - $r2 = ereg_replace("(<\?php )+", "", highlight_string(""; - } - - if ($r1 == $sline) { - $r .= sprintf('

%s %s
%s %s
' . $r . '
'; - - echo "
".$r."
"; -} diff --git a/crumb/COPYING b/crumb/COPYING deleted file mode 100644 index a6b67561a..000000000 --- a/crumb/COPYING +++ /dev/null @@ -1,280 +0,0 @@ - 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. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/crumb/LICENSE.ASL b/crumb/LICENSE.ASL deleted file mode 100644 index 80a80caeb..000000000 --- a/crumb/LICENSE.ASL +++ /dev/null @@ -1,48 +0,0 @@ -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 . diff --git a/crumb/LICENSE.BSDL b/crumb/LICENSE.BSDL deleted file mode 100644 index ea2f0d10b..000000000 --- a/crumb/LICENSE.BSDL +++ /dev/null @@ -1,24 +0,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: - - - 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. diff --git a/crumb/README b/crumb/README deleted file mode 100644 index 6a3190491..000000000 --- a/crumb/README +++ /dev/null @@ -1,86 +0,0 @@ -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 diff --git a/crumb/addclient.php b/crumb/addclient.php deleted file mode 100644 index 9335742ad..000000000 --- a/crumb/addclient.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ - -@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'; diff --git a/crumb/config/conf.bak.php b/crumb/config/conf.bak.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/crumb/config/conf.php b/crumb/config/conf.php deleted file mode 100644 index 55865e188..000000000 --- a/crumb/config/conf.php +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Storage System Settings - sql - - - - crumb_clients - - - - - - - - Menu Settings - - - - - - - diff --git a/crumb/config/prefs.php.dist b/crumb/config/prefs.php.dist deleted file mode 100644 index 391652271..000000000 --- a/crumb/config/prefs.php.dist +++ /dev/null @@ -1,21 +0,0 @@ - _("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.") -); diff --git a/crumb/contactsearch.php b/crumb/contactsearch.php deleted file mode 100644 index 4d8518490..000000000 --- a/crumb/contactsearch.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ - -@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'; diff --git a/crumb/docs/CHANGES b/crumb/docs/CHANGES deleted file mode 100644 index 141c0cc98..000000000 --- a/crumb/docs/CHANGES +++ /dev/null @@ -1,5 +0,0 @@ ---- -0.1 ---- - -[xyz] Initial Release diff --git a/crumb/docs/CREDITS b/crumb/docs/CREDITS deleted file mode 100644 index 62c26b77a..000000000 --- a/crumb/docs/CREDITS +++ /dev/null @@ -1,24 +0,0 @@ -=========================== - Crumb Development Team -=========================== - - -Core Developers -=============== -Ben Klang - - -Drivers -======= - - - -Localization -============ - -===================== ====================================================== -===================== ====================================================== - - -Contributions -============= diff --git a/crumb/docs/INSTALL b/crumb/docs/INSTALL deleted file mode 100644 index 4d0db66d4..000000000 --- a/crumb/docs/INSTALL +++ /dev/null @@ -1,237 +0,0 @@ -========================= - 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 diff --git a/crumb/docs/RELEASE_NOTES b/crumb/docs/RELEASE_NOTES deleted file mode 100644 index ef85ebaff..000000000 --- a/crumb/docs/RELEASE_NOTES +++ /dev/null @@ -1,49 +0,0 @@ -notes['fm']['focus'] = 4; - -/* Mailing list release notes. */ -$this->notes['ml']['changes'] = <<notes['fm']['changes'] = <<notes['name'] = 'Crumb'; -$this->notes['fm']['project'] = 'crumb'; -$this->notes['fm']['branch'] = 'Default'; diff --git a/crumb/docs/TODO b/crumb/docs/TODO deleted file mode 100644 index bce715fbf..000000000 --- a/crumb/docs/TODO +++ /dev/null @@ -1,5 +0,0 @@ -================================ - Crumb Development TODO List -================================ - -- Example todo diff --git a/crumb/index.php b/crumb/index.php deleted file mode 100644 index 1cbd4a60b..000000000 --- a/crumb/index.php +++ /dev/null @@ -1,11 +0,0 @@ - - */ - -require dirname(__FILE__) . '/listclients.php'; diff --git a/crumb/lib/Application.php b/crumb/lib/Application.php deleted file mode 100644 index d9510ec54..000000000 --- a/crumb/lib/Application.php +++ /dev/null @@ -1,16 +0,0 @@ - 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 = ''; - $html .= ''; - $html .= '
 
'; - - return sprintf($html, $this->_params['color']); - } - -} diff --git a/crumb/lib/Crumb.php b/crumb/lib/Crumb.php deleted file mode 100644 index d7ab8fe70..000000000 --- a/crumb/lib/Crumb.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @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; - } - -} diff --git a/crumb/lib/Driver.php b/crumb/lib/Driver.php deleted file mode 100644 index 7fcbfa3dc..000000000 --- a/crumb/lib/Driver.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @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; - } - } - -} diff --git a/crumb/lib/Driver/sql.php b/crumb/lib/Driver/sql.php deleted file mode 100644 index d12dbd156..000000000 --- a/crumb/lib/Driver/sql.php +++ /dev/null @@ -1,127 +0,0 @@ - - * 'phptype' The database type (e.g. 'pgsql', 'mysql', etc.). - * 'table' The name of the foo table in 'database'. - * 'charset' The database's internal charset. - * - * Required by some database implementations:
- *      '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.
- * - * 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 - * @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; - } - -} diff --git a/crumb/lib/Forms/AddClient.php b/crumb/lib/Forms/AddClient.php deleted file mode 100644 index 9062f0965..000000000 --- a/crumb/lib/Forms/AddClient.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * 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 - * @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; - } -} diff --git a/crumb/lib/Forms/ContactSearch.php b/crumb/lib/Forms/ContactSearch.php deleted file mode 100644 index e6f06d408..000000000 --- a/crumb/lib/Forms/ContactSearch.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * 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 - * @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; - } - } -} diff --git a/crumb/lib/base.php b/crumb/lib/base.php deleted file mode 100644 index 56437d84e..000000000 --- a/crumb/lib/base.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * 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 - */ - -// 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(); diff --git a/crumb/listclients.php b/crumb/listclients.php deleted file mode 100644 index 09af20def..000000000 --- a/crumb/listclients.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ - -@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'; diff --git a/crumb/locale b/crumb/locale deleted file mode 100644 index 26d8318d8..000000000 --- a/crumb/locale +++ /dev/null @@ -1,111 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Horde Project -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , 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 \n" -"Language-Team: LANGUAGE \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 "" diff --git a/crumb/scripts/sql/crumb.sql b/crumb/scripts/sql/crumb.sql deleted file mode 100644 index 355588bef..000000000 --- a/crumb/scripts/sql/crumb.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE crumb_clients ( - client_id INT NOT NULL, - turba_uid VARCHAR(255), - whups_queue INT, - group_id VARCHAR(255), - - PRIMARY KEY (client_id) -); - diff --git a/crumb/templates/common-header.inc b/crumb/templates/common-header.inc deleted file mode 100644 index 1385eaffd..000000000 --- a/crumb/templates/common-header.inc +++ /dev/null @@ -1,29 +0,0 @@ -getCharset()); - header('Vary: Accept-Language'); -} -?> - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - - - diff --git a/crumb/templates/menu.inc b/crumb/templates/menu.inc deleted file mode 100644 index e996c4a13..000000000 --- a/crumb/templates/menu.inc +++ /dev/null @@ -1,5 +0,0 @@ - - -notify(array('listeners' => 'status')) ?> diff --git a/crumb/themes/screen.css b/crumb/themes/screen.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/drag_n_drop_portal/block.php b/drag_n_drop_portal/block.php deleted file mode 100644 index eb3e4886e..000000000 --- a/drag_n_drop_portal/block.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @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()); diff --git a/drag_n_drop_portal/index.php b/drag_n_drop_portal/index.php deleted file mode 100644 index d515a1739..000000000 --- a/drag_n_drop_portal/index.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @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'; -?> - - - - - - - - - - -
- - -get('templates', 'horde') . '/common-footer.inc'; diff --git a/drag_n_drop_portal/js/portal.js b/drag_n_drop_portal/js/portal.js deleted file mode 100644 index 60541be0b..000000000 --- a/drag_n_drop_portal/js/portal.js +++ /dev/null @@ -1,366 +0,0 @@ -// 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; - } - } -}); diff --git a/drag_n_drop_portal/js/portal_edit.js b/drag_n_drop_portal/js/portal_edit.js deleted file mode 100644 index f664f2fe0..000000000 --- a/drag_n_drop_portal/js/portal_edit.js +++ /dev/null @@ -1,204 +0,0 @@ - -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('
' + transport.responseText + '
'); - }, - 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('
' + transport.responseText + '
'); - }, - 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' - }); -} diff --git a/drag_n_drop_portal/lib/Block/Layout/View/js.php b/drag_n_drop_portal/lib/Block/Layout/View/js.php deleted file mode 100644 index a42287da6..000000000 --- a/drag_n_drop_portal/lib/Block/Layout/View/js.php +++ /dev/null @@ -1,110 +0,0 @@ - - * @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 = '
'; - $js = ''; - - $js_init .= 'portal.addWidgetControls("control_buttons");' - . '}' - . 'document.observe("dom:loaded", init); -' - . ''; - - $html .= '
' . "\n" . $js . "\n" . $js_init; - - // Strip any CSS tags out of the returned content so - // they can be handled seperately. - if (preg_match_all('//', $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"; - } -} diff --git a/drag_n_drop_portal/params.php b/drag_n_drop_portal/params.php deleted file mode 100644 index bd6c2e146..000000000 --- a/drag_n_drop_portal/params.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @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 ''; -} 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'; -} diff --git a/drag_n_drop_portal/save.php b/drag_n_drop_portal/save.php deleted file mode 100644 index 08baf62c8..000000000 --- a/drag_n_drop_portal/save.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @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)); diff --git a/drag_n_drop_portal/select.php b/drag_n_drop_portal/select.php deleted file mode 100644 index 855f69686..000000000 --- a/drag_n_drop_portal/select.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @package Folks - */ -define('HORDE_BASE', dirname(__FILE__) . '/..'); -require_once HORDE_BASE . '/lib/base.php'; -require_once 'Horde/Loader.php'; - -?> - - -
- -
-" onclick="return addWidget()" /> -" onclick="return cancelRedBox()" /> - diff --git a/drag_n_drop_portal/templates/portal/params.php b/drag_n_drop_portal/templates/portal/params.php deleted file mode 100644 index 0ffcbcdb8..000000000 --- a/drag_n_drop_portal/templates/portal/params.php +++ /dev/null @@ -1,37 +0,0 @@ -

getName($app, $name)) ?>

-
- - - - - -updateable): ?> - - - - - - - - - - - - - - -
  - -
getParamName($app, $name, $id) ?>: getOptionsWidget($app, $name, $id, $defaults) ?>
-" onclick="return setParams()" /> -" onclick="return cancelRedBox()" /> -
-
diff --git a/drag_n_drop_portal/themes/graphics/bottom_left.gif b/drag_n_drop_portal/themes/graphics/bottom_left.gif deleted file mode 100644 index d324686e3..000000000 Binary files a/drag_n_drop_portal/themes/graphics/bottom_left.gif and /dev/null differ diff --git a/drag_n_drop_portal/themes/graphics/bottom_right.gif b/drag_n_drop_portal/themes/graphics/bottom_right.gif deleted file mode 100644 index 930a8cf0c..000000000 Binary files a/drag_n_drop_portal/themes/graphics/bottom_right.gif and /dev/null differ diff --git a/drag_n_drop_portal/themes/graphics/delete.png b/drag_n_drop_portal/themes/graphics/delete.png deleted file mode 100644 index efdc40694..000000000 Binary files a/drag_n_drop_portal/themes/graphics/delete.png and /dev/null differ diff --git a/drag_n_drop_portal/themes/graphics/edit.png b/drag_n_drop_portal/themes/graphics/edit.png deleted file mode 100644 index 83c9fe470..000000000 Binary files a/drag_n_drop_portal/themes/graphics/edit.png and /dev/null differ diff --git a/drag_n_drop_portal/themes/graphics/minus.png b/drag_n_drop_portal/themes/graphics/minus.png deleted file mode 100644 index 32170460c..000000000 Binary files a/drag_n_drop_portal/themes/graphics/minus.png and /dev/null differ diff --git a/drag_n_drop_portal/themes/graphics/plus.png b/drag_n_drop_portal/themes/graphics/plus.png deleted file mode 100644 index 263e35690..000000000 Binary files a/drag_n_drop_portal/themes/graphics/plus.png and /dev/null differ diff --git a/drag_n_drop_portal/themes/graphics/reload.png b/drag_n_drop_portal/themes/graphics/reload.png deleted file mode 100644 index dcb020450..000000000 Binary files a/drag_n_drop_portal/themes/graphics/reload.png and /dev/null differ diff --git a/drag_n_drop_portal/themes/graphics/tooltip_bg.png b/drag_n_drop_portal/themes/graphics/tooltip_bg.png deleted file mode 100644 index 3448adc87..000000000 Binary files a/drag_n_drop_portal/themes/graphics/tooltip_bg.png and /dev/null differ diff --git a/drag_n_drop_portal/themes/graphics/top_left.gif b/drag_n_drop_portal/themes/graphics/top_left.gif deleted file mode 100644 index dd665b90b..000000000 Binary files a/drag_n_drop_portal/themes/graphics/top_left.gif and /dev/null differ diff --git a/drag_n_drop_portal/themes/graphics/top_right.gif b/drag_n_drop_portal/themes/graphics/top_right.gif deleted file mode 100644 index e46ca3930..000000000 Binary files a/drag_n_drop_portal/themes/graphics/top_right.gif and /dev/null differ diff --git a/drag_n_drop_portal/themes/screen.css b/drag_n_drop_portal/themes/screen.css deleted file mode 100644 index c4f3274fb..000000000 --- a/drag_n_drop_portal/themes/screen.css +++ /dev/null @@ -1,217 +0,0 @@ - -/* 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; -} diff --git a/fima/COPYING b/fima/COPYING deleted file mode 100644 index 5a965fbc5..000000000 --- a/fima/COPYING +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/fima/README b/fima/README deleted file mode 100644 index af2412ca4..000000000 --- a/fima/README +++ /dev/null @@ -1,85 +0,0 @@ -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 diff --git a/fima/account.php b/fima/account.php deleted file mode 100644 index 78cb7be7c..000000000 --- a/fima/account.php +++ /dev/null @@ -1,229 +0,0 @@ - - * - * 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'; diff --git a/fima/accounts.php b/fima/accounts.php deleted file mode 100644 index b4d019857..000000000 --- a/fima/accounts.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * 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 - */ - -@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'; diff --git a/fima/config/.htaccess b/fima/config/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/fima/config/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/fima/config/conf.xml b/fima/config/conf.xml deleted file mode 100644 index 20f244646..000000000 --- a/fima/config/conf.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - Storage System Settings - - sql - - - - fima_accounts - fima_postings - - - - - - - - Menu Settings - - - - - - - diff --git a/fima/config/menu.php.dist b/fima/config/menu.php.dist deleted file mode 100644 index b03d82515..000000000 --- a/fima/config/menu.php.dist +++ /dev/null @@ -1,39 +0,0 @@ - '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. */ diff --git a/fima/config/prefs.php.dist b/fima/config/prefs.php.dist deleted file mode 100644 index 8a06772d3..000000000 --- a/fima/config/prefs.php.dist +++ /dev/null @@ -1,168 +0,0 @@ - _("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:") -); diff --git a/fima/config/report.php.dist b/fima/config/report.php.dist deleted file mode 100644 index 6d64a26e3..000000000 --- a/fima/config/report.php.dist +++ /dev/null @@ -1,13 +0,0 @@ - _("General Overview"), - 'PeriodOverview' => _("Period Overview"), - 'AccountOverview' => _("Account Overview"), - 'AssetOverview' => _("Asset Overview"), - 'Analysis' => _("Analysis"), - 'Trend' => _("Trend"), - ); diff --git a/fima/data.php b/fima/data.php deleted file mode 100644 index 771332b37..000000000 --- a/fima/data.php +++ /dev/null @@ -1,227 +0,0 @@ - - * - * 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 '
'; -} -require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/fima/docs/CHANGES b/fima/docs/CHANGES deleted file mode 100644 index 653ced5c6..000000000 --- a/fima/docs/CHANGES +++ /dev/null @@ -1,12 +0,0 @@ ---- -v1.1 ---- - -[trt] Close accounts. -[trt] Hide null rows in reports. - ---- -v1.0 ---- - -[trt] Initial Release. diff --git a/fima/docs/CREDITS b/fima/docs/CREDITS deleted file mode 100644 index 65c8ce6ff..000000000 --- a/fima/docs/CREDITS +++ /dev/null @@ -1,26 +0,0 @@ -=========================== - Fima Development Team -=========================== - - -Core Developers -=============== - -- Thomas Trethan - - -Localization -============ - -===================== ====================================================== -German Thomas Trethan - 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. diff --git a/fima/docs/INSTALL b/fima/docs/INSTALL deleted file mode 100644 index c21010c9c..000000000 --- a/fima/docs/INSTALL +++ /dev/null @@ -1,225 +0,0 @@ -========================= - 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 diff --git a/fima/docs/RELEASE_NOTES b/fima/docs/RELEASE_NOTES deleted file mode 100644 index d28010628..000000000 --- a/fima/docs/RELEASE_NOTES +++ /dev/null @@ -1,37 +0,0 @@ -notes['fm']['focus'] = 0; - -/* Mailing list release notes. */ -$this->notes['ml']['changes'] = <<notes['fm']['changes'] = <<notes['name'] = 'Fima'; -$this->notes['fm']['project'] = 'fima'; -$this->notes['fm']['branch'] = 'Default'; diff --git a/fima/docs/TODO b/fima/docs/TODO deleted file mode 100644 index 7b2dc61fe..000000000 --- a/fima/docs/TODO +++ /dev/null @@ -1,9 +0,0 @@ -================================ - 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 diff --git a/fima/index.php b/fima/index.php deleted file mode 100644 index 6fc8aec12..000000000 --- a/fima/index.php +++ /dev/null @@ -1,11 +0,0 @@ - - * - * 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 - */ - -require dirname(__FILE__) . '/postings.php'; diff --git a/fima/ledgers/create.php b/fima/ledgers/create.php deleted file mode 100644 index 1b6c9fb30..000000000 --- a/fima/ledgers/create.php +++ /dev/null @@ -1,38 +0,0 @@ -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'; diff --git a/fima/ledgers/delete.php b/fima/ledgers/delete.php deleted file mode 100644 index 0309a7fe0..000000000 --- a/fima/ledgers/delete.php +++ /dev/null @@ -1,53 +0,0 @@ -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'; diff --git a/fima/ledgers/edit.php b/fima/ledgers/edit.php deleted file mode 100644 index 12bc94c49..000000000 --- a/fima/ledgers/edit.php +++ /dev/null @@ -1,53 +0,0 @@ -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'; diff --git a/fima/ledgers/index.php b/fima/ledgers/index.php deleted file mode 100644 index c52ba17c1..000000000 --- a/fima/ledgers/index.php +++ /dev/null @@ -1,41 +0,0 @@ -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'; diff --git a/fima/lib/Application.php b/fima/lib/Application.php deleted file mode 100644 index 8182bc5ff..000000000 --- a/fima/lib/Application.php +++ /dev/null @@ -1,74 +0,0 @@ -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:") . - '
' . - Fima::buildDateWidget('closedperiod', (int)$GLOBALS['prefs']->getValue('closed_period'), '', _("None"), true) . - '

'; - } - - 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; - } - } - -} diff --git a/fima/lib/Block/summary.php b/fima/lib/Block/summary.php deleted file mode 100644 index 21a496d31..000000000 --- a/fima/lib/Block/summary.php +++ /dev/null @@ -1,159 +0,0 @@ -_params['block_title']) - ? $this->_params['block_title'] - : $registry->get('name'); - return Horde::link(Horde::url($registry->getInitialPage(), true)) - . htmlspecialchars($label) . ''; - } - - 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 '' . _("Error when retrieving results.") . ''; - } - 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 '' . _("Error when retrieving results.") . ''; - } - $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 .= ''; - foreach ($row as $colId => $value) { - if ($rowId === '__header__') { - $html .= '' . htmlspecialchars($value) . ''; - } elseif ($colId === '__header__') { - $html .= '' . htmlspecialchars($value) . ''; - } else { - $html .= '' . Fima::convertValueToAmount($value) . ''; - } - } - $html .= ''; - } - - if (empty($html)) { - return '' . _("No results to display") . ''; - } - - return '' - . $html . '
'; - } - -} diff --git a/fima/lib/Block/tree_menu.php b/fima/lib/Block/tree_menu.php deleted file mode 100644 index f6dd0e5d3..000000000 --- a/fima/lib/Block/tree_menu.php +++ /dev/null @@ -1,34 +0,0 @@ -addNode( - $parent . $menu[0], - $parent, - $menu[1], - $indent + 1, - false, - array( - 'icon' => Horde_Themes::img($menu[2]), - 'url' => $menu[3] - ) - ); - } - } - -} diff --git a/fima/lib/Driver.php b/fima/lib/Driver.php deleted file mode 100644 index 766607343..000000000 --- a/fima/lib/Driver.php +++ /dev/null @@ -1,411 +0,0 @@ - - * @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]; - } - -} diff --git a/fima/lib/Driver/sql.php b/fima/lib/Driver/sql.php deleted file mode 100644 index af8765227..000000000 --- a/fima/lib/Driver/sql.php +++ /dev/null @@ -1,1064 +0,0 @@ - - * 'phptype' The database type (e.g. 'pgsql', 'mysql', etc.). - * 'table' The name of the foo table in 'database'. - * 'charset' The database's internal charset. - * - * Required by some database implementations:
- *      '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.
- * - * 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 - * @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; - } - -} diff --git a/fima/lib/Fima.php b/fima/lib/Fima.php deleted file mode 100644 index 98a55f4d7..000000000 --- a/fima/lib/Fima.php +++ /dev/null @@ -1,764 +0,0 @@ - - * @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 widget. - */ - function buildAccountWidget($name, $value = '', $params = null, $blank = false, $multiple = false, $filters = array(), $hideclosed = false) - { - $accounts = Fima::listAccounts($filters); - - $html = '\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 widget. - */ - function buildAccountTypeWidget($name, $value = '', $params = null, $blank = false, $multiple = false) - { - $types = Fima::getAccountTypes(); - - $html = '\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 widget. - */ - function buildPostingTypeWidget($name, $value = '', $params = null, $blank = false, $multiple = false) - { - $types = Fima::getPostingTypes(); - - $html = '\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 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 = ''; - } - for ($i = 1; $i < 13; ++$i) { - $html .= ''; - } - $html .= '' . "\n"; - - /* Period only? */ - if ($periodonly) { - return $html; - } - - /* Day. */ - $html .= '- ' . "\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; - } - -} diff --git a/fima/lib/Forms/CreateLedger.php b/fima/lib/Forms/CreateLedger.php deleted file mode 100644 index ad50492a7..000000000 --- a/fima/lib/Forms/CreateLedger.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @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); - } - -} diff --git a/fima/lib/Forms/DeleteLedger.php b/fima/lib/Forms/DeleteLedger.php deleted file mode 100644 index 0969d6e35..000000000 --- a/fima/lib/Forms/DeleteLedger.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/Forms/EditLedger.php b/fima/lib/Forms/EditLedger.php deleted file mode 100644 index 04d8bfb1a..000000000 --- a/fima/lib/Forms/EditLedger.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/Forms/account.php b/fima/lib/Forms/account.php deleted file mode 100644 index e1663cddb..000000000 --- a/fima/lib/Forms/account.php +++ /dev/null @@ -1,183 +0,0 @@ - - * @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 - * @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) - { -?>
-buttons as $key => $button): ?> - - -
-
- - * @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 - * @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; - } - -} diff --git a/fima/lib/Report.php b/fima/lib/Report.php deleted file mode 100644 index eb60d5f38..000000000 --- a/fima/lib/Report.php +++ /dev/null @@ -1,186 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/Report/AccountOverview.php b/fima/lib/Report/AccountOverview.php deleted file mode 100644 index ffac9d8d4..000000000 --- a/fima/lib/Report/AccountOverview.php +++ /dev/null @@ -1,286 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/Report/Analysis.php b/fima/lib/Report/Analysis.php deleted file mode 100644 index 0dce0869a..000000000 --- a/fima/lib/Report/Analysis.php +++ /dev/null @@ -1,384 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/Report/AssetOverview.php b/fima/lib/Report/AssetOverview.php deleted file mode 100644 index f730acd94..000000000 --- a/fima/lib/Report/AssetOverview.php +++ /dev/null @@ -1,325 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/Report/GeneralOverview.php b/fima/lib/Report/GeneralOverview.php deleted file mode 100644 index a87f5881e..000000000 --- a/fima/lib/Report/GeneralOverview.php +++ /dev/null @@ -1,266 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/Report/PeriodOverview.php b/fima/lib/Report/PeriodOverview.php deleted file mode 100644 index 7f77d1122..000000000 --- a/fima/lib/Report/PeriodOverview.php +++ /dev/null @@ -1,272 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/Report/Trend.php b/fima/lib/Report/Trend.php deleted file mode 100644 index b67b06ed1..000000000 --- a/fima/lib/Report/Trend.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/ReportGraph.php b/fima/lib/ReportGraph.php deleted file mode 100644 index 2ca7a540a..000000000 --- a/fima/lib/ReportGraph.php +++ /dev/null @@ -1,191 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/ReportGraph/Bar.php b/fima/lib/ReportGraph/Bar.php deleted file mode 100644 index 0a3feede7..000000000 --- a/fima/lib/ReportGraph/Bar.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/ReportGraph/Line.php b/fima/lib/ReportGraph/Line.php deleted file mode 100644 index 9ee2599d1..000000000 --- a/fima/lib/ReportGraph/Line.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/ReportGraph/Pie.php b/fima/lib/ReportGraph/Pie.php deleted file mode 100644 index 657681854..000000000 --- a/fima/lib/ReportGraph/Pie.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @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; - } - -} diff --git a/fima/lib/UI/VarRenderer/fima.php b/fima/lib/UI/VarRenderer/fima.php deleted file mode 100644 index 4d9b57277..000000000 --- a/fima/lib/UI/VarRenderer/fima.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @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('
', - $varname, - $varname, - $value['type'] == 'delete' ? ' checked="checked"' : '', - $varname, - _("Delete postings.")) - . sprintf('
', - $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('
', - $varname, - $varname, - $value['type'] == 'none' ? ' checked="checked"' : '', - $varname, - _("Keep subaccounts and postings.")) - . sprintf('
', - $varname, - $varname, - $value['type'] == 'delete' ? ' checked="checked"' : '', - $varname, - _("Delete subaccounts and postings.")) - . sprintf('
', - $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')))); - } - -} diff --git a/fima/lib/base.php b/fima/lib/base.php deleted file mode 100644 index 2acae93c6..000000000 --- a/fima/lib/base.php +++ /dev/null @@ -1,53 +0,0 @@ -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(); diff --git a/fima/locale/.htaccess b/fima/locale/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/fima/locale/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/fima/locale/de/LC_MESSAGES/fima.mo b/fima/locale/de/LC_MESSAGES/fima.mo deleted file mode 100644 index c94b24719..000000000 Binary files a/fima/locale/de/LC_MESSAGES/fima.mo and /dev/null differ diff --git a/fima/locale/de/LC_MESSAGES/fima.po b/fima/locale/de/LC_MESSAGES/fima.po deleted file mode 100644 index 162466dfc..000000000 --- a/fima/locale/de/LC_MESSAGES/fima.po +++ /dev/null @@ -1,1316 +0,0 @@ -# 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 \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? Warning: This " -"deletes all existing postings." -msgstr "" -"Existierenden Buchungen durch die importierten ersetzen? Achtung: " -"Dies löscht alle existierenden Buchungen." - -#: 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" diff --git a/fima/locale/de/help.xml b/fima/locale/de/help.xml deleted file mode 100644 index 2c38e480e..000000000 --- a/fima/locale/de/help.xml +++ /dev/null @@ -1,403 +0,0 @@ - - - - - Fima: Übersicht - Was ist Fima? - - 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. - - Hauptfunktionalitäten: - * freie und flexible Struktur des Kontenplans - * Vermögenswerte organisiersen und nachverfolgen - * unabhängige Datenkreise: Ist-Abrechnung, Budget, Vorschau - * flexible and detaillierte Auswertungen mit verschiedenen Parametern - * grafische Auswertungsdiagramme - - - - Fima: Einstellungen - Aktive Konfiguration - * Ihr aktives Buch: wählen Sie Ihr aktives Buch - * Ihr aktiver Datenkreis: wählen Sie Ihren aktiven Datenkreis - * 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 - Oberflächen-Einstellungen - * Anzahl der Buchungen pro Seite: geben Sie die Anzahl der Buchungen ein, die pro Seite angezeigt werden - * Bei der Anzeige von Buchungen, bei welcher Seite möchten Sie beginnen: erste oder letzte Seite - * Buchungen sortieren nach: wählen Sie die Spalte aus, nach welcher Buchungen sortiert werden - * Dann: wählen Sie eine alternative Spalte aus, nach welcher Buchungen sortiert werden - * Sortierrichtung: aufsteigen oder absteigend - * Wählen Sie das Format für Platzhalter in der Textsuche: DOS Platzhalter (* und ?), SQL Platzhalter (% und _) oder keine - * Wählen Sie das FOrmat für Beträge: wählen Sie Ihre bevorzugte Notation - * Ausgaben mit negativem Vorzeichen eingeben: wählen Sie, ob Sie bei beim Eingeben von Buchungen das negative Vorzeichen für Ausgaben weglassen möchten - * Möchten Sie das Löschen von Buchungen bestätigen: wählen Sie, ob Sie das Löschen von Buchungen bestätigen möchten - * Wählen Sie die Grafikgröße für Auswertungsdiagramme: die Abmessungen der erstellten Bilder in Pixel - - - - Konten: Übersicht - - Der Kontenplan ist in drei Ebenen gegliedert: - - Kontokategorie - - Kontokategorien dienen der allgemeinen Aufsummierungen von verschiedenen Konten. Jedes Konto ist einer einzigen Kategorie zugeordnet. Es existieren drei verschiedene Kontokategorien: - - * Einnahmen (zB. Gehalt, Gewinne, Spenden, etc.) - * Ausgaben (zB. Verpflegung, Miete, Kleidung, etc.) - * Vermögen (zB. Bargeld, Kreditkarten, Sparbücher, etc.) - - 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. - - - 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. - - Kontogruppen, Hauptkonten, Unterkonten - - 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. - - - 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 Buchungen Übersicht). Weiters kann ein Konto abgeschlossen werden um neue Buchungen zu unterbinden, jedoch existierende zu behalten. - - - 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). - - - - - Konten: Löschen eines Kontos - - Beim Löschen eines Kontos müssen Sie angeben, wie Sie Buchungen handhaben wollen: - - * Buchungen löschen: alle existierenden Buchungen, die auf das betroffene Konto gebucht wurden, löschen - * Buchungen umbuchen: alle existierenden Buchungen auf ein anderes Konto derselben Kategorie verschieben - - Sie müssen auch angeben, wie Sie etwaige Unterkonten und deren Buchungen handhaben wollen: - - * Unterkonten und Buchungen behalten: nichts tun - * Unterkonten und Buchungen löschen: alle existierenden Unterkonten und Buchungen ebenfalls löschen - * Unterkonten löschen und Buchungen umbuchen: alle existierenden Unterkonten löschen und zuvor jegliche existierenden Buchungen auf ein anderes Konto derselben Kategorie verschieben - - - - Buchungen: Übersicht - - Ein Buchungssatz hat folgende Attribute: - - * Datenkreis: siehe Datenkreise - * Datum: Datum der Buchung (Tag, Monat, Jahr) - * Vermögenskonto: für jede Buchung ist die Angabe eines Vermögenskontos zur Verfolgung Ihre Vermögenswerte erforderlich - * 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 - * Anmerkung: pro Buchung kann eine kurze Anmerkung eingegeben werden (max. 255 Zeichen) - * Betrag: positive Beträge erhöhen und negative Beträge vermindern das gewählte Vermögenskonto - * a.o.: Buchungen können als außerordentlich markiert werden (besonders groß, nicht geplant, ...) - - - - Buchungen: Datenkreise - - Jede Buchung ist einem einziges Datenkreis zugeordnet. Es existieren drei unterschiedliche Datenkreise: - - Ist-Abrechnung - - Ist-Buchungen bestehen aus derzeitigen Einnahmen und Ausgaben, die mittels verschiedener Auswertungen analysiert werden können. Es spiegelt Ihre aktuelle finanzielle Situation wider. - - - 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. - - - 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. - - Budget - - 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. - - - 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. - - - 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. - - - Tipp: Erfassen Sie jegliche Abweichungen zwischen Ihrer Ist-Abrechnung und Ihrem Budget. Dadurch sind auch Ihre budgetierten Vermögenswerte aktuell. - - - Tipp: Es besteht die Möglichkeit Ihr Budget durch die Funktion Buchungen transferieren als Kopie der Buchungen des Vorjahrs mit optionaler Summierung zu erstellen und nachträglich anzupassen. - - Vorschau - - 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. - - - Tipp: Prüfen Sie auf Abweichungen zwischen den Summen von Ist-Abrechnung und Budget/Vorschau und passen Sie die weitere Vorschaurechnung an. - - - Tipp: Erfassen Sie jegliche Abweichungen zwischen Ihrer Ist-Abrechnung und Vorschau. Dadurch sind auch Ihre Vorschau-Vermögenswerte aktuell. - - - Tipp: Es besteht die Möglichkeit Ihre Vorschaurechnung durch die Funktion Buchungen transferieren als Kopie Ihres Budgets zu erstellen und nachträglich anzupassen. - - - - - Buchungen: Buchungen erstellen/bearbeiten - - 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. - - - Ausgaben haben üblicherweise negative Beträge, können jedoch aus Komfort ohne negatives Vorzeichen eingegeben werden (siehe Oberflächen-Einstellungen: Ausgaben mit negativem Vorzeichen eingeben?). 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). - - - 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. - - - 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. - - - Tipp: Bei der Eingabe neuer Buchungen für Budget oder Vorschau 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. - - - - - Buchungen: Buchungen umbuchen - - Buchen Sie mehrere Buchungen um, um diese gemeinsam in einen anderen Datenkreis zu verschieben oder deren Vermögens- oder Bewegungskonto zu ändern. - - - - - Buchungen: Buchungen transferieren - - Transferieren Sie alle Buchungen eines bestimmten Datenkreise innerhalb eines gezielten Zeitraums in einen anderen Datenkreis mit folgenden Optionen: - - * Transfer von: Quelldatenkreis, von dem die Buchungen transferiert werden sollen - * Zeitraum von: Quellzeitraum, innerhalb dessen die Buchungen transferiert werden sollen - * Ursprüngliche Buchungen behalten: auswählen um die gewählten Buchungen zu kopieren, andernfalls um diese zu verschieben - * Nicht summieren: Buchungen unverändert lassen - * Summieren durch Kombination: Buchungen summieren durch Gruppierung pro Kombination Vermögens-/Bewegungskonto - * Summieren durch Buchen gegen: Buchungen summieren durch getrennte Gruppierung pro Vermögens- und Bewegungskonto, wobei jeweils gegen ein spezielle (Dummy-)Konto gebucht wird - * Transfer nach: Zieldatenkreis, in den die Buchungen transferiert werden sollen - * Zeitraum bis: Zielzeitraum, inner den die Buchungen transferiert werden sollen - * Existierende Buchungen löschen: zuvor alle existierenden Buchungen im Zieldatenkreis innerhalb des Zielzeitraums löschen - - Tipp: Sie könnnen das Budget (oder die Vorschau) 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. - - - 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. - - - - - Buchungen: Buchungen suchen - - Bei der Suche von Buchungen können Sie folgende Filter verwenden: - - * Datenkreis: zu filternder Datenkreis - * Anfangsdatum: Beginn des zu filternden Zeitraums - * Enddatum: Ende des zu filternden Zeitraums - * Vermögenskonten: es werden Buchungen mit dem/den ausgewählten Konten als Vermögens- oder Bewegungskonto (bei Vermögensumlagen) gefiltert - * Bewegungskonten: es werden Buchungen mit dem/den ausgewählten Konten als Bewegungskonto gefiltert - * Anmerkung: Sie können Platzhalter beim Durchsuchen der Anmerkung verwenden (siehe Oberflächen-Einstellungen: Wählen Sie das Format für Platzhalter in der Textsuche). - * Anfangsbetrag: minimaler Betrag - * Endbetrag: maximaler Betrag - * a.o. Buchungen: alle oder keine a.o. Buchungen filtern; leer lassen um alle Buchungen zu erhalten - - Tipp: Es können mehrere Vermögens- und Bewegungskonten durch Halten der Umschalt- oder Steuerungstaste ausgewählt werden. - - - Tipp: Beim Filtern nach Beträgen vergessen Sie nicht Ausgaben mit negativem Vorzeichen einzugeben. - - - 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. - - - - - Auswertungen: Übersicht - - Bei der Erstellung von Auswertungen können Sie folgende Parameter verwenden: - - * Auswertung: verschiedene Auswertungen - * Anzeige: Datenkreis auswählen (manche Auswertungen benutzen nur den ersten Wert, andere alle Werte) - * Zeitraum: Beginn und Ende des Auswertungszeitraums - * Referenz: Beginn und Ende des Referenz-Auswertungszeitraums (bei der Verwendung von Referenz als Datenkreis für die Anzeige) - * Konten: Buchungen mit den ausgewählten Konten als Bewegungskonto werden ausgewertet - * Kumulieren: Teilergebnisse im gewählten Zeitraum werden summieren - * Unterkonten: zusätzlich Unterkonten anzeigen anstatt nur Hauptkonten - * Leerzeilen: Zeilen ohne Ergebnisse anzeigen - * Jährlich: Ergebnisse nach Jahren anstatt Monaten gruppieren - * Diagramm: eine Auswertungsgrafik anstelle von einer tabellarischen Ansicht anzeigen - - Alle Auswertungen verwenden nur einen Teil der Parameter. Siehe Auswertungsdetails für eine Beschreibung jeder Auswertung und der verwendeten Parameter. - - - - - Auswertungen: Details - - Gesamtübersicht - * Beschreibung: Kontokategorien, Ergebnisse und Vermögen pro Datenkreis - * Parameter: Anzeige (alle), Zeitraum, (Referenz), Konten, Diagramm - * Diagramm: Balkendiagramm - - Periodenübersicht - * Beschreibung: Kontokategorien, Ergebnisse und Vermögen pro Zeitraum - * Paramater: Anzeige (erstes), Zeitraum, (Referenz), Konten, Kumulieren, Leerzeilen, Jährlich, Diagramm - * Diagramm: Liniendiagramm - - Kontoübersicht - * Beschreibung: Datenkreise pro Zeitraum - * Parameter: Anzeige (alle), Zeitraum, (Referenz), Konten, Kumulieren, Leerzeilen, Jährlich, Diagramm - * Diagramm: Liniendiagramm - - Vermögensübersicht - * Beschreibung: Vermögenskonten pro Zeitraum - * Parameter: Anzeige (erstes), Zeitraum, (Referenz), Kumulieren, Unterkonten, Leerzeilen, Jährlich, Diagramm - * Diagramm: Liniendiagramm, Besten 5 - - Analyse - * Beschreibung: Datenkreise pro Konten - * Parameter: Anzeige (alle), Zeitraum, (Referenz), Konten, Unterkonten, Leerzeilen, Diagramm - * Diagramm: Tortendiagramm, Besten 5 (Rest gruppiert) pro Kontokategorie - - Trend - * Beschreibung: Zeitraum pro Konto - * Parameter: Anzeige (erstes), Zeitraum, (Referenz), Konten, Unterkonten, Leerzeilen, Jährlich, Diagramm - * Diagramm: Liniendiagramm, Besten 5 pro Kontokategorie - - - - Musterbeispiel: Übersicht - - Dieses Musterbeispiel demonstriert die Verwendung der Hauptfunktionalitäten von Fima. Folgen Sie den Anweisungen Schritt für Schritt in der angegebenen Reihenfolge. - - - - - Musterbeispiel: 1) Konten - Vermögen - * 0100 Bargeld - * * 0110 Person A - * * 0120 Person B - * 0200 Girkontoo - * 0300 Sparbuch - * 0400 Lebensversicherung - Einnahmen - * 0000 Saldovortrag - * 1000 Gehalt - * 1900 Andere Einnahmen - * * 1910 Beihilfen - * * 1999 Diverses - Ausgaben - * 2000 Verpflegung - * 3000 Heim - * * 3010 Miete - * * 3020 Strom - * * 3030 Einrichtung - * 3500 Auto - * * 3510 Versicherung - * * 3520 Benzin - * 4000 Person A - * * 4010 Kleidung - * * 4020 Freizeit - * 5000 Person B - * * 5010 Kleidung - * * 5020 Freizeit - * 9900 Andere Ausgaben - - 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.) - - - - - Musterbeispiel: 2) Anfangsbestände - - 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): - - Vermögenskonto | Bewegungskonto | Betrag - * 0110 Bargeld - Person A | 0000 Saldovortrag | 133,50 - * 0120 Bargeld - Person B | 0000 Saldovortrag | 420,30 - * 0200 Girokonto | 0000 Saldovortrag | -3.412,50 - * 0300 Sparbuch | 0000 Saldovortrag | 6.850,20 - * 0400 Lebensversicherung | 0000 Saldovortrag | 10.500,00 - In Summe beträgt unser Vermögen daher 14.491,50. - - 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. - - - - - Musterbeispiel: 3) Buchungen - - Nach der Erfassung unserer Anfangsbestände beginnen wir einige Buchungen einzugeben (mit einem Datum nach dem 01.01.2008): - - Vermögenskonto | Bewegungskonto | Betrag - * 0110 Bargeld - Person A | 2000 Verpflegung | -35,00 - * 0110 Bargeld - Person A | 4020 Person A - Freizeit | -22,20 - * 0110 Bargeld - Person A | 3520 Auto - Benzin | -40,00 - * 0120 Bargeld - Perosn B | 0200 Girokonto | 1.000,00 - * 0120 Bargeld - Person B | 2000 Verpflegung | -320,10 - * 0120 Bargeld - Person B | 5010 Person B - Kleidung | -278,00 - * 0200 Girokonto | 1000 Gehalt | 2.600,00 - * 0200 Girokonto | 3010 Heim - Miete | -520,00 - - 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. - - - Tipp: Aus Komfort ist es möglich Ausgaben ohne negativem Vorzeichen einzugeben (siehe Oberflächen-Einstellungen: Ausgaben mit negativem Vorzeichen eingeben?). Jedenfalls betrifft der eingegeben Betrag bei der vierten Transaktion (Vermögensumlage) stets das ausgewählte Vermögenskonto. - - - Tipp: Kontrollieren Sie die Endbeträge der Vermögenskonten mit der Auswertung Vermögensübersicht (mit kumulierten Werten). - - - Tipp: Verfolgen und analysieren Sie Ihre Einnahmen und Ausgaben mit den Auswertungen Kontoübersicht und Analyse. Benutzen Sie die Auswertungen Periodenübersicht und Trend zur Analyse und Überprüfung der Entwicklung Ihrer Kosten. - - - - - Musterbeispiel: 4) Budget - - 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: - - - 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 Auto-Füllen 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. - - - B) Erstellen Sie Ihr Budget basierend auf den Einnahmen und Ausgaben des Vorjahrs (sofern verfügbar). Benutzen Sie die Funktion Buchungen transferieren mit folgenden Parametern: - - * Transfer von: Ist-Abrechnung - * Zeitraum von: 2007 - Alle - * Ursprüngliche Buchungen behalten: ja - * Konten summieren: Summieren durch Kombination. - * Transfer nach: Budget - * Zeitraum bis: 2008 - Alle - * Existierende Buchungen löschen: ja - - Tipp: Vergleichen Sie Budgetwerte mit der Ist-Abrechung mithilfe der Auswertungen Gesamtübersicht, Kontoübersicht oder Analyse. - - - - - Musterbeispiel: 5) Vorschau - - 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: - - - A) Erstellen Sie Ihre Vorschau ganz neu (siehe Musterbeispiel: Budget). - - - B) Erstellen Sie Ihre Vorschau als Kopie Ihres Budgets mittels der Funktion Buchungen transferieren mit folgenden Parametern: - - * Transfer von: Budget - * Zeitraum von: 2008 - Alle - * Ursprüngliche Buchungen behalten: ja - * Konten summieren: Nicht summieren. - * Transfer nach: Vorschau - * Zeitraum bis: 2008 - Alle - * Existierende Buchungen löschen: ja - - Tipp: Vergleichen Sie Vorschauwerte mit dem Budget oder der Ist-Abrechnung mithilfe der Auswertungen Gesamtübersicht, Kontoübersicht oder Analyse. - - - - diff --git a/fima/locale/en/help.xml b/fima/locale/en/help.xml deleted file mode 100644 index dbcfa21f9..000000000 --- a/fima/locale/en/help.xml +++ /dev/null @@ -1,406 +0,0 @@ - - - - - Fima: Overview - What is Fima? - - 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. - - Main features: - * free and flexible structure of the table of accounts - * management and tracking of assets - * independent posting types: actual, budget, forecast - * flexible and detailled reports using various parameters - * graphical report charts - - - - Fima: Preferences - Active Configuration - * Your active ledger: select your current ledger - * Your active posting type: select the current posting type - * 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 - Interface Preferences - * Postings per page in the list view: enter the number of postings to display per page - * When displaying the posting, which page do you want to start on: first or last page - * Sort postings by: select the column which to sort postings by - * Then: select an alternative column which to sort postings by - * Sort direction: ascending or descending - * Select the format for wildcards for text search: DOS wildcards (* and ?), SQL wildcards (% and _) or none - * Select the format for amounts: select your preferred notation - * Enter expenses with negative sign: choose whether to omit the negative sign when entering expenses - * Do you want to confirm deleting postings: choose whether you'd like to confirm deleting postings - * Select the canvas size for chart reports: the dimensions of the generated image in pixel - - - - Accounts: Overview - - The table of accounts is structured in three levels: - - Account Types - - Account types are the general aggregation of different accounts. Each account is assigned one single type. There are three different account types: - - * income (eg. salary, prizes, donations, etc.) - * expense (eg. food, rental, clothes, etc.) - * asset (eg. cash, credit card, bankbook, etc.) - - 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). - - - 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. - - Account groups, Main Accounts, Subaccounts - - 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. - - - 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 Postings Overview). Also an account may be closed in order to prevent new postings but keep existing ones. - - - 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). - - - - - Accounts: Deleting an Account - - When deleting an account you need to specify how to handle postings: - - * Delete postings: delete all existing postings that were posted to the specific account - * Shift postings: move all existing postings to another account of the same account type - - Also you need to specify how to handle potential subaccounts and their postings: - - * Keep subaccounts and postings: don't do anything - * Delete subaccounts and postings: delete all existing subaccounts and postings too - * Delete subaccounts and shift postings: delete all existing subaccounts and previously shift any existing postings to another account of the same account type - - - - Postings: Overview - - A posting record has of the following attributes: - - * Posting types: see Posting Types - * Date: date of the posting (day, month, year) - * Asset account: specifying the asset account for each posting is necessary to track your assets - * 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 - * Description: it is possible to enter a short description for each posting (max. 255 characters) - * Amount: positive amounts increase and negative amounts decrease the chosen asset account - * e.o.: postings may be marked extraordinary (very large, not planned, ...) - - - - Postings: Posting Types - - Each posting is assigned one single type. There are three different posting types: - - Actual - - Actual postings constist of current incomes and expenses which can be analyzed using different reports. It reflects your actual financial situation. - - - 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: 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. - - Budget - - 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. - - - 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: 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: Enter any differences between your actual and budget to your budget. This way also your budget assets are up-to-date. - - - Tip: It is possible to create your budget based on the postings of the last year by copying and optionally summarize them using the Transfer Postings functionality and adapting it afterwards. - - Forecast - - After creating a budget it usually won't change. All further adaptions can be included in the forecast which therefore is an updated budget. - - - Tip: Check for any differences between your actual and budget/forecast result regularly and adapt your future forecast. - - - Tip: Enter any differences between your actual and forcast to your budget. This way also your forecast assets are up-to-date. - - - Tip: It is possible to create your forecast by copying your budget using the Transfer Postings functionality and afterwards adapting it afterwards. - - - - - Postings: Add/Edit Postings - - When adding new postings the date and asset account will be copied from the entry above for convenience, but may be changed later on. - - - Expenses usually are negative amounts, but may be entered without negative sign for convenience (see Interface Preferences: Enter expenses with negative sign?). 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). - - - 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: 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: In order to prevent adding or editing postings with a date in the past unintentionally, enter a closing period (see Preferences: Active Configuration: Closed by period). - - - Tip: When entering new postings for budget or forecast, 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. - - - - - Postings: Shift Postings - - Shift several selected postings in order to move them to another posting type or to change the asset or posting account all at once. - - - - - Postings: Transfer Postings - - Transfer all postings of a specific posting type within a specific period to another posting type using the following options: - - * Transfer from: source posting type where to transfer posting from - * Period from: source period of posting to transfer from - * Keep original Postings: check to copy selected postings, leave unchecked to move postings - * Don't summarize: leave postings unchanged - * Summarize by combining: summarize postings by grouping according to the combination of asset and posting account - * Summarize by posting against: summarize postings by grouping by asset and posting account seperately, each posting against a specific (dummy) account - * Transfer to: destination posting type where to transfer posting to - * Period to: destination period of posting to transfer to - * Delete existing Postings: previously delete any existing postings of the destination posting type within the destination period - - Tip: You may create a budget (or forecast) 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: 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. - - - - - Postings: Search Postings - - When searching postings it is possible to use the following filters: - - * Posting Type: posting type to filter - * Date Start: start of filter period - * Date End: end of filter period - * Asset Accounts: postings with the selected account(s) as asset or posting account (when shifting assets) will be filtered - * Posting Accounts: postings with the selected account(s) as posting account will be filtered - * Description: you may use wildcards when search the description (see Interface Preferences: Select the format for wildcards for text search). - * Amount Start: minimum amount - * Amount End: maximum amount - * e.o. Postings: filter all or none e.o. postings; leave empty to get all postings - - Tip: It is possible to select several asset and posting accounts by holding the shift or control key. - - - Tip: When filtering for amounts remember to enter expenses with a negative sign. - - - 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. - - - - - Reports: Overview - - When creating reports it is possible to use the following parameters: - - * Report: different reports - * Display: select posting type (some reports use the first value only, other use all values) - * Period: start and end of report period - * Reference: start and end of report reference period (when using reference as posting type for display) - * Accounts: postings with the selected account(s) as posting account will be reported - * Cumulate: summarize partial results within the selected period - * Subaccounts: additionally show subaccounts instead of main accounts only - * Null Rows: display rows containing no results - * Yearly: group results by years instead of months - * Chart: display a report graph instead of a table view - - All reports use only a set of parameters. See report details for a description of each report and used parameters. - - - - - Reports: Details - - General Overview - * Description: account types, totals and asset result by posting types - * Parameters: Display (all), Period, (Reference), Accounts, Chart - * Chart: bar chart - - Period Overview - * Description: account types, totals and asset result by period - * Paramaters: Display (first), Period, (Reference), Accounts, Cumulate, Null Rows, Yearly, Chart - * Chart: line chart - - Account Overview - * Description: posting types by period - * Parameters: Display (all), Period, (Reference), Accounts, Cumulate, Null Rows, Yearly, Chart - * Chart: line chart - - Asset Overview - * Description: asset accounts by period - * Parameters: Display (first), Period, (Reference), Cumulate, Subaccounts, Null Rows, Yearly, Chart - * Chart: line chart, top 5 - - Analysis - * Description: posting types by accounts - * Parameters: Display (all), Period, (Reference), Accounts, Subaccounts, Null Rows, Chart - * Chart: pie chart, top 5 (rest grouped) by account type - - Trend - * Description: period by accounts - * Parameters: Display (first), Period, (Reference), Accounts, Subaccounts, Null Rows, Yearly, Chart - * Chart: line chart, top 5 by account type - - - - Exemplar: Overview - - This exemplar demonstrates how to use the main features of Fima. Follow the instructions step by step in the given order. - - - - - Exemplar: 1) Accounts - Asset - * 0100 Cash - * * 0110 Person A - * * 0120 Person B - * 0200 Giro - * 0300 Bankbook - * 0400 Life Assurance - Income - * 0000 Opening Balance - * 1000 Salary - * 1900 Other Income - * * 1910 Subsidy - * * 1999 Miscellaneous - Expense - * 2000 Food - * 3000 Home - * * 3010 Rental - * * 3020 Electricity - * * 3030 Furniture - * 3500 Car - * * 3510 Insurance - * * 3520 Fuel - * 4000 Person A - * * 4010 Clothes - * * 4020 Hobby - * 5000 Person B - * * 5010 Clothes - * * 5020 Hobby - * 9900 Other Expense - - 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.) - - - - - Exemplar: 2) Opening - - 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): - - Asset Account | Posting Account | Amount - * 0110 Cash - Person A | 0000 Opening Balance | 133.50 - * 0120 Cash - Person B | 0000 Opening Balance | 420.30 - * 0200 Giro | 0000 Opening Balance | -3,412.50 - * 0300 Bankbook | 0000 Opening Balance | 6,850.20 - * 0400 Life Assurance | 0000 Opening Balance | 10,500.00 - In total our asset result is therefore 14,491.50. - - Tip: Use a seperate account of type income for your opening balance. This way reports show correct amounts and assets can be tracked. - - - - - Exemplar: 3) Postings - - After doing our opening balance let's start entering some postings (past the date 2008-01-01): - - Asset Account | Posting Account | Amount - * 0110 Cash - Person A | 2000 Food | -35.00 - * 0110 Cash - Person A | 4020 Person A - Hobby | -22.20 - * 0110 Cash - Person A | 3520 Car - Fuel | -40.00 - * 0120 Cash - Perosn B | 0200 Giro | 1,000.00 - * 0120 Cash - Person B | 2000 Food | -320.10 - * 0120 Cash - Person B | 5010 Person B - Clothes | -278.00 - * 0200 Giro | 1000 Salary | 2,600.00 - * 0200 Giro | 3010 Home - Rental | -520.00 - - 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: It is possible to enter expenses without negative sign for convenience (see Interface Preferences: Enter expenses with negative sign?). However, with the fourth transaction (shifting assets) the entered value always applies to the selected asset account. - - - Tip: Control the final amounts of asset accounts by using the report Asset Overview (with cumulated values). - - - Tip: Track and analyse your incomes and expenses using the reports Account Overview and Analysis. Use the reports Period Overview and Trend to analyse and check the development of costs. - - - - - Exemplar: 4) Budget - - 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: - - - 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 Autofill 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. - - - B) Create your budget based on incomes and expenses from the last year (if any). Use the function Transfer Postings with the following parameters: - - * Transfer from: Actual - * Period from: 2007 - All - * Keep original Postings: yes - * Summarize Accounts: Summarize by combining. - * Transfer to: Budget - * Period to: 2008 - All - * Delete existing postings: yes - - Tip: Compare budget and actual amounts using the reports General Overview, Account Overview or Analysis. - - - - - Exemplar: 5) Forecast - - Since a budget usually remains untouched after creation, we want a forecast to adapt. There are two possibilities for ceating a forecast: - - - A) Create your forecast from scratch (see Exemplar: Budget). - - - B) Create your forecast by copying the budget using the function Transfer Postings with the following parameters: - - * Transfer from: Budget - * Period from: 2008 - All - * Keep original Postings: yes - * Summarize Accounts: Don't summarize. - * Transfer to: Forecast - * Period to: 2008 - All - * Delete existing postings: yes - - Tip: Compare forecast and budget or actual amounts using the reports General Overview, Account Overview or Analysis. - - - - diff --git a/fima/locale/fima.pot b/fima/locale/fima.pot deleted file mode 100644 index 519ee6e5a..000000000 --- a/fima/locale/fima.pot +++ /dev/null @@ -1,1302 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Horde Project -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , 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 \n" -"Language-Team: LANGUAGE \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? Warning: This " -"deletes all existing postings." -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 "" diff --git a/fima/postings.php b/fima/postings.php deleted file mode 100644 index 854aaa008..000000000 --- a/fima/postings.php +++ /dev/null @@ -1,733 +0,0 @@ - - * - * 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 - */ - -@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) . ''; - $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) . ''; - } - 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) . ''; - $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) . ''; - } -} - -/* Some browsers have trouble with hidden overflow in table cells but not in divs. */ -if ($GLOBALS['browser']->hasQuirk('no_hidden_overflow_tables')) { - $overflow_begin = '
'; - $overflow_end = '
'; -} 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 ''; - } -} -require FIMA_TEMPLATES . '/postings/footer.inc'; - -require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/fima/report.php b/fima/report.php deleted file mode 100644 index 80a22c335..000000000 --- a/fima/report.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * 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'; diff --git a/fima/scripts/sql/fima.sql b/fima/scripts/sql/fima.sql deleted file mode 100644 index a9397d4eb..000000000 --- a/fima/scripts/sql/fima.sql +++ /dev/null @@ -1,40 +0,0 @@ -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; - diff --git a/fima/search.php b/fima/search.php deleted file mode 100644 index 7808c0a16..000000000 --- a/fima/search.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * 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'; diff --git a/fima/templates/accounts/accounts.inc b/fima/templates/accounts/accounts.inc deleted file mode 100644 index dae870f4b..000000000 --- a/fima/templates/accounts/accounts.inc +++ /dev/null @@ -1,55 +0,0 @@ -hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT); -$perm_delete = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE); - -?> - - -

get('name')) ?>

- -
- - - -
-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 = '' . $accountLabel . ''; - } - $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")) . ''; } - 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")) . ''; } - 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")) . ''; } - if ($perm_edit && isset($account['add_link'])) { $accountExtra .= ' '.Horde::link(Horde::url($account['add_link']), _("Create a New Account")) . Horde::img('new-small.png', '+') . ''; } - if ( isset($account['view_link'])) { $accountExtra .= ' '.Horde::link(Horde::url($account['view_link']), sprintf(_("View %s"), $accountLabel)) . Horde::img('search-small.png', _("Search")) . ''; } - } - $tree->addNode($accountId, $account['parent_id'], $accountLabel, 0, $print_view ? true : $account['expanded'], $params, $accountExtra); -} - -echo $tree->renderTree(); - -?> -
-
diff --git a/fima/templates/common-header.inc b/fima/templates/common-header.inc deleted file mode 100644 index 2f7e2db31..000000000 --- a/fima/templates/common-header.inc +++ /dev/null @@ -1,29 +0,0 @@ -getCharset()); - header('Vary: Accept-Language'); -} -?> - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - - - diff --git a/fima/templates/data/export.inc b/fima/templates/data/export.inc deleted file mode 100644 index 5bbeac4d4..000000000 --- a/fima/templates/data/export.inc +++ /dev/null @@ -1,18 +0,0 @@ -
"> - - - -

- -

- -
-
-
- - " class="button" /> -
-
diff --git a/fima/templates/data/import.inc b/fima/templates/data/import.inc deleted file mode 100644 index 86134593d..000000000 --- a/fima/templates/data/import.inc +++ /dev/null @@ -1,35 +0,0 @@ -
- - - - -

- -

- -
-
-
- - - Warning: This deletes all existing postings.")) ?> -
- -
- -

- -
-

- " class="button" /> -
-
- -
diff --git a/fima/templates/ledgers_list.php b/fima/templates/ledgers_list.php deleted file mode 100644 index 8da35f06b..000000000 --- a/fima/templates/ledgers_list.php +++ /dev/null @@ -1,39 +0,0 @@ -

- -

- -
-
- - " /> -
-
- -" cellspacing="0" id="ledger-list" class="striped sortable"> - - - - - - - - - - - - - - - - - - - - - - - - - - -
get('name')) ?>">">">
diff --git a/fima/templates/menu.inc b/fima/templates/menu.inc deleted file mode 100644 index 433b9e521..000000000 --- a/fima/templates/menu.inc +++ /dev/null @@ -1,41 +0,0 @@ -
- - -
- - - -notify(array('listeners' => 'status')) ?> diff --git a/fima/templates/postings/actions.inc b/fima/templates/postings/actions.inc deleted file mode 100644 index 7a783a713..000000000 --- a/fima/templates/postings/actions.inc +++ /dev/null @@ -1,23 +0,0 @@ - - - - -
-
-
-
- -
    -
  • -
  • -
  • -
  • -
- - " onclick="return Submit('');" /> -getValue('active_postingtype'), array(FIMA_POSTINGTYPE_FORECAST, FIMA_POSTINGTYPE_BUDGET))): ?> - " onclick="autofillPostings();" /> - - -
-
diff --git a/fima/templates/postings/edit.inc b/fima/templates/postings/edit.inc deleted file mode 100644 index f4a9dc042..000000000 --- a/fima/templates/postings/edit.inc +++ /dev/null @@ -1,55 +0,0 @@ - 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)); -?> - $posting): ?> - - - - - - - - - - - - - - - - - - - - /> - - - - - : - - - - - : - - - diff --git a/fima/templates/postings/empty.inc b/fima/templates/postings/empty.inc deleted file mode 100644 index d0105f3b7..000000000 --- a/fima/templates/postings/empty.inc +++ /dev/null @@ -1,5 +0,0 @@ - - -   - - diff --git a/fima/templates/postings/footer.inc b/fima/templates/postings/footer.inc deleted file mode 100644 index 85cd41945..000000000 --- a/fima/templates/postings/footer.inc +++ /dev/null @@ -1,5 +0,0 @@ - - - - -
diff --git a/fima/templates/postings/header.inc b/fima/templates/postings/header.inc deleted file mode 100644 index 89a954fca..000000000 --- a/fima/templates/postings/header.inc +++ /dev/null @@ -1,39 +0,0 @@ -
-
1) { echo 'style="width:40%" '; } ?> class="leftFloat"> - - - - - getValue('active_postingtype')), _("Search Postings")) . Horde::img('search.png', _("Search")) ?> - - - - - -
- - - 1): ?> -
- -
-
- -
- - -
- - -isBrowser('msie') && $GLOBALS['browser']->getMajor() < 7): ?> -
- -
- -
- - -
- - - diff --git a/fima/templates/postings/javascript_edit.inc b/fima/templates/postings/javascript_edit.inc deleted file mode 100644 index ed2d77b03..000000000 --- a/fima/templates/postings/javascript_edit.inc +++ /dev/null @@ -1,357 +0,0 @@ - diff --git a/fima/templates/postings/javascript_list.inc b/fima/templates/postings/javascript_list.inc deleted file mode 100644 index eaf7a708a..000000000 --- a/fima/templates/postings/javascript_list.inc +++ /dev/null @@ -1,165 +0,0 @@ - diff --git a/fima/templates/postings/javascript_shift.inc b/fima/templates/postings/javascript_shift.inc deleted file mode 100644 index 17c33ceff..000000000 --- a/fima/templates/postings/javascript_shift.inc +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/fima/templates/postings/javascript_transfer.inc b/fima/templates/postings/javascript_transfer.inc deleted file mode 100644 index f98af39f7..000000000 --- a/fima/templates/postings/javascript_transfer.inc +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/fima/templates/postings/list.inc b/fima/templates/postings/list.inc deleted file mode 100644 index ca145dd23..000000000 --- a/fima/templates/postings/list.inc +++ /dev/null @@ -1,15 +0,0 @@ - $posting): ?> - - - = $posting['date']) echo ' disabled="disabled"' ?> /> $posting['account_type_eo'])) ?> - - - - - - - - - : - - diff --git a/fima/templates/postings/navbar.inc b/fima/templates/postings/navbar.inc deleted file mode 100644 index 3e014b4ef..000000000 --- a/fima/templates/postings/navbar.inc +++ /dev/null @@ -1,33 +0,0 @@ - - - - - -
-
- - - -
- -
- 1): ?> -
- - - - -
- -
-
diff --git a/fima/templates/postings/posting_footers.inc b/fima/templates/postings/posting_footers.inc deleted file mode 100644 index f8448b60f..000000000 --- a/fima/templates/postings/posting_footers.inc +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - diff --git a/fima/templates/postings/posting_headers.inc b/fima/templates/postings/posting_headers.inc deleted file mode 100644 index c05552aa1..000000000 --- a/fima/templates/postings/posting_headers.inc +++ /dev/null @@ -1,82 +0,0 @@ - - - - - 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' - ); -} - -?> - - - - -
- - - - - - - - - - $val): ?> - - - - diff --git a/fima/templates/postings/shift.inc b/fima/templates/postings/shift.inc deleted file mode 100644 index b4e987a94..000000000 --- a/fima/templates/postings/shift.inc +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/fima/templates/postings/transfer.inc b/fima/templates/postings/transfer.inc deleted file mode 100644 index 1da028ece..000000000 --- a/fima/templates/postings/transfer.inc +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fima/templates/reports/empty.inc b/fima/templates/reports/empty.inc deleted file mode 100644 index 65281ac3f..000000000 --- a/fima/templates/reports/empty.inc +++ /dev/null @@ -1,2 +0,0 @@ -
-

diff --git a/fima/templates/reports/graph.inc b/fima/templates/reports/graph.inc deleted file mode 100644 index 5ad2d44bb..000000000 --- a/fima/templates/reports/graph.inc +++ /dev/null @@ -1,3 +0,0 @@ -
-

<?php echo _(" title="" />

-

-->*/ ?> diff --git a/fima/templates/reports/img.inc b/fima/templates/reports/img.inc deleted file mode 100644 index 6d33aa90e..000000000 --- a/fima/templates/reports/img.inc +++ /dev/null @@ -1,6 +0,0 @@ -getGraph(); diff --git a/fima/templates/reports/reports.inc b/fima/templates/reports/reports.inc deleted file mode 100644 index 2be953d6a..000000000 --- a/fima/templates/reports/reports.inc +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - -

- -
- - - /> - -   - - $key, 'actionID' => 'change_sort')), $val['stext'], null, null, null, $val['stext']) . Horde::img($sortImg, $sortText) ?> - - $key, 'actionID' => 'change_sort')), $val['stext'], 'widget', null, null, $val['text']) ?> - - - - - -
-    - - $posting): ?> - - -
-   - - -
-   - - -
-   - - -
-   - - getValue('active_postingtype'), ''); ?> -
-   - - -
-   - - - -
-   - - -
- -
- -
- -
-   - - -
-   - - -
-   - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - '))) ?> - -hasFeature('javascript')): ?> - $typeLabel): - if ($typeId == FIMA_ACCOUNTTYPE_ASSET) { - continue; - } -?> -
- - -
- - - -   -   - -
- - - -   -   - -
- - - - /> - -   - - /> - -   - - /> - -   - - /> - - -   - - /> - - -
-
- -" /> -" onclick="document.report.actionID.value='clear_report';" /> - - diff --git a/fima/templates/reports/table.inc b/fima/templates/reports/table.inc deleted file mode 100644 index 9ae73b8b4..000000000 --- a/fima/templates/reports/table.inc +++ /dev/null @@ -1,44 +0,0 @@ -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) ? '\/' : '/\\'; - -?> -
- - $row) { - echo ''; - foreach ($row as $colId => $value) { - if ($rowId === '__headersort__') { - $sortText = sprintf(_("Sort by %s"), $value); - echo ''; - } elseif ($rowId === '__header__') { - echo ''; - } elseif ($colId === '__header__') { - echo ''; - } elseif ($value === null) { - echo ''; - } else { - echo ''; - } - } - echo "\n"; -} -?> -
'; - if ($sortby == $colId) { - echo Horde::link(Horde_Util::addParameter($sorturl, 'sortby', $colId), $sortText, null, null, null, $sortText) . Horde::img($sortImg, $sortImgText) . ''; - } - echo Horde::widget(Horde_Util::addParameter(($sortby == $colId) ? $sorturl : $reporturl, 'sortby', $colId), $sortText, 'widget', null, null, $value); - echo '' . htmlspecialchars($value) . '' . ($value{0} === ' ' ? '    ' : '') . htmlspecialchars($value) . '' . Fima::convertValueToAmount($value) . '
- diff --git a/fima/templates/search/search.inc b/fima/templates/search/search.inc deleted file mode 100644 index a6112803f..000000000 --- a/fima/templates/search/search.inc +++ /dev/null @@ -1,109 +0,0 @@ -
- - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-   - - -
-   - - -
-   - - -
-   - - -
-   - - - -hasFeature('javascript')): ?> - $typeLabel): -?> -
- - -
-   - - -
-   - - -
-   - - -
-   - - -
-
- -" /> -" /> - -
diff --git a/fima/themes/bluewhite/screen.css b/fima/themes/bluewhite/screen.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/fima/themes/graphics/accounts.png b/fima/themes/graphics/accounts.png deleted file mode 100644 index f77b51657..000000000 Binary files a/fima/themes/graphics/accounts.png and /dev/null differ diff --git a/fima/themes/graphics/accounts.psd b/fima/themes/graphics/accounts.psd deleted file mode 100644 index 938438eb3..000000000 Binary files a/fima/themes/graphics/accounts.psd and /dev/null differ diff --git a/fima/themes/graphics/add.png b/fima/themes/graphics/add.png deleted file mode 100644 index 0b45747aa..000000000 Binary files a/fima/themes/graphics/add.png and /dev/null differ diff --git a/fima/themes/graphics/asset.png b/fima/themes/graphics/asset.png deleted file mode 100644 index ae04307b1..000000000 Binary files a/fima/themes/graphics/asset.png and /dev/null differ diff --git a/fima/themes/graphics/eoasset.png b/fima/themes/graphics/eoasset.png deleted file mode 100644 index ae04307b1..000000000 Binary files a/fima/themes/graphics/eoasset.png and /dev/null differ diff --git a/fima/themes/graphics/eoexpense.png b/fima/themes/graphics/eoexpense.png deleted file mode 100644 index 8b4df65ae..000000000 Binary files a/fima/themes/graphics/eoexpense.png and /dev/null differ diff --git a/fima/themes/graphics/eoincome.png b/fima/themes/graphics/eoincome.png deleted file mode 100644 index 288c36c6f..000000000 Binary files a/fima/themes/graphics/eoincome.png and /dev/null differ diff --git a/fima/themes/graphics/expense.png b/fima/themes/graphics/expense.png deleted file mode 100644 index 45b066b51..000000000 Binary files a/fima/themes/graphics/expense.png and /dev/null differ diff --git a/fima/themes/graphics/fima.png b/fima/themes/graphics/fima.png deleted file mode 100644 index 1ee389b08..000000000 Binary files a/fima/themes/graphics/fima.png and /dev/null differ diff --git a/fima/themes/graphics/income.png b/fima/themes/graphics/income.png deleted file mode 100644 index e107bba9d..000000000 Binary files a/fima/themes/graphics/income.png and /dev/null differ diff --git a/fima/themes/graphics/list.png b/fima/themes/graphics/list.png deleted file mode 100644 index 1ee389b08..000000000 Binary files a/fima/themes/graphics/list.png and /dev/null differ diff --git a/fima/themes/graphics/new-small.png b/fima/themes/graphics/new-small.png deleted file mode 100644 index 22179a202..000000000 Binary files a/fima/themes/graphics/new-small.png and /dev/null differ diff --git a/fima/themes/graphics/posting.psd b/fima/themes/graphics/posting.psd deleted file mode 100644 index 7aba1fd91..000000000 Binary files a/fima/themes/graphics/posting.psd and /dev/null differ diff --git a/fima/themes/graphics/report.png b/fima/themes/graphics/report.png deleted file mode 100644 index 15a68209d..000000000 Binary files a/fima/themes/graphics/report.png and /dev/null differ diff --git a/fima/themes/graphics/reports.psd b/fima/themes/graphics/reports.psd deleted file mode 100644 index 98cb1e129..000000000 Binary files a/fima/themes/graphics/reports.psd and /dev/null differ diff --git a/fima/themes/graphics/search-small.png b/fima/themes/graphics/search-small.png deleted file mode 100644 index 126f3a6ea..000000000 Binary files a/fima/themes/graphics/search-small.png and /dev/null differ diff --git a/fima/themes/report.inc b/fima/themes/report.inc deleted file mode 100644 index 6331316fd..000000000 --- a/fima/themes/report.inc +++ /dev/null @@ -1,69 +0,0 @@ -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', - ); diff --git a/fima/themes/screen.css b/fima/themes/screen.css deleted file mode 100644 index 49f27a692..000000000 --- a/fima/themes/screen.css +++ /dev/null @@ -1,291 +0,0 @@ -/* 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; -} - diff --git a/fima/themes/silver/graphics/accounts.png b/fima/themes/silver/graphics/accounts.png deleted file mode 100644 index 0a77f0732..000000000 Binary files a/fima/themes/silver/graphics/accounts.png and /dev/null differ diff --git a/fima/themes/silver/graphics/accounts.psd b/fima/themes/silver/graphics/accounts.psd deleted file mode 100644 index cd004eba2..000000000 Binary files a/fima/themes/silver/graphics/accounts.psd and /dev/null differ diff --git a/fima/themes/silver/graphics/add.png b/fima/themes/silver/graphics/add.png deleted file mode 100644 index abfd5f100..000000000 Binary files a/fima/themes/silver/graphics/add.png and /dev/null differ diff --git a/fima/themes/silver/graphics/asset.png b/fima/themes/silver/graphics/asset.png deleted file mode 100644 index 565935a3a..000000000 Binary files a/fima/themes/silver/graphics/asset.png and /dev/null differ diff --git a/fima/themes/silver/graphics/eoasset.png b/fima/themes/silver/graphics/eoasset.png deleted file mode 100644 index 565935a3a..000000000 Binary files a/fima/themes/silver/graphics/eoasset.png and /dev/null differ diff --git a/fima/themes/silver/graphics/eoexpense.png b/fima/themes/silver/graphics/eoexpense.png deleted file mode 100644 index ca110da0d..000000000 Binary files a/fima/themes/silver/graphics/eoexpense.png and /dev/null differ diff --git a/fima/themes/silver/graphics/eoincome.png b/fima/themes/silver/graphics/eoincome.png deleted file mode 100644 index 0130b2336..000000000 Binary files a/fima/themes/silver/graphics/eoincome.png and /dev/null differ diff --git a/fima/themes/silver/graphics/expense.png b/fima/themes/silver/graphics/expense.png deleted file mode 100644 index 22eeeb04b..000000000 Binary files a/fima/themes/silver/graphics/expense.png and /dev/null differ diff --git a/fima/themes/silver/graphics/fima.png b/fima/themes/silver/graphics/fima.png deleted file mode 100644 index f58aba33b..000000000 Binary files a/fima/themes/silver/graphics/fima.png and /dev/null differ diff --git a/fima/themes/silver/graphics/income.png b/fima/themes/silver/graphics/income.png deleted file mode 100644 index 5b2cc3d7c..000000000 Binary files a/fima/themes/silver/graphics/income.png and /dev/null differ diff --git a/fima/themes/silver/graphics/list.png b/fima/themes/silver/graphics/list.png deleted file mode 100644 index f58aba33b..000000000 Binary files a/fima/themes/silver/graphics/list.png and /dev/null differ diff --git a/fima/themes/silver/graphics/new-small.png b/fima/themes/silver/graphics/new-small.png deleted file mode 100644 index 71aded487..000000000 Binary files a/fima/themes/silver/graphics/new-small.png and /dev/null differ diff --git a/fima/themes/silver/graphics/posting.psd b/fima/themes/silver/graphics/posting.psd deleted file mode 100644 index aa89b612b..000000000 Binary files a/fima/themes/silver/graphics/posting.psd and /dev/null differ diff --git a/fima/themes/silver/graphics/report.png b/fima/themes/silver/graphics/report.png deleted file mode 100644 index 67e927e4e..000000000 Binary files a/fima/themes/silver/graphics/report.png and /dev/null differ diff --git a/fima/themes/silver/graphics/report.psd b/fima/themes/silver/graphics/report.psd deleted file mode 100644 index 0a7956926..000000000 Binary files a/fima/themes/silver/graphics/report.psd and /dev/null differ diff --git a/fima/themes/silver/graphics/search-small.png b/fima/themes/silver/graphics/search-small.png deleted file mode 100644 index 9b695a973..000000000 Binary files a/fima/themes/silver/graphics/search-small.png and /dev/null differ diff --git a/fima/themes/silver/screen.css b/fima/themes/silver/screen.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/flexdemo/alt.php b/flexdemo/alt.php deleted file mode 100644 index c7f9e86ae..000000000 --- a/flexdemo/alt.php +++ /dev/null @@ -1,13 +0,0 @@ - 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'); diff --git a/flexdemo/garland/app.html.php b/flexdemo/garland/app.html.php deleted file mode 100644 index ee9db0800..000000000 --- a/flexdemo/garland/app.html.php +++ /dev/null @@ -1,4 +0,0 @@ -app as $tpl) { - echo $this->render($tpl . '.html.php'); -} diff --git a/flexdemo/garland/css/defaults-rtl.css b/flexdemo/garland/css/defaults-rtl.css deleted file mode 100644 index 84d764661..000000000 --- a/flexdemo/garland/css/defaults-rtl.css +++ /dev/null @@ -1,7 +0,0 @@ -/* $Id: defaults-rtl.css,v 1.3 2007/11/27 12:09:26 goba Exp $ */ - -th { - text-align: right; - padding-right: 0; - padding-left: 1em; -} diff --git a/flexdemo/garland/css/defaults.css b/flexdemo/garland/css/defaults.css deleted file mode 100644 index 56ef350da..000000000 --- a/flexdemo/garland/css/defaults.css +++ /dev/null @@ -1,53 +0,0 @@ -/* $Id: defaults.css,v 1.5 2007/10/02 12:10:40 dries Exp $ */ - -/* -** HTML elements -*/ -fieldset { - margin-bottom: 1em; - padding: .5em; -} -form { - margin: 0; - padding: 0; -} -hr { - height: 1px; - border: 1px solid gray; -} -img { - border: 0; -} -table { - border-collapse: collapse; -} -th { - text-align: left; /* LTR */ - padding-right: 1em; /* LTR */ - border-bottom: 3px solid #ccc; -} - -/* -** Markup free clearing -** Details: http://www.positioniseverything.net/easyclearing.html -*/ -.clear-block:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - -.clear-block { - display: inline-block; -} - -/* Hides from IE-mac \*/ -* html .clear-block { - height: 1%; -} -.clear-block { - display: block; -} -/* End hide from IE-mac */ diff --git a/flexdemo/garland/css/fix-ie-rtl.css b/flexdemo/garland/css/fix-ie-rtl.css deleted file mode 100644 index 84030cf49..000000000 --- a/flexdemo/garland/css/fix-ie-rtl.css +++ /dev/null @@ -1,63 +0,0 @@ -/* $Id: fix-ie-rtl.css,v 1.2 2007/11/09 22:14:41 goba Exp $ */ - -body { - /* Center layout */ - text-align: center; - /* Allow text resizing */ - font-size: 80%; -} - -#squeeze { - zoom: 1; - direction: ltr; -} - -#squeeze .left-corner{ - direction: rtl -} - -#header-region, #wrapper #container { - /* Reset text alignment */ - text-align: right; -} - -#wrapper #container #center { - /* Reduce amount of damage done by extremely wide content */ - overflow: hidden; -} - -#wrapper #container #center .right-corner .left-corner { - /* Because of the lack of min-height, we use height as an alternative */ - height: 400px; -} - -fieldset { - /* Don't draw backgrounds on fieldsets in IE, as they look really bad. */ - background: none; -} - -/* Prevent fieldsets from shifting when changing collapsed state. */ -html.js fieldset.collapsible { - position: relative; - top: -1em; -} - -html.js fieldset.collapsed { - top: 0; - margin-bottom: 1em; -} - -tr.menu-disabled { - /* Use filter to emulate CSS3 opacity */ - filter: alpha(opacity=50); -} - -#header-region { - /* Because of the lack of min-height, we use height as an alternative */ - height: 1em; -} - -#attach-hide label, #uploadprogress div.message { - /* Fading elements in IE causes the text to bleed unless they have a background. */ - background-color: #ffffff; -} diff --git a/flexdemo/garland/css/fix-ie.css b/flexdemo/garland/css/fix-ie.css deleted file mode 100644 index 048863d27..000000000 --- a/flexdemo/garland/css/fix-ie.css +++ /dev/null @@ -1,69 +0,0 @@ -/* $Id: fix-ie.css,v 1.8.2.1 2008/02/05 09:27:26 goba Exp $ */ - -/** - * Garland, for Drupal 6.x - * Stefan Nagtegaal, iStyledThis [dot] nl - * Steven Wittens, acko [dot] net - */ - -body { - /* Center layout */ - text-align: center; - /* Allow text resizing */ - font-size: 80%; -} - -#header-region, #wrapper #container { - /* Reset text alignment */ - text-align: left; /* LTR */ -} - -#wrapper #container #center { - /* Reduce amount of damage done by extremely wide content */ - overflow: hidden; -} - -#wrapper #container #center .right-corner .left-corner { - /* Because of the lack of min-height, we use height as an alternative */ - height: 400px; -} - -fieldset { - /* Don't draw backgrounds on fieldsets in IE, as they look really bad. */ - background: none; -} - -ul.primary { - /* Fix missing top margin */ - position: relative; /* LTR */ -/* top: 0.5em; */ -} - -/* Prevent fieldsets from shifting when changing collapsed state. */ -html.js fieldset.collapsible { - position: relative; - top: -1em; -} -html.js fieldset.collapsed { - top: 0; - margin-bottom: 1em; -} - -tr.menu-disabled { - /* Use filter to emulate CSS3 opacity */ - filter: alpha(opacity=50); -} - -#header-region { - /* Because of the lack of min-height, we use height as an alternative */ - height: 1em; -} - -tr.taxonomy-term-preview { - filter: alpha(opacity=50); -} - -#attach-hide label, #uploadprogress div.message { - /* Fading elements in IE causes the text to bleed unless they have a background. */ - background-color: #ffffff; -} diff --git a/flexdemo/garland/css/print.css b/flexdemo/garland/css/print.css deleted file mode 100644 index b45a26335..000000000 --- a/flexdemo/garland/css/print.css +++ /dev/null @@ -1,55 +0,0 @@ -/* $Id: print.css,v 1.3 2007/09/06 21:23:32 goba Exp $ */ - -/** - * Garland, for Drupal 5.0 - * Stefan Nagtegaal, iStyledThis [dot] nl - * Steven Wittens, acko [dot] net` - * - * If you use a customized color scheme, you must regenerate it after - * modifying this file. - */ - -body, input, textarea, select { - color: #000; - background: none; -} - -ul.primary-links, ul.secondary-links, -#header-region, .sidebar { - display: none; -} - -body.sidebars, body.sideber-left, body.sidebar-right, body { - width: 640px; -} - -body.sidebar-left #center, body.sidebar-right #center, body.sidebars #center, -body.sidebar-left #squeeze, body.sidebar-right #squeeze, body.sidebars #squeeze { - margin: 0; -} - -#wrapper, -#wrapper #container .breadcrumb, -#wrapper #container #center, -#wrapper #container #center .right-corner, -#wrapper #container #center .right-corner .left-corner, -#wrapper #container #footer, -#wrapper #container #center #squeeze { - position: static; - left: 0; - padding: 0; - margin: 0; - width: auto; - float: none; - clear: both; - background: none; -} - -#wrapper #container #header { - height: 130px; -} - -#wrapper #container #header h1, #wrapper #container #header h1 a:link, #wrapper #container #header h1 a:visited { - text-shadow: none; - color: #000; -} diff --git a/flexdemo/garland/css/style-rtl.css b/flexdemo/garland/css/style-rtl.css deleted file mode 100644 index f5fa6d7ec..000000000 --- a/flexdemo/garland/css/style-rtl.css +++ /dev/null @@ -1,293 +0,0 @@ -/* $Id: style-rtl.css,v 1.6 2007/12/17 15:05:10 goba Exp $ */ - -html { - direction: rtl; -} - -/** - * Generic elements - */ -body { - direction: rtl; -} - -ol li, ul li { - margin: 0.4em .5em 0.4em 0; -} - -ul.menu, .item-list ul { - margin: 0.35em -0.5em 0 0; -} - -ul.menu ul, .item-list ul ul { - margin-left: 0; - margin-right: 0em; -} - -ol li, ul li, ul.menu li, .item-list ul li, li.leaf { - margin: 0.15em .5em 0.15em 0; -} - -ul li, ul.menu li, .item-list ul li, li.leaf { - padding: 0 1.5em .2em 0; - background: transparent url("../images/menu-leaf.gif") no-repeat 100% .35em; -} - -ol li { - margin-left: 0; - margin-right: 2em; -} - -ul li.expanded { - background: transparent url("../images/menu-expanded.gif") no-repeat 100% .35em; -} - -ul li.collapsed { - background: transparent url("../images/menu-collapsed-rtl.gif") no-repeat 100% .35em; -} - -ul.inline li { - padding: 0 0 0 1em; -} - -ol.task-list { - margin-left: 0; - margin-right: 0; -} - -ol.task-list li { - padding: 0.5em 2em 0.5em 1em; -} - -ol.task-list li.active { - background: transparent url(../images/task-list.png) no-repeat 97px 50%; -} - -ol.task-list li.done { - background: transparent url(../../misc/watchdog-ok.png) no-repeat 100% 50%; -} - -ol.task-list li.active { - margin-right: 0; - margin-left: 1em; -} - -dl { - margin: 0.5em 1.5em 1em 0; -} - -dl dt { -} - -dl dd { - margin: 0 1.5em .5em 0; -} - -.form-button, .form-submit { - margin: 2em 0 1em 0.5em; -} - -#header-region h2 { - margin: 0 0 0 1em; -} - -#wrapper { - background: #edf5fa url("../images/body.png") repeat-x 50% 0; -} - -#wrapper #container #header h1 img { - padding-right: 0; - padding-left: 20px; - float: right; -} - -#sidebar-left .block-region { - margin: 0 0 0 15px; -} - -#sidebar-right .block-region { - margin: 0 15px 0px 0; -} - -/* Now we add the backgrounds for the main content shading */ -#wrapper #container #center #squeeze { - background: #fff url("../images/bg-content.png") repeat-x 50% 0; -} - -#wrapper #container .breadcrumb { - position: absolute; - top: 15px; - left: 0; - right: 35px; - z-index: 3; -} - -/** - * Primary navigation - */ -ul.primary-links { - float: left; -width:70%; -} - -ul.primary-links li { - float: right; -} - -/** - * Secondary navigation - */ -ul.secondary-links { - float: left; - clear: left; -} - -ul.secondary-links li { - float: right; -} - -ul.primary { - float: right; -} -ul.secondary { - clear: both; - text-align: right; -} -h2.with-tabs { - float: right; - margin: 0 0 0 2em; -} - -ul.primary li a, ul.primary li.active a, ul.primary li a:hover, ul.primary li a:visited, -ul.secondary li a, ul.secondary li.active a, ul.secondary li a:hover, ul.secondary li a:visited { - margin: 0 1px 0 0; - -} -ul.primary li a:after { - /* Fix Firefox 2 RTL bug. */ - content: " "; -} - -ul.links li, ul.inline li { - padding-left: 1em; - padding-right: 0; -} - -.node .links, .comment .links { - text-align: right; -} - -.node .links ul.links li, .comment .links ul.links li {} -.terms ul.links li { - padding-right: 1em; - padding-left: 0; -} - -.picture, .comment .submitted { - padding-left: 0; - float: left; - clear: left; - padding-right: 1em; -} - -.new { - float: left; -} - -.terms { - float: left; -} - -.indented { - margin-left: 0; - margin-right: 25px; -} - -html.js fieldset.collapsible legend a { - padding-left: 0; - padding-right: 2em; - background: url("../images/menu-expanded.gif") no-repeat 100% 50%; -} - -html.js fieldset.collapsed legend a { - background: url("../images/menu-collapsed-rtl.gif") no-repeat 100% 50%; -} - -/** - * Syndication Block - */ -#block-node-0 h2 { - float: right; - padding-right: 0; - padding-left: 20px; -} - -#block-node-0 img { - float: left; -} - -#block-node-0 .content { - clear: left; -} - -/** - * Login Block - */ -#user-login-form ul { - text-align: right; -} - -div.admin .left { - float: right; -} - -div.admin .right { - float: left; -} - -/* Fix Opera, IE6 and IE7 header width */ -#wrapper #container #header { - position: relative; - width: 100%; -} - -#wrapper #container #header #logo-floater { - width: 100%; - left: 0; - top:0; -} - -/** - * Fixes for IE7 - Does not break other browsers - */ - -/* Position:relative on these breaks IE7. */ -ul.primary li a, ul.primary li.active a, ul.primary li a:hover, ul.primary li a:visited, -ul.secondary li a, ul.secondary li.active a, ul.secondary li a:hover, ul.secondary li a:visited { - position: static; -} - -/* Fix right and left cloumns position breaking on window resize */ -#container { - position: relative; -} - -#center { - position: relative; -} - -#sidebar-right{ - position: absolute; - right: 0; -} - -/** - * Apply hasLayout to elements in IE7, using standard property "min-height" - * (see http://www.satzansatz.de/cssd/onhavinglayout.html) - */ - -/* Fix background bleed in center column. */ -#squeeze, -#squeeze .right-corner { - min-height: 1%; -} diff --git a/flexdemo/garland/css/style.css b/flexdemo/garland/css/style.css deleted file mode 100644 index 4b151b0f4..000000000 --- a/flexdemo/garland/css/style.css +++ /dev/null @@ -1,1079 +0,0 @@ -/* $Id: style.css,v 1.38.2.1 2008/02/05 09:27:26 goba Exp $ */ - -/** - * Garland, for Drupal 6.x - * Stefan Nagtegaal, iStyledThis [dot] nl - * Steven Wittens, acko [dot] net` - * - * If you use a customized color scheme, you must regenerate it after - * modifying this file. - */ - -/** - * Generic elements - */ -body { - margin: 0; - padding: 0; - background: #edf5fa; - font: 12px/170% Verdana, sans-serif; - color: #494949; -} - -input { - font: 12px/100% Verdana, sans-serif; - color: #494949; -} - -textarea, select { - font: 12px/160% Verdana, sans-serif; - color: #494949; -} - -h1, h2, h3, h4, h5, h6 { - margin: 0; - padding: 0; - font-weight: normal; - font-family: Helvetica, Arial, sans-serif; -} - -h1 { - font-size: 170%; -} - -h2 { - font-size: 160%; - line-height: 130%; -} - -h3 { - font-size: 140%; -} - -h4 { - font-size: 130%; -} - -h5 { - font-size: 120%; -} - -h6 { - font-size: 110%; -} - -ul, quote, code, fieldset { - margin: .5em 0; -} - -p { - margin: 0.6em 0 1.2em; - padding: 0; -} - -a:link, a:visited { - color: #027AC6; - text-decoration: none; -} - -a:hover { - color: #0062A0; - text-decoration: underline; -} - -a:active, a.active { - color: #5895be; -} - -hr { - margin: 0; - padding: 0; - border: none; - height: 1px; - background: #5294c1; -} - -ul { - margin: 0.5em 0 1em; - padding: 0; -} - -ol { - margin: 0.75em 0 1.25em; - padding: 0; -} - -ol li, ul li { - margin: 0.4em 0 0.4em .5em; /* LTR */ -} - -ul.menu, .item-list ul { - margin: 0.35em 0 0 -0.5em; /* LTR */ - padding: 0; -} - -ul.menu ul, .item-list ul ul { - margin-left: 0em; /* LTR */ -} - -ol li, ul li, ul.menu li, .item-list ul li, li.leaf { - margin: 0.15em 0 0.15em .5em; /* LTR */ -} - -ul li, ul.menu li, .item-list ul li, li.leaf { - padding: 0 0 .2em 1.5em; - list-style-type: none; - list-style-image: none; - background: transparent url(../images/menu-leaf.gif) no-repeat 1px .35em; /* LTR */ -} - -ol li { - padding: 0 0 .3em; - margin-left: 2em; /* LTR */ -} - -ul li.expanded { - background: transparent url(../images/menu-expanded.gif) no-repeat 1px .35em; /* LTR */ -} - -ul li.collapsed { - background: transparent url(../images/menu-collapsed.gif) no-repeat 0px .35em; /* LTR */ -} - -ul li.leaf a, ul li.expanded a, ul li.collapsed a { - display: block; -} - -ul.inline li { - background: none; - margin: 0; - padding: 0 1em 0 0; /* LTR */ -} - -ol.task-list { - margin-left: 0; /* LTR */ - list-style-type: none; - list-style-image: none; -} -ol.task-list li { - padding: 0.5em 1em 0.5em 2em; /* LTR */ -} -ol.task-list li.active { - background: transparent url(../images/task-list.png) no-repeat 3px 50%; /* LTR */ -} -ol.task-list li.done { - color: #393; - background: transparent url(../../misc/watchdog-ok.png) no-repeat 0px 50%; /* LTR */ -} -ol.task-list li.active { - margin-right: 1em; /* LTR */ -} - -fieldset ul.clear-block li { - margin: 0; - padding: 0; - background-image: none; -} - -dl { - margin: 0.5em 0 1em 1.5em; /* LTR */ -} - -dl dt { -} - -dl dd { - margin: 0 0 .5em 1.5em; /* LTR */ -} - -img, a img { - border: none; -} - -table { - margin: 1em 0; - width: 100%; -} - -thead th { - border-bottom: 2px solid #d3e7f4; - color: #494949; - font-weight: bold; -} - -th a:link, th a:visited { - color: #6f9dbd; -} - -td, th { - padding: .3em .5em; -} - -tr.even, tr.odd, tbody th { - border: solid #d3e7f4; - border-width: 1px 0; -} - -tr.odd, tr.info { - background-color: #edf5fa; -} - -tr.even { - background-color: #fff; -} - -tr.drag { - background-color: #fffff0; -} - -tr.drag-previous { - background-color: #ffd; -} - -tr.odd td.active { - background-color: #ddecf5; -} - -tr.even td.active { - background-color: #e6f1f7; -} - -td.region, td.module, td.container, td.category { - border-top: 1.5em solid #fff; - border-bottom: 1px solid #b4d7f0; - background-color: #d4e7f3; - color: #455067; - font-weight: bold; -} - -tr:first-child td.region, tr:first-child td.module, tr:first-child td.container, tr:first-child td.category { - border-top-width: 0; -} - -span.form-required { - color: #ffae00; -} - -span.submitted, .description { - font-size: 0.92em; - color: #898989; -} - -.description { - line-height: 150%; - margin-bottom: 0.75em; - color: #898989; -} - -.messages, .preview { - margin: .75em 0 .75em; - padding: .5em 1em; -} - -.messages ul { - margin: 0; -} - -.form-checkboxes, .form-radios, .form-checkboxes .form-item, .form-radios .form-item { - margin: 0.25em 0; -} - -#center form { - margin-bottom: 2em; -} - -.form-button, .form-submit { - margin: 2em 0.5em 1em 0; /* LTR */ -} - -#dblog-form-overview .form-submit, -.confirmation .form-submit, -.search-form .form-submit, -.poll .form-submit, -fieldset .form-button, fieldset .form-submit, -.sidebar .form-button, .sidebar .form-submit, -table .form-button, table .form-submit { - margin: 0; -} - -.box { - margin-bottom: 2.5em; -} - -/** - * Layout - */ -#header-region { - min-height: 1em; - background: #d2e6f3 url(../images/bg-navigation.png) repeat-x 50% 100%; -} - -#header-region .block { - display: block; - margin: 0 1em; -} - -#header-region .block-region { - display: block; - margin: 0 0.5em 1em; - padding: 0.5em; - position: relative; - top: 0.5em; -} - -#header-region * { - display: inline; - line-height: 1.5em; - margin-top: 0; - margin-bottom: 0; -} - -/* Prevent the previous directive from showing the content of script elements in Mozilla browsers. */ -#header-region script { - display: none; -} - -#header-region p, #header-region img { - margin-top: 0.5em; -} - -#header-region h2 { - margin: 0 1em 0 0; /* LTR */ -} - -#header-region h3, #header-region label, #header-region li { - margin: 0 1em; - padding: 0; - background: none; -} - -#wrapper { - background: #edf5fa url(../images/body.png) repeat-x 50% 0; -} - -#wrapper #container { - margin: 0 auto; - padding: 0 20px; - max-width: 1270px; -} - -#wrapper #container #header { - height: 80px; -} - -#wrapper #container #header #logo-floater { - position: absolute; -} - -#wrapper #container #header h1, #wrapper #container #header h1 a:link, #wrapper #container #header h1 a:visited { - line-height: 120px; - position: relative; - z-index: 2; - white-space: nowrap; -} - -#wrapper #container #header h1 span { - font-weight: bold; -} - -#wrapper #container #header h1 img { - padding-top: 16px; - padding-right: 20px; /* LTR */ - float: left; /* LTR */ -} - -/* With 3 columns, require a minimum width of 1000px to ensure there is enough horizontal space. */ -body.sidebars { - min-width: 980px; -} -/* With 2 columns, require a minimum width of 800px. */ -body.sidebar-left, body.sidebar-right { - min-width: 780px; -} - -/* We must define 100% width to avoid the body being too narrow for near-empty pages */ -#wrapper #container #center { - float: left; - width: 100%; -} - -/* So we move the #center container over the sidebars to compensate */ -body.sidebar-left #center { - margin-left: -210px; -} -body.sidebar-right #center { - margin-right: -210px; -} -body.sidebars #center { - margin: 0 -210px; -} - -/* And add blanks left and right for the sidebars to fill */ -body.sidebar-left #squeeze { - margin-left: 210px; -} -body.sidebar-right #squeeze { - margin-right: 210px; -} -body.sidebars #squeeze { - margin: 0 210px; -} - -/* We ensure the sidebars are still clickable using z-index */ -#wrapper #container .sidebar { - margin: 60px 0 5em; - width: 210px; - float: left; - z-index: 2; - position: relative; -} - -#wrapper #container .sidebar .block { - margin: 0 0 1.5em 0; -} - -#sidebar-left .block { - padding: 0 15px 0 0px; -} - -#sidebar-right .block { - padding: 0 0px 0 15px; -} - -.block .content { - margin: 0.5em 0; -} - -#sidebar-left .block-region { - margin: 0 15px 0 0px; /* LTR */ -} - -#sidebar-right .block-region { - margin: 0 0px 0 15px; /* LTR */ -} - -.block-region { - padding: 1em; - background: transparent; - border: 2px dashed #b4d7f0; - text-align: center; - font-size: 1.3em; -} - -/* Now we add the backgrounds for the main content shading */ -#wrapper #container #center #squeeze { - background: #fff url(../images/bg-content.png) repeat-x 50% 0; - position: relative; -} - -#wrapper #container #center .right-corner { - background: transparent url(../images/bg-content-right.png) no-repeat 100% 0; - position: relative; - left: 10px; -} - -#wrapper #container #center .right-corner .left-corner { - padding: 60px 25px 5em 35px; - background: transparent url(../images/bg-content-left.png) no-repeat 0 0; - margin-left: -10px; - position: relative; - left: -10px; - min-height: 400px; -} - -#wrapper #container #footer { - float: none; - clear: both; - text-align: center; - margin: 4em 0 -3em; - color: #898989; -} - -#wrapper #container .breadcrumb { - position: absolute; - top: 15px; - left: 35px; /* LTR */ - z-index: 3; -} - -body.sidebar-left #footer { - margin-left: -210px; -} - -body.sidebar-right #footer { - margin-right: -210px; -} - -body.sidebars #footer { - margin: 0 -210px; -} - -/** - * Header - */ -#wrapper #container #header h1, #wrapper #container #header h1 a:link, #wrapper #container #header h1 a:visited { - color: #fff; - font-weight: normal; - text-shadow: #1659ac 0px 1px 3px; - font-size: 1.5em; -} - -#wrapper #container #header h1 a:hover { - text-decoration: none; -} - -#wrapper #container .breadcrumb { - font-size: 0.92em; -} - -#wrapper #container .breadcrumb, #wrapper #container .breadcrumb a { - color: #529ad6; -} - -#mission { - padding: 1em; - background-color: #fff; - border: 1px solid #e0e5fb; - margin-bottom: 2em; -} - -/** - * Primary navigation - */ -ul.primary-links { - margin: 0; - padding: 0; - float: right; /* LTR */ - position: relative; - z-index: 4; -} - -ul.primary-links li { - margin: 0; - padding: 0; - float: left; /* LTR */ - background-image: none; -} - -ul.primary-links li a, ul.primary-links li a:link, ul.primary-links li a:visited { - display: block; - margin: 0 1em; - padding: .75em 0 0; - color: #fff; - background: transparent url(../images/bg-navigation-item.png) no-repeat 50% 0; -} - -ul.primary-links li a:hover, ul.primary-links li a.active { - color: #fff; - background: transparent url(../images/bg-navigation-item-hover.png) no-repeat 50% 0; -} - -/** - * Secondary navigation - */ -ul.secondary-links { - margin: 0; - padding: 18px 0 0; - float: right; /* LTR */ - clear: right; /* LTR */ - position: relative; - z-index: 4; -} - -ul.secondary-links li { - margin: 0; - padding: 0; - float: left; /* LTR */ - background-image: none; -} - -ul.secondary-links li a, ul.secondary-links li a:link, ul.secondary-links li a:visited { - display: block; - margin: 0 1em; - padding: .75em 0 0; - color: #cde3f1; - background: transparent; -} - -ul.secondary-links li a:hover, ul.secondary-links li a.active { - color: #cde3f1; - background: transparent; -} - -/** - * Local tasks - */ -ul.primary, ul.primary li, ul.secondary, ul.secondary li { - border: 0; - background: none; - margin: 0; - padding: 0; -} - -#tabs-wrapper { - margin: 0 -26px 1em; - padding: 0 26px; - border-bottom: 1px solid #e9eff3; - position: relative; -} -ul.primary { - padding: 0.5em 0 10px; - float: left; /* LTR */ -} -ul.secondary { - clear: both; - text-align: left; /* LTR */ - border-bottom: 1px solid #e9eff3; - margin: -0.2em -26px 1em; - padding: 0 26px 0.6em; -} -h2.with-tabs { - float: left; /* LTR */ - margin: 0 2em 0 0; /* LTR */ - padding: 0; -} - -ul.primary li a, ul.primary li.active a, ul.primary li a:hover, ul.primary li a:visited, -ul.secondary li a, ul.secondary li.active a, ul.secondary li a:hover, ul.secondary li a:visited { - border: 0; - background: transparent; - padding: 4px 1em; - margin: 0 0 0 1px; /* LTR */ - height: auto; - text-decoration: none; - position: relative; - top: -1px; -} -ul.primary li.active a, ul.primary li.active a:link, ul.primary li.active a:visited, ul.primary li a:hover, -ul.secondary li.active a, ul.secondary li.active a:link, ul.secondary li.active a:visited, ul.secondary li a:hover { - background: url(../images/bg-tab.png) repeat-x 0 50%; - color: #fff; -} -ul.primary li.active a, -ul.secondary li.active a { - font-weight: bold; -} - -/** - * Nodes & comments - */ -.node { - border-bottom: 1px solid #e9eff3; - margin: -1.5em -26px 1.5em; - padding: 1.5em 26px; -} - -ul.links li, ul.inline li { - margin-left: 0; - margin-right: 0; - padding-left: 0; /* LTR */ - padding-right: 1em; /* LTR */ - background-image: none; -} - -.node .links, .comment .links { - text-align: left; /* LTR */ -} - -.node .links ul.links li, .comment .links ul.links li {} -.terms ul.links li { - margin-left: 0; - margin-right: 0; - padding-right: 0; - padding-left: 1em; -} - -.picture, .comment .submitted { - float: right; /* LTR */ - clear: right; /* LTR */ - padding-left: 1em; /* LTR */ -} - -.new { - color: #ffae00; - font-size: 0.92em; - font-weight: bold; - float: right; /* LTR */ -} - -.terms { - float: right; /* LTR */ -} - -.preview .node, .preview .comment, .sticky { - margin: 0; - padding: 0.5em 0; - border: 0; - background: 0; -} - -.sticky { - padding: 1em; - background-color: #fff; - border: 1px solid #e0e5fb; - margin-bottom: 2em; -} - -#comments { - position: relative; - top: -1px; - border-bottom: 1px solid #e9eff3; - margin: -1.5em -25px 0; - padding: 0 25px; -} - -#comments h2.comments { - margin: 0 -25px; - padding: .5em 25px; - background: #fff url(../images/gradient-inner.png) repeat-x 0 0; -} - -.comment { - margin: 0 -25px; - padding: 1.5em 25px 1.5em; - border-top: 1px solid #e9eff3; -} - -.indented { - margin-left: 25px; /* LTR */ -} - -.comment h3 a.active { - color: #494949; -} - -.node .content, .comment .content { - margin: 0.6em 0; -} - -/** - * Aggregator.module - */ -#aggregator { - margin-top: 1em; -} -#aggregator .feed-item-title { - font-size: 160%; - line-height: 130%; -} -#aggregator .feed-item { - border-bottom: 1px solid #e9eff3; - margin: -1.5em -31px 1.75em; - padding: 1.5em 31px; -} -#aggregator .feed-item-categories { - font-size: 0.92em; -} -#aggregator .feed-item-meta { - font-size: 0.92em; - color: #898989; -} - -/** - * Color.module - */ -#palette .form-item { - border: 1px solid #fff; -} -#palette .item-selected { - background: #fff url(../images/gradient-inner.png) repeat-x 0 0; - border: 1px solid #d9eaf5; -} - -/** - * Menu.module - */ -tr.menu-disabled { - opacity: 0.5; -} -tr.odd td.menu-disabled { - background-color: #edf5fa; -} -tr.even td.menu-disabled { - background-color: #fff; -} - -/** - * Poll.module - */ -.poll .bar { - background: #fff url(../images/bg-bar-white.png) repeat-x 0 0; - border: solid #f0f0f0; - border-width: 0 1px 1px; -} - -.poll .bar .foreground { - background: #71a7cc url(../images/bg-bar.png) repeat-x 0 100%; -} - -.poll .percent { - font-size: .9em; -} - -/** - * Autocomplete. - */ -#autocomplete li { - cursor: default; - padding: 2px; - margin: 0; -} - -/** - * Collapsible fieldsets - */ -fieldset { - margin: 1em 0; - padding: 1em; - border: 1px solid #d9eaf5; - background: #fff url(../images/gradient-inner.png) repeat-x 0 0; -} - -/* Targets IE 7. Fixes background image in field sets. */ -*:first-child+html fieldset { - padding: 0 1em 1em; - background-position: 0 .75em; - background-color: transparent; -} - -*:first-child+html fieldset > .description, *:first-child+html fieldset .fieldset-wrapper .description { - padding-top: 1em; -} - -fieldset legend { - /* Fix disappearing legend in FFox */ - display: block; -} - -*:first-child+html fieldset legend, *:first-child+html fieldset.collapsed legend { - display: inline; -} - -html.js fieldset.collapsed { - background: transparent; - padding-top: 0; - padding-bottom: .6em; -} - -html.js fieldset.collapsible legend a { - padding-left: 2em; /* LTR */ - background: url(../images/menu-expanded.gif) no-repeat 0% 50%; /* LTR */ -} - -html.js fieldset.collapsed legend a { - background: url(../images/menu-collapsed.gif) no-repeat 0% 50%; /* LTR */ -} - -/** - * Syndication icons and block - */ -#block-node-0 h2 { - float: left; /* LTR */ - padding-right: 20px; /* LTR */ -} - -#block-node-0 img, .feed-icon { - float: right; /* LTR */ - padding-top: 4px; -} - -#block-node-0 .content { - clear: right; /* LTR */ -} - -/** - * Login Block - */ -#user-login-form { - text-align: center; -} -#user-login-form ul { - text-align: left; /* LTR */ -} - -/** - * User profiles. - */ -.profile { - margin-top: 1.5em; -} -.profile h3 { - border-bottom: 0; - margin-bottom: 1em; -} -.profile dl { - margin: 0; -} -.profile dt { - font-weight: normal; - color: #898989; - font-size: 0.92em; - line-height: 1.3em; - margin-top: 1.4em; - margin-bottom: 0.45em; -} -.profile dd { - margin-bottom: 1.6em; -} - -/** - * Admin Styles - */ -div.admin-panel, -div.admin-panel .description, -div.admin-panel .body, -div.admin, -div.admin .left, -div.admin .right, -div.admin .expert-link, -div.item-list, -.menu { - margin: 0; - padding: 0; -} - -div.admin .left { - float: left; /* LTR */ - width: 48%; -} -div.admin .right { - float: right; /* LTR */ - width: 48%; -} - -div.admin-panel { - background: #fff url(../images/gradient-inner.png) repeat-x 0 0; - padding: 1em 1em 1.5em; -} -div.admin-panel .description { - margin-bottom: 1.5em; -} -div.admin-panel dl { - margin: 0; -} -div.admin-panel dd { - color: #898989; - font-size: 0.92em; - line-height: 1.3em; - margin-top: -.2em; - margin-bottom: .65em; -} - -table.system-status-report th { - border-color: #d3e7f4; -} - -#autocomplete li.selected, tr.selected td, tr.selected td.active { - background: #027ac6; - color: #fff; -} - -tr.selected td a:link, tr.selected td a:visited, tr.selected td a:active { - color: #d3e7f4; -} - -tr.taxonomy-term-preview { - opacity: 0.5; -} - -tr.taxonomy-term-divider-top { - border-bottom: none; -} - -tr.taxonomy-term-divider-bottom { - border-top: 1px dotted #CCC; -} - -/** - * CSS support - */ - -/******************************************************************* - * Color Module: Don't touch * - *******************************************************************/ - -/** - * Generic elements. - */ -.messages { - background-color: #fff; - border: 1px solid #b8d3e5; -} - -.preview { - background-color: #fcfce8; - border: 1px solid #e5e58f; -} - -div.status { - color: #33a333; - border-color: #c7f2c8; -} - -div.error, tr.error { - color: #a30000; - background-color: #FFCCCC; -} - -.form-item input.error, .form-item textarea.error { - border: 1px solid #c52020; - color: #363636; -} - -/** - * dblog.module - */ -tr.dblog-user { - background-color: #fcf9e5; -} - -tr.dblog-user td.active { - background-color: #fbf5cf; -} - -tr.dblog-content { - background-color: #fefefe; -} - -tr.dblog-content td.active { - background-color: #f5f5f5; -} - -tr.dblog-warning { - background-color: #fdf5e6; -} - -tr.dblog-warning td.active { - background-color: #fdf2de; -} - -tr.dblog-error { - background-color: #fbe4e4; -} - -tr.dblog-error td.active { - background-color: #fbdbdb; -} -tr.dblog-page-not-found, tr.dblog-access-denied { - background: #d7ffd7; -} -tr.dblog-page-not-found td.active, tr.dblog-access-denied td.active { - background: #c7eec7; -} - -/** - * Status report colors. - */ -table.system-status-report tr.error, table.system-status-report tr.error th { - background-color: #fcc; - border-color: #ebb; - color: #200; -} -table.system-status-report tr.warning, table.system-status-report tr.warning th { - background-color: #ffd; - border-color: #eeb; -} -table.system-status-report tr.ok, table.system-status-report tr.ok th { - background-color: #dfd; - border-color: #beb; -} diff --git a/flexdemo/garland/images/bg-bar-white.png b/flexdemo/garland/images/bg-bar-white.png deleted file mode 100644 index 256ea31b1..000000000 Binary files a/flexdemo/garland/images/bg-bar-white.png and /dev/null differ diff --git a/flexdemo/garland/images/bg-bar.png b/flexdemo/garland/images/bg-bar.png deleted file mode 100644 index 1fbcae043..000000000 Binary files a/flexdemo/garland/images/bg-bar.png and /dev/null differ diff --git a/flexdemo/garland/images/bg-content-left.png b/flexdemo/garland/images/bg-content-left.png deleted file mode 100644 index a64b346e6..000000000 Binary files a/flexdemo/garland/images/bg-content-left.png and /dev/null differ diff --git a/flexdemo/garland/images/bg-content-right.png b/flexdemo/garland/images/bg-content-right.png deleted file mode 100644 index f07ebb5cd..000000000 Binary files a/flexdemo/garland/images/bg-content-right.png and /dev/null differ diff --git a/flexdemo/garland/images/bg-content.png b/flexdemo/garland/images/bg-content.png deleted file mode 100644 index d55828ed2..000000000 Binary files a/flexdemo/garland/images/bg-content.png and /dev/null differ diff --git a/flexdemo/garland/images/bg-navigation-item-hover.png b/flexdemo/garland/images/bg-navigation-item-hover.png deleted file mode 100644 index c783d718b..000000000 Binary files a/flexdemo/garland/images/bg-navigation-item-hover.png and /dev/null differ diff --git a/flexdemo/garland/images/bg-navigation-item.png b/flexdemo/garland/images/bg-navigation-item.png deleted file mode 100644 index d2452ac4f..000000000 Binary files a/flexdemo/garland/images/bg-navigation-item.png and /dev/null differ diff --git a/flexdemo/garland/images/bg-navigation.png b/flexdemo/garland/images/bg-navigation.png deleted file mode 100644 index 18b9559de..000000000 Binary files a/flexdemo/garland/images/bg-navigation.png and /dev/null differ diff --git a/flexdemo/garland/images/bg-tab.png b/flexdemo/garland/images/bg-tab.png deleted file mode 100644 index 18554b04d..000000000 Binary files a/flexdemo/garland/images/bg-tab.png and /dev/null differ diff --git a/flexdemo/garland/images/body.png b/flexdemo/garland/images/body.png deleted file mode 100644 index b361e7b38..000000000 Binary files a/flexdemo/garland/images/body.png and /dev/null differ diff --git a/flexdemo/garland/images/gradient-inner.png b/flexdemo/garland/images/gradient-inner.png deleted file mode 100644 index 7ca1413f6..000000000 Binary files a/flexdemo/garland/images/gradient-inner.png and /dev/null differ diff --git a/flexdemo/garland/images/menu-collapsed-rtl.gif b/flexdemo/garland/images/menu-collapsed-rtl.gif deleted file mode 100644 index fb0beb608..000000000 Binary files a/flexdemo/garland/images/menu-collapsed-rtl.gif and /dev/null differ diff --git a/flexdemo/garland/images/menu-collapsed.gif b/flexdemo/garland/images/menu-collapsed.gif deleted file mode 100644 index 3dc9ca770..000000000 Binary files a/flexdemo/garland/images/menu-collapsed.gif and /dev/null differ diff --git a/flexdemo/garland/images/menu-expanded.gif b/flexdemo/garland/images/menu-expanded.gif deleted file mode 100644 index 126ccc11a..000000000 Binary files a/flexdemo/garland/images/menu-expanded.gif and /dev/null differ diff --git a/flexdemo/garland/images/menu-leaf.gif b/flexdemo/garland/images/menu-leaf.gif deleted file mode 100644 index b7811910e..000000000 Binary files a/flexdemo/garland/images/menu-leaf.gif and /dev/null differ diff --git a/flexdemo/garland/images/task-list.png b/flexdemo/garland/images/task-list.png deleted file mode 100644 index a4de35516..000000000 Binary files a/flexdemo/garland/images/task-list.png and /dev/null differ diff --git a/flexdemo/garland/left.html.php b/flexdemo/garland/left.html.php deleted file mode 100644 index c1d97ee4e..000000000 --- a/flexdemo/garland/left.html.php +++ /dev/null @@ -1,4 +0,0 @@ -left as $block_def) { - echo $this->blockContent($block_def); -} diff --git a/flexdemo/garland/list.html.php b/flexdemo/garland/list.html.php deleted file mode 100644 index a9756ec7d..000000000 --- a/flexdemo/garland/list.html.php +++ /dev/null @@ -1,7 +0,0 @@ - -

Application zone

-
- Welcome to Horde Flex demo. -
diff --git a/flexdemo/garland/main.html.php b/flexdemo/garland/main.html.php deleted file mode 100644 index abd097b26..000000000 --- a/flexdemo/garland/main.html.php +++ /dev/null @@ -1,54 +0,0 @@ - - - - Administration theme | Drupal6 Test - - - - - - - - - - - - -
-
- - - - - -
-
-
-
- render('app.html.php') ?> -
-
-
-
- - - -
-
- - - - diff --git a/flexdemo/garland/right.html.php b/flexdemo/garland/right.html.php deleted file mode 100644 index 73fd064fc..000000000 --- a/flexdemo/garland/right.html.php +++ /dev/null @@ -1 +0,0 @@ -blockContent('flexdemo', 'menu') ?> \ No newline at end of file diff --git a/flexdemo/garland/secondary.html.php b/flexdemo/garland/secondary.html.php deleted file mode 100644 index 8fcc8072c..000000000 --- a/flexdemo/garland/secondary.html.php +++ /dev/null @@ -1,58 +0,0 @@ - - - - Administration theme | Drupal6 Test - - - - - - - - - - - - - -
-
- - - -
-
-
-
- - -

Application zone

-
- The configuration options have been reset to their default values. -
-
-
-
-
- - - -
-
- - - - diff --git a/flexdemo/index.php b/flexdemo/index.php deleted file mode 100644 index 44985b606..000000000 --- a/flexdemo/index.php +++ /dev/null @@ -1,13 +0,0 @@ - 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'); diff --git a/flexdemo/lib/Block/block1.php b/flexdemo/lib/Block/block1.php deleted file mode 100644 index 0d457dfa4..000000000 --- a/flexdemo/lib/Block/block1.php +++ /dev/null @@ -1,39 +0,0 @@ -Block1

foo

'; - return $html; - } - - - function toHtml() - { - return $this->_content(); - } - -} diff --git a/flexdemo/lib/Block/block2.php b/flexdemo/lib/Block/block2.php deleted file mode 100644 index 095afd603..000000000 --- a/flexdemo/lib/Block/block2.php +++ /dev/null @@ -1,39 +0,0 @@ -Block2'; - return $html; - } - - - function toHtml() - { - return $this->_content(); - } - -} diff --git a/flexdemo/lib/Block/menu.php b/flexdemo/lib/Block/menu.php deleted file mode 100644 index c8b0eabc5..000000000 --- a/flexdemo/lib/Block/menu.php +++ /dev/null @@ -1,41 +0,0 @@ -Menu'; - return $html; - } - - - function toHtml() - { - return $this->_content(); - } - - - -} diff --git a/jeta/COPYING b/jeta/COPYING deleted file mode 100644 index a6b67561a..000000000 --- a/jeta/COPYING +++ /dev/null @@ -1,280 +0,0 @@ - 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. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/jeta/README b/jeta/README deleted file mode 100644 index e18c48c2b..000000000 --- a/jeta/README +++ /dev/null @@ -1,83 +0,0 @@ -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 diff --git a/jeta/config/.htaccess b/jeta/config/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/jeta/config/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/jeta/config/conf.xml b/jeta/config/conf.xml deleted file mode 100644 index 5af748dab..000000000 --- a/jeta/config/conf.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Authentication Settings - true - - - - Menu Settings - - - - - - - diff --git a/jeta/config/prefs.php.dist b/jeta/config/prefs.php.dist deleted file mode 100644 index acbd459f2..000000000 --- a/jeta/config/prefs.php.dist +++ /dev/null @@ -1,229 +0,0 @@ - _("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?") -); diff --git a/jeta/docs/CHANGES b/jeta/docs/CHANGES deleted file mode 100644 index 6b99c5f7d..000000000 --- a/jeta/docs/CHANGES +++ /dev/null @@ -1,31 +0,0 @@ --------- -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 ). -[jan] Add Spanish translation (Manuel Perez Ayala ). -[jan] Add German translation. -[max] Add support for configuring full/bare Auth name as username. -[jan] Add Finnish translation (Petteri Karttunen ). -[jan] Replace applet with SSHTerm from SSHTools (www.sshtools.com). -[jan] Add Romanian translation (Eugen Hoanca ). -[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. diff --git a/jeta/docs/CREDITS b/jeta/docs/CREDITS deleted file mode 100644 index 462aa1d96..000000000 --- a/jeta/docs/CREDITS +++ /dev/null @@ -1,27 +0,0 @@ -======================= - Jeta Development Team -======================= - - -Core Developers -=============== - -- Eric Rostetter - Original design -- Jan Schneider - Integration of SSHTools and JTA applets -- Michael Slusarz - General coding - - -Localization -============ - -===================== ====================================================== -Chinese (Traditional) Jonathan Chen -Czech Pavel Chytil . -Finnish Petteri Karttunen -German Jan Schneider -Romanian Eugen Hoanca -Spanish Manuel Perez Ayala -===================== ====================================================== diff --git a/jeta/docs/INSTALL b/jeta/docs/INSTALL deleted file mode 100644 index 78d32458f..000000000 --- a/jeta/docs/INSTALL +++ /dev/null @@ -1,232 +0,0 @@ -================= - 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 diff --git a/jeta/docs/RELEASE_NOTES b/jeta/docs/RELEASE_NOTES deleted file mode 100644 index 7d2a6e6f7..000000000 --- a/jeta/docs/RELEASE_NOTES +++ /dev/null @@ -1,43 +0,0 @@ -notes['fm']['focus'] = 1; - -/* Mailing list release notes. */ -$this->notes['ml']['changes'] = <<notes['fm']['changes'] = <<notes['name'] = 'Jeta'; -$this->notes['list'] = 'dev'; -$this->notes['fm']['project'] = 'jeta'; -$this->notes['fm']['branch'] = 'Default'; diff --git a/jeta/index.php b/jeta/index.php deleted file mode 100644 index d0e31dd5d..000000000 --- a/jeta/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ - -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'; diff --git a/jeta/jar/SSHTermApplet-jdk1.3.1-dependencies-signed.jar b/jeta/jar/SSHTermApplet-jdk1.3.1-dependencies-signed.jar deleted file mode 100644 index 1b8761595..000000000 Binary files a/jeta/jar/SSHTermApplet-jdk1.3.1-dependencies-signed.jar and /dev/null differ diff --git a/jeta/jar/SSHTermApplet-jdkbug-workaround-signed.jar b/jeta/jar/SSHTermApplet-jdkbug-workaround-signed.jar deleted file mode 100644 index 3045e077d..000000000 Binary files a/jeta/jar/SSHTermApplet-jdkbug-workaround-signed.jar and /dev/null differ diff --git a/jeta/jar/SSHTermApplet-signed.jar b/jeta/jar/SSHTermApplet-signed.jar deleted file mode 100644 index 15984291e..000000000 Binary files a/jeta/jar/SSHTermApplet-signed.jar and /dev/null differ diff --git a/jeta/jar/jta.conf b/jeta/jar/jta.conf deleted file mode 100644 index 9bb00e217..000000000 --- a/jeta/jar/jta.conf +++ /dev/null @@ -1 +0,0 @@ -SSH.user = diff --git a/jeta/jar/jta26.jar b/jeta/jar/jta26.jar deleted file mode 100755 index 7ed0d2b5a..000000000 Binary files a/jeta/jar/jta26.jar and /dev/null differ diff --git a/jeta/lib/.htaccess b/jeta/lib/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/jeta/lib/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/jeta/lib/Applet.php b/jeta/lib/Applet.php deleted file mode 100644 index 556e7a7c8..000000000 --- a/jeta/lib/Applet.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @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 .= ''; - } - return $out; - } - -} diff --git a/jeta/lib/Applet/jta.php b/jeta/lib/Applet/jta.php deleted file mode 100644 index 23b35fbcd..000000000 --- a/jeta/lib/Applet/jta.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @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 '' . - $this->_generateParamTags($params) . ''; - } - -} diff --git a/jeta/lib/Applet/sshtools.php b/jeta/lib/Applet/sshtools.php deleted file mode 100644 index b2a0cdf43..000000000 --- a/jeta/lib/Applet/sshtools.php +++ /dev/null @@ -1,92 +0,0 @@ - - * @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 '' . - $this->_generateParamTags($params) . - ''; - } - -} diff --git a/jeta/lib/Application.php b/jeta/lib/Application.php deleted file mode 100644 index 8ea158599..000000000 --- a/jeta/lib/Application.php +++ /dev/null @@ -1,59 +0,0 @@ -addArray(array( - 'class' => ((basename($_SERVER['PHP_SELF']) == 'index.php') ? 'current' : ''), - 'icon' => 'jeta.png', - 'text' => _("_Shell"), - 'url' => Horde::url('index.php') - )); - } - -} diff --git a/jeta/lib/Test.php b/jeta/lib/Test.php deleted file mode 100644 index a10ecdeca..000000000 --- a/jeta/lib/Test.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @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() - { - } - -} diff --git a/jeta/locale/.htaccess b/jeta/locale/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/jeta/locale/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/jeta/locale/cs/LC_MESSAGES/jeta.mo b/jeta/locale/cs/LC_MESSAGES/jeta.mo deleted file mode 100644 index 1f4ebaba5..000000000 Binary files a/jeta/locale/cs/LC_MESSAGES/jeta.mo and /dev/null differ diff --git a/jeta/locale/cs/LC_MESSAGES/jeta.po b/jeta/locale/cs/LC_MESSAGES/jeta.po deleted file mode 100644 index 40a0b2724..000000000 --- a/jeta/locale/cs/LC_MESSAGES/jeta.po +++ /dev/null @@ -1,18 +0,0 @@ -# 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 , 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 \n" -"Language-Team: Czech \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" diff --git a/jeta/locale/de/LC_MESSAGES/jeta.mo b/jeta/locale/de/LC_MESSAGES/jeta.mo deleted file mode 100644 index 23c3aedc2..000000000 Binary files a/jeta/locale/de/LC_MESSAGES/jeta.mo and /dev/null differ diff --git a/jeta/locale/de/LC_MESSAGES/jeta.po b/jeta/locale/de/LC_MESSAGES/jeta.po deleted file mode 100644 index 3bcb7c02f..000000000 --- a/jeta/locale/de/LC_MESSAGES/jeta.po +++ /dev/null @@ -1,177 +0,0 @@ -# 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 \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" diff --git a/jeta/locale/de/help.xml b/jeta/locale/de/help.xml deleted file mode 100644 index 83d59b026..000000000 --- a/jeta/locale/de/help.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Übersicht - Einführung - - Die SSH-Anwendung ermöglicht einen Shell-Zugang zu Ihrem Konto über ein - Java-SSH-Applet. - - - - diff --git a/jeta/locale/en/help.xml b/jeta/locale/en/help.xml deleted file mode 100644 index d6bd59a59..000000000 --- a/jeta/locale/en/help.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Overview - Introduction - - The SSH app provides a Java SSH applet that you can use to access your shell account. - - - - diff --git a/jeta/locale/es/LC_MESSAGES/jeta.mo b/jeta/locale/es/LC_MESSAGES/jeta.mo deleted file mode 100644 index 0d975a17f..000000000 Binary files a/jeta/locale/es/LC_MESSAGES/jeta.mo and /dev/null differ diff --git a/jeta/locale/es/LC_MESSAGES/jeta.po b/jeta/locale/es/LC_MESSAGES/jeta.po deleted file mode 100644 index c28d1d5a9..000000000 --- a/jeta/locale/es/LC_MESSAGES/jeta.po +++ /dev/null @@ -1,179 +0,0 @@ -# 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 \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" diff --git a/jeta/locale/es/help.xml b/jeta/locale/es/help.xml deleted file mode 100644 index 5e9ba1be1..000000000 --- a/jeta/locale/es/help.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Introducción - Introducción - La aplicación SSH proporciona un applet JAVA SSH que se puede utilizar para acceder a su cuenta de consola. - - - diff --git a/jeta/locale/fi/LC_MESSAGES/jeta.mo b/jeta/locale/fi/LC_MESSAGES/jeta.mo deleted file mode 100644 index c2e6062e2..000000000 Binary files a/jeta/locale/fi/LC_MESSAGES/jeta.mo and /dev/null differ diff --git a/jeta/locale/fi/LC_MESSAGES/jeta.po b/jeta/locale/fi/LC_MESSAGES/jeta.po deleted file mode 100644 index b12f4108f..000000000 --- a/jeta/locale/fi/LC_MESSAGES/jeta.po +++ /dev/null @@ -1,15 +0,0 @@ -# Jeta Finnish translation -# Copyright 2003 Petteri Karttunen. -# Petteri Karttunen , 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 \n" -"Language-Team: Finnish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" diff --git a/jeta/locale/jeta.pot b/jeta/locale/jeta.pot deleted file mode 100644 index 8e664734b..000000000 --- a/jeta/locale/jeta.pot +++ /dev/null @@ -1,171 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Horde Project -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , 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 \n" -"Language-Team: LANGUAGE \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 "" diff --git a/jeta/locale/ro/LC_MESSAGES/jeta.mo b/jeta/locale/ro/LC_MESSAGES/jeta.mo deleted file mode 100644 index c3cd2e303..000000000 Binary files a/jeta/locale/ro/LC_MESSAGES/jeta.mo and /dev/null differ diff --git a/jeta/locale/ro/LC_MESSAGES/jeta.po b/jeta/locale/ro/LC_MESSAGES/jeta.po deleted file mode 100644 index d0c90d9e0..000000000 --- a/jeta/locale/ro/LC_MESSAGES/jeta.po +++ /dev/null @@ -1,16 +0,0 @@ -# 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 , 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 \n" -"Language-Team: Romanian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" diff --git a/jeta/locale/zh_TW/LC_MESSAGES/jeta.mo b/jeta/locale/zh_TW/LC_MESSAGES/jeta.mo deleted file mode 100644 index 5624f44c9..000000000 Binary files a/jeta/locale/zh_TW/LC_MESSAGES/jeta.mo and /dev/null differ diff --git a/jeta/locale/zh_TW/LC_MESSAGES/jeta.po b/jeta/locale/zh_TW/LC_MESSAGES/jeta.po deleted file mode 100644 index 2e03bf462..000000000 --- a/jeta/locale/zh_TW/LC_MESSAGES/jeta.po +++ /dev/null @@ -1,16 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , 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 \n" -"Language-Team: Traditional Chinese \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" diff --git a/jeta/templates/common-header.inc b/jeta/templates/common-header.inc deleted file mode 100644 index 4ce99b381..000000000 --- a/jeta/templates/common-header.inc +++ /dev/null @@ -1,15 +0,0 @@ -getCharset()); - header('Vary: Accept-Language'); -} -?> - -' : '' ?> - -<?php echo htmlspecialchars($registry->get('name')) ?> - - - - - diff --git a/jeta/templates/main.html b/jeta/templates/main.html deleted file mode 100644 index 4daa618d7..000000000 --- a/jeta/templates/main.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -

- -

diff --git a/jeta/themes/graphics/favicon.ico b/jeta/themes/graphics/favicon.ico deleted file mode 100644 index 43e7d6f48..000000000 Binary files a/jeta/themes/graphics/favicon.ico and /dev/null differ diff --git a/jeta/themes/graphics/jeta.png b/jeta/themes/graphics/jeta.png deleted file mode 100644 index 888cb31bb..000000000 Binary files a/jeta/themes/graphics/jeta.png and /dev/null differ diff --git a/kastalia/COPYING b/kastalia/COPYING deleted file mode 100644 index 5a965fbc5..000000000 --- a/kastalia/COPYING +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/kastalia/LICENSE.ASL b/kastalia/LICENSE.ASL deleted file mode 100644 index e0b7a1365..000000000 --- a/kastalia/LICENSE.ASL +++ /dev/null @@ -1,48 +0,0 @@ -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 . diff --git a/kastalia/LICENSE.BSDL b/kastalia/LICENSE.BSDL deleted file mode 100755 index e2b4fbfed..000000000 --- a/kastalia/LICENSE.BSDL +++ /dev/null @@ -1,24 +0,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: - - - 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. diff --git a/kastalia/README b/kastalia/README deleted file mode 100644 index b2efbf72f..000000000 --- a/kastalia/README +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/kastalia/config/.htaccess b/kastalia/config/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/kastalia/config/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/kastalia/config/conf.php b/kastalia/config/conf.php deleted file mode 100644 index 4aa3b8271..000000000 --- a/kastalia/config/conf.php +++ /dev/null @@ -1,12 +0,0 @@ - - - - Kastalia Datastore Settings - - /absolute/path/to/horde/kastalia/datastore - - - lost+found - - - - Kastalia Upload Settings - - false - - - 0 - - - /absolute/path/to/horde/kastalia/temp - - - 10 - - - false - - - 0 - - - 1 - - - diff --git a/kastalia/datastore/.htaccess b/kastalia/datastore/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/kastalia/datastore/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/kastalia/decrypt_menu.php b/kastalia/decrypt_menu.php deleted file mode 100644 index ce35e03c3..000000000 --- a/kastalia/decrypt_menu.php +++ /dev/null @@ -1,104 +0,0 @@ - - */ - -//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 "
Kastalia Datastore - Decryption Password
\n"; -echo "

notice: cookies and javascripts must be enabled to download files!

\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); -} -?> - - - - - - -
- - -
- - \ No newline at end of file diff --git a/kastalia/docs/CHANGES b/kastalia/docs/CHANGES deleted file mode 100644 index fe2b86160..000000000 --- a/kastalia/docs/CHANGES +++ /dev/null @@ -1,37 +0,0 @@ ---- -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 diff --git a/kastalia/docs/CREDITS b/kastalia/docs/CREDITS deleted file mode 100644 index 545e0e984..000000000 --- a/kastalia/docs/CREDITS +++ /dev/null @@ -1,9 +0,0 @@ -=========================== - Kastalia Development Team -=========================== - - -Core Developers -=============== - -- Andre Pawlowski aka sqall \ No newline at end of file diff --git a/kastalia/docs/INSTALL b/kastalia/docs/INSTALL deleted file mode 100644 index 1eecfa9e2..000000000 --- a/kastalia/docs/INSTALL +++ /dev/null @@ -1,177 +0,0 @@ -========================= - 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 diff --git a/kastalia/docs/RELEASE_NOTES b/kastalia/docs/RELEASE_NOTES deleted file mode 100755 index b2f3c91c0..000000000 --- a/kastalia/docs/RELEASE_NOTES +++ /dev/null @@ -1,14 +0,0 @@ - - */ - -//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 -//################### ################### -// 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); -} -//################### ################### - -//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); - } -} -?> diff --git a/kastalia/encrypt_decrypt_files.php b/kastalia/encrypt_decrypt_files.php deleted file mode 100644 index f689e5edb..000000000 --- a/kastalia/encrypt_decrypt_files.php +++ /dev/null @@ -1,383 +0,0 @@ - - */ - -//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 "
Kastalia Datastore - Encryption/Decryption
\n"; -echo "
\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!
\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...
\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!
\n"; - echo "This constitutes a breach of security because the content of the uploaded file stored unencrypted.
\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 - - //##################### ##################### - //Header Manipulation zum aufrufen der naechsten Verschluesselungsrunde - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - echo "encrypting part " . ($kastalia_part_number + 1) . " of " . $max_parts . "
"; - echo "please wait...
"; - echo "

\n"; - echo "\n"; - //##################### ##################### - - } - 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
\n"; - } - echo "Encryption done...
\n"; - echo "File successfully stored under " . substr($output_name, strlen($conf['datastore']['location'] . "/")) . " !\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!
\n"; - echo "This constitutes a breach of security because the content of the uploaded file still stored unencrypted.
\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 - - //##################### ##################### - //Header Manipulation zum aufrufen der naechsten Entschluesselungsrunde - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - echo "decrypting part " . ($kastalia_part_number + 1) . " of " . $max_parts . "
"; - echo "please wait...
"; - echo "

\n"; - echo "\n"; - //##################### ##################### - - } - 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); - - //##################### ##################### - //Header Manipulation zum aufrufen des Downloadskriptes - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - echo "starting download
"; - echo "please wait...
"; - echo "

\n"; - echo "\n"; - //##################### ##################### - - } - 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!
"; - //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...
\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!
\n"; - echo "This constitutes a breach of security because the content of the uploaded file stored unencrypted.
\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!
\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']); -} -?> - - \ No newline at end of file diff --git a/kastalia/index.php b/kastalia/index.php deleted file mode 100755 index 4f6f4dc10..000000000 --- a/kastalia/index.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - -require dirname(__FILE__) . '/list.php'; -require KASTALIA_BASE . '/main.php'; diff --git a/kastalia/lib/Application.php b/kastalia/lib/Application.php deleted file mode 100644 index d994c425c..000000000 --- a/kastalia/lib/Application.php +++ /dev/null @@ -1,16 +0,0 @@ - - * @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') - ) - ); - } - -} diff --git a/kastalia/lib/Kastalia.php b/kastalia/lib/Kastalia.php deleted file mode 100644 index a57799e51..000000000 --- a/kastalia/lib/Kastalia.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @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; - } -} diff --git a/kastalia/lib/base.php b/kastalia/lib/base.php deleted file mode 100644 index 104833be7..000000000 --- a/kastalia/lib/base.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ - -// 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(); diff --git a/kastalia/list.php b/kastalia/list.php deleted file mode 100755 index 1c4f40a5a..000000000 --- a/kastalia/list.php +++ /dev/null @@ -1,18 +0,0 @@ - - */ - -@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'; diff --git a/kastalia/locale/.htaccess b/kastalia/locale/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/kastalia/locale/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/kastalia/locale/de/help.xml b/kastalia/locale/de/help.xml deleted file mode 100644 index b7c3b41f1..000000000 --- a/kastalia/locale/de/help.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Übersicht - Was ist Kastalia? - - 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. - - - - diff --git a/kastalia/locale/en/help.xml b/kastalia/locale/en/help.xml deleted file mode 100755 index 8c7b613a4..000000000 --- a/kastalia/locale/en/help.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Kastalia Overview - - What is Kastalia? - 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. - - - diff --git a/kastalia/locale/kastalia.pot b/kastalia/locale/kastalia.pot deleted file mode 100644 index ad0260500..000000000 --- a/kastalia/locale/kastalia.pot +++ /dev/null @@ -1,29 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Horde Project -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , 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 \n" -"Language-Team: LANGUAGE \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 "" diff --git a/kastalia/main.php b/kastalia/main.php deleted file mode 100755 index 8f8c3952b..000000000 --- a/kastalia/main.php +++ /dev/null @@ -1,236 +0,0 @@ - - */ - -//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); -} - -?> - - - -
Kastalia Datastore - Download
-

notice: cookies and javascripts must be enabled to download files!

- -\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 "
  • \n"; - echo "\n"; - echo "\"directory\n"; - echo $directory_element; - echo "\n\n"; - echo "
  • \n"; - echo "
  • \n"; - echo "
    \n"; - //der Ordner wird nun mit einem erneuten aufrufen der Funktion ausgelesen und der Inhalt bearbeitet - ScanDirectory($dir_name . '/' . $directory_element); - echo "
    \n"; - echo "
  • \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 "
  • \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 "\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 "\n"; - echo "
  • \n"; - } - //falls es sich nicht um eine von Kastalia verschluesselte Datei handelt - else { //PRINT UNENCRYPTED FILE DOWNLOAD - echo "
  • \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 "\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 "\n"; - echo "
  • \n"; - } - } - echo "\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!
    \n"; - echo "This constitutes a breach of security because the content of the uploaded file stored unencrypted.
    \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 . "!
    "; - echo "This constitutes a breach of security because the uploaded file will not be deleted and the content stored unencrypted.
    \n"; - echo "Please contact the administrator to have the file deleted.\n"; - } - } - } - } - else { - echo "Error: Can't open directory \"$dir_name\"!"; - } -} -?> - - \ No newline at end of file diff --git a/kastalia/temp/.htaccess b/kastalia/temp/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/kastalia/temp/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/kastalia/templates/common-footer.inc b/kastalia/templates/common-footer.inc deleted file mode 100644 index 108cecf8c..000000000 --- a/kastalia/templates/common-footer.inc +++ /dev/null @@ -1,3 +0,0 @@ -notify(array('listeners' => array('audio'))); ?> - - diff --git a/kastalia/templates/common-header.inc b/kastalia/templates/common-header.inc deleted file mode 100755 index 4f3571c73..000000000 --- a/kastalia/templates/common-header.inc +++ /dev/null @@ -1,32 +0,0 @@ -getCharset()); - header('Vary: Accept-Language'); -} -?> - - - - -' : '' ?> - - - - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - - - diff --git a/kastalia/templates/menu.inc b/kastalia/templates/menu.inc deleted file mode 100755 index d96bb7137..000000000 --- a/kastalia/templates/menu.inc +++ /dev/null @@ -1,5 +0,0 @@ - - -notify(array('listeners' => 'status')) ?> diff --git a/kastalia/themes/graphics/directory_closed.gif b/kastalia/themes/graphics/directory_closed.gif deleted file mode 100755 index c4f1138bf..000000000 Binary files a/kastalia/themes/graphics/directory_closed.gif and /dev/null differ diff --git a/kastalia/themes/graphics/directory_open.gif b/kastalia/themes/graphics/directory_open.gif deleted file mode 100644 index 09755aafc..000000000 Binary files a/kastalia/themes/graphics/directory_open.gif and /dev/null differ diff --git a/kastalia/themes/graphics/file.gif b/kastalia/themes/graphics/file.gif deleted file mode 100644 index b430f1e6e..000000000 Binary files a/kastalia/themes/graphics/file.gif and /dev/null differ diff --git a/kastalia/themes/graphics/file_enc.gif b/kastalia/themes/graphics/file_enc.gif deleted file mode 100644 index 8bd8bac3d..000000000 Binary files a/kastalia/themes/graphics/file_enc.gif and /dev/null differ diff --git a/kastalia/themes/graphics/kastalia.png b/kastalia/themes/graphics/kastalia.png deleted file mode 100644 index 6f44752eb..000000000 Binary files a/kastalia/themes/graphics/kastalia.png and /dev/null differ diff --git a/kastalia/themes/graphics/loader.gif b/kastalia/themes/graphics/loader.gif deleted file mode 100644 index a77150e8e..000000000 Binary files a/kastalia/themes/graphics/loader.gif and /dev/null differ diff --git a/kastalia/themes/graphics/menu/upload.png b/kastalia/themes/graphics/menu/upload.png deleted file mode 100644 index 780a740c0..000000000 Binary files a/kastalia/themes/graphics/menu/upload.png and /dev/null differ diff --git a/kastalia/themes/screen.css b/kastalia/themes/screen.css deleted file mode 100755 index a219ca1bb..000000000 --- a/kastalia/themes/screen.css +++ /dev/null @@ -1,44 +0,0 @@ -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 diff --git a/kastalia/upload.php b/kastalia/upload.php deleted file mode 100644 index e82ecbc1e..000000000 --- a/kastalia/upload.php +++ /dev/null @@ -1,207 +0,0 @@ - - */ - -//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 "
    Kastalia Datastore - Upload
    \n"; -echo "
    \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 " . substr($upload_target, strlen($conf['datastore']['location'] . "/")) . " !\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!

    "; - echo "Possible reasons:
    "; - echo "-upload_max_filesize, post_max_size or memory_limit value is too low in php.ini.
    "; - echo "-file_uploads is set to Off in php.ini."; - exit(1); - } -} -?> - - \ No newline at end of file diff --git a/kastalia/upload_menu.php b/kastalia/upload_menu.php deleted file mode 100644 index 3e07018ed..000000000 --- a/kastalia/upload_menu.php +++ /dev/null @@ -1,258 +0,0 @@ - - */ - -//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 "
    Kastalia Datastore - Upload
    \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 "
    "; - echo "File uploads are disabled!"; - exit(0); -} -?> - - - - - - - -

    notice: cookies and javascripts must be enabled to upload files! | maximal upload size: - - - -

    - - - - - - - -
    -
    -choose file: - - -
    - -encrypt file?:\n"; - echo "\n"; - //dieser Teil wird nur angezeigt, wenn die checkbox zum - //verschluesselten speichern der Daten aktiviert ist - echo "
    \n"; - echo "
    password:\n"; - echo "\n"; - echo "\n"; - echo "
    suggested password:\n"; - echo "\n"; - echo "
    \n"; - } - //falls das temporaere Verzeichnis nicht beschreibbar ist, wird eine Warnmeldung ausgegeben - //und die Option Daten verschluesselt zu speichern wird ausgeblendet - else { - echo "
    Warning: The option to store files encrypted is enabled by the administrator but still deactivated by Kastalia itself!
    \n"; - echo "Check if the temporary directory exists and is writable.\n"; - } -} -?> - -
    -
    -

    choose folder:

    - -
    -
    - - -"; - echo substr($directory_element, strlen($conf['datastore']['location'])); - echo ""; - } - //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; -} -?> - - \ No newline at end of file diff --git a/news/add.php b/news/add.php deleted file mode 100644 index 8f39d818c..000000000 --- a/news/add.php +++ /dev/null @@ -1,605 +0,0 @@ - - * @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'; diff --git a/news/admin/categories/delete.php b/news/admin/categories/delete.php deleted file mode 100644 index 71bd03606..000000000 --- a/news/admin/categories/delete.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * 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'; diff --git a/news/admin/categories/edit.php b/news/admin/categories/edit.php deleted file mode 100644 index f754326a1..000000000 --- a/news/admin/categories/edit.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * 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'; diff --git a/news/admin/categories/index.php b/news/admin/categories/index.php deleted file mode 100644 index 3faacff44..000000000 --- a/news/admin/categories/index.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * 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 . ''; - $categories[$category_id]['actions'][] = Horde::link(Horde_Util::addParameter($edit_url, 'category_id', $category_id), _("Edit")) . - $edit_img . ''; -} - -$view = new News_View(); -$view->categories = $categories; -$view->add_url = Horde::link($edit_url, _("Add New")) . _("Add New") . ''; - -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'; diff --git a/news/admin/sources/delete.php b/news/admin/sources/delete.php deleted file mode 100644 index a7a6d3b8e..000000000 --- a/news/admin/sources/delete.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * 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'; diff --git a/news/admin/sources/edit.php b/news/admin/sources/edit.php deleted file mode 100644 index 40070a01c..000000000 --- a/news/admin/sources/edit.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * 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'; diff --git a/news/admin/sources/index.php b/news/admin/sources/index.php deleted file mode 100644 index 11ff22395..000000000 --- a/news/admin/sources/index.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * 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 . ''; - $sources[$source_id]['actions'][] = Horde::link(Horde_Util::addParameter($delete_url, 'source_id', $source_id), _("Delete")) . - $delete_img . ''; - $sources[$source_id]['actions'][] = Horde::link(Horde_Util::addParameter($edit_url, 'source_id', $source_id), _("Edit")) . - $edit_img . ''; -} - -$view = new News_View(); -$view->sources = $sources; -$view->add_url = Horde::link($edit_url, _("Add New")) . _("Add New") . ''; - -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'; diff --git a/news/admin/tabs.php b/news/admin/tabs.php deleted file mode 100644 index 6e0f6a691..000000000 --- a/news/admin/tabs.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ - -/* 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'); diff --git a/news/browse.php b/news/browse.php deleted file mode 100644 index c634762a4..000000000 --- a/news/browse.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @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'; diff --git a/news/cloud.php b/news/cloud.php deleted file mode 100644 index 637062dfd..000000000 --- a/news/cloud.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @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'; diff --git a/news/config/conf.xml b/news/config/conf.xml deleted file mode 100644 index 5736deb54..000000000 --- a/news/config/conf.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - These are the settings for storing all the News data, such as categories, - items within those categories, item options, etc. - - sql - - - - - horde_datatree - horde_datatree_attributes - - - - - - - - - - - Settings for displaying - 130 - - - - Enable optional news attributes - TRUE - TRUE - false - true - - - - - - - - - Images settings - true - horde - - horde_vfs - - - /schedul-images - png - - jpeg - png - - - 150 - 150 - 300 - 300 - - - - Comments - authenticated - - authenticated - never - all - - - - - - - - - - Trackback Settings - 1 - 30 - 30 - - - Wordlist - Regex - DNSBL - SURBL - - - - - - - - Menu Settings - - - - - - - - - - - diff --git a/news/config/prefs.php.dist b/news/config/prefs.php.dist deleted file mode 100644 index 8afaa03f7..000000000 --- a/news/config/prefs.php.dist +++ /dev/null @@ -1,51 +0,0 @@ - _("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' -); - diff --git a/news/content.php b/news/content.php deleted file mode 100644 index 6e4b34b3f..000000000 --- a/news/content.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @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 '
     
    '; -echo $layout_html; -require $registry->get('templates', 'horde') . '/common-footer.inc'; \ No newline at end of file diff --git a/news/content_edit.php b/news/content_edit.php deleted file mode 100644 index a1a8f6773..000000000 --- a/news/content_edit.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @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'; diff --git a/news/delete.php b/news/delete.php deleted file mode 100644 index de1013536..000000000 --- a/news/delete.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @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'; diff --git a/news/delete_file.php b/news/delete_file.php deleted file mode 100644 index 0ec4fe15f..000000000 --- a/news/delete_file.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @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'; diff --git a/news/diff.php b/news/diff.php deleted file mode 100644 index 4930ee0f4..000000000 --- a/news/diff.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @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 '
    ' . $nls['languages'][$k] . '
    ' . "\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."); - } -} diff --git a/news/edit.php b/news/edit.php deleted file mode 100644 index aab432bb0..000000000 --- a/news/edit.php +++ /dev/null @@ -1,205 +0,0 @@ - - * @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'; diff --git a/news/feed.php b/news/feed.php deleted file mode 100644 index 090cb310e..000000000 --- a/news/feed.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @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']) - . ' ' - . $story['story_title'] . '
    '; -} diff --git a/news/files.php b/news/files.php deleted file mode 100644 index 749e00aea..000000000 --- a/news/files.php +++ /dev/null @@ -1,125 +0,0 @@ - - * @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 '

    HTTP/1.0 404 Not Found

    '; - } - 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 '

    HTTP/1.0 404 Not Found

    '; - } - 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 '

    HTTP/1.0 404 Not Found

    '; - } - 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; -} - diff --git a/news/index.php b/news/index.php deleted file mode 100644 index 8fce8e83b..000000000 --- a/news/index.php +++ /dev/null @@ -1,14 +0,0 @@ - - * @package News - */ - -require NEWS_BASE . '/content.php'; diff --git a/news/js/feed.js b/news/js/feed.js deleted file mode 100644 index 1590ae4bf..000000000 --- a/news/js/feed.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 - }); -} diff --git a/news/lib/Api.php b/news/lib/Api.php deleted file mode 100644 index 20cc271a9..000000000 --- a/news/lib/Api.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @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 = '' . $news['title'] . ''; - $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); - } - -} diff --git a/news/lib/Application.php b/news/lib/Application.php deleted file mode 100644 index 82aa02ff7..000000000 --- a/news/lib/Application.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @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(); - } - -} diff --git a/news/lib/Block/categories.php b/news/lib/Block/categories.php deleted file mode 100755 index 8420ff715..000000000 --- a/news/lib/Block/categories.php +++ /dev/null @@ -1,34 +0,0 @@ -getHtml(); - } -} \ No newline at end of file diff --git a/news/lib/Block/category.php b/news/lib/Block/category.php deleted file mode 100755 index 308261511..000000000 --- a/news/lib/Block/category.php +++ /dev/null @@ -1,65 +0,0 @@ -_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) . ''; - - 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'); - } -} diff --git a/news/lib/Block/jonah.php b/news/lib/Block/jonah.php deleted file mode 100755 index 6431993cd..000000000 --- a/news/lib/Block/jonah.php +++ /dev/null @@ -1,58 +0,0 @@ -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") . ''; - } - - /** - * The content to go in this block. - * - * @return string The content - */ - function _content() - { - $html = '
    '; - $html .= _("Select a feed."); - $html .= '
    '; - - 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 .= '
    ' - . '
    '; - - Horde::addScriptFile('effects.js', 'horde'); - Horde::addScriptFile('redbox.js', 'horde'); - Horde::addScriptFile('feed.js', 'news'); - - return $html; - } -} diff --git a/news/lib/Block/last.php b/news/lib/Block/last.php deleted file mode 100755 index 36b0c95a8..000000000 --- a/news/lib/Block/last.php +++ /dev/null @@ -1,62 +0,0 @@ -'; - } - - 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'); - } -} diff --git a/news/lib/Block/last_blogs.php b/news/lib/Block/last_blogs.php deleted file mode 100755 index 360e53cda..000000000 --- a/news/lib/Block/last_blogs.php +++ /dev/null @@ -1,48 +0,0 @@ - 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'); - } -} diff --git a/news/lib/Block/last_comments.php b/news/lib/Block/last_comments.php deleted file mode 100755 index df6879a53..000000000 --- a/news/lib/Block/last_comments.php +++ /dev/null @@ -1,56 +0,0 @@ - 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'] . ' ' - . ' (' . $message['message_author'] . ')
    '; - } - return $html; - } -} \ No newline at end of file diff --git a/news/lib/Block/most_commented.php b/news/lib/Block/most_commented.php deleted file mode 100755 index e683c95ec..000000000 --- a/news/lib/Block/most_commented.php +++ /dev/null @@ -1,55 +0,0 @@ - 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'); - } -} diff --git a/news/lib/Block/most_read.php b/news/lib/Block/most_read.php deleted file mode 100755 index a64508599..000000000 --- a/news/lib/Block/most_read.php +++ /dev/null @@ -1,55 +0,0 @@ - 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'); - } -} diff --git a/news/lib/Block/my_comments.php b/news/lib/Block/my_comments.php deleted file mode 100644 index 61ae08c2c..000000000 --- a/news/lib/Block/my_comments.php +++ /dev/null @@ -1,76 +0,0 @@ - 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 = '' - . '' - . ''; - - 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 .= ''; - } - $html .= '
    ' . _("Title") . '' . _("User") . '
    ' - . '' - . $message['message_subject'] . ' ' - . '' - . $message['message_author'] . '
    '; - - $GLOBALS['cache']->set($cache_key, $html); - return $html; - } -} diff --git a/news/lib/Block/sources.php b/news/lib/Block/sources.php deleted file mode 100755 index bb0197c22..000000000 --- a/news/lib/Block/sources.php +++ /dev/null @@ -1,44 +0,0 @@ -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 . '
    '; - } - - return $html; - } -} diff --git a/news/lib/Block/tags_cloud.php b/news/lib/Block/tags_cloud.php deleted file mode 100644 index 9197897bb..000000000 --- a/news/lib/Block/tags_cloud.php +++ /dev/null @@ -1,38 +0,0 @@ -getCloud(true); - } -} \ No newline at end of file diff --git a/news/lib/Categories.php b/news/lib/Categories.php deleted file mode 100644 index 5defc52fe..000000000 --- a/news/lib/Categories.php +++ /dev/null @@ -1,615 +0,0 @@ - - * @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 = ''; - - 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 .= ''; - } - $url = $this->_view_url . $node_id; - $output .= Horde::link($url) . $this->_nodes[$node_id]['category_name'] . ', '; - if ($this->_nodes[$node_id]['indent'] == 0) { - $output .= '
    '; - } - - 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'] . ''; - } 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 . ''; - } - - $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; - } -} diff --git a/news/lib/Driver.php b/news/lib/Driver.php deleted file mode 100644 index bd27be06e..000000000 --- a/news/lib/Driver.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @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; - } -} diff --git a/news/lib/Driver/sql.php b/news/lib/Driver/sql.php deleted file mode 100644 index bf8f8ec71..000000000 --- a/news/lib/Driver/sql.php +++ /dev/null @@ -1,583 +0,0 @@ - - * @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; - } - -} diff --git a/news/lib/Forms/Search.php b/news/lib/Forms/Search.php deleted file mode 100644 index 97cb035a6..000000000 --- a/news/lib/Forms/Search.php +++ /dev/null @@ -1,133 +0,0 @@ - - * @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()]); - } - - } - } - -} diff --git a/news/lib/News.php b/news/lib/News.php deleted file mode 100644 index 2eceb0378..000000000 --- a/news/lib/News.php +++ /dev/null @@ -1,469 +0,0 @@ - - * @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 = '
    '; - $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 . ' ' . "\n"; - $html .= _("Attached files: ") . '' . "\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 . ' ' . "\n"; - $html .= Horde::link(Horde_Util::addParameter($view_url, 'actionID', 'download_file'), sprintf(_("Dowload %s"), $file['file_name'])) . $dowload_img . ' ' . "\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 . ' ' . "\n"; - } - $html .= $file['file_name'] . ' ' . "\n"; - $html .= ' (' . self::format_filesize($file['file_size']) . ')'; - $html .= '
    ' . "\n"; - } - - $html .= '
    '; - - 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; - } - -} diff --git a/news/lib/Search.php b/news/lib/Search.php deleted file mode 100644 index 2d4e76131..000000000 --- a/news/lib/Search.php +++ /dev/null @@ -1,135 +0,0 @@ - - * @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()]); - } - - } - } - -} diff --git a/news/lib/TagCloud.php b/news/lib/TagCloud.php deleted file mode 100644 index 2bb165211..000000000 --- a/news/lib/TagCloud.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @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("%s\n", - $type, - $tag['url'], - htmlspecialchars($tag['name'])); - } - - /** - * wrap div tag - * - * @return string - * @param string $html - */ - protected function _wrapDiv($html) - { - return $html; - } - -} diff --git a/news/lib/View.php b/news/lib/View.php deleted file mode 100644 index 835cfecb7..000000000 --- a/news/lib/View.php +++ /dev/null @@ -1,74 +0,0 @@ - - * @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 .= '' . $tag . ' '; - } - - return $html; - } -} diff --git a/news/lib/base.php b/news/lib/base.php deleted file mode 100644 index 2d4ff8c60..000000000 --- a/news/lib/base.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @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(); -} diff --git a/news/locale/.htaccess b/news/locale/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/news/locale/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/news/locale/news.pot b/news/locale/news.pot deleted file mode 100644 index 36074a879..000000000 --- a/news/locale/news.pot +++ /dev/null @@ -1,958 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Horde Project -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , 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 \n" -"Language-Team: LANGUAGE \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 "" diff --git a/news/locale/sl/LC_MESSAGES/news.mo b/news/locale/sl/LC_MESSAGES/news.mo deleted file mode 100755 index dcfbe4ba2..000000000 Binary files a/news/locale/sl/LC_MESSAGES/news.mo and /dev/null differ diff --git a/news/locale/sl/LC_MESSAGES/news.po b/news/locale/sl/LC_MESSAGES/news.po deleted file mode 100644 index bbc4d1c64..000000000 --- a/news/locale/sl/LC_MESSAGES/news.po +++ /dev/null @@ -1,949 +0,0 @@ -# translation of sl_SI.po to Slovene -# Marko Milost , 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 \n" -"Language-Team: Slovene \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" diff --git a/news/mail.php b/news/mail.php deleted file mode 100644 index b6dac1c11..000000000 --- a/news/mail.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @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(); diff --git a/news/news.php b/news/news.php deleted file mode 100644 index f239a1495..000000000 --- a/news/news.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @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'; diff --git a/news/note.php b/news/note.php deleted file mode 100644 index dce3e2c40..000000000 --- a/news/note.php +++ /dev/null @@ -1,43 +0,0 @@ - - * @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(); -} diff --git a/news/pdf.php b/news/pdf.php deleted file mode 100644 index 21e7cfb8f..000000000 --- a/news/pdf.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @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(); diff --git a/news/po/messages.mo b/news/po/messages.mo deleted file mode 100644 index e54f6c97a..000000000 Binary files a/news/po/messages.mo and /dev/null differ diff --git a/news/print.php b/news/print.php deleted file mode 100644 index 49f1b6f39..000000000 --- a/news/print.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @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'; diff --git a/news/reads.php b/news/reads.php deleted file mode 100644 index 1d89dec57..000000000 --- a/news/reads.php +++ /dev/null @@ -1,49 +0,0 @@ - - * @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'; diff --git a/news/rss/comments.php b/news/rss/comments.php deleted file mode 100644 index ce1103873..000000000 --- a/news/rss/comments.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ - -$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 = 'getCharset() . '" ?> - - - ' . htmlspecialchars($title) . ' - ' . str_replace('_', '-', strtolower($registry->preferredLang())) . ' - ' . date('r') . ' - ' . htmlspecialchars($title) . ' - ' . Horde::url('index.php', true, -1) . ' - ' . htmlspecialchars($registry->get('name')) . ''; - - foreach ($list as $comment) { - $rss .= ' - - ' . htmlspecialchars($comment['message_subject']) . ' - ' . $comment['read_url'] . ' - ' . $comment['read_url'] . ' - ' . date('r', strtotime($comment['message_date'])) . ' - - '; - } - - $rss .= ' - -'; - - $cache->set($cache_key, $rss); -} - -header('Content-type: text/xml; charset=' . $GLOBALS['registry']->getCharset()); -echo $rss; diff --git a/news/rss/index.php b/news/rss/index.php deleted file mode 100644 index 3393c5daf..000000000 --- a/news/rss/index.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ - -$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 = 'getCharset() . '" ?> - - - ' . htmlspecialchars($title) . ' - ' . str_replace('_', '-', strtolower($registry->preferredLang())) . ' - ' . date('r') . ' - ' . htmlspecialchars($title) . ' - ' . Horde::url('index.php', true, -1) . ' - ' . htmlspecialchars($registry->get('name')) . ''; - - $rss .= ' - - ' . _("Last news") . ' - ' . Horde::url('rss/news.php', true, -1) . ' - '; - - $rss .= ' - - ' . _("Last comments") . ' - ' . Horde::url('rss/comments.php', true, -1) . ' - '; - - $rss .= ' - - '; - - $cache->set($cache_key, $rss); -} - -header('Content-type: text/xml'); -echo $rss; diff --git a/news/rss/news.php b/news/rss/news.php deleted file mode 100755 index 44577ca67..000000000 --- a/news/rss/news.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @author McLion - */ - -$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 .= ' - - - ' . htmlspecialchars($news['title']) . ' - ' . htmlspecialchars($news['user']). ' - ' . $news_link . ' - ' . $news_link . ' - ' . $news_link . '#comments - - ' . date('r', strtotime($news['publish'])) . ' - - '; - - if (strtotime($news['publish']) > $lastnewstime) { - $lastnewstime = strtotime($news['publish']); - } - } - - // Wee need the last published news time - $rssheader = 'getCharset() . '" ?> - - - ' . htmlspecialchars($title) . ' - ' . str_replace('_', '-', strtolower($registry->preferredLang())) . ' - ' . date('r', $lastnewstime) . ' - ' . htmlspecialchars($title) . ' - ' . Horde::url('index.php', true, -1) . ' - ' . htmlspecialchars($registry->get('name')) . ''; - - $rssfooter = ' - -'; - - // build rss - $rss = $rssheader . $rssbody . $rssfooter; - - $cache->set($cache_key, $rss); -} - -header('Content-type: text/xml; charset=utf-8'); -echo $rss; diff --git a/news/scripts/sql/news.mysql.sql b/news/scripts/sql/news.mysql.sql deleted file mode 100644 index 261cf70a1..000000000 --- a/news/scripts/sql/news.mysql.sql +++ /dev/null @@ -1,107 +0,0 @@ -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) -); diff --git a/news/scripts/upgrades/20070302_trackback.sql b/news/scripts/upgrades/20070302_trackback.sql deleted file mode 100644 index 3769f3ea0..000000000 --- a/news/scripts/upgrades/20070302_trackback.sql +++ /dev/null @@ -1,13 +0,0 @@ -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`) -); diff --git a/news/scripts/upgrades/20070609_sponsored.sql b/news/scripts/upgrades/20070609_sponsored.sql deleted file mode 100644 index e86f428ca..000000000 --- a/news/scripts/upgrades/20070609_sponsored.sql +++ /dev/null @@ -1,2 +0,0 @@ -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 diff --git a/news/scripts/upgrades/20071220_tags.sql b/news/scripts/upgrades/20071220_tags.sql deleted file mode 100644 index 5dc905e11..000000000 --- a/news/scripts/upgrades/20071220_tags.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `news_body` ADD `tags` VARCHAR( 255 ) AFTER `picture_comment` ; \ No newline at end of file diff --git a/news/search.php b/news/search.php deleted file mode 100644 index 01c6b6b3b..000000000 --- a/news/search.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @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'; diff --git a/news/tags.php b/news/tags.php deleted file mode 100644 index 55ddfe3dd..000000000 --- a/news/tags.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * 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 - * @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 . '
    '; - $params = array($tags, $row['id']); - $news->db->query('UPDATE news_body SET tags = ? WHERE id = ?', $params); -} - -echo 'done'; diff --git a/news/templates/add/before.inc b/news/templates/add/before.inc deleted file mode 100755 index e69de29bb..000000000 diff --git a/news/templates/block/news.php b/news/templates/block/news.php deleted file mode 100644 index 1fab9dd9f..000000000 --- a/news/templates/block/news.php +++ /dev/null @@ -1,19 +0,0 @@ -news)): ?> - -news as $news_id => $news) { ?> -

    -' . $news['title'] . ' - ' . $news['abbreviation'] . '... (' . $news['comments'] . ')
    '; -?> -

    - - - - - -

    - \ No newline at end of file diff --git a/news/templates/block/titles.php b/news/templates/block/titles.php deleted file mode 100644 index 504b1d54a..000000000 --- a/news/templates/block/titles.php +++ /dev/null @@ -1,21 +0,0 @@ -news)): ?> - - - -news as $news_id => $news) { ?> - - - - - -
    -getValue('date_format'), strtotime($news['publish'])) . ' - '; -echo Horde::link(News::getUrlFor('news', $news['id']), $news['abbreviation']); -echo $news['title'] . ''; -?> -
    - - -

    - diff --git a/news/templates/browse/footer.inc b/news/templates/browse/footer.inc deleted file mode 100755 index 10cc5e347..000000000 --- a/news/templates/browse/footer.inc +++ /dev/null @@ -1 +0,0 @@ -render(); ?> diff --git a/news/templates/browse/header.inc b/news/templates/browse/header.inc deleted file mode 100755 index 21ac9eedd..000000000 --- a/news/templates/browse/header.inc +++ /dev/null @@ -1,3 +0,0 @@ -
    ()
    -render(); ?> - diff --git a/news/templates/browse/row.inc b/news/templates/browse/row.inc deleted file mode 100755 index 994cbc926..000000000 --- a/news/templates/browse/row.inc +++ /dev/null @@ -1,12 +0,0 @@ -

    - - -'; ?> - - -
    - ...
    - - - - -

    \ No newline at end of file diff --git a/news/templates/categories/delete.html b/news/templates/categories/delete.html deleted file mode 100755 index 7adede239..000000000 --- a/news/templates/categories/delete.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -
    -
    Categories
    - -
    - - \ No newline at end of file diff --git a/news/templates/categories/edit.html b/news/templates/categories/edit.html deleted file mode 100755 index 7adede239..000000000 --- a/news/templates/categories/edit.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -
    -
    Categories
    - -
    - - \ No newline at end of file diff --git a/news/templates/categories/index.html b/news/templates/categories/index.html deleted file mode 100755 index c314ca778..000000000 --- a/news/templates/categories/index.html +++ /dev/null @@ -1,5 +0,0 @@ - - - -
    Categories
    - diff --git a/news/templates/categories/index.php b/news/templates/categories/index.php deleted file mode 100644 index 9dcfe5714..000000000 --- a/news/templates/categories/index.php +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - -categories as $category_id => $category) { ?> - - - - - - - - - -
    add_url ?>
    -categories[$category['category_parentid']]['category_name'] . - ' - ' . $category['category_parentid']; -} -?>
    \ No newline at end of file diff --git a/news/templates/common-header.inc b/news/templates/common-header.inc deleted file mode 100644 index e8b17bcf6..000000000 --- a/news/templates/common-header.inc +++ /dev/null @@ -1,31 +0,0 @@ -getCharset()); - header('Vary: Accept-Language'); -} -?> - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - -" href="" type="application/rss+xml" /> -" href="" type="application/rss+xml" /> - - - - diff --git a/news/templates/edit/footer.inc b/news/templates/edit/footer.inc deleted file mode 100755 index 0582a5d8f..000000000 --- a/news/templates/edit/footer.inc +++ /dev/null @@ -1,4 +0,0 @@ - -render(); ?> - -
    diff --git a/news/templates/edit/header.inc b/news/templates/edit/header.inc deleted file mode 100755 index 1e8daf490..000000000 --- a/news/templates/edit/header.inc +++ /dev/null @@ -1,17 +0,0 @@ -
    - - - - - - - - - -' . _("Comments") . ''; -} -?> - - \ No newline at end of file diff --git a/news/templates/edit/info.php b/news/templates/edit/info.php deleted file mode 100644 index bf989d34f..000000000 --- a/news/templates/edit/info.php +++ /dev/null @@ -1,124 +0,0 @@ - - - diff --git a/news/templates/edit/row.php b/news/templates/edit/row.php deleted file mode 100644 index 2e0173fd9..000000000 --- a/news/templates/edit/row.php +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - -' . $row['comments'] . ''; -} -?> - diff --git a/news/templates/menu.inc b/news/templates/menu.inc deleted file mode 100644 index 3b6beca52..000000000 --- a/news/templates/menu.inc +++ /dev/null @@ -1,14 +0,0 @@ - - -notify(array('listeners' => 'status')) ?> diff --git a/news/templates/news/attachments.php b/news/templates/news/attachments.php deleted file mode 100644 index 5d04153a1..000000000 --- a/news/templates/news/attachments.php +++ /dev/null @@ -1,5 +0,0 @@ -
    ' . News::format_attached($id); -} diff --git a/news/templates/news/blog.php b/news/templates/news/blog.php deleted file mode 100644 index 89a8765ed..000000000 --- a/news/templates/news/blog.php +++ /dev/null @@ -1,39 +0,0 @@ -
    -' . _("Blogs") . ''; - -// Blogs -if (!empty($row['trackback'])) { - echo _("Talkbacks to this article:") . '
      '; - foreach ($row['trackback'] as $trackback) { - echo '
    • ' . Horde::link($trackback['url'], $trackback['excerpt']) . $trackback['title'] . ' ' - . _("From: ") . $trackback['blog_name'] . ' @ ' . News::dateFormat($trackback['created']) . '
    • '; - } - echo '

    '; -} - -$trackback_url = Horde_Util::addParameter(Horde::url('trackback.php', true), 'id', $id); -echo _("Use the following link to trackback from your own site: ") . - '

    '; - -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) . '' . _("Trackback this blog on this site.") . '
    '; -} - -$read_url = News::getUrlFor('news', $id); -?> - - diff --git a/news/templates/news/comments.php b/news/templates/news/comments.php deleted file mode 100644 index a200954fa..000000000 --- a/news/templates/news/comments.php +++ /dev/null @@ -1,21 +0,0 @@ -
    --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']; - } -} - diff --git a/news/templates/news/gallery.php b/news/templates/news/gallery.php deleted file mode 100644 index 5f9e37085..000000000 --- a/news/templates/news/gallery.php +++ /dev/null @@ -1,19 +0,0 @@ -get('webroot', 'horde') . '/vfs/.horde/ansel/'; - -echo '
    '; -foreach ($images as $image_id => $image) { - $img_url = substr($image_id, -2) . '/%s/' . $image_id . '.jpg'; - echo "\n" . '
    ' . - 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" . - '' . - $image['caption']. '
    '; -} -echo '
    '; - diff --git a/news/templates/news/info.php b/news/templates/news/info.php deleted file mode 100644 index ef3ae6465..000000000 --- a/news/templates/news/info.php +++ /dev/null @@ -1,20 +0,0 @@ -' . _("News data") . ''; -echo _("By") . ': ' . Horde::link(Horde_Util::addParameter($browse_url, 'user', $row['user'])) . $row['user'] . '
    '; -echo _("On") . ': ' . Horde::link(Horde_Util::addParameter($browse_url, 'publish', $row['publish'])) . News::dateFormat($row['publish']) . '
    '; -echo _("Category") . ': ' . Horde::link(Horde_Util::addParameter($browse_url, 'cid', $row['category1'])) . $GLOBALS['news_cat']->getName($row['category1']) . '
    '; - -$plain = preg_replace('/\s\s+/', ' ', trim(strip_tags($row['content']))); -echo _("Chars") . ': ' . number_format(strlen($plain)) . '
    '; -echo _("Besed") . ': ' . number_format(substr_count($plain, ' ')) . '
    '; - -if ($row['sourcelink']) { - echo _("Source news") . ': ' . Horde::externalUrl($row['sourcelink'], true) . _("Source news") . '
    '; -} - -if ($row['source']) { - $sources = $news->getSources(true); - echo _("Source media") . ': ' . Horde::externalUrl($sources[$row['source']]['source_url'], true) . - $sources[$row['source']]['source_name'] . '
    '; -} diff --git a/news/templates/news/mail.php b/news/templates/news/mail.php deleted file mode 100644 index d817b1f56..000000000 --- a/news/templates/news/mail.php +++ /dev/null @@ -1,7 +0,0 @@ -
    -
    - - - - - diff --git a/news/templates/news/news.php b/news/templates/news/news.php deleted file mode 100644 index c51f1ae69..000000000 --- a/news/templates/news/news.php +++ /dev/null @@ -1,46 +0,0 @@ -
    -

    -
    - - - - - - - -
    - -"> - -
    -');"> - -
    -\n"; -} else { - echo _("Primary category") . ': ' . $row['category1'] . '!!!
    ' . "\n"; -} - -if ($row['category2']>0) { - echo _("Secondary category") . ': ' . $allowed_cats[$row['category2']] . "
    \n"; -} - -if (substr($row['unpublish'], 0, 1) != 0) { - echo _("Unpublish date") . ': ' . $row['unpublish'] . "
    \n"; -} - -if ($conf['comments']['allow']) { - echo _("Allow comments") . ': ' . ($row['comments']>-1 ? _("Yes") : _("No")) . "
    \n"; -} - -if ($row['editor']) { - echo _("Editor") . ': ' . $row['editor'] . "
    \n"; -} - -if ($row['sortorder']) { - echo _("Sort order") . ': ' . $row['sortorder'] . "
    \n"; -} - -if (isset($row['parents'])) { - echo _("Parents") . ': ' . sizeof($row['parents']) . "
    \n"; -} - -if (!empty($row['source']) && isset($GLOBALS['cfgSources'][$row['source']])) { - echo _("Source") . ': ' . $GLOBALS['cfgSources'][$row['source']]['title'] . '
    '; -} - -if (isset($row['sourcelink'])) { - echo _("Source link") . ': ' . $row['sourcelink'] . '
    '; -} - -// 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); -} - -?> -
    -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: ") . '
    '; - - 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") . ' | '; - - $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") . ' | '; - - $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") . ' '; - - echo ')
    ' . "\n"; - } -} - -?> -
    - -
    - $page, 'id' => $row['id'])); -echo Horde::link($url,_("Edit")) . - Horde::img('edit.png', _("Edit"), '', $img_dir) . '  '; - -echo Horde::link(Horde_Util::addParameter($browse_url, 'id', $row['id']), _("Info")) . - Horde::img('devel.png', _("Info"), '', $img_dir). '  '; - -/* 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) . ' '; - } 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) . ' '; - - $url = Horde_Util::addParameter(Horde::url('delete.php'), 'id', $row['id']); - echo Horde::link($url,_("Delete"), '', '', '', _("Delete")) . Horde::img('delete.png', _("Delete"), '', $img_dir) . '  '; - - 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) . ' '; - } 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) . ' '; - } - } -} - -?> - - - true)) . 'return false', $row['view_count']) . number_format($row['view_count']) . ''; -?> -
    - - - - -
    -' - . '' - . '
    ' - . $row['picture_comment'] - . ''; -} - -$plain_text = trim(strip_tags($row['content'])); -echo '
    ' . substr($plain_text, 0, 1) . '
    '; -echo $row['content']; - -if ($row['sponsored']) { - echo '' . _("* Sponsored news") . ''; -} - -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'; - -?> -
    - -
    \ No newline at end of file diff --git a/news/templates/news/parents.php b/news/templates/news/parents.php deleted file mode 100644 index d4de7c162..000000000 --- a/news/templates/news/parents.php +++ /dev/null @@ -1,12 +0,0 @@ -
    -'; - foreach ($row['parents'] as $parent_id => $data) { - echo '
  • ' . News::dateFormat($data['publish']) . ' ' - . Horde::link(News::getUrlFor('news', $parent_id), _("Read")) - . $data['title'] . ' (' . ($data['comments']> -1 ? $data['comments'] : 0) . ')'; - } - echo ''; -} diff --git a/news/templates/news/selling.php b/news/templates/news/selling.php deleted file mode 100644 index 806ab1e5c..000000000 --- a/news/templates/news/selling.php +++ /dev/null @@ -1,13 +0,0 @@ -
    -
    -call($item[0] . '/getSellingForm', $item[1]); - } catch (Horde_Exception $e) { - echo $e->getMessage(); - } -} - diff --git a/news/templates/news/threads.php b/news/templates/news/threads.php deleted file mode 100644 index 7eeb6e8f4..000000000 --- a/news/templates/news/threads.php +++ /dev/null @@ -1,14 +0,0 @@ -
    -' . sprintf(_("Threads in %s"), $registry->get('name', 'agora')) . ':'; - $agore_link = $registry->get('webroot', 'agora'); - echo ''; -} diff --git a/news/templates/news/today.php b/news/templates/news/today.php deleted file mode 100644 index 52d335f8b..000000000 --- a/news/templates/news/today.php +++ /dev/null @@ -1,13 +0,0 @@ -
    ' . _("On this day") . '
    '; -$img = Horde::img('news.png'); -echo $img . ' ' . Horde::link(Horde_Util::addParameter($browse_url, 'date', $row['publish'])) . _("News of this day.") . '
    '; - -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.") . '
    '; -} - diff --git a/news/templates/news/tools.php b/news/templates/news/tools.php deleted file mode 100644 index 7a74241d9..000000000 --- a/news/templates/news/tools.php +++ /dev/null @@ -1,25 +0,0 @@ -
    ' . _("Tools") . '
    '; - -$img = Horde::img('print.png'); -echo $img . ' ' . Horde::link('javascript:window.print()') . _("Printer firendly") . '
    '; - -$img = Horde::img('mime/pdf.png'); -echo $img . ' ' . Horde::link(Horde_Util::addParameter(Horde::url('pdf.php'), 'id', $id)) . _("PDF") . '
    '; - -/* 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.") . '
    '; -} - -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.") . '
    '; -} diff --git a/news/templates/news/ulaform.php b/news/templates/news/ulaform.php deleted file mode 100644 index f8e836956..000000000 --- a/news/templates/news/ulaform.php +++ /dev/null @@ -1,17 +0,0 @@ - $_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 '

    ' . $form['title'] . '

    '; - echo $form['form']; -} diff --git a/news/templates/print/footer.inc b/news/templates/print/footer.inc deleted file mode 100755 index e69de29bb..000000000 diff --git a/news/templates/print/header.inc b/news/templates/print/header.inc deleted file mode 100755 index e69de29bb..000000000 diff --git a/news/templates/reads/footer.inc b/news/templates/reads/footer.inc deleted file mode 100755 index 000ca4b01..000000000 --- a/news/templates/reads/footer.inc +++ /dev/null @@ -1 +0,0 @@ - diff --git a/news/templates/reads/header.inc b/news/templates/reads/header.inc deleted file mode 100755 index c192b7959..000000000 --- a/news/templates/reads/header.inc +++ /dev/null @@ -1,10 +0,0 @@ -
    - - - - - - - - - diff --git a/news/templates/reads/row.inc b/news/templates/reads/row.inc deleted file mode 100755 index 56d758815..000000000 --- a/news/templates/reads/row.inc +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/news/templates/sources/index.php b/news/templates/sources/index.php deleted file mode 100644 index 87180309f..000000000 --- a/news/templates/sources/index.php +++ /dev/null @@ -1,18 +0,0 @@ -
    '; ?>'; ?>
    - - - - - - - - -sources as $source_id => $source) { ?> - - - - - - - -
    add_url ?>
    diff --git a/news/themes/graphics/folder_open.png b/news/themes/graphics/folder_open.png deleted file mode 100644 index 312f8be41..000000000 Binary files a/news/themes/graphics/folder_open.png and /dev/null differ diff --git a/news/themes/graphics/mkdir.png b/news/themes/graphics/mkdir.png deleted file mode 100644 index 121f15693..000000000 Binary files a/news/themes/graphics/mkdir.png and /dev/null differ diff --git a/news/themes/graphics/news.png b/news/themes/graphics/news.png deleted file mode 100644 index cfb725222..000000000 Binary files a/news/themes/graphics/news.png and /dev/null differ diff --git a/news/themes/screen.css b/news/themes/screen.css deleted file mode 100755 index a3d45651a..000000000 --- a/news/themes/screen.css +++ /dev/null @@ -1,82 +0,0 @@ -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 diff --git a/news/trackback.php b/news/trackback.php deleted file mode 100644 index 6189e4a47..000000000 --- a/news/trackback.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @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(); diff --git a/skoli/LICENSE b/skoli/LICENSE deleted file mode 100644 index da074b87a..000000000 --- a/skoli/LICENSE +++ /dev/null @@ -1,48 +0,0 @@ -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 . diff --git a/skoli/README b/skoli/README deleted file mode 100644 index 098999b7d..000000000 --- a/skoli/README +++ /dev/null @@ -1,87 +0,0 @@ -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 diff --git a/skoli/add.php b/skoli/add.php deleted file mode 100644 index 7dbc748a7..000000000 --- a/skoli/add.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - -@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'; diff --git a/skoli/classes/create.php b/skoli/classes/create.php deleted file mode 100644 index 34c8c8ae6..000000000 --- a/skoli/classes/create.php +++ /dev/null @@ -1,46 +0,0 @@ -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'; diff --git a/skoli/classes/delete.php b/skoli/classes/delete.php deleted file mode 100644 index 7ae1d426b..000000000 --- a/skoli/classes/delete.php +++ /dev/null @@ -1,48 +0,0 @@ -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'; diff --git a/skoli/classes/edit.php b/skoli/classes/edit.php deleted file mode 100644 index b4d0c999f..000000000 --- a/skoli/classes/edit.php +++ /dev/null @@ -1,75 +0,0 @@ -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'; diff --git a/skoli/classes/index.php b/skoli/classes/index.php deleted file mode 100644 index 09be282f4..000000000 --- a/skoli/classes/index.php +++ /dev/null @@ -1,37 +0,0 @@ -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'; diff --git a/skoli/config/conf.xml b/skoli/config/conf.xml deleted file mode 100644 index 27caf8257..000000000 --- a/skoli/config/conf.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - Storage System Settings - - sql - - - - - - - - - - - - Settings for new Objects - - true - true - true - true - - - - - Address settings - - ask - - - - localsql - - - name - user - - - - - - %c - %g - %s - - - - - - - Menu settings - - true - - - - - - - diff --git a/skoli/config/prefs.php.dist b/skoli/config/prefs.php.dist deleted file mode 100644 index bf88f6376..000000000 --- a/skoli/config/prefs.php.dist +++ /dev/null @@ -1,205 +0,0 @@ - _("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.
    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).
    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' -); diff --git a/skoli/config/schools.php.dist b/skoli/config/schools.php.dist deleted file mode 100644 index 6d3debd57..000000000 --- a/skoli/config/schools.php.dist +++ /dev/null @@ -1,114 +0,0 @@ - _("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"), - ), -); diff --git a/skoli/data.php b/skoli/data.php deleted file mode 100644 index 570fac76e..000000000 --- a/skoli/data.php +++ /dev/null @@ -1,178 +0,0 @@ - - */ - -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[] = '\n"; -} - -$wholeclass_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[] = '\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'; diff --git a/skoli/docs/CHANGES b/skoli/docs/CHANGES deleted file mode 100644 index 7e31cfce8..000000000 --- a/skoli/docs/CHANGES +++ /dev/null @@ -1,5 +0,0 @@ ----- -v0.1 ----- - -[xyz] Initial Release diff --git a/skoli/docs/CREDITS b/skoli/docs/CREDITS deleted file mode 100644 index a7551824b..000000000 --- a/skoli/docs/CREDITS +++ /dev/null @@ -1,17 +0,0 @@ -=========================== - Skoli Development Team -=========================== - - -Core Developers -=============== - -- Martin Blumenthal - - -Localization -============ - -===================== ====================================================== -German Martin Blumenthal -===================== ====================================================== diff --git a/skoli/docs/INSTALL b/skoli/docs/INSTALL deleted file mode 100644 index 32a7fd302..000000000 --- a/skoli/docs/INSTALL +++ /dev/null @@ -1,241 +0,0 @@ -====================== - 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 diff --git a/skoli/docs/RELEASE_NOTES b/skoli/docs/RELEASE_NOTES deleted file mode 100644 index c49e37af4..000000000 --- a/skoli/docs/RELEASE_NOTES +++ /dev/null @@ -1,52 +0,0 @@ -notes['fm']['focus'] = 4; - -/* Mailing list release notes. */ -$this->notes['ml']['changes'] = <<notes['fm']['changes'] = <<notes['name'] = 'Skoli'; -$this->notes['fm']['project'] = 'skoli'; -$this->notes['fm']['branch'] = 'Default'; diff --git a/skoli/docs/TODO b/skoli/docs/TODO deleted file mode 100644 index 470eab49e..000000000 --- a/skoli/docs/TODO +++ /dev/null @@ -1,13 +0,0 @@ -============================= - 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). diff --git a/skoli/entry.php b/skoli/entry.php deleted file mode 100644 index 20e18e283..000000000 --- a/skoli/entry.php +++ /dev/null @@ -1,118 +0,0 @@ - - */ - -@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 '
    '; -echo $tabs->render($viewName); -echo '

    ' . sprintf(_("Entry for \"%s\""), $studentdetails[$conf['addresses']['name_field']]) . '

    '; - -// 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 '
    '; -require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/skoli/index.php b/skoli/index.php deleted file mode 100644 index c5a7d4085..000000000 --- a/skoli/index.php +++ /dev/null @@ -1,10 +0,0 @@ -getValue('initial_page') . '.php'; diff --git a/skoli/lib/Ajax/Application.php b/skoli/lib/Ajax/Application.php deleted file mode 100644 index 6d3096011..000000000 --- a/skoli/lib/Ajax/Application.php +++ /dev/null @@ -1,15 +0,0 @@ - - * @category Horde - * @license http://www.fsf.org/copyleft/gpl.html GPL - * @package Skoli - */ -class Skoli_Ajax_Application extends Horde_Core_Ajax_Application {} diff --git a/skoli/lib/Application.php b/skoli/lib/Application.php deleted file mode 100644 index d21b77b78..000000000 --- a/skoli/lib/Application.php +++ /dev/null @@ -1,16 +0,0 @@ - 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') - ) - ); - } - } - -} diff --git a/skoli/lib/Driver.php b/skoli/lib/Driver.php deleted file mode 100644 index 279f9b98e..000000000 --- a/skoli/lib/Driver.php +++ /dev/null @@ -1,138 +0,0 @@ - - * @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]; - } - -} diff --git a/skoli/lib/Driver/sql.php b/skoli/lib/Driver/sql.php deleted file mode 100644 index a63cfa8e4..000000000 --- a/skoli/lib/Driver/sql.php +++ /dev/null @@ -1,605 +0,0 @@ - - * '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'. - * - * 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 - * @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; - } -} diff --git a/skoli/lib/Forms/CreateClass.php b/skoli/lib/Forms/CreateClass.php deleted file mode 100644 index e930a075c..000000000 --- a/skoli/lib/Forms/CreateClass.php +++ /dev/null @@ -1,234 +0,0 @@ - - * @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; - } - -} diff --git a/skoli/lib/Forms/DeleteClass.php b/skoli/lib/Forms/DeleteClass.php deleted file mode 100644 index c0ac3e1ca..000000000 --- a/skoli/lib/Forms/DeleteClass.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @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; - } - -} diff --git a/skoli/lib/Forms/EditClass.php b/skoli/lib/Forms/EditClass.php deleted file mode 100644 index 70812751e..000000000 --- a/skoli/lib/Forms/EditClass.php +++ /dev/null @@ -1,169 +0,0 @@ - - * @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; - } - -} diff --git a/skoli/lib/Forms/Entry.php b/skoli/lib/Forms/Entry.php deleted file mode 100644 index d020ebfb3..000000000 --- a/skoli/lib/Forms/Entry.php +++ /dev/null @@ -1,184 +0,0 @@ - - * @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; - } -} diff --git a/skoli/lib/School.php b/skoli/lib/School.php deleted file mode 100644 index 7363f759c..000000000 --- a/skoli/lib/School.php +++ /dev/null @@ -1,287 +0,0 @@ - - * @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; - } - -} diff --git a/skoli/lib/Skoli.php b/skoli/lib/Skoli.php deleted file mode 100644 index 2a6efe281..000000000 --- a/skoli/lib/Skoli.php +++ /dev/null @@ -1,1076 +0,0 @@ - - * @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; - } -} diff --git a/skoli/lib/base.php b/skoli/lib/base.php deleted file mode 100644 index 0674dae46..000000000 --- a/skoli/lib/base.php +++ /dev/null @@ -1,37 +0,0 @@ -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(); diff --git a/skoli/list.php b/skoli/list.php deleted file mode 100644 index 24d431471..000000000 --- a/skoli/list.php +++ /dev/null @@ -1,159 +0,0 @@ - - */ - -@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 '
    '; -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'; diff --git a/skoli/locale/.htaccess b/skoli/locale/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/skoli/locale/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/skoli/locale/de/LC_MESSAGES/skoli.mo b/skoli/locale/de/LC_MESSAGES/skoli.mo deleted file mode 100644 index de30bf01e..000000000 Binary files a/skoli/locale/de/LC_MESSAGES/skoli.mo and /dev/null differ diff --git a/skoli/locale/de/LC_MESSAGES/skoli.po b/skoli/locale/de/LC_MESSAGES/skoli.po deleted file mode 100644 index af6a0edda..000000000 --- a/skoli/locale/de/LC_MESSAGES/skoli.po +++ /dev/null @@ -1,1019 +0,0 @@ -# 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.
    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.
    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).
    NOTE: You also need to choose \"Custom settings\" above." -msgstr "" -"Eingabe eines eigenen Notenformats. Jede Note wird mit einem Komma getrennt " -"(beste Note zuerst).
    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" diff --git a/skoli/locale/de/help.xml b/skoli/locale/de/help.xml deleted file mode 100644 index d645bd4ed..000000000 --- a/skoli/locale/de/help.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Skoli Übersicht - Was ist Skoli? - - 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. - - - - diff --git a/skoli/locale/en/help.xml b/skoli/locale/en/help.xml deleted file mode 100644 index 0d50ff3b0..000000000 --- a/skoli/locale/en/help.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Skoli Overview - What is Skoli? - - 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. - - - - diff --git a/skoli/locale/skoli.pot b/skoli/locale/skoli.pot deleted file mode 100644 index 8a75ca85e..000000000 --- a/skoli/locale/skoli.pot +++ /dev/null @@ -1,996 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Horde Project -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , 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 \n" -"Language-Team: LANGUAGE \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.
    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).
    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 "" diff --git a/skoli/scripts/.htaccess b/skoli/scripts/.htaccess deleted file mode 100755 index 3a4288278..000000000 --- a/skoli/scripts/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/skoli/scripts/sql/skoli.sql b/skoli/scripts/sql/skoli.sql deleted file mode 100755 index 99a430fbf..000000000 --- a/skoli/scripts/sql/skoli.sql +++ /dev/null @@ -1,81 +0,0 @@ -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); diff --git a/skoli/search.php b/skoli/search.php deleted file mode 100644 index 848cc83bd..000000000 --- a/skoli/search.php +++ /dev/null @@ -1,187 +0,0 @@ - - */ - -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[] = '\n"; -} -foreach ($classes as $key=>$class) { - $class_options[] = '\n"; -} - -$student_options = array(); -$student_options[] = '\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[] = '\n"; -} -if (!$foundstudent && $studentid != 'all') { - $actionID = ''; - $studentid = ''; - $_SESSION['skoli']['search_studentid'] = $studentid; -} - -$type_options = array(); -$type_options[] = '\n"; -if ($conf['objects']['allow_marks']) { - $type_options[] = '\n"; -} -if ($conf['objects']['allow_objectives']) { - $type_options[] = '\n"; -} -if ($conf['objects']['allow_outcomes']) { - $type_options[] = '\n"; -} -if ($conf['objects']['allow_absences']) { - $type_options[] = '\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 '
    '; - 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'), '
    ', true); - $entry['details'] = current(explode('
    ', $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'; diff --git a/skoli/templates/classes/list.php b/skoli/templates/classes/list.php deleted file mode 100644 index e1c736bc0..000000000 --- a/skoli/templates/classes/list.php +++ /dev/null @@ -1,35 +0,0 @@ -

    - -

    - -
    -
    - - " /> -
    -
    - - 0): ?> -" cellspacing="0" id="class-list" class="striped sortable"> - - - - - - - - - - - - - - - - - - - - -
     
    get('name')) ?>">">">
    - diff --git a/skoli/templates/common-header.inc b/skoli/templates/common-header.inc deleted file mode 100644 index 11adac711..000000000 --- a/skoli/templates/common-header.inc +++ /dev/null @@ -1,34 +0,0 @@ -getCharset()); - header('Vary: Accept-Language'); -} -?> - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); - -$bc = $prefs->getValue('show_panel') - ? 'rightPanel' - : ''; - -?> -<?php echo htmlspecialchars($page_title) ?> - - - - - -> diff --git a/skoli/templates/data/export.inc b/skoli/templates/data/export.inc deleted file mode 100644 index 3d81f29d8..000000000 --- a/skoli/templates/data/export.inc +++ /dev/null @@ -1,34 +0,0 @@ -
    "> - - -

    - -

    - -
    -
    -
    - - 1): ?> -
    -
    -
    - - - -
    - -
    -
    -
    - - " class="button" /> -
    -
    diff --git a/skoli/templates/entry/delete.inc b/skoli/templates/entry/delete.inc deleted file mode 100644 index c46ac27d9..000000000 --- a/skoli/templates/entry/delete.inc +++ /dev/null @@ -1,10 +0,0 @@ -
    - - - - -
    -

    - " /> -
    -
    diff --git a/skoli/templates/list/classes.inc b/skoli/templates/list/classes.inc deleted file mode 100644 index c17987c40..000000000 --- a/skoli/templates/list/classes.inc +++ /dev/null @@ -1,49 +0,0 @@ - - - '; - } - ?> - - - '; - } - ?> - - -   - -   - - - 'search', - 'class' => $class['_id'], - 'student' => 'all' - ); - echo Horde::link(Horde_Util::addParameter(Horde::url('search.php'), $params), $label) . htmlspecialchars($class['name']) . ''; - ?> - - -   - -   - -   - -   - -   - -   - - - - diff --git a/skoli/templates/list/empty.inc b/skoli/templates/list/empty.inc deleted file mode 100644 index 3e418aa2e..000000000 --- a/skoli/templates/list/empty.inc +++ /dev/null @@ -1,3 +0,0 @@ -

    - -

    diff --git a/skoli/templates/list/footers.inc b/skoli/templates/list/footers.inc deleted file mode 100644 index a5ef8c968..000000000 --- a/skoli/templates/list/footers.inc +++ /dev/null @@ -1,6 +0,0 @@ - - -

    - -
    -
    diff --git a/skoli/templates/list/header.inc b/skoli/templates/list/header.inc deleted file mode 100644 index 5ad70ecc5..000000000 --- a/skoli/templates/list/header.inc +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/skoli/templates/list/headers.inc b/skoli/templates/list/headers.inc deleted file mode 100644 index f2ce0a8e7..000000000 --- a/skoli/templates/list/headers.inc +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/skoli/templates/list/students.inc b/skoli/templates/list/students.inc deleted file mode 100644 index fa060f0c2..000000000 --- a/skoli/templates/list/students.inc +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/skoli/templates/menu.inc b/skoli/templates/menu.inc deleted file mode 100644 index 319b5c80d..000000000 --- a/skoli/templates/menu.inc +++ /dev/null @@ -1,5 +0,0 @@ - - -notify(array('listeners' => 'status')) ?> diff --git a/skoli/templates/panel.inc b/skoli/templates/panel.inc deleted file mode 100644 index 780145227..000000000 --- a/skoli/templates/panel.inc +++ /dev/null @@ -1,76 +0,0 @@ -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; - } -} -?> - -
    - - - - -
    -
    - -

    -

    - -

    -

    - -

    - -getAuth()): ?> -

    - -

    - - - -

    -
      - $cl): ?> -
    • - -
    - - - -

    -
      - $cl): ?> -
    • - -
    - - -

    - " class="button" /> -

    - - -
    -
    diff --git a/skoli/templates/search/criteria.inc b/skoli/templates/search/criteria.inc deleted file mode 100644 index b17bb8f2c..000000000 --- a/skoli/templates/search/criteria.inc +++ /dev/null @@ -1,44 +0,0 @@ - - - - -

    - -

    - -
    - - 1): ?> - - - get('name') ?> - -  - -  -
    - -
    - -
    - - - - width="2%"> -   - width="2%"> -   - > -   - width="2%"> -   - width="2%"> -   - width="2%"> -   - width="2%"> -   - width="2%"> -   - width="2%"> -   - width="10%"> -   - 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")) . ''; - } - ?> -
    - $class['_id'], 'student'=>$student['__key'])), $label) . Horde::img('add.png', $label) . ''; - } - ?> - - 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) . ''; - } - ?> -    - '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']]) . ''; - ?> -      
    - - - -
    - - - - " /> - " /> -
    -
    - diff --git a/skoli/templates/search/empty.inc b/skoli/templates/search/empty.inc deleted file mode 100644 index 3121ac26f..000000000 --- a/skoli/templates/search/empty.inc +++ /dev/null @@ -1,3 +0,0 @@ -

    - -

    diff --git a/skoli/templates/search/entries.inc b/skoli/templates/search/entries.inc deleted file mode 100644 index f53695f05..000000000 --- a/skoli/templates/search/entries.inc +++ /dev/null @@ -1,27 +0,0 @@ - - - 'EditEntry', - 'entry' => $entry['_id'] - ); - echo Horde::link(Horde_Util::addParameter(Horde::url('entry.php'), $params), $label) . Horde::img('edit.png', $label) . ''; - } - ?> - -   - - 'Entry', - 'entry' => $entry['_id'] - ); - echo Horde::link(Horde_Util::addParameter(Horde::url('entry.php'), $params), _("View Entry")) . htmlspecialchars($entry['student']) . ' '; - ?> - -   -   -   - diff --git a/skoli/templates/search/footers.inc b/skoli/templates/search/footers.inc deleted file mode 100644 index bafb71ee3..000000000 --- a/skoli/templates/search/footers.inc +++ /dev/null @@ -1,6 +0,0 @@ - - -

    - -
    -
  • diff --git a/skoli/templates/search/header.inc b/skoli/templates/search/header.inc deleted file mode 100644 index 71f3659cd..000000000 --- a/skoli/templates/search/header.inc +++ /dev/null @@ -1,11 +0,0 @@ -
    - diff --git a/skoli/templates/search/headers.inc b/skoli/templates/search/headers.inc deleted file mode 100644 index 5d762e3af..000000000 --- a/skoli/templates/search/headers.inc +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/skoli/themes/categoryCSS.php b/skoli/themes/categoryCSS.php deleted file mode 100644 index b3668af65..000000000 --- a/skoli/themes/categoryCSS.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ - -$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"; -} diff --git a/skoli/themes/graphics/add.png b/skoli/themes/graphics/add.png deleted file mode 100644 index 324f5fd19..000000000 Binary files a/skoli/themes/graphics/add.png and /dev/null differ diff --git a/skoli/themes/graphics/az.png b/skoli/themes/graphics/az.png deleted file mode 100644 index 2b646f94c..000000000 Binary files a/skoli/themes/graphics/az.png and /dev/null differ diff --git a/skoli/themes/graphics/favicon.ico b/skoli/themes/graphics/favicon.ico deleted file mode 100644 index c3b82e4f1..000000000 Binary files a/skoli/themes/graphics/favicon.ico and /dev/null differ diff --git a/skoli/themes/graphics/minus.png b/skoli/themes/graphics/minus.png deleted file mode 100644 index 32170460c..000000000 Binary files a/skoli/themes/graphics/minus.png and /dev/null differ diff --git a/skoli/themes/graphics/plus.png b/skoli/themes/graphics/plus.png deleted file mode 100644 index 263e35690..000000000 Binary files a/skoli/themes/graphics/plus.png and /dev/null differ diff --git a/skoli/themes/graphics/search.png b/skoli/themes/graphics/search.png deleted file mode 100644 index 94c47d455..000000000 Binary files a/skoli/themes/graphics/search.png and /dev/null differ diff --git a/skoli/themes/graphics/skoli.png b/skoli/themes/graphics/skoli.png deleted file mode 100644 index 03f96725b..000000000 Binary files a/skoli/themes/graphics/skoli.png and /dev/null differ diff --git a/skoli/themes/graphics/timetable.png b/skoli/themes/graphics/timetable.png deleted file mode 100644 index 3da6e7eb3..000000000 Binary files a/skoli/themes/graphics/timetable.png and /dev/null differ diff --git a/skoli/themes/graphics/za.png b/skoli/themes/graphics/za.png deleted file mode 100644 index a154237b5..000000000 Binary files a/skoli/themes/graphics/za.png and /dev/null differ diff --git a/skoli/themes/screen.css b/skoli/themes/screen.css deleted file mode 100644 index 3999575e9..000000000 --- a/skoli/themes/screen.css +++ /dev/null @@ -1,124 +0,0 @@ -#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; -}
    - - width="2%"> -   - width="2%"> -   - width="2%"> -   - width="2%"> -   - -   -