Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion inc/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@
// Force recompilation of smarty templates?
$conf['smartycompile'] = 0;


// load clipboard flash widget from this URL:
$conf['clippyurl'] = 'http://github.com/mojombo/clippy/raw/master/build/clippy.swf';
8 changes: 8 additions & 0 deletions inc/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
$FIELDS['_marker'] = 'marker'; // aka. tags
$FIELDS['country'] = 'c';

/**
* Mozilla uses a more elaborate schema
*/
$OCLASSES[] = 'mozillaAbPersonAlpha';
$FIELDS['homestreet'] = 'mozillaHomeStreet';
$FIELDS['homelocation'] = 'mozillaHomeLocalityName';
$FIELDS['homezip'] = 'mozillaHomePostalCode';

/**
* If the open exchange schema is used the following fields
* and object classes are added
Expand Down
4 changes: 4 additions & 0 deletions inc/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@ function remove_magic_quotes(&$array) {
// select the correct google api key
$conf['gmapkey'] = $conf['gmaps'][$_SERVER['HTTP_HOST']];

$user = null;
if (isset($_SESSION['ldapab']['username'])) {
$user = $_SESSION['ldapab']['username'];
}
?>
5 changes: 4 additions & 1 deletion inc/lang/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
$lang['mobile'] = 'Handy';
$lang['pager'] = 'Pieper';
$lang['homephone'] = 'Telefon (priv.)';
$lang['homestreet'] = 'Adresse (priv.)';
$lang['homestreet'] = 'Straße (priv.)';
$lang['homezip'] = 'Postleitzahl (priv.)';
$lang['homelocation'] = 'Stadt (priv.)';
$lang['photo'] = 'Foto';
$lang['url'] = 'Webseite';
$lang['note'] = 'Notizen';
Expand Down Expand Up @@ -51,6 +53,7 @@
$lang['copy'] = 'Kopieren';
$lang['map'] = 'Karte';
$lang['csvexport'] = 'CSV';
$lang['printexport'] = 'Drucken';
$lang['vcfexport'] = 'VCard';
$lang['vcfimport'] = 'Import';
$lang['search'] = 'Suchen';
Expand Down
5 changes: 4 additions & 1 deletion inc/lang/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
$lang['mobile'] = 'Mobile';
$lang['pager'] = 'Pager';
$lang['homephone'] = 'Phone (priv.)';
$lang['homestreet'] = 'Address (priv.)';
$lang['homestreet'] = 'Street (priv.)';
$lang['homezip'] = 'Postal Code (priv.)';
$lang['homelocation'] = 'City (priv.)';
$lang['photo'] = 'Picture';
$lang['url'] = 'Website';
$lang['note'] = 'Notes';
Expand Down Expand Up @@ -51,6 +53,7 @@
$lang['copy'] = 'Copy';
$lang['map'] = 'Map';
$lang['csvexport'] = 'CSV';
$lang['printexport'] = 'Print';
$lang['vcfexport'] = 'VCard';
$lang['vcfimport'] = 'Import';
$lang['search'] = 'Search';
Expand Down
27 changes: 17 additions & 10 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
$entrytpl = 'list_csv_entry.tpl';
}elseif(!empty($_REQUEST['export']) && $_REQUEST['export'] == 'map'){
$entrytpl = 'list_map_entry.tpl';
}elseif(!empty($_REQUEST['export']) && $_REQUEST['export'] == 'print'){
$entrytpl = 'list_print_entry.tpl';
}else{
$entrytpl = 'list_entry.tpl';
}
Expand All @@ -22,6 +24,16 @@
// fetch results
$result = ldap_queryabooks($ldapfilter,$fields);

//prepare templates
tpl_std();
if (empty($_REQUEST['filter'])) $_REQUEST['filter']='';
if (empty($_REQUEST['marker'])) $_REQUEST['marker']='';
if (empty($_REQUEST['search'])) $_REQUEST['search']='';
$smarty->assign('filter',$_REQUEST['filter']);
$smarty->assign('marker',$_REQUEST['marker']);
$smarty->assign('search',$_REQUEST['search']);
$smarty->assign('org',$_REQUEST['org']);

$list = '';
if(count($result)==1 && $_REQUEST['search']){
//only one result on a search -> display page
Expand All @@ -35,17 +47,8 @@
$list .= $smarty->fetch($entrytpl);
}
}

//prepare templates
tpl_std();
if (empty($_REQUEST['filter'])) $_REQUEST['filter']='';
if (empty($_REQUEST['marker'])) $_REQUEST['marker']='';
if (empty($_REQUEST['search'])) $_REQUEST['search']='';
$smarty->assign('list',$list);
$smarty->assign('filter',$_REQUEST['filter']);
$smarty->assign('marker',$_REQUEST['marker']);
$smarty->assign('search',$_REQUEST['search']);
$smarty->assign('org',$_REQUEST['org']);

//display templates
if(!empty($_REQUEST['export'])){
if ($conf['userlogreq'] && $user == ''){
Expand All @@ -63,6 +66,10 @@
header('Content-Type: text/html; charset=utf-8');
$smarty->display('list_map.tpl');
exit;
}elseif($_REQUEST['export'] == 'print'){
header('Content-Type: text/html; charset=utf-8');
$smarty->display('list_print.tpl');
exit;
}
}else{
//save location in session
Expand Down
10 changes: 6 additions & 4 deletions scripts/maps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

var gmap_data = Array();
var gmap_centered = false;
var gmap_bounds = new GLatLngBounds();

function gmap_loader(){
if (!GBrowserIsCompatible()) {
Expand Down Expand Up @@ -29,10 +30,11 @@ function gmap_add(map,gc,adr,info,t){
if (!point) {
//alert(address + " not found");
} else {
if(!gmap_centered){
map.setCenter(point, 5);
gmap_centered = true;
}
gmap_bounds.extend(point);
var zoom = map.getBoundsZoomLevel(gmap_bounds);
if (zoom > 17) zoom = 17;
map.setCenter(gmap_bounds.getCenter(), zoom);

var marker = new GMarker(point);
map.addOverlay(marker);
GEvent.addListener(marker, "click", function(){
Expand Down
5 changes: 5 additions & 0 deletions styles/design.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ a.ed_csvexport {
padding: 1px 0px 1px 16px;
}

a.ed_printexport {
background: transparent url(../pix/page_white_excel.png) 0px 1px no-repeat;
padding: 1px 0px 1px 16px;
}

a.ed_vcfimport {
background: transparent url(../pix/page_in.png) 0px 1px no-repeat;
padding: 1px 0px 1px 16px;
Expand Down
5 changes: 5 additions & 0 deletions styles/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,8 @@ div#footrow {
div#footrow div.login{
float: right;
}

/* print export */
div.print h2 {
border-bottom: 1px solid #999;
}
13 changes: 13 additions & 0 deletions templates/entry_edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,19 @@
<td><textarea name="entry[homestreet]" class="input" rows="2" cols="30">{$entry.homestreet|h}</textarea></td>
</tr>
{/if}
{if $fields.homezip}
<tr>
<th>{$lang.homezip}:</th>
<td><input type="text" class="input ac" name="entry[homezip]" value="{$entry.homezip|h}" /></td>
</tr>
{/if}
{if $fields.homelocation}
<tr>
<th>{$lang.homelocation}:</th>
<td><textarea name="entry[homelocation]" class="input" rows="2" cols="30">{$entry.homelocation|h}</textarea></td>
</tr>
{/if}

{if $fields.homephone}
<tr>
<th>{$lang.homephone}:</th>
Expand Down
20 changes: 20 additions & 0 deletions templates/entry_print.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>ConTagged - {$lang.ldapab}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" type="text/css" href="styles/layout.css" />
<link rel="stylesheet" type="text/css" href="styles/design.css" />
<link rel="stylesheet" type="text/css" href="styles/scripted.css" />

</head>
<body>
<div id="content" class="print">
{if $conf.userlogreq == 0 || $user != ''}
{include file="list_print_entry.tpl"}
{/if}
</div>
</body>
</html>
44 changes: 44 additions & 0 deletions templates/entry_show.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@
<tr>
<td valign="top" width="50%">
<h3>{$lang.business}</h3>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
width="110"
height="14"
id="clippy" >
<embed src="{$conf.clippyurl}"
width="110"
height="14"
name="clippy"
quality="high"
allowScriptAccess="always"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="text={$entry.title} {$entry.givenname} {$entry.name}
{$entry.organization}
{$entry.street}
{$entry.zip} {$entry.location}
{$entry.state}
"
/>
</object>
<table width="100%">
<tr>
<td colspan="2">
Expand Down Expand Up @@ -94,13 +114,37 @@

<td valign="top" width="50%">
<h3>{$lang.private}</h3>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
width="110"
height="14"
id="clippy_home" >
<embed src="{$conf.clippyurl}"
width="110"
height="14"
name="clippy_home"
quality="high"
allowScriptAccess="always"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="text={$entry.title} {$entry.givenname} {$entry.name}
{$entry.homestreet}
{$entry.homezip} {$entry.homelocation}
{$entry.homestate}
"
/>
</object>

<table width="100%">
<tr>
<td colspan="2">
{$entry.title|h} {$entry.givenname|h} {$entry.name|h}<br />
{if $entry.homestreet}
{$entry.homestreet|h|nl2br}<br /><br />
{/if}
{if $entry.homelocation}
{$entry.homezip|h} {$entry.homelocation|h|nl2br}<br /><br />
{/if}

</td>
</tr>
{if $entry.homephone}
Expand Down
2 changes: 1 addition & 1 deletion templates/list_csv.tpl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{$lang.name|csv};{$lang.givenname|csv};{$lang.title|csv};{$lang.organization|csv};{$lang.office|csv};{$lang.street|csv};{$lang.zip|csv};{$lang.location|csv};{$lang.country|csv};{$lang.phone|csv};{$lang.fax|csv};{$lang.pager|csv};{$lang.homestreet|csv};{$lang.homephone|csv};{$lang.mobile|csv};{$lang.url|csv};{$lang.note|csv};{$lang.mail|csv};{$lang.mail|csv};{$lang.mail|csv};{$lang.marker|csv}
{$lang.name|csv};{$lang.givenname|csv};{$lang.title|csv};{$lang.organization|csv};{$lang.office|csv};{$lang.street|csv};{$lang.zip|csv};{$lang.location|csv};{$lang.country|csv};{$lang.phone|csv};{$lang.fax|csv};{$lang.pager|csv};{$lang.homestreet|csv};{$lang.homezip|csv};{$lang.homelocation|csv};{$lang.homephone|csv};{$lang.mobile|csv};{$lang.url|csv};{$lang.note|csv};{$lang.mail|csv};{$lang.mail|csv};{$lang.mail|csv};{$lang.marker|csv}
{$list}
2 changes: 1 addition & 1 deletion templates/list_csv_entry.tpl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{$entry.name|csv};{$entry.givenname|csv};{$entry.title|csv};{$entry.organization|csv};{$entry.office|csv};{$entry.street|csv};{$entry.zip|csv};{$entry.location|csv};{$entry.country|csv};{$entry.phone|csv};{$entry.fax|csv};{$entry.pager|csv};{$entry.homestreet|csv};{$entry.homephone|csv};{$entry.mobile|csv};{$lang.url|csv};{$entry.note|csv};{$entry.mail[0]|csv};{$entry.mail[1]|csv};{$entry.mail[2]|csv};{$entry.markers|csv}
{$entry.name|csv};{$entry.givenname|csv};{$entry.title|csv};{$entry.organization|csv};{$entry.office|csv};{$entry.street|csv};{$entry.zip|csv};{$entry.location|csv};{$entry.country|csv};{$entry.phone|csv};{$entry.fax|csv};{$entry.pager|csv};{$entry.homestreet|csv};{$entry.homezip|csv};{$entry.homelocation|csv};{$entry.homephone|csv};{$entry.mobile|csv};{$lang.url|csv};{$entry.note|csv};{$entry.mail[0]|csv};{$entry.mail[1]|csv};{$entry.mail[2]|csv};{$entry.markers|csv}

21 changes: 21 additions & 0 deletions templates/list_print.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>ConTagged - {$lang.ldapab}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" type="text/css" href="styles/layout.css" />
<link rel="stylesheet" type="text/css" href="styles/design.css" />
<link rel="stylesheet" type="text/css" href="styles/scripted.css" />

</head>
<body>
<div id="content" class="print">
{if $conf.userlogreq == 0 || $user != ''}
{* $list is a concatenation of multiple list_print_entry.tpl *}
{$list}
{/if}
</div>
</body>
</html>
Loading