{5} Assigned, Active Tickets by Owner (Full Description) (5 matches)

List tickets assigned, group by ticket owner. This report demonstrates the use of full-row display.

argh@… (2 matches)

Ticket Summary Component Milestone Type Severity Created
Description
#71 GetFromUrl: extract only part of the page Components defect normal 09/04/04

It would be good, if you could specify whether only the body of the page should be fetched. Furthemore specifying a regexp might be a nice feature.


#119 More flexible NavFromSitemap component Components enhancement normal 04/04/05

Playing around with patPortal to use it for a simple page layout, I've found NavFromSitemap? a bit inflexible and done a ExtNavFromSitemap? component. Differences are:

  • added a parameter 'templateName' so that the component can be used more than once per page (I ran into "template already exists" like errors here)
  • added a parameter 'recurse' (defaults to true) to enable the user to switch off recursive/treelike building
  • added a parameter 'bubbleActive' (defaults to false) so that in a path.subPath.subSubPath path and subPath will also be "active" when the current page is subSubPath
  • added a parameter 'path' that enables the user to render a subtree of the entire sitemap.

This way, I can use the same component for displaying a (e.g.) horizontal menu that only shows the topmost level of the sitemap hierarchie and a vertical menu that shows a second level portion of the sitemap.

class patPortal_Component_ExtNavFromSitemap extends patPortal_Component {

public function render( $area, patPortal_Request $request, patPortal_Response

$response )

{

$name = (isset($this->paramstemplateName?) ? $this->paramstemplateName?

: 'NavFromSitemap?');

if (isset($this->paramspath?)) {

$pages = $this->sitemap->loadPage($this->paramspath?);

} else {

$pages = $this->sitemap;

}

$this->tmpl->readTemplatesFromInput( $this->paramstemplate? );

$this->renderNavigation( $request->getPath(), $pages );

return $this->tmpl->getParsedTemplate( $name );

}

private function renderNavigation( $currentPath, $pages, $level = 0 ) {

$name = (isset($this->paramstemplateName?) ? $this->paramstemplateName?

: 'NavFromSitemap?');

$recurse = (isset($this->paramsrecurse?) ? $this->paramsrecurse? : true); $bubbleActive = (isset($this->paramsbubbleActive?) ?

$this->paramsbubbleActive? : false);

$entries = 0;

$nextLevel = $level + 1; foreach( $pages as $page ) {

++$entries;

if( $this->tmpl->exists( $name . '_Container_'.$nextLevel ) )

{

$this->tmpl->clearTemplate( $name . '_Container_'.$nextLevel, true ); $subEntries = 0;

if ($page->isInPath($currentPath)
$this->paramsautoCollapse? === false) {

if( $recurse AND $page->hasPages() ) {

$subEntries = $this->renderNavigation( $currentPath, $page, $nextLevel );

}

} if ($subEntries>0) {

$this->tmpl->setAttribute( $name . '_Container_'.$nextLevel,

'visibility', 'visible' );

} else {

$this->tmpl->setAttribute( $name . '_Container_'.$nextLevel,

'visibility', 'hidden' );

}

} the name of the template that will be used for this entry $template = $name . '_Entry_'.$level;

mark the active page $active = 'no'; if (!$bubbleActive AND $currentPath == $page->path ) {

$active = 'yes';

} elseif ($bubbleActive AND strpos($currentPath . '.', $page->path) === 0) {

$active = 'yes';

}

add needed variables to the template $this->tmpl->addVars( $template, $page->getMeta(), 'META_' ); $this->tmpl->addVar( $template, 'URI', $page->getUri() ); $this->tmpl->addVar( $template, 'PATH', $page->path ); $this->tmpl->addVar( $template, 'TITLE', $page->title ); $this->tmpl->addVar( $template, 'ACTIVE', $active );

$this->tmpl->parseTemplate( $name . '_Entry_'.$level, 'a' );

}

return $entries;

}

}

Because the parameter $path gets set via config, this makes the subtree shown independend from the current top level path. This might apply to some situations while far more typically we'd have the "second level" subtree depending on the current top level path.

+ projects

+ project1 + project2 + project3

+ presentations

+ presentation1 + presentation2 + presentation3

+ about us

with a

<component:param name="recurse" value="false" />

we'd get only the topmost nodes

+ projects + presentations + aboutus

with a

<component:param name="path" value="projects" />

the component would _always_ show the subtree

+ project1 + project2 + project3

It would make sense to invent another parameter $level or so to have the subtree selected sensitively by the current top level path:

public function render(...) {

if (isset($this->paramslevel?)) {

$level = $this->paramslevel?; $path = $request->getPath(); $path = array_slice(explode('.', $path), 0, $level); $path = implode('.', $path); $pages = $this->sitemap->loadPage($path);

} elseif (isset($this->paramspath?)) {

$pages = $this->sitemap->loadPage($this->paramspath?);

} else {

$pages = $this->sitemap;

}

}

Sorry, I haven't had the time to test this. I think, with a

<component:param name="level" value="1" />

that should load the subtree of the current top level path.

For path=projects or path=project[n], we'd get

+ project1 + project2 + project3

For path=presentations or path=presentations.presentation[n], we'd get

+ presentation1 + presentation2 + presentation3

And for path=aboutus the component would show up nothing.

PS: please correct assignments like prio, serverity etc.


schst@… (3 matches)

Ticket Summary Component Milestone Type Severity Created
Description
#117 Need error handling Framework v0.5.0 defect normal 03/31/05

There is no doubt that patPortal is still under heavy devolpement. But since there are several patPortal installations it is necessary to implement a basic error handling.

Thx in advance Bjoern


#120 Remove SessionID from URL Framework enhancement normal 04/04/05

How can I remove the SessionID from my URLs? I.e., how can I have sessions that don't rely on URL rewriting but on cookies?

PS: please correct assignments like prio, serverity etc.


#121 Make Page_Forward work with relative URIs Framework v0.5.0 enhancement normal 04/04/05

How to redirect to a relative uri?

Don't know if this is the way I'm meant to go, but I tried to integrate a Wordpress blog into a site by adding a Page_Forward to the sitemap. Something like:

Home (index.php) + Services (index.php?path=home.services) + [...] + Blog (index.php?path=home.blog -> forward to /blog/index.php)

Looking at Response_Http::forwardTo(), it's not possible to use a relative uri by doing something like

<page:forward title="Blog" uri="./blog/" relevance="100"/>

As far as I understand the design, forwardTo() would need the request as an additional parameter to be able to look at the request's base uri and prepend it to a relative forward uri.

So I tried to change the interface's protocol to:

Response_Http::forwardTo($uri, patPortal_Request $request)

But then I noticed that there's no method available in $request to determine the raw "base uri" (as I understand it), i.e. an uri like http://domain.ltd/myproject/

Instead, Request_Http::getBaseUri() returns the complete dispatcher uri like http://domain.ltd/myproject/index.php

Don't know if it's appropriate to change the Request's api. I'd find it more intuitive to have something like:

Request_HTTP::getBaseUri() {

return http://domain.ltd/myproject/

} Request_HTTP::getSelfUri() {

return http://domain.ltd/myproject/index.php

} Request_HTTP::getPathUri() {

return http://domain.ltd/myproject/index.php?__path=home

}

and in Response_HTTP::replaceUrls() replacement of tokens

PORTAL_BASE_URI PORTAL_SELF_URI PORTAL_PATH_URI

With:

Response_Http::forwardTo($uri, patPortal_Request $request) {

$this->data = $uri; $this->replaceUrls($request);

$parts = parse_url($this->data); if (!isset($partsscheme?)) {

$this->data = $request->getBaseUri() . $this->data; $parts = parse_url($this->data);

}

probably further sanitize uri ...

$this->addHeader('Location', $this->data); $this->data = null;

}

forwarding to relative urls could be done by:

<page:forward title="Blog" uri="[PORTAL_BASE_URI]/blog/" />

or alternatively by:

<page:forward title="Blog" uri="./blog/" />


For now - without screwing up any api/bc, a simple solution could be to just modify Response_Http::forwardTo() like follows:

public function forwardTo($uri) {

$parts = parse_url($uri); if (!isset($partsscheme?)) {

$uri = 'http://' . $_SERVERHTTP_HOST? .

dirname($_SERVERPHP_SELF?) . '/' . $uri;

$parts = parse_url($uri);

} build internal URIs /* switch ($partsscheme?) {

default:

break;

} */ $this->addHeader('Location', $uri); $this->data = null;

}


Note: See TracReports for help on using and creating reports.