[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property login.php inc/class.boactor.inc.php in...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property login.php inc/class.boactor.inc.php in... |
Date: |
Tue, 31 Oct 2006 14:14:06 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Changes by: Sigurd Nes <sigurdne> 06/10/31 14:14:06
Modified files:
. : login.php
inc : class.boactor.inc.php class.bocommon.inc.php
class.bolookup.inc.php class.soactor.inc.php
class.solookup.inc.php class.uiactor.inc.php
class.uilookup.inc.php
setup : default_records.inc.php setup.inc.php
tables_current.inc.php tables_update.inc.php
templates/base : attributes_form.xsl lookup.xsl
Log message:
Admin tenant as external users mapped to internal users
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/login.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.boactor.inc.php?cvsroot=phpgroupware&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.bocommon.inc.php?cvsroot=phpgroupware&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.bolookup.inc.php?cvsroot=phpgroupware&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.soactor.inc.php?cvsroot=phpgroupware&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.solookup.inc.php?cvsroot=phpgroupware&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uiactor.inc.php?cvsroot=phpgroupware&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uilookup.inc.php?cvsroot=phpgroupware&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/property/setup/default_records.inc.php?cvsroot=phpgroupware&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/property/setup/setup.inc.php?cvsroot=phpgroupware&r1=1.51&r2=1.52
http://cvs.savannah.gnu.org/viewcvs/property/setup/tables_current.inc.php?cvsroot=phpgroupware&r1=1.69&r2=1.70
http://cvs.savannah.gnu.org/viewcvs/property/setup/tables_update.inc.php?cvsroot=phpgroupware&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/attributes_form.xsl?cvsroot=phpgroupware&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/lookup.xsl?cvsroot=phpgroupware&r1=1.1&r2=1.2
Patches:
Index: login.php
===================================================================
RCS file: /sources/phpgroupware/property/login.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- login.php 30 Oct 2006 10:11:55 -0000 1.2
+++ login.php 31 Oct 2006 14:14:05 -0000 1.3
@@ -8,7 +8,7 @@
* @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc.
http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package phpgroupware
- * @version $Id: login.php,v 1.2 2006/10/30 10:11:55 sigurdne Exp $
+ * @version $Id: login.php,v 1.3 2006/10/31 14:14:05 sigurdne Exp $
*/
$phpgw_info = array();
@@ -226,18 +226,18 @@
$_passwd = md5($passwd);
- $db->query("SELECT fm_tenant.id,
phpgw_account_lid,phpgw_accounts.account_pwd FROM fm_tenant $join
phpgw_accounts ON fm_tenant.phpgw_account_lid = phpgw_accounts.account_lid
WHERE fm_tenant.account_lid = '$login' AND "
- . "fm_tenant.account_pwd='" . $_passwd . "' AND
fm_tenant.account_status ='A'",__LINE__,__FILE__);
+ $db->query("SELECT fm_tenant.id,
phpgw_accounts.account_lid,phpgw_accounts.account_pwd FROM fm_tenant $join
phpgw_accounts ON fm_tenant.phpgw_account_id = phpgw_accounts.account_id WHERE
fm_tenant.account_lid = '$login' AND "
+ . "fm_tenant.account_pwd='" . $_passwd . "' AND
fm_tenant.account_status ='1'",__LINE__,__FILE__);
$db->next_record();
- if (!$db->f('phpgw_account_lid'))
+ if (!$db->f('account_lid'))
{
$GLOBALS['phpgw']->redirect('login.php?cd=5');
exit;
}
$tenant_id = $db->f('id');
- $login = $db->f('phpgw_account_lid');
+ $login = $db->f('account_lid');
$passwd = $db->f('account_pwd');
$_POST['passwd_type'] = 'md5';
Index: inc/class.boactor.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.boactor.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- inc/class.boactor.inc.php 31 Oct 2006 09:50:56 -0000 1.13
+++ inc/class.boactor.inc.php 31 Oct 2006 14:14:05 -0000 1.14
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage admin
- * @version $Id: class.boactor.inc.php,v 1.13 2006/10/31 09:50:56
sigurdne Exp $
+ * @version $Id: class.boactor.inc.php,v 1.14 2006/10/31 14:14:05
sigurdne Exp $
*/
/**
@@ -221,6 +221,22 @@
$lookup_functions[$m]['action'] =
'Window1=window.open('."'" . $lookup_link ."'"
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
$m++;
}
+
+ if($actor['attributes'][$i]['datatype']=='user')
+ {
+ if($actor['attributes'][$i]['value'])
+ {
+
$actor['attributes'][$i]['user_name']=
$GLOBALS['phpgw']->accounts->id2name($actor['attributes'][$i]['value']);
+ }
+
+ $insert_record_actor[] =
$actor['attributes'][$i]['name'];
+ $lookup_link =
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$this->currentapp.'.uilookup.phpgw_user', 'column'=>
$actor['attributes'][$i]['name']));
+
+ $lookup_functions[$m]['name'] =
'lookup_'. $actor['attributes'][$i]['name'] .'()';
+ $lookup_functions[$m]['action'] =
'Window1=window.open('."'" . $lookup_link ."'"
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
+ $m++;
+ }
+
if($actor['attributes'][$i]['datatype']=='R' ||
$actor['attributes'][$i]['datatype']=='CH' ||
$actor['attributes'][$i]['datatype']=='LB')
{
$actor['attributes'][$i]['choice']
= $this->so->read_attrib_choice($actor['attributes'][$i]['attrib_id']);
@@ -260,7 +276,7 @@
$GLOBALS['phpgw']->session->appsession('insert_record_actor',$this->currentapp,$insert_record_actor);
-//html_print_r($actor);
+//_debug_array($actor);
return $actor;
}
Index: inc/class.bocommon.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- inc/class.bocommon.inc.php 31 Oct 2006 09:50:56 -0000 1.50
+++ inc/class.bocommon.inc.php 31 Oct 2006 14:14:05 -0000 1.51
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage core
- * @version $Id: class.bocommon.inc.php,v 1.50 2006/10/31 09:50:56
sigurdne Exp $
+ * @version $Id: class.bocommon.inc.php,v 1.51 2006/10/31 14:14:05
sigurdne Exp $
*/
/**
@@ -782,7 +782,8 @@
'VENDOR' => 'Vendor',
'email' => 'Email',
'link' => 'Link',
- 'pwd' => 'Password'
+ 'pwd' => 'Password',
+ 'user' => 'phpgw user'
);
$datatype = lang($datatype_text[$datatype]);
@@ -806,7 +807,8 @@
'VENDOR' => 'int',
'email' => 'varchar',
'link' => 'varchar',
- 'pwd' => 'varchar'
+ 'pwd' => 'varchar',
+ 'user' => 'int'
);
return $datatype_text[$datatype];
@@ -822,7 +824,8 @@
'VENDOR' => 4,
'email' => 64,
'link' => 255,
- 'pwd' => 32
+ 'pwd' => 32,
+ 'user' => 4
);
return
(isset($datatype_precision[$datatype])?$datatype_precision[$datatype]:'');
@@ -1321,6 +1324,8 @@
{
$datatypes[13]['id']= 'pwd';
$datatypes[13]['name']= lang('Password');
+ $datatypes[14]['id']= 'user';
+ $datatypes[14]['name']= lang('phpgw user');
}
return $this->select_list($selected,$datatypes);
Index: inc/class.bolookup.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.bolookup.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- inc/class.bolookup.inc.php 3 Feb 2006 12:05:49 -0000 1.8
+++ inc/class.bolookup.inc.php 31 Oct 2006 14:14:05 -0000 1.9
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage core
- * @version $Id: class.bolookup.inc.php,v 1.8 2006/02/03 12:05:49
sigurdne Exp $
+ * @version $Id: class.bolookup.inc.php,v 1.9 2006/10/31 14:14:05
sigurdne Exp $
*/
/**
@@ -250,5 +250,14 @@
return $ns3420;
}
+
+ function read_phpgw_user()
+ {
+ $phpgw_user = $this->so->read_phpgw_user(array('start'
=> $this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
+
'filter' => $this->filter,'cat_id' => $this->cat_id));
+ $this->total_records = $this->so->total_records;
+
+ return $phpgw_user;
+ }
}
?>
Index: inc/class.soactor.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.soactor.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- inc/class.soactor.inc.php 31 Oct 2006 09:50:56 -0000 1.19
+++ inc/class.soactor.inc.php 31 Oct 2006 14:14:05 -0000 1.20
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage admin
- * @version $Id: class.soactor.inc.php,v 1.19 2006/10/31 09:50:56
sigurdne Exp $
+ * @version $Id: class.soactor.inc.php,v 1.20 2006/10/31 14:14:05
sigurdne Exp $
*/
/**
@@ -393,13 +393,14 @@
}
}
-
if (isset($values_attribute) AND
is_array($values_attribute))
{
foreach($values_attribute as $entry)
{
if($entry['value'])
{
+ if($entry['datatype']!='AB' &&
$entry['datatype']!='VENDOR' && $entry['datatype']!='user')
+ {
if($entry['datatype'] == 'C' ||
$entry['datatype'] == 'T' || $entry['datatype'] == 'V')
{
$entry['value'] =
$this->db->db_addslashes($entry['value']);
@@ -430,6 +431,7 @@
}
}
}
+ }
if($this->role == 'vendor')
{
@@ -484,7 +486,7 @@
{
foreach($values_attribute as $entry)
{
- if($entry['datatype']!='AB' &&
$entry['datatype']!='VENDOR')
+ if($entry['datatype']!='AB' &&
$entry['datatype']!='VENDOR' && $entry['datatype']!='user')
{
if($entry['datatype'] == 'C' ||
$entry['datatype'] == 'T' || $entry['datatype'] == 'V')
{
Index: inc/class.solookup.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.solookup.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- inc/class.solookup.inc.php 30 Jan 2006 22:14:19 -0000 1.9
+++ inc/class.solookup.inc.php 31 Oct 2006 14:14:05 -0000 1.10
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage core
- * @version $Id: class.solookup.inc.php,v 1.9 2006/01/30 22:14:19
sigurdne Exp $
+ * @version $Id: class.solookup.inc.php,v 1.10 2006/10/31 14:14:05
sigurdne Exp $
*/
/**
@@ -380,5 +380,60 @@
return $ns3420;
}
+
+ function read_phpgw_user($data)
+ {
+ if(is_array($data))
+ {
+ if ($data['start'])
+ {
+ $start=$data['start'];
+ }
+ else
+ {
+ $start=0;
+ }
+ $filter =
(isset($data['filter'])?$data['filter']:'none');
+ $query =
(isset($data['query'])?$data['query']:'');
+ $sort =
(isset($data['sort'])?$data['sort']:'DESC');
+ $order =
(isset($data['order'])?$data['order']:'');
+ $cat_id =
(isset($data['cat_id'])?$data['cat_id']:0);
+ }
+
+ if ($order)
+ {
+ $ordermethod = " order by $order $sort";
+ }
+ else
+ {
+ $ordermethod = ' order by account_lastname
DESC';
+ }
+
+ if($query)
+ {
+ $query = ereg_replace("'",'',$query);
+ $query = ereg_replace('"','',$query);
+
+ $querymethod = " AND ( account_last_name
$this->like '%$query%' or account_first_name $this->like '%$query%')";
+ }
+
+ $sql = "SELECT * FROM phpgw_accounts WHERE
account_status = 'A' AND account_type = 'u' $querymethod ";
+
+ $this->db2->query($sql,__LINE__,__FILE__);
+ $this->total_records = $this->db2->num_rows();
+ $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
+
+ while ($this->db->next_record())
+ {
+ $phpgw_user[] = array
+ (
+ 'id' =>
$this->db->f('account_id'),
+ 'last_name' =>
$this->db->f('account_lastname'),
+ 'first_name' =>
$this->db->f('account_firstname')
+ );
+ }
+ return $phpgw_user;
+ }
+
}
?>
Index: inc/class.uiactor.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uiactor.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- inc/class.uiactor.inc.php 31 Oct 2006 09:50:56 -0000 1.24
+++ inc/class.uiactor.inc.php 31 Oct 2006 14:14:05 -0000 1.25
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage admin
- * @version $Id: class.uiactor.inc.php,v 1.24 2006/10/31 09:50:56
sigurdne Exp $
+ * @version $Id: class.uiactor.inc.php,v 1.25 2006/10/31 14:14:05
sigurdne Exp $
*/
/**
@@ -372,6 +372,8 @@
$insert_record_actor =
$GLOBALS['phpgw']->session->appsession('insert_record_actor',$this->currentapp);
+
+//_debug_array($insert_record_actor);
//_debug_array($values_attribute);
for ($j=0;$j<count($insert_record_actor);$j++)
{
Index: inc/class.uilookup.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uilookup.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- inc/class.uilookup.inc.php 9 Mar 2006 13:07:12 -0000 1.14
+++ inc/class.uilookup.inc.php 31 Oct 2006 14:14:05 -0000 1.15
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage core
- * @version $Id: class.uilookup.inc.php,v 1.14 2006/03/09 13:07:12
sigurdne Exp $
+ * @version $Id: class.uilookup.inc.php,v 1.15 2006/10/31 14:14:05
sigurdne Exp $
*/
/**
@@ -39,7 +39,8 @@
'entity' => True,
'ns3420' => True,
'street' => True,
- 'tenant' => True
+ 'tenant' => True,
+ 'phpgw_user' => True
);
function uilookup()
@@ -897,5 +898,130 @@
$this->save_sessiondata();
}
+ function phpgw_user()
+ {
+
+ $GLOBALS['phpgw']->xslttpl->add_file(array('lookup',
+
'nextmatchs',
+
'search_field'));
+
+ $phpgw_user_list = $this->bo->read_phpgw_user();
+
+ $column = get_var('column',array('POST','GET'));
+
+ while (is_array($phpgw_user_list) &&
list(,$phpgw_user_entry) = each($phpgw_user_list))
+ {
+ $content[] = array
+ (
+ 'id' =>
$phpgw_user_entry['id'],
+ 'account_lid' =>
$phpgw_user_entry['account_lid'],
+ 'first_name' =>
$phpgw_user_entry['first_name'],
+ 'last_name' =>
$phpgw_user_entry['last_name'],
+ 'lang_select' =>
lang('Select'),
+ 'lang_select_statustext' =>
lang('Select this user')
+ );
+ }
+
+ $table_header[] = array
+ (
+ 'sort_account_lid' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'account_lid',
+
'order' => $this->order,
+
'extra' => array('menuaction' =>
$this->currentapp.'.uilookup.phpgw_user',
+
'cat_id'
=>$this->cat_id)
+
)),
+ 'sort_last_name' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'account_lastname',
+
'order' => $this->order,
+
'extra' => array('menuaction' =>
$this->currentapp.'.uilookup.phpgw_user',
+
'cat_id'
=>$this->cat_id)
+
)),
+ 'sort_first_name' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'account_firstname',
+
'order' => $this->order,
+
'extra' => array('menuaction' =>
$this->currentapp.'.uilookup.phpgw_user',
+
'cat_id'
=>$this->cat_id)
+
)),
+ 'lang_last_name' => lang('last
name'),
+ 'lang_first_name' => lang('first
name'),
+ 'sort_id' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'account_id',
+
'order' => $this->order,
+
'extra' => array('menuaction' =>
$this->currentapp.'.uilookup.phpgw_user',
+
'cat_id'
=>$this->cat_id)
+
)),
+ 'lang_id' => lang('ID'),
+ 'lang_select' => lang('Select')
+ );
+
+ $table_done[] = array
+ (
+ 'lang_done' =>
lang('Done'),
+ 'lang_done_statustext' => lang('Close this
window')
+ );
+
+ $link_select = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uilookup.phpgw_user',
+ 'second_display' => true,
+ 'order' => $this->order,
+ 'sort' => $this->sort,
+ 'cat_id' =>
$this->cat_id,
+ 'query' => $this->query,
+ 'filter' => $this->filter
+ );
+
+ if($column)
+ {
+ $user_id =$column;
+ $user_name =$column . '_user_name';
+ }
+ else
+ {
+ $user_id ='user_id';
+ $user_name ='user_name';
+ }
+
+
+ $data = array
+ (
+ 'allow_allrows'
=> false,
+ 'start_record'
=> $this->start,
+ 'record_limit'
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
+ 'num_records'
=> count($phpgw_user_list),
+ 'all_records'
=> $this->bo->total_records,
+ 'link_url'
=> $GLOBALS['phpgw']->link('/index.php',$link_select),
+ 'img_path'
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
+ 'lang_no_cat'
=> lang('no category'),
+ 'lang_cat_statustext' =>
lang('Select the category the building belongs to. To do not use a category
select NO CATEGORY'),
+ 'select_name'
=> 'cat_id',
+ 'select_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_select),
+ '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'),
+ 'table_header_phpgw_user' =>
$table_header,
+ 'values_phpgw_user'
=> $content,
+ 'table_done'
=> $table_done,
+ 'user_id'
=> $user_id,
+ 'user_name'
=> $user_name
+
+ );
+
+ $appname
= lang('phpgw_user');
+ $function_msg =
lang('list phpgw_user');
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_phpgw_user' => $data));
+ $this->save_sessiondata();
+ }
}
?>
Index: setup/default_records.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/default_records.inc.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- setup/default_records.inc.php 30 Oct 2006 09:49:13 -0000 1.34
+++ setup/default_records.inc.php 31 Oct 2006 14:14:05 -0000 1.35
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage setup
- * @version $Id: default_records.inc.php,v 1.34 2006/10/30 09:49:13
sigurdne Exp $
+ * @version $Id: default_records.inc.php,v 1.35 2006/10/31 14:14:05
sigurdne Exp $
*/
@@ -262,6 +262,17 @@
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id,
list, search, lookup_form, column_name, input_text, statustext, size, datatype,
attrib_sort, precision_, scale, default_value, nullable) VALUES (1, 1, 1, NULL,
'first_name', 'First name', 'First name', NULL, 'V', 1, 50, NULL, NULL,
'True')");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id,
list, search, lookup_form, column_name, input_text, statustext, size, datatype,
attrib_sort, precision_, scale, default_value, nullable) VALUES (2, 1, 1, NULL,
'last_name', 'Last name', 'Last name', NULL, 'V', 2, 50, NULL, NULL, 'True')");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id,
list, search, lookup_form, column_name, input_text, statustext, size, datatype,
attrib_sort, precision_, scale, default_value, nullable) VALUES (3, 1, 1, NULL,
'contact_phone', 'contact phone', 'contact phone', NULL, 'V', 3, 20, NULL,
NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id,
list, search, lookup_form, column_name, input_text, statustext, size, datatype,
attrib_sort, precision_, scale, default_value, nullable) VALUES (4, 1, 1, NULL,
'phpgw_account_id', 'Mapped User', 'Mapped User', NULL, 'user', 4, 4, NULL,
NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id,
list, search, lookup_form, column_name, input_text, statustext, size, datatype,
attrib_sort, precision_, scale, default_value, nullable) VALUES (5, 1, 1, NULL,
'account_lid', 'User Name', 'User name for login', NULL, 'V', 5, 25, NULL,
NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id,
list, search, lookup_form, column_name, input_text, statustext, size, datatype,
attrib_sort, precision_, scale, default_value, nullable) VALUES (6, 1, 1, NULL,
'account_pwd', 'Password', 'Users Password', NULL, 'pwd', 6, 32, NULL, NULL,
'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id,
list, search, lookup_form, column_name, input_text, statustext, size, datatype,
attrib_sort, precision_, scale, default_value, nullable) VALUES (7, 1, 1, NULL,
'account_status', 'account status', 'account status', NULL, 'LB', 7, NULL,
NULL, NULL, 'True')");
+
+#
+# Dumping data for table fm_tenant_choice
+#
+
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_choice
(attrib_id, id, value) VALUES (7, 1, 'Active')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_choice
(attrib_id, id, value) VALUES (7, 2, 'Banned')");
#
# Dumping data for table fm_tenant
Index: setup/setup.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/setup.inc.php,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- setup/setup.inc.php 29 Oct 2006 20:04:40 -0000 1.51
+++ setup/setup.inc.php 31 Oct 2006 14:14:05 -0000 1.52
@@ -8,12 +8,12 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage setup
- * @version $Id: setup.inc.php,v 1.51 2006/10/29 20:04:40 sigurdne Exp $
+ * @version $Id: setup.inc.php,v 1.52 2006/10/31 14:14:05 sigurdne Exp $
*/
$setup_info['property']['name'] = 'property';
$setup_info['property']['title'] = 'Property';
- $setup_info['property']['version'] = '0.9.17.530';
+ $setup_info['property']['version'] = '0.9.17.531';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
Index: setup/tables_current.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/tables_current.inc.php,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- setup/tables_current.inc.php 29 Oct 2006 20:04:40 -0000 1.69
+++ setup/tables_current.inc.php 31 Oct 2006 14:14:05 -0000 1.70
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage setup
- * @version $Id: tables_current.inc.php,v 1.69 2006/10/29 20:04:40
sigurdne Exp $
+ * @version $Id: tables_current.inc.php,v 1.70 2006/10/31 14:14:05
sigurdne Exp $
*/
$phpgw_baseline = array(
@@ -65,10 +65,10 @@
'last_name' => array('type' =>
'varchar','precision' => '30','nullable' => True),
'contact_phone' => array('type' =>
'varchar','precision' => '20','nullable' => True),
'category' => array('type' => 'int','precision'
=> '4','nullable' => True),
- 'phpgw_account_lid' => array('type' =>
'varchar','precision' => '25','nullable' => True),
+ 'phpgw_account_id' => array('type' =>
'int','precision' => '4','nullable' => True),
'account_lid' => array('type' =>
'varchar','precision' => '25','nullable' => True),
'account_pwd' => array('type' =>
'varchar','precision' => '32','nullable' => True),
- 'account_status' => array('type' =>
'char','precision' => '1','nullable' => True,'default' => 'A')
+ 'account_status' => array('type' =>
'int','precision' => '4','nullable' => True,'default' => '1')
),
'pk' => array('id'),
'fk' => array(),
Index: setup/tables_update.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/tables_update.inc.php,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- setup/tables_update.inc.php 29 Oct 2006 20:04:40 -0000 1.57
+++ setup/tables_update.inc.php 31 Oct 2006 14:14:05 -0000 1.58
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage setup
- * @version $Id: tables_update.inc.php,v 1.57 2006/10/29 20:04:40
sigurdne Exp $
+ * @version $Id: tables_update.inc.php,v 1.58 2006/10/31 14:14:05
sigurdne Exp $
*/
/**
@@ -1246,8 +1246,6 @@
}
-
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_b_account',null,'grouping');
-
$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.518';
return $GLOBALS['setup_info']['property']['currentver'];
@@ -1540,3 +1538,87 @@
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.530';
return $GLOBALS['setup_info']['property']['currentver'];
}
\ No newline at end of file
+
+ /**
+ * Update property version from 0.9.17.530 to 0.9.17.531
+ */
+
+ $test[] = '0.9.17.530';
+ function property_upgrade0_9_17_530()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $fm_tenant = array(
+ 'fd' => array(
+ 'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
+ 'member_of' => array('type' =>
'varchar','precision' => '255','nullable' => True),
+ 'entry_date' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'first_name' => array('type' =>
'varchar','precision' => '30','nullable' => True),
+ 'last_name' => array('type' =>
'varchar','precision' => '30','nullable' => True),
+ 'contact_phone' => array('type' =>
'varchar','precision' => '20','nullable' => True),
+ 'category' => array('type' => 'int','precision'
=> '4','nullable' => True),
+ 'phpgw_account_id' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'account_lid' => array('type' =>
'varchar','precision' => '25','nullable' => True),
+ 'account_pwd' => array('type' =>
'varchar','precision' => '32','nullable' => True),
+ 'account_status' => array('type' =>
'char','precision' => '1','nullable' => True,'default' => 'A')
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ );
+
+ $fm_tenant2 = array(
+ 'fd' => array(
+ 'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
+ 'member_of' => array('type' =>
'varchar','precision' => '255','nullable' => True),
+ 'entry_date' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'first_name' => array('type' =>
'varchar','precision' => '30','nullable' => True),
+ 'last_name' => array('type' =>
'varchar','precision' => '30','nullable' => True),
+ 'contact_phone' => array('type' =>
'varchar','precision' => '20','nullable' => True),
+ 'category' => array('type' => 'int','precision'
=> '4','nullable' => True),
+ 'phpgw_account_id' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'account_lid' => array('type' =>
'varchar','precision' => '25','nullable' => True),
+ 'account_pwd' => array('type' =>
'varchar','precision' => '32','nullable' => True),
+ 'account_status' => array('type' =>
'int','precision' => '4','nullable' => True,'default' => '1')
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ );
+
+
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_tenant',$fm_tenant,'phpgw_account_lid');
+
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_tenant',$fm_tenant2,'account_status');
+ unset($fm_tenant);
+ unset($fm_tenant2);
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tenant','phpgw_account_id',
array('type' => 'int','precision' => '4','nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tenant','account_status',
array('type' => 'int','precision' => '4','nullable' => True,'default' => '1'));
+
+ $GLOBALS['phpgw_setup']->oProc->query("SELECT max(id) as id,
max(attrib_sort) as attrib_sort FROM fm_tenant_attribute");
+
+ $GLOBALS['phpgw_setup']->oProc->next_record();
+ $id = $GLOBALS['phpgw_setup']->oProc->f('id') + 1;
+ $attrib_sort = $GLOBALS['phpgw_setup']->oProc->f('attrib_sort')
+1;
+
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_tenant_attribute (id, list, search, lookup_form, column_name, input_text,
statustext, size, datatype, attrib_sort, precision_, scale, default_value,
nullable) VALUES ($id, 1, 1, NULL, 'phpgw_account_id', 'Mapped User', 'Mapped
User', NULL, 'user', $attrib_sort, 4, NULL, NULL, 'True')");
+ $id++;
+ $attrib_sort++;
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_tenant_attribute (id, list, search, lookup_form, column_name, input_text,
statustext, size, datatype, attrib_sort, precision_, scale, default_value,
nullable) VALUES ($id, 1, 1, NULL, 'account_lid', 'User Name', 'User name for
login', NULL, 'V', $attrib_sort, 25, NULL, NULL, 'True')");
+ $id++;
+ $attrib_sort++;
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_tenant_attribute (id, list, search, lookup_form, column_name, input_text,
statustext, size, datatype, attrib_sort, precision_, scale, default_value,
nullable) VALUES ($id, 1, 1, NULL, 'account_pwd', 'Password', 'Users Password',
NULL, 'pwd', $attrib_sort, 32, NULL, NULL, 'True')");
+ $id++;
+ $attrib_sort++;
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_tenant_attribute (id, list, search, lookup_form, column_name, input_text,
statustext, size, datatype, attrib_sort, precision_, scale, default_value,
nullable) VALUES ($id, 1, 1, NULL, 'account_status', 'account status', 'account
status', NULL, 'LB', $attrib_sort, NULL, NULL, NULL, 'True')");
+
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_tenant_choice (attrib_id, id, value) VALUES ($id, 1, 'Active')");
+ $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_tenant_choice (attrib_id, id, value) VALUES ($id, 2, 'Banned')");
+ unset($id);
+ unset($attrib_sort);
+
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.531';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
Index: templates/base/attributes_form.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/attributes_form.xsl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- templates/base/attributes_form.xsl 31 Oct 2006 09:50:56 -0000 1.8
+++ templates/base/attributes_form.xsl 31 Oct 2006 14:14:05 -0000 1.9
@@ -1,4 +1,4 @@
-<!-- $Id: attributes_form.xsl,v 1.8 2006/10/31 09:50:56 sigurdne Exp $ -->
+<!-- $Id: attributes_form.xsl,v 1.9 2006/10/31 14:14:05 sigurdne Exp $ -->
<xsl:template name="attributes_form">
<xsl:apply-templates select="attributes_values"/>
@@ -155,6 +155,38 @@
</xsl:attribute>
</input>
</xsl:when>
+ <xsl:when
test="datatype='user'">
+
<xsl:variable name="user_name"><xsl:value-of
select="name"/><xsl:text>_user_name</xsl:text></xsl:variable>
+
<xsl:variable name="lookup_function"><xsl:text>lookup_</xsl:text><xsl:value-of
select="name"/><xsl:text>();</xsl:text></xsl:variable>
+ <input
type="text" name="{name}" value="{value}" onClick="{$lookup_function}"
readonly="readonly" size="6" onMouseout="window.status='';return true;" >
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+
<xsl:attribute name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+
<xsl:value-of select="statustext"/>
+
<xsl:text>'; return true;</xsl:text>
+
</xsl:attribute>
+ </input>
+ <input
size="30" type="text" name="{$user_name}" value="{user_name}"
onClick="{$lookup_function}" readonly="readonly">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+
<xsl:attribute name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+
<xsl:value-of select="statustext"/>
+
<xsl:text>'; return true;</xsl:text>
+
</xsl:attribute>
+ </input>
+ </xsl:when>
<xsl:when
test="datatype='D'">
<input
type="text" name="values_attribute[{counter}][value]" value="{value}"
onFocus="{//dateformat_validate}" onKeyUp="{//onKeyUp}" onBlur="{//onBlur}"
size="12" maxlength="10" onMouseout="window.status='';return true;" >
<xsl:choose>
Index: templates/base/lookup.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/lookup.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- templates/base/lookup.xsl 17 Jan 2005 10:03:18 -0000 1.1
+++ templates/base/lookup.xsl 31 Oct 2006 14:14:05 -0000 1.2
@@ -1,4 +1,4 @@
-<!-- $Id: lookup.xsl,v 1.1 2005/01/17 10:03:18 sigurdne Exp $ -->
+<!-- $Id: lookup.xsl,v 1.2 2006/10/31 14:14:05 sigurdne Exp $ -->
<xsl:template name="app_data">
<xsl:choose>
@@ -20,6 +20,9 @@
<xsl:when test="list_vendor">
<xsl:apply-templates select="list_vendor"/>
</xsl:when>
+ <xsl:when test="list_phpgw_user">
+ <xsl:apply-templates select="list_phpgw_user"/>
+ </xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="list_contact"/>
</xsl:otherwise>
@@ -783,3 +786,112 @@
</tr>
</table>
</xsl:template>
+
+
+<!-- list phpgw_user-->
+
+ <xsl:template match="list_phpgw_user">
+ <script LANGUAGE="JavaScript">
+ function Exchangephpgw_user(thisform)
+ {
+ opener.document.form.<xsl:value-of
select="user_id"/>.value = thisform.elements[0].value;
+ opener.document.form.<xsl:value-of
select="user_name"/>.value = thisform.elements[1].value;
+ window.close()
+ }
+ </script>
+
+
+ <table width="100%" cellpadding="2" cellspacing="2"
align="center">
+ <tr>
+ <td align="right">
+ <xsl:call-template name="search_field"/>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" width="100%">
+ <xsl:call-template name="nextmatchs"/>
+ </td>
+ </tr>
+ </table>
+ <table width="100%" cellpadding="2" cellspacing="2"
align="center">
+ <xsl:apply-templates
select="table_header_phpgw_user"/>
+ <xsl:apply-templates
select="values_phpgw_user"/>
+
+ <tr>
+ <td colspan="3" width="100%">
+ <xsl:call-template name="nextmatchs"/>
+ </td>
+ </tr>
+ </table>
+ <xsl:apply-templates select="table_done"/>
+
+ </xsl:template>
+
+ <xsl:template match="table_header_phpgw_user">
+ <xsl:variable name="sort_id"><xsl:value-of
select="sort_id"/></xsl:variable>
+ <xsl:variable name="sort_last_name"><xsl:value-of
select="sort_last_name"/></xsl:variable>
+ <xsl:variable name="sort_first_name"><xsl:value-of
select="sort_first_name"/></xsl:variable>
+ <tr class="th">
+ <td class="th_text" width="5%" align="right">
+ <a href="{$sort_id}"><xsl:value-of
select="lang_id"/></a>
+ </td>
+ <td class="th_text" width="40%" align="right">
+ <a
href="{$sort_first_name}"><xsl:value-of select="lang_first_name"/></a>
+ </td>
+ <td class="th_text" width="40%" align="right">
+ <a
href="{$sort_last_name}"><xsl:value-of select="lang_last_name"/></a>
+ </td>
+ <td class="th_text" width="5%">
+ <xsl:value-of select="lang_select"/>
+ </td>
+ </tr>
+ </xsl:template>
+
+
+ <xsl:template match="values_phpgw_user">
+ <xsl:variable name="lang_select_statustext"><xsl:value-of
select="lang_select_statustext"/></xsl:variable>
+ <xsl:variable name="full_name"><xsl:value-of
select="first_name"/><xsl:text> </xsl:text><xsl:value-of
select="last_name"/></xsl:variable>
+ <tr>
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="@class">
+ <xsl:value-of
select="@class"/>
+ </xsl:when>
+ <xsl:when test="position() mod
2 = 0">
+
<xsl:text>row_off</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>row_on</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <td class="small_text" align="right">
+ <xsl:value-of select="id"/>
+ </td>
+ <td class="small_text" align="right">
+ <xsl:value-of select="first_name"/>
+ </td>
+ <td class="small_text" align="right">
+ <xsl:value-of select="last_name"/>
+ </td>
+ <xsl:choose>
+ <xsl:when test="id">
+ <form>
+ <td class="small_text"
valign="top">
+ <input
type="hidden" name="hidden" value="{id}"></input>
+ <input
type="hidden" name="hidden" value="{$full_name}"></input>
+ <xsl:variable
name="lang_select"><xsl:value-of select="lang_select"/></xsl:variable>
+ <input
type="button" name="convert" value="{$lang_select}"
onClick="Exchangephpgw_user(this.form);" onMouseout="window.status='';return
true;">
+
<xsl:attribute name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+
<xsl:value-of select="lang_select_statustext"/>
+
<xsl:text>'; return true;</xsl:text>
+
</xsl:attribute>
+ </input>
+ </td>
+ </form>
+ </xsl:when>
+ </xsl:choose>
+ </tr>
+ </xsl:template>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property login.php inc/class.boactor.inc.php in...,
Sigurd Nes <=