[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/class.soadmin.php, 1.1.1.3
From: |
nomail |
Subject: |
[Phpgroupware-cvs] property/class.soadmin.php, 1.1.1.3 |
Date: |
Sun, 23 May 2004 09:30:40 -0000 |
Update of /property
Modified Files:
Branch:
class.soadmin.php
date: 2004/04/23 21:26:33; author: sigurdne; state: Exp; lines: +108 -108
Log Message:
no message
=====================================================================
Index: property/class.soadmin.php
diff -u property/class.soadmin.php:1.1.1.2 property/class.soadmin.php:1.1.1.3
--- property/class.soadmin.php:1.1.1.2 Fri Apr 23 20:25:34 2004
+++ property/class.soadmin.php Fri Apr 23 21:26:33 2004
@@ -1,108 +1,108 @@
-<?php
-
/**************************************************************************\
- * phpGroupWare - property
*
- * http://www.phpgroupware.org
*
- *
*
- * Facilities Management
*
- * Written by Sigurd Nes [sigurdne at online.no]
*
- *
------------------------------------------------------------------------ *
- * Copyright 2000 - 2003 Free Software Foundation, Inc
*
- * This program is part of the GNU project, see http://www.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.
*
-
\**************************************************************************/
-
- class property_soadmin
- {
- function property_soadmin()
- {
- $this->currentapp = 'property';
//$GLOBALS['phpgw_info']['flags']['currentapp'];
- $this->account = $GLOBALS['phpgw_data']['user']['id'];
- $this->socommon =
CreateObject($this->currentapp.'_socommon');
- $this->join = $this->socommon->join;
- }
-
-
- function get_initials($id)
- {
- $dbresult = $GLOBALS['phpgw']->db->Execute("SELECT
initials FROM fm_ecouser WHERE id=$id ");
- return $dbresult->fields['initials'];
- }
-
- function set_initials($initials)
- {
- while (is_array($initials) && list($account_id,$value)
= each($initials))
- {
- $GLOBALS['phpgw']->db->Execute("UPDATE
fm_ecouser set initials= '$value' WHERE id=$account_id ");
- if($value)
- {
- if(!$this->get_initials($account_id))
- {
- $account_lid =
strtoupper($GLOBALS['phpgw']->accounts->id2name($account_id));
-
$GLOBALS['phpgw']->db->Execute("INSERT INTO fm_ecouser (id,lid,initials) VALUES
($account_id,'$account_lid','$value' )");
- }
- }
- }
- }
-
- function select_location($grant='')
- {
- if($grant)
- {
- $filter = ' WHERE allow_grant=1';
- }
- $dbresult = $GLOBALS['phpgw']->db->Execute("SELECT *
FROM fm_acl_location $filter ORDER BY id ");
-
- $i = 0;
- while (!$dbresult->EOF)
- {
- $location[$i]['id']
= $dbresult->fields['id'];
- $location[$i]['descr']
= stripslashes($dbresult->fields['descr']);
- $i++;
- $dbresult->MoveNext();
- }
-
- return $location;
- }
-
-
- function read_fm_id()
- {
- $sql = "select * from fm_idgenerator ";
- $dbresult = $GLOBALS['phpgw']->db->Execute($sql);
-
- while (!$dbresult->EOF)
- {
- $fm_ids[] = array(
- 'descr' =>
$dbresult->fields['name'],
- 'value' =>
$dbresult->fields['value'],
- 'remark' =>
$dbresult->fields['remark']
- );
-
- $dbresult->MoveNext();
- }
-
- return $fm_ids;
- }
-
- function edit_id($values='')
- {
- $field=$values['field'];
- $select=$values['select'];
-
- while($entry=each($select))
- {
- $n=$entry[0];
-
- $sql = "update fm_idgenerator set
value='$values[$n]' where name='$field[$n]'";
- $GLOBALS['phpgw']->db->Execute($sql);
- }
-
- $receipt['message'][] = array('msg' => lang('ID is
updated'));
- return $receipt;
- }
- }
-?>
+<?php
+
/**************************************************************************\
+ * phpGroupWare - property
*
+ * http://www.phpgroupware.org
*
+ *
*
+ * Facilities Management
*
+ * Written by Sigurd Nes [sigurdne at online.no]
*
+ *
------------------------------------------------------------------------ *
+ * Copyright 2000 - 2003 Free Software Foundation, Inc
*
+ * This program is part of the GNU project, see http://www.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.
*
+
\**************************************************************************/
+
+ class property_soadmin
+ {
+ function property_soadmin()
+ {
+ $this->currentapp = 'property';
//$GLOBALS['phpgw_info']['flags']['currentapp'];
+ $this->account = $GLOBALS['phpgw_data']['user']['id'];
+ $this->socommon =
CreateObject($this->currentapp.'_socommon');
+ $this->join = $this->socommon->join;
+ }
+
+
+ function get_initials($id)
+ {
+ $dbresult = $GLOBALS['phpgw']->db->Execute("SELECT
initials FROM fm_ecouser WHERE id=$id ");
+ return $dbresult->fields['initials'];
+ }
+
+ function set_initials($initials)
+ {
+ while (is_array($initials) && list($account_id,$value)
= each($initials))
+ {
+ $GLOBALS['phpgw']->db->Execute("UPDATE
fm_ecouser set initials= '$value' WHERE id=$account_id ");
+ if($value)
+ {
+ if(!$this->get_initials($account_id))
+ {
+ $account_lid =
strtoupper($GLOBALS['phpgw']->accounts->id2name($account_id));
+
$GLOBALS['phpgw']->db->Execute("INSERT INTO fm_ecouser (id,lid,initials) VALUES
($account_id,'$account_lid','$value' )");
+ }
+ }
+ }
+ }
+
+ function select_location($grant='')
+ {
+ if($grant)
+ {
+ $filter = ' WHERE allow_grant=1';
+ }
+ $dbresult = $GLOBALS['phpgw']->db->Execute("SELECT *
FROM fm_acl_location $filter ORDER BY id ");
+
+ $i = 0;
+ while (!$dbresult->EOF)
+ {
+ $location[$i]['id']
= $dbresult->fields['id'];
+ $location[$i]['descr']
= stripslashes($dbresult->fields['descr']);
+ $i++;
+ $dbresult->MoveNext();
+ }
+
+ return $location;
+ }
+
+
+ function read_fm_id()
+ {
+ $sql = "select * from fm_idgenerator ";
+ $dbresult = $GLOBALS['phpgw']->db->Execute($sql);
+
+ while (!$dbresult->EOF)
+ {
+ $fm_ids[] = array(
+ 'descr' =>
$dbresult->fields['name'],
+ 'value' =>
$dbresult->fields['value'],
+ 'remark' =>
$dbresult->fields['remark']
+ );
+
+ $dbresult->MoveNext();
+ }
+
+ return $fm_ids;
+ }
+
+ function edit_id($values='')
+ {
+ $field=$values['field'];
+ $select=$values['select'];
+
+ while($entry=each($select))
+ {
+ $n=$entry[0];
+
+ $sql = "update fm_idgenerator set
value='$values[$n]' where name='$field[$n]'";
+ $GLOBALS['phpgw']->db->Execute($sql);
+ }
+
+ $receipt['message'][] = array('msg' => lang('ID is
updated'));
+ return $receipt;
+ }
+ }
+?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/class.soadmin.php, 1.1.1.3,
nomail <=