diff options
| author | "Lester Caine ext:(%22) <lester@lsces.co.uk> | 2010-11-03 09:46:53 +0000 |
|---|---|---|
| committer | "Lester Caine ext:(%22) <lester@lsces.co.uk> | 2010-11-03 09:46:53 +0000 |
| commit | 3261da3afcc151ebc1ddd77b1055d5bde3c70b7f (patch) | |
| tree | a582efa13411b27c7a3a041a38d8afe6d42d26ff /list.php | |
| download | contact-3261da3afcc151ebc1ddd77b1055d5bde3c70b7f.tar.gz contact-3261da3afcc151ebc1ddd77b1055d5bde3c70b7f.tar.bz2 contact-3261da3afcc151ebc1ddd77b1055d5bde3c70b7f.zip | |
Import package again after stripping private data which should not have been commited
Diffstat (limited to 'list.php')
| -rw-r--r-- | list.php | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/list.php b/list.php new file mode 100644 index 0000000..ee0d684 --- /dev/null +++ b/list.php @@ -0,0 +1,57 @@ +<?php +/** + * @version $Header: /cvsroot/bitweaver/_bit_contact/list.php,v 1.5 2010/02/08 21:27:22 wjames5 Exp $ + * + * Copyright (c) 2006 bitweaver.org + * All Rights Reserved. See below for details and a complete list of authors. + * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details + * + * @package contact + * @subpackage functions + */ + +/** + * required setup + */ +require_once( '../kernel/setup_inc.php' ); + +include_once( CONTACT_PKG_PATH.'Contact.php' ); + +$gBitSystem->verifyPackage( 'contact' ); +$gBitSystem->verifyPermission( 'p_contact_view' ); + +$gContent = new Contact( ); +$gContent->invokeServices( 'content_list_function', $_REQUEST ); + +// Handle the request hash storing into the session. +$gContent->mTypes->processRequestHash($_REQUEST, $_SESSION['contact']); + +$listHash = $_REQUEST; +// Setup which contact types we want to view. +$contactTypes = $gContent->getContactTypes(); +if( $gBitUser->hasPermission("p_contact_view_changes") && $_SESSION['contact']['contact_type_guid'] ) { + $listHash['contact_type_guid'] = $_SESSION['contact']['contact_type_guid']; +} else { + foreach ($contactTypes as $key => $val) { + if ($gBitSystem->isFeatureActive('contact_default_'.$key)) { + $listHash['contact_type_guid'][] = $key; + } + } +} +// Get a list of matching contact entries +$listcontacts = $gContent->getList( $listHash ); + + +if ( $listHash['listInfo']['count'] == 1 ){ + header ("location: ".CONTACT_PKG_URL."display_contact.php?content_id=".$listcontacts[0]['content_id'] ); + die; +} + +$gBitSmarty->assign_by_ref( 'listcontacts', $listcontacts ); +$gBitSmarty->assign_by_ref( 'listInfo', $listHash['listInfo'] ); + +$gBitSystem->setBrowserTitle("View Contacts List"); +// Display the template +$gBitSystem->display( 'bitpackage:contact/list.tpl', NULL, array( 'display_mode' => 'list' )); + +?> |
