summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2016-02-07 17:06:26 +0000
committerlsces <lester@lsces.co.uk>2016-02-07 17:06:26 +0000
commit69b08377a8a2d3791b21d96720657d93beda2af0 (patch)
tree924935419d8b9b5fb982ef1aa82b09882204e4d1
parent6da4dfeaa2dba4fbb74dedf5b8577c9095659b61 (diff)
downloadcontact-69b08377a8a2d3791b21d96720657d93beda2af0.tar.gz
contact-69b08377a8a2d3791b21d96720657d93beda2af0.tar.bz2
contact-69b08377a8a2d3791b21d96720657d93beda2af0.zip
Second contact list style
This may need same treatment as fisheye gallery selection
-rw-r--r--list1.php56
-rw-r--r--templates/display_list_header1.tpl21
-rw-r--r--templates/list1.tpl76
3 files changed, 153 insertions, 0 deletions
diff --git a/list1.php b/list1.php
new file mode 100644
index 0000000..a818cd9
--- /dev/null
+++ b/list1.php
@@ -0,0 +1,56 @@
+<?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 ){
+ bit_redirect( CONTACT_PKG_URL."display_contact.php?content_id=".$listcontacts[0]['content_id'] );
+}
+
+$gBitSmarty->assignByRef( 'listcontacts', $listcontacts );
+$gBitSmarty->assignByRef( 'listInfo', $listHash['listInfo'] );
+
+$gBitSystem->setBrowserTitle("View Contacts List");
+// Display the template
+$gBitSystem->display( 'bitpackage:contact/list1.tpl', NULL, array( 'display_mode' => 'list' ));
+
+?>
diff --git a/templates/display_list_header1.tpl b/templates/display_list_header1.tpl
new file mode 100644
index 0000000..f2ed2b0
--- /dev/null
+++ b/templates/display_list_header1.tpl
@@ -0,0 +1,21 @@
+ <div class="navbar">
+ {form class="find" legend="Find in Contact entries" id="data_options"}
+ {foreach from=$hidden item=value key=name}
+ <input type="hidden" name="{$name}" value="{$value}" />
+ {/foreach}
+ <input type="hidden" name="sort_mode" value="{$sort_mode|default:$smarty.request.sort_mode}" />
+
+ {include file="bitpackage:contact/contact_options_inc.tpl"}
+ <input type="submit" name="refresh" value="{tr}Update Contact Filter{/tr}" />&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <label class="col-md-1 col-sm-3 col-xs-12">{tr}Key{/tr}:&nbsp;<input size="4" type="text" name="find_key" value="{$find_key|default:$smarty.request.find_key|escape}" /></label>
+ <label class="col-md-3 col-sm-3 col-xs-12">{tr}Title{/tr}:&nbsp;<input size="20" type="text" name="find_title" value="{$find_title|default:$smarty.request.find_title|escape}" /></label>
+ <label class="col-md-3 col-sm-3 col-xs-12">{tr}Location{/tr}:&nbsp;<input size="20" type="text" name="find_location" value="{$find_location|default:$smarty.request.find_location|escape}" /></label>
+ <label class="col-md-2 col-sm-3 col-xs-12">{tr}Postcode{/tr}:&nbsp;<input size="10" type="text" name="find_postcode" value="{$find_postcode|default:$smarty.request.find_postcode|escape}" /></label>
+ <label class="col-md-2 col-sm-3 col-xs-12">{tr}Number{/tr}:&nbsp;<input size="10" type="text" name="find_xref" value="{$find_xref|default:$smarty.request.find_xref|escape}" /></label>
+ <div class="col-md-1 col-sm-3 col-xs-12">
+ <input type="submit" name="search" value="{tr}Find{/tr}" />&nbsp;
+ <input type="button" onclick="location.href='{$smarty.server.PHP_SELF}{if $hidden}?{/if}{foreach from=$hidden item=value key=name}{$name}={$value}&amp;{/foreach}'" value="{tr}Reset{/tr}" />
+ </div>
+ {/form}
+ </div> \ No newline at end of file
diff --git a/templates/list1.tpl b/templates/list1.tpl
new file mode 100644
index 0000000..b9d08c4
--- /dev/null
+++ b/templates/list1.tpl
@@ -0,0 +1,76 @@
+{strip}
+
+<div class="floaticon">{bithelp}</div>
+
+<div class="listing contacts">
+ <div class="header">
+ <h1>{tr}Contacts{/tr}</h1>
+ </div>
+
+ <div class="body">
+
+ {include file="bitpackage:contact/display_list_header1.tpl"}
+ <div class="table-responsive">
+ <table class="col-xs-12">
+ <caption>{tr}Available Content{/tr} <span class="total">[ {$listInfo.total_records} ]</span></caption>
+ <tr>
+ <th class="width2p">{booticon ipackage="icons" iname="icon-link" iexplain="sort by"}</th>
+ <th>{smartlink ititle="Contract" isort="xkey" ihash=$listInfo.ihash}</th>
+ {* {if $gBitUser->hasPermission( 'p_liberty_view_all_status' )}
+ <th>{smartlink ititle="Forename" isort="forename" ihash=$listInfo.ihash}</th>
+ <th>{smartlink ititle="Surname" isort="surname" ihash=$listInfo.ihash}</th>
+ {/if} *}
+ <th>{smartlink ititle="Title" isort="title" idefault=1 iorder=desc ihash=$listInfo.ihash}</th>
+ <th>{smartlink ititle="Address" isort="street" ihash=$listInfo.ihash}</th>
+ </tr>
+ {section name=content loop=$listcontacts}
+ <tr class="first">
+ <td class="alignright">
+ <a href="display_contact.php?content_id={$listcontacts[content].content_id}" title="ci_{$listcontacts[content].content_id}">
+ {$listcontacts[content].xkey}
+ </a>
+ </td>
+ <td class="alignleft">
+ <a href="display_contact.php?content_id={$listcontacts[content].content_id}" title="ci_{$listcontacts[content].content_id}">
+ {$listcontacts[content].title}
+ </a>
+ </td>
+ <td>{if isset($listcontacts[content].house) && ($listcontacts[content].house <> '') }
+ {$listcontacts[content].house},&nbsp;{/if}
+ {if isset($listcontacts[content].add1) && ($listcontacts[content].add1 <> '') }
+ {$listcontacts[content].add1},&nbsp;{/if}
+ {if isset($listcontacts[content].add2) && ($listcontacts[content].add2 <> '') }
+ {$listcontacts[content].add2},&nbsp;{/if}
+ {if isset($listcontacts[content].add3) && ($listcontacts[content].add3 <> '') }
+ {$listcontacts[content].add3},&nbsp;{/if}
+ {if isset($listcontacts[content].add4) && ($listcontacts[content].add4 <> '') }
+ {$listcontacts[content].add4},&nbsp;{/if}
+ {if isset($listcontacts[content].town) && ($listcontacts[content].town <> '') }
+ {$listcontacts[content].town},&nbsp;{/if}
+ {$listcontacts[content].postcode}</td>
+ </tr>
+ <tr class="second">
+ <td>{$item.display_link}</td>
+ <td>{assign var=content_type_guid value=$item.content_type_guid}{$gLibertySystem->getContentTypeName($content_type_guid)}</td>
+ <td>
+ {tr}Refs{/tr}: {$listcontacts[content].refs|default:0}&nbsp;&nbsp;
+ {tr}Tasks{/tr}: {$listcontacts[content].tasks|default:0}&nbsp;&nbsp;
+ {tr}Addresses{/tr}: {$listcontacts[content].addresses|default:0}
+ </td>
+ {if $gBitUser->hasPermission( 'p_liberty_view_all_status' )}
+ <td>{if isset($listcontacts[content].dob) && ($listcontacts[content].dob <> '') }DOB: {$listcontacts[content].dob}{/if}</td>
+ <td>{if isset($listcontacts[content].nino) && ($listcontacts[content].nino <> '') }NI: {$listcontacts[content].nino}{/if}</td>
+ {/if}
+ </tr>
+ {sectionelse}
+ <tr class="norecords">
+ <td colspan="8">{tr}No records found{/tr}</td>
+ </tr>
+ {/section}
+ </table>
+ </div>
+ {pagination}
+ </div><!-- end .body -->
+</div><!-- end .contacts -->
+
+{/strip}