<?php
	class bocatalog_contact_comm_type
	{
		function bocatalog_contact_comm_type()
		{
			$this->so = CreateObject('addressbook.socatalog_contact_comm_type');
			$this->standard_contact_filed = array(
				'email'			=> lang('email'),
				'phone'			=> lang('phone'),
				'mobile phone'	=> lang('mobile phone'),
				'fax'			=> lang('fax'),
				'instant messaging'	=> lang('instant messaging'),
				'url'			=> lang('url'),
				'other'			=> lang('other')
			);
		}
		
		function select_catalog()
		{
			$catalogs = $this->so->select_catalog();
			foreach ($catalogs as $idx => $val)
			{
				if (isset($this->standard_contact_filed[$val['comm_type_description']]))
				{
					$catalogs[$idx]['comm_type_description'] = $this->standard_contact_filed[$val['comm_type_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);
		}
	}
?>
