make the phpgw Version-0_9_16-branch HEAD

This commit is contained in:
Ralf Becker 2003-08-28 14:16:30 +00:00
parent aedaca8c72
commit f76c6eedd7
161 changed files with 5417 additions and 6165 deletions

182
about.php
View File

@ -1,78 +1,128 @@
<?php
/**************************************************************************\
* phpGroupWare *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/**************************************************************************\
* phpGroupWare *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info'] = array();
$GLOBALS['phpgw_info']['flags']['currentapp'] = 'about';
$GLOBALS['phpgw_info']['flags']['disable_Template_class'] = True;
$GLOBALS['phpgw_info']['flags']['noheader'] = True;
include('header.inc.php');
$app = $HTTP_GET_VARS['app'];
$GLOBALS['phpgw']->xslttpl->add_file(array('about'));
if ($app == 'phpGroupWare' || $app == 'about')
if ($app)
{
$app = 'phpgwapi';
}
$setup_file = PHPGW_INCLUDE_ROOT . '/' . $app . '/setup/setup.inc.php';
if (@file_exists($setup_file))
{
include($setup_file);
$fields = array
(
'version',
'description',
'note',
'author',
'license',
'based_on',
'maintainer'
);
while (list(,$field) = each($fields))
if (!($included = $GLOBALS['phpgw']->hooks->single('about',$app)))
{
$app_data[$field] = $setup_info[$app][$field];
if ($field == 'description')
{
$app_data[$field] = lang($setup_info[$app][$field]);
}
}
if (isset($app_data['note']) && !empty($app_data['note']))
{
$app_data['note'] = lang($app_data['note']);
}
}
$data = array
(
'phpgw_logo' => $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
'lang_url_statustext' => lang('phpGroupWare --> homepage'),
'lang_version' => lang('version'),
'phpgw_version' => 'phpGroupWare API ' . $GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],
'phpgw_descr' => lang('is a multi-user, web-based groupware suite written in PHP'),
'about_app' => $app_data + array
(
'title' => lang($app),
'icon' => $GLOBALS['phpgw']->common->image($app,'navbar','',True),
'lang_version' => lang('version'),
'lang_author' => lang('author'),
'lang_based_on' => lang('based on'),
'lang_maintainer' => lang('maintainer'),
'lang_license' => lang('license')
)
function about_app()
{
global $app;
$icon = $GLOBALS['phpgw']->common->image($app,'navbar.gif');
include (PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php");
$info = $setup_info[$app];
$info['title'] = $GLOBALS['phpgw_info']['apps'][$app]['title'];
$other_infos = array(
'author' => lang('Author'),
'maintainer' => lang('Maintainer'),
'version' => lang('Version'),
'license' => lang('License')
);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('about_data' => $data));
$s = "<table width='70%' cellpadding='4'>\n<tr><td align='right'><img src='$icon'></td><td align='left'><b>$info[title]</b></td></tr>";
if ($info['description'])
{
$info['description'] = lang($info['description']);
$s .= "<tr><td colspan='2' align='center'>$info[description]</td></tr>\n";
if ($info['note'])
{
$info['note'] = lang($info['note']);
$s .= "<tr><td colspan='2' align='center'><i>$info[note]</i></td></tr>\n";
}
}
foreach ($other_infos as $key => $val)
{
if (isset($info[$key]))
{
$s .= "<tr><td width='50%' align='right'>$val</td><td>";
$infos = $info[$key];
for ($n = 0; is_array($info[$key][$n]) && ($infos = $info[$key][$n]) || !$n; ++$n)
{
if (!is_array($infos) && isset($info[$key.'_email']))
{
$infos = array('email' => $info[$key.'_email'],'name' => $infos);
}
if (is_array($infos))
{
$names = explode('<br>',$infos['name']);
$emails = split('@|<br>',$infos['email']);
if (count($names) < count($emails)/2)
{
$names = '';
}
$infos = '';
while (list($user,$domain) = $emails)
{
if ($infos) $infos .= '<br>';
$name = $names ? array_shift($names) : $user;
$infos .= "<a href='mailto:$user at $domain' onClick=\"document.location='mailto:$user'+'@'+'$domain'; return false;\">$name</a>";
array_shift($emails); array_shift($emails);
}
}
$s .= ($n ? '<br>' : '') . $infos;
}
$s .= "</td></tr>\n";
}
}
$s .= "</table>\n";
return $s;
}
$api_only = !($included = file_exists(PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php"));
}
}
else
{
$api_only = True;
}
$tpl = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi'));
$tpl->set_file(array(
'phpgw_about' => 'about.tpl',
'phpgw_about_unknown' => 'about_unknown.tpl'
));
$tpl->set_var('webserver_url',$GLOBALS['phpgw']->common->get_image_path('phpgwapi'));
$tpl->set_var('phpgw_version','phpGroupWare API version ' . $GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
if ($included)
{
$tpl->set_var('phpgw_app_about',about_app('',''));
//about_app($tpl,"phpgw_app_about");
}
else
{
if ($api_only)
{
$tpl->set_var('phpgw_app_about','');
}
else
{
$tpl->set_var('app_header',$app);
$tpl->parse('phpgw_app_about','phpgw_about_unknown');
}
}
$title = isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : 'phpGroupWare';
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('About %1',$title);
$GLOBALS['phpgw']->common->phpgw_header();
$tpl->pparse('out','phpgw_about');
$GLOBALS['phpgw']->common->phpgw_footer();
?>

69
addressbook/admin.php Normal file
View File

@ -0,0 +1,69 @@
<?php
/**************************************************************************\
* phpGroupWare - Address Book *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_info['flags'] = array(
'currentapp' => 'addressbook',
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'enable_config_class' => True,
'enable_nextmatchs_class' => True
);
include('../header.inc.php');
$phpgw->config->read_repository();
if ($submit)
{
if ($usecountrylist)
{
$phpgw->config->config_data['countrylist'] = True;
}
else
{
unset($phpgw->config->config_data['countrylist']);
}
$phpgw->config->save_repository(True);
Header('Location: ' . $phpgw->link('/admin/index.php'));
}
$phpgw->common->phpgw_header();
echo parse_navbar();
$t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$t->set_file(array('admin' => 'admin.tpl'));
$t->set_var('action_url',$phpgw->link('/addressbook/admin.php'));
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$t->set_var('tr_color',$tr_color);
$t->set_var('lang_countrylist',lang('Use Country List'));
if ($phpgw->config->config_data['countrylist'])
{
$t->set_var('countrylist',' checked');
}
else
{
$t->set_var('countrylist','');
}
$t->set_var('lang_admin',lang('Addressbook').' '.lang('Admin'));
$t->set_var('lang_submit',lang('submit'));
$t->pparse('out','admin');
$phpgw->common->phpgw_footer();
?>

View File

@ -12,27 +12,32 @@
/* $Id$ */
$GLOBALS['phpgw_info'] = array();
$GLOBALS['phpgw_info']['flags']['currentapp'] = 'addressbook';
$GLOBALS['phpgw_info']['flags']['enable_contacts_class'] = True;
$GLOBALS['phpgw_info']['flags'] = array(
'currentapp' => 'addressbook',
'noheader' => True,
'enable_contacts_class' => True,
);
include('../header.inc.php');
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Import CSV-File into Addressbook');
$GLOBALS['phpgw']->common->phpgw_header();
$GLOBALS['phpgw']->contacts = createobject('phpgwapi.contacts');
$GLOBALS['phpgw']->template->set_file(array('import_t' => 'csv_import.tpl'));
$GLOBALS['phpgw']->template->set_block('import_t','filename');
$GLOBALS['phpgw']->template->set_block('import_t','fheader');
$GLOBALS['phpgw']->template->set_block('import_t','fields');
$GLOBALS['phpgw']->template->set_block('import_t','ffooter');
$GLOBALS['phpgw']->template->set_block('import_t','imported');
$GLOBALS['phpgw']->template->set_block('import_t','import');
$GLOBALS['phpgw']->template->set_file(array('import' => 'csv_import.tpl'));
$GLOBALS['phpgw']->template->set_block('import','filename','filenamehandle');
$GLOBALS['phpgw']->template->set_block('import','fheader','fheaderhandle');
$GLOBALS['phpgw']->template->set_block('import','fields','fieldshandle');
$GLOBALS['phpgw']->template->set_block('import','ffooter','ffooterhandle');
$GLOBALS['phpgw']->template->set_block('import','imported','importedhandle');
if($action == 'download' && (!$fieldsep || !$csvfile || !($fp=fopen($csvfile,'rb'))))
$csvfile = isset($_POST['csvfile']) ? $_POST['csvfile'] : $_FILES['csvfile']['tmp_name'];
if($_POST['action'] == 'download' && (!$_POST['fieldsep'] || !$csvfile || !($fp=fopen($csvfile,'rb'))))
{
$action = '';
$_POST['action'] = '';
}
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/addressbook/csv_import.php'));
$GLOBALS['phpgw']->template->set_var('lang_addr_action',lang('Import CSV-File into Addressbook'));
$PSep = '||'; // Pattern-Separator, separats the pattern-replacement-pairs in trans
$ASep = '|>'; // Assignment-Separator, separats pattern and replacesment
@ -125,18 +130,18 @@
return $id_str;
}
switch($action)
switch($_POST['action'])
{
case '': // Start, ask Filename
$GLOBALS['phpgw']->template->set_var('lang_csvfile',lang('CSV-Filename'));
$GLOBALS['phpgw']->template->set_var('lang_fieldsep',lang('Fieldseparator'));
$GLOBALS['phpgw']->template->set_var('fieldsep',$fieldsep ? $fieldsep : ',');
$GLOBALS['phpgw']->template->set_var('fieldsep',$_POST['fieldsep'] ? $_POST['fieldsep'] : ',');
$GLOBALS['phpgw']->template->set_var('submit',lang('Download'));
$GLOBALS['phpgw']->template->set_var('csvfile',$csvfile);
$GLOBALS['phpgw']->template->set_var('enctype','ENCTYPE="multipart/form-data"');
$hiddenvars .= '<input type="hidden" name="action" value="download">'."\n";
$GLOBALS['phpgw']->template->parse('rows','filename');
$GLOBALS['phpgw']->template->parse('filenamehandle','filename');
break;
case 'download':
@ -151,9 +156,9 @@
$GLOBALS['phpgw']->template->set_var('lang_translation',lang("Translation").' <a href="#help">'.lang('help').'</a>');
$GLOBALS['phpgw']->template->set_var('submit',lang('Import'));
$GLOBALS['phpgw']->template->set_var('lang_debug',lang('Test Import (show importable records <u>only</u> in browser)'));
$GLOBALS['phpgw']->template->parse('rows','fheader');
$GLOBALS['phpgw']->template->parse('fheaderhandle','fheader');
$hiddenvars .= '<input type="hidden" name="action" value="import">'."\n"
. '<input type="hidden" name="fieldsep" value="'.$fieldsep."\">\n";
. '<input type="hidden" name="fieldsep" value="'.$_POST['fieldsep']."\">\n";
$addr_names = $GLOBALS['phpgw']->contacts->stock_contact_fields + array(
'cat_id' => 'Categories: @cat_id(Cat1,Cat2)',
@ -161,8 +166,7 @@
'owner' => 'Owner: defaults to user',
'address2' => 'address line 2',
'address3' => 'address line 3',
'ophone' => 'Other Phone',
'ab_id' => 'Address Id: @addr_id(n_family,n_given,org_name)'
'ophone' => 'Other Phone'
);
$config = CreateObject('phpgwapi.config','addressbook');
$config->read_repository();
@ -172,7 +176,7 @@
}
unset($config);
while(list($field,$name) = each($addr_names))
foreach($addr_names as $field => $name)
{
if($dn = display_name($field))
{
@ -180,23 +184,22 @@
}
}
$addr_name_options = "<option value=\"\">none\n";
reset($addr_names);
while(list($field,$name) = each($addr_names))
foreach($addr_names as $field => $name)
{
$addr_name_options .= "<option value=\"$field\">".$GLOBALS['phpgw']->strip_html($name)."\n";
}
$csv_fields = fgetcsv($fp,8000,$fieldsep);
$csv_fields = fgetcsv($fp,8000,$_POST['fieldsep']);
$csv_fields[] = 'no CSV 1'; // eg. for static assignments
$csv_fields[] = 'no CSV 2';
$csv_fields[] = 'no CSV 3';
while(list($csv_idx,$csv_field) = each($csv_fields))
foreach($csv_fields as $csv_idx => $csv_field)
{
$GLOBALS['phpgw']->template->set_var('csv_field',$csv_field);
$GLOBALS['phpgw']->template->set_var('csv_idx',$csv_idx);
if($def = $defaults[$csv_field])
{
list($addr,$trans) = explode($PSep,$def,2);
$GLOBALS['phpgw']->template->set_var('trans',$trans);
list($addr,$_POST['trans']) = explode($PSep,$def,2);
$GLOBALS['phpgw']->template->set_var('trans',$_POST['trans']);
$GLOBALS['phpgw']->template->set_var('addr_fields',str_replace('="'.$addr.'">','="'.$addr.'" selected>',$addr_name_options));
}
else
@ -204,19 +207,19 @@
$GLOBALS['phpgw']->template->set_var('trans','');
$GLOBALS['phpgw']->template->set_var('addr_fields',$addr_name_options);
}
$GLOBALS['phpgw']->template->parse('rows','fields',True);
$GLOBALS['phpgw']->template->parse('fieldshandle','fields',True);
}
$GLOBALS['phpgw']->template->set_var('lang_start',lang('Startrecord'));
$GLOBALS['phpgw']->template->set_var('start',$start);
$GLOBALS['phpgw']->template->set_var('start',$_POST['start']);
$GLOBALS['phpgw']->template->set_var('lang_max',lang('Number of records to read (<=200)'));
$GLOBALS['phpgw']->template->set_var('max',200);
$GLOBALS['phpgw']->template->parse('rows','ffooter',True);
$GLOBALS['phpgw']->template->parse('ffooterhandle','ffooter');
fclose($fp);
$old = $csvfile; $csvfile = $GLOBALS['phpgw_info']['server']['temp_dir'].'/addrbook_import_'.basename($csvfile);
rename($old,$csvfile);
$hiddenvars .= '<input type="hidden" name="csvfile" value="'.$csvfile.'">';
$mktime_lotus = "${PSep}0?([0-9]+)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*).*$ASep@mktime(${VPre}4,${VPre}5,${VPre}6,${VPre}2,${VPre}3,${VPre}1)";
$help_on_trans = "<a name='help'><b>How to use Translation's</b><p>".
$help_on_trans = "<a name=\"help\"></a><b>How to use Translation's</b><p>".
"Translations enable you to change / adapt the content of each CSV field for your needs. <br>".
"General syntax is: <b>pattern1 ${ASep} replacement1 ${PSep} ... ${PSep} patternN ${ASep} replacementN</b><br>".
"If the pattern-part of a pair is ommited it will match everything ('^.*$'), which is only ".
@ -251,21 +254,22 @@
$GLOBALS['phpgw']->template->set_var('help_on_trans',lang($help_on_trans)); // I don't think anyone will translate this
break;
case 'import':
@set_time_limit(0);
$fp=fopen($csvfile,'rb');
$csv_fields = fgetcsv($fp,8000,$fieldsep);
$csv_fields = fgetcsv($fp,8000,$_POST['fieldsep']);
$csv_fields[] = 'no CSV 1'; // eg. for static assignments
$csv_fields[] = 'no CSV 2';
$csv_fields[] = 'no CSV 3';
$addr_fields = array_diff($addr_fields,array('')); // throw away empty / not assigned entrys
$addr_fields = array_diff($_POST['addr_fields'],array('')); // throw away empty / not assigned entrys
$defaults = array();
while(list($csv_idx,$addr) = each($addr_fields))
{ // convert $trans[$csv_idx] into array of pattern => value
foreach($addr_fields as $csv_idx => $addr)
{ // convert $_POST['trans'][$csv_idx] into array of pattern => value
$defaults[$csv_fields[$csv_idx]] = $addr;
if($trans[$csv_idx])
if($_POST['trans'][$csv_idx])
{
$defaults[$csv_fields[$csv_idx]] .= $PSep.$trans[$csv_idx];
$defaults[$csv_fields[$csv_idx]] .= $PSep.$_POST['trans'][$csv_idx];
}
}
@ -275,15 +279,14 @@
$log = "<table border=1>\n\t<tr><td>#</td>\n";
reset($addr_fields);
while(list($csv_idx,$addr) = each($addr_fields))
{ // convert $trans[$csv_idx] into array of pattern => value
// if (!$debug) echo "<p>$csv_idx: ".$csv_fields[$csv_idx].": $addr".($trans[$csv_idx] ? ': '.$trans[$csv_idx] : '')."</p>";
$pat_reps = explode($PSep,stripslashes($trans[$csv_idx]));
foreach($addr_fields as $csv_idx => $addr)
{ // convert $_POST['trans'][$csv_idx] into array of pattern => value
// if (!$_POST['debug']) echo "<p>$csv_idx: ".$csv_fields[$csv_idx].": $addr".($_POST['trans'][$csv_idx] ? ': '.$_POST['trans'][$csv_idx] : '')."</p>";
$pat_reps = explode($PSep,stripslashes($_POST['trans'][$csv_idx]));
$replaces = ''; $values = '';
if($pat_reps[0] != '')
{
while(list($k,$pat_rep) = each($pat_reps))
foreach($pat_reps as $k => $pat_rep)
{
list($pattern,$replace) = explode($ASep,$pat_rep,2);
if($replace == '')
@ -293,11 +296,11 @@
$values[$pattern] = $replace; // replace two with only one, added by the form
$replaces .= ($replaces != '' ? $PSep : '') . $pattern . $ASep . $replace;
}
$trans[$csv_idx] = $values;
$_POST['trans'][$csv_idx] = $values;
}
else
{
unset( $trans[$csv_idx] );
unset( $_POST['trans'][$csv_idx] );
}
$log .= "\t\t<td><b>$addr</b></td>\n";
}
@ -307,24 +310,22 @@
$auto_fn = array('n_prefix','n_given','n_middle','n_family','n_suffix');
}
if($start < 1)
{
$start = 1;
}
for($i = 1; $i < $start && fgetcsv($fp,8000,$fieldsep); ++$i); // overread lines before our start-record
$start = $_POST['start'] < 1 ? 1 : $_POST['start'];
for($anz = 0; $anz < $max && ($fields = fgetcsv($fp,8000,$fieldsep)); ++$anz)
for($i = 1; $i < $start && fgetcsv($fp,8000,$_POST['fieldsep']); ++$i); // overread lines before our start-record
for($anz = 0; $anz < $_POST['max'] && ($fields = fgetcsv($fp,8000,$_POST['fieldsep'])); ++$anz)
{
$log .= "\t</tr><tr><td>".($start+$anz)."</td>\n";
reset($addr_fields); $values = array();
while(list($csv_idx,$addr) = each($addr_fields))
{
//echo "<p>$csv: $addr".($trans[$csv] ? ': '.$trans[$csv] : '')."</p>";
//echo "<p>$csv: $addr".($_POST['trans'][$csv] ? ': '.$_POST['trans'][$csv] : '')."</p>";
$val = $fields[$csv_idx];
if(isset($trans[$csv_idx]))
if(isset($_POST['trans'][$csv_idx]))
{
$trans_csv = $trans[$csv_idx];
$trans_csv = $_POST['trans'][$csv_idx];
while(list($pattern,$replace) = each($trans_csv))
{
if(ereg((string) $pattern,$val))
@ -342,15 +343,22 @@
}
if($val[0] == '@')
{
// removing the $ to close security hole of showing vars, which contain eg. passwords
$val = 'return '.substr(str_replace('$','',$val),1).';';
// echo "<p>eval('$val')=";
$val = eval($val);
// echo "'$val'</p>";
if (!$GLOBALS['phpgw_info']['user']['apps']['admin'])
{
echo lang('@-eval() is only availible to admins!!!');
}
else
{
// removing the $ to close security hole of showing vars, which contain eg. passwords
$val = 'return '.substr(str_replace('$','',$val),1).';';
// echo "<p>eval('$val')=";
$val = eval($val);
// echo "'$val'</p>";
}
}
if($pattern[0] != '@' || $val)
{
break;
break;
}
}
}
@ -370,32 +378,24 @@
}
$log .= "\t\t<td>".$values['fn']."</td>\n";
}
if(!$debug)
if(!$_POST['debug'])
{
if (!$values['ab_id'])
{
$GLOBALS['phpgw']->contacts->add( $values['owner'] ? $values['owner'] : $GLOBALS['phpgw_info']['user']['account_id'],
$values,$values['access'],$values['cat_id']);
}
else
{
$GLOBALS['phpgw']->contacts->update( $values['ab_id'],
$values['owner'] ? $values['owner'] : $GLOBALS['phpgw_info']['user']['account_id'],
$values,$values['access'],$values['cat_id']);
}
$GLOBALS['phpgw']->contacts->add( $values['owner'] ? $values['owner'] : $GLOBALS['phpgw_info']['user']['account_id'],
$values,$values['access'],$values['cat_id']);
// echo "<p>adding: ".dump_array($values)."</p>\n";
}
}
$log .= "\t</tr>\n</table>\n";
$GLOBALS['phpgw']->template->set_var('anz_imported',$debug ? lang('%1 records read (not yet imported, you may go %2back%3 and uncheck Test Import)',
$GLOBALS['phpgw']->template->set_var('anz_imported',$_POST['debug'] ? lang('%1 records read (not yet imported, you may go %2back%3 and uncheck Test Import)',
$anz,'<a href="javascript:history.back()">','</a>') :
lang('%1 records imported',$anz));
$GLOBALS['phpgw']->template->set_var('log',$log);
$GLOBALS['phpgw']->template->parse('rows','imported');
$GLOBALS['phpgw']->template->parse('importedhandle','imported');
break;
}
$GLOBALS['phpgw']->template->set_var('hiddenvars',$hiddenvars);
$GLOBALS['phpgw']->template->fp('phpgw_body','import');
$GLOBALS['phpgw']->template->pfp('out','import',True);
$GLOBALS['phpgw']->common->phpgw_footer();
?>

View File

@ -1,6 +0,0 @@
phpgroupware-addressbook (0.9.14-0.RC3.3) unstable; urgency=low
* New release.
- Source is now splitted into modules.
-- Luca - De Whiskey's - De Vitis <luca@debian.org> Mon, 21 May 2001 15:00:56 +0200

View File

@ -1,15 +0,0 @@
Source: phpgroupware-addressbook
Section: web
Priority: optional
Maintainer: Luca - De Whiskey's - De Vitis <luca@debian.org>
Build-Depends: debhelper (>> 3.0.0)
Standards-Version: 3.5.2
Package: phpgroupware-addressbook
Section: web
Architecture: all
Depends: phpgroupware (>= ${Source-Version}), php3-pgsql | php3-cgi-pgsql | php4-pgsql | php3-mysql | php3-cgi-mysql | php4-mysql
Description: The phpGrouhpWare addressbook management module
This phpGroupWare module provides a searchable addressbook with vCard
support.

View File

@ -1,15 +0,0 @@
This package was debianized by Luca - De Whiskey's - De Vitis <luca@debian.org> on
Sat, 29 Jun 2002 17:13:40 +0200
It was downloaded from the CVS repository at subversion.gnu.org. Try:
prompt$ CVSROOT=:pserver:anoncvs@subversions.gnu.org:/cvsroot/phpgroupware
prompt$ CVS_RSH=ssh
prompt$ cvs login
prompt$ cvs get all packages
Upstream Author(s):
Please, see credits.txt, the README file or visit http://apps.phpgroupware.org/
Copyright:
A copy of the GNU General Public License, version 2, can be found in
/usr/share/common-licenses/GPL .

View File

@ -1,74 +0,0 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=3
APP = addressbook
PACKAGE = debian/phpgroupware-$(APP)/usr/share/phpgroupware/$(APP)
PACKAGEDOC = debian/phpgroupware-$(APP)/usr/share/doc/phpgroupware-$(APP)
COPYRIGHT = -iname copyright\* -or -iname license
CHANGELOG = -iname change\*
INSTALL = -iname install
FINDOPT = -type f -not \( -path \*CVS\* -or -path \*debian\* -or -name .cvsignore \)
SPECIAL = -size 0 -or $(INSTALL) -or $(CHANGELOG) -or $(COPYRIGHT) -or -name \*.sgml
STAMPS = -name configure-stamp -or -name build-stamp
APPFILES = -not \( -path \*doc\* -or -path \. -or -name '*.pl' -or -name '*.py' -or $(STAMPS) \)
DOCFILES = -not \( $(SPECIAL) \)
configure: configure-stamp
configure-stamp:
dh_testdir
# No configuration needed.
touch configure-stamp
build: configure-stamp build-stamp
build-stamp:
dh_testdir
# Here should go the commands necessary to build the sgml documentation...
touch build-stamp
clean:
dh_testdir
rm -f build-stamp configure-stamp
rm -f debian/.builded
rm -f debian/files
# Here should go the commands to clean the builded sgml documents.
dh_clean
install: build
dh_testdir
# Install $(APP) files in $(PACKAGE)
find $(FINDOPT) $(APPFILES) \
-exec install -D --mode=644 {} $(PACKAGE)/{} \;
# Install $(APP) doc files in $(PACKAGEDOC)
cd doc ;\
find $(FINDOPT) $(DOCFILES) \
-exec install -D --mode=644 {} ../$(PACKAGEDOC)/{} \;
binary-indep: build install
dh_testdir
dh_testroot
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb | tee debian/.builded
binary: binary-indep
.PHONY: build clean binary-indep binary-arch binary install configure

View File

@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@ -0,0 +1,59 @@
<?php
/**************************************************************************\
* phpGroupWare - User manual *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_flags = Array(
'currentapp' => 'manual'
);
$phpgw_info['flags'] = $phpgw_flags;
include('../../../header.inc.php');
$font = $phpgw_info['theme']['font'];
?>
<img src="<?php echo $phpgw->common->image('addressbook','navbar.gif'); ?>" border="0">
<font face="<?php echo $font ?>" size="2"><p/>&nbsp;&nbsp;&nbsp;&nbsp; Ein durchsuchbares
Adressbuch um Kontakt-Informationen von Gesch&auml;ftspartnern, Freunden und der
Familie aufzubewahren.
<ul>
<li><b>Hinzuf&uuml;gen:</b><br/>
Klicken Sie auf den Hinzuf&uuml;gen Knopf, es wird eine Formularseite mit
den folgenden Feldern angezeigt:
<table width="80%">
<td bgcolor="#ccddeb" width="50%" valign="top">
<font face="<?php echo $font; ?>" size="2">
Nachnahme:<br/>
E-mail:<br/>
Telefon Privat:<br/>
Telefon Gesch&auml;ftlich:<br/>
Mobiltelefon:<br/>
Strasse:<br/>
Stadt:<br/>
Land:<br/>
Postleitzahl:<br/>
Zugriff:<br/>
Gruppen-Einstellungen:<br/>
Notizen:</td>
<td bgcolor="#ccddeb" width="50%" valign="top"> <font face="<?php echo $font; ?>" size="2">
Vorname:<br/>
Firmenname:<br/>
Fax:<br/>
Pager:<br/>
Andere Nummer:<br/>
Geburtstag:</td></table>
...und viele andere mehr.
Einfach die Felder ausfüllen und OK klicken.</li><p/>&nbsp;&nbsp;&nbsp;&nbsp;</ul>
Der Zugriff kann auf Privat beschr&auml;nkt werden, was die Prefrences (Optionen)
Einstellungen überschreibt. In den Prefrences kann eingestellt werden, welche
Benutzer welchen Zugriff auf ihr Adressbuch haben - anschauen, bearbeiten oder
sogar l&ouml;schen.
<p/>&nbsp;&nbsp;&nbsp;&nbsp;
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -1,55 +0,0 @@
<?php
/**************************************************************************\
* phpGroupWare - User manual *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags'] = Array
(
'headonly' => True,
'currentapp' => 'addressbook'
);
include('../../../header.inc.php');
$GLOBALS['phpgw']->help = CreateObject('phpgwapi.help_helper');
$GLOBALS['phpgw']->help->set_params(array('app_name' => 'addressbook',
'title' => lang('addressbook') . ' - ' . lang('add'),
'controls' => array('up' => 'list.php')));
$values['add'] = array
(
'add_img' => $GLOBALS['phpgw']->common->image('addressbook','help_add'),
'item_1' => 'Add any and all information that you see fit. You can use the tab key to tab from one field to the next.',
'item_2' => 'Once you have entered all the information, press OK to accept, Clear to erase all information in all the fields or Cancel to exit this screen.',
'lang_lastname' => 'Last name',
'lang_firstname' => 'First name',
'lang_email' => 'E-mail',
'lang_homephone' => 'Home phone',
'lang_workphone' => 'Work phone',
'lang_mobile' => 'Mobile',
'lang_street' => 'Street',
'lang_city' => 'City',
'lang_state' => 'State',
'lang_zip' => 'ZIP code',
'lang_access' => 'Access',
'lang_groupsettings' => 'Group settings',
'lang_notes' => 'Notes',
'lang_company' => 'Company name',
'lang_fax' => 'Fax',
'lang_pager' => 'Pager',
'lang_othernumber' => 'Other number',
'lang_birthday' => 'Birthday',
'access_descr' => 'Access can be restricted to private, overriding acl preferences settings.
From preferences, you can grant access to users to the be able to view,
edit, and even delete your entries.'
);
$GLOBALS['phpgw']->help->xdraw($values);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->help->output);
?>

View File

@ -0,0 +1,56 @@
<?php
/**************************************************************************\
* phpGroupWare - User manual *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_flags = Array(
'currentapp' => 'manual'
);
$phpgw_info['flags'] = $phpgw_flags;
include('../../../header.inc.php');
$font = $phpgw_info['theme']['font'];
?>
<img src="<?php echo $phpgw->common->image('addressbook','navbar.gif'); ?>" border="0">
<font face="<?php echo $font ?>" size="2"><p/>
A searchable address book for keeping contact information of business
associates or friends and family.
<ul><li><b>Add:</b><br/>
Click on the add button, a form page will be presented with the following fields:
<table width="80%">
<td bgcolor="#ccddeb" width="50%" valign="top">
<font face="<?php echo $font; ?>" size="2">
Last name:<br/>
E-mail:<br/>
Home phone:<br/>
Work phone:<br/>
Mobile:<br/>
Street:<br/>
City:<br/>
State:<br/>
ZIP code:<br/>
Access:<br/>
Group settings:<br/>
Notes:</td>
<td bgcolor="#ccddeb" width="50%" valign="top">
<font face="<?php echo $font; ?>" size="2">
First name:<br/>
Company name:<br/>
Fax:<br/>
Pager:<br/>
Other number:<br/>
Birthday:</td></table>
...and many others.
Simply fill in the fields, and click OK.</li><p/></ul>
Access can be restricted to private, overriding acl preferences settings.
From preferences, you can grant access to users to the be able to view,
edit, and even delete your entries.<p/>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -1,52 +0,0 @@
<?php
/**************************************************************************\
* phpGroupWare - User manual *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags'] = Array
(
'headonly' => True,
'currentapp' => 'addressbook'
);
include('../../../header.inc.php');
$GLOBALS['phpgw']->help = CreateObject('phpgwapi.help_helper');
$GLOBALS['phpgw']->help->set_params(array('app_name' => 'addressbook',
'title' => lang('addressbook') . ' - ' . lang('list'),
'controls' => array('up' => 'overview.php',
'down' => 'add.php')));
$values['list'] = array
(
'list_img' => $GLOBALS['phpgw']->common->image('addressbook','help_list'),
'item_1' => 'Category select box. The category filter shows the items sorted by category.',
'item_2' => 'The double arrow moves you to the first page, the single arrow moves you to the previous page.',
'item_3' => 'Type in a word and hit the search for a specific name. For example you cant remember Bobs e-mail address, you type *Bob* into the search box and it will display all entries with the name Bob. You can search entries of your adressbook. The search function is not case sensetive, it searches for upper and lower cases at once.',
'item_4' => 'This pull down menu allows you to choose which entries you would like to view: private, only yours or all records. Hit the filter button to display your selection.',
'item_5' => 'Use the filter button to activate your selection of filters (see #4).',
'item_6' => 'The double arrow moves you to the last page, the single arrow moves you to the next page.',
'h_data' => 'Data records. The visible fields you have choosen in the preferences section. Examples:',
'item_7' => 'Persons full name. By clicking on *Full Name* it will sort the list by the entries first name.',
'item_8' => 'Persons birthday. By clicking on *Birthday* it will sort the list by the entries birthday.',
'item_9' => 'Persons work e-mail address. By clicking on "Business Email" it will sort the list by the entries Business e-mail. In the example above, if you click on the e-mail address, joe@work.com, it will open a compose window to joe an e-mail.',
'item_10' => 'Persons home e-mail address. By clicking on "Home Email" it will sort the list by the entries home e-mail. In the example above, if you click on the e-mail address, joe@home.com, it will open a compose window to joe an e-mail.',
'item_11' => 'View: Allows you to view all of the information that was entered. ie: phone #, address, work #, etc...',
'item_12' => 'VCard: Creates a VCard.',
'item_13' => 'Edit: Allows you to edit all the information contained in that persons entry. It is only possible to edit an entry if you are the owner or have the rights to do so.',
'item_14' => 'Owner: The person who owns this record.',
'item_15' => 'Add: Creates a new entry to add a new person.',
'item_16' => 'Add VCard: Imports a new VCard into your address book.',
'item_17' => 'Import Contacts: A way to import a previous address book, ie. Netscape ldif format, IE csv files...',
'item_18' => 'Export Contacts: Lets you export your address book to a text file.'
);
$GLOBALS['phpgw']->help->xdraw($values);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->help->output);
?>

View File

@ -1,34 +0,0 @@
<?php
/**************************************************************************\
* phpGroupWare - User manual *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags'] = Array
(
'headonly' => True,
'currentapp' => 'addressbook'
);
include('../../../header.inc.php');
$GLOBALS['phpgw']->help = CreateObject('phpgwapi.help_helper');
$GLOBALS['phpgw']->help->set_params(array('app_name' => 'addressbook',
'title' => lang('addressbook') . ' - ' . lang('overview'),
'controls' => array('down' => 'list.php')));
$values['overview'] = array
(
'intro' => 'A searchable address book for keeping contact information of business associates or friends and family, to keep various levels of contact information and a search function to find people you need quickly. Integration with other applications in the phpGroupWare suite.',
'prefs_settings' => 'Preferences settings:<br>When you enter the adressbock the first time it shows on the top the message *Please set your preferences for this application!*. This means you still have to adapt the application for your special needs. Each applications preferences section can be found within the preferences application. For further informations please see the section preferences.'
);
$GLOBALS['phpgw']->help->xdraw($values);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->help->output);
?>

View File

@ -51,3 +51,4 @@ T
Tiedon käyttöoikeus voidaan rajoittaa yksityiseksi, mikä ohittaa ACL:n
asetuksen. Osoitekirjan asetuksista voit antaa muille käyttäjille
oikeuden selata, muokata tai jopa poistaa tallentamiasi tietoja.<p/>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -51,3 +51,5 @@ FAX:<br/>
プライベートデータにアクセスするには、利用許可(ユーザ設定)を設定する必要があります。
ユーザ設定ではあなたが作成したアドレス帳を他のユーザが、表示・訂正・削除することができるアクセス権を設定することができます。
<p/>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -1,6 +1,6 @@
<?php
/**************************************************************************\
* phpGroupWare *
* phpGroupWare - User manual *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
@ -9,20 +9,18 @@
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/* $Id$ */
$phpgw_baseline = array(
'phpgw_addressbook_servers' => array(
'fd' => array(
'name' => array('type' => 'varchar', 'precision' => 64, 'nullable' => False),
'basedn' => array('type' => 'varchar', 'precision' => 255, 'nullable' => True),
'search' => array('type' => 'varchar', 'precision' => 32, 'nullable' => True),
'attrs' => array('type' => 'varchar', 'precision' => 255, 'nullable' => True),
'enabled' => array('type' => 'int', 'precision' => 4)
),
'pk' => array('name'),
'fk' => array(),
'ix' => array(),
'uc' => array()
)
$phpgw_flags = Array(
'currentapp' => 'manual'
);
$phpgw_info['flags'] = $phpgw_flags;
include('../../header.inc.php');
$appname = 'addressbook';
include(PHPGW_SERVER_ROOT.'/'.$appname.'/setup/setup.inc.php');
?>
<img src="<?php echo $phpgw->common->image($appname,'navbar.gif'); ?>" border="0"><p/>
<font face="<?php echo $phpgw_info['theme']['font']; ?>" size="2">
Version: <b><?php echo $setup_info[$appname]['version']; ?></b>
</font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -41,25 +41,15 @@
$this->read_sessiondata();
$this->use_session = True;
}
global $start,$limit,$query,$sort,$order,$filter,$cat_id;
$start = intval(get_var('start', array('POST','GET')));
$query = get_var('query', array('POST','GET'));
$limit = get_var('limit', array('POST','GET'));
$sort = get_var('sort', array('POST','GET'));
$order = get_var('order', array('POST','GET'));
$filter = get_var('filter', array('POST','GET'));
$cat_id = get_var('fcat_id', array('POST'));
$this->start = (!empty($start) || ($start == '0')) ? $start : $this->start;
$this->limit = (!empty($limit) || ($limit == '0')) ? $limit : $this->limit;
$this->query = (empty($query) && !empty($this->query)) || !empty($query) ? $query : $this->query;
$this->cquery = (empty($cquery) && !empty($this->cquery)) || !empty($cquery) ? $cquery : $this->cquery;
$this->sort = (!empty($sort)) ? $sort : $this->sort;
$this->order = (!empty($order)) ? $order : $this->order;
$this->filter = (!empty($filter) || ($filter == '0')) ? $filter : $this->filter;
$this->cat_id = (isset($cat_id) && !empty($cat_id)) ? $cat_id : $this->cat_id;
$this->cat_id = ($cat_id == '0' || $cat_id == 0 || $cat_id == '') ? $cat_id : $this->cat_id;
if($start || $start == 0) { $this->start = $start; }
if($limit) { $this->limit = $limit; }
if($query) { $this->query = $query; }
if($sort) { $this->sort = $sort; }
if($order) { $this->order = $order; }
if($filter) { $this->filter = $filter; }
$this->cat_id = $cat_id;
}
function save_sessiondata()
@ -85,10 +75,7 @@
function read_sessiondata()
{
$data = $GLOBALS['phpgw']->session->appsession('session_data','addressbook');
if($this->debug)
{
echo '<br>Read:'; _debug_array($data);
}
if($this->debug) { echo '<br>Read:'; _debug_array($data); }
$this->start = $data['start'];
$this->limit = $data['limit'];
@ -103,23 +90,20 @@
{
include (PHPGW_APP_INC . '/import/' . $conv_type);
if($private == '')
{
$private = 'public';
}
if ($private == '') { $private = 'public'; }
$row = 0;
$buffer = array();
$contacts = new import_conv;
$buffer = $contacts->import_start_file($buffer);
$fp = fopen($tsvfile,'r');
if($contacts->type == 'csv')
if ($contacts->type == 'csv')
{
while($data = fgetcsv($fp,8000,','))
while ($data = fgetcsv($fp,8000,','))
{
$num = count($data);
$row++;
if($row == 1)
if ($row == 1)
{
$header = $data;
/* Changed here to ignore the header, set to our array
@ -132,10 +116,10 @@
else
{
$buffer = $contacts->import_start_record($buffer);
for($c=0; $c<$num; $c++)
for ($c=0; $c<$num; $c++ )
{
//Send name/value pairs along with the buffer
if($contacts->import[$header[$c]] != '' && $data[$c] != '')
if ($contacts->import[$header[$c]] != '' && $data[$c] != '')
{
$buffer = $contacts->import_new_attrib($buffer, $contacts->import[$header[$c]],$data[$c]);
}
@ -144,25 +128,25 @@
}
}
}
elseif($contacts->type == 'ldif')
elseif ($contacts->type == 'ldif')
{
while($data = fgets($fp,8000))
while ($data = fgets($fp,8000))
{
$url = "";
list($name,$value,$extra) = split(':', $data);
if(substr($name,0,2) == 'dn')
if (substr($name,0,2) == 'dn')
{
$buffer = $contacts->import_start_record($buffer);
}
$test = trim($value);
if($name && !empty($test) && $extra)
if ($name && !empty($test) && $extra)
{
// Probable url string
$url = $test;
$value = $extra;
}
elseif($name && empty($test) && $extra)
elseif ($name && empty($test) && $extra)
{
// Probable multiline encoding
$newval = base64_decode(trim($extra));
@ -170,15 +154,15 @@
//echo $name.':'.$value;
}
if($name && $value)
if ($name && $value)
{
$test = split(',mail=',$value);
if($test[1])
if ($test[1])
{
$name = "mail";
$value = $test[1];
}
if($url)
if ($url)
{
$name = "homeurl";
$value = $url. ':' . $value;
@ -197,32 +181,32 @@
}
else
{
while($data = fgets($fp,8000))
while ($data = fgets($fp,8000))
{
$data = trim($data);
// RB 2001/05/07 added for Lotus Organizer
while(substr($data,-1) == '=')
while (substr($data,-1) == '=')
{
// '=' at end-of-line --> line to be continued with next line
$data = substr($data,0,-1) . trim(fgets($fp,8000));
}
if(strstr($data,';ENCODING=QUOTED-PRINTABLE'))
if (strstr($data,';ENCODING=QUOTED-PRINTABLE'))
{
// RB 2001/05/07 added for Lotus Organizer
$data = quoted_printable_decode(str_replace(';ENCODING=QUOTED-PRINTABLE','',$data));
}
list($name,$value) = explode(':', $data,2); // RB 2001/05/09 to allow ':' in Values (not only in URL's)
if(strtolower(substr($name,0,5)) == 'begin')
if (strtolower(substr($name,0,5)) == 'begin')
{
$buffer = $contacts->import_start_record($buffer);
}
if($name && $value)
if ($name && $value)
{
reset($contacts->import);
while(list($fname,$fvalue) = each($contacts->import))
while ( list($fname,$fvalue) = each($contacts->import) )
{
if(strstr(strtolower($name), $contacts->import[$fname]))
if ( strstr(strtolower($name), $contacts->import[$fname]) )
{
$buffer = $contacts->import_new_attrib($buffer,$name,$value);
}
@ -243,14 +227,14 @@
function export($conv_type,$cat_id='')
{
include (PHPGW_APP_INC . '/export/' . $conv_type);
$buffer = array();
$buffer=array();
$contacts = new export_conv;
// Read in user custom fields, if any
$customfields = array();
while(list($col,$descr) = @each($GLOBALS['phpgw_info']['user']['preferences']['addressbook']))
while (list($col,$descr) = @each($GLOBALS['phpgw_info']['user']['preferences']['addressbook']))
{
if(substr($col,0,6) == 'extra_')
if ( substr($col,0,6) == 'extra_' )
{
$field = ereg_replace('extra_','',$col);
$field = ereg_replace(' ','_',$field);
@ -262,12 +246,12 @@
'address2' => 'address2',
'address3' => 'address3'
);
if($contacts->type != 'vcard')
if ($contacts->type != 'vcard')
{
$contacts->qfields = $contacts->stock_contact_fields;# + $extrafields;# + $customfields;
}
if(!empty($cat_id))
if (!empty($cat_id))
{
$buffer = $contacts->export_start_file($buffer,$cat_id);
}
@ -276,10 +260,10 @@
$buffer = $contacts->export_start_file($buffer);
}
for($i=0;$i<count($contacts->ids);$i++)
for ($i=0;$i<count($contacts->ids);$i++)
{
$buffer = $contacts->export_start_record($buffer);
while(list($name,$value) = each($contacts->currentrecord))
while( list($name,$value) = each($contacts->currentrecord) )
{
$buffer = $contacts->export_new_attrib($buffer,$name,$value);
}

View File

@ -24,8 +24,8 @@
'update_entry' => True
);
var $xml_functions = array();
var $xml_functions = array();
var $xmlrpc_methods = array();
var $soap_functions = array(
'read_entries' => array(
'in' => array('int','int','struct','string','int'),
@ -53,6 +53,7 @@
var $so;
var $start;
var $limit;
var $query;
var $sort;
var $order;
@ -73,41 +74,75 @@
$this->read_sessiondata();
$this->use_session = True;
}
/* _debug_array($GLOBALS['HTTP_POST_VARS']); */
/* Might change this to '' at the end---> */
$_start = $GLOBALS['HTTP_POST_VARS']['start'] ? $GLOBALS['HTTP_POST_VARS']['start'] : $GLOBALS['HTTP_GET_VARS']['start'];
$_query = $GLOBALS['HTTP_POST_VARS']['query'] ? $GLOBALS['HTTP_POST_VARS']['query'] : $GLOBALS['HTTP_GET_VARS']['query'];
$_sort = $GLOBALS['HTTP_POST_VARS']['sort'] ? $GLOBALS['HTTP_POST_VARS']['sort'] : $GLOBALS['HTTP_GET_VARS']['sort'];
$_order = $GLOBALS['HTTP_POST_VARS']['order'] ? $GLOBALS['HTTP_POST_VARS']['order'] : $GLOBALS['HTTP_GET_VARS']['order'];
$_filter = $GLOBALS['HTTP_POST_VARS']['filter'] ? $GLOBALS['HTTP_POST_VARS']['filter'] : $GLOBALS['HTTP_GET_VARS']['filter'];
$_cat_id = $GLOBALS['HTTP_POST_VARS']['cat_id'] ? $GLOBALS['HTTP_POST_VARS']['cat_id'] : $GLOBALS['HTTP_GET_VARS']['cat_id'];
$_fcat_id = $GLOBALS['HTTP_POST_VARS']['fcat_id'] ? $GLOBALS['HTTP_POST_VARS']['fcat_id'] : $GLOBALS['HTTP_GET_VARS']['fcat_id'];
$start = intval(get_var('start', array('POST','GET')));
$query = get_var('query', array('POST','GET'));
$cquery = get_var('cquery', array('GET'));
$sort = get_var('sort', array('POST','GET'));
$order = get_var('order', array('POST','GET'));
$filter = get_var('filter', array('POST','GET'));
$cat_id = get_var('fcat_id', array('POST'));
$this->start = (!empty($start) || ($start == '0')) ? $start : $this->start;
$this->query = (empty($query) && !empty($this->query)) || !empty($query) ? $query : $this->query;
$this->cquery = (empty($cquery) && !empty($this->cquery)) || !empty($cquery) ? $cquery : $this->cquery;
$this->sort = (!empty($sort)) ? $sort : $this->sort;
$this->order = (!empty($order)) ? $order : $this->order;
$this->filter = (!empty($filter) || ($filter == '0')) ? $filter : $this->filter;
$this->cat_id = (isset($cat_id) && !empty($cat_id)) ? $cat_id : $this->cat_id;
$this->cat_id = ($cat_id == '0' || $cat_id == 0 || $cat_id == '') ? $cat_id : $this->cat_id;
if($this->debug)
if(!empty($_start) || ($_start == '0') || ($_start == 0))
{
$this->_debug_sqsof();
if($this->debug) { echo '<br>overriding $start: "' . $this->start . '" now "' . $_start . '"'; }
$this->start = $_start;
}
if($_limit)
{
$this->limit = $_limit;
}
if((empty($_query) && !empty($this->query)) || !empty($_query))
{
$this->query = $_query;
}
if(isset($GLOBALS['HTTP_POST_VARS']['fcat_id']) || isset($GLOBALS['HTTP_POST_VARS']['fcat_id']))
{
$this->cat_id = $_fcat_id;
}
else
{
$this->cat_id = -1;
}
if(isset($_sort) && !empty($_sort))
{
if($this->debug) { echo '<br>overriding $sort: "' . $this->sort . '" now "' . $_sort . '"'; }
$this->sort = $_sort;
}
if(isset($_order) && !empty($_order))
{
if($this->debug) { echo '<br>overriding $order: "' . $this->order . '" now "' . $_order . '"'; }
$this->order = $_order;
}
if(isset($_filter) && !empty($_filter))
{
if($this->debug) { echo '<br>overriding $filter: "' . $this->filter . '" now "' . $_filter . '"'; }
$this->filter = $_filter;
}
if($this->debug) { $this->_debug_sqsof(); }
$this->xmlrpc_methods[] = array(
'name' => 'read_entries',
'description' => 'Get list of addressbook items'
);
}
function _debug_sqsof()
{
$data = array(
'start' => $this->start,
'limit' => $this->limit,
'query' => $this->query,
'sort' => $this->sort,
'order' => $this->order,
'filter' => $this->filter,
'cat_id' => $this->cat_id,
'cquery' => $this->cquery
'cat_id' => $this->cat_id
);
echo '<br>BO:';
_debug_array($data);
@ -120,7 +155,7 @@
in which case the input might be an array. The server always calls
this function to fill the server dispatch map using a string.
*/
if(is_array($_type))
if (is_array($_type))
{
$_type = $_type['type'] ? $_type['type'] : $_type[0];
}
@ -172,12 +207,9 @@
function save_sessiondata($data)
{
if($this->use_session)
if ($this->use_session)
{
if($this->debug)
{
echo '<br>Save:'; _debug_array($data);
}
if($this->debug) { echo '<br>Save:'; _debug_array($data); }
$GLOBALS['phpgw']->session->appsession('session_data','addressbook',$data);
}
}
@ -185,14 +217,11 @@
function read_sessiondata()
{
$data = $GLOBALS['phpgw']->session->appsession('session_data','addressbook');
if($this->debug)
{
echo '<br>Read:'; _debug_array($data);
}
if($this->debug) { echo '<br>Read:'; _debug_array($data); }
$this->start = $data['start'];
$this->limit = $data['limit'];
$this->query = $data['query'];
$this->cquery = $data['cquery'];
$this->sort = $data['sort'];
$this->order = $data['order'];
$this->filter = $data['filter'];
@ -202,15 +231,15 @@
function strip_html($dirty = '')
{
if($dirty == '')
if ($dirty == '')
{
$dirty = array();
}
for($i=0;$i<count($dirty);$i++)
{
if(is_array($dirty[$i]))
if(gettype($dirty[$i]) == 'array')
{
while(list($name,$value) = @each($dirty[$i]))
while (list($name,$value) = @each($dirty[$i]))
{
$cleaned[$i][$name] = $GLOBALS['phpgw']->strip_html($dirty[$i][$name]);
}
@ -227,11 +256,8 @@
{
$entries = $this->so->read_entries($data);
$this->total = $this->so->contacts->total_records;
if($this->debug)
{
echo '<br>Total records="' . $this->total . '"';
}
return $this->strip_html($entries);
if($this->debug) { echo '<br>Total records="' . $this->total . '"'; }
return (is_array($entries) ? $this->strip_html($entries) : array());
}
function read_entry($data)
@ -248,7 +274,7 @@
function add_vcard()
{
$uploadedfile = $GLOBALS['HTTP_POST_VARS']['uploadedfile'];
global $uploadedfile;
if($uploadedfile == 'none' || $uploadedfile == '')
{
@ -289,15 +315,11 @@
function add_email()
{
$name = $GLOBALS['HTTP_GET_VARS']['name'];
$referer = $GLOBALS['HTTP_GET_VARS']['referer'];
global $name,$referer;
$named = explode(' ', $name);
for($i=count($named);$i>=0;$i--)
{
$names[$i] = $named[$i];
}
if($names[2])
for ($i=count($named);$i>=0;$i--) { $names[$i] = $named[$i]; }
if ($names[2])
{
$fields['n_given'] = $names[0];
$fields['n_middle'] = $names[1];
@ -341,13 +363,13 @@
function save_preferences($prefs,$other,$qfields,$fcat_id)
{
$GLOBALS['phpgw']->preferences->read_repository();
if(is_array($prefs))
if (is_array($prefs))
{
/* _debug_array($prefs);exit; */
while(list($pref,$x) = each($qfields))
while (list($pref,$x) = each($qfields))
{
/* echo '<br>checking: ' . $pref . '=' . $prefs[$pref]; */
if($prefs[$pref] == 'on')
if ($prefs[$pref] == 'on')
{
$GLOBALS['phpgw']->preferences->add('addressbook',$pref,'addressbook_on');
}
@ -361,29 +383,26 @@
if(is_array($other))
{
$GLOBALS['phpgw']->preferences->delete('addressbook','mainscreen_showbirthdays');
if($other['mainscreen_showbirthdays'])
if ($other['mainscreen_showbirthdays'])
{
$GLOBALS['phpgw']->preferences->add('addressbook','mainscreen_showbirthdays',True);
}
$GLOBALS['phpgw']->preferences->delete('addressbook','default_filter');
if($other['default_filter'])
if ($other['default_filter'])
{
$GLOBALS['phpgw']->preferences->add('addressbook','default_filter',$other['default_filter']);
}
$GLOBALS['phpgw']->preferences->delete('addressbook','autosave_category');
if($other['autosave_category'])
if ($other['autosave_category'])
{
$GLOBALS['phpgw']->preferences->add('addressbook','autosave_category',True);
}
}
if($fcat_id)
{
$GLOBALS['phpgw']->preferences->delete('addressbook','default_category');
$GLOBALS['phpgw']->preferences->add('addressbook','default_category',$fcat_id);
}
$GLOBALS['phpgw']->preferences->delete('addressbook','default_category');
$GLOBALS['phpgw']->preferences->add('addressbook','default_category',$fcat_id);
$GLOBALS['phpgw']->preferences->save_repository(True);
/* _debug_array($prefs);exit; */

View File

@ -1,134 +0,0 @@
<?php
/**************************************************************************\
* phpGroupWare - addressbook *
* http://www.phpgroupware.org *
* Written by Joseph Engo <jengo@mail.com> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
class remote
{
var $servers = array(
'BigFoot' => array(
'host' => 'ldap.bigfoot.com',
'basedn' => '',
'search' => 'cn',
'attrs' => 'mail,cn,o,surname,givenname',
'enabled' => True
),
);
var $serverid = '';
var $ldap = 0;
function remote($serverid='BigFoot')
{
$GLOBALS['phpgw']->db->query("SELECT * FROM phpgw_addressbook_servers",__LINE__,__FILE__);
while ($GLOBALS['phpgw']->db->next_record())
{
if ($GLOBALS['phpgw']->db->f('name'))
{
$this->servers[$GLOBALS['phpgw']->db->f('name')] = array(
'host' => $GLOBALS['phpgw']->db->f('host'),
'basedn' => $GLOBALS['phpgw']->db->f('basedn'),
'search' => $GLOBALS['phpgw']->db->f('search'),
'attrs' => $GLOBALS['phpgw']->db->f('attrs'),
'enabled' => $GLOBALS['phpgw']->db->f('enabled')
);
}
}
$this->serverid = $serverid;
$this->ldap = $this->_connect($this->serverid);
//$this->search();
}
function _connect($serverid='BigFoot')
{
if (!$ds = ldap_connect($this->servers[$serverid]['host']))
{
printf("<b>Error: Can't connect to LDAP server %s!</b><br>",$this->servers[$serverid]['host']);
return False;
}
@ldap_bind($ds);
return $ds;
}
function search($query='')
{
if(!$query)
{
return;
}
if(isset($this->servers[$this->serverid]['attrs']))
{
$attrs = explode(',',$this->servers[$this->serverid]['attrs']);
$found = ldap_search($this->ldap,$this->servers[$this->serverid]['basedn'],$this->servers[$this->serverid]['search'] . '=*' . $query . '*',$attrs);
}
else
{
$found = ldap_search($this->ldap,$this->servers[$this->serverid]['basedn'],$this->servers[$this->serverid]['search'] . '=*' . $query . '*');
}
$ldap_fields = @ldap_get_entries($this->ldap, $found);
$out = $this->clean($ldap_fields);
$out = $this->convert($out);
return $out;
}
function clean($value)
{
if(!is_int($value) && ($value != 'count'))
{
if(is_array($value))
{
while(list($x,$y) = @each($value))
{
/* Fill a new output array, but do not include things like array( 0 => mail) */
if(isset($this->servers[$this->serverid]['attrs']) &&
!@in_array($y,explode(',',$this->servers[$this->serverid]['attrs'])))
{
$out[$x] = $this->clean($y);
}
}
unset($out['count']);
return $out;
}
else
{
return $value;
}
}
}
function convert($in='')
{
if(is_array($in))
{
while(list($key,$value) = each($in))
{
$out[] = array(
'fn' => $value['cn'][0],
'n_family' => $value['sn'][0] ? $value['sn'][0] : $value['surname'][0],
'email' => $value['mail'][0],
'owner' => $GLOBALS['phpgw_info']['user']['account_id']
);
}
return $out;
}
else
{
return $in;
}
}
}
?>

View File

@ -65,14 +65,13 @@
$data['query'],
$data['filter'],
$data['sort'],
$data['order'],
$data['cquery']
$data['order']
);
}
function read_entry($id,$fields)
{
if($this->rights & PHPGW_ACL_READ)
if ($this->rights & PHPGW_ACL_READ)
{
return $this->contacts->read_single_entry($id,$fields);
}
@ -85,7 +84,7 @@
function read_last_entry($fields)
{
if($this->rights & PHPGW_ACL_READ)
if ($this->rights & PHPGW_ACL_READ)
{
return $this->contacts->read_last_entry($fields);
}
@ -103,7 +102,7 @@
{
$fields['tid'] = 'n';
}
if($this->rights & PHPGW_ACL_ADD)
if ($this->rights & PHPGW_ACL_ADD)
{
$ab_id = $fields['ab_id'];
$owner = $fields['owner'];
@ -130,26 +129,27 @@
function update_entry($fields)
{
if($this->rights & PHPGW_ACL_EDIT)
if ($this->rights & PHPGW_ACL_EDIT)
{
$ab_id = $fields['ab_id'];
$owner = $fields['owner'];
$access = $fields['access'];
$cat_id = $fields['cat_id'];
$tid = $fields['tid'];
unset($fields['owner']);
unset($fields['access']);
unset($fields['cat_id']);
unset($fields['ab_id']);
unset($fields['tid']);
$this->contacts->update($ab_id,$owner,$fields,$access,$cat_id);
$this->contacts->update($ab_id,$owner,$fields,$access,$cat_id,$tid);
}
return;
}
function delete_entry($data)
{
if($this->rights & PHPGW_ACL_DELETE)
if ($this->rights & PHPGW_ACL_DELETE)
{
$this->contacts->delete($data['id']);
}

View File

@ -14,7 +14,7 @@
class uiXport
{
var $output = '';
var $template;
var $public_functions = array(
'import' => True,
'export' => True
@ -32,6 +32,7 @@
function uiXport()
{
$this->template = $GLOBALS['phpgw']->template;
$this->cat = CreateObject('phpgwapi.categories');
$this->bo = CreateObject('addressbook.boXport',True);
$this->browser = CreateObject('phpgwapi.browser');
@ -45,28 +46,19 @@
$this->cat_id = $this->bo->cat_id;
}
function totpl()
{
if(@isset($this->output) && !empty($this->output))
{
$GLOBALS['phpgw']->template->set_var('phpgw_body', $this->output,True);
unset($this->output);
}
}
/* Return a select form element with the categories option dialog in it */
function cat_option($cat_id='',$notall=False,$java=True,$multiple=False)
{
if($java)
if ($java)
{
$jselect = ' onChange="this.form.submit();"';
}
/* Setup all and none first */
$cats_link = "\n" .'<select name="fcat_id'.($multiple?'[]':'').'"' .$jselect . ($multiple ? 'multiple size="3"' : '') . ">\n";
if(!$notall)
if (!$notall)
{
$cats_link .= '<option value=""';
if($cat_id=='all')
if ($cat_id=='all')
{
$cats_link .= ' selected';
}
@ -74,7 +66,7 @@
}
/* Get global and app-specific category listings */
$cats_link .= $this->cat->formatted_list('select','all',$cat_id,True);
$cats_link .= $this->cat->formated_list('select','all',$cat_id,True);
$cats_link .= '</select>'."\n";
return $cats_link;
}
@ -83,11 +75,11 @@
{
global $convert,$download,$tsvfile,$private,$conv_type,$fcat_id;
if($convert)
if ($convert)
{
$buffer = $this->bo->import($tsvfile,$conv_type,$private,$fcat_id);
if($download == '')
if ($download == '')
{
if($conv_type == 'Debug LDAP' || $conv_type == 'Debug SQL' )
{
@ -98,30 +90,36 @@
else
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
echo "<pre>$buffer</pre>";
echo '<a href="'.$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index') . '">'.lang('OK').'</a>';
$GLOBALS['phpgw']->common->phpgw_footer();
}
}
else
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
echo "<pre>$buffer</pre>";
echo '<a href="'.$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'). '">'.lang('OK').'</a>';
$GLOBALS['phpgw']->common->phpgw_footer();
}
}
else
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
set_time_limit(0);
$GLOBALS['phpgw']->template->set_file(array('import' => 'import.tpl'));
$this->template->set_file(array('import' => 'import.tpl'));
$dir_handle = opendir(PHPGW_APP_INC . SEP . 'import');
$i=0; $myfilearray = '';
while($file = readdir($dir_handle))
while ($file = readdir($dir_handle))
{
if((substr($file, 0, 1) != '.') && is_file(PHPGW_APP_INC . SEP . 'import' . SEP . $file) )
if ((substr($file, 0, 1) != '.') && is_file(PHPGW_APP_INC . SEP . 'import' . SEP . $file) )
{
$myfilearray[$i] = $file;
$i++;
@ -129,92 +127,87 @@
}
closedir($dir_handle);
sort($myfilearray);
for($i=0;$i<count($myfilearray);$i++)
for ($i=0;$i<count($myfilearray);$i++)
{
$fname = ereg_replace('_',' ',$myfilearray[$i]);
$conv .= '<OPTION VALUE="' . $myfilearray[$i].'">' . $fname . '</OPTION>';
}
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
$GLOBALS['phpgw']->template->set_var('lang_cat',lang('Select Category'));
$GLOBALS['phpgw']->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
$GLOBALS['phpgw']->template->set_var('conversion',lang('Select the type of conversion'));
$GLOBALS['phpgw']->template->set_var('export_path',lang('Enter the path to the export file here'));
$GLOBALS['phpgw']->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']);
$GLOBALS['phpgw']->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']);
$GLOBALS['phpgw']->template->set_var('mark_private',lang('Mark records as private'));
$GLOBALS['phpgw']->template->set_var('help_import',lang('In Netscape, open the Addressbook and select <b>Export</b> from the <b>File</b> menu.<br>The file exported will be in LDIF format.<P>Or, in Outlook, select your Contacts folder, select <b>Import and Export...</b> from'));
$GLOBALS['phpgw']->template->set_var('help_import2',lang('the <b>File</b> menu and export your contacts into a comma separated text (CSV) file. <P>Or, in Palm Desktop 4.0 or greater, visit your addressbook and select <b>Export</b> from the <b>File</b> menu. The file exported will be in VCard format.<P>'));
$GLOBALS['phpgw']->template->set_var('none',lang('none'));
$GLOBALS['phpgw']->template->set_var('debug_browser',lang('Debug output in browser'));
$GLOBALS['phpgw']->template->set_var('import_text',lang('Import from LDIF, CSV, or VCard'));
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.import'));
$GLOBALS['phpgw']->template->set_var('cat_link',$this->cat_option($this->cat_id,True,False));
$GLOBALS['phpgw']->template->set_var('tsvfilename','');
$GLOBALS['phpgw']->template->set_var('conv',$conv);
$GLOBALS['phpgw']->template->set_var('debug',lang('Debug output in browser'));
$GLOBALS['phpgw']->template->set_var('filetype',lang('LDIF'));
$GLOBALS['phpgw']->template->set_var('download',lang('Submit'));
$GLOBALS['phpgw']->template->set_var('start',$this->start);
$GLOBALS['phpgw']->template->set_var('sort',$this->sort);
$GLOBALS['phpgw']->template->set_var('order',$this->order);
$GLOBALS['phpgw']->template->set_var('filter',$this->filter);
$GLOBALS['phpgw']->template->set_var('query',$this->query);
$GLOBALS['phpgw']->template->set_var('cat_id',$this->cat_id);
$this->output = $GLOBALS['phpgw']->template->fp('out','import');
$this->totpl();
$this->template->set_var('lang_cancel',lang('Cancel'));
$this->template->set_var('lang_cat',lang('Select Category'));
$this->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
$this->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']);
$this->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']);
$this->template->set_var('import_text',lang('Import from LDIF, CSV, or VCard'));
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.import'));
$this->template->set_var('cat_link',$this->cat_option($this->cat_id,True,False));
$this->template->set_var('tsvfilename','');
$this->template->set_var('conv',$conv);
$this->template->set_var('debug',lang('Debug output in browser'));
$this->template->set_var('filetype',lang('LDIF'));
$this->template->set_var('download',lang('Submit'));
$this->template->set_var('start',$this->start);
$this->template->set_var('sort',$this->sort);
$this->template->set_var('order',$this->order);
$this->template->set_var('filter',$this->filter);
$this->template->set_var('query',$this->query);
$this->template->set_var('cat_id',$this->cat_id);
$this->template->pparse('out','import');
}
// $GLOBALS['phpgw']->common->phpgw_footer();
}
function export()
{
global $convert,$tsvfilename,$cat_id,$download,$conv_type;
if($convert)
if ($convert)
{
if($conv_type == 'none')
if ($conv_type == 'none')
{
$GLOBALS['phpgw_info']['flags']['noheader'] = False;
$GLOBALS['phpgw_info']['flags']['noheader'] = True;
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
echo lang('<b>No conversion type &lt;none&gt; could be located.</b> Please choose a conversion type from the list');
echo '&nbsp<a href="'.$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export') . '">' . lang('OK') . '</a>';
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->common->phpgw_footer();
$GLOBALS['phpgw']->common->phpgw_exit();
}
$buffer = $this->bo->export($conv_type,$cat_id);
if(($download == 'on') || ($conv_type == 'Palm_PDB'))
if(($download == 'on') || ($conv_type == 'Palm_PDB') )
{
// filename, default application/octet-stream, length of file, default nocache True
$this->browser->content_header($tsvfilename,'application/x-octet-stream',strlen($buffer));
echo $buffer;
exit;
}
else
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
echo "<pre>\n";
echo $buffer;
echo "\n</pre>\n";
echo '<a href="'.$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export') . '">' . lang('OK') . '</a>';
$GLOBALS['phpgw']->common->phpgw_footer();
}
}
else
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
set_time_limit(0);
$GLOBALS['phpgw']->template->set_file(array('export' => 'export.tpl'));
$this->template->set_file(array('export' => 'export.tpl'));
$dir_handle = opendir(PHPGW_APP_INC. SEP . 'export');
$i=0; $myfilearray = '';
while($file = readdir($dir_handle))
while ($file = readdir($dir_handle))
{
if((substr($file, 0, 1) != '.') && is_file(PHPGW_APP_INC . SEP . 'export' . SEP . $file) )
if ((substr($file, 0, 1) != '.') && is_file(PHPGW_APP_INC . SEP . 'export' . SEP . $file) )
{
$myfilearray[$i] = $file;
$i++;
@ -222,36 +215,33 @@
}
closedir($dir_handle);
sort($myfilearray);
for($i=0;$i<count($myfilearray);$i++)
for ($i=0;$i<count($myfilearray);$i++)
{
$fname = ereg_replace('_',' ',$myfilearray[$i]);
$conv .= ' <option value="'.$myfilearray[$i].'">'.$fname.'</option>'."\n";
}
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
$GLOBALS['phpgw']->template->set_var('lang_cat',lang('Select Category'));
$GLOBALS['phpgw']->template->set_var('cat_link',$this->cat_option($this->cat_id,False,False));
$GLOBALS['phpgw']->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/addressbook/index.php'));
$GLOBALS['phpgw']->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']);
$GLOBALS['phpgw']->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']);
$GLOBALS['phpgw']->template->set_var('export_text',lang('Export from Addressbook'));
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export'));
$GLOBALS['phpgw']->template->set_var('filename',lang('Export file name'));
$GLOBALS['phpgw']->template->set_var('conversion',lang('Select the type of conversion'));
$GLOBALS['phpgw']->template->set_var('conv',$conv);
$GLOBALS['phpgw']->template->set_var('debug',lang(''));
$GLOBALS['phpgw']->template->set_var('download',lang('Submit'));
$GLOBALS['phpgw']->template->set_var('download_export',lang('Download export file (Uncheck to debug output in browser)'));
$GLOBALS['phpgw']->template->set_var('none',lang('none'));
$GLOBALS['phpgw']->template->set_var('start',$this->start);
$GLOBALS['phpgw']->template->set_var('sort',$this->sort);
$GLOBALS['phpgw']->template->set_var('order',$this->order);
$GLOBALS['phpgw']->template->set_var('filter',$this->filter);
$GLOBALS['phpgw']->template->set_var('query',$this->query);
$GLOBALS['phpgw']->template->set_var('cat_id',$this->cat_id);
$this->template->set_var('lang_cancel',lang('Cancel'));
$this->template->set_var('lang_cat',lang('Select Category'));
$this->template->set_var('cat_link',$this->cat_option($this->cat_id,False,False));
$this->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/addressbook/index.php'));
$this->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']);
$this->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']);
$this->template->set_var('export_text',lang('Export from Addressbook'));
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export'));
$this->template->set_var('filename',lang('Export file name'));
$this->template->set_var('conv',$conv);
$this->template->set_var('debug',lang(''));
$this->template->set_var('download',lang('Submit'));
$this->template->set_var('start',$this->start);
$this->template->set_var('sort',$this->sort);
$this->template->set_var('order',$this->order);
$this->template->set_var('filter',$this->filter);
$this->template->set_var('query',$this->query);
$this->template->set_var('cat_id',$this->cat_id);
$this->template->pparse('out','export');
$this->output = $GLOBALS['phpgw']->template->fp('out','export');
$this->totpl();
$GLOBALS['phpgw']->common->phpgw_footer();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -24,8 +24,8 @@
function uifields()
{
// $GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
// $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs');
$GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs');
$this->config = CreateObject('phpgwapi.config','addressbook');
}
@ -34,9 +34,9 @@
if(!$GLOBALS['phpgw']->acl->check('run',1,'admin'))
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
echo lang('access not permitted');
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->common->phpgw_exit();
}
$GLOBALS['phpgw']->template->set_file(array(
@ -80,6 +80,7 @@
$total_records = count($fields);
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$GLOBALS['phpgw']->template->set_var('left',$GLOBALS['phpgw']->nextmatchs->left('/index.php',$start,$total_records,'menuaction=addressbook.uifields.index'));
$GLOBALS['phpgw']->template->set_var('right',$GLOBALS['phpgw']->nextmatchs->right('/index.php',$start,$total_records,'menuaction=addressbook.uifields.index'));
@ -128,9 +129,9 @@
if(!$GLOBALS['phpgw']->acl->check('run',1,'admin'))
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
echo lang('access not permitted');
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->common->phpgw_exit();
}
$field = stripslashes($GLOBALS['HTTP_POST_VARS']['field']);
@ -166,6 +167,7 @@
}
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
if($errorcount)
{
@ -204,9 +206,9 @@
if(!$GLOBALS['phpgw']->acl->check('run',1,'admin'))
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
echo lang('access not permitted');
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->common->phpgw_exit();
}
$field = stripslashes($GLOBALS['HTTP_POST_VARS']['field'] ? $GLOBALS['HTTP_POST_VARS']['field'] : $GLOBALS['HTTP_GET_VARS']['field']);
@ -245,6 +247,7 @@
}
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
if($errorcount)
{
@ -296,9 +299,9 @@
if(!$GLOBALS['phpgw']->acl->check('run',1,'admin'))
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
echo lang('access not permitted');
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->common->phpgw_exit();
}
$field = $GLOBALS['HTTP_POST_VARS']['field'] ? $GLOBALS['HTTP_POST_VARS']['field'] : $GLOBALS['HTTP_GET_VARS']['field'];
@ -320,6 +323,7 @@
else
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$hidden_vars = '<input type="hidden" name="sort" value="' . $sort . '">' . "\n"
. '<input type="hidden" name="order" value="' . $order .'">' . "\n"

View File

@ -26,7 +26,7 @@
'out' => True
);
var $extrafields = array(
var $extrafields = array(
'ophone' => 'ophone',
'address2' => 'address2',
'address3' => 'address3'
@ -43,13 +43,14 @@
function in()
{
$action = $GLOBALS['HTTP_POST_VARS']['action'];
$action = $GLOBALS['HTTP_POST_VARS']['action'] ? $GLOBALS['HTTP_POST_VARS']['action'] : $GLOBALS['HTTP_GET_VARS']['action'];
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
echo '<body bgcolor="' . $GLOBALS['phpgw_info']['theme']['bg_color'] . '">';
if($action == 'GetFile')
if ($action == 'GetFile')
{
echo '<b><center>' . lang('You must select a vcard. (*.vcf)') . '</b></center><br><br>';
}
@ -64,43 +65,39 @@
$this->template->set_var('group_option',$group_option);
$this->template->pparse('out','vcardin');
$GLOBALS['phpgw']->common->phpgw_footer();
}
function out()
{
$ab_id = get_var('ab_id',array('GET','POST'));
$nolname = get_var('nolname',array('GET','POST'));
$nofname = get_var('nofname',array('GET','POST'));
$ab_id = $GLOBALS['HTTP_GET_VARS']['ab_id'] ? $GLOBALS['HTTP_GET_VARS']['ab_id'] : $GLOBALS['HTTP_POST_VARS']['ab_id'];
$nolname = $GLOBALS['HTTP_GET_VARS']['nolname'];
$nofname = $GLOBALS['HTTP_GET_VARS']['nofname'];
if($nolname || $nofname)
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
}
if(!$ab_id)
{
Header('Location: ' . $GLOBALS['phpgw']->link('/addressbook/index.php'));
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->common->phpgw_exit();
}
// First, make sure they have permission to this entry
$check = $this->bo->read_entry(array(
'id' => $ab_id,
'fields' => array(
'owner' => 'owner'
)
));
$check = $this->bo->read_entry(array('id' => $ab_id, 'fields' => array('owner' => 'owner')));
$perms = $this->contacts->check_perms($this->contacts->grants[$check[0]['owner']],PHPGW_ACL_READ);
if((!$perms) && ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id']))
if ( (!$perms) && ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id']) )
{
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.get_list'));
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
Header("Location: " . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.get_list'));
$GLOBALS['phpgw']->common->phpgw_exit();
}
$extrafields = array('address2' => 'address2');
$extrafields = array('address2' => 'address2');
$qfields = $this->contacts->stock_contact_fields + $extrafields;
$fieldlist = $this->bo->read_entry(array('id' => $ab_id, 'fields' => $qfields));
@ -127,49 +124,50 @@
if($lastname == '')
{
/* Run away here. */
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.out&nolname=1&ab_id=' . $ab_id));
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uivcard.out&nolname=1&ab_id=$ab_id"));
}
if($firstname == '')
{
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.out&nofname=1&ab_id=' . $ab_id));
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uivcard.out&nofname=1&ab_id=$ab_id"));
}
if ($email)
{
$fn = explode('@',$email);
$filename = sprintf('%s.vcf', $fn[0]);
$filename = sprintf("%s.vcf", $fn[0]);
}
elseif ($hemail)
{
$fn = explode('@',$hemail);
$filename = sprintf('%s.vcf', $fn[0]);
$filename = sprintf("%s.vcf", $fn[0]);
}
else
{
$fn = strtolower($firstname);
$filename = sprintf('%s.vcf', $fn);
$filename = sprintf("%s.vcf", $fn);
}
// set translation variable
$myexport = $this->vcard->export;
// check that each $fields exists in the export array and
// set a new array to equal the translation and original value
while(list($name,$value) = each($fields))
while( list($name,$value) = each($fields) )
{
if($myexport[$name] && ($value != ''))
if ($myexport[$name] && ($value != "") )
{
//echo '<br>'.$name.'='.$fields[$name]."\n";
//echo '<br>'.$name."=".$fields[$name]."\n";
$buffer[$myexport[$name]] = $value;
}
}
// create a vcard from this translated array
$entry = $this->vcard->out($buffer);
$entry = $this->vcard->out($buffer);
// print it using browser class for headers
// filename, mimetype, no length, default nocache True
$this->browser->content_header($filename,'text/x-vcard');
echo $entry;
$GLOBALS['phpgw']->common->exit;
exit;
//$GLOBALS['phpgw']->common->exit;
} /* !nolname && !nofname */
if($nofname)
@ -177,7 +175,8 @@
echo '<br><br><center>';
echo lang("This person's first name was not in the address book.") .'<br>';
echo lang('Vcards require a first name entry.') . '<br><br>';
echo '<a href="' . $GLOBALS['phpgw']->link('/addressbook/index.php') . '">' . lang('OK') . '</a>';
echo '<a href="' . $GLOBALS['phpgw']->link('/addressbook/index.php',
"order=$order&start=$start&filter=$filter&query=$query&sort=$sort&cat_id=$cat_id") . '">' . lang('OK') . '</a>';
echo '</center>';
}
@ -186,9 +185,15 @@
echo '<br><br><center>';
echo lang("This person's last name was not in the address book.") . '<br>';
echo lang('Vcards require a last name entry.') . '<br><br>';
echo '<a href="' . $GLOBALS['phpgw']->link('/addressbook/index.php') . '">' . lang('OK') . '</a>';
echo '<a href="' . $GLOBALS['phpgw']->link('/addressbook/index.php',
"order=$order&start=$start&filter=$filter&query=$query&sort=$sort&cat_id=$cat_id") . '">' . lang('OK') . '</a>';
echo '</center>';
}
if($nolname || $nofname)
{
//$GLOBALS['phpgw']->common->phpgw_footer();
}
}
}
?>

View File

@ -43,8 +43,6 @@
/* Return a select form element with the categories option dialog in it */
function cat_option($cat_id='',$notall=False,$java=True,$multiple=False)
{
global $phpgw;
if ($java)
{
$jselect = ' onChange="this.form.submit();"';
@ -62,7 +60,7 @@
}
/* Get global and app-specific category listings */
$cats_link .= $phpgw->categories->formatted_list('select','all',$cat_id,True);
$cats_link .= $GLOBALS['phpgw']->categories->formated_list('select','all',$cat_id,True);
$cats_link .= '</select>'."\n";
return $cats_link;
}
@ -134,12 +132,10 @@
function read_custom_fields()
{
global $phpgw_info;
$i = 0; $j = 0;
$fields = array();
@reset($phpgw_info['user']['preferences']['addressbook']);
while (list($col,$descr) = @each($phpgw_info['user']['preferences']['addressbook']))
@reset($GLOBALS['phpgw_info']['user']['preferences']['addressbook']);
while (list($col,$descr) = @each($GLOBALS['phpgw_info']['user']['preferences']['addressbook']))
{
if ( substr($col,0,6) == 'extra_' )
{
@ -166,17 +162,15 @@
function save_custom_field($old='',$new='')
{
global $phpgw,$phpgw_info;
$phpgw->preferences->read_repository($phpgw_info['user']['account_id']);
$GLOBALS['phpgw']->preferences->read_repository($GLOBALS['phpgw_info']['user']['account_id']);
if ($old)
{
$phpgw->preferences->delete("addressbook","extra_".$old);
$GLOBALS['phpgw']->preferences->delete("addressbook","extra_".$old);
}
if($new)
{
$phpgw->preferences->add("addressbook","extra_".$new);
$GLOBALS['phpgw']->preferences->add("addressbook","extra_".$new);
}
$phpgw->preferences->save_repository(1);
$GLOBALS['phpgw']->preferences->save_repository(1);
}
?>

View File

@ -2,24 +2,24 @@
/**************************************************************************\
* phpGroupWare *
* http://www.phpgroupware.org *
* Written by coreteam <phpgroupware-developers@gnu.org> *
* ----------------------------------------------------- *
* Written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
{
// Only Modify the $file variable.....
$file = Array
(
'Site Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
'Edit custom fields' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'),
'Global Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname . '&global_cats=True')
);
//Do not modify below this line
$GLOBALS['phpgw']->common->display_mainscreen($appname,$file);
}
?>
// $Id$
// $Source$
// Only Modify the $file and $title variables.....
$title = $appname;
$file = Array(
'Site Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
'Edit custom fields' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'),
'Global Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=addressbook')
);
//Do not modify below this line
display_section($appname,$title,$file);
?>

View File

@ -1,41 +0,0 @@
<?php
/**************************************************************************\
* phpGroupWare - Addressbook hook_help *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
include(PHPGW_SERVER_ROOT.'/'.'addressbook'.'/setup/setup.inc.php');
$GLOBALS['phpgw']->help->set_params(array('app_name' => 'addressbook',
'title' => lang('addressbook'),
'app_version' => $setup_info['addressbook']['version']));
$GLOBALS['phpgw']->help->data[] = array
(
'text' => lang('owerview'),
'link' => $GLOBALS['phpgw']->help->check_help_file('overview.php'),
'lang_link_statustext' => lang('owerview')
);
$GLOBALS['phpgw']->help->data[] = array
(
'text' => lang('list'),
'link' => $GLOBALS['phpgw']->help->check_help_file('list.php'),
'lang_link_statustext' => lang('list')
);
$GLOBALS['phpgw']->help->data[] = array
(
'text' => lang('add'),
'link' => $GLOBALS['phpgw']->help->check_help_file('add.php'),
'lang_link_statustext' => lang('add')
);
$GLOBALS['phpgw']->help->draw();
?>

View File

@ -1,55 +1,83 @@
<?php
/**************************************************************************\
* phpGroupWare - Addressbook hook_home *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/**************************************************************************\
* phpGroupWare - E-Mail *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$d1 = strtolower(substr(PHPGW_APP_INC,0,3));
if($d1 == 'htt' || $d1 == 'ftp' )
{
echo "Failed attempt to break in via an old Security Hole!<br>\n";
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->common->phpgw_exit();
}
unset($d1);
if ($GLOBALS['phpgw_info']['user']['apps']['addressbook']
&& $GLOBALS['phpgw_info']['user']['preferences']['addressbook']['mainscreen_showbirthdays'])
{
echo "\n<!-- Birthday info -->\n";
$c = CreateObject('phpgwapi.contacts');
$qfields = array
(
$qfields = array(
'n_given' => 'n_given',
'n_family' => 'n_family',
'bday' => 'bday'
);
$now = time() - ((60 * 60) * intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']));
$today = $GLOBALS['phpgw']->common->show_date($now,'n/d/');
$bdays = $c->read(0,15,$qfields,$today,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']);
$title = '<center><font color="#FFFFFF">'.lang('Birthdays').'</font></center>';
$portalbox = CreateObject('phpgwapi.listbox',
Array(
'title' => $title,
'primary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
'secondary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
'tertiary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
'width' => '100%',
'outerborderwidth' => '0',
'header_background_image' => $GLOBALS['phpgw']->common->image('phpgwapi/templates/default','bg_filler')
)
);
$app_id = $GLOBALS['phpgw']->applications->name2id('addressbook');
$GLOBALS['portal_order'][] = $app_id;
$var = Array(
'up' => Array('url' => '/set_box.php', 'app' => $app_id),
'down' => Array('url' => '/set_box.php', 'app' => $app_id),
'close' => Array('url' => '/set_box.php', 'app' => $app_id),
'question' => Array('url' => '/set_box.php', 'app' => $app_id),
'edit' => Array('url' => '/set_box.php', 'app' => $app_id)
);
while(list($key,$value) = each($var))
{
$portalbox->set_controls($key,$value);
}
$portalbox->data = Array();
$GLOBALS['phpgw']->portalbox->set_params(array('app_id' => $app_id,
'title' => lang('addressbook')));
while(list($key,$val) = @each($bdays))
{
if (substr($val['bday'],0,strlen($today)) == $today)
{
$GLOBALS['phpgw']->portalbox->data[] = array
(
'text' => lang("Today is %1's birthday!", $val['n_given'] . ' ' . $val['n_family']),
'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $val['id']),
'lang_link_statustext' => lang('show contact')
$portalbox->data[] = array(
'text' => lang("Today is %1's birthday!", $val['n_given'] . ' ' . $val['n_family']),
'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $val['id'])
);
}
// $tmp = '<a href="'
// . $GLOBALS['phpgw']->link('/addressbook/view.php','ab_id=' . $val['id']) . '">'
// . $val['n_given'] . ' ' . $val['n_family'] . '</a>';
// echo '<tr><td align="left">' . lang("Today is %1's birthday!", $tmp) . '</td></tr>' . "\n";
}
$tomorrow = $GLOBALS['phpgw']->common->show_date($now + 86400,'n/d/');
@ -60,14 +88,21 @@
{
if (substr($val['bday'],0,strlen($tomorrow)) == $tomorrow)
{
$GLOBALS['phpgw']->portalbox->data[] = array
(
'text' => lang("Tomorrow is %1's birthday.", $val['n_given'] . ' ' . $val['n_family']),
'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='.$val['id']),
'lang_link_statustext' => lang('show contact')
$portalbox->data[] = array(
'text' => lang("Tomorrow is %1's birthday.",$val['n_given'] . ' ' . $val['n_family']),
'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='.$val['id'])
);
}
// $tmp = '<a href="'
// . $GLOBALS['phpgw']->link('/addressbook/view.php','ab_id=' . $val['id']) . '">'
// . $val['n_given'] . ' ' . $val["n_family"] . '</a>';
// echo '<tr><td align="left">' . lang("Tomorrow is %1's birthday.", $tmp) . '</td></tr>' . "\n";
}
$GLOBALS['phpgw']->portalbox->draw();
if(count($portalbox->data))
{
echo $portalbox->draw();
}
unset($portalbox);
echo "\n<!-- Birthday info -->\n";
}
?>

View File

@ -0,0 +1,19 @@
<?php
/**************************************************************************\
* phpGroupWare - Calendar Holidays *
* http://www.phpgroupware.org *
* Written by Mark Peters <skeeter@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
// Only Modify the $file variable.....
$file = Array();
//Do not modify below this line
display_manual_section($appname,$file);
?>

View File

@ -15,8 +15,7 @@
if($d1 == 'htt' || $d1 == 'ftp' )
{
echo "Failed attempt to break in via an old Security Hole!<br>\n";
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->common->phpgw_exit();
}
unset($d1);

View File

@ -1,10 +1,10 @@
<?php
/**************************************************************************\
* phpGroupWare - Addressbook *
* phpGroupWare - Messenger *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This application written by Joseph Engo <jengo@phpgroupware.org> *
* and Miles Lott<milosch@phpgroupware.org> *
* -------------------------------------------- *
* Funding for this program was provided by http://www.checkwithmom.com *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
@ -17,10 +17,14 @@
$GLOBALS['phpgw_info'] = array();
$GLOBALS['phpgw_info']['flags'] = array(
'currentapp' => 'addressbook'
'currentapp' => 'addressbook',
'noheader' => True,
'nonavbar' => True
);
include('../header.inc.php');
$obj = CreateObject('addressbook.uiaddressbook');
$obj->index();
$GLOBALS['phpgw']->common->phpgw_footer();
?>

View File

@ -1,15 +1,19 @@
%1 records imported addressbook de %1 Datensätze importiert
%1 records read (not yet imported, you may go %2back%3 and uncheck test import) addressbook de %1 Datensätze gelesen (noch nicht importiert, sie können %2zurück%3 gehen und Test-Import auschalten)
<b>no conversion type &lt;none&gt; could be located.</b> please choose a conversion type from the list addressbook de <b>Kein Übersetzungstyp &lt;none&gt; konnte gefunden werden.</b> Bitte wählen Sie einen Übersetzungstype aus der Liste
<b>no conversion type <none> could be located.</b> please choose a conversion type from the list addressbook de <b>Kein Übersetzungstyp &lt;none&gt; konnte gefunden werden.</b> Bitte wählen Sie einen Übersetzungstype aus der Liste
@-eval() is only availible to admins!!! addressbook de @-eval() ist nur verfügbar für Administratoren!!!
add a single entry by passing the fields. addressbook de Hinzufügen eines einzelnen Eintrags durch Übergeben der Felder.
add custom field addressbook de Benutzerdefiniertes Feld hinzufügen
address book common de Adressbuch
address book - vcard in addressbook de Adressbuch - VCard in
address book - view addressbook de Adressbuch - Anzeigen
address line 2 addressbook de Adreßzeile 2
address line 3 addressbook de Adreßzeile 3
address type addressbook de Adreßtyp
addressbook common de Adressbuch
addressbook preferences addressbook de Adressbuch Einstellungen
addressbook-fieldname addressbook de Adressbuch Feldname
addvcard addressbook de VCard hinzufügen
alphabet addressbook de a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
alt. csv import addressbook de Alt. CSV Import
are you sure you want to delete this field? addressbook de Sind Sie sicher, dass sie dieses Feld löschen wollen?
bbs phone addressbook de BBS
@ -35,27 +39,32 @@ company name common de Firmenname
contact common de Kontakt
contact application admin de Kontakt Anwendung
contact settings admin de Kontakt Einstellungen
copied by %1, from record #%2. addressbook de Kopiert von %1, vom Datensatz Nr. %2.
country common de Land
csv-fieldname addressbook de CSV-Feldname
csv-filename addressbook de CSV-Dateiname
custom addressbook de Benutzerdefiniert
custom fields addressbook de Benutzerdefinierte Felder
debug output in browser addressbook de Ausgaben zur Fehlersuche im Webbrowser
debug output in browser addressbook de Debugausgaben in Browser
default filter addressbook de Standardfilter
delete a single entry by passing the id. addressbook de Löscht einen einzelnen Eintrag durch Übergabe seiner Id.
department common de Abteilung
domestic addressbook de Wohnung
download export file (uncheck to debug output in browser) addressbook de Exportdatei herunterladen (nicht auswählen um eine Test-Ausgabe im Browser zu bekommen)
download addressbook de Herunterladen
edit custom field addressbook de Benutzerdefiniertes Feld bearbeiten
edit custom fields admin de Benutzerdefinierte Felder bearbeiten
enable remote search admin de Fern-Suche zulassen
enter the path to the export file here addressbook de Geben Sie hier den Pfad zur exportierent Datei an
export contacts addressbook de Kontakte exportieren
export file name addressbook de Dateiname zum Exportieren
export from addressbook addressbook de Export vom Addressbuch
extra addressbook de Extra
fax addressbook de Telefax
fax number common de Telefaxnummer
field name addressbook de Feldname
field %1 has been added ! addressbook de Feld %1 wurde hinzugefügt !
field %1 has been updated ! addressbook de Feld %1 wurde aktualisiert !
field name addressbook de Feldname
fields addressbook de Felder
fields to show in address list addressbook de Felder, die in der Adressliste angezeigt werden sollen
fieldseparator addressbook de Feldtrenner
full name addressbook de vollständiger Name
geo addressbook de GEO
grant addressbook access common de Berechtigungen
@ -68,10 +77,12 @@ home phone addressbook de Tel privat
home state addressbook de Land (priv)
home street addressbook de Straße (priv)
home zip code addressbook de PLZ (priv)
import addressbook de Import
import contacts addressbook de Kontakte importieren
import csv-file into addressbook addressbook de Import CSV-Datei ins Addressbuch
import file addressbook de Datei importieren
import from ldif, csv, or vcard addressbook de Import von LDIF, CSV oder VCard
import from outlook addressbook de Aus Outlook importieren
in netscape, open the addressbook and select <b>export</b> from the <b>file</b> menu.<br>the file exported will be in ldif format.<p>or, in outlook, select your contacts folder, select <b>import and export...</b> from addressbook de
international addressbook de International
isdn phone addressbook de ISDN Tel.
label addressbook de Adreßetikett
@ -79,15 +90,16 @@ ldap context for contacts admin de LDAP Kontext f
ldap host for contacts admin de LDAP Host für Kontakte
ldap root dn for contacts admin de LDAP rootdn für Kontakte
ldap root pw for contacts admin de LDAP Paswort für Kontakte
ldif addressbook de LDIF
line 2 addressbook de Zeile 2
mark records as private addressbook de Einträge als privat markieren
message phone addressbook de Anrufbeantworter
middle name addressbook de Zweiter Vorname
mobile addressbook de Mobil
mobile phone addressbook de Mobil-Telefon
modem phone addressbook de Modem
no vcard addressbook de Keine VCard
none addressbook de keine
number of records to read (<=200) addressbook de Nummer der einzulesenden Datensätze (<= 200)
on addressbook de an
other addressbook de Andere
other number addressbook de andere Nr.
other phone addressbook de Anderes Telefon
@ -96,182 +108,43 @@ parcel addressbook de Lieferadresse
personal addressbook de Persönlich
phone number common de Telefon
phone numbers common de Telefonnummern
please enter a name for that field ! addressbook de Bitte geben sie einen Namen für das Feld an !
please select addressbook de Bitte auswählen
postal common de Postanschrift
pref addressbook de pref
prefix addressbook de Prefix
public key addressbook de öffentlicher Schlüssel
read a list of entries. addressbook de Liest eine Liste von Einträgen.
read a single entry by passing the id and fieldlist. addressbook de Liest einen einzelnen Eintrag über seine Id und Feldliste.
read this list of methods. addressbook de Liest diese Liste der Methoden.
record access addressbook de Zugriffsrechte
record owner addressbook de Datensatz Eigentümer
retrieve contacts admin de Kontakte laden
select the type of conversion addressbook de Art der Umsetzung auswählen
select addressbook de Auswählen
select where you want to store admin de Auswählen wo Sie speichern wollen
show birthday reminders on main screen addressbook de Geburtstags-Mahner auf der Startseite anzeigen
startrecord addressbook de Startdatensatz
state common de Land
street common de Straße
successfully imported %1 records into your addressbook. addressbook de %1 Kontakte wurden erfolgreich in ihr Adressbuch importiert
suffix addressbook de Zusatz
the <b>file</b> menu and export your contacts into a comma separated text (csv) file. <p>or, in palm desktop 4.0 or greater, visit your addressbook and select <b>export</b> from the <b>file</b> menu. the file exported will be in vcard format.<p> addressbook de
test import (show importable records <u>only</u> in browser) addressbook de Test-Import (zeigt importierbare Datensätze <u>nur</u> im Browser an)
that field name has been used already ! addressbook de Dieser Feldname wird bereits benutzt !
this person's first name was not in the address book. addressbook de Der Vorname dieser Person ist nicht im Adressbuch.
this person's last name was not in the address book. addressbook de Der Nachname dieser Person ist nicht im Adressbuch.
today is %1's birthday! common de Heute ist der Geburtstag von %1!
tomorrow is %1's birthday. common de Morgen ist der Geburtstag von %1.
translation addressbook de Übersetzung
update a single entry by passing the fields. addressbook de Aktualisiert einen einzelnen Eintrag durch Übergabe seiner Felder.
use country list addressbook de Länderliste benutzen
vcard common de VCard
vcards require a first name entry. addressbook de VCards benötigen einen Vornamen.
vcards require a last name entry. addressbook de VCards benötigen einen Nachnamen.
video phone addressbook de Bildtelefon
voice phone addressbook de Telefon
warning!! ldap is valid only if you are not using contacts for accounts storage! admin de WARNUNG!! LDAP darf nur verwendet werden, wenn sie die Benutzerkonten nicht im Adressbuch speichern!
work phone addressbook de Tel dienstl.
you appear to be running addressbook de Sie benutzen gerade einen
you must select a vcard. (*.vcf) addressbook de Sie müssen eine VCard auswählen (*.vcf)
you must select at least 1 column to display addressbook de Sie müssen mindestens eine Spalte zum Anzeigen auswählen
zip code common de PLZ
<br>
<b>Fatal error</b>: Call to undefined function: phpgw_exit() in <b>/www/drock/html/cvs_phpgroupware/developer_tools/inc/class.uilangfile.inc.php</b> on line <b>566</b><br>
<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="author" content="phpGroupWare http://www.phpgroupware.org">
<meta name="description" content="phpGroupWare">
<meta name="keywords" content="phpGroupWare">
<meta name="robots" content="noindex">
<link rel="icon" href="favicon.ico" type="image/x-ico">
<link rel="shortcut icon" href="favicon.ico">
<title>phpGroupWare@CVS@granit</title>
<link rel="stylesheet" type="text/css" href="/cvs_phpgroupware/phpgwapi/templates/verdilak/css/phpgw.css">
<link rel="stylesheet" type="text/css" href="/cvs_phpgroupware/phpgwapi/templates/verdilak/css/submarine.css">
</head>
<body>
<table width="100%" height="100%" cellspacing="0" cellpadding="0">
<tr height="30">
<td colspan="2" valign="top">
<table class="navbar" height="30" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr valign="bottom">
<td>
<a href="http://www.phpgroupware.org" target="_blank" title="phpGroupWare --> homepage*"><img src="/cvs_phpgroupware/phpgwapi/templates/verdilak/images/logo.png" border="0"></a>
</td>
<td class="info" width="99%" align="center">Ralf Becker &lt;ralf&gt; - Saturday 01.03.2003</td>
<td rowspan="2" nowrap>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<a href="/cvs_phpgroupware/home.php"><img src="/cvs_phpgroupware/phpgwapi/templates/verdilak/images/welcome-grey.png" border="0" alt="Home" title="Home"></a>
</td>
<td>
<a href="/cvs_phpgroupware/preferences/index.php"><img src="/cvs_phpgroupware/preferences/templates/verdilak/images/preferences-grey.png" border="0" alt="Preferences" title="Preferences"></a>
</td>
<td>
<a href="/cvs_phpgroupware/logout.php"><img src="/cvs_phpgroupware/phpgwapi/templates/verdilak/images/logout.png" border="0" alt="Logout" title="Logout"></a>
</td>
<td>
<a href="/cvs_phpgroupware/about.php?app=developer_tools"><img src="/cvs_phpgroupware/phpgwapi/templates/verdilak/images/about-grey.png" border="0" alt="about Developer Tools" title="about Developer Tools"></a>
</td>
<td>
<a href="/cvs_phpgroupware/help.php" target="_blank"><img src="/cvs_phpgroupware/phpgwapi/templates/verdilak/images/help.png" border="0" alt="Manual" title="Manual"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="bottom">
<td colspan="2" valign="bottom"><img src="/cvs_phpgroupware/phpgwapi/templates/verdilak/images/greybar.jpg" height="6" width="100%"></td>
</tr>
</table>
</td>
</tr>
<tr height="20" valign="top">
<td class="left"></td>
<td align="right"></td>
</tr>
<tr valign="top">
<td class="left" width="32">
<table cellspacing="0" cellpadding="0" valign="top" class="left">
<tr>
<td class="left">
<a href="/cvs_phpgroupware/admin/index.php"><img src="/cvs_phpgroupware/admin/templates/default/images/navbar.png" border="0" alt="Admin" title="Admin"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/email/index.php"><img src="/cvs_phpgroupware/email/templates/default/images/navbar.png" border="0" alt="E-Mail" title="E-Mail"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/calendar/index.php"><img src="/cvs_phpgroupware/calendar/templates/default/images/navbar.png" border="0" alt="Calendar" title="Calendar"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/addressbook/index.php"><img src="/cvs_phpgroupware/addressbook/templates/default/images/navbar.png" border="0" alt="Addressbook" title="Addressbook"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/news_admin/index.php"><img src="/cvs_phpgroupware/news_admin/templates/default/images/navbar.png" border="0" alt="News Admin" title="News Admin"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/notes/index.php"><img src="/cvs_phpgroupware/notes/templates/default/images/navbar.png" border="0" alt="Notes" title="Notes"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/developer_tools/index.php"><img src="/cvs_phpgroupware/developer_tools/templates/default/images/navbar.png" border="0" alt="Developer Tools" title="Developer Tools"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/etemplate/index.php"><img src="/cvs_phpgroupware/etemplate/templates/default/images/navbar.png" border="0" alt="eTemplate" title="eTemplate"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/sitemgr/index.php"><img src="/cvs_phpgroupware/sitemgr/templates/default/images/navbar.png" border="0" alt="sitemgr*" title="sitemgr*"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/filemanager/index.php"><img src="/cvs_phpgroupware/filemanager/templates/default/images/navbar.png" border="0" alt="Filemanager" title="Filemanager"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/projects/index.php"><img src="/cvs_phpgroupware/projects/templates/default/images/navbar.png" border="0" alt="Projects" title="Projects"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/infolog/index.php"><img src="/cvs_phpgroupware/infolog/templates/default/images/navbar.png" border="0" alt="InfoLog" title="InfoLog"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/stocks/index.php"><img src="/cvs_phpgroupware/stocks/templates/default/images/navbar.png" border="0" alt="Stock Quotes" title="Stock Quotes"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/chora/index.php"><img src="/cvs_phpgroupware/chora/templates/default/images/navbar.png" border="0" alt="Chora" title="Chora"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/registration/index.php"><img src="/cvs_phpgroupware/phpgwapi/templates/verdilak/images/nonav.png" border="0" alt="Registration" title="Registration"></a>
</td>
</tr>
<tr>
<td class="left">
<a href="/cvs_phpgroupware/et_media/index.php"><img src="/cvs_phpgroupware/phpgwapi/templates/verdilak/images/nonav.png" border="0" alt="et_media*" title="et_media*"></a>
</td>
</tr>
</table>
</td>
<td width="100%" height="100%" valign="top" align="center" style="padding-left: 5px"></td>
</tr>
<tr class="navbar">
<td colspan="2" align="center" class="info">Powered by<a href="http://www.phpgroupware.org" target="blank" onMouseout="window.status='';return true;" onMouseover="window.status='phpGroupWare --> homepage*'; return true;"> phpGroupWare </a> Version 0.9.15.008</td>
</tr>
</table>
</body>
</html>

View File

@ -1,6 +1,7 @@
%1 records imported addressbook en %1 records imported
%1 records read (not yet imported, you may go %2back%3 and uncheck test import) addressbook en %1 records read (not yet imported, you may go %2back%3 and uncheck Test Import)
<b>no conversion type &lt;none&gt; could be located.</b> please choose a conversion type from the list addressbook en <b>No conversion type &lt;none&gt; could be located.</b> Please choose a conversion type from the list
@-eval() is only availible to admins!!! addressbook en @-eval() is only availible to admins!!!
add a single entry by passing the fields. addressbook en Add a single entry by passing the fields.
add custom field addressbook en Add Custom Field
address book common en Address Book
@ -13,7 +14,6 @@ addressbook common en Addressbook
addressbook preferences addressbook en Addressbook preferences
addressbook-fieldname addressbook en Addressbook-Fieldname
addvcard addressbook en Add VCard
alphabet addressbook en a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
alt. csv import addressbook en Alt. CSV Import
are you sure you want to delete this field? addressbook en Are you sure you want to delete this field?
bbs phone addressbook en BBS Phone
@ -39,6 +39,7 @@ company name common en Company Name
contact common en Contact
contact application admin en Contact application
contact settings admin en Contact Settings
copied by %1, from record #%2. addressbook en Copied by %1, from record #%2.
country common en Country
csv-fieldname addressbook en CSV-Fieldname
csv-filename addressbook en CSV-Filename
@ -50,10 +51,8 @@ delete a single entry by passing the id. addressbook en Delete a single entry by
department common en Department
domestic addressbook en Domestic
download addressbook en Download
download export file (uncheck to debug output in browser) addressbook en Download export file (Uncheck to debug output in browser)
edit custom field addressbook en Edit Custom Field
edit custom fields admin en Edit Custom Fields
enter the path to the export file here addressbook en Enter the path to the export file here
export contacts addressbook en Export Contacts
export file name addressbook en Export file name
export from addressbook addressbook en Export from Addressbook
@ -67,7 +66,6 @@ fields to show in address list addressbook en Fields to show in address list
fieldseparator addressbook en Fieldseparator
full name addressbook en Full Name
geo addressbook en GEO
go addressbook en Go
grant addressbook access common en Grant Addressbook Access
home address type addressbook en Home Address Type
home city addressbook en Home City
@ -84,7 +82,6 @@ import csv-file into addressbook addressbook en Import CSV-File into Addressbook
import file addressbook en Import File
import from ldif, csv, or vcard addressbook en Import from LDIF, CSV, or VCard
import from outlook addressbook en Import from Outlook
In Netscape, open the Addressbook and select <b>Export</b> from the <b>File</b> menu.<br>The file exported will be in LDIF format.<P>Or, in Outlook, select your Contacts folder, select <b>Import and Export...</b> from addressbook en In Netscape, open the Addressbook and select <b>Export</b> from the <b>File</b> menu.<br>The file exported will be in LDIF format.<P>Or, in Outlook, select your Contacts folder, select <b>Import and Export...</b> from
international addressbook en International
isdn phone addressbook en ISDN Phone
label addressbook en Label
@ -94,7 +91,6 @@ ldap root dn for contacts admin en LDAP root dn for contacts
ldap root pw for contacts admin en LDAP root pw for contacts
ldif addressbook en LDIF
line 2 addressbook en Line 2
mark records as private addressbook en Mark records as private
message phone addressbook en Message Phone
middle name addressbook en Middle Name
mobile addressbook en Mobile
@ -104,7 +100,6 @@ no vcard addressbook en No VCard
number of records to read (<=200) addressbook en Number of records to read (<=200)
other number addressbook en Other Number
other phone addressbook en Other Phone
owerview addressbook en owerview
pager common en Pager
parcel addressbook en Parcel
phone number common en Phone Number
@ -118,24 +113,21 @@ read a list of entries. addressbook en Read a list of entries.
read a single entry by passing the id and fieldlist. addressbook en Read a single entry by passing the id and fieldlist.
record access addressbook en Record Access
record owner addressbook en Record owner
remote search addressbook en Remote Search
retrieve contacts admin en retrieve contacts
select the type of conversion addressbook en Select the type of conversion
select where you want to store admin en Select where you want to store
show birthday reminders on main screen addressbook en Show birthday reminders on main screen
show contact addressbook en show contact
startrecord addressbook en Startrecord
state common en State
street common en Street
suffix addressbook en Suffix
test import (show importable records <u>only</u> in browser) addressbook en Test Import (show importable records <u>only</u> in browser)
that field name has been used already ! addressbook en That field name has been used already !
the <b>File</b> menu and export your contacts into a comma separated text (CSV) file. <P>Or, in Palm Desktop 4.0 or greater, visit your addressbook and select <b>Export</b> from the <b>File</b> menu. The file exported will be in VCard format.<P> addressbook en the <b>File</b> menu and export your contacts into a comma separated text (CSV) file. <P>Or, in Palm Desktop 4.0 or greater, visit your addressbook and select <b>Export</b> from the <b>File</b> menu. The file exported will be in VCard format.<P>
this person's first name was not in the address book. addressbook en This person's first name was not in the address book.
this person's last name was not in the address book. addressbook en This person's last name was not in the address book.
today is %1's birthday! common en Today is %1's birthday!
tomorrow is %1's birthday. common en Tomorrow is %1's birthday.
update a single entry by passing the fields. addressbook en Update a single entry by passing the fields.
use country list addressbook en Use Country List
vcard common en VCard
vcards require a first name entry. addressbook en VCards require a first name entry.
vcards require a last name entry. addressbook en Vcards require a last name entry.

View File

@ -37,16 +37,13 @@ country common es Pais
csv-fieldname addressbook es Campo CSV
csv-filename addressbook es Archivo CSV
custom fields addressbook es Campos Personalizados
debug output in browser addressbook es Visualizar depuracion
default filter preferences es Filtro por Defecto
department common es Departmento
domestic common es Nacional
download addressbook es Descargar Archivo
download export file (uncheck to debug output in browser) addressbook es Descargar archivo exportado
edit custom field admin es Editar Campo Personalizado
edit custom fields admin es Editar Campos Personalizados
e-mail addressbook es E-Mail
enter the path to the export file here addressbook es Ingrese la ruta al archivo exportado aqui
export contacts addressbook es Exportar Contactos
export file name addressbook es Nombre del Archivo a Exportar
export from addressbook addressbook es Exportar de la Libreta de Direcciones
@ -76,8 +73,6 @@ import file addressbook es Importar Archivo
import from ldif, csv, or vcard addressbook es Importar desde LDIF, CSV o VCard
import from netscape addressbook es Importar desde Netscape
import from outlook addressbook es Importar desde Outlook
In Netscape, open the Addressbook and select <b>Export</b> from the <b>File</b> menu.<br>The file exported will be in LDIF format.<P>Or, in Outlook, select your Contacts folder, select <b>Import and Export...</b> from addressbook es <P>
the <b>File</b> menu and export your contacts into a comma separated text (CSV) file. <P>Or, in Palm Desktop 4.0 or greater, visit your addressbook and select <b>Export</b> from the <b>File</b> menu. The file exported will be in VCard format.<P> addressbook es Desde Outlook, seleccione su carpeta de contactos, seleccione <b>Importar y Exportar</b> del menu <b>Archivo</b> y exporte sus contactos en un archivo de Texto separado por comas (CSV).</P>
international common es Internacional
isdn phone addressbook es Telefono ISDN
label addressbook es Etiqueta
@ -87,14 +82,12 @@ ldap host for contacts admin es Host LDAP para contacts
ldap root dn for contacts admin es Raiz LDAP dn para contactos
ldap root pw for contacts admin es Raiz LDAP pw para contactos
line 2 addressbook es Linea 2
mark records as private addressbook es Marcar registros como Privados
message phone addressbook es Telefono de Mensajes
middle name addressbook es Segundo Nombre
mobile addressbook es Tel.Celular
mobile phone addressbook es Telefono Movil
modem phone addressbook es Telefono Modem
no vcard common es Sin VCard
none addressbook es Ninguno
number of records to read (<=200) addressbook es Registros a leer (menos de 200)
other number addressbook es Otro Numero
other phone addressbook es Otro Telefono
@ -112,7 +105,6 @@ record access addressbook es Acceso al registro
record owner addressbook es Dueño del registro
records read (not yet imported, you may go back and uncheck test import) addressbook es registros leidos (aun no importados, usted puede volver y desmarcar Testear)
retrieve contacts admin es Recuperar Contactos
select the type of conversion addressbook es Seleccione el tipo de conversion
select where you want to store admin es Seleccione donde desea almacenar
show birthday reminders on main screen addressbook es Mostrar recordatorios de Cumplea&ntilde;os en la Pantalla Principal
startrecord addressbook es Registro Inicial

View File

@ -1,6 +1,7 @@
%1 records imported addressbook fr %1 enregistrements importés
%1 records read (not yet imported, you may go %2back%3 and uncheck test import) addressbook fr %1 enregistrements lus (pas encore importés, vous pouvez revenir %2en arrière%3 et décocher Tester l'import)
%1 records read (not yet imported, you may go %2back%3 and uncheck test import) addressbook fr %1 enregistrements lus (pas
<b>no conversion type &lt;none&gt; could be located.</b> please choose a conversion type from the list addressbook fr <b>Aucun type de conversion &lt;aucun&gt; n'a pu être trouvé.</b> SVP choisissez un type de conversion depuis la liste
@-eval() is only availible to admins!!! addressbook fr @-eval() est disponible uniquement pour les administrateurs!!!
add a single entry by passing the fields. addressbook fr Ajouter une seule entrée en passant les champs.
add custom field addressbook fr Ajouter champ personnalisé
address book common fr Carnet d'adresses
@ -13,7 +14,6 @@ addressbook common fr Carnet d'adresses
addressbook preferences addressbook fr Préférences du carnet d'adresses
addressbook-fieldname addressbook fr Carnet d'adresses-nomdechamp
addvcard addressbook fr Ajouter VCard
alphabet addressbook fr a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
alt. csv import addressbook fr Import Alt. CSV
are you sure you want to delete this field? addressbook fr Etes-vous sûr de vouloir effacer ce champ?
bbs phone addressbook fr Téléphone BBS
@ -39,6 +39,7 @@ company name common fr Nom de la soci
contact common fr Contact
contact application admin fr Application contact
contact settings admin fr Paramètres du contact
copied by %1, from record #%2. addressbook fr Copié par %1, depuis l'enregistrement #%2.
country common fr Pays
csv-fieldname addressbook fr CSV-Nomdechamp
csv-filename addressbook fr CSV-Nomdefichier
@ -50,10 +51,8 @@ delete a single entry by passing the id. addressbook fr Effacer une seule entr
department common fr Département
domestic addressbook fr Domestique
download addressbook fr Downloader
download export file (uncheck to debug output in browser) addressbook fr Downloader le fichier d'export (Décocher pour débogger la sortie dans le navigateur)
edit custom field addressbook fr Editer le champ personnalisé
edit custom fields admin fr Editer les champs personnalisés
enter the path to the export file here addressbook fr Entrez le chemin vers le fichier d'export ici
export contacts addressbook fr Exporter les contacts
export file name addressbook fr Nom du fichier d'export
export from addressbook addressbook fr Exporter depuis le carnet d'adresses
@ -67,7 +66,6 @@ fields to show in address list addressbook fr Champs
fieldseparator addressbook fr Séparateur de champ
full name addressbook fr Nom complet
geo addressbook fr GEO
go addressbook fr Allez
grant addressbook access common fr Régler les droits d'accès au carnet d'adresses
home address type addressbook fr Type d'adresse (domicile)
home city addressbook fr Ville (domicile)
@ -84,7 +82,6 @@ import csv-file into addressbook addressbook fr Importer le fichier CSV dans le
import file addressbook fr Importer le fichier
import from ldif, csv, or vcard addressbook fr Importer depuis LDIF, CSV ou VCard
import from outlook addressbook fr Importer depuis Outlook
In Netscape, open the Addressbook and select <b>Export</b> from the <b>File</b> menu.<br>The file exported will be in LDIF format.<P>Or, in Outlook, select your Contacts folder, select <b>Import and Export...</b> from addressbook fr Dans Netscape, ouvrez le carnet d'adresses et choisissez <b>Exporter</b> dans le menu <b>Fichier</b>.<br>Le fichier exporté sera dans le format LDIF.<P>Ou, dans Outlook, choisissez votre dossier Contacts, choisissez <b>Importer et Exporter...</b> depuis
international addressbook fr International
isdn phone addressbook fr Téléphone RNIS
label addressbook fr Label
@ -94,7 +91,6 @@ ldap root dn for contacts admin fr Racine LDAP dn pour les contacts
ldap root pw for contacts admin fr Racine LDAP pw pour les contacts
ldif addressbook fr LDIF
line 2 addressbook fr Ligne 2
mark records as private addressbook fr Marquer les enregistrements comme privés
message phone addressbook fr Téléphone de message
middle name addressbook fr Deuxième prénom
mobile addressbook fr Portable
@ -104,7 +100,6 @@ no vcard addressbook fr Pas de VCard
number of records to read (<=200) addressbook fr Nombre d'enregistrements à lire (<=200)
other number addressbook fr Autre numéro
other phone addressbook fr Autre téléphone
owerview addressbook fr Vue globale
pager common fr Pager
parcel addressbook fr Paquet
phone number common fr Numéro de téléphone
@ -118,24 +113,21 @@ read a list of entries. addressbook fr Lire une liste d'entr
read a single entry by passing the id and fieldlist. addressbook fr Lire une seule entrée en passant l'ID et la liste des champs.
record access addressbook fr Enregistrer l'accès
record owner addressbook fr Enregistrer le propriétaire
remote search addressbook fr Recherche à distance
retrieve contacts admin fr Récupérer les contacts
select the type of conversion addressbook fr Choisissez le type de conversion
select where you want to store admin fr Choisissez où vous voulez stocker
show birthday reminders on main screen addressbook fr Montrer les rappels d'anniversaires sur la page principale
show contact addressbook fr Montrer le contact
startrecord addressbook fr Enregistrement de départ
state common fr Région
street common fr Rue
suffix addressbook fr Suffixe
test import (show importable records <u>only</u> in browser) addressbook fr Tester l'import (montrer <u>seulement</u> les enregistrements importables dans le navigateur)
that field name has been used already ! addressbook fr Ce nom de champ a déjà été utilisé !
the <b>File</b> menu and export your contacts into a comma separated text (CSV) file. <P>Or, in Palm Desktop 4.0 or greater, visit your addressbook and select <b>Export</b> from the <b>File</b> menu. The file exported will be in VCard format.<P> addressbook fr le menu <b>Fichier</b> et exportez vos contacts dans un fichier aux champs séparés par des virgules (CSV). <P>Ou, dans Palm Desktop 4.0 ou plus, allez dans votre carnet d'adresses et choisissez <b>Exporter</b> depuis le menu <b>Fichier</b>. Le fichier exporté sera dans le format VCard.<P>
this person's first name was not in the address book. addressbook fr Le prénom de cette personne n'était pas dans le carnet d'adresses.
this person's last name was not in the address book. addressbook fr Le nom de cette personne n'était pas dans le carnet d'adresses.
today is %1's birthday! common fr Aujourd'hui c'est l'anniversaire de %1 !
tomorrow is %1's birthday. common fr Demain c'est l'anniversaire de %1.
update a single entry by passing the fields. addressbook fr Mettre à jour une seule entrée en passant les champs.
use country list addressbook fr Utiliser la liste des pays
vcard common fr VCard
vcards require a first name entry. addressbook fr Les VCards nécessitent une entrée Prénom.
vcards require a last name entry. addressbook fr Les Vcards nécessitent une entrée nom de famille.

View File

@ -88,7 +88,7 @@ suffix addressbook ja
that field name has been used already ! addressbook ja 項目名は既に存在しています。
this person's first name was not in the address book. addressbook ja アドレス帳に名前がありません。
today is %1's birthday! common ja 今日は %1 さんの誕生日です。
tomorrow is %1's birthday. common ja 明日は %1 さんの誕生日です。
tommorow is %1's birthday. common ja 明日は %1 さんの誕生日です。
url addressbook ja URL
vcard common ja VCard
vcards require a first name entry. addressbook ja VCard には、名前が必要です。

View File

@ -13,23 +13,13 @@
/* Basic information about this app */
$setup_info['addressbook']['name'] = 'addressbook';
$setup_info['addressbook']['version'] = '0.9.13.003';
$setup_info['addressbook']['title'] = 'Addressbook';
$setup_info['addressbook']['version'] = '0.9.13.002';
$setup_info['addressbook']['app_order'] = 4;
$setup_info['addressbook']['enable'] = 1;
$setup_info['addressbook']['author'][] = array
(
'name' => 'Joseph Engo',
'email' => 'jengo@phpgroupware.org'
);
$setup_info['addressbook']['author'][] = array
(
'name' => 'Miles Lott',
'email' => 'milos@speakeasy.net'
);
$setup_info['addressbook']['note'] = 'The phpgwapi manages contact data. Addressbook manages servers for its remote capability';
$setup_info['addressbook']['author'] = 'Joseph Engo, Miles Lott';
$setup_info['addressbook']['note'] = 'The phpgwapi manages contact data. Addressbook manages servers for its remote capability.';
$setup_info['addressbook']['license'] = 'GPL';
$setup_info['addressbook']['description'] =
'Contact manager with Vcard support.<br>
@ -37,28 +27,24 @@
It makes use of the phpgroupware contacts class to store and retrieve
contact information via SQL or LDAP.';
$setup_info['addressbook']['maintainer'] = '';
/* Tables */
$setup_info['addressbook']['tables'][] = 'phpgw_addressbook_servers';
$setup_info['addressbook']['maintainer'] = 'phpGroupWare coreteam';
$setup_info['addressbook']['maintainer_email'] = 'phpgroupware-developers@gnu.org';
/* The hooks this app includes, needed for hooks registration */
$setup_info['addressbook']['hooks'] = array
(
'admin',
'add_def_pref',
'config_validate',
'home',
'deleteaccount',
'notifywindow',
'preferences',
'help'
);
$setup_info['addressbook']['hooks'][] = 'admin';
$setup_info['addressbook']['hooks'][] = 'add_def_pref';
$setup_info['addressbook']['hooks'][] = 'config_validate';
$setup_info['addressbook']['hooks'][] = 'home';
$setup_info['addressbook']['hooks'][] = 'manual';
$setup_info['addressbook']['hooks'][] = 'addaccount';
$setup_info['addressbook']['hooks'][] = 'editaccount';
$setup_info['addressbook']['hooks'][] = 'deleteaccount';
$setup_info['addressbook']['hooks'][] = 'notifywindow';
$setup_info['addressbook']['hooks'][] = 'preferences';
/* Dependencies for this app to work */
$setup_info['addressbook']['depends'][] = array
(
'appname' => 'phpgwapi',
'versions' => Array('0.9.15', '0.9.16')
$setup_info['addressbook']['depends'][] = array(
'appname' => 'phpgwapi',
'versions' => Array('0.9.13', '0.9.14')
);
?>

View File

@ -1,14 +0,0 @@
<?php
/**************************************************************************\
* phpGroupWare - Setup *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_baseline = array();
?>

View File

@ -1,36 +0,0 @@
<?php
/**************************************************************************\
* phpGroupWare - Setup *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$test[] = '0.9.13.002';
function addressbook_upgrade0_9_13_002()
{
$GLOBALS['phpgw_setup']->oProc->CreateTable(
'phpgw_addressbook_servers', array(
'fd' => array(
'name' => array('type' => 'varchar', 'precision' => 64, 'nullable' => False),
'basedn' => array('type' => 'varchar', 'precision' => 255, 'nullable' => True),
'search' => array('type' => 'varchar', 'precision' => 32, 'nullable' => True),
'attrs' => array('type' => 'varchar', 'precision' => 255, 'nullable' => True),
'enabled' => array('type' => 'int', 'precision' => 4)
),
'pk' => array('name'),
'fk' => array(),
'ix' => array(),
'uc' => array()
)
);
$GLOBALS['setup_info']['addressbook']['currentver'] = '0.9.13.003';
return $GLOBALS['setup_info']['addressbook']['currentver'];
}
?>

View File

@ -0,0 +1,16 @@
<table border="0" width="100%">
<tr>
<td align="left">
<a href="{url}"><img src="{image}" border="0" alt="{alt}"></a>
</td>
</tr>
<tr>
<td align="center">{about_addressbook}</td>
</tr>
<tr>
<td align="center">{appear}&nbsp;{agent}&nbsp;{version}&nbsp;{on}&nbsp;{platform}.</td>
</tr>
<tr>
<td><hr></td>
</tr>
</table>

View File

@ -1,17 +1,14 @@
<!-- BEGIN add -->
<table border="0" cellPadding="0" cellSpacing="0" width="75%">
<table border="0" cellPadding="0" cellSpacing="0" width="77%">
<tr>
<td width="7%">&nbsp;</td>
<td width="7%">&nbsp;</td>
<td>
<input type="submit" name="submit" value="{lang_ok}">
<input type="reset" name="reset" value="{lang_clear}">
<td width="10%">
<input type="submit" name="submit" value="{lang_save}">&nbsp;
</td>
</form>
<form action="{cancel_url}" method="post">
<td>
<input type="submit" name="Cancel" value="{lang_cancel}">
<td width="10%">
<input type="submit" name="cancel" value="{lang_cancel}">
</td>
</form>
<td>&nbsp;</td>

View File

@ -1,25 +1,28 @@
<!-- BEGIN header -->
<form method="POST" action="{action_url}">
<table border="0" align="center">
<tr class="th">
<td colspan="2"><font color="{th_text}">&nbsp;<b>{title}</b></font></td>
<tr bgcolor="{th_bg}">
<td colspan="2"><font color="{th_text}">&nbsp;<b>{title}</b></font></td>
</tr>
<tr class="th_err">
<tr bgcolor="{th_err}">
<td colspan="2">&nbsp;<b>{error}</b></font></td>
</tr>
<!-- END header -->
<!-- BEGIN body -->
<tr class="row_off">
<tr bgcolor="{row_on}">
<td colspan="2">&nbsp;</td>
</tr>
<tr bgcolor="{row_off}">
<td colspan="2">&nbsp;<b>{lang_Addressbook}/{lang_Contact_Settings}</b></font></td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>{lang_Contact_application}:</td>
<td><input name="newsettings[contact_application]" value="{value_contact_application}"></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td align="center" colspan="2">{lang_WARNING!!_LDAP_is_valid_only_if_you_are_NOT_using_contacts_for_accounts_storage!}</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>{lang_Select_where_you_want_to_store}/{lang_retrieve_contacts}.</td>
<td>
<select name="newsettings[contact_repository]">
@ -28,32 +31,25 @@
</select>
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>{lang_LDAP_host_for_contacts}:</td>
<td><input name="newsettings[ldap_contact_host]" value="{value_ldap_contact_host}"></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>{lang_LDAP_context_for_contacts}:</td>
<td><input name="newsettings[ldap_contact_context]" value="{value_ldap_contact_context}" size="40"></td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>{lang_LDAP_root_dn_for_contacts}:</td>
<td><input name="newsettings[ldap_contact_dn]" value="{value_ldap_contact_dn}" size="40"></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>{lang_LDAP_root_pw_for_contacts}:</td>
<td><input name="newsettings[ldap_contact_pw]" type="password" value=""></td>
</tr>
<tr class="row_on">
<td>{lang_Enable_remote_search}:</td>
<td>
<input name="newsettings[enable_remote_addressbook]" type="radio" value=""{checked_enable_remote_addressbook+}>{lang_no}
<input name="newsettings[enable_remote_addressbook]" type="radio" value="True"{checked_enable_remote_addressbook+True}>{lang_yes}
</td>
</tr>
<!-- END body -->
<!-- BEGIN footer -->
<tr class="th">
<tr bgcolor="{th_bg}">
<td colspan="2">
&nbsp;
</td>

View File

@ -1,3 +1,9 @@
<br><center>
<FORM {enctype} action="{action_url}" method="post">
<TABLE>
<!-- BEGIN filename -->
<TR>
<TD>{lang_csvfile}</td>
@ -36,7 +42,7 @@
{lang_max} <INPUT name="max" type="text" size="3" value="{max}"><td>
</tr>
<tr>
<td><INPUT name="debug" type="checkbox" value="1" checked> {lang_debug}</td>
<td colspan="3"><INPUT name="debug" type="checkbox" value="1" checked> {lang_debug}</td>
</TR>
<tr><td colspan=3>&nbsp;<p>
{help_on_trans}
@ -52,17 +58,7 @@
</TR>
<!-- END imported -->
<!-- BEGIN import -->
<p class=action>{lang_addr_action}<br>
<hr noshade width="98%" align="center" size="1">
<center>
<FORM {enctype} action="{action_url}" method="post">
<TABLE>
{rows}
</TABLE>
{hiddenvars}
</form>
</TABLE>
{hiddenvars}</form>
</CENTER>
<!-- END import -->

View File

@ -1,6 +1,9 @@
<br>
<center>{lang_sure}</center>
<br>
<center>
<a href="{no_link}">{lang_no}</a> &nbsp; &nbsp; &nbsp; &nbsp;
<a href="{yes_link}">{lang_yes}</a>
<form action="{yes_link}" method="POST">
<input type="submit" name="yes" value="{lang_yes}"> &nbsp; &nbsp; &nbsp; &nbsp;
<input type="submit" name="no" value="{lang_no}">
</form>
</center>

View File

@ -3,14 +3,12 @@
<input type="hidden" name="entry[ab_id]" value="{ab_id}">
<input type="hidden" name="entry[tid]" value="{tid}">
<input type="hidden" name="entry[referer]" value="{referer}">
<table border="0" cellPadding="1" cellSpacing="1" width="95%">
<table border="0" cellPadding="1" cellSpacing="1" width="77%">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td align="left" width="7%">
<input type="submit" name="submit" value="{lang_submit}"></form>
<td align="left" width="10%">
<input type="submit" name="submit" value="{lang_save}">&nbsp;</form>
</TD>
<td align="left" width="7%">
<td align="left" width="10%">
{cancel_link}
<input type="submit" name="cancel" value="{lang_cancel}"></form>
</td>
@ -20,7 +18,6 @@
{delete_button}
</form>
</td>
<td>&nbsp;</td>
</tr>
</table>
<!-- END edit -->

View File

@ -1,5 +1,5 @@
<!-- BEGIN export -->
<!-- BEGIN import -->
<CENTER>
<TABLE WIDTH=90%>
<TR BGCOLOR="{navbar_bg}">
@ -10,13 +10,13 @@
<TD>
<FORM ENCTYPE="multipart/form-data" action="{action_url}" method="POST">
<OL>
<LI>{conversion}:
<LI>Select the type of conversion:
<SELECT NAME="conv_type">
<OPTION VALUE="none">&lt;{none}&gt;</OPTION>
<OPTION VALUE="none">&lt;none&gt;</OPTION>
{conv} </SELECT><P></LI>
<LI>{filename}:<INPUT NAME="tsvfilename" VALUE="export.txt"></LI>
<LI>{lang_cat}:{cat_link}</LI>
<LI><INPUT NAME="download" TYPE="checkbox" checked>{download_export}</LI>
<LI><INPUT NAME="download" TYPE="checkbox" checked>Download export file (Uncheck to debug output in browser)</LI>
<LI><INPUT NAME="convert" TYPE="submit" VALUE="{download}"></LI>
</OL>
<input type="hidden" name="sort" value="{sort}">

View File

@ -1,18 +1,17 @@
<!-- BEGIN addressbook entry form -->
<table width="75%" border="0" align="center">
{search}
<tr class="th">
<tr bgcolor="{th_bg}">
<td colspan="5"><font color="{th_text}" face="">{lang_personal}:</font></td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_prefix}:</font></td>
<td colspan="3">
<font size="-1"><input size="10" name="entry[prefix]" value="{prefix}"></font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_firstname}:</font></td>
<td>
@ -23,29 +22,29 @@
<font size="-1"><input name="entry[middle]" value="{middle}"></font>
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_lastname}:</font></td>
<td colspan="3">
<font size="-1"><input name="entry[lastname]" value="{lastname}"></font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_suffix}:</font></td>
<td colspan="3">
<font size="-1"><input size="10" name="entry[suffix]" value="{suffix}"></font>
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font face="" size="-1">{lang_birthday}:</font></td>
<td colspan="3"><font size="-1">{birthday}</font></td>
</tr>
<tr class="th">
<tr bgcolor="{th_bg}">
<td colspan="5"><font color="{th_text}" face="">{lang_business}:</font></td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td>
<font color="{row_text}" face="" size="-1">{lang_title}:</font>
@ -54,7 +53,7 @@
<font size="-1"><input name="entry[title]" value="{title}"></font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td>
<font color="{row_text}" face="" size="-1">{lang_company}:</font>
@ -67,7 +66,7 @@
<input size="30" name="entry[url]" value="{url}">
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td>
<font color="{row_text}" face="" size="-1">{lang_email}:
@ -80,7 +79,7 @@
<font size="-1">{email_type}</font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td>
<font color="{row_text}" face="" size="-1">{lang_department}:</font>
@ -89,28 +88,28 @@
<font size="-1"><input name="entry[department]" value="{department}"></font>
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font face="" size="-1">{lang_bstreet}:</font></td>
<td colspan="3">
<font size="-1"><input size="30" name="entry[bstreet]" value="{bstreet}"></font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font face="" size="-1">{lang_address2}:</font></td>
<td colspan="3">
<font size="-1"><input size="30" name="entry[address2]" value="{address2}"></font>
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font face="" size="-1">{lang_address3}:</font></td>
<td colspan="3">
<font size="-1"><input size="30" name="entry[address3]" value="{address3}"></font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font face="" size="-1">{lang_bcity}:</font></td>
<td>
@ -120,14 +119,14 @@
<font size="-1"><input name="entry[bstate]" value="{bstate}"></font>
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font face="" size="-1">{lang_bzip}:</font></td>
<td colspan="3">
<font size="-1"><input size="10" name="entry[bzip]" value="{bzip}"></font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_bcountry}:</font></td>
<td>
@ -137,14 +136,14 @@
<font size="-1">{timezone}</font>
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_badrtype}:</font></td>
<td colspan="3">
<font size="-1">{badrtype}</font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_wphone}:</font></td>
<td>
@ -155,7 +154,7 @@
<font size="-1"><input name="entry[fax]" value="{fax}"></font>{pref_fax}
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_pager}:</font></td>
<td>
@ -166,7 +165,7 @@
<font size="-1"><input name="entry[mphone]" value="{mphone}"></font>{pref_cell}
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_msgphone}:</font></td>
<td>
@ -177,7 +176,7 @@
<font size="-1"><input name="entry[isdnphone]" value="{isdnphone}"></font>{pref_isdn}
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_carphone}:</font></td>
<td>
@ -188,20 +187,20 @@
<font size="-1"><input name="entry[vidphone]" value="{vidphone}"></font>{pref_video}
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font size="-1">{lang_label}:</font></td>
<td colspan="3"><font size="-1">{label}</font></td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font size="-1">{lang_pubkey}:</font></td>
<td colspan="3"><font size="-1">{pubkey}</font></td>
</tr>
<tr class="th">
<tr bgcolor="{th_bg}">
<td colspan="5"><font color="{row_text}" face="">{lang_home}:</font></td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td>
<font color="{row_text}" face="" size="-1">{lang_hemail}:</font>
@ -211,12 +210,12 @@
<font size="-1">{hemail_type}</font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font face="" size="-1">{lang_hstreet}:</font></td>
<td colspan="3"><font size="-1"><input size="30" name="entry[hstreet]" value="{hstreet}"></font></td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font face="" size="-1">{lang_hcity}:</font></td>
<td>
@ -227,28 +226,28 @@
<font size="-1"><input name="entry[hstate]" value="{hstate}"></font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font face="" size="-1">{lang_hzip}:</font></td>
<td colspan="3">
<font size="-1"><input size="10" name="entry[hzip]" value="{hzip}"></font>
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_hcountry}:</font></td>
<td colspan="3">
<font size="-1">{hcountry}</font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_hadrtype}:</font></td>
<td colspan="3">
<font size="-1">{hadrtype}</font>
</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td>&nbsp;</td>
<td><font color="{row_text}" face="" size="-1">{lang_hphone}:</font></td>
<td>
@ -258,22 +257,22 @@
<font size="-1"><input name="entry[ophone]" value="{ophone}"></font>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><font size="-1">{lang_notes}:</font></td>
<td colspan="4"><font size="-1">{notes}</font></td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td><font size="-1">{lang_private}:</font></td>
<td colspan="4">
<input type="checkbox" name="entry[access]" value="True"{access_check}>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><font size="-1">{lang_cats}:</font></td>
<td>{cats_link}</td>
<td colspan="3">&nbsp;</td>
</tr>
<tr class="th">
<tr bgcolor="{th_bg}">
<td colspan="5"><font color="{row_text}" face="" size="-1">{lang_custom}</font></td>
</tr>
{custom}

View File

@ -1,185 +0,0 @@
<!-- $Id$ -->
<xsl:template name="help_data">
<xsl:apply-templates select="xhelp"/>
</xsl:template>
<xsl:template match="xhelp">
<xsl:choose>
<xsl:when test="overview">
<xsl:apply-templates select="overview"/>
</xsl:when>
<xsl:when test="list">
<xsl:apply-templates select="list"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="add"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="overview">
<table>
<tr>
<td>
<xsl:value-of disable-output-escaping="yes" select="intro"/>
</td>
</tr>
<tr>
<td>
<xsl:value-of disable-output-escaping="yes" select="prefs_settings"/>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="list">
<xsl:variable name="list_img" select="list_img"/>
<table>
<tr>
<td colspan="2">
<img src="{$list_img}"/>
</td>
</tr>
<tr>
<td valign="top" align="right">1</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_1"/></td>
</tr>
<tr>
<td valign="top" align="right">2</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_2"/></td>
</tr>
<tr>
<td valign="top" align="right">3</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_3"/></td>
</tr>
<tr>
<td valign="top" align="right">4</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_4"/></td>
</tr>
<tr>
<td valign="top" align="right">5</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_5"/></td>
</tr>
<tr>
<td valign="top" align="right">6</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_6"/></td>
</tr>
<tr>
<td colspan="2"><u><xsl:value-of disable-output-escaping="yes" select="h_data"/></u></td>
</tr>
<tr>
<td valign="top" align="right">7</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_7"/></td>
</tr>
<tr>
<td valign="top" align="right">8</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_8"/></td>
</tr>
<tr>
<td valign="top" align="right">9</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_9"/></td>
</tr>
<tr>
<td valign="top" align="right">10</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_10"/></td>
</tr>
<tr>
<td valign="top" align="right">11</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_11"/></td>
</tr>
<tr>
<td valign="top" align="right">12</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_12"/></td>
</tr>
<tr>
<td valign="top" align="right">13</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_13"/></td>
</tr>
<tr>
<td valign="top" align="right">14</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_14"/></td>
</tr>
<tr>
<td valign="top" align="right">15</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_15"/></td>
</tr>
<tr>
<td valign="top" align="right">16</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_16"/></td>
</tr>
<tr>
<td valign="top" align="right">17</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_17"/></td>
</tr>
<tr>
<td valign="top" align="right">18</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_18"/></td>
</tr>
</table>
</xsl:template>
<xsl:template match="add">
<xsl:variable name="add_img" select="add_img"/>
<table>
<tr>
<td colspan="2">
<img src="{$add_img}"/>
</td>
</tr>
<tr>
<td valign="top" align="right">1</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_1"/></td>
</tr>
<tr>
<td colspan="2">
<table width="80%" bgcolor="#ccddeb">
<tr>
<td><xsl:value-of select="lang_lastname"/>:</td>
<td><xsl:value-of select="lang_firstname"/>:</td>
</tr>
<tr>
<td><xsl:value-of select="lang_email"/>:</td>
<td><xsl:value-of select="lang_company"/>:</td>
</tr>
<tr>
<td><xsl:value-of select="lang_homephone"/>:</td>
<td><xsl:value-of select="lang_fax"/>:</td>
</tr>
<tr>
<td><xsl:value-of select="lang_workphone"/>:</td>
<td><xsl:value-of select="lang_pager"/>:</td>
</tr>
<tr>
<td><xsl:value-of select="lang_mobile"/>:</td>
<td><xsl:value-of select="lang_othernumber"/>:</td>
</tr>
<tr>
<td><xsl:value-of select="lang_street"/>:</td>
<td><xsl:value-of select="lang_city"/>:</td>
</tr>
<tr>
<td><xsl:value-of select="lang_state"/>:</td>
<td><xsl:value-of select="lang_zip"/>:</td>
</tr>
<tr>
<td><xsl:value-of select="lang_access"/>:</td>
<td><xsl:value-of select="lang_groupsettings"/>:</td>
</tr>
<tr>
<td><xsl:value-of select="lang_notes"/>:</td>
<td><xsl:value-of select="lang_birthday"/>:</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><xsl:value-of disable-output-escaping="yes" select="access_descr"/></td>
</tr>
<tr>
<td valign="top" align="right">2</td>
<td><xsl:value-of disable-output-escaping="yes" select="item_2"/></td>
</tr>
</table>
</xsl:template>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -12,18 +12,24 @@
<TR>
<TD><FORM ENCTYPE="multipart/form-data" action="{action_url}" method="post">
<OL>
<LI>{help_import} {help_import2}
<LI>In Netscape, open the Addressbook and select <b>Export</b> from the <b>File</b> menu.
The file exported will be in LDIF format.
<P>Or, in Outlook, select your Contacts folder, select <b>Import
and Export...</b> from the <b>File</b>
menu and export your contacts into a comma separated text (CSV) file.
<P>Or, in Palm Desktop 4.0 or greater, visit your addressbook and select <b>Export</b> from the <b>File</b> menu.
The file exported will be in VCard format.<P>
</LI>
<LI>{export_path}:
<LI>Enter the path to the exported file here:
<INPUT NAME="tsvfile" SIZE="48" TYPE="file" VALUE="{tsvfilename}"><P></LI>
<LI>{conversion}:
<LI>Select the type of conversion:
<SELECT NAME="conv_type">
<OPTION VALUE="none">&lt;{none}&gt;</OPTION>
<OPTION VALUE="none">&lt;none&gt;</OPTION>
{conv}
</SELECT><P></LI>
<LI>{lang_cat}:{cat_link}</LI>
<LI><INPUT NAME="private" TYPE="checkbox" VALUE="private" CHECKED>{mark_private}</LI>
<LI><INPUT NAME="download" TYPE="checkbox" VALUE="{debug}" CHECKED>{debug_browser}</LI>
<LI><INPUT NAME="private" TYPE="checkbox" VALUE="private" CHECKED>Mark records as private</LI>
<LI><INPUT NAME="download" TYPE="checkbox" VALUE="{debug}" CHECKED>Debug output in browser</LI>
<LI><INPUT NAME="convert" TYPE="submit" VALUE="{download}"></LI>
</OL>
<input type="hidden" name="sort" value="{sort}">

View File

@ -1,19 +1,15 @@
<!-- BEGIN addressbook_header -->
<center>{lang_addressbook}
<br>{lang_showing}
<br>{searchreturn}{search_filter}{remotesearch}
<table width="75%" border="1" cellspacing="1" cellpadding="1">
<tr>
{alphalinks}
</tr>
</table>
<table width="75%" border="0" cellspacing="1" cellpadding="3">
<tr class="th">{cols}
<center>
{lang_showing}
<br>{searchreturn}
{search_filter}
<table width="95%" border="0" cellspacing="1" cellpadding="3">
<tr bgcolor="{th_bg}">{cols}
<td width="3%" height="21"><font face="Arial, Helvetica, sans-serif" size="-1">{lang_view}</font></td>
<td width="3%" height="21"><font face="Arial, Helvetica, sans-serif" size="-1">{lang_vcard}</font></td>
<td width="5%" height="21"><font face="Arial, Helvetica, sans-serif" size="-1">{lang_edit}</font></td>
<td width="5%" height="21"><font face="Arial, Helvetica, sans-serif" size="-1">{lang_owner}</font></td>
</tr>
</tr>
<!-- END addressbook_header -->
<!-- BEGIN column -->
@ -21,34 +17,18 @@
<!-- END column -->
<!-- BEGIN row -->
<tr class="{row_tr_color}">{columns}
<tr bgcolor="{row_tr_color}">{columns}
<td valign="top" width="3%"><font face="{font}" size="2"><a href="{row_view_link}">{lang_view}</a></font></td>
<td valign="top" width="3%"><font face="{font}" size="2"><a href="{row_vcard_link}">{lang_vcard}</a></font></td>
<td valign="top" width="5%"><font face="{font}" size="2">{row_edit}</font></td>
<td valign="top" width="5%"><font face="{font}" size="2">{row_owner}</font></td>
</tr>
</tr>
<!-- END row -->
<!-- BEGIN remsearch -->
<table width="75%" border="0" cellspacing="1" cellpadding="3">
<form method="POST" action="{remote_search}">
<tr class="row_on">
<td colspan="3">{lang_remote_search}:
<select name="serverid">
{search_remote}
</select>
</td>
<td><input size="30" name="remote_query" value="{remote_query}"></td>
<td><input type="submit" name="submit" value="{lang_go}"></td>
</tr>
</form>
</table>
<!-- END remsearch -->
<!-- BEGIN addressbook_footer -->
</table>
<table width="75%" border="0" cellspacing="0" cellpadding="4">
<tr class="th">
<table width="95%" border="0" cellspacing="0" cellpadding="4">
<tr bgcolor="{th_bg}">
<form action="{add_url}" method="post"><td width="16%"><input type="submit" name="Add" value="{lang_add}"></td></form>
<form action="{vcard_url}" method="post"><td width="16%"><input type="submit" name="AddVcard" value="{lang_addvcard}"></td></form>
<form action="{import_url}" method="post"><td width="16%"><input type="submit" name="Import" value="{lang_import}"></td></form>
@ -56,8 +36,5 @@
<form action="{export_url}" method="post"><td width="16%"><input type="submit" name="Export" value="{lang_export}"></td></form>
</tr>
</table>
</center>
</center>
<!-- END addressbook_footer -->
<!-- BEGIN addressbook_alpha --><td class="charbgcolor" align="center"><a href="{charlink}"><font color="{charcolor}">{char}</a></font></td>
<!-- END addressbook_alpha -->

View File

@ -19,14 +19,14 @@
<form method="post" action="{actionurl}">
<input type="text" name="query">&nbsp;<input type="submit" name="search" value="{lang_search}"></form></td>
</tr>
<tr class="th">
<td width="16%" class="th">{sort_field}</td>
<td width="8%" class="th" align="center">{lang_edit}</td>
<td width="8%" class="th" align="center">{lang_delete}</td>
<tr bgcolor="{th_bg}">
<td width="16%" bgcolor="{th_bg}">{sort_field}</td>
<td width="8%" bgcolor="{th_bg}" align="center">{lang_edit}</td>
<td width="8%" bgcolor="{th_bg}" align="center">{lang_delete}</td>
</tr>
<!-- BEGIN field_list -->
<tr class="{tr_color}">
<tr bgcolor="{tr_color}">
<td>{cfield}</td>
<td align="center"><a href="{edit}">{lang_edit_entry}</a></td>
<td align="center"><a href="{delete}">{lang_delete_entry}</a></td>

View File

@ -1,5 +1,5 @@
<!-- $Id$ -->
<tr class="{row_color}">
<tr bgcolor="{row_color}">
<td>{user}</td>
<td align="center"><input type="checkbox" name="{read}" value="Y"{read_selected}></td>
<td align="center"><input type="checkbox" name="{edit}" value="Y"{edit_selected}></td>

View File

@ -1,6 +1,6 @@
<tr class="th">
<tr bgcolor="{bg_color}">
<td>{string}</td>
<td align="center">{read_lang}</td>
<td align="center">{edit_lang}</td>
<td align="center">{delete_lang}</td>
<td align="center">{lang_read}</td>
<td align="center">{lang_edit}</td>
<td align="center">{lang_delete}</td>
</tr>

View File

@ -2,13 +2,13 @@
<p><b>{lang_abprefs}:</b><hr><p>
<form method="POST" action="{action_url}">
<table border="0" align="center" cellspacing="1" cellpadding="1">
<tr class="th">
<tr bgcolor="{th_bg}">
<td colspan="6" align="center"><font color="#000000" face="">{lang_fields}:</font></td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td colspan="6"><font color="#000000" face="">{lang_personal}:</font></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><input type="checkbox" name="prefs[fn]"{fn_checked}>{fn}</option></td>
<td><input type="checkbox" name="prefs[n_given]"{n_given_checked}>{n_given}</option></td>
<td><input type="checkbox" name="prefs[n_family]"{n_family_checked}>{n_family}</option></td>
@ -16,7 +16,7 @@
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><input type="checkbox" name="prefs[n_prefix]"{n_prefix_checked}>{n_prefix}</option></td>
<td><input type="checkbox" name="prefs[n_suffix]"{n_suffix_checked}>{n_suffix}</option></td>
<td><input type="checkbox" name="prefs[bday]"{bday_checked}>{bday}</option></td>
@ -27,10 +27,10 @@
<tr>
<td>&nbsp;</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td colspan="6"><font color="#000000" face="">{lang_business}:</font></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><input type="checkbox" name="prefs[org_name]"{org_name_checked}>{org_name}</option></td>
<td><input type="checkbox" name="prefs[org_unit]"{org_unit_checked}>{org_unit}</option></td>
<td><input type="checkbox" name="prefs[title]"{title_checked}>{title}</option></td>
@ -38,7 +38,7 @@
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><input type="checkbox" name="prefs[adr_one_street]"{adr_one_street_checked}>{adr_one_street}</option></td>
<td><input type="checkbox" name="prefs[address2]"{address2_checked}>{address2}</option></td>
<td><input type="checkbox" name="prefs[address3]"{address3_checked}>{address3}</option></td>
@ -46,7 +46,7 @@
<td><input type="checkbox" name="prefs[adr_one_region]"{adr_one_region_checked}>{adr_one_region}</option></td>
<td><input type="checkbox" name="prefs[adr_one_postalcode]"{adr_one_postalcode_checked}>{adr_one_postalcode}</option></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><input type="checkbox" name="prefs[adr_one_countryname]"{adr_one_countryname_checked}>{adr_one_countryname}</option></td>
<td><input type="checkbox" name="prefs[adr_two_type]"{adr_one_type_checked}>{adr_one_type}</option></td>
<td><input type="checkbox" name="prefs[tel_work]"{tel_work_checked}>{tel_work}</option></td>
@ -56,10 +56,10 @@
<tr>
<td>&nbsp;</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td colspan="6"><font color="#000000" face="">{lang_home}:</font></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><input type="checkbox" name="prefs[adr_two_street]"{adr_two_street_checked}>{adr_two_street}</option></td>
<td><input type="checkbox" name="prefs[adr_two_locality]"{adr_two_locality_checked}>{adr_two_locality}</option></td>
<td><input type="checkbox" name="prefs[adr_two_region]"{adr_two_region_checked}>{adr_two_region}</option></td>
@ -67,7 +67,7 @@
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><input type="checkbox" name="prefs[adr_two_countryname]"{adr_two_countryname_checked}>{adr_two_countryname}</option></td>
<td><input type="checkbox" name="prefs[adr_two_type]"{adr_two_type_checked}>{adr_two_type}</option></td>
<td><input type="checkbox" name="prefs[tel_home]"{tel_home_checked}>{tel_home}</option></td>
@ -77,10 +77,10 @@
<tr>
<td>&nbsp;</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td colspan="6"><font color="#000000" face="">{lang_phones}:</font></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><input type="checkbox" name="prefs[tel_voice]"{tel_voice_checked}>{tel_voice}</option></td>
<td><input type="checkbox" name="prefs[tel_fax]"{tel_fax_checked}>{tel_fax}</option></td>
<td><input type="checkbox" name="prefs[tel_msg]"{tel_msg_checked}>{tel_msg}</option></td>
@ -88,7 +88,7 @@
<td><input type="checkbox" name="prefs[tel_pager]"{tel_pager_checked}>{tel_pager}</option></td>
<td><input type="checkbox" name="prefs[tel_bbs]"{tel_bbs_checked}>{tel_bbs}</option></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><input type="checkbox" name="prefs[tel_modem]"{tel_modem_checked}>{tel_modem}</option></td>
<td><input type="checkbox" name="prefs[tel_car]"{tel_car_checked}>{tel_car}</option></td>
<td><input type="checkbox" name="prefs[tel_isdn]"{tel_isdn_checked}>{tel_isdn}</option></td>
@ -99,10 +99,10 @@
<tr>
<td>&nbsp;</td>
</tr>
<tr class="row_on">
<tr bgcolor="{row_on}">
<td colspan="6"><font color="#000000" face="">{lang_other}:</font></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td><input type="checkbox" name="prefs[geo]"{geo_checked}>{geo}</option></td>
<td><input type="checkbox" name="prefs[url]"{url_checked}>{url}</option></td>
<td><input type="checkbox" name="prefs[tz]"{tz_checked}>{tz}</option></td>
@ -117,10 +117,10 @@
<tr>
<td>&nbsp;</td>
</tr>
<tr class="th">
<tr bgcolor="{th_bg}">
<td colspan="6" align="center"><font color="#000000" face="">{lang_otherprefs}:</font></td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td colspan="3" align="center">
{lang_default_filter}
{filter_select}
@ -129,7 +129,7 @@
<input type="checkbox" name="other[mainscreen_showbirthdays]"{show_birthday}>
</td>
</tr>
<tr class="row_off">
<tr bgcolor="{row_off}">
<td colspan="3" align="center">
{lang_defaultcat}
{cat_select}

View File

@ -1,9 +1,9 @@
<!-- BEGIN view_header -->
<p>&nbsp;<b>{lang_viewpref}</b><hr><p>
<br>
<table border="0" cellspacing="2" cellpadding="2" width="70%" align="center">
<!-- END view_header -->
<!-- BEGIN view_row -->
<tr class="th">
<tr bgcolor="{th_bg}">
<td align="right" width="30%"><b>{display_col}</b>:</td><td width="70%">{ref_data}</td>
</tr>
<!-- END view_row -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1,113 +0,0 @@
<?php
$GLOBALS['phpgw_info']['flags']['currentapp'] = 'admin';
include('../header.inc.php');
include(PHPGW_API_INC . '/class.acl2.inc.php');
//$sec = New acl(array('account_id'=>1));
$sec = New acl2(1,'##DEFAULT##');
//echo 'phpgw:<pre>'; print_r($GLOBALS['phpgw']); echo '</pre>';
$sec->get_memberships();
//echo 'memberships_sql: '.$sec->memberships_sql.'<br>';
//echo 'memberships:<pre>'; print_r($sec->memberships); echo '</pre>';
function ttt($location, $rights)
{
GLOBAL $sec;
if ($sec->check($location, $rights))
{
echo $rights.' is valid<br>';
}
else
{
echo $rights.' is invalid<br>';
}
}
echo 'This test is going to delete all your phpgw_acl2 records to ensure that the tests run as expected.<br>';
$GLOBALS['phpgw']->db->query('DELETE FROM phpgw_acl2',__LINE__,__FILE__);
echo 'Action: DELETE FROM phpgw_acl2<br><br>';
echo 'Running checks on .one.two.three after changing directly granted rights as well as ones it will inherit from<br>';
echo '<br>1: check rights for .one.two which will get inherited by .one.two.three<br>';
ttt('.one.two', 1);
ttt('.one.two', 2);
ttt('.one.two', 4);
ttt('.one.two', 8);
echo 'You can see that no rights are set, so none will be inherited<br>';
echo '<br>2: checking .one.two.three<br>';
ttt('.one.two.three', 1);
ttt('.one.two.three', 2);
ttt('.one.two.three', 4);
ttt('.one.two.three', 8);
echo 'You can see that no rights are set directly as well<br>';
echo '<br>3: add rights 4 to .one.two.three<br>';
echo 'Action: $acl2->add(\'.one.two.three\',4,0);<br>';
$sec->add('.one.two.three',4,0);
ttt('.one.two.three', 1);
ttt('.one.two.three', 2);
ttt('.one.two.three', 4);
ttt('.one.two.three', 8);
echo '<br>4: add rights 8 to .one.two.three<br>';
echo 'Action: $acl2->add(\'.one.two.three\',8,0);<br>';
$sec->add('.one.two.three',8,0);
ttt('.one.two.three', 1);
ttt('.one.two.three', 2);
ttt('.one.two.three', 4);
ttt('.one.two.three', 8);
echo '<br>5: remove rights 4 from .one.two.three<br>';
echo 'Action: $acl2->remove(\'.one.two.three\',4,0);<br>';
$sec->remove('.one.two.three',4,0);
ttt('.one.two.three', 1);
ttt('.one.two.three', 2);
ttt('.one.two.three', 4);
ttt('.one.two.three', 8);
echo '<br>5: set rights to 2 on .one.two.three<br>';
echo 'Action: $acl2->set(\'.one.two.three\', 2,0);<br>';
$sec->set('.one.two.three', 2,0);
ttt('.one.two.three', 1);
ttt('.one.two.three', 2);
ttt('.one.two.three', 4);
ttt('.one.two.three', 8);
echo '<br>Now to see inheritance in action...<br>';
echo '6: add rights 8 to .one.two<br>';
echo 'Action: $acl2->add(\'.one.two\',8,0);<br>';
$sec->add('.one.two',8,0);
ttt('.one.two.three', 1);
ttt('.one.two.three', 2);
ttt('.one.two.three', 4);
ttt('.one.two.three', 8);
echo 'You can see here that it has inherited rights 8 from .one.two<br>';
echo '<br>7: add rights 4 to .one.two<br>';
echo 'Action: $acl2->add(\'.one.two\',4,0);<br>';
$sec->add('.one.two',4,0);
ttt('.one.two.three', 1);
ttt('.one.two.three', 2);
ttt('.one.two.three', 4);
ttt('.one.two.three', 8);
echo 'You can see here that it has also inherited rights 4 from .one.two<br>';
echo '<br>Now to see inherited rights masks in action...<br>';
echo '8: add rights mask for 8 to .one.two<br>';
echo 'Action: $acl2->add(\'.one.two\',8,1);<br>';
$sec->add('.one.two',8,1);
ttt('.one.two.three', 1);
ttt('.one.two.three', 2);
ttt('.one.two.three', 4);
ttt('.one.two.three', 8);
echo 'You can see here that it no longer inherited rights 8 from .one.two<br>';
echo '<br>It will help to see the rights for .one.two at this point to clearly see the rights mask doing its work<br>';
echo '9: display rights for .one.two<br>';
ttt('.one.two', 1);
ttt('.one.two', 2);
ttt('.one.two', 4);
ttt('.one.two', 8);
echo 'You can see here that it has rights for 4 and 8, and yet above you saw that .one.two.three did not inherited rights 4 from it<br>';
//echo 'rights_cache:<pre>'; print_r($sec->rights_cache); echo '</pre>';
?>

View File

@ -1,6 +0,0 @@
phpgroupware-admin (0.9.14-0.RC3.3) unstable; urgency=low
* New release.
- Source is now splitted into modules.
-- Luca - De Whiskey's - De Vitis <luca@debian.org> Mon, 21 May 2001 15:00:56 +0200

View File

@ -1,16 +0,0 @@
Source: phpgroupware-admin
Section: web
Priority: optional
Maintainer: Luca - De Whiskey's - De Vitis <luca@debian.org>
Build-Depends: debhelper (>> 3.0.0)
Standards-Version: 3.5.2
Package: phpgroupware-admin
Section: web
Architecture: all
Depends: phpgroupware (>= ${Source-Version}), php3-pgsql | php3-cgi-pgsql | php4-pgsql | php3-mysql | php3-cgi-mysql | php4-mysql
Description: The phpGroupWare administration module
This phpGroupWare module provide the administration facilities for
phpGroupWare (add and remove groups, users, modules, session handling
etc.).

View File

@ -1,15 +0,0 @@
This package was debianized by Luca - De Whiskey's - De Vitis <luca@debian.org> on
Sat, 29 Jun 2002 17:13:40 +0200
It was downloaded from the CVS repository at subversion.gnu.org. Try:
prompt$ CVSROOT=:pserver:anoncvs@subversions.gnu.org:/cvsroot/phpgroupware
prompt$ CVS_RSH=ssh
prompt$ cvs login
prompt$ cvs get all packages
Upstream Author(s):
Please, see credits.txt, the README file or visit http://apps.phpgroupware.org/
Copyright:
A copy of the GNU General Public License, version 2, can be found in
/usr/share/common-licenses/GPL .

View File

@ -1,74 +0,0 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=3
APP = admin
PACKAGE = debian/phpgroupware-$(APP)/usr/share/phpgroupware/$(APP)
PACKAGEDOC = debian/phpgroupware-$(APP)/usr/share/doc/phpgroupware-$(APP)
COPYRIGHT = -iname copyright\* -or -iname license
CHANGELOG = -iname change\*
INSTALL = -iname install
FINDOPT = -type f -not \( -path \*CVS\* -or -path \*debian\* -or -name .cvsignore \)
SPECIAL = -size 0 -or $(INSTALL) -or $(CHANGELOG) -or $(COPYRIGHT) -or -name \*.sgml
STAMPS = -name configure-stamp -or -name build-stamp
APPFILES = -not \( -path \*doc\* -or -path \. -or -name '*.pl' -or -name '*.py' -or $(STAMPS) \)
DOCFILES = -not \( $(SPECIAL) \)
configure: configure-stamp
configure-stamp:
dh_testdir
# No configuration needed.
touch configure-stamp
build: configure-stamp build-stamp
build-stamp:
dh_testdir
# Here should go the commands necessary to build the sgml documentation...
touch build-stamp
clean:
dh_testdir
rm -f build-stamp configure-stamp
rm -f debian/.builded
rm -f debian/files
# Here should go the commands to clean the builded sgml documents.
dh_clean
install: build
dh_testdir
# Install $(APP) files in $(PACKAGE)
find $(FINDOPT) $(APPFILES) \
-exec install -D --mode=644 {} $(PACKAGE)/{} \;
# Install $(APP) doc files in $(PACKAGEDOC)
cd doc ;\
find $(FINDOPT) $(DOCFILES) \
-exec install -D --mode=644 {} ../$(PACKAGEDOC)/{} \;
binary-indep: build install
dh_testdir
dh_testroot
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb | tee debian/.builded
binary: binary-indep
.PHONY: build clean binary-indep binary-arch binary install configure

Binary file not shown.

View File

@ -69,10 +69,6 @@ and the following special types:
\layout Enumerate
{hook_XXX} - Calls a function named XXX (will be discussed later).
\layout Enumerate
{checked_XXX+YYY} - Handles checkbox/radio values set to YYY or '' (will
be discussed later).
\layout Standard
Following is an example from the addressbook application:
@ -179,35 +175,7 @@ Let's take a look at part of the preferences/default/config.tpl:
\layout Standard
Here, we are adding a new element, {hook_country_set}.
This brings up the next file we will need to parse this value, hook_config.inc.ph
p.
But first, let's look at the last template type, 'checked':
\layout Code
<input name="newsettings[enable_remote_addressbook]" type="radio" value=""{check
ed_enable_remote_addressbook+}>{lang_no}
\layout Code
<input name="newsettings[enable_remote_addressbook]" type="radio" value="True"{c
hecked_enable_remote_addressbook+True}>{lang_yes}
\layout Standard
We want to check the value of the setting 'enable_remote_addressbook'.
The value could be '' or 'True'.
We use the '+' character to isolate the config name from the check value.
If the value is empty or unset in the phpgw_config table, {checked_enable_remot
e_addressbook+} is replaced with ' checked'.
If the value is 'True',{checked_enable_remote_addressbook+True} is replaced
with ' checked'.
Note that the part after the '+' character matches what is in the value=
\begin_inset Quotes erd
\end_inset
XXX
\begin_inset Quotes erd
\end_inset
part in the html for this form element.
This brings up the next file we will need to parse this value...
\layout Subsection
hook_config.inc.php (optional)

Binary file not shown.

View File

@ -1,15 +1,15 @@
%!PS-Adobe-2.0
%%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software
%%Title: adminconfig.dvi
%%Pages: 1
%%Pages: 6
%%PageOrder: Ascend
%%BoundingBox: 0 0 612 792
%%DocumentFonts: Times-Roman
%%DocumentFonts: Helvetica-Bold Times-Roman Courier Times-Italic
%%EndComments
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -t letter -o adminconfig.ps adminconfig.dvi
%DVIPSParameters: dpi=600, compressed
%DVIPSSource: TeX output 2002.03.19:1838
%DVIPSSource: TeX output 2001.12.22:1805
%%BeginProcSet: texc.pro
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
@ -314,13 +314,28 @@ setcmykcolor}DC/White{0 0 0 0 setcmykcolor}DC end
%%EndProcSet
TeXDict begin 40258431 52099146 1000 600 600 (adminconfig.dvi)
@start /Fa 107[37 22[40 1[40 1[42 42 60 42 42 23 32 28
42 42 42 42 65 23 42 1[23 42 42 28 37 42 37 42 37 1[42
1[28 23 28 1[60 60 78 1[60 51 46 55 1[46 60 60 74 51
2[28 60 60 46 51 60 55 55 60 76 1[47 47 47 23 23 7[42
42 42 23 21 28 21 47 42 28 28 28 65 1[42 1[34 28 29[46
46 2[{TeXBase1Encoding ReEncodeFont}76 83.022 /Times-Roman
rf end
@start /Fa 138[42 2[32 1[42 42 42 60 3[23 42 42 1[37
42 37 1[42 9[69 15[60 16[42 42 42 42 42 42 1[23 21 43[42
2[{TeXBase1Encoding ReEncodeFont}24 83.022 /Times-Italic
rf /Fb 107[45 22[45 1[45 1[45 45 45 45 45 45 45 45 1[45
45 45 45 45 45 1[45 45 45 45 45 45 45 45 45 1[45 1[45
45 45 5[45 45 45 2[45 45 45 1[45 2[45 1[45 45 45 45 45
45 45 2[45 45 45 45 45 7[45 1[45 45 45 45 45 1[45 45
45 45 45 1[45 1[45 45 33[{TeXBase1Encoding ReEncodeFont}64
74.7198 /Courier rf /Fc 137[66 73 40 1[47 73 73 73 73
1[33 66 1[33 73 73 1[66 73 66 1[66 1[66 43[66 66 66 2[33
4[40 40 37[73 2[{TeXBase1Encoding ReEncodeFont}25 119.552
/Helvetica-Bold rf /Fd 140[80 6[40 2[40 3[80 30[88 20[80
2[40 46[{TeXBase1Encoding ReEncodeFont}7 143.462 /Helvetica-Bold
rf /Fe 107[37 22[40 1[40 1[42 42 60 42 42 23 32 28 1[42
42 42 65 23 42 1[23 42 42 28 37 42 37 42 37 1[42 1[28
1[28 2[60 78 2[51 46 55 1[46 60 60 74 51 2[28 60 60 46
1[60 55 55 60 76 1[47 1[47 1[23 5[42 42 42 42 42 23 21
28 21 2[28 28 28 2[42 32[46 46 2[{TeXBase1Encoding ReEncodeFont}66
83.022 /Times-Roman rf /Ff 138[126 2[80 1[126 126 126
184 3[57 126 126 1[115 126 115 1[115 9[195 15[161 23[57
57 43[126 2[{TeXBase1Encoding ReEncodeFont}18 206.584
/Helvetica-Bold rf end
%%EndProlog
%%BeginSetup
%%Feature: *Resolution 600dpi
@ -331,180 +346,188 @@ letter
%%EndSetup
%%Page: 1 1
1 0 bop Black Black -434 -417 a Fa(phpGroupW)-7 b(are)39
b(admin/con\002g.php)81 b(A)42 b(brief)f(introduction)f(to)i(writing)f
(hooks)g(and)g(templates)h(for)f(an)o(y)g(application)f(to)i(use)h
(this)f(admin)f(interf)o(ace,)-600 -318 y(by)93 b(Miles)47
b(Lott)g(<milosch@phpgroupw)o(are.or)n(g)o(>)41 b(Dec)47
b(22,)f(2001.)91 b(Files)k(con\002g.tpl)45 b(\(required\))91
b(In)46 b(your)f(application/templates/def)o(ault)e(directory)-5
b(,)-600 -218 y(create)38 b(a)g(ne)n(w)g(template)g(\002le)h(named)e
('con\002g.tpl'.)e(This)k(will)g(be)f(included)e(by)i(con\002g.php)d
(and)j(used)g(to)g(dra)o(w)g(the)g(page.)f(This)h(template)g(should)f
(include)-600 -118 y(a)45 b(POST)g(method)f(form.)f(The)i(follo)n(wing)
e(template)h(tags)h(may)f(be)h(used:)89 b({action_url})43
b(-)i(A)g(phpgw->link)d(to)j(con\002g.php)d(will)k(be)e(inserted.)89
b({title})-600 -19 y(-)50 b(This)g(will)g(be)f(parsed)g(to)h(display)f
('Site)h(Con\002guration'.)97 b({th_bg},{th_te)o(xt},{ro)n(w_)o(on})o
(,{ro)m(w_)o(of)n(f)o(})44 b(-)50 b(Replaced)f(with)h(the)f(current)g
(theme)g(colors.)-600 81 y(and)c(the)g(follo)n(wing)e(special)i(types:)
91 b({lang_XXX})44 b(-)h(Filled)h(with)f(lang\('XXX'\).)89
b({v)n(alue_XXX})43 b(-)i(Filled)h(with)f(the)g(current)f(v)n(alue)h
(of)f(con\002g)h(item)-600 180 y('XXX'.)95 b({selected_XXX})47
b(-)h(set)h(to)e(\224,)h(or)g(')g(selected')f(if)h(an)g(option)e(v)n
(alue)h(is)i(current.)94 b({hook_XXX})46 b(-)i(Calls)h(a)f(function)e
(named)g(XXX)i(\(will)-600 280 y(be)54 b(discussed)g(later\).)109
b({check)o(ed_XXX+YYY})51 b(-)k(Handles)f(checkbox/radio)c(v)n(alues)k
(set)h(to)g(YYY)f(or)g(\224)h(\(will)f(be)h(discussed)f(later\).)108
b(F)o(ollo)n(wing)-600 380 y(is)70 b(an)f(e)o(xample)e(from)h(the)h
(addressbook)e(application:)g(<form)h(method="POST")f
(action="{action_url}">)e(<table)k(border="0")d(align="center">)-600
479 y(<tr)96 b(bgcolor="{th_bg}">)c(<td)k(colspan="2"><font)d
(color="{th_te)o(xt}">&nbsp;<b>)o({title}</b>)o(</fon)o(t></td)o(>)e
(</tr>)96 b(<tr)g(bgcolor="{th_err}">)-600 579 y(<td)62
b(colspan="2">&nbsp;<b>{erro)o(r}</b)o(></fo)o(nt>)o(</td>)56
b(</tr>)61 b(<!--)g(END)h(header)e(-->)i(<!--)f(BEGIN)g(body)f(-->)i
(<tr)f(bgcolor="{ro)n(w_on}">)c(<td)-600 679 y(colspan="2">&nbsp;</td>)
28 b(</tr>)33 b(<tr)g(bgcolor="{ro)n(w_of)n(f}">)27 b(<td)32
b(colspan="2">&nbsp;<b>{lang_Ad)o(dre)o(ssbook)o(}/{lan)o(g_)o
(Contact_)o(Setting)o(s}</b></f)o(on)o(t>)-600 778 y(</td>)121
b(</tr>)g(<tr)h(bgcolor="{ro)n(w_on}">)116 b
(<td>{lang_Contact_application}:</td)o(>)g(<td><input)j(name="ne)n
(wsettings[contact_application])o(")-600 878 y(v)n(alue="{v)n
(alue_contact_applicatio)o(n}")o(></td>)25 b(</tr>)31
b(...)62 b(Note)30 b(the)h(\002eldname,)e(ne)n
(wsettings[contact_application].)d(This)31 b(array)f(name)g(must)h(be)f
(used)h(for)f(the)-600 977 y(form)e(v)n(alues.)h(Ne)o(xt,)g(note)f(the)
i(v)n(alue)e(setting)h(for)g(this)h(form)e(element,)h({v)n
(alue_contact_application}.)23 b(This)30 b(indicates)f(that)g(we)h(w)o
(ant)f(the)g(current)f(v)n(alue)h(of)g(the)-600 1077
y(con\002g)21 b(setting,)h('contact_application',)c(to)k(be)g(set)h
(and)e(displayed)g(on)h(the)g(form.)f(Lastly)-5 b(,)21
b(look)g(at)i(the)f(template)g(element,)f({lang_Contact_application}.)c
(Here,)22 b(the)-600 1177 y(v)n(alue)k(from)g(the)h(lang)f(db)g(table)h
(will)h(be)e(inserted)h(if)g(a)n(v)n(ailable.)53 b(Let')-5
b(s)28 b(tak)o(e)e(a)i(look)e(at)h(part)f(of)h(the)g(preferences/def)o
(ault/con\002g.tpl:)49 b(<tr)27 b(bgcolor="{ro)n(w_on}">)-600
1276 y(<td>{lang_Country_Selection})35 b(\({lang_T)-6
b(e)o(xt_Entry}/{lang_)o(SelectBox}\))o(:</td>)35 b(<td>)40
b(<select)h(name="ne)n(wsettings[countrylist]">)36 b
({hook_country_set})-600 1376 y(</select>)f(</td>)f(</tr>)70
b(Here,)34 b(we)h(are)g(adding)e(a)i(ne)n(w)f(element,)g
({hook_country_set}.)29 b(This)35 b(brings)f(up)g(the)g(ne)o(xt)g
(\002le)i(we)e(will)i(need)e(to)g(parse)h(this)g(v)n(alue,)-600
1476 y(hook_con\002g.inc.php.)56 b(But)62 b(\002rst,)g(let')-5
b(s)63 b(look)d(at)j(the)e(last)i(template)e(type,)g('check)o(ed':)f
(<input)g(name="ne)n(wsettings[enable_remote_ad)o(dr)o(essboo)o(k])o(")
-600 1575 y(type="radio")36 b(v)n(alue=""{check)o(ed_enable_r)o(emo)o
(te_ad)o(dr)o(essboo)o(k+}>)o({lang)o(_n)o(o})c(<input)38
b(name="ne)n(wsettings[enable_remo)o(te_ad)o(dr)o(essboo)o(k]")32
b(type="radio")-600 1675 y(v)n(alue="T)m(rue"{check)o(ed_enab)o(le_re)o
(mo)o(te_ad)o(dr)o(essboo)o(k+T)l(rue})o(>{lang)o(_y)o(es})g(W)-7
b(e)20 b(w)o(ant)f(to)f(check)g(the)h(v)n(alue)e(of)i(the)f(setting)h
('enable_remote_addressboo)o(k')o(.)13 b(The)-600 1774
y(v)n(alue)18 b(could)h(be)g(\224)g(or)g('T)m(rue'.)f(W)-7
b(e)20 b(use)g(the)f('+')g(character)f(to)h(isolate)h(the)f(con\002g)f
(name)h(from)f(the)h(check)f(v)n(alue.)h(If)g(the)g(v)n(alue)f(is)i
(empty)f(or)g(unset)g(in)g(the)g(phpgw_con\002g)-600
1874 y(table,)38 b({check)o(ed_enable_remote_ad)o(dr)o(essboo)o(k+})32
b(is)40 b(replaced)d(with)h(')h(check)o(ed'.)d(If)j(the)f(v)n(alue)g
(is)h('T)m(rue',{check)o(ed_enable_r)o(emo)o(te_ad)o(dr)o(essboo)o(k+T)
l(rue)o(})-600 1974 y(is)29 b(replaced)d(with)i(')g(check)o(ed'.)e
(Note)h(that)h(the)g(part)f(after)g(the)h('+')f(character)g(matches)g
(what)h(is)g(in)g(the)g(v)n(alue=\224XXX\224)e(part)i(in)g(the)f(html)h
(for)f(this)h(form)f(element.)-600 2073 y(hook_con\002g.inc.php)19
b(\(optional\))49 b(At)26 b(each)f(in)m(v)n(ocation)e(of)i
(con\002g.php,)e(a)i(call)h(to)f(the)g(common)f(class)i(function)d
(hook_single\(\))f(is)27 b(made.)d(It)h(attempts)g(to)h(include)-600
2173 y(a)31 b(\002le,)g(hook_con\002g.inc.php)24 b(as)31
b(a)g(set)g(of)f(code)g(for)g(con\002g.php)d(to)k(use.)f(In)g(the)h
(case)f(of)g(the)h(preferences)d(e)o(xample)h(abo)o(v)o(e,)g(using)g
(hook_country_set,)d(here)k(is)-600 2273 y(the)39 b(corresponding)d
(function)i(in)i(preferences/inc/hook_con)o(\002g.in)o(c.ph)o(p:)34
b(function)j(country_set\($con\002g\))e({)40 b($country)d(=)j(array\()e
('user_choice')f(=>)j('Users)-600 2372 y(Choice',)30
b('force_select')e(=>)j('F)o(orce)e(Selectbox')h(\);)g(while)h(\(list)g
(\($k)o(e)o(y)-5 b(,)29 b($v)n(alue\))g(=)h(each)h(\($country\)\))c({)k
(if)f(\($con\002g['countrylist'])c(==)31 b($k)o(e)o(y\))e({)i
($selected)f(=)h(')-600 2472 y(selected';)23 b(})g(else)h({)g
($selected)e(=)i(\224;)f(})h($descr)e(=)i(lang\($v)n(alue\);)c($out)i
(.=)i('<option)d(v)n(alue="')h(.)h($k)o(e)o(y)f(.)i('"')e(.)i
($selected)f(.)g('>')g(.)g($descr)g(.)g('</option>')e(.)i("\\n";)g(})h
(return)-600 2571 y($out;)31 b(})63 b(Note)31 b(again)g(the)g(template)
g(v)n(alue)g(we)g(used)g(earlier)m(,)g({hook_country_set}.)26
b(This)31 b(causes)h(con\002g.php)d(to)i(look)g(for)f(a)i(function)e
(named)g(country_set\(\).)-600 2671 y(Since)j(we)g(included)e(the)i
(\002le)h(with)f(this)g(function)e(via)i(the)g(hook_single\(\))c(call,)
34 b(this)f(function)e(is)j(e)o(x)o(ecuted.)c(It')-5
b(s)34 b(return)e(is)h(a)h(string,)e(and)g(the)h(function)e(prints)-600
2771 y(nothing)25 b(itself.)54 b(hook_con\002g_v)n(alidate.in)o(c.p)o
(hp)20 b(\(optional\))52 b(Once)26 b(the)h(admin)e(clicks)i(the)f
(submit)g(b)n(utton)g(to)g(post)h(the)f(form,)g(we)g(can)h(optionally)d
(v)n(alidate)i(their)-600 2870 y(input)j(using)h(one)g(or)g(man)o(y)f
(dif)n(ferent)f(functions.)h(This)h(is)h(done)e(by)h(\002rst)h(making)e
(another)f(call)j(to)f(hook_single\(\))d(in)k(the)f(API)g(common)e
(class.)j(This)g(time,)f(the)-600 2970 y(name)k(con\002g_v)n(alidate)e
(is)j(used,)f(so)h(common)d(tries)j(to)g(include)e
('application/inc/hook_con\002g_)o(v)n(alid)o(ate.in)o(c.ph)o(p')o(.)64
b(If)34 b(this)h(\002le)g(e)o(xists,)g(it)g(sets)h(a)f(v)n(ar)f(to)g
(tell)-600 3070 y(con\002g.php)c(it)j(w)o(as)g(found.)e(F)o(ollo)n
(wing)g(then)h(are)h(functions)e(named)g(after)h(each)g(con\002g)g(we)h
(w)o(ant)f(to)h(v)n(alidate.)f(The)g(follo)n(wing)f(e)o(xample)g(is)i
(for)f(addressbook:)-600 3169 y($GLOB)m(ALS['phpgw_info'][')-5
b(serv)n(er')o(][)o('fo)o(un)o(d_)o(v)n(alid)o(ation)o(_h)o(oo)o(k'])35
b(=)41 b(T)m(rue;)f(/*)h(Check)g(a)g(speci\002c)g(setting.)f(Name)h
(must)g(match)f(the)h(setting.)g(*/)g(function)-600 3269
y(ldap_contact_conte)o(xt\($v)n(a)o(lue=\224\))e({)45
b(if\($v)n(alue)f(==)h($GLOB)m(ALS['phpgw_info'][')-6
b(serv)o(er)o('][)o(')o(ldap)o(_c)o(on)o(te)o(xt')o(]\))39
b({)46 b($GLOB)m(ALS['con\002g_error'])40 b(=)45 b('Contact)-600
3368 y(conte)o(xt)17 b(for)g(ldap)h(must)g(be)g(dif)n(ferent)f(from)g
(the)h(conte)o(xt)f(used)h(for)f(accounts';)g(})h(elseif\($v)n(alue)f
(==)h($GLOB)m(ALS['phpgw_info'][')-5 b(serv)n(er')o(][')n(ldap)o(_g)o
(rou)o(p_)o(con)o(te)o(x)o(t']\))-600 3468 y({)22 b($GLOB)m
(ALS['con\002g_error'])16 b(=)21 b('Contact)g(conte)o(xt)e(for)i(ldap)f
(must)i(be)f(dif)n(ferent)e(from)h(the)h(conte)o(xt)f(used)h(for)f
(groups';)g(})h(else)h({)f($GLOB)m(ALS['con\002g_error'])16
b(=)-600 3568 y(\224;)24 b(})h(})48 b(Here)24 b(we)g(created)f(a)h
(function)f(to)h(check)f(the)g(entered)g(v)n(alue)g(for)h(the)f
(con\002g)g(item,)h(ldap_contact_conte)o(xt.)19 b(W)-7
b(e)25 b(w)o(ant)f(to)g(mak)o(e)g(sure)f(the)h(admin)f(did)h(not)f(set)
-600 3667 y(this)d(v)n(alue)f(to)g(one)g(which)g(w)o(ould)g(con\003ict)
g(with)h(another)e(con\002g)g(item,)i(used)f(for)g(accounts)f(or)h
(groups)f(in)i(phpGroupW)-7 b(are.)36 b(con\002g.php)17
b(calls)k(this)e(function,)f(sending)-600 3767 y(it)j(the)g(POST)-6
b(ed)21 b(v)n(alue.)f(con\002g.php)e(continues,)h(adding)g(all)j(other)
e(con\002g)f(items)j(from)d(the)i(POST)-6 b(ed)21 b(v)n(alues.)41
b(The)21 b(v)n(ariable)e($GLOB)m(ALS['con\002g_error'])d(is)22
b(parsed)-600 3867 y(through)e(lang\(\),)h(then)h(appended)e(to)j(the)f
(local)h(v)n(ariable,)e($error)-5 b(.)21 b(If)h(this)h(has)g(an)o(y)f
(v)n(alue)f(after)h(the)h(POST)-6 b(ed)22 b(v)n(ariables)g(are)g(check)
o(ed,)f(the)i(form)e(then)h(has)h(its)g({error})-600
3966 y(tag)f(\002lled)g(with)f(this)i(result.)e(The)g(form)g(is)h
(displayed)f(again,)f(with)i(the)g(error)-5 b(.)20 b(If)i($error)e(has)
i(no)f(v)n(alue,)g(con\002g.php)e(redirects)i(to)g(admin/inde)o(x.php.)
40 b(Ho)n(we)n(v)o(er)m(,)19 b(there)-600 4066 y(is)i(one)e(more)g
(function)f(that)i(may)g(be)g(included)e(in)i(hook_con\002g_v)n
(alidate.inc.)o(ph)o(p:)35 b(/*)20 b(Check)g(all)g(settings)g(to)g(v)n
(alidate)f(input.)g(Name)h(must)g(be)g('\002nal_v)n(alidation')d(*/)
-600 4165 y(function)36 b(\002nal_v)n(alidation\($v)n(alue=\224\))c({)
38 b(if\($v)n(alue['contact_repository)o('])32 b(==)38
b(')o(ldap')e(&&)i(!$v)n(alue[')o(ldap_contact_d)o(n')o(]\))32
b({)38 b($GLOB)m(ALS['con\002g_error'])32 b(=)-600 4265
y('Contact)37 b(dn)g(must)h(be)f(set';)h(})g(elseif\($v)n
(alue['contact_repositor)o(y'])31 b(==)38 b(')o(ldap')f(&&)g(!$v)n
(alue[')o(ldap_contact_co)o(nte)n(xt'])o(\))32 b({)38
b($GLOB)m(ALS['con\002g_error'])32 b(=)-600 4365 y('Contact)24
b(conte)o(xt)f(must)i(be)f(set';)h(})g(else)h({)f($GLOB)m
(ALS['con\002g_error'])19 b(=)25 b(\224;)g(})g(})50 b(con\002g.php)22
b(checks)i(for)g(the)g(e)o(xistence)g(of)g(the)h(function)e('\002nal_v)
n(alidation\(\)'.)-600 4464 y(This)31 b(function)e(can)i(be)g(used)g
(to)g(check)f(all)i(form)e(v)n(alues)g(at)i(once.)e(It)h(gets)h(sent)f
(the)g(entire)g($ne)n(wsettings)f(array)g(POST)-6 b(ed)31
b(from)f(the)h(form.)f(As)h(with)h(the)f(other)-600 4564
y(functions)19 b(in)h(this)h(\002le,)f(\002nal_v)n(alidation\(\))e
(should)h(set)i($GLOB)m(ALS['con\002g_error'])15 b(if)20
b(there)g(is)h(a)g(problem.)p Black Black eop
1 0 bop Black 0 TeXcolorgray Black Black 505 647 a Ff(phpGr)l(oupW)-8
b(are)58 b(admin/con\002g.php)695 879 y Fe(A)21 b(brief)e(introduction)
f(to)i(writing)g(hooks)f(and)h(templates)g(for)f(an)o(y)h(application)e
(to)j(use)f(this)695 987 y(admin)f(interf)o(ace,)h(by)695
1136 y(Miles)h(Lott)f(<milosch@phpgroupw)o(are.or)o(g)o(>)15
b(Dec)20 b(22,)g(2001.)-2 1854 y Fd(1.)39 b(Files)-2
2182 y Fc(1.1.)34 b(con\002g.tpl)h(\(required\))396 2350
y Fe(In)20 b(your)f(application/templates/def)o(ault)e(directory)-5
b(,)18 b(create)i(a)g(ne)n(w)g(template)g(\002le)h(named)e
('con\002g.tpl'.)f(This)i(will)396 2458 y(be)g(included)f(by)h
(con\002g.php)d(and)j(used)g(to)g(dra)o(w)g(the)g(page.)f(This)i
(template)e(should)h(include)f(a)h(POST)h(method)396
2566 y(form.)e(The)h(follo)n(wing)f(template)g(tags)i(may)e(be)i(used:)
p Black 463 2798 a(1.)p Black 40 w({action_url})e(-)h(A)h(phpgw->link)c
(to)j(con\002g.php)e(will)j(be)f(inserted.)p Black 463
2947 a(2.)p Black 40 w({title})h(-)f(This)h(will)g(be)f(parsed)f(to)i
(display)e('Site)i(Con\002guration'.)p Black 463 3097
a(3.)p Black 40 w({th_bg},{th_te)o(xt},{ro)n(w_on)o(},{r)o(o)n(w_)o(of)
m(f})15 b(-)20 b(Replaced)g(with)g(the)g(current)f(theme)h(colors.)396
3246 y(and)g(the)g(follo)n(wing)f(special)h(types:)p
Black 463 3479 a(1.)p Black 40 w({lang_XXX})f(-)i(Filled)f(with)h
(lang\('XXX'\).)p Black 463 3628 a(2.)p Black 40 w({v)n(alue_XXX})e(-)h
(Filled)h(with)f(the)g(current)f(v)n(alue)h(of)g(con\002g)f(item)h
('XXX'.)p Black 463 3778 a(3.)p Black 40 w({selected_XXX})g(-)g(set)h
(to)f(\224,)h(or)f(')g(selected')g(if)g(an)h(option)d(v)n(alue)i(is)h
(current.)p Black 463 3927 a(4.)p Black 40 w({hook_XXX})d(-)j(Calls)g
(a)g(function)d(named)h(XXX)i(\(will)f(be)h(discussed)f(later\).)396
4077 y(F)o(ollo)n(wing)f(is)i(an)f(e)o(xample)f(from)g(the)h
(addressbook)e(application:)396 4257 y Fb(<form)44 b(method="POST")f
(action="{action_url}">)396 4354 y(<table)h(border="0")f
(align="center">)441 4451 y(<tr)h(bgcolor="{th_bg}">)486
4548 y(<td)g(colspan="2"><font)e
(color="{th_text}">&nbsp;<b>{title}</b></f)o(ont><)o(/td>)441
4645 y(</tr>)i(<tr)g(bgcolor="{th_err}">)486 4742 y(<td)g
(colspan="2">&nbsp;<b>{error}</b></font></)o(td>)441
4840 y(</tr>)p Black 3842 5278 a Fa(1)p Black eop
%%Page: 2 2
2 1 bop Black 0 TeXcolorgray Black 2778 67 a Fa(phpGr)l(oupW)-8
b(ar)m(e)19 b(admin/con\002g)o(.php)p Black 396 579 a
Fb(<!--)44 b(END)h(header)f(-->)396 676 y(<!--)g(BEGIN)g(body)h(-->)441
773 y(<tr)f(bgcolor="{row_on}">)486 870 y(<td)g
(colspan="2">&nbsp;</td>)441 967 y(</tr>)441 1065 y(<tr)g
(bgcolor="{row_off}">)486 1162 y(<td)g
(colspan="2">&nbsp;<b>{lang_Addressbook}/{)o(lang_C)o(ontact)o(_Setti)o
(ngs}<)o(/b></f)o(ont>)396 1259 y(</td>)441 1356 y(</tr>)441
1453 y(<tr)g(bgcolor="{row_on}">)486 1550 y
(<td>{lang_Contact_application}:</td>)486 1647 y(<td><input)f
(name="newsettings[contact_application]")38 b
(value="{value_contact_application}"></td>)441 1745 y(</tr>)396
1842 y(...)396 2130 y Fe(Note)20 b(the)h(\002eldname,)e(ne)n
(wsettings[contact_application].)c(This)20 b(array)f(name)h(must)g(be)g
(used)g(for)g(the)g(form)f(v)n(alues.)396 2238 y(Ne)o(xt,)h(note)g(the)
g(v)n(alue)f(setting)i(for)e(this)i(form)e(element,)g({v)n
(alue_contact_application}.)c(This)20 b(indicates)g(that)h(we)396
2346 y(w)o(ant)g(the)f(current)f(v)n(alue)g(of)h(the)g(con\002g)g
(setting,)g('contact_application',)c(to)k(be)g(set)h(and)f(displayed)f
(on)g(the)i(form.)396 2454 y(Lastly)-5 b(,)20 b(look)f(at)i(the)f
(template)g(element,)f({lang_Contact_application}.)d(Here,)j(the)i(v)n
(alue)e(from)g(the)i(lang)e(db)h(table)396 2561 y(will)h(be)f(inserted)
g(if)g(a)n(v)n(ailable.)396 2711 y(Let')-5 b(s)21 b(tak)o(e)f(a)h(look)
e(at)i(part)f(of)g(the)g(preferences/def)o(ault/con\002g.tpl:)441
2891 y Fb(<tr)44 b(bgcolor="{row_on}">)486 2988 y
(<td>{lang_Country_Selection})c
(\({lang_Text_Entry}/{lang_SelectBox}\):</)o(td>)486
3085 y(<td>)531 3182 y(<select)j(name="newsettings[countrylist]">)396
3280 y({hook_country_set})531 3377 y(</select>)486 3474
y(</td>)441 3571 y(</tr>)396 3859 y Fe(Here,)20 b(we)h(are)f(adding)f
(a)h(ne)n(w)g(element,)f({hook_country_set}.)d(This)k(brings)f(up)h
(the)g(ne)o(xt)g(\002le)h(we)f(will)h(need)f(to)396 3967
y(parse)g(this)h(v)n(alue...)-2 4337 y Fc(1.2.)34 b
(hook_con\002g.inc.php)j(\(optional\))396 4504 y Fe(At)21
b(each)f(in)m(v)n(ocation)e(of)i(con\002g.php,)d(a)k(call)g(to)f(the)g
(common)f(class)i(function)d(hook_single\(\))f(is)k(made.)f(It)g
(attempts)396 4612 y(to)h(include)e(a)h(\002le,)h
(hook_con\002g.inc.php)14 b(as)21 b(a)g(set)g(of)f(code)f(for)h
(con\002g.php)d(to)k(use.)f(In)g(the)g(case)h(of)f(the)g(preferences)
396 4720 y(e)o(xample)f(abo)o(v)o(e,)f(using)i(hook_country_set,)15
b(here)20 b(is)h(the)f(corresponding)d(function)i(in)396
4828 y(preferences/inc/hook_con\002g.)o(inc.p)o(hp)o(:)p
Black 3842 5278 a Fa(2)p Black eop
%%Page: 3 3
3 2 bop Black 0 TeXcolorgray Black 2778 67 a Fa(phpGr)l(oupW)-8
b(ar)m(e)19 b(admin/con\002g)o(.php)p Black 396 579 a
Fb(function)44 b(country_set\($config\))396 676 y({)576
773 y($country)f(=)i(array\()f('user_choice')e(=>)j('Users)f(Choice',)f
('force_select')f(=>)j('Force)f(Se-)396 870 y(lectbox')g(\);)576
967 y(while)g(\(list)g(\($key,)f($value\))h(=)h(each)f(\($country\)\))
576 1065 y({)755 1162 y(if)g(\($config['countrylist'])d(==)k($key\))755
1259 y({)934 1356 y($selected)f(=)g(')h(selected';)755
1453 y(})755 1550 y(else)755 1647 y({)934 1745 y($selected)f(=)g(\224;)
755 1842 y(})755 1939 y($descr)g(=)g(lang\($value\);)755
2036 y($out)g(.=)h('<option)e(value="')h(.)g($key)g(.)h('"')f(.)h
($selected)e(.)i('>')f(.)h($descr)f(.)g('</option>')f(.)i("\\n";)576
2133 y(})576 2230 y(return)e($out;)396 2327 y(})396 2615
y Fe(Note)20 b(again)g(the)g(template)f(v)n(alue)h(we)h(used)e(earlier)
m(,)h({hook_country_set}.)15 b(This)20 b(causes)h(con\002g.php)c(to)k
(look)e(for)h(a)396 2723 y(function)f(named)g(country_set\(\).)e(Since)
j(we)h(included)d(the)j(\002le)g(with)f(this)h(function)d(via)i(the)g
(hook_single\(\))d(call,)396 2831 y(this)k(function)d(is)k(e)o(x)o
(ecuted.)c(It')-5 b(s)21 b(return)e(is)i(a)f(string,)g(and)g(the)g
(function)e(prints)i(nothing)f(itself.)-2 3201 y Fc(1.3.)34
b(hook_con\002g_v)n(alidate)r(.inc.php)39 b(\(optional\))396
3369 y Fe(Once)20 b(the)g(admin)g(clicks)g(the)g(submit)g(b)n(utton)f
(to)i(post)f(the)g(form,)f(we)i(can)f(optionally)e(v)n(alidate)i(their)
g(input)f(using)396 3477 y(one)h(or)g(man)o(y)f(dif)n(ferent)f
(functions.)h(This)h(is)h(done)e(by)h(\002rst)h(making)e(another)g
(call)h(to)h(hook_single\(\))c(in)j(the)g(API)396 3584
y(common)f(class.)h(This)h(time,)f(the)g(name)g(con\002g_v)n(alidate)d
(is)k(used,)f(so)h(common)d(tries)j(to)f(include)396
3692 y('application/inc/hook_con\002g_)o(v)n(a)o(lidate.in)o(c.p)o(hp)o
('.)396 3842 y(If)g(this)h(\002le)g(e)o(xists,)f(it)h(sets)g(a)g(v)n
(ar)f(to)g(tell)h(con\002g.php)d(it)i(w)o(as)i(found.)c(F)o(ollo)n
(wing)h(then)g(are)h(functions)f(named)g(after)396 3950
y(each)h(con\002g)f(we)i(w)o(ant)f(to)h(v)n(alidate.)e(The)h(follo)n
(wing)e(e)o(xample)h(is)i(for)f(addressbook:)576 4130
y Fb($GLOBALS['phpgw_info']['server']['fou)o(nd_val)o(idatio)o(n_hook)o
('])39 b(=)45 b(True;)576 4227 y(/*)f(Check)g(a)h(specific)e(setting.)h
(Name)g(must)g(match)g(the)g(setting.)g(*/)576 4324 y(function)f
(ldap_contact_context\($value=\224\))576 4421 y({)755
4518 y(if\($value)g(==)i($GLOBALS['phpgw_info']['server']['ldap)o
(_conte)o(xt']\))755 4616 y({)934 4713 y($GLOBALS['config_error'])c(=)k
('Contact)e(context)h(for)g(ldap)g(must)g(be)h(differ-)396
4810 y(ent)g(from)f(the)g(context)g(used)g(for)g(accounts';)p
Black 3842 5278 a Fa(3)p Black eop
%%Page: 4 4
4 3 bop Black 0 TeXcolorgray Black 2778 67 a Fa(phpGr)l(oupW)-8
b(ar)m(e)19 b(admin/con\002g)o(.php)p Black 755 579 a
Fb(})755 676 y(elseif\($value)43 b(==)h
($GLOBALS['phpgw_info']['server']['ldap_g)o(roup_)o(contex)o(t']\))755
773 y({)934 870 y($GLOBALS['config_error'])d(=)k('Contact)e(context)h
(for)g(ldap)g(must)g(be)h(differ-)396 967 y(ent)g(from)f(the)g(context)
g(used)g(for)g(groups';)755 1065 y(})755 1162 y(else)755
1259 y({)934 1356 y($GLOBALS['config_error'])d(=)k(\224;)755
1453 y(})576 1550 y(})396 1838 y Fe(Here)20 b(we)f(created)g(a)h
(function)e(to)i(check)e(the)i(entered)e(v)n(alue)h(for)g(the)g
(con\002g)g(item,)g(ldap_contact_conte)o(xt.)c(W)-7 b(e)21
b(w)o(ant)396 1946 y(to)g(mak)o(e)e(sure)h(the)h(admin)e(did)h(not)g
(set)h(this)f(v)n(alue)g(to)g(one)g(which)g(w)o(ould)f(con\003ict)h
(with)g(another)f(con\002g)g(item,)h(used)396 2054 y(for)g(accounts)f
(or)h(groups)f(in)h(phpGroupW)-7 b(are.)396 2204 y(con\002g.php)18
b(calls)j(this)g(function,)d(sending)h(it)i(the)f(POST)-6
b(ed)20 b(v)n(alue.)f(con\002g.php)f(continues,)h(adding)g(all)h(other)
g(con\002g)396 2312 y(items)h(from)e(the)h(POST)-6 b(ed)21
b(v)n(alues.)396 2461 y(The)f(v)n(ariable)f($GLOB)m
(ALS['con\002g_error'])c(is)21 b(parsed)f(through)e(lang\(\),)h(then)g
(appended)f(to)j(the)f(local)g(v)n(ariable,)396 2569
y($error)-5 b(.)19 b(If)h(this)h(has)f(an)o(y)g(v)n(alue)f(after)h(the)
g(POST)-6 b(ed)20 b(v)n(ariables)g(are)g(check)o(ed,)f(the)h(form)f
(then)h(has)g(its)h({error})e(tag)396 2677 y(\002lled)i(with)f(this)h
(result.)f(The)g(form)f(is)i(displayed)e(again,)g(with)h(the)g(error)-5
b(.)20 b(If)g($error)e(has)j(no)e(v)n(alue,)h(con\002g.php)396
2785 y(redirects)g(to)g(admin/inde)o(x.php.)396 2934
y(Ho)n(we)n(v)o(er)m(,)e(there)i(is)h(one)f(more)f(function)g(that)h
(may)g(be)g(included)e(in)j(hook_con\002g_v)n(alidate.inc)o(.ph)o(p:)
576 3114 y Fb(/*)44 b(Check)g(all)g(settings)g(to)g(validate)g(input.)g
(Name)g(must)g(be)h('final_validation')c(*/)576 3212
y(function)i(final_validation\($value=\224\))576 3309
y({)755 3406 y(if\($value['contact_repository'])d(==)k('ldap')g(&&)g
(!$value['ldap_contact_dn']\))755 3503 y({)934 3600 y
($GLOBALS['config_error'])d(=)k('Contact)e(dn)i(must)f(be)g(set';)755
3697 y(})755 3794 y(elseif\($value['contact_repository'])39
b(==)44 b('ldap')g(&&)h(!$value['ldap_contact_context']\))755
3891 y({)934 3989 y($GLOBALS['config_error'])c(=)k('Contact)e(context)h
(must)g(be)h(set';)755 4086 y(})755 4183 y(else)755 4280
y({)934 4377 y($GLOBALS['config_error'])c(=)k(\224;)755
4474 y(})576 4571 y(})p Black 3842 5278 a Fa(4)p Black
eop
%%Page: 5 5
5 4 bop Black 0 TeXcolorgray Black 2778 67 a Fa(phpGr)l(oupW)-8
b(ar)m(e)19 b(admin/con\002g)o(.php)p Black 396 579 a
Fe(con\002g.php)f(checks)i(for)f(the)h(e)o(xistence)g(of)g(the)g
(function)e('\002nal_v)n(alidation\(\)'.)f(This)j(function)e(can)i(be)g
(used)g(to)396 687 y(check)g(all)g(form)g(v)n(alues)f(at)i(once.)e(It)i
(gets)f(sent)h(the)f(entire)g($ne)n(wsettings)f(array)g(POST)-6
b(ed)21 b(from)e(the)h(form.)f(As)i(with)396 795 y(the)f(other)g
(functions)f(in)h(this)h(\002le,)f(\002nal_v)n(alidation\(\))d(should)j
(set)h($GLOB)m(ALS['con\002g_error'])15 b(if)20 b(there)g(is)h(a)396
903 y(problem.)p Black 3842 5278 a Fa(5)p Black eop
%%Page: 6 6
6 5 bop Black 0 TeXcolorgray Black 2778 67 a Fa(phpGr)l(oupW)-8
b(ar)m(e)19 b(admin/con\002g)o(.php)p Black Black 3840
5278 a(6)p Black eop
%%Trailer
end
userdict /end-hook known{end-hook}if

View File

@ -67,11 +67,6 @@
<para>
&lcub;hook_XXX&rcub; - Calls a function named XXX (will be discussed later).
</para>
</listitem>
<listitem>
<para>
&lcub;checked_XXX+YYY&rcub; - Handles checkbox/radio values set to YYY or '' (will be discussed later).
</para>
</listitem>
</orderedlist>
<para>
@ -117,14 +112,7 @@
]]><![ CDATA [ </tr>
]]> </programlisting>
<para>
Here, we are adding a new element, &lcub;hook_country_set&rcub;. This brings up the next file we will need to parse this value, hook_config.inc.php. But first, let's look at the last template type, 'checked':
</para>
<programlisting>
<![ CDATA [<input name="newsettings[enable_remote_addressbook]" type="radio" value=""{checked_enable_remote_addressbook+}>{lang_no}
]]><![ CDATA [<input name="newsettings[enable_remote_addressbook]" type="radio" value="True"{checked_enable_remote_addressbook+True}>{lang_yes}
]]> </programlisting>
<para>
We want to check the value of the setting 'enable_remote_addressbook'. The value could be '' or 'True'. We use the '+' character to isolate the config name from the check value. If the value is empty or unset in the phpgw_config table, &lcub;checked_enable_remote_addressbook+&rcub; is replaced with ' checked'. If the value is 'True',&lcub;checked_enable_remote_addressbook+True&rcub; is replaced with ' checked'. Note that the part after the '+' character matches what is in the value=&rdquo;XXX&rdquo; part in the html for this form element.
Here, we are adding a new element, &lcub;hook_country_set&rcub;. This brings up the next file we will need to parse this value...
</para>
</sect2>
<sect2>

View File

@ -1,15 +1,10 @@
phpGroupWare admin/config.php
Abstract
A brief introduction to writing hooks and templates for any
application to use this admin interface, by
Abstract
Miles Lott <milosch@phpgroupware.org> Dec 22, 2001.
A brief introduction to writing hooks and templates for any application to use
this admin interface, by Miles Lott <milosch@phpgroupware.org> Dec 22, 2001.
1 Files
@ -22,70 +17,39 @@ include a POST method form. The following template tags
may be used:
1. {action_url} - A phpgw->link to config.php will be inserted.
2. {title} - This will be parsed to display 'Site Configuration'.
3. {th_bg},{th_text},{row_on},{row_off} - Replaced with the
current theme colors.
3. {th_bg},{th_text},{row_on},{row_off} - Replaced with the current theme colors.
and the following special types:
1. {lang_XXX} - Filled with lang('XXX').
2. {value_XXX} - Filled with the current value of config item
'XXX'.
3. {selected_XXX} - set to '', or ' selected' if an option
value is current.
4. {hook_XXX} - Calls a function named XXX (will be discussed
later).
5. {checked_XXX+YYY} - Handles checkbox/radio values set to
YYY or '' (will be discussed later).
2. {value_XXX} - Filled with the current value of config item 'XXX'.
3. {selected_XXX} - set to '', or ' selected' if an option value is current.
4. {hook_XXX} - Calls a function named XXX (will be discussed later).
Following is an example from the addressbook application:
<form method="POST" action="{action_url}">
<table border="0" align="center">
<tr bgcolor="{th_bg}">
<td colspan="2"><font color="{th_text}">&nbsp;<b>{title}</b></font></td>
</tr> <tr bgcolor="{th_err}">
<td colspan="2">&nbsp;<b>{error}</b></font></td>
</tr>
<!-- END header -->
<!-- BEGIN body -->
<tr bgcolor="{row_on}">
<td colspan="2">&nbsp;</td>
</tr>
<tr bgcolor="{row_off}">
<td colspan="2">&nbsp;<b>{lang_Addressbook}/{lang_Contact_Settings}</b></font>
</td>
</tr>
<tr bgcolor="{row_on}">
<td>{lang_Contact_application}:</td>
<td><input name="newsettings[contact_application]" value="{value_contact_application}"></td>
</tr>
...
Note the fieldname, newsettings[contact_application]. This
@ -100,40 +64,16 @@ if available.
Let's take a look at part of the preferences/default/config.tpl:
<tr bgcolor="{row_on}">
<td>{lang_Country_Selection} ({lang_Text_Entry}/{lang_SelectBox}):</td>
<td>
<select name="newsettings[countrylist]">
{hook_country_set}
</select>
</td>
</tr>
Here, we are adding a new element, {hook_country_set}. This
brings up the next file we will need to parse this value,
hook_config.inc.php. But first, let's look at the last template
type, 'checked':
<input name="newsettings[enable_remote_addressbook]" type="radio"
value=""{checked_enable_remote_addressbook+}>{lang_no}
<input name="newsettings[enable_remote_addressbook]" type="radio"
value="True"{checked_enable_remote_addressbook+True}>{lang_yes}
We want to check the value of the setting 'enable_remote_addressbook'.
The value could be '' or 'True'. We use the '+' character
to isolate the config name from the check value. If the
value is empty or unset in the phpgw_config table, {checked_enable_remote_addressbook+}
is replaced with ' checked'. If the value is 'True',{checked_enable_remote_addressbook+True}
is replaced with ' checked'. Note that the part after the
'+' character matches what is in the value="XXX"
part in the html for this form element.
brings up the next file we will need to parse this value...
1.2 hook_config.inc.php (optional)
@ -145,41 +85,22 @@ hook_country_set, here is the corresponding function in
preferences/inc/hook_config.inc.php:
function country_set($config)
{
$country = array( 'user_choice' => 'Users Choice', 'force_select'
=> 'Force Selectbox' );
$country = array( 'user_choice' => 'Users Choice', 'force_select' => 'Force Selectbox' );
while (list ($key, $value) = each ($country))
{
if ($config['countrylist'] == $key)
{
$selected = ' selected';
}
else
{
$selected = '';
}
$descr = lang($value);
$out .= '<option value="' . $key . '"' . $selected
. '>' . $descr . '</option>' . "\n";
$out .= '<option value="' . $key . '"' . $selected . '>' . $descr . '</option>' . "\n";
}
return $out;
}
Note again the template value we used earlier, {hook_country_set}.
@ -202,42 +123,24 @@ was found. Following then are functions named after each
config we want to validate. The following example is for
addressbook:
$GLOBALS['phpgw_info']['server']['found_validation_hook']
= True;
$GLOBALS['phpgw_info']['server']['found_validation_hook'] = True;
/* Check a specific setting. Name must match the setting.
*/
/* Check a specific setting. Name must match the setting. */
function ldap_contact_context($value='')
{
if($value == $GLOBALS['phpgw_info']['server']['ldap_context'])
{
$GLOBALS['config_error'] = 'Contact context for
ldap must be different from the context used for accounts';
$GLOBALS['config_error'] = 'Contact context for ldap must be different from the context used for accounts';
}
elseif($value == $GLOBALS['phpgw_info']['server']['ldap_group_context'])
{
$GLOBALS['config_error'] = 'Contact context for
ldap must be different from the context used for groups';
$GLOBALS['config_error'] = 'Contact context for ldap must be different from the context used for groups';
}
else
{
$GLOBALS['config_error'] = '';
}
}
Here we created a function to check the entered value for
@ -260,40 +163,21 @@ config.php redirects to admin/index.php.
However, there is one more function that may be included
in hook_config_validate.inc.php:
/* Check all settings to validate input. Name must be
'final_validation' */
/* Check all settings to validate input. Name must be 'final_validation' */
function final_validation($value='')
{
if($value['contact_repository'] == 'ldap' && !$value['ldap_contact_dn'])
{
$GLOBALS['config_error'] = 'Contact dn must be
set';
$GLOBALS['config_error'] = 'Contact dn must be set';
}
elseif($value['contact_repository'] == 'ldap' &&
!$value['ldap_contact_context'])
elseif($value['contact_repository'] == 'ldap' && !$value['ldap_contact_context'])
{
$GLOBALS['config_error'] = 'Contact context must
be set';
$GLOBALS['config_error'] = 'Contact context must be set';
}
else
{
$GLOBALS['config_error'] = '';
}
}
config.php checks for the existence of the function 'final_validation()'.

32
admin/help/DE/account.php Normal file
View File

@ -0,0 +1,32 @@
<?php
/**************************************************************************\
* phpGroupWare - User manual *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_flags = Array(
'currentapp' => 'manual',
'admin_header' => True,
);
$phpgw_info['flags'] = $phpgw_flags;
include('../../../header.inc.php');
$appname = 'admin';
?>
<img src="<?php echo $phpgw->common->image($appname,'navbar.gif'); ?>" border=0>
<font face="<?php echo $phpgw_info['theme']['font']; ?>" size="2"><p/>&nbsp;&nbsp;
Diese Funktion ist normalerweise nur f&uuml;r den Administrator zugänglich. Administration aller Programme, Benutzer und Benutzergruppen und Sitzungs/Logging Kontrolle.
<ul>
<li><b>Benutzerkonten-Verwaltung:</b><p/>&nbsp;&nbsp;
<i>Benutzerkonten:</i><br/>
Erstellen, Edittieren und l&ouml;schen von Benutzerkonten. Setzen von Gruppenmidgliedschaft und der Zugriff auf Programme.<p/>&nbsp;&nbsp;
<i>Benutzergruppen:</i><br/>
Erstellen, Edittieren und l&ouml;schen von Benutzergruppen.<p/>&nbsp;&nbsp;
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

54
admin/help/DE/admin.php Normal file
View File

@ -0,0 +1,54 @@
<?php
/**************************************************************************\
* phpGroupWare - User manual *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_flags = Array(
'currentapp' => 'manual',
'admin_header' => True,
);
$phpgw_info['flags'] = $phpgw_flags;
include('../../../header.inc.php');
$appname = 'admin';
?>
<img src="<?php echo $phpgw->common->image($appname,'navbar.gif'); ?>" border=0>
<font face="<?php echo $phpgw_info['theme']['font']; ?>" size="2"><p/>&nbsp;&nbsp;&nbsp;&nbsp;
Diese Funktion ist normalerweise nur f&uuml;r den Administrator zugänglich. Administration aller Programme, Benutzer und Benutzergruppen und Sitzungs/Logging Kontrolle.
<ul>
<li><b>Benutzerkonten-Verwaltung:</b><br/>
<i>Benutzerkonten:</i><br/>
Erstellen, Edittieren und l&ouml;schen von Benutzerkonten. Setzen von Gruppenmidgliedschaft und der Zugriff auf Programme.<br/
><i>Benutzergruppen:</i><br/>
Erstellen, Editieren und l&ouml;schen von Benutzergruppen.
<p/>&nbsp;&nbsp;&nbsp;&nbsp;
<li><b>Sitzungs-Verwaltung:</b><br/>
<i>Session's anzeigen::</i><br/>
Aktuelle Sitzungen, IP's, Login-Zeit, Inaktivit&auml;tszeit und die M&ouml;glichkeit sessions zu beenden (kill).<br/>
<i>Zugriffsaufzeichnungen (Access Log) anzeigen:</i><br/>
LoginId, IP, Login Time (Zeit), Logout Time (Zeit), Total time spent (gesamte
Verbrachte Zeit).</li>
<p/>&nbsp;&nbsp;&nbsp;&nbsp;
<li><b>Headline-Seiten (Schlagzeilen):</b><br/>
Administrieren von Headline-Seiten die von den Benutzern im Headline Programm
gesehen werden.<br/>
<i>Edit:</i> Optionen f&uuml;r die Headline-Seiten:<br/>
Anzeige, BasisURL, NewsDatei, Minuten zwischen Neuladungen (reloads), Angezeigte
Auflistung und die Art der Neuigkeiten.<br/>
<i>L&ouml;schen:</i>Entfernen von einer existierenden Headline-Seite, klicken
auf Löschen bringt Sie auf eine &Uuml;berprüffungsseite, um das l&ouml;schen
zu verifizieren.<br/>
<i>Anzeigen:</i>Zeigt die Optionen wie in Edit.<br/>
<i>Hinzuf&uuml;gen:</i>Formular um eine neue Headline-Seite hinzuzuf&uuml;gen, wie in Edit.</li><p/>&nbsp;&nbsp;&nbsp;&nbsp;
<li><b>Netzwerk News:</b><br/>
Manuelle Aktualisierung f&uuml;r Newsgruppen.</li><p/>&nbsp;&nbsp;&nbsp;&nbsp;
<li><b>Server Information:</b><br/>
Zeigt die phpinfo(); des Servers an.</li><p/>&nbsp;&nbsp;&nbsp;&nbsp;
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

33
admin/help/DE/other.php Normal file
View File

@ -0,0 +1,33 @@
<?php
/**************************************************************************\
* phpGroupWare - User manual *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_flags = Array(
'currentapp' => 'manual',
'admin_header' => True,
'enable_utilities_class' => True
);
$phpgw_info['flags'] = $phpgw_flags;
include('../../../header.inc.php');
$appname = 'admin';
?>
<img src="<?php echo $phpgw->common->image($appname,'navbar.gif'); ?>" border=0>
<font face="<?php echo $phpgw_info['theme']['font']; ?>" size="2"><p/>&nbsp;&nbsp;&nbsp;
Diese Funktion ist normalerweise nur f&uuml;r den Administrator zugänglich. Administration
aller Programme, Benutzer und Benutzergruppen und Sitzung's/Logging Kontrolle.
<ul><li><b>Netzwerk News:</b><br/>
Manuelle Aktualisierung f&uuml;r Newsgruppen.</li><p/>&nbsp;&nbsp;&nbsp;
<li><b>Server Information:</b><br/>
Zeigt die phpinfo(); des Server's an.</li>
<p/>&nbsp;&nbsp;&nbsp;
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

35
admin/help/DE/session.php Normal file
View File

@ -0,0 +1,35 @@
<?php
/**************************************************************************\
* phpGroupWare - User manual *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_flags = Array(
'currentapp' => 'manual',
'admin_header' => True,
'enable_utilities_class' => True
);
$phpgw_info['flags'] = $phpgw_flags;
include('../../../header.inc.php');
$appname = 'admin';
?>
<img src="<?php echo $phpgw->common->image($appname,'navbar.gif'); ?>" border=0>
<font face="<?php echo $phpgw_info['theme']['font']; ?>" size="2">
<p>
Diese Funktion ist normalerweise nur f&uuml;r den Administrator zugänglich. Administration aller Programme, Benutzer und Benutzergruppen und Sitzungs/Logging Kontrolle.
<ul>
<li><b>Session :</b>
<p><i>Sessions anzeigen:</i>
<br>Aktuelle Sitzungen, IP's, Login-Zeit, Inaktivit&auml;tszeit und die M&ouml;glichkeit sessions zu beenden (kill).
<p><i>Zugriffsaufzeichnungen (Access Log) anzeigen:</i>
<br>
LoginId, IP, Login Time (Zeit), Logout Time (Zeit), Total time spent (gesamte
verbrachte Zeit). </ul>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -30,3 +30,4 @@ Create, edit and delete users accounts. Set membership of groups, and access to
<i>User groups:</i><br/>
Create, edit and delete groups.<p/>
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -46,3 +46,4 @@ Manual update for news groups.</li><p/>
<li><b>Server information:</b><br/>
At present phpinfo of the server that is running.</li><p/>
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -29,3 +29,4 @@ Manual update for news groups.</li><p/>
<li><b>Server information:</b><br/>
At present phpinfo of the server that is running.</li><p/>
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -32,3 +32,4 @@ Administration of all applications, user and group accounts, session logging and
<p><i>View Access Log:</i>
<br>LoginId, IP, Login Time, Logout Time, Total time spent.
</ul>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -32,3 +32,4 @@ ryhm
<i>Käyttäjäryhmät:</i><br/>
Toiminnolla voit lisätä, muuttaa ja poistaa käyttäjäryhmiä.<p/>
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -50,3 +50,4 @@ Uutisryhmien p
<li><b>Palvelimen tiedot:</b><br/>
Tällä hetkellä palvelimen phpinfo.</li><p/>
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -30,3 +30,4 @@ Uutisryhmien p
<li><b>Palvelimen tiedot:</b><br/>
Tällä hetkellä palvelimen phpinfo.</li><p/>
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -34,3 +34,4 @@ on ollut tekem
<p><i>Näytä käyttöloki:</i>
<br>Tunnus, IP-osoite, Sisäänkirjautumisaika, Uloskirjautumisaika, Istunnon kesto.
</ul>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -30,3 +30,4 @@
<i>ユーザグループ:</i><br/>
ユーザが所属するグループを追加、訂正削除することができます。<p/>
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -51,3 +51,4 @@ you a checking page to be sure you do want to delete.<br/>
<li><b>サーバ情報:</b><br/>
サーバで動作している PHP の情報を、phpinfo() で表示します。</li><p/>
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -29,3 +29,4 @@
<li><b>サーバ情報:</b><br/>
サーバで動作している PHP の情報を、phpinfo() で表示します。</li><p/>
</ul></font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -32,3 +32,4 @@
<p><i>アクセスログ参照:</i>
<br>phpGroupWareへのアクセスログを表示します。ログインID,IPアドレス,ログイン時間,ログアウト時間,利用時間を表示します。
</ul>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -24,3 +24,4 @@
<font face="<?php echo $phpgw_info['theme']['font']; ?>" size="2">
Version: <b><?php echo $setup_info[$appname]['version']; ?></b>
</font>
<?php $phpgw->common->phpgw_footer(); ?>

View File

@ -1,37 +1,35 @@
<?php
/**************************************************************************\
* phpGroupWare - Account Administration *
* phpGroupWare - account administration *
* http://www.phpgroupware.org *
* Written by coreteam <phpgroupware-developers@gnu.org> *
* ----------------------------------------------------- *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
class boaccounts
{
var $so;
var $public_functions = array
(
'add_group' => True,
'delete_group' => True,
'delete_user' => True,
'edit_group' => True,
'save_user' => True,
var $public_functions = array(
'add_group' => True,
'add_user' => True,
'delete_group' => True,
'delete_user' => True,
'edit_group' => True,
'edit_user' => True,
'set_group_managers' => True
);
var $xml_functions = array();
var $soap_functions = array
(
'add_user' => array
(
'in' => array('int','struct'),
'out' => array()
var $soap_functions = array(
'add_user' => array(
'in' => array('int', 'struct'),
'out' => array()
)
);
@ -77,28 +75,113 @@
}
}
function check_rights($action, $access = 'group_access')
function delete_group()
{
switch($action)
if (!@isset($_POST['account_id']) || !@$_POST['account_id'] || $GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
{
case 'view': $right = '8'; break;
case 'add': $right = '4'; break;
case 'edit': $right = '16'; break;
case 'delete': $right = '32'; break;
case 'search': $right = '2'; break;
ExecMethod('admin.uiaccounts.list_groups');
return False;
}
$account_id = intval($_POST['account_id']);
$GLOBALS['phpgw']->db->lock(
Array(
'phpgw_accounts',
'phpgw_acl'
)
);
$old_group_list = $GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group');
@reset($old_group_list);
while($old_group_list && $id = each($old_group_list))
{
$GLOBALS['phpgw']->acl->delete_repository('phpgw_group',$account_id,intval($id[1]));
$GLOBALS['phpgw']->session->delete_cache(intval($id[1]));
}
if (!$GLOBALS['phpgw']->acl->check($access,$right,'admin'))
$GLOBALS['phpgw']->acl->delete_repository('%%','run',$account_id);
if (! @rmdir($GLOBALS['phpgw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['phpgw']->accounts->id2name($account_id)))
{
return True;
$cd = 38;
}
return False;
else
{
$cd = 32;
}
$GLOBALS['phpgw']->accounts->delete($account_id);
$GLOBALS['phpgw']->db->unlock();
Header('Location: '.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'));
$GLOBALS['phpgw']->common->phpgw_exit();
}
function add_group($values)
function delete_user()
{
$temp_users = ($values['account_user']?$values['account_user']:Array());
if (isset($_POST['cancel']) || $GLOBALS['phpgw']->acl->check('account_access',32,'admin'))
{
ExecMethod('admin.uiaccounts.list_users');
return False;
}
elseif($_POST['delete_account'])
{
$accountid = $_POST['account_id'];
settype($account_id,'integer');
$account_id = get_account_id($accountid);
// make this information also in hook available
$lid = $GLOBALS['phpgw']->accounts->id2name($account_id);
$db = $GLOBALS['phpgw']->db;
$db->query('SELECT app_name,app_order FROM phpgw_applications WHERE app_enabled!=0 ORDER BY app_order',__LINE__,__FILE__);
if($db->num_rows())
{
while($db->next_record())
{
$appname = $db->f('app_name');
if($appname <> 'admin')
{
$GLOBALS['phpgw']->hooks->single('deleteaccount', $appname);
}
}
}
$GLOBALS['hook_values']['account_id'] = $account_id;
$GLOBALS['hook_values']['account_lid'] = $lid;
$GLOBALS['phpgw']->hooks->single('deleteaccount','preferences');
$GLOBALS['phpgw']->hooks->single('deleteaccount','admin');
$GLOBALS['phpgw']->hooks->process('deleteaccount');
$basedir = $GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'users' . SEP;
if (! @rmdir($basedir . $lid))
{
$cd = 34;
}
else
{
$cd = 29;
}
ExecMethod('admin.uiaccounts.list_users');
return False;
}
}
function add_group()
{
if ($GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
{
ExecMethod('admin.uiaccounts.list_groups');
return False;
}
$temp_users = ($_POST['account_user']?$_POST['account_user']:Array());
$account_user = Array();
@reset($temp_users);
while(list($key,$user_id) = each($temp_users))
@ -107,7 +190,7 @@
}
@reset($account_user);
$group_permissions = ($values['account_apps']?$values['account_apps']:Array());
$group_permissions = ($_POST['account_apps']?$_POST['account_apps']:Array());
$account_apps = Array();
@reset($group_permissions);
while(list($key,$value) = each($group_permissions))
@ -119,30 +202,31 @@
}
@reset($account_apps);
$group_info = Array
(
'account_id' => ($values['account_id']?intval($values['account_id']):0),
'account_name' => ($values['account_name']?$values['account_name']:''),
$group_info = Array(
'account_id' => ($_POST['account_id']?intval($_POST['account_id']):0),
'account_name' => ($_POST['account_name']?$_POST['account_name']:''),
'account_user' => $account_user,
'account_apps' => $account_apps
);
$GLOBALS['phpgw']->db->lock(array
(
'phpgw_accounts',
'phpgw_nextid',
'phpgw_preferences',
'phpgw_sessions',
'phpgw_acl',
'phpgw_applications',
'phpgw_app_sessions',
'phpgw_hooks'
));
$this->validate_group($group_info);
$GLOBALS['phpgw']->db->lock(
Array(
'phpgw_accounts',
'phpgw_nextid',
'phpgw_preferences',
'phpgw_sessions',
'phpgw_acl',
'phpgw_applications',
'phpgw_app_sessions',
'phpgw_hooks'
)
);
$group = CreateObject('phpgwapi.accounts',$group_info['account_id'],'g');
$group->acct_type = 'g';
$account_info = array
(
$account_info = array(
'account_type' => 'g',
'account_lid' => $group_info['account_name'],
'account_passwd' => '',
@ -181,7 +265,7 @@
$GLOBALS['pref'] = CreateObject('phpgwapi.preferences',$user_id);
$t = $GLOBALS['pref']->read_repository();
@reset($new_apps);
while(list($app_key,$app_name) = each($new_apps))
while(is_array($new_apps) && list($app_key,$app_name) = each($new_apps))
{
if (!$t[($app_name=='admin'?'common':$app_name)])
{
@ -204,17 +288,92 @@
{
$cd = 37;
}
$GLOBALS['phpgw']->db->unlock();
ExecMethod('admin.uiaccounts.list_groups');
return False;
}
function edit_group($values)
function add_user()
{
if ($GLOBALS['phpgw']->acl->check('account_access',4,'admin'))
{
ExecMethod('admin.uiaccounts.list_users');
return False;
}
if ($_POST['submit'])
{
$userData = array(
'account_type' => 'u',
'account_lid' => $_POST['account_lid'],
'account_firstname' => $_POST['account_firstname'],
'account_lastname' => $_POST['account_lastname'],
'account_passwd' => $_POST['account_passwd'],
'status' => ($_POST['account_status'] ? 'A' : ''),
'account_status' => ($_POST['account_status'] ? 'A' : ''),
'old_loginid' => ($_GET['old_loginid']?rawurldecode($_GET['old_loginid']):''),
'account_id' => ($_GET['account_id']?$_GET['account_id']:0),
'account_passwd_2' => $_POST['account_passwd_2'],
'account_groups' => $_POST['account_groups'],
'anonymous' => $_POST['anonymous'],
'changepassword' => $_POST['changepassword'],
'account_permissions' => $_POST['account_permissions'],
'homedirectory' => $_POST['homedirectory'],
'loginshell' => $_POST['loginshell'],
'account_expires_never' => $_POST['never_expires']
/* 'file_space' => $_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
);
if ($_POST['expires'] !== '' && !$_POST['never_expires'])
{
$jscal = CreateObject('phpgwapi.jscalendar',False);
$userData += $jscal->input2date($_POST['expires'],False,'account_expires_day','account_expires_month','account_expires_year');
}
if (!$errors = $this->validate_user($userData))
{
$account_id = $this->so->add_user($userData);
if ($userData['anonymous'])
{
$GLOBALS['phpgw']->acl->add_repository('phpgwapi','anonymous',$account_id,1);
}
else
{
$GLOBALS['phpgw']->acl->delete_repository('phpgwapi','anonymous',$account_id);
}
// make this information for the hooks available
$GLOBALS['hook_values']['account_lid'] = $userData['account_lid'];
$GLOBALS['hook_values']['account_id'] = $account_id;
$GLOBALS['hook_values']['new_passwd'] = $userData['account_passwd'];
$GLOBALS['hook_values']['account_firstname'] = $userData['account_firstname'];
$GLOBALS['hook_values']['account_lastname'] = $userData['account_lastname'];
$GLOBALS['phpgw']->hooks->process('addaccount');
ExecMethod('admin.uiaccounts.list_users');
return False;
}
else
{
$ui = createobject('admin.uiaccounts');
$ui->create_edit_user($userData['account_id'],$userData,$errors);
}
}
else
{
ExecMethod('admin.uiaccounts.list_users');
return False;
}
}
function edit_group()
{
if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
{
$error[] = lang('no permission to create groups');
ExecMethod('admin.uiaccounts.list_groups');
return False;
}
$temp_users = ($values['account_user']?$values['account_user']:Array());
$temp_users = ($_POST['account_user']?$_POST['account_user']:Array());
$account_user = Array();
@reset($temp_users);
while($temp_users && list($key,$user_id) = each($temp_users))
@ -223,7 +382,7 @@
}
@reset($account_user);
$group_permissions = ($values['account_apps']?$values['account_apps']:Array());
$group_permissions = ($_POST['account_apps']?$_POST['account_apps']:Array());
$account_apps = Array();
@reset($group_permissions);
while(list($key,$value) = each($group_permissions))
@ -236,12 +395,14 @@
@reset($account_apps);
$group_info = Array(
'account_id' => ($values['account_id']?intval($values['account_id']):0),
'account_name' => ($values['account_name']?$values['account_name']:''),
'account_id' => ($_POST['account_id']?intval($_POST['account_id']):0),
'account_name' => ($_POST['account_name']?$_POST['account_name']:''),
'account_user' => $account_user,
'account_apps' => $account_apps
);
$this->validate_group($group_info);
// Lock tables
$GLOBALS['phpgw']->db->lock(
Array(
@ -365,198 +526,140 @@
/*
// Update any other options here, since the above save_repository () depends
// on a group having users
$group->data['file_space'] = $GLOBALS['HTTP_POST_VARS']['account_file_space_number'] . "-" . $GLOBALS['HTTP_POST_VARS']['account_file_space_type'];
$group->data['file_space'] = $_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'];
$group->save_repository();
*/
$GLOBALS['phpgw']->db->unlock();
ExecMethod('admin.uiaccounts.list_groups');
return False;
}
function save_user($values)
function edit_user()
{
if (is_array($values))
if ($GLOBALS['phpgw']->acl->check('account_access',16,'admin'))
{
if($values['expires_never'])
{
$values['expires'] = $values['account_expires'] = -1;
}
else
{
$values['expires'] = $values['account_expires'] = mktime(2,0,0,$values['account_expires_month'],$values['account_expires_day'],$values['account_expires_year']);
}
ExecMethod('admin.uiaccounts.list_users');
return False;
}
$userData = array
(
'account_type' => 'u',
'account_lid' => $values['account_lid'],
'account_firstname' => $values['account_firstname'],
'account_lastname' => $values['account_lastname'],
'account_passwd' => $values['account_passwd'],
'status' => ($values['account_status'] ? 'A' : ''),
'account_status' => ($values['account_status'] ? 'A' : ''),
'old_loginid' => ($values['old_loginid']?rawurldecode($GLOBALS['HTTP_GET_VARS']['old_loginid']):''),
'account_id' => ($values['account_id']?$GLOBALS['HTTP_GET_VARS']['account_id']:0),
'account_passwd_2' => $values['account_passwd_2'],
'account_groups' => $values['account_groups'],
'account_permissions' => $values['account_permissions'],
'homedirectory' => $values['homedirectory'],
'loginshell' => $values['loginshell'],
'account_expires_month' => $values['account_expires_month'],
'account_expires_day' => $values['account_expires_day'],
'account_expires_year' => $values['account_expires_year'],
'account_expires_never' => $values['expires'],
'expires' => $values['expires'],
'account_expires' => $values['expires']
/* 'file_space' => $GLOBALS['HTTP_POST_VARS']['account_file_space_number'] . "-" . $GLOBALS['HTTP_POST_VARS']['account_file_space_type'] */
if ($_POST['submit'])
{
$userData = array(
'account_lid' => $_POST['account_lid'],
'firstname' => $_POST['account_firstname'],
'lastname' => $_POST['account_lastname'],
'account_passwd' => $_POST['account_passwd'],
'status' => ($_POST['account_status'] ? 'A' : ''),
'account_status' => ($_POST['account_status'] ? 'A' : ''),
'old_loginid' => ($_GET['old_loginid']?rawurldecode($_GET['old_loginid']):''),
'account_id' => ($_GET['account_id']?$_GET['account_id']:0),
'account_passwd_2' => $_POST['account_passwd_2'],
'account_groups' => $_POST['account_groups'],
'anonymous' => $_POST['anonymous'],
'changepassword' => $_POST['changepassword'],
'account_permissions' => $_POST['account_permissions'],
'homedirectory' => $_POST['homedirectory'],
'loginshell' => $_POST['loginshell'],
'account_expires_never' => $_POST['never_expires']
/* 'file_space' => $_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
);
if ($values['account_id'])
if ($_POST['expires'] !== '' && !$_POST['never_expires'])
{
$userData['account_id'] = $values['account_id'];
$this->update_user($userData);
/* check if would create a menu
$jscal = CreateObject('phpgwapi.jscalendar',False);
$userData += $jscal->input2date($_POST['expires'],False,'account_expires_day','account_expires_month','account_expires_year');
}
if (!$errors = $this->validate_user($userData))
{
$this->save_user($userData);
$GLOBALS['hook_values']['account_id'] = $userData['account_id'];
$GLOBALS['hook_values']['account_lid'] = $userData['account_lid'];
$GLOBALS['hook_values']['account_firstname'] = $userData['account_firstname'];
$GLOBALS['hook_values']['account_lastname'] = $userData['account_lastname'];
$GLOBALS['phpgw']->hooks->process('editaccount');
// check if would create a menu
// if we do, we can't return to the users list, because
// there are also some other plugins
if (!ExecMethod('admin.uimenuclass.createHTMLCode','edit_user'))
{
}*/
}
else
{
$account_id = $this->so->add_user($userData);
$GLOBALS['hook_values']['account_lid'] = $userData['account_lid'];
$GLOBALS['hook_values']['account_id'] = $account_id; //$userData['account_id'];
$GLOBALS['hook_values']['new_passwd'] = $userData['account_passwd'];
$GLOBALS['phpgw']->hooks->process('addaccount');
}
}
}
/* stores the userdata */
function update_user($userData)
{
$account = CreateObject('phpgwapi.accounts',$userData['account_id'],'u');
$account->update_data($userData);
$account->save_repository();
if ($userData['account_passwd'])
{
$auth = CreateObject('phpgwapi.auth');
$auth->change_password($old_passwd,$userData['account_passwd'],$userData['account_id']);
$GLOBALS['hook_values']['account_id'] = $userData['account_id'];
$GLOBALS['hook_values']['old_passwd'] = $old_passwd;
$GLOBALS['hook_values']['new_passwd'] = $userData['account_passwd'];
$GLOBALS['phpgw']->hooks->process('changepassword');
}
$apps = CreateObject('phpgwapi.applications',array(intval($userData['account_id']),'u'));
$apps->account_id = $userData['account_id'];
if ($_userData['account_permissions'])
{
while($app = each($userData['account_permissions']))
{
if($app[1])
ExecMethod('admin.uiaccounts.list_users');
return False;
}
else
{
$apps->add($app[0]);
ExecMethod('admin.uiaccounts.edit_user',$_GET['account_id']);
return False;
}
}
}
$apps->save_repository();
$account = CreateObject('phpgwapi.accounts',$userData['account_id'],'u');
$allGroups = $account->get_list('groups');
if ($userData['account_groups'])
{
reset($userData['account_groups']);
while (list($key,$value) = each($userData['account_groups']))
{
$newGroups[$value] = $value;
}
}
$acl = CreateObject('phpgwapi.acl',$userData['account_id']);
reset($allGroups);
while (list($key,$groupData) = each($allGroups))
{
/* print "$key,". $groupData['account_id'] ."<br>";*/
/* print "$key,". $userData['account_groups'][1] ."<br>"; */
if ($newGroups[$groupData['account_id']])
{
$acl->add_repository('phpgw_group',$groupData['account_id'],$userData['account_id'],1);
}
else
{
$acl->delete_repository('phpgw_group',$groupData['account_id'],$userData['account_id']);
$ui = createobject('admin.uiaccounts');
$ui->create_edit_user($userData['account_id'],$userData,$errors);
}
}
$GLOBALS['phpgw']->session->delete_cache(intval($userData['account_id']));
}
function set_group_managers()
{
if($GLOBALS['phpgw']->acl->check('group_access',16,'admin') || $GLOBALS['HTTP_POST_VARS']['cancel'])
if($GLOBALS['phpgw']->acl->check('group_access',16,'admin') || $_POST['cancel'])
{
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'));
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->common->phpgw_exit();
}
elseif($GLOBALS['HTTP_POST_VARS']['submit'])
elseif($_POST['submit'])
{
$acl = CreateObject('phpgwapi.acl',intval($GLOBALS['HTTP_POST_VARS']['account_id']));
$acl = CreateObject('phpgwapi.acl',intval($_POST['account_id']));
$users = $GLOBALS['phpgw']->accounts->member($GLOBALS['HTTP_POST_VARS']['account_id']);
$users = $GLOBALS['phpgw']->accounts->member($_POST['account_id']);
@reset($users);
while($managers && list($key,$user) = each($users))
{
$acl->add_repository('phpgw_group',intval($GLOBALS['HTTP_POST_VARS']['account_id']),$user['account_id'],1);
$acl->add_repository('phpgw_group',intval($_POST['account_id']),$user['account_id'],1);
}
$managers = $GLOBALS['HTTP_POST_VARS']['managers'];
$managers = $_POST['managers'];
@reset($managers);
while($managers && list($key,$manager) = each($managers))
{
$acl->add_repository('phpgw_group',intval($GLOBALS['HTTP_POST_VARS']['account_id']),$manager,(1 + PHPGW_ACL_GROUP_MANAGERS));
$acl->add_repository('phpgw_group',intval($_POST['account_id']),$manager,(1 + PHPGW_ACL_GROUP_MANAGERS));
}
}
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'));
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->common->phpgw_exit();
}
function validate_group($values)
function validate_group($group_info)
{
$group = CreateObject('phpgwapi.accounts',$values['account_id'],'g');
$errors = Array();
$group = CreateObject('phpgwapi.accounts',$group_info['account_id'],'g');
$group->read_repository();
if (!$values['account_id'] && $GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
if(!$group_info['account_name'])
{
$error[] = lang('no permission to add groups');
$errors[] = lang('You must enter a group name.');
}
if(!$values['account_name'])
if($group_info['account_name'] != $group->id2name($group_info['account_id']))
{
$error[] = lang('You must enter a group name.');
}
if($values['account_name'] != $group->id2name($values['account_id']))
{
if ($group->exists($values['account_name']))
if ($group->exists($group_info['account_name']))
{
$error[] = lang('Sorry, that group name has already been taken.');
$errors[] = lang('Sorry, that group name has already been taken.');
}
}
/*
if (preg_match ("/\D/", $account_file_space_number))
{
$error[] = lang ('File space must be an integer');
$errors[] = lang ('File space must be an integer');
}
*/
if(is_array($error))
if(count($errors))
{
return $error;
$ui = createobject('admin.uiaccounts');
$ui->create_edit_group($group_info,$errors);
$GLOBALS['phpgw']->common->phpgw_exit();
}
}
@ -564,69 +667,76 @@
returns FALSE if the data are correct
otherwise the error array
*/
function validate_user($values)
function validate_user(&$_userData)
{
if (!$values['account_id'] && $GLOBALS['phpgw']->acl->check('account_access',4,'admin'))
{
$error[] = lang('no permission to add users');
}
$totalerrors = 0;
/*
if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap' && ! $values['allow_long_loginids'])
if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap' && ! $allow_long_loginids)
{
if (strlen($values['account_lid']) > 8)
if (strlen($_userData['account_lid']) > 8)
{
$error[] = lang('The loginid can not be more then 8 characters');
$error[$totalerrors] = lang('The loginid can not be more then 8 characters');
$totalerrors++;
}
}
*/
if (!$values['account_lid'])
if (!$_userData['account_lid'])
{
$error[] = lang('You must enter a loginid');
$error[$totalerrors] = lang('You must enter a loginid');
$totalerrors++;
}
if ($values['old_loginid'] != $values['account_lid'])
if ($_userData['old_loginid'] != $_userData['account_lid'])
{
if ($GLOBALS['phpgw']->accounts->exists($values['account_lid']))
if ($GLOBALS['phpgw']->accounts->exists($_userData['account_lid']))
{
$error[] = lang('That loginid has already been taken');
$error[$totalerrors] = lang('That loginid has already been taken');
$totalerrors++;
}
}
if ($values['account_passwd'] || $values['account_passwd_2'])
if ($_userData['account_passwd'] || $_userData['account_passwd_2'])
{
if ($values['account_passwd'] != $values['account_passwd_2'])
if ($_userData['account_passwd'] != $_userData['account_passwd_2'])
{
$error[] = lang('The two passwords are not the same');
$error[$totalerrors] = lang('The two passwords are not the same');
$totalerrors++;
}
}
/* $temp_msgbox_data = $GLOBALS['phpgw_info']['flags']['msgbox_data'];
unset($GLOBALS['phpgw_info']['flags']['msgbox_data']);
if(!sanitize($_userData['account_passwd'],'password'))
if (!count($_userData['account_permissions']) && !count($_userData['account_groups']))
{
$error[$totalerrors] = lang('You must add at least 1 permission or group to this account');
$totalerrors++;
}
if ($_userData['account_expires_month'] || $_userData['account_expires_day'] || $_userData['account_expires_year'] || $_userData['account_expires_never'])
{
if($_userData['account_expires_never'])
{
reset($GLOBALS['phpgw_info']['flags']['msgbox_data']);
while(list($key) = each($GLOBALS['phpgw_info']['flags']['msgbox_data']))
$_userData['expires'] = -1;
$_userData['account_expires'] = $_userData['expires'];
}
else
{
if (! checkdate($_userData['account_expires_month'],$_userData['account_expires_day'],$_userData['account_expires_year']))
{
$error[$totalerrors] = lang($key);
$error[$totalerrors] = lang('You have entered an invalid expiration date');
$totalerrors++;
}
else
{
$_userData['expires'] = mktime(2,0,0,$_userData['account_expires_month'],$_userData['account_expires_day'],$_userData['account_expires_year']);
$_userData['account_expires'] = $_userData['expires'];
}
}
$GLOBALS['phpgw_info']['flags']['msgbox_data'] = $temp_msgbox_data;
unset($temp_msgbox_data); */
}
if (!count($values['account_permissions']) && !count($values['account_groups']))
else
{
$error[] = lang('You must add at least 1 permission or group to this account');
}
if ($values['account_expires_month'] || $values['account_expires_day'] || $values['account_expires_year'] || $values['account_expires_never'])
{
if (! checkdate($values['account_expires_month'],$values['account_expires_day'],$values['account_expires_year']))
{
$error[] = lang('You have entered an invalid expiration date');
}
$_userData['expires'] = -1;
$_userData['account_expires'] = $_userData['expires'];
}
/*
@ -638,99 +748,93 @@
}
*/
if (is_array($error))
if ($totalerrors == 0)
{
return FALSE;
}
else
{
return $error;
}
}
function delete_group($account_id)
/* stores the userdata */
function save_user($_userData)
{
if ($GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
$account = CreateObject('phpgwapi.accounts',$_userData['account_id'],'u');
$account->update_data($_userData);
$account->save_repository();
if ($_userData['account_passwd'])
{
return False;
$auth = CreateObject('phpgwapi.auth');
$auth->change_password($old_passwd, $_userData['account_passwd'], $_userData['account_id']);
$GLOBALS['hook_values']['account_id'] = $_userData['account_id'];
$GLOBALS['hook_values']['old_passwd'] = $old_passwd;
$GLOBALS['hook_values']['new_passwd'] = $_userData['account_passwd'];
$GLOBALS['phpgw']->hooks->process('changepassword');
}
$GLOBALS['phpgw']->db->lock(array
(
'phpgw_accounts',
'phpgw_acl'
)
);
$apps = CreateObject('phpgwapi.applications',array(intval($_userData['account_id']),'u'));
$old_group_list = $GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group');
@reset($old_group_list);
while($old_group_list && $id = each($old_group_list))
$apps->account_id = $_userData['account_id'];
if ($_userData['account_permissions'])
{
$GLOBALS['phpgw']->acl->delete_repository('phpgw_group',$account_id,intval($id[1]));
$GLOBALS['phpgw']->session->delete_cache(intval($id[1]));
}
$GLOBALS['phpgw']->acl->delete_repository('%%','run',$account_id);
if (! @rmdir($GLOBALS['phpgw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['phpgw']->accounts->id2name($account_id)))
{
$cd = 38;
}
else
{
$cd = 32;
}
$GLOBALS['phpgw']->accounts->delete($account_id);
$GLOBALS['phpgw']->db->unlock();
}
function delete_user()
{
if (isset($GLOBALS['HTTP_POST_VARS']['cancel']) || $GLOBALS['phpgw']->acl->check('account_access',32,'admin'))
{
ExecMethod('admin.uiaccounts.list_users');
return False;
}
elseif($GLOBALS['HTTP_POST_VARS']['delete_account'])
{
$accountid = $GLOBALS['HTTP_POST_VARS']['account_id'];
settype($account_id,'integer');
$account_id = get_account_id($accountid);
$lid = $GLOBALS['phpgw']->accounts->id2name($account_id);
$db = $GLOBALS['phpgw']->db;
$db->query('SELECT app_name,app_order FROM phpgw_applications WHERE app_enabled!=0 ORDER BY app_order',__LINE__,__FILE__);
if($db->num_rows())
while($app = each($_userData['account_permissions']))
{
while($db->next_record())
if($app[1])
{
$appname = $db->f('app_name');
if($appname <> 'admin')
{
$GLOBALS['phpgw']->hooks->single('deleteaccount', $appname);
}
$apps->add($app[0]);
}
}
}
$apps->save_repository();
$GLOBALS['phpgw']->hooks->single('deleteaccount','preferences');
$GLOBALS['phpgw']->hooks->single('deleteaccount','admin');
$account = CreateObject('phpgwapi.accounts',$_userData['account_id'],'u');
$allGroups = $account->get_list('groups');
$GLOBALS['hook_values']['account_id'] = $account_id;
$GLOBALS['phpgw']->hooks->process('deleteaccount');
$basedir = $GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'users' . SEP;
if (! @rmdir($basedir . $lid))
if ($_userData['account_groups'])
{
reset($_userData['account_groups']);
while (list($key,$value) = each($_userData['account_groups']))
{
$cd = 34;
$newGroups[$value] = $value;
}
}
$acl = CreateObject('phpgwapi.acl',$_userData['account_id']);
reset($allGroups);
while (list($key,$groupData) = each($allGroups))
{
/* print "$key,". $groupData['account_id'] ."<br>";*/
/* print "$key,". $_userData['account_groups'][1] ."<br>"; */
if ($newGroups[$groupData['account_id']])
{
$acl->add_repository('phpgw_group',$groupData['account_id'],$_userData['account_id'],1);
}
else
{
$cd = 29;
$acl->delete_repository('phpgw_group',$groupData['account_id'],$_userData['account_id']);
}
ExecMethod('admin.uiaccounts.list_users');
return False;
}
if ($_userData['anonymous'])
{
$acl->add_repository('phpgwapi','anonymous',$_userData['account_id'],1);
}
else
{
$acl->delete_repository('phpgwapi','anonymous',$_userData['account_id']);
}
if ($_userData['changepassword'])
{
$GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$_userData['account_id'],1);
}
else
{
$GLOBALS['phpgw']->acl->delete_repository('preferences','changepassword',$_userData['account_id']);
}
$GLOBALS['phpgw']->session->delete_cache(intval($_userData['account_id']));
}
function load_group_users($account_id)

View File

@ -28,9 +28,9 @@
function bocategories()
{
if ($GLOBALS['appname'])
if ($_GET['appname'])
{
$this->cats = CreateObject('phpgwapi.categories',-1,$GLOBALS['appname']);
$this->cats = CreateObject('phpgwapi.categories',-1,$_GET['appname']);
}
else
{
@ -39,24 +39,19 @@
$this->read_sessiondata();
/* _debug_array($GLOBALS['HTTP_POST_VARS']); */
$start = intval(get_var('start',array('POST','GET')));
/* _debug_array($_POST); */
/* Might change this to '' at the end---> */
$start = get_var('start',array('POST','GET'));
$query = get_var('query',array('POST','GET'));
$sort = get_var('sort',array('POST','GET'));
$sort = get_var('sort', array('POST','GET'));
$order = get_var('order',array('POST','GET'));
$cat_id = intval(get_var('cat_id', array('POST','GET')));
$cat_id = get_var('cat_id',array('POST','GET'));
if(!empty($start) || $start == 0)
if(!empty($start) || $start == '0' || $start == 0)
{
if($this->debug) { echo '<br>overriding start: "' . $this->start . '" now "' . $start . '"'; }
$this->start = $start;
}
else
{
$this->start = 0;
}
if((empty($query) && !empty($this->query)) || !empty($query))
{
if($this->debug) { echo '<br>setting query to: "' . $query . '"'; }
@ -67,17 +62,14 @@
{
$this->cat_id = $cat_id;
}
if($cat_id == 0)
if($cat_id == '0' || $cat_id == 0 || $cat_id == '')
{
unset($this->cat_id);
}
if(isset($sort) && !empty($sort))
{
$this->sort = $sort;
}
if(isset($order) && !empty($order))
{
$this->order = $order;
@ -105,23 +97,15 @@
}
}
function get_list($global_cats=False)
function get_list()
{
if($this->debug) { echo '<br>querying: "' . $this->query . '"'; }
if ($global_cats)
{
return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,True);
}
else
{
return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order);
}
return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,True);
}
function save_cat($values)
{
if ($values['cat_id'] && $values['cat_id'] != 0)
if ($values['id'] && $values['id'] != 0)
{
return $this->cats->edit($values);
}
@ -133,20 +117,19 @@
function exists($data)
{
return $this->cats->exists($data);
$data['type'] = $data['type'] ? $data['type'] : '';
$data['cat_id'] = $data['cat_id'] ? $data['cat_id'] : '';
return $this->cats->exists($data['type'],$data['cat_name'],$data['cat_id']);
}
function formatted_list($data)
{
return $this->cats->formatted_list($data);
return $this->cats->formated_list($data['select'],$data['all'],$data['cat_parent'],True);
}
function delete($data)
function delete($cat_id,$subs=False)
{
if (is_array($data))
{
$this->cats->delete($data);
}
return $this->cats->delete($cat_id,$subs);
}
function check_values($values)
@ -168,7 +151,7 @@
(
'type' => 'appandmains',
'cat_name' => $values['name'],
'cat_id' => $values['cat_id']
'cat_id' => $values['id']
));
}
else
@ -177,7 +160,7 @@
(
'type' => 'appandsubs',
'cat_name' => $values['name'],
'cat_id' => $values['cat_id']
'cat_id' => $values['id']
));
}

View File

@ -19,10 +19,9 @@
function add_user($userData)
{
$GLOBALS['phpgw']->db->lock
(
array
(
$userData['account_expires'] = $userData['expires'];
$GLOBALS['phpgw']->db->lock(
Array(
'phpgw_accounts',
'phpgw_nextid',
'phpgw_preferences',
@ -37,10 +36,9 @@
$GLOBALS['phpgw']->accounts->create($userData);
$userData['account_id'] = $GLOBALS['phpgw']->accounts->name2id($userData['account_lid']);
$apps = CreateObject('phpgwapi.applications',array($userData['account_id'],'u'));
$apps = CreateObject('phpgwapi.applications',$userData['account_id']);
$apps->read_installed_apps();
// Read Group Apps
if ($userData['account_groups'])
{
@ -63,7 +61,7 @@
$apps->account_type = 'u';
$apps->account_id = $userData['account_id'];
$apps->account_apps = Array(Array());
$apps->data = Array(Array());
if ($userData['account_permissions'])
{
@ -82,8 +80,10 @@
}
$apps->save_repository();
$GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$userData['account_id'],1);
if ($userData['changepassword'])
{
$GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$userData['account_id'],1);
}
// Assign user to groups
if ($userData['account_groups'])
{
@ -94,32 +94,11 @@
}
}
/* if ($apps_after)
{
$GLOBALS['pref'] = CreateObject('phpgwapi.preferences',$userData['account_id']);
$GLOBALS['phpgw']->hooks->single('add_def_pref','admin');
while ($apps = each($apps_after))
{
if (strcasecmp ($apps[0], 'admin') != 0)
{
$GLOBALS['phpgw']->hooks->single('add_def_pref', $apps[1]);
}
}
$GLOBALS['pref']->save_repository(False);
} */
$apps->account_apps = array(array());
$apps_after = array(array());
$GLOBALS['phpgw']->db->unlock();
/*
// start inlcuding other admin tools
while($app = each($apps_after))
{
$GLOBALS['phpgw']->hooks->single('add_user_data', $value);
}
*/
return $userData['account_id'];
}
}

View File

@ -28,7 +28,7 @@
$this->db->next_record();
$app_info = array(
$this->db->f('app_name'),
$this->db->f('app_name'),
$GLOBALS['phpgw_info']['apps'][$this->db->f('app_name')]['title'],
$this->db->f('app_enabled'),
$this->db->f('app_name'),
$this->db->f('app_order')
@ -44,7 +44,7 @@
while ($this->db->next_record())
{
$apps[$this->db->f('app_name')] = array(
'title' => str_replace('- ','-',ucwords(str_replace('_','- ',$this->db->f('app_name')))),
'title' => $GLOBALS['phpgw_info']['apps'][$this->db->f('app_name')],
'name' => $this->db->f('app_name'),
'status' => $this->db->f('app_enabled')
);
@ -74,7 +74,7 @@
function save($data)
{
$sql = "UPDATE phpgw_applications SET app_name='" . addslashes($data['n_app_name']) . "',"
. "app_enabled='" . $data['n_app_status'] . "',app_order='" . $data['app_order']
. "app_enabled='" . $data['n_app_status'] . "',app_order='" . $data['app_order']
. "' WHERE app_name='" . $data['old_app_name'] . "'";
$this->db->query($sql,__LINE__,__FILE__);

View File

@ -20,6 +20,11 @@
function uiaccess_history()
{
if ($GLOBALS['phpgw']->acl->check('access_log_access',1,'admin'))
{
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$this->bo = createobject('admin.boaccess_history');
$this->nextmatchs = createobject('phpgwapi.nextmatchs');
$this->template = $GLOBALS['phpgw']->template;
@ -35,13 +40,14 @@
function list_history()
{
$account_id = ($GLOBALS['HTTP_GET_VARS']['account_id']?$GLOBALS['HTTP_GET_VARS']['account_id']:$GLOBALS['HTTP_POST_VARS']['account_id']);
$start = ($GLOBALS['HTTP_POST_VARS']['start']?$GLOBALS['HTTP_POST_VARS']['start']:0);
$sort = ($GLOBALS['HTTP_POST_VARS']['sort']?$GLOBALS['HTTP_POST_VARS']['sort']:0);
$order = ($GLOBALS['HTTP_POST_VARS']['order']?$GLOBALS['HTTP_POST_VARS']['order']:0);
$account_id = get_var('account_id',array('GET','POST'));
$start = get_var('start',array('POST'),0);
$sort = get_var('sort',array('POST'),0);
$order = get_var('order',array('POST'),0);
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('View access log');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$total_records = $this->bo->total($account_id);

File diff suppressed because it is too large Load Diff

View File

@ -23,12 +23,20 @@
function uiaclmanager()
{
$this->account_id = intval($_GET['account_id']);
if (!$this->account_id || $GLOBALS['phpgw']->acl->check('account_access',64,'admin'))
{
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$this->template = createobject('phpgwapi.Template',PHPGW_APP_TPL);
}
function common_header()
{
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin') . ' - ' . lang('ACL Manager') .
': ' . $GLOBALS['phpgw']->common->grab_owner_name($this->account_id);
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
}
function list_apps()
@ -46,14 +54,12 @@
$this->template->set_block('app_list','link_row');
$this->template->set_block('app_list','spacer_row');
$this->template->set_var('lang_header',lang('ACL Manager'));
while (is_array($GLOBALS['acl_manager']) && list($app,$locations) = each($GLOBALS['acl_manager']))
{
$icon = $GLOBALS['phpgw']->common->image($app,array('navbar.gif',$app.'.gif'));
$this->template->set_var('icon_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']);
$this->template->set_var('link_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']);
$this->template->set_var('app_name',lang($GLOBALS['phpgw_info']['navbar'][$app]['title']));
$this->template->set_var('app_name',$GLOBALS['phpgw_info']['apps'][$app]['title']);
$this->template->set_var('a_name',$appname);
$this->template->set_var('app_icon',$icon);
@ -68,83 +74,83 @@
while (is_array($locations) && list($loc,$value) = each($locations))
{
$total_rights = 0;
while (list($k,$v) = each($value['rights']))
{
$total_rights += $v;
}
reset($value['rights']);
$link_values = array(
'menuaction' => 'admin.uiaclmanager.access_form',
'location' => urlencode($loc),
'acl_app' => $app,
'account_id' => $this->account_id
);
// If all of there rights are denied, then they shouldn't even see the option
if ($total_rights != $GLOBALS['phpgw']->acl->get_rights($loc,$app))
{
$link_values = array(
'menuaction' => 'admin.uiaclmanager.access_form',
'location' => urlencode(base64_encode($loc)),
'acl_app' => $app,
'account_id' => $GLOBALS['account_id']
);
$this->template->set_var('link_location',$GLOBALS['phpgw']->link('/index.php',$link_values));
$this->template->set_var('lang_location',lang($value['name']));
$this->template->fp('rows','link_row',True);
}
$this->template->set_var('link_location',$GLOBALS['phpgw']->link('/index.php',$link_values));
$this->template->set_var('lang_location',lang($value['name']));
$this->template->fp('rows','link_row',True);
}
$this->template->parse('rows','spacer_row',True);
}
$this->template->set_var(array(
'cancel_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'),
'lang_cancel' => lang('Cancel')
));
$this->template->pfp('out','list');
}
function access_form()
{
$GLOBALS['phpgw']->hooks->single('acl_manager',$GLOBALS['acl_app']);
$location = base64_decode($GLOBALS['location']);
$location = $_GET['location'];
$acl_manager = $GLOBALS['acl_manager'][$GLOBALS['acl_app']][$location];
if ($_POST['submit'] || $_POST['cancel'])
{
if ($_POST['submit'])
{
$total_rights = 0;
while (is_array($_POST['acl_rights']) && list(,$rights) = each($_POST['acl_rights']))
{
$total_rights += $rights;
}
if ($total_rights)
{
$GLOBALS['phpgw']->acl->add_repository($_GET['acl_app'], $location, $this->account_id, $total_rights);
}
else // we dont need to save 0 rights (= no restrictions)
{
$GLOBALS['phpgw']->acl->delete_repository($_GET['acl_app'], $location, $this->account_id);
}
}
$this->list_apps();
return;
}
$GLOBALS['phpgw']->hooks->single('acl_manager',$_GET['acl_app']);
$acl_manager = $GLOBALS['acl_manager'][$_GET['acl_app']][$location];
$this->common_header();
$this->template->set_file('form','acl_manager_form.tpl');
$acc = createobject('phpgwapi.accounts',$GLOBALS['account_id']);
$acc = createobject('phpgwapi.accounts',$this->account_id);
$acc->read_repository();
$afn = $GLOBALS['phpgw']->common->display_fullname($acc->data['account_lid'],$acc->data['firstname'],$acc->data['lastname']);
$this->template->set_var('lang_message',lang('Check items to <b>%1</b> to %2 for %3',$acl_manager['name'],$GLOBALS['acl_app'],$afn));
$this->template->set_var('lang_message',lang('Check items to <b>%1</b> to %2 for %3',lang($acl_manager['name']),$GLOBALS['phpgw_info']['apps'][$_GET['acl_app']]['title'],$afn));
$link_values = array(
'menuaction' => 'admin.boaclmanager.submit',
'acl_app' => $GLOBALS['acl_app'],
'location' => urlencode($GLOBALS['location']),
'account_id' => $GLOBALS['account_id']
'menuaction' => 'admin.uiaclmanager.access_form',
'acl_app' => $_GET['acl_app'],
'location' => urlencode($_GET['location']),
'account_id' => $this->account_id
);
$acl = createobject('phpgwapi.acl',$GLOBALS['account_id']);
$acl = createobject('phpgwapi.acl',$this->account_id);
$acl->read_repository();
$grants = $acl->get_rights($location,$_GET['acl_app']);
$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$link_values));
$this->template->set_var('lang_title',lang('ACL Manager'));
$total = 0;
while (list($name,$value) = each($acl_manager['rights']))
{
$grants = $acl->get_rights($location,$GLOBALS['acl_app']);
if (! $GLOBALS['phpgw']->acl->check($location,$value,$GLOBALS['acl_app']))
{
$s .= '<option value="' . $value . '"';
$s .= (($grants & $value)?' selected':'');
$s .= '>' . lang($name) . '</option>';
$total++;
}
$cb .= '<input type="checkbox" name="acl_rights[]" value="'.$value.'"'.($grants & $value ? ' checked' : '').'>&nbsp;'.lang($name)."<br>\n";
}
$size = 7;
if ($total < 7)
{
$size = $total;
}
$this->template->set_var('select_values','<select name="acl_rights[]" multiple size="' . $size . '">' . $s . '</select>');
$this->template->set_var('lang_submit',lang('Submit'));
$this->template->set_var('select_values',$cb);
$this->template->set_var('lang_submit',lang('Save'));
$this->template->set_var('lang_cancel',lang('Cancel'));
$this->template->pfp('out','form');

View File

@ -32,15 +32,26 @@
function get_list()
{
if ($GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
{
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$can_add = !$GLOBALS['phpgw']->acl->check('applications_access',2,'admin');
$can_edit = !$GLOBALS['phpgw']->acl->check('applications_access',4,'admin');
$can_delete = !$GLOBALS['phpgw']->acl->check('applications_access',8,'admin');
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Installed applications');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$GLOBALS['phpgw']->template->set_file(array('applications' => 'applications.tpl'));
$GLOBALS['phpgw']->template->set_block('applications','list','list');
$GLOBALS['phpgw']->template->set_block('applications','row','row');
$start = $GLOBALS['HTTP_POST_VARS']['start'];
$sort = $GLOBALS['HTTP_GET_VARS']['sort'];
$order = $GLOBALS['HTTP_GET_VARS']['order'];
$GLOBALS['phpgw']->template->set_block('applications','add','add');
$start = get_var('start',array('POST','GET'));
$sort = $_GET['sort'];
$order = $_GET['order'];
$offset = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
$apps = $this->bo->get_list();
@ -91,7 +102,8 @@
$i++;
}
$GLOBALS['phpgw']->template->set_var('lang_installed',lang('Installed applications'));
$GLOBALS['phpgw']->template->set_var('bg_color',$GLOBALS['phpgw_info']['theme']['bg_color']);
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
$GLOBALS['phpgw']->template->set_var('sort_title',$this->nextmatchs->show_sort_order($sort,'title','title','/index.php',lang('Title'),'&menuaction=admin.uiapplications.get_list'));
$GLOBALS['phpgw']->template->set_var('lang_showing',$this->nextmatchs->show_hits($total,$start));
@ -106,29 +118,15 @@
$GLOBALS['phpgw']->template->set_var('lang_note',lang('(To install new applications use<br><a href="setup/" target="setup">Setup</a> [Manage Applications] !!!)'));
$GLOBALS['phpgw']->template->set_var('lang_add',lang('add'));
@reset($applications);
while (list($key,$app) = @each($applications))
foreach($applications as $app)
{
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
if($app['title'])
{
$name = $app['title'];
}
elseif($app['name'])
{
$name = $app['name'];
}
else
{
$name = '&nbsp;';
}
$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
$GLOBALS['phpgw']->template->set_var('name',$name);
$GLOBALS['phpgw']->template->set_var('name',$GLOBALS['phpgw_info']['apps'][$app['name']]['title']);
$GLOBALS['phpgw']->template->set_var('edit','<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.edit&app_name=' . urlencode($app['name'])) . '"> ' . lang('Edit') . ' </a>');
$GLOBALS['phpgw']->template->set_var('delete','<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.delete&app_name=' . urlencode($app['name'])) . '"> ' . lang('Delete') . ' </a>');
$GLOBALS['phpgw']->template->set_var('edit',$can_edit ? '<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.edit&app_name=' . urlencode($app['name'])) . '&start='.$start.'"> ' . lang('Edit') . ' </a>' : '&nbsp;');
$GLOBALS['phpgw']->template->set_var('delete',$can_delete ? '<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.delete&app_name=' . urlencode($app['name'])) . '&start='.$start.'"> ' . lang('Delete') . ' </a>' : '&nbsp;');
if ($app['status'])
{
@ -142,6 +140,14 @@
$GLOBALS['phpgw']->template->parse('rows','row',True);
}
if ($can_add)
{
$GLOBALS['phpgw']->template->parse('addbutton','add');
}
else
{
$GLOBALS['phpgw']->template->set_var('addbutton','');
}
$GLOBALS['phpgw']->template->pparse('out','list');
}
@ -156,18 +162,30 @@
function add()
{
if ($GLOBALS['phpgw']->acl->check('applications_access',2,'admin'))
{
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$start = get_var('start',array('POST','GET'));
$GLOBALS['phpgw']->template->set_file(array('application' => 'application_form.tpl'));
$GLOBALS['phpgw']->template->set_block('application','form','form');
$GLOBALS['phpgw']->template->set_block('application','row','row');
$GLOBALS['phpgw']->template->set_block('form','delete_button');
$GLOBALS['phpgw']->template->set_var('delete_button','');
if ($GLOBALS['HTTP_POST_VARS']['submit'])
if ($_POST['cancel'])
{
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start);
}
if ($_POST['save'])
{
$totalerrors = 0;
$app_order = $GLOBALS['HTTP_POST_VARS']['app_order'] ? $GLOBALS['HTTP_POST_VARS']['app_order'] : 0;
$n_app_name = chop($GLOBALS['HTTP_POST_VARS']['n_app_name']);
$n_app_title = chop($GLOBALS['HTTP_POST_VARS']['n_app_title']);
$n_app_status = $GLOBALS['HTTP_POST_VARS']['n_app_status'];
$app_order = $_POST['app_order'] ? $_POST['app_order'] : 0;
$n_app_name = chop($_POST['n_app_name']);
$n_app_status = $_POST['n_app_status'];
if ($this->bo->exists($n_app_name))
{
@ -190,9 +208,8 @@
'app_order' => $app_order
));
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list'));
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start);
$GLOBALS['phpgw']->common->phpgw_exit();
}
else
{
@ -204,11 +221,13 @@
$GLOBALS['phpgw']->template->set_var('error','');
}
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Add new application');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$GLOBALS['phpgw']->template->set_var('lang_header',lang('Add new application'));
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
$GLOBALS['phpgw']->template->set_var('hidden_vars','');
$GLOBALS['phpgw']->template->set_var('hidden_vars','<input type="hidden" name="start" value="'.$start.'">');
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.add'));
$this->display_row(lang('application name'),'<input name="n_app_name" value="' . $n_app_name . '">');
@ -231,33 +250,48 @@
$this->display_row(lang('Select which location this app should appear on the navbar, lowest (left) to highest (right)'),'<input name="app_order" value="' . $app_order . '">');
$GLOBALS['phpgw']->template->set_var('lang_submit_button',lang('add'));
$GLOBALS['phpgw']->template->pparse('out','form');
$GLOBALS['phpgw']->template->set_var('lang_save_button',lang('Add'));
$GLOBALS['phpgw']->template->set_var('lang_cancel_button',lang('Cancel'));
$GLOBALS['phpgw']->template->pparse('phpgw_body','form');
}
function edit()
{
$app_name = $GLOBALS['HTTP_GET_VARS']['app_name'];
if ($GLOBALS['phpgw']->acl->check('applications_access',4,'admin'))
{
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$app_name = get_var('app_name',array('POST','GET'));
$start = get_var('start',array('POST','GET'));
$GLOBALS['phpgw']->template->set_file(array('application' => 'application_form.tpl'));
$GLOBALS['phpgw']->template->set_block('application','form','form');
$GLOBALS['phpgw']->template->set_block('application','row','row');
if ($GLOBALS['HTTP_POST_VARS']['submit'])
if ($_POST['cancel'])
{
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start);
}
if ($_POST['delete'])
{
return $this->delete();
}
if ($_POST['save'])
{
$totalerrors = 0;
$old_app_name = $GLOBALS['HTTP_POST_VARS']['old_app_name'];
$app_order = $GLOBALS['HTTP_POST_VARS']['app_order'] ? $GLOBALS['HTTP_POST_VARS']['app_order'] : 0;
$n_app_name = chop($GLOBALS['HTTP_POST_VARS']['n_app_name']);
$n_app_status = $GLOBALS['HTTP_POST_VARS']['n_app_status'];
$app_order = $_POST['app_order'] ? $_POST['app_order'] : 0;
$n_app_name = chop($_POST['n_app_name']);
$n_app_status = $_POST['n_app_status'];
if (! $n_app_name)
{
$error[$totalerrors++] = lang('You must enter an application name.');
}
if ($old_app_name != $n_app_name)
if ($app_name != $n_app_name)
{
if ($this->bo->exists($n_app_name))
{
@ -271,16 +305,16 @@
'n_app_name' => $n_app_name,
'n_app_status' => $n_app_status,
'app_order' => $app_order,
'old_app_name' => $old_app_name
'old_app_name' => $app_name
));
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list'));
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start);
}
}
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Edit application');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
if ($totalerrors)
{
@ -291,15 +325,17 @@
$GLOBALS['phpgw']->template->set_var('error','');
list($n_app_name,$n_app_title,$n_app_status,$old_app_name,$app_order) = $this->bo->read($app_name);
}
$GLOBALS['phpgw']->template->set_var('lang_header',lang('Edit application'));
$GLOBALS['phpgw']->template->set_var('hidden_vars','<input type="hidden" name="old_app_name" value="' . $old_app_name . '">');
$GLOBALS['phpgw']->template->set_var('hidden_vars','<input type="hidden" name="start" value="'.$start.'">'.
'<input type="hidden" name="app_name" value="' . $app_name . '">');
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.edit'));
$this->display_row(lang('application name'),'<input name="n_app_name" value="' . $n_app_name . '">');
$GLOBALS['phpgw']->template->set_var('lang_status',lang('Status'));
$GLOBALS['phpgw']->template->set_var('lang_submit_button',lang('edit'));
$GLOBALS['phpgw']->template->set_var('lang_save_button',lang('Save'));
$GLOBALS['phpgw']->template->set_var('lang_cancel_button',lang('Cancel'));
$GLOBALS['phpgw']->template->set_var('lang_delete_button',lang('Delete'));
$selected[$n_app_status] = ' selected';
$status_html = '<option value="0"' . $selected[0] . '>' . lang('Disabled') . '</option>'
@ -310,38 +346,47 @@
$this->display_row(lang("Select which location this app should appear on the navbar, lowest (left) to highest (right)"),'<input name="app_order" value="' . $app_order . '">');
$GLOBALS['phpgw']->template->set_var('select_status',$status_html);
$GLOBALS['phpgw']->template->pparse('out','form');
$GLOBALS['phpgw']->template->pparse('phpgw_body','form');
}
function delete()
{
$app_name = $GLOBALS['HTTP_GET_VARS']['app_name'];
if (!$app_name)
if ($GLOBALS['phpgw']->acl->check('applications_access',8,'admin'))
{
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list'));
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$app_name = get_var('app_name',array('POST','GET'));
$start = get_var('start',array('POST','GET'));
if (!$app_name || $_POST['no'] || $_POST['yes'])
{
if ($_POST['yes'])
{
$this->bo->delete($app_name);
}
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start);
}
$GLOBALS['phpgw']->template->set_file(array('body' => 'delete_common.tpl'));
if ($GLOBALS['HTTP_GET_VARS']['confirm'])
{
$this->bo->delete($app_name);
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list'));
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
}
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$GLOBALS['phpgw']->template->set_var('messages',lang('Are you sure you want to delete this application ?'));
$GLOBALS['phpgw']->template->set_var('no','<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list') . '">' . lang('No') . '</a>');
$GLOBALS['phpgw']->template->set_var('yes','<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.delete&app_name=' . urlencode($app_name) . "&confirm=True") . '">' . lang('Yes') . '</a>');
$GLOBALS['phpgw']->template->pparse('out','body');
$GLOBALS['phpgw']->template->set_var('messages',lang('Are you sure you want to delete the application %1 ?',$GLOBALS['phpgw_info']['apps'][$app_name]['title']));
$GLOBALS['phpgw']->template->set_var('no',lang('No'));
$GLOBALS['phpgw']->template->set_var('yes',lang('Yes'));
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.delete'));
$GLOBALS['phpgw']->template->set_var('hidden_vars','<input type="hidden" name="start" value="'.$start.'">'.
'<input type="hidden" name="app_name" value="'. urlencode($app_name) . '">');
$GLOBALS['phpgw']->template->pparse('phpgw_body','body');
}
function register_all_hooks()
{
if ($GLOBALS['phpgw']->acl->check('applications_access',16,'admin'))
{
$GLOBALS['phpgw']->redirect_link('/index.php');
}
if (!is_object($GLOBALS['phpgw']->hooks))
{
$GLOBALS['phpgw']->hooks = CreateObject('phpgwapi.hooks');

View File

@ -4,10 +4,12 @@
* http://www.phpgroupware.org *
* Written by Bettina Gille [ceb@phpgroupware.org] *
* ----------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
* Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/* $Source$ */
@ -15,8 +17,7 @@
class uicategories
{
var $bo;
var $nextmatchs;
var $xslttpl;
var $template;
var $start;
var $query;
@ -28,20 +29,35 @@
var $public_functions = array
(
'index' => True,
'add' => True,
'edit' => True,
'delete' => True
);
function uicategories()
{
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if ($GLOBALS['phpgw']->acl->check('global_categories_access',1,'admin'))
{
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$this->bo = CreateObject('admin.bocategories');
$this->template = $GLOBALS['phpgw']->template;
$this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
$this->acl_search = !$GLOBALS['phpgw']->acl->check('global_categories_access',2,'admin');
$this->acl_add = !$GLOBALS['phpgw']->acl->check('global_categories_access',4,'admin');
$this->acl_view = !$GLOBALS['phpgw']->acl->check('global_categories_access',8,'admin');
$this->acl_edit = !$GLOBALS['phpgw']->acl->check('global_categories_access',16,'admin');
$this->acl_delete = !$GLOBALS['phpgw']->acl->check('global_categories_access',32,'admin');
$this->acl_add_sub= !$GLOBALS['phpgw']->acl->check('global_categories_access',64,'admin');
$this->appname = get_var('appname',array('GET','POST'));
$GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps'][$this->appname ? $this->appname : 'admin']['title'];
$this->start = $this->bo->start;
$this->query = $this->bo->query;
$this->sort = $this->bo->sort;
$this->sort = $this->bo->sort;
$this->order = $this->bo->order;
$this->cat_id = $this->bo->cat_id;
if($this->debug) { $this->_debug_sqsof(); }
@ -50,11 +66,11 @@
function _debug_sqsof()
{
$data = array(
'start' => $this->start,
'query' => $this->query,
'sort' => $this->sort,
'order' => $this->order,
'cat_id' => $this->cat_id
'start' => $this->start,
'query' => $this->query,
'sort' => $this->sort,
'order' => $this->order,
'cat_id' => $this->cat_id
);
echo '<br>UI:<br>';
_debug_array($data);
@ -64,10 +80,10 @@
{
$data = array
(
'start' => $this->start,
'query' => $this->query,
'sort' => $this->sort,
'order' => $this->order
'start' => $this->start,
'query' => $this->query,
'sort' => $this->sort,
'order' => $this->order
);
if(isset($this->cat_id))
@ -77,106 +93,133 @@
$this->bo->save_sessiondata($data);
}
function set_langs()
{
$this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
$this->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
$this->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
$this->template->set_var('lang_save',lang('Save'));
$this->template->set_var('lang_search',lang('Search'));
$this->template->set_var('lang_sub',lang('Add sub'));
$this->template->set_var('lang_edit',lang('Edit'));
$this->template->set_var('lang_delete',lang('Delete'));
$this->template->set_var('lang_parent',lang('Parent category'));
$this->template->set_var('lang_none',lang('None'));
$this->template->set_var('lang_name',lang('Name'));
$this->template->set_var('lang_descr',lang('Description'));
$this->template->set_var('lang_add',lang('Add'));
$this->template->set_var('lang_reset',lang('Clear Form'));
$this->template->set_var('lang_cancel',lang('Cancel'));
$this->template->set_var('lang_done',lang('Done'));
}
function index()
{
$global_cats = get_var('global_cats',array('POST','GET'));
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data','cats',
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'search_field',
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'nextmatchs'));
$link_data = array
(
'menuaction' => 'admin.uicategories.index',
'appname' => $GLOBALS['appname'],
'global_cats' => $global_cats
'menuaction' => 'admin.uicategories.add',
'appname' => $this->appname
);
if ($_POST['add'])
{
$link_data['menuaction'] = 'admin.uicategories.edit';
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
if ($_POST['done'])
{
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uimainscreen.mainscreen');
$GLOBALS['phpgw']->redirect_link('/admin/index.php');
}
if ($GLOBALS['appname'])
$this->template->set_file(array('cat_list_t' => 'listcats.tpl'));
$this->template->set_block('cat_list_t','cat_list','list');
if (!$this->acl_add)
{
$GLOBALS['phpgw_info']['flags']['app_header'] = lang($GLOBALS['appname']) . '&nbsp;' . lang('global categories') . ': ' . lang('category list');
$this->template->set_block('cat_list_t','add','addhandle');
}
else
if (!$this->acl_search)
{
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('global categories') . ': ' . lang('category list');
$this->template->set_block('cat_list_t','search','searchhandle');
}
if (!$global_cats)
$GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Global categories');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$this->set_langs();
$this->template->set_var('query',$this->query);
$link_data['menuaction'] = 'admin.uicategories.index';
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
if(!$start)
{
$global_cats = False;
$start = 0;
}
$categories = $this->bo->get_list($global_cats);
$categories = $this->bo->get_list();
$cat_header[] = array
(
'sort_name' => $this->nextmatchs->show_sort_order(array
(
'sort' => $this->sort,
'var' => 'cat_name',
'order' => $this->order,
'extra' => $link_data
)),
'lang_add_sub' => lang('add sub'),
'lang_name' => lang('name'),
'lang_descr' => lang('description'),
'lang_edit' => lang('edit'),
'lang_delete' => lang('delete'),
'lang_sort_statustext' => lang('sort the entries'),
'sort_descr' => $this->nextmatchs->show_sort_order(array
(
'sort' => $this->sort,
'var' => 'cat_description',
'order' => $this->order,
'extra' => $link_data
))
);
$left = $this->nextmatchs->left('/index.php',$this->start,$this->bo->cats->total_records,$link_data);
$right = $this->nextmatchs->right('/index.php',$this->start,$this->bo->cats->total_records,$link_data);
$this->template->set_var('left',$left);
$this->template->set_var('right',$right);
while (is_array($categories) && list(,$cat) = each($categories))
$this->template->set_var('lang_showing',$this->nextmatchs->show_hits($this->bo->cats->total_records,$this->start));
$this->template->set_var('sort_name',$this->nextmatchs->show_sort_order($this->sort,'cat_name',$this->order,'/index.php',lang('Name'),$link_data));
$this->template->set_var('sort_description',$this->nextmatchs->show_sort_order($this->sort,'cat_description',$this->order,'/index.php',lang('Description'),$link_data));
for ($i=0;$i<count($categories);$i++)
{
$level = $cat['level'];
$cat_name = $GLOBALS['phpgw']->strip_html($cat['name']);
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
$this->template->set_var(tr_color,$tr_color);
$id = $categories[$i]['id'];
$level = $categories[$i]['level'];
$cat_name = $GLOBALS['phpgw']->strip_html($categories[$i]['name']);
$main = 'yes';
if ($level > 0)
{
$space = '&nbsp;.&nbsp;';
$space = '&nbsp;&nbsp;';
$spaceset = str_repeat($space,$level);
$cat_name = $spaceset . $cat_name;
$main = 'no';
}
$descr = $GLOBALS['phpgw']->strip_html($cat['descr']);
$descr = $GLOBALS['phpgw']->strip_html($categories[$i]['description']);
if (!$descr) { $descr = '&nbsp;'; }
if ($GLOBALS['appname'] && $cat['app_name'] == 'phpgw')
if ($level == 0)
{
$appendix = '&nbsp;&lt;' . lang('Global') . '&gt;';
$cat_name = '<font color="FF0000"><b>' . $cat_name . '</b></font>';
$descr = '<font color="FF0000"><b>' . $descr . '</b></font>';
}
if ($this->appname && $categories[$i]['app_name'] == 'phpgw')
{
$appendix = '&lt;' . lang('Global') . '&gt;';
}
else
{
$appendix = '';
}
$link_data['menuaction'] = 'admin.uicategories.edit';
$link_data['parent'] = $cat['cat_id'];
$add_sub_url = $GLOBALS['phpgw']->link('/index.php',$link_data);
$this->template->set_var(array
(
'name' => $cat_name . $appendix,
'descr' => $descr
));
if ($GLOBALS['appname'] && $cat['app_name'] == $GLOBALS['appname'])
if ($this->acl_add_sub)
{
$link_data['menuaction'] = 'admin.uicategories.add';
$link_data['cat_parent'] = $id;
$this->template->set_var('add_sub','<a href="'.$GLOBALS['phpgw']->link('/index.php',$link_data).'">'.
lang('Add sub').'</a>');
}
if ($this->appname && $categories[$i]['app_name'] == $this->appname)
{
$show_edit_del = True;
}
elseif(!$GLOBALS['appname'] && $cat['app_name'] == 'phpgw')
elseif(!$this->appname && $categories[$i]['app_name'] == 'phpgw')
{
$show_edit_del = True;
}
@ -185,242 +228,251 @@
$show_edit_del = False;
}
if ($show_edit_del)
$link_data['cat_id'] = $id;
if ($show_edit_del && $this->acl_edit)
{
$link_data['cat_id'] = $cat['cat_id'];
$link_data['menuaction'] = 'admin.uicategories.edit';
$edit_url = $GLOBALS['phpgw']->link('/index.php',$link_data);
$lang_edit = lang('edit');
$link_data['menuaction'] = 'admin.uicategories.delete';
$delete_url = $GLOBALS['phpgw']->link('/index.php',$link_data);
$lang_delete = lang('delete');
$link_data['menuaction'] = 'admin.uicategories.edit';
$this->template->set_var('edit','<a href="'.$GLOBALS['phpgw']->link('/index.php',$link_data).'">'.
lang('Edit').'</a>');
}
else
{
$edit_url = '';
$lang_edit = '';
$delete_url = '';
$lang_delete = '';
$this->template->set_var('edit','');
}
$content[] = array
(
'name' => $cat_name . $appendix,
'descr' => $descr,
'date' => $note['date'],
'main' => $main,
'add_sub_url' => $add_sub_url,
'edit_url' => $edit_url,
'delete_url' => $delete_url,
'lang_add_sub_statustext' => lang('add a subcategory'),
'lang_edit_statustext' => lang('edit this category'),
'lang_delete_statustext' => lang('delete this category'),
'lang_add_sub' => lang('add sub'),
'lang_edit' => $lang_edit,
'lang_delete' => $lang_delete
);
if ($show_edit_del && $this->acl_delete)
{
$link_data['menuaction'] = 'admin.uicategories.delete';
$this->template->set_var('delete','<a href="'.$GLOBALS['phpgw']->link('/index.php',$link_data).'">'.
lang('Delete').'</a>');
}
else
{
$this->template->set_var('delete','');
}
$this->template->fp('list','cat_list',True);
}
$link_data['menuaction'] = 'admin.uicategories.index';
$link_data['parent'] = '';
$cat_add[] = array
(
'lang_add' => lang('add'),
'lang_add_statustext' => lang('add a category'),
'action_url' => $GLOBALS['phpgw']->link('/index.php',$link_data),
'lang_done' => lang('done'),
'lang_done_statustext' => lang('return to admin mainscreen')
);
$link_data['menuaction'] = 'admin.uicategories.index';
$data = array
(
'start_record' => $this->start,
'record_limit' => $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
'num_records' => count($categoris),
'all_records' => $this->bo->cats->total_records,
'nextmatchs_url' => $GLOBALS['phpgw']->link('/index.php',$link_data),
'nextmatchs_img_path' => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
'select_url' => $GLOBALS['phpgw']->link('/index.php',$link_data),
'lang_searchfield_statustext' => lang('Enter the search string. To show all entries, empty this field and press the SUBMIT button again'),
'lang_searchbutton_statustext' => lang('Submit the search string'),
'query' => $this->query,
'lang_search' => lang('search'),
'cat_header' => $cat_header,
'cat_data' => $content,
'cat_add' => $cat_add
);
$link_data['menuaction'] = 'admin.uicategories.add';
$link_data['cat_parent'] = '';
$this->template->set_var('add_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
$this->save_sessiondata();
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('cat_list' => $data));
$this->template->pfp('out','cat_list_t',True);
}
function edit()
function add()
{
$global_cats = get_var('global_cats',array('POST','GET'));
$parent = get_var('parent',array('GET'));
$values = get_var('values',array('POST'));
$new_parent = $_POST['new_parent'];
$cat_parent = intval(get_var('cat_parent',array('POST','GET')));
$cat_name = $_POST['cat_name'];
$cat_description = $_POST['cat_description'];
if ($new_parent)
{
$cat_parent = intval($new_parent);
}
if (!$this->acl_add && $cat_parent == 0 || !$this->acl_add_sub && $cat_parent != 0)
{
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$link_data = array
(
'menuaction' => 'admin.uicategories.index',
'appname' => $GLOBALS['appname'],
'global_cats' => $global_cats
'menuaction' => 'admin.uicategories.index',
'appname' => $this->appname
);
if ($values['cancel'])
if ($_POST['cancel'])
{
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
if ($values['save'] || $values['apply'])
$GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Add global category');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$this->set_langs();
$this->template->set_file(array('form' => 'category_form.tpl'));
$this->template->set_block('form','delete','deletehandle');
if ($_POST['save'])
{
$values['cat_id'] = $this->cat_id;
$values['access'] = 'public';
$values = array
(
'parent' => $cat_parent,
'descr' => $cat_description,
'name' => $cat_name,
'access' => 'public'
);
$error = $this->bo->check_values($values);
if (is_array($error))
{
$message = $GLOBALS['phpgw']->common->error_list($error);
$this->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
}
else
{
$this->cat_id = $this->bo->save_cat($values);
if ($values['apply'])
{
$message = lang('Category %1 has been saved !',$values['name']);
}
else
{
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
$this->bo->save_cat($values);
$this->template->set_var('message',lang('Category %1 has been added !', $cat_name));
}
}
if ($this->cat_id)
{
$cats = $this->bo->cats->return_single($this->cat_id);
$parent = $cats['parent'];
}
$link_data['menuaction'] = 'admin.uicategories.add';
$this->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
if ($GLOBALS['appname'])
{
$GLOBALS['phpgw_info']['flags']['app_header'] = lang($GLOBALS['appname']) . '&nbsp;' . lang('global categories') . ': ' . ($this->cat_id?lang('edit category'):lang('add category'));
}
else
{
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('global categories') . ': ' . $function;
}
$this->template->set_var('category_list',$this->bo->cats->formatted_list(array('selected' => $cat_parent)));
$this->template->set_var('cat_name',$cat_name);
$this->template->set_var('cat_description',$cat_description);
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data','cats'));
if ($GLOBALS['appname'])
{
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit global category for %1',lang($GLOBALS['appname'])));
}
else
{
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit global category'));
}
$data = array
(
'lang_name' => lang('name'),
'lang_descr' => lang('description'),
'lang_parent' => lang('parent category'),
'old_parent' => $cats['parent'],
'lang_save' => lang('save'),
'lang_apply' => lang('apply'),
'lang_cancel' => lang('cancel'),
'value_name' => $GLOBALS['phpgw']->strip_html($cats['name']),
'value_descr' => $GLOBALS['phpgw']->strip_html($cats['descr']),
'message' => $message,
'lang_content_statustext' => lang('enter a description for the category'),
'lang_cancel_statustext' => lang('leave the category untouched and return back to the list'),
'lang_save_statustext' => lang('save the category and return back to the list'),
'lang_apply_statustext' => lang('save the category'),
'lang_no_cat' => lang('no category'),
'lang_cat_statustext' => lang('Select the parent category. If this is a main category select NO CATEGORY'),
'select_name' => 'values[parent]',
'cat_list' => $this->bo->cats->formatted_xslt_list(array('format' => 'select', 'selected' => $parent,'self' => $this->cat_id,'globals' => $global_cats))
);
$link_data['menuaction'] = 'admin.uicategories.edit';
if ($this->cat_id)
{
$link_data['cat_id'] = $this->cat_id;
}
$data['edit_url'] = $GLOBALS['phpgw']->link('/index.php',$link_data);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('cat_edit' => $data));
$this->template->pfp('out','form');
}
function delete()
function edit()
{
$global_cats = get_var('global_cats',array('POST','GET'));
$new_parent = intval($_POST['new_parent']);
$cat_parent = intval($_POST['cat_parent']);
$cat_name = $_POST['cat_name'];
$cat_description = $_POST['cat_description'];
$old_parent = intval($_POST['old_parent']);
if ($new_parent)
{
$cat_parent = $new_parent;
}
$link_data = array
(
'menuaction' => 'admin.uicategories.index',
'appname' => $GLOBALS['appname'],
'global_cats' => $global_cats
'menuaction' => 'admin.uicategories.index',
'appname' => $this->appname
);
if ($_POST['done'] || $_POST['cancel'] || !$this->cat_id)
if ($_POST['cancel'] || !$this->cat_id || !$this->acl_edit)
{
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
if ($_POST['delete'])
$GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Edit global category');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$this->set_langs();
$this->template->set_file(array('form' => 'category_form.tpl'));
if ($_POST['save'])
{
if ($_POST['subs'])
$values = array
(
'id' => $this->cat_id,
'old_parent' => $old_parent,
'parent' => $cat_parent,
'descr' => $cat_description,
'name' => $cat_name,
'access' => 'public'
);
$error = $this->bo->check_values($values);
if (is_array($error))
{
switch ($_POST['subs'])
{
case 'move':
$this->bo->delete(array('cat_id' => $this->cat_id, 'modify_subs' => True));
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
break;
case 'drop':
$this->bo->delete(array('cat_id' => $this->cat_id, 'drop_subs' => True));
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
break;
default:
$error = array('Please choose one of the methods to handle the subcategories');
$msgbox_error = $GLOBALS['phpgw']->common->error_list($error);
break;
}
$this->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
}
else
{
$this->bo->delete(array('cat_id' => $this->cat_id));
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
$this->cat_id = $this->bo->save_cat($values);
$this->template->set_var('message',lang('Category %1 has been updated !',$cat_name));
}
}
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'app_delete'));
$cats = $this->bo->cats->return_single($this->cat_id);
$GLOBALS['phpgw_info']['flags']['app_header'] = ($GLOBALS['appname']?lang($GLOBALS['appname']) . '&nbsp;':'') . lang('global categories') . ': ' . lang('delete category');
$hidden_vars = '<input type="hidden" name="cat_id" value="' . $this->cat_id . '">' . "\n"
. '<input type="hidden" name="old_parent" value="' . $cats[0]['parent'] . '">' . "\n";
$this->template->set_var('hidden_vars',$hidden_vars);
$type = ($GLOBALS['appname']?'noglobalapp':'noglobal');
$link_data['menuaction'] = 'admin.uicategories.edit';
$link_data['cat_id'] = $this->cat_id;
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
$apps_cats = $this->bo->exists(array('type' => $type,
'cat_name' => '',
'cat_id' => $this->cat_id));
if ($apps_cats)
$this->template->set_var('cat_name',$GLOBALS['phpgw']->strip_html($cats[0]['name']));
$this->template->set_var('cat_description',$GLOBALS['phpgw']->strip_html($cats[0]['description']));
$this->template->set_var('category_list',$this->bo->cats->formatted_list(array('selected' => $cats[0]['parent'],'self' => $this->cat_id)));
$this->template->pfp('out','form');
}
function delete()
{
if (!$this->acl_delete)
{
$error = array('This category is currently being used by applications as a parent category',
'You will need to reassign these subcategories before you can delete this category');
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$link_data = array
(
'menuaction' => 'admin.uicategories.index',
'appname' => $this->appname
);
$msgbox_error = $GLOBALS['phpgw']->common->error_list($error);
$show_done = 'yes';
if (!$this->cat_id || $_POST['cancel'])
{
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
if ($_POST['confirm'])
{
if ($_POST['subs'])
{
$this->bo->delete($this->cat_id,True);
}
else
{
$this->bo->delete($this->cat_id);
}
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
$this->template->set_file(array('category_delete' => 'delete_cat.tpl'));
if ($this->appname)
{
$type = 'noglobalapp';
}
else
{
$confirm_msg = lang('Are you sure you want to delete this global category ?');
$type = 'noglobal';
}
$apps_cats = $this->bo->exists(array
(
'type' => $type,
'cat_name' => '',
'cat_id' => $this->cat_id
));
$GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Delete category');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$hidden_vars = '<input type="hidden" name="cat_id" value="' . $this->cat_id . '">' . "\n";
$this->template->set_var('hidden_vars',$hidden_vars);
$cats = $this->bo->cats->return_single($this->cat_id);
$this->template->set_var('cat_name',$cats[0]['name']);
if ($apps_cats)
{
$this->template->set_block('category_delete','delete','deletehandle');
$this->template->set_var('messages',lang('This category is currently being used by applications as a parent category') . '<br>'
. lang('You will need to remove the subcategories before you can delete this category'));
$this->template->set_var('lang_subs','');
$this->template->set_var('subs','');
$this->template->set_var('nolink',$nolink);
$this->template->set_var('deletehandle','');
$this->template->set_var('donehandle','');
$this->template->set_var('lang_ok',lang('Ok'));
$this->template->pfp('out','category_delete');
}
else
{
$this->template->set_block('category_delete','done','donehandle');
$this->template->set_var('messages',lang('Are you sure you want to delete this category ?'));
$exists = $this->bo->exists(array
(
@ -431,33 +483,22 @@
if ($exists)
{
$subs = 'yes';
$lang_sub_select_move = lang('Do you want to move all global subcategories one level down ?');
$lang_sub_select_drop = lang('Do you want to delete all global subcategories ?');
$this->template->set_var('lang_subs',lang('Do you also want to delete all global subcategories ?'));
$this->template->set_var('subs','<input type="checkbox" name="subs" value="True">');
}
else
{
$this->template->set_var('lang_subs','');
$this->template->set_var('subs', '');
}
$link_data['menuaction'] = 'admin.uicategories.delete';
$link_data['cat_id'] = $this->cat_id;
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
$this->template->set_var('lang_yes',lang('Yes'));
$this->template->set_var('lang_no',lang('No'));
$this->template->pfp('out','category_delete');
}
$data = array
(
'show_done' => $show_done,
'msgbox_data' => $msgbox_error,
'lang_delete' => lang('delete'),
'subs' => $subs,
'lang_sub_select_move' => $lang_sub_select_move,
'lang_sub_select_drop' => $lang_sub_select_drop,
'lang_delete_statustext' => lang('delete the category'),
'lang_cancel_statustext' => lang('do NOT delete the category and return back to the list'),
'lang_done_statustext' => lang('back to the list'),
'lang_cancel' => lang('cancel'),
'lang_done' => lang('done'),
'lang_confirm_msg' => $confirm_msg
);
$link_data['menuaction'] = 'admin.uicategories.delete';
$link_data['cat_id'] = $this->cat_id;
$data['delete_url'] = $GLOBALS['phpgw']->link('/index.php',$link_data);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
}
}
?>

View File

@ -18,29 +18,14 @@
function index()
{
$referer = urldecode($GLOBALS['HTTP_GET_VARS']['referer']);
if($referer)
if ($GLOBALS['phpgw']->acl->check('site_config_access',1,'admin'))
{
$_redir = $referer;
$GLOBALS['phpgw']->session->appsession('session_data','admin_config',$referer);
$GLOBALS['phpgw']->redirect_link('/index.php');
}
else
{
$referer = $GLOBALS['phpgw']->session->appsession('session_data','admin_config');
if($referer == '-1')
{
$referer = '';
}
$_redir = $referer ? $referer : $GLOBALS['phpgw']->link('/admin/index.php');
}
$appname = $GLOBALS['HTTP_GET_VARS']['appname'];
switch($appname)
switch($_GET['appname'])
{
case 'admin':
//case 'preferences':
//$appname = 'preferences';
case 'addressbook':
case 'calendar':
case 'email':
@ -49,14 +34,16 @@
Other special apps can go here for now, e.g.:
case 'bogusappname':
*/
$appname = $_GET['appname'];
$config_appname = 'phpgwapi';
break;
case 'phpgwapi':
case '':
/* This keeps the admin from getting into what is a setup-only config */
Header('Location: ' . $_redir);
$GLOBALS['phpgw']->redirect_link('/admin/index.php');
break;
default:
$appname = $_GET['appname'];
$config_appname = $appname;
break;
}
@ -76,17 +63,17 @@
$current_config = $c->config_data;
}
if ($GLOBALS['HTTP_POST_VARS']['cancel'])
if ($_POST['cancel'] || $_POST['submit'] && $GLOBALS['phpgw']->acl->check('site_config_access',2,'admin'))
{
Header('Location: ' . $_redir);
$GLOBALS['phpgw']->redirect_link('/admin/index.php');
}
if ($GLOBALS['HTTP_POST_VARS']['submit'])
if ($_POST['submit'])
{
/* Load hook file with functions to validate each config (one/none/all) */
$GLOBALS['phpgw']->hooks->single('config_validate',$appname);
while (list($key,$config) = each($GLOBALS['HTTP_POST_VARS']['newsettings']))
while (list($key,$config) = each($_POST['newsettings']))
{
if ($config)
{
@ -128,14 +115,11 @@
unset($GLOBALS['phpgw_info']['server']['found_validation_hook']);
}
$c->save_repository(True);
$c->save_repository();
if(!$errors)
{
$GLOBALS['phpgw']->session->appsession('session_data','admin_config',-1);
Header('Location: ' . $_redir);
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
exit;
$GLOBALS['phpgw']->redirect_link('/admin/index.php');
}
}
@ -149,12 +133,18 @@
else
{
$t->set_var('error','');
$t->set_var('th_err',$GLOBALS['phpgw_info']['theme']['th_bg']);
}
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$t->set_var('title',lang('Site Configuration'));
$t->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname));
$t->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']);
$t->set_var('th_text', $GLOBALS['phpgw_info']['theme']['th_text']);
$t->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']);
$t->set_var('row_off', $GLOBALS['phpgw_info']['theme']['row_off']);
$t->pparse('out','header');
$vars = $t->get_undefined('body');
@ -173,7 +163,7 @@
}
$newval = implode(' ',$new);
switch($type)
switch ($type)
{
case 'lang':
$t->set_var($value,lang($newval));
@ -190,19 +180,19 @@
$t->set_var($value,$current_config[$newval]);
}
break;
/*
case 'checked':
/* '+' is used as a delimiter for the check value */
list($newvalue,$check) = split('\+',$newval);
$newval = ereg_replace(' ','_',$newvalue);
if($current_config[$newval] == $check)
$newval = ereg_replace(' ','_',$newval);
if ($current_config[$newval])
{
$t->set_var($value, ' checked');
$t->set_var($value,' checked');
}
else
{
$t->set_var($value, '');
$t->set_var($value,'');
}
break;
*/
case 'selected':
$configs = array();
$config = '';
@ -235,15 +225,15 @@
}
break;
default:
$t->set_var($value,'');
break;
$t->set_var($value,'');
break;
}
}
$t->pfp('out','body');
$t->set_var('lang_submit', lang('submit'));
$t->set_var('lang_cancel', lang('cancel'));
$t->set_var('lang_submit', $GLOBALS['phpgw']->acl->check('site_config_access',2,'admin') ? lang('Cancel') : lang('Save'));
$t->set_var('lang_cancel', lang('Cancel'));
$t->pfp('out','footer');
}
}

View File

@ -23,6 +23,10 @@
function uicurrentsessions()
{
if ($GLOBALS['phpgw']->acl->check('current_sessions_access',1,'admin'))
{
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$this->template = createobject('phpgwapi.Template',PHPGW_APP_TPL);
$this->bo = createobject('admin.bocurrentsessions');
$this->nextmatchs = createobject('phpgwapi.nextmatchs');
@ -31,6 +35,7 @@
function header()
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
}
function store_location($info)
@ -78,15 +83,9 @@
$this->template->set_block('current','list','list');
$this->template->set_block('current','row','row');
if (! $GLOBALS['phpgw']->acl->check('current_sessions_access',4,'admin'))
{
$can_view_ip = True;
}
if (! $GLOBALS['phpgw']->acl->check('current_sessions_access',2,'admin'))
{
$can_view_action = True;
}
$can_view_action = !$GLOBALS['phpgw']->acl->check('current_sessions_access',2,'admin');
$can_view_ip = !$GLOBALS['phpgw']->acl->check('current_sessions_access',4,'admin');
$can_kill = !$GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin');
$total = $this->bo->total();
@ -115,14 +114,7 @@
$this->template->set_var('row_loginid',$value['session_lid']);
if ($can_view_ip)
{
$this->template->set_var('row_ip',$value['session_ip']);
}
else
{
$this->template->set_var('row_ip','&nbsp; -- &nbsp;');
}
$this->template->set_var('row_ip',$can_view_ip?$value['session_ip']:'&nbsp;');
$this->template->set_var('row_logintime',$value['session_logintime']);
$this->template->set_var('row_idle',$value['session_idle']);
@ -131,16 +123,12 @@
{
$this->template->set_var('row_action',$GLOBALS['phpgw']->strip_html($value['session_action']));
}
elseif(! $can_view_action)
{
$this->template->set_var('row_action','&nbsp; -- &nbsp;');
}
else
{
$this->template->set_var('row_action','&nbsp;');
}
if ($value['session_id'] != $GLOBALS['phpgw_info']['user']['sessionid'] && ! $GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin'))
if ($value['session_id'] != $GLOBALS['phpgw_info']['user']['sessionid'] && $can_kill)
{
$this->template->set_var('row_kill','<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.kill&ksession='
. $value['session_id'] . '&kill=true') . '">' . lang('Kill').'</a>');
@ -160,10 +148,8 @@
{
if ($GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin'))
{
$this->list_sessions();
return False;
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Kill session');
$this->header();
$this->template->set_file('form','kill_session.tpl');

View File

@ -26,6 +26,11 @@
function uilog()
{
if ($GLOBALS['phpgw']->acl->check('error_log_access',1,'admin'))
{
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$_cols = $GLOBALS['HTTP_POST_VARS']['_cols'];
$nocols = $GLOBALS['HTTP_POST_VARS']['nocols'];
$_delcol = $GLOBALS['HTTP_POST_VARS']['_delcol'];
@ -257,6 +262,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.($this->editmode?lang('Edit Table format') : lang('View error log'));
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$this->t->pfp('out','log_list_t');
// $this->set_app_langs();
}

View File

@ -1,49 +1,44 @@
<?php
/**************************************************************************\
* phpGroupWare - Administration *
* http://www.phpgroupware.org *
* Written by coreteam <phpgroupware-developers@gnu.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/**************************************************************************\
* phpGroupWare - administration *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
class uimainscreen
{
var $public_functions = array
(
'index' => True,
'mainscreen' => True
);
var $public_functions = array('index' => True);
function uimainscreen()
{
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
$GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs');
}
function mainscreen()
{
$GLOBALS['phpgw']->xslttpl->add_file('app_data');
function display_section($appname,$file,$file2='')
{
$GLOBALS['phpgw']->common->display_mainscreen($appname,$file2 ? $file2 : $file);
}
$GLOBALS['phpgw']->hooks->process('admin');
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $GLOBALS['phpgw']->common->output));
}
function index()
{
if ($GLOBALS['HTTP_POST_VARS']['cancel'])
$section = addslashes($_POST['section']);
$select_lang = addslashes($_POST['select_lang']);
$message = addslashes($_POST['message']);
$acl_ok = array();
if (!$GLOBALS['phpgw']->acl->check('mainscreen_message_access',1,'admin'))
{
header('Location: ' . $GLOBALS['phpgw']->link('/admin/index.php'));
$acl_ok['mainscreen'] = True;
}
if (!$GLOBALS['phpgw']->acl->check('mainscreen_message_access',2,'admin'))
{
$acl_ok['loginscreen'] = True;
}
if ($_POST['cancel'] && !isset($_POST['message']) ||
!count($acl_ok) || $_POST['submit'] && !isset($acl_ok[$section]))
{
$GLOBALS['phpgw']->redirect_link('/admin/index.php');
}
$GLOBALS['phpgw']->template->set_file(array('message' => 'mainscreen_message.tpl'));
@ -51,24 +46,37 @@
$GLOBALS['phpgw']->template->set_block('message','row','row');
$GLOBALS['phpgw']->template->set_block('message','row_2','row_2');
$section = $GLOBALS['HTTP_POST_VARS']['section'];
$select_lang = $GLOBALS['HTTP_POST_VARS']['select_lang'];
$message = $GLOBALS['HTTP_POST_VARS']['message'];
$GLOBALS['phpgw']->common->phpgw_header();
if ($GLOBALS['HTTP_POST_VARS']['submit'])
if ($_POST['submit'])
{
$GLOBALS['phpgw']->db->query("DELETE FROM phpgw_lang WHERE message_id='$section" . "_message' AND app_name='"
. "$section' AND lang='$select_lang'",__LINE__,__FILE__);
$GLOBALS['phpgw']->db->query("INSERT INTO phpgw_lang VALUES ('$section" . "_message','$section','$select_lang','"
. addslashes($message) . "')",__LINE__,__FILE__);
. $message . "')",__LINE__,__FILE__);
$message = '<center>'.lang('message has been updated').'</center>';
$section = '';
}
if (empty($select_lang))
if ($_POST['cancel']) // back to section/lang-selection
{
$message = $section = '';
}
switch ($section)
{
case 'mainscreen':
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Edit main screen message') . ': '.strtoupper($select_lang);
break;
case 'loginscreen':
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Edit login screen message') . ': '.strtoupper($select_lang);
break;
default:
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Main screen message');
break;
}
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
if (empty($section))
{
$GLOBALS['phpgw']->template->set_var('header_lang',lang('Main screen message'));
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index'));
$GLOBALS['phpgw']->template->set_var('tr_color',$GLOBALS['phpgw_info']['theme']['th_bg']);
$GLOBALS['phpgw']->template->set_var('value','&nbsp;');
@ -77,51 +85,48 @@
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
$select_lang = '<select name="select_lang">';
$lang_select = '<select name="select_lang">';
$GLOBALS['phpgw']->db->query("SELECT lang,phpgw_languages.lang_name,phpgw_languages.lang_id FROM phpgw_lang,phpgw_languages WHERE "
. "phpgw_lang.lang=phpgw_languages.lang_id GROUP BY lang,phpgw_languages.lang_name,"
. "phpgw_languages.lang_id ORDER BY lang");
. "phpgw_languages.lang_id ORDER BY lang",__LINE__,__FILE__);
while ($GLOBALS['phpgw']->db->next_record())
{
$select_lang .= '<option value="' . $GLOBALS['phpgw']->db->f('lang') . '">' . $GLOBALS['phpgw']->db->f('lang_id')
. ' - ' . $GLOBALS['phpgw']->db->f('lang_name') . '</option>';
$lang = $GLOBALS['phpgw']->db->f('lang');
$lang_select .= '<option value="' . $lang . '"'.($lang == $select_lang ? ' selected' : '').'>' .
$lang . ' - ' . $GLOBALS['phpgw']->db->f('lang_name') . "</option>\n";
}
$select_lang .= '</select>';
$lang_select .= '</select>';
$GLOBALS['phpgw']->template->set_var('label',lang('Language'));
$GLOBALS['phpgw']->template->set_var('value',$select_lang);
$GLOBALS['phpgw']->template->set_var('value',$lang_select);
$GLOBALS['phpgw']->template->fp('rows','row',True);
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
$select_section = '<select name="section"><option value="mainscreen">' . lang('Main screen')
. '</option><option value="loginscreen">' . lang("Login screen") . '</option>'
. '</select>';
$select_section = '<select name="section">'."\n";
foreach($acl_ok as $key => $val)
{
$select_section .= ' <option value="'.$key.'"'.
($key == $_POST['section'] ? ' selected' : '') . '>' .
($key == 'mainscreen' ? lang('Main screen') : lang("Login screen")) . "</option>\n";
}
$select_section .= '</select>';
$GLOBALS['phpgw']->template->set_var('label',lang('Section'));
$GLOBALS['phpgw']->template->set_var('value',$select_section);
$GLOBALS['phpgw']->template->fp('rows','row',True);
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
$GLOBALS['phpgw']->template->set_var('value','<input type="submit" value="' . lang('Submit')
$GLOBALS['phpgw']->template->set_var('value','<input type="submit" value="' . lang('Edit')
. '"><input type="submit" name="cancel" value="'. lang('cancel') .'">');
$GLOBALS['phpgw']->template->fp('rows','row_2',True);
}
else
{
$GLOBALS['phpgw']->db->query("SELECT content FROM phpgw_lang WHERE lang='$select_lang' AND message_id='$section"
. "_message'");
. "_message'",__LINE__,__FILE__);
$GLOBALS['phpgw']->db->next_record();
$current_message = $GLOBALS['phpgw']->db->f('content');
if ($section == 'mainscreen')
{
$GLOBALS['phpgw']->template->set_var('header_lang',lang('Edit main screen message'));
}
else
{
$GLOBALS['phpgw']->template->set_var('header_lang',lang('Edit login screen message'));
}
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index'));
$GLOBALS['phpgw']->template->set_var('select_lang',$select_lang);
$GLOBALS['phpgw']->template->set_var('section',$section);
@ -136,7 +141,7 @@
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
$GLOBALS['phpgw']->template->set_var('value','<input type="submit" name="submit" value="' . lang('Update')
$GLOBALS['phpgw']->template->set_var('value','<input type="submit" name="submit" value="' . lang('Save')
. '"><input type="submit" name="cancel" value="'. lang('cancel') .'">'
);
$GLOBALS['phpgw']->template->fp('rows','row_2',True);

Some files were not shown because too many files have changed in this diff Show More