From 6eced17fa214f579531458e5e5b8b11df5eb1162 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 31 Jul 2009 14:46:48 -0600 Subject: [PATCH] Track Horde popup.js changes --- ansel/faces/gallery.php | 1 + ansel/gallery.php | 1 + ansel/js/src/googlemap.js | 2 +- ansel/js/src/slideshow.js | 4 +- ansel/lib/Ajax/Imple/ImageSaveGeotag.php | 2 +- ansel/lib/Ansel.php | 2 +- ansel/lib/Block/recently_added_geodata.php | 1 + ansel/lib/View/GalleryRenderer/Gallery.php | 1 + ansel/lib/View/GalleryRenderer/GalleryLightbox.php | 1 + ansel/lib/Widget/Actions.php | 2 +- ansel/lib/Widget/Geodata.php | 5 +- ansel/map_edit.php | 1 + ansel/templates/image/crop_image.inc | 3 +- ansel/templates/image/edit_image.inc | 3 +- ansel/templates/image/resize_image.inc | 3 +- ansel/templates/tile/image.inc | 2 +- ansel/templates/view/gallery.inc | 2 +- ansel/templates/view/gallerylightbox.inc | 2 +- ansel/templates/view/image.inc | 2 +- ansel/templates/view/slideshow.inc | 4 +- ansel/view.php | 1 - fima/accounts.php | 9 +-- fima/ledgers/index.php | 1 - fima/lib/Fima.php | 90 +++++++++++----------- fima/postings.php | 43 +++++------ fima/templates/ledgers_list.php | 2 +- folks/edit/friends/groups.php | 2 - folks/edit/friends/invite.php | 2 - folks/templates/edit/groups.php | 2 +- .../Model/lib/Horde/Form/VarRenderer/Xhtml.php | 3 +- gollem/js/src/popup.js | 66 ---------------- gollem/lib/Gollem.php | 3 +- gollem/lib/api.php | 3 +- gollem/manager.php | 5 +- gollem/templates/javascript_defs.php | 3 - ingo/lib/Ingo.php | 8 +- kronolith/calendars/index.php | 1 - kronolith/day.php | 3 - kronolith/event.php | 3 - kronolith/index.php | 2 +- kronolith/lib/Kronolith.php | 9 +-- kronolith/lib/View/EditEvent.php | 1 + kronolith/month.php | 3 - kronolith/new.php | 1 + kronolith/templates/calendar_list.php | 2 +- kronolith/templates/edit/edit.inc | 2 +- kronolith/week.php | 3 - kronolith/workweek.php | 3 - kronolith/year.php | 3 - nag/lib/Nag.php | 8 +- nag/list.php | 1 - nag/tasklists/index.php | 1 - nag/tasks/index.php | 1 - nag/templates/list/task_headers.inc | 2 +- nag/templates/tasklist_list.php | 2 +- nag/view.php | 1 - news/edit.php | 1 - news/news.php | 1 - news/templates/edit/info.php | 2 +- news/templates/edit/row.php | 2 +- news/templates/news/gallery.php | 3 +- skoli/classes/index.php | 1 - skoli/list.php | 1 - skoli/templates/classes/list.php | 2 +- skoli/templates/list/headers.inc | 2 +- turba/addressbooks/index.php | 1 - turba/lib/Turba.php | 6 +- turba/templates/addressbook_list.php | 2 +- 68 files changed, 122 insertions(+), 241 deletions(-) delete mode 100644 gollem/js/src/popup.js diff --git a/ansel/faces/gallery.php b/ansel/faces/gallery.php index 36909c3a6..8214f9453 100644 --- a/ansel/faces/gallery.php +++ b/ansel/faces/gallery.php @@ -49,6 +49,7 @@ $pager->preserve('gallery', $gallery_id); $title = sprintf(_("Searching for faces in %s"), Horde::link(Ansel::getUrlFor('view', array('gallery' => $gallery_id, 'view' => 'Gallery'))) . $gallery->get('name') . ''); Horde::addScriptFile('stripe.js', 'horde', true); +Horde::addScriptFile('popup.js', 'horde', true); require ANSEL_TEMPLATES . '/common-header.inc'; require ANSEL_TEMPLATES . '/menu.inc'; require ANSEL_TEMPLATES . '/faces/gallery.inc'; diff --git a/ansel/gallery.php b/ansel/gallery.php index 0b4fbe90a..fb2d1ed60 100644 --- a/ansel/gallery.php +++ b/ansel/gallery.php @@ -388,6 +388,7 @@ $imple = Horde_Ajax_Imple::factory(array('ansel', 'GallerySlugCheck'), array('slug' => $gallery_slug, 'bindTo' => 'gallery_slug')); $imple->attach(); +Horde::addScriptFile('popup.js', 'horde', true); require ANSEL_TEMPLATES . '/menu.inc'; require ANSEL_TEMPLATES . '/gallery/gallery.inc'; require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/ansel/js/src/googlemap.js b/ansel/js/src/googlemap.js index 371977986..b42bd7fda 100644 --- a/ansel/js/src/googlemap.js +++ b/ansel/js/src/googlemap.js @@ -398,7 +398,7 @@ Ansel_GMap.prototype = { _getRelocateLink: function(iid) { if (options.hasEdit) { var a = new Element('a', {href: this.options.relocateUrl + '?image=' + iid}).update(this.options.relocateText); - a.observe('click', function(e) {popup(this.options.relocateUrl + '?image=' + iid, 750, 600); e.stop();}.bind(this)); + a.observe('click', function(e) { Horde.popup({ url: this.options.relocateUrl, params: 'image=' + iid, width: 600, height: 750 }); e.stop();}.bind(this)); return a; } else { return ''; diff --git a/ansel/js/src/slideshow.js b/ansel/js/src/slideshow.js index 6c47e54d6..35bf4888c 100755 --- a/ansel/js/src/slideshow.js +++ b/ansel/js/src/slideshow.js @@ -169,14 +169,14 @@ Slide.prototype = { Element.setHref($('breadcrumb_gallery'), SlideController.baseUrl + '/view.php' + params + '&view=Gallery'); if ($('image_properties_link')) { Element.setHref('image_properties_link', SlideController.baseUrl + '/image.php' + params + '&actionID=modify&share=' + SlideController.galleryShare); - Element.setOnClick('image_properties_link', function(){SlideController.pause();popup(this.href);return false;}); + Element.setOnClick('image_properties_link', function(){SlideController.pause();Horde.popup({ url: this.href });return false;}); } if ($('image_edit_link')) { Element.setHref('image_edit_link', SlideController.baseUrl + '/image.php' + params + '&actionID=editimage'); } if ($('image_ecard_link')) { Element.setHref('image_ecard_link', SlideController.baseUrl + '/img/ecard.php?image=' + SlideController.photos[SlideController.photoId][3] + '&gallery=' + SlideController.galleryId); - Element.setOnClick('image_ecard_link', function(){SlideController.pause();popup(this.href);return false;}); + Element.setOnClick('image_ecard_link', function(){SlideController.pause();Horde.popup({ url: this.href });return false;}); } if ($('image_delete_link')) { //TODO : Guess we should have PHP save the localized text for this... diff --git a/ansel/lib/Ajax/Imple/ImageSaveGeotag.php b/ansel/lib/Ajax/Imple/ImageSaveGeotag.php index 35483911f..d1679d9e6 100644 --- a/ansel/lib/Ajax/Imple/ImageSaveGeotag.php +++ b/ansel/lib/Ajax/Imple/ImageSaveGeotag.php @@ -67,7 +67,7 @@ class Ansel_Ajax_Imple_ImageSaveGeotag extends Horde_Ajax_Imple_Base $image->geotag('', '', ''); // Now get the "add geotag" stuff $addurl = Horde_Util::addParameter(Horde::applicationUrl('map_edit.php'), 'image', $img); - $addLink = Horde::link($addurl, '', '', '', 'popup(\'' . Horde_Util::addParameter(Horde::applicationUrl('map_edit.php'), 'image', $img) . '\'); return false;'); + $addLink = Horde::link($addurl, '', '', '', Horde::popupJs(Horde::applicationUrl('map_edit.php'), array('params' => array('image' => $img), 'urlencode' => true)) . 'return false;'); $imgs = $GLOBALS['ansel_storage']->getRecentImagesGeodata(Horde_Auth::getAuth()); if (count($imgs) > 0) { $imgsrc = '
'; diff --git a/ansel/lib/Ansel.php b/ansel/lib/Ansel.php index 6da32da2a..da72f3be5 100644 --- a/ansel/lib/Ansel.php +++ b/ansel/lib/Ansel.php @@ -651,7 +651,7 @@ class Ansel { if ($conf['menu']['print'] && ($pl = Horde_Util::nonInputVar('print_link'))) { $menu->add($pl, _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', - 'popup(this.href); return false;'); + Horde::popupJs($pl, array('urlencode' => true)) . 'return false;'); } if ($returnType == 'object') { diff --git a/ansel/lib/Block/recently_added_geodata.php b/ansel/lib/Block/recently_added_geodata.php index d2a883a8b..158d1ef1a 100644 --- a/ansel/lib/Block/recently_added_geodata.php +++ b/ansel/lib/Block/recently_added_geodata.php @@ -55,6 +55,7 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block { Horde::addExternalScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel'); Horde::addExternalScriptFile('http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/1.1/src/markermanager.js', 'ansel'); Horde::addScriptFile('googlemap.js'); + Horde::addScriptFile('popup.js', 'horde', true); if ($this->_params['gallery'] != 'all') { $gallery = $this->_getGallery(); if (is_a($gallery, 'PEAR_Error')) { diff --git a/ansel/lib/View/GalleryRenderer/Gallery.php b/ansel/lib/View/GalleryRenderer/Gallery.php index a8193680b..e6b5b4ab3 100644 --- a/ansel/lib/View/GalleryRenderer/Gallery.php +++ b/ansel/lib/View/GalleryRenderer/Gallery.php @@ -122,6 +122,7 @@ class Ansel_View_GalleryRenderer_Gallery extends Ansel_View_GalleryRenderer_Base $action_links[] = Horde::link('#', '', 'widget', '', 'copySelected(); return false;') . _("Copy") . ''; } + Horde::addScriptFiles('popup.js', 'horde', true); include ANSEL_TEMPLATES . '/view/gallery.inc'; return ob_get_clean(); } diff --git a/ansel/lib/View/GalleryRenderer/GalleryLightbox.php b/ansel/lib/View/GalleryRenderer/GalleryLightbox.php index b504e93fa..25c150fd7 100644 --- a/ansel/lib/View/GalleryRenderer/GalleryLightbox.php +++ b/ansel/lib/View/GalleryRenderer/GalleryLightbox.php @@ -28,6 +28,7 @@ class Ansel_View_GalleryRenderer_GalleryLightbox extends Ansel_View_GalleryRende Ansel::attachStylesheet('lightbox.css'); Horde::addScriptFile('effects.js', 'horde', true); Horde::addScriptFile('lightbox.js', 'ansel', true); + Horde::addScriptFile('popup.js', 'horde', true); } } diff --git a/ansel/lib/Widget/Actions.php b/ansel/lib/Widget/Actions.php index af303936d..05f536332 100644 --- a/ansel/lib/Widget/Actions.php +++ b/ansel/lib/Widget/Actions.php @@ -175,7 +175,7 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base } if ($this->_view->gallery->get('owner') == Horde_Auth::getAuth()) { - $html .= '
  • ' . Horde::link('#','','popup widget', '', "popup('" . Horde_Util::addParameter(Horde::applicationUrl('perms.php'), 'cid', $this->_view->gallery->id) . "');") . Horde::img('perms.png', '', '', $GLOBALS['registry']->getImageDir('horde')) . ' ' . _("Set permissions") . '
  • '; + $html .= '
  • ' . Horde::link('#', '', 'popup widget', '', Horde::popupJs(Horde::applicationUrl('perms.php'), array('params' => array('cid' => $this->_view->gallery->id), 'urlencode' => true)) . 'return false;') . Horde::img('perms.png', '', '', $GLOBALS['registry']->getImageDir('horde')) . ' ' . _("Set permissions") . '
  • '; } elseif (!empty($conf['report_content']['driver']) && (($conf['report_content']['allow'] == 'authenticated' && Horde_Auth::isAuthenticated()) || $conf['report_content']['allow'] == 'all')) { diff --git a/ansel/lib/Widget/Geodata.php b/ansel/lib/Widget/Geodata.php index b4d3e056e..f3d98768e 100644 --- a/ansel/lib/Widget/Geodata.php +++ b/ansel/lib/Widget/Geodata.php @@ -41,8 +41,6 @@ class Ansel_Widget_Geodata extends Ansel_Widget_Base { global $ansel_storage; - Horde::addScriptFile('popup.js', 'horde'); - $geodata = $ansel_storage->getImagesGeodata($this->_params['images']); $url = Horde::applicationUrl('map_edit.php', true); $rtext = _("Relocate this image"); @@ -64,6 +62,7 @@ class Ansel_Widget_Geodata extends Ansel_Widget_Base Horde::addExternalScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel'); Horde::addExternalScriptFile('http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/1.1/src/markermanager.js', 'ansel'); Horde::addScriptFile('googlemap.js'); + Horde::addScriptFile('popup.js', 'horde', true); $html = $this->_htmlBegin() . "\n"; $content = '
    '; @@ -104,7 +103,7 @@ class Ansel_Widget_Geodata extends Ansel_Widget_Base } elseif ($permsEdit) { // Image view, but no geotags, provide ability to add it. $addurl = Horde_Util::addParameter(Horde::applicationUrl('map_edit.php'), 'image', $this->_params['images'][0]); - $addLink = Horde::link($addurl, '', '', '', 'popup(\'' . Horde_Util::addParameter(Horde::applicationUrl('map_edit.php'), 'image', $this->_params['images'][0]) . '\', 750, 600); return false;'); + $addLink = Horde::link($addurl, '', '', '', Horde::popupJs(Horde::applicationUrl('map_edit.php'), array('params' => array('image' => $this->_params['images'][0]), 'urlencode' => true)) . 'return false;'); $imgs = $ansel_storage->getRecentImagesGeodata(Horde_Auth::getAuth()); if (count($imgs) > 0) { $imgsrc = '
    '; diff --git a/ansel/map_edit.php b/ansel/map_edit.php index 4eb0b2992..3736bd3f6 100644 --- a/ansel/map_edit.php +++ b/ansel/map_edit.php @@ -14,6 +14,7 @@ require_once dirname(__FILE__) . '/lib/base.php'; Horde::addExternalScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel'); Horde::addScriptFile('googlemap.js', 'ansel'); Horde::addScriptFile('googlemap_edit.js', 'ansel'); +Horde::addScriptFile('popup.js', 'horde', true); $image_id = Horde_Util::getFormData('image'); diff --git a/ansel/templates/image/crop_image.inc b/ansel/templates/image/crop_image.inc index 35a0c9c1b..86a9e3056 100644 --- a/ansel/templates/image/crop_image.inc +++ b/ansel/templates/image/crop_image.inc @@ -107,8 +107,7 @@ if (Ansel::isAvailable('grayscale')) { echo Horde::link(Horde_Util::addParameter($imageurl, 'actionID', 'previewgrayscale')) . Horde::img('image/grayscale.png', '', '', $registry->getImageDir('horde')) . ' ' . _("Grayscale") . ' '; } if (Ansel::isAvailable('text_watermark')) { - Horde::addScriptFile('popup.js', 'horde', true); - echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageurl, array('actionID' => 'setwatermark', 'share' => $gallery->getName()))), '', '', '_blank', 'return !popup(this.href, 450, 250);') . Horde::img('text.png') . ' ' . _("Watermark") . ' '; + echo Horde::link('#', '', '', '_blank', Horde::popupJs(Horde::applicationUrl($imageurl), array('params' => array('actionID' => 'setwatermark', 'share' => $gallery->getName()), 'width' => 450, 'height' => 250, 'urlencode' => true)) . 'return false;') . Horde::img('text.png') . ' ' . _("Watermark") . ' '; } $selfUrl = Horde::selfUrl(true); echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($selfUrl, array('actionID' => 'cropedit')))) . Horde::img('image/crop.png', '', '', $registry->getImageDir('horde')) . _("Crop") . ''; diff --git a/ansel/templates/image/edit_image.inc b/ansel/templates/image/edit_image.inc index ef09a2fe2..fa0efe0ad 100644 --- a/ansel/templates/image/edit_image.inc +++ b/ansel/templates/image/edit_image.inc @@ -23,8 +23,7 @@ if (Ansel::isAvailable('grayscale')) { echo Horde::link(Horde_Util::addParameter($imageurl, 'actionID', 'previewgrayscale')) . Horde::img('image/grayscale.png', '', '', $registry->getImageDir('horde')) . ' ' . _("Grayscale") . ' '; } if (Ansel::isAvailable('TextWatermark')) { - Horde::addScriptFile('popup.js', 'horde', true); - echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageurl, array('actionID' => 'setwatermark', 'share' => $gallery->getName()))), '', '', '_blank', 'return !popup(this.href, 450, 250);') . Horde::img('text.png') . ' ' . _("Watermark") . ' '; + echo Horde::link('#', '', '', '_blank', Horde::popupJs(Horde::applicationUrl($imageurl), array('params' => array('actionID' => 'setwatermark', 'share' => $gallery->getName()), 'width' => 450, 'height' => 250, 'urlencode' => true)) . 'return false;') . Horde::img('text.png') . ' ' . _("Watermark") . ' '; } $selfUrl = Horde::selfUrl(true); diff --git a/ansel/templates/image/resize_image.inc b/ansel/templates/image/resize_image.inc index 33d47aedd..74be8b38e 100644 --- a/ansel/templates/image/resize_image.inc +++ b/ansel/templates/image/resize_image.inc @@ -54,8 +54,7 @@ if (Ansel::isAvailable('grayscale')) { echo Horde::link(Horde_Util::addParameter($imageurl, 'actionID', 'previewgrayscale')) . Horde::img('image/grayscale.png', '', '', $registry->getImageDir('horde')) . ' ' . _("Grayscale") . ' '; } if (Ansel::isAvailable('text_watermark')) { - Horde::addScriptFile('popup.js', 'horde', true); - echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageurl, array('actionID' => 'setwatermark', 'share' => $gallery->getName()))), '', '', '_blank', 'return !popup(this.href, 450, 250);') . Horde::img('text.png') . ' ' . _("Watermark") . ' '; + echo Horde::link('#', '', '', '_blank', Horde::popupJs(Horde::applicationUrl($imageurl), array('params' => array('actionID' => 'setwatermark', 'share' => $gallery->getName()), 'width' => 450, 'height' => 250, 'urlencode' => true)) . 'return false;') . Horde::img('text.png') . ' ' . _("Watermark") . ' '; } $selfUrl = Horde::selfUrl(true); diff --git a/ansel/templates/tile/image.inc b/ansel/templates/tile/image.inc index c8f305b2f..62a16bdd6 100644 --- a/ansel/templates/tile/image.inc +++ b/ansel/templates/tile/image.inc @@ -14,7 +14,7 @@ if ($option_select): ?>
    - 'modify'))), '', '', '_blank', 'popup(this.href); return false;') . _("Properties") ?> + 'modify'))), '', '', '_blank', Horde::popupJs(Horde::applicationUrl($image_url), array('params' => array('actionID' => 'modify', 'urlencode' => true))) . 'return false;') . _("Properties") ?> | diff --git a/ansel/templates/view/gallery.inc b/ansel/templates/view/gallery.inc index ee100b1d9..0edd19b18 100644 --- a/ansel/templates/view/gallery.inc +++ b/ansel/templates/view/gallery.inc @@ -82,7 +82,7 @@ function editDates() alert(''); return false; } - popup(imageDateUrl, 600, 250); + Horde.popup({ url: imageDateUrl, width: 600, height: 250 }); } function downloadSelected() diff --git a/ansel/templates/view/gallerylightbox.inc b/ansel/templates/view/gallerylightbox.inc index c3e1f933d..96f56d631 100644 --- a/ansel/templates/view/gallerylightbox.inc +++ b/ansel/templates/view/gallerylightbox.inc @@ -80,7 +80,7 @@ function editDates() alert(''); return false; } - popup(imageDateUrl, 600, 250); + Horde.popup({ url: imageDateUrl, width: 600, height: 250 }); } function downloadSelected() diff --git a/ansel/templates/view/image.inc b/ansel/templates/view/image.inc index c621c04ee..ca28593d1 100644 --- a/ansel/templates/view/image.inc +++ b/ansel/templates/view/image.inc @@ -56,7 +56,7 @@ function arrowHandler(e) $actionHTML = ''; if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT) && empty($this->_params['api'])) { $needSeperator = true; - $actionHTML .= Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, array('actionID' => 'modify', 'ret' => 'image'))), '', '', '_blank', 'popup(this.href); return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") . ''; + $actionHTML .= Horde::link('#', '', '', '_blank', Horde::popupJs(Horde::applicationUrl($imageActionUrl), array('params' => array('actionID' => 'modify', 'ret' => 'image'), 'urlencode' => true)) . 'return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") . ''; $actionHTML .= ' | ' . Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, 'actionID', 'editimage')), '', '', '', '', '', '', array('id' => 'image_edit_link')) . _("Edit") . ''; } if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE) && empty($this->_params['api'])) { diff --git a/ansel/templates/view/slideshow.inc b/ansel/templates/view/slideshow.inc index a94bff5a0..559e9ef83 100644 --- a/ansel/templates/view/slideshow.inc +++ b/ansel/templates/view/slideshow.inc @@ -14,7 +14,7 @@ function stopSlideShow() gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)): ?> - 'modify', 'share' => $this->gallery->getName(), 'ret' => 'image'))), '', '', '_blank', 'SlideController.pause();popup(this.href); return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") ?> + 'modify', 'share' => $this->gallery->getName(), 'ret' => 'image'))), '', '', '_blank', 'SlideController.pause();' . Horde::popupJs(Horde::applicationUrl($imageActionUrl), array('params' => array('actionID' => 'modify', 'share' => $this->gallery->getName(), 'ret' => 'image'), 'urlencode' => true)) . 'return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") ?> | 'image_edit_link')) . _("Edit") ?> gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)): ?> @@ -24,7 +24,7 @@ function stopSlideShow() - 'image_ecard_link')) . _("Send an Ecard") ?> | + true)) . 'return false;', '', '', array('id' => 'image_ecard_link')) . _("Send an Ecard") ?> | 'image_download_link')) . _("Download Original Photo") ?> diff --git a/ansel/view.php b/ansel/view.php index 2c6b9668d..46456baaf 100644 --- a/ansel/view.php +++ b/ansel/view.php @@ -45,7 +45,6 @@ try { $title = $view->getTitle(); $view_html = $view->html(); -Horde::addScriptFile('popup.js', 'horde', true); require ANSEL_TEMPLATES . '/common-header.inc'; require ANSEL_TEMPLATES . '/menu.inc'; echo $view_html; diff --git a/fima/accounts.php b/fima/accounts.php index 5ecad29e0..b7fc28fd4 100644 --- a/fima/accounts.php +++ b/fima/accounts.php @@ -29,7 +29,7 @@ case 'delete_all': $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')) { @@ -60,13 +60,13 @@ foreach ($types as $typeId => $typeLabel) { $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 { @@ -74,7 +74,7 @@ foreach ($accountlist as $accountId => $account) { $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; @@ -83,7 +83,6 @@ foreach ($accountlist as $accountId => $account) { /* Print. */ $print_view = (bool)Horde_Util::getFormData('print'); if (!$print_view) { - Horde::addScriptFile('popup.js', 'horde', true); $print_link = Horde::applicationUrl(Horde_Util::addParameter('accounts.php', array('print' => 1))); } diff --git a/fima/ledgers/index.php b/fima/ledgers/index.php index b8bb9e35c..ce03959e8 100644 --- a/fima/ledgers/index.php +++ b/fima/ledgers/index.php @@ -35,7 +35,6 @@ $edit_img = Horde::img('edit.png', _("Edit"), null, $registry->getImageDir('hord $perms_img = Horde::img('perms.png', _("Change Permissions"), null, $registry->getImageDir('horde')); $delete_img = Horde::img('delete.png', _("Delete"), null, $registry->getImageDir('horde')); -Horde::addScriptFile('popup.js', 'horde', true); Horde::addScriptFile('tables.js', 'turba', true); $title = _("Manage Ledgers"); require FIMA_TEMPLATES . '/common-header.inc'; diff --git a/fima/lib/Fima.php b/fima/lib/Fima.php index 196e37a3c..421389d7e 100644 --- a/fima/lib/Fima.php +++ b/fima/lib/Fima.php @@ -70,7 +70,7 @@ class Fima { return $accounts; } - + function getAccount($account) { $ledger = Fima::getActiveLedger(); @@ -102,7 +102,7 @@ class Fima { /* Create a Fima storage instance. */ $storage = &Fima_Driver::singleton($ledger); - $storage->retrievePostings($filters, + $storage->retrievePostings($filters, array('posting_' . $prefs->getValue('sortby') . ' ' . ($prefs->getValue('sortdir') ? 'DESC' : 'ASC'), 'posting_' . $prefs->getValue('altsortby')), $limit); @@ -124,13 +124,13 @@ class Fima { function getPostingsCount() { $ledger = Fima::getActiveLedger(); - + /* Create a Fima storage instance. */ $storage = &Fima_Driver::singleton($ledger); return $storage->_postingsCount; } - - + + /** * Get grouped results from storage. * @@ -143,7 +143,7 @@ class Fima { */ function getResults($groups = array(), $filters = array()) { $ledger = Fima::getActiveLedger(); - + /* Create a Fima storage instance. */ $storage = &Fima_Driver::singleton($ledger); return $storage->getResults($groups, $filters); @@ -160,7 +160,7 @@ class Fima { function getAssetResults($postingtype, $perdate = null) { $ledger = Fima::getActiveLedger(); - + /* Create a Fima storage instance. */ $storage = &Fima_Driver::singleton($ledger); return $storage->getAssetResults($postingtype, $perdate); @@ -174,7 +174,7 @@ class Fima { function getPostingsResult() { $ledger = Fima::getActiveLedger(); - + /* Create a Fima storage instance. */ $storage = &Fima_Driver::singleton($ledger); return $storage->_postingsResult; @@ -250,7 +250,7 @@ class Fima { function buildAccountWidget($name, $value = '', $params = null, $blank = false, $multiple = false, $filters = array(), $hideclosed = false) { $accounts = Fima::listAccounts($filters); - + $html = '\n"; } @@ -306,7 +306,7 @@ class Fima { if ($blank !== false) { $html .= ''; } - + foreach ($types as $typeValue => $typeLabel) { $html .= ''; } - + foreach ($types as $typeValue => $typeLabel) { $html .= '