<?php
	class bocatalog_contact_addr_type
	{
		function bocatalog_contact_addr_type()
		{
			$this->so = CreateObject('addressbook.socatalog_contact_addr_type');
			$this->standard_contact_filed = array(
				'home'			=> lang('own house'),
				'work'			=> lang('work')
			);
		}
		
		function select_catalog()
		{
			$catalogs = $this->so->select_catalog();
			foreach ($catalogs as $idx => $val)
			{
				if (isset($this->standard_contact_filed[$val['addr_description']]))
				{
					$catalogs[$idx]['addr_description'] = $this->standard_contact_filed[$val['addr_description']];
					$catalogs[$idx]['not_'.lang('edit').'_mode'] = True;
					$catalogs[$idx]['not_'.lang('delete').'_mode'] = True;
				}							
			}
			return $catalogs;
		}
		
		function insert($fields)
		{
			return $this->so->insert($fields);
		}
		
		function delete($key)
		{
			return $this->so->delete($key);
		}
		
		function update($key, $fields)
		{
			$this->so->update($key, $fields);
		}

		function get_record($key)
		{
			return $this->so->get_record($key);
		}
	}
?>
