[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: cdb/inc class.cdb_contact_personal.inc.php,1.2,1
From: |
Patrick Walsh <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: cdb/inc class.cdb_contact_personal.inc.php,1.2,1.3 |
Date: |
Wed, 13 Feb 2002 18:37:28 -0500 |
Update of /cvsroot/phpgroupware/cdb/inc
In directory subversions:/tmp/cvs-serv6473
Modified Files:
class.cdb_contact_personal.inc.php
Log Message:
Converted to new format
Index: class.cdb_contact_personal.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/cdb/inc/class.cdb_contact_personal.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.cdb_contact_personal.inc.php 11 Nov 2001 16:04:09 -0000 1.2
--- class.cdb_contact_personal.inc.php 13 Feb 2002 23:37:25 -0000 1.3
***************
*** 24,37 ****
/* add vars that have get/let interface to this array.
*/
$this->_ = array(
! 'birthday' => '',
'children' => ''
! 'gender' => '',
! 'gov_id' => '',
'hobbies' => '',
! 'language' => '',
! 'language_id' => '',
! 'language_data' => '',
'spouse' => '',
! 'anniversary' => ''
);
}
--- 24,36 ----
/* add vars that have get/let interface to this array.
*/
$this->_ = array(
! 'birthday' => 0,
'children' => ''
! // one of "unspecified", "male", or "female"
! 'gender' => 'unspecified',
! 'gov_id_num' => '',
'hobbies' => '',
! 'language' => 0,
'spouse' => '',
! 'anniversary' => 0
);
}
***************
*** 39,63 ****
function get_birthday()
{
! return $this->get('birthday');
}
function let_birthday($new_birthday)
{
! return $this->let('birthday', $new_birthday);
}
function get_children()
{
! return $this->get('children');
}
function let_children($new_children)
{
! return $this->let('children', $new_children);
}
function get_gender()
{
! return $this->get('gender');
#returns 'unspecified'|'male'|'female'
}
--- 38,62 ----
function get_birthday()
{
! return $this->_get('birthday');
}
function let_birthday($new_birthday)
{
! return $this->_let('birthday', $new_birthday);
}
function get_children()
{
! return $this->_get('children');
}
function let_children($new_children)
{
! return $this->_let('children', $new_children);
}
function get_gender()
{
! return $this->_get('gender');
#returns 'unspecified'|'male'|'female'
}
***************
*** 65,195 ****
function let_gender($new_gender)
{
! return $this->let('gender', $new_gender);
}
function get_gov_id()
{
! return $this->get('gov_id');
}
function let_gov_id($new_gov_id)
{
! return $this->let('gov_id', $new_gov_id);
}
function get_hobbies()
{
! return $this->get('hobbies');
}
function let_hobbies($new_hobbies)
{
! return $this->let('hobbies', $new_hobbies);
}
function get_language()
{
! return $this->get('language');
}
function let_language($new_language)
{
! return $this->let('language', $new_language);
! }
!
! function get_language_id()
! {
! return $this->get('language_id');
! #returns int
! }
!
! function let_language_id($new_language_id)
! {
! return $this->let('language_id', $new_language_id);
! }
!
! function get_language_data()
! {
! return $this->get('language_data');
! return languages.class;
}
function get_spouse()
{
! return $this->get('spouse');
}
function let_spouse($new_spouse)
{
! return $this->let('spouse', $new_spouse);
}
function get_anniversary()
{
! return $this->get('anniversary');
}
function let_anniversary($new_anniversary)
{
! return $this->let('anniversary', $new_anniversary);
}
function save()
{
- $mySuccess = FALSE;
-
- if($this->id() && $this->exists($this->id()))
- {
- $query = "UPDATE pgw_cdb_contact_personal SET ".
-
"birthday='".$this->get('birthday')."',".
-
"children='".$this->get('children')."',".
- "gender='".$this->get('gender')."',".
-
"gov_id_num='".$this->get('gov_id_num')."',".
- "hobbies='".$this->get('hobbies')."',".
-
"language='".$this->get('language')."',".
- "spouse='".$this->get('spouse')."',".
-
"anniversary='".$this->get('anniversary')."' ".
- "WHERE contact_id=".$this->id();
-
- $cdb = $GLOBALS['phpgw']->db;
- $cdb->query($query);
- $mySuccess = TRUE;
- }
- return $mySuccess;
}
function load($intID)
{
- $query = "SELECT * FROM pgw_cdb_contact_personal WHERE
contact_id='$intID'";
- $cdb = $GLOBALS['phpgw']->db;
- $cdb->query($query);
- $cdb->next_record();
-
- $personal['birthday'] = $cdb->f('birthday');
- $personal['children'] = $cdb->f('children');
- $personal['gender'] = $cdb->f('gender');
- $personal['gov_id_num'] = $cdb->f('gov_id_num');
- $personal['hobbies'] = $cdb->f('hobbies');
- $personal['language'] = $cdb->f('language');
- $personal['spouse'] = $cdb->f('spouse');
- $personal['anniversary'] = $cdb->f('anniversary');
-
- return $personal;
- }
-
- function delete()
- {
- /* NOTE: I assume someone with write access
(can_write($intID) evaluates */
- /* to TRUE, has delete access as well */
- $mySuccess = FALSE;
- if($this->can_write($this->_id)) // check for write
permission
- {
- if($this->meta->let_status("delete")) // try to
set status to 'delete'
- {
- $mySuccess = TRUE; // report TRUE on
success
- }
- }
- return $mySuccess;
}
}
?>
--- 64,137 ----
function let_gender($new_gender)
{
! switch($new_gender)
! {
! case 'unspecified':
! case 'male':
! case 'female':
! return $this->_let('gender',
$new_gender);
! break;
! case default:
! return FALSE;
! }
}
function get_gov_id()
{
! return $this->_get('gov_id_num');
}
function let_gov_id($new_gov_id)
{
! return $this->_let('gov_id_num', $new_gov_id);
}
function get_hobbies()
{
! return $this->_get('hobbies');
}
function let_hobbies($new_hobbies)
{
! return $this->_let('hobbies', $new_hobbies);
}
function get_language()
{
! return $this->_get('language');
}
function let_language($new_language)
{
! return $this->_let('language', $new_language);
}
function get_spouse()
{
! return $this->_get('spouse');
}
function let_spouse($new_spouse)
{
! return $this->_let('spouse', $new_spouse);
}
function get_anniversary()
{
! return $this->_get('anniversary');
}
function let_anniversary($new_anniversary)
{
! return $this->_let('anniversary', $new_anniversary);
}
function save()
{
}
function load($intID)
{
}
+
}
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: cdb/inc class.cdb_contact_personal.inc.php,1.2,1.3,
Patrick Walsh <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: cdb/inc class.cdb_contact.inc.php,1.3,1.4 class.cdb_contact_phone.inc.php,1.1,1.2 class.cdb_entity_meta.inc.php,1.1,1.2 class.cdb_generic.inc.php,1.1,1.2 class.cdb_phone.inc.php,1.1,1.2 class.cdb_template.inc.php,1.1,1.2 admin.inc.php,1.1.1.1,NONE functions.inc.php,1.4,NONE generic.class.php,1.3,NONE preferences.inc.php,1.1.1.1,NONE
- Next by Date:
[Phpgroupware-cvs] CVS: wcm/inc class.boelement.inc.php,1.3,1.4 class.bopage.inc.php,1.2,1.3 class.bosite.inc.php,1.2,1.3 class.soelement.inc.php,1.7,1.8 class.sopage.inc.php,1.7,1.8 class.uielement.inc.php,1.5,1.6 class.uipage.inc.php,1.8,1.9 class.uisite.inc.php,1.3,1.4
- Previous by thread:
[Phpgroupware-cvs] CVS: cdb/inc class.cdb_contact.inc.php,1.3,1.4 class.cdb_contact_phone.inc.php,1.1,1.2 class.cdb_entity_meta.inc.php,1.1,1.2 class.cdb_generic.inc.php,1.1,1.2 class.cdb_phone.inc.php,1.1,1.2 class.cdb_template.inc.php,1.1,1.2 admin.inc.php,1.1.1.1,NONE functions.inc.php,1.4,NONE generic.class.php,1.3,NONE preferences.inc.php,1.1.1.1,NONE
- Next by thread:
[Phpgroupware-cvs] CVS: wcm/inc class.boelement.inc.php,1.3,1.4 class.bopage.inc.php,1.2,1.3 class.bosite.inc.php,1.2,1.3 class.soelement.inc.php,1.7,1.8 class.sopage.inc.php,1.7,1.8 class.uielement.inc.php,1.5,1.6 class.uipage.inc.php,1.8,1.9 class.uisite.inc.php,1.3,1.4
- Index(es):