[sork] Vacation Portal Block
Chris
cjdl01 at brokensolstice.com
Wed Sep 22 00:01:48 UTC 2010
> http://git.horde.org/diff.php/vacation/lib/Block/summary.php?rt=horde&r1=1.7.2.2&r2=1.7.2.3&ty=u
>
> Jan.
Hi Jan,
Thanks for the above, but it didn't seem to work 100%. I applied it
using "patch -P0 <summary.patch". It said it failed on one hunk, but
the function part seemed to take. (I assume the first hunk failed
because a difference in dates, my summary.php was did not say
"2008/10/09", instead it said "2009/01/29").
After patching, the portal block worked, so long as I did not have
vacation mode enabled. As soon as I turned on vacation mode,
Everything on the horde portal went away, and all that was visible was
this error:
Fatal error: Class 'MIME' not found in
/var/www/horde/vacation/lib/Driver.php on line 311
I disable vacation mode, and the block works normally again.
Here is my summary.php after patching:
--------------------------------------------
$block_name = _("Vacation Summary");
/**
* $Horde: vacation/lib/Block/summary.php,v 1.7.2.2 2009/01/29
11:57:31 jan Exp $
*
* @package Horde_Block
*/
class Horde_Block_Vacation_summary extends Horde_Block {
var $_app = 'vacation';
function _title()
{
return
Horde::link(Horde::applicationUrl($GLOBALS['registry']->getInitialPage(),
true))
. $GLOBALS['registry']->get('name') . '</a>';
}
function _content()
{
require_once dirname(__FILE__) . '/../base.php';
require_once VACATION_BASE . '/lib/Driver.php';
// Create the driver.
$driver = Vacation_Driver::factory(Auth::getAuth());
// Find out if vacation is active.
if (!$driver) {
return '<p><em>' . _("Failed to create a vacation
driver") . '</em></p>';
}
return '<p><strong>' .
(!$driver->isEnabled(Auth::getCredential('password')) ?
_("Vacation is not active.") :
_("Vacation is active.")) . '</strong></p>';
}
}
---------------------------------------------------
Thanks so much for the help!
-Chris
More information about the sork
mailing list