diff options
| -rwxr-xr-x | display_contact.php | 2 | ||||
| -rwxr-xr-x | index.php | 2 | ||||
| -rwxr-xr-x | list.php | 49 | ||||
| -rwxr-xr-x | list_contacts.php | 36 | ||||
| -rwxr-xr-x | load_emails.php | 2 | ||||
| -rwxr-xr-x | templates/admin_xref_types.tpl | 2 | ||||
| -rwxr-xr-x | templates/list.tpl | 5 | ||||
| -rwxr-xr-x | templates/menu_contact.tpl | 2 |
8 files changed, 24 insertions, 76 deletions
diff --git a/display_contact.php b/display_contact.php index 48e6a0b..c9cd179 100755 --- a/display_contact.php +++ b/display_contact.php @@ -33,7 +33,7 @@ $gBitSmarty->assign( 'galleryId', $gGallery->mGalleryId ); $gBitSmarty->assign( 'galLayout', 'fixed_grid' ); if (!$gContent->isValid()) { - header( "location: " . CONTACT_PKG_URL . "list.php" ); + header( "location: " . CONTACT_PKG_URL . "list_contacts.php" ); die; } @@ -21,7 +21,7 @@ $gBitSystem->verifyPermission( 'p_contact_view' ); include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php'; if (!$gContent->mContentId) { - header( "location: " . CONTACT_PKG_URL . "list.php" ); + header( "location: " . CONTACT_PKG_URL . "list_contacts.php" ); die; } @@ -1,55 +1,10 @@ <?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/includes/setup_inc.php'; -use Bitweaver\Contact\Contact; -use Bitweaver\KernelTools; - -$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 ){ - KernelTools::bit_redirect( CONTACT_PKG_URL."display_contact.php?content_id=".$listcontacts[0]['content_id'] ); -} - -$gBitSmarty->assign( 'listcontacts', $listcontacts ); -$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] ); - -$gBitSystem->setBrowserTitle("View Contacts List"); -// Display the template -$gBitSystem->display( 'bitpackage:contact/list.tpl', NULL, [ 'display_mode' => 'list' ]); +header( 'Location: ' . CONTACT_PKG_URL . 'list_contacts.php?' . http_build_query( $_GET ) ); +die; diff --git a/list_contacts.php b/list_contacts.php index 833638b..9aa8ca9 100755 --- a/list_contacts.php +++ b/list_contacts.php @@ -1,37 +1,29 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_contact/list_contacts.php,v 1.4 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/includes/setup_inc.php'; + use Bitweaver\Contact\Contact; +use Bitweaver\KernelTools; -$gBitSystem->isPackageActive('contact', TRUE); +$gBitSystem->verifyPackage( 'contact' ); +$gBitSystem->verifyPermission( 'p_contact_view' ); -// Now check permissions to access this page -$gBitSystem->verifyPermission('p_read_contact'); +$gContent = new Contact(); +$gContent->invokeServices( 'content_list_function', $_REQUEST ); -$contacts = new Contact(); +$listHash = $_REQUEST; +$listcontacts = $gContent->getList( $listHash ); -if ( empty( $_REQUEST["sort_mode"] ) ) { - $sort_mode = 'organisation_asc'; +if( $listHash['listInfo']['count'] == 1 ) { + KernelTools::bit_redirect( CONTACT_PKG_URL."display_contact.php?content_id=".$listcontacts[0]['content_id'] ); } -// Get a list of Contacts -$contacts->getList( $_REQUEST ); - -$smarty->assign('listInfo', $_REQUEST['listInfo']); -$smarty->assign('list', $contacts); +$gBitSmarty->assign( 'listcontacts', $listcontacts ); +$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] ); -// Display the template -$gBitSystem->display( 'bitpackage:contact/list_contacts.tpl', NULL, [ 'display_mode' => 'list' ]); +$gBitSystem->setBrowserTitle( "View Contacts List" ); +$gBitSystem->display( 'bitpackage:contact/list.tpl', NULL, [ 'display_mode' => 'list' ] ); diff --git a/load_emails.php b/load_emails.php index b421f55..e9e146a 100755 --- a/load_emails.php +++ b/load_emails.php @@ -24,7 +24,7 @@ $gBitSystem->verifyPermission( 'p_contact_update' ); include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php'; if (!$gContent->mContentId) { - header( "location: " . CONTACT_PKG_URL . "list.php" ); + header( "location: " . CONTACT_PKG_URL . "list_contacts.php" ); die; } diff --git a/templates/admin_xref_types.tpl b/templates/admin_xref_types.tpl index 41eb9c1..7b6b792 100755 --- a/templates/admin_xref_types.tpl +++ b/templates/admin_xref_types.tpl @@ -57,7 +57,7 @@ <td> <h3> - <a href="{$smarty.const.CONTACT_PKG_URL}list.php?source={$xref_types[type].source}">{$xref_types[type].cross_ref_title}</a> + <a href="{$smarty.const.CONTACT_PKG_URL}list_contacts.php?source={$xref_types[type].source}">{$xref_types[type].cross_ref_title}</a> <small>[ {$xref_types[type].num_entries} ]</small> </h3> diff --git a/templates/list.tpl b/templates/list.tpl index fed9c8a..e6cdcc3 100755 --- a/templates/list.tpl +++ b/templates/list.tpl @@ -18,7 +18,8 @@ <th>{smartlink ititle="Address" isort="street" ihash=$listInfo.ihash|default:''}</th> </tr> {section name=content loop=$listcontacts} - <tr class="first"> + {if $smarty.section.content.rownum % 2 != 0}{assign var=rowclass value="odd"}{else}{assign var=rowclass value="even"}{/if} + <tr class="first {$rowclass}"> <td class="alignleft"> <a href="display_contact.php?content_id={$listcontacts[content].content_id}" title="ci_{$listcontacts[content].content_id}"> {$listcontacts[content].title} @@ -38,7 +39,7 @@ {$listcontacts[content].town}, {/if} {$listcontacts[content].postcode}</td> </tr> - <tr class="second"> + <tr class="second {$rowclass}"> <td>{$item.display_link|default:'Not Set'}</td> <td>{assign var=content_type_guid value=$item.content_type_guid|default:'bitpage'}{$gLibertySystem->getContentTypeName($content_type_guid|default:'bitpage')}</td> <td> diff --git a/templates/menu_contact.tpl b/templates/menu_contact.tpl index 0f362ba..646e72a 100755 --- a/templates/menu_contact.tpl +++ b/templates/menu_contact.tpl @@ -1,7 +1,7 @@ {strip} {if $packageMenuTitle}<a class="dropdown-toggle" data-toggle="dropdown" href="#"> {tr}{$packageMenuTitle}{/tr} <b class="caret"></b></a>{/if} <ul class="{$packageMenuClass}"> - <li><a class="item" href="{$smarty.const.CONTACT_PKG_URL}list.php">{booticon ipackage="icons" iname="icon-telephone" iexplain="List contacts" ilocation=menu}</a></li> + <li><a class="item" href="{$smarty.const.CONTACT_PKG_URL}list_contacts.php">{booticon ipackage="icons" iname="icon-telephone" iexplain="List contacts" ilocation=menu}</a></li> {if $gBitUser->isAdmin() || $gBitUser->hasPermission( 'p_contact_edit' ) } <li><a class="item" href="{$smarty.const.CONTACT_PKG_URL}add_person.php">{booticon ipackage="icons" iname="icon-telephone-edit" iexplain="Add Person" ilocation=menu}</a></li> <li><a class="item" href="{$smarty.const.CONTACT_PKG_URL}add_business.php">{booticon ipackage="icons" iname="icon-telephone-edit" iexplain="Add Business" ilocation=menu}</a></li> |
