diff --git a/addressbook/inc/class.addressbook_egw_record.inc.php b/addressbook/inc/class.addressbook_egw_record.inc.php index dd945393ce..ab153c19c9 100644 --- a/addressbook/inc/class.addressbook_egw_record.inc.php +++ b/addressbook/inc/class.addressbook_egw_record.inc.php @@ -8,7 +8,7 @@ * @link http://www.egroupware.org * @author Cornelius Weiss * @copyright Cornelius Weiss - * @version $Id: class.egw_addressbook_record.inc.php 22827 2006-11-10 15:35:35Z nelius_weiss $ + * @version $Id$ */ /** @@ -105,6 +105,21 @@ class addressbook_egw_record implements importexport_iface_egw_record return $this->identifier ? $this->identifier : $this->id; } + /** + * Gets the URL icon representitive of the record + * This could be as general as the application icon, or as specific as a contact photo + * + * @return string Full URL of an icon, or appname/icon_name + */ + public function get_icon() { + $ui = new addressbook_ui(); + + // Type as default + $ui->type_icon($this->owner, $this->private, $this->tid, $icon, $label); + + // Specific photo + return $this->jpegphoto ? egw_framework::link('/index.php',$ui->photo_src($this->identifier,$this->jpegphoto)):'addressbook/'.$icon; + } /** * saves record into backend * diff --git a/admin/inc/class.admin_egw_group_record.inc.php b/admin/inc/class.admin_egw_group_record.inc.php index 11d900c5ae..0f876d0e8c 100644 --- a/admin/inc/class.admin_egw_group_record.inc.php +++ b/admin/inc/class.admin_egw_group_record.inc.php @@ -104,6 +104,16 @@ class admin_egw_group_record implements importexport_iface_egw_record return $this->identifier; } + /** + * Gets the URL icon representitive of the record + * This could be as general as the application icon, or as specific as a contact photo + * + * @return string Full URL of an icon, or appname/icon_name + */ + public function get_icon() { + return 'group'; + } + /** * saves record into backend * diff --git a/admin/inc/class.admin_egw_user_record.inc.php b/admin/inc/class.admin_egw_user_record.inc.php index 722165a09b..b0aea82597 100644 --- a/admin/inc/class.admin_egw_user_record.inc.php +++ b/admin/inc/class.admin_egw_user_record.inc.php @@ -105,6 +105,16 @@ class admin_egw_user_record implements importexport_iface_egw_record return $this->identifier; } + /** + * Gets the URL icon representitive of the record + * This could be as general as the application icon, or as specific as a contact photo + * + * @return string Full URL of an icon, or appname/icon_name + */ + public function get_icon() { + return 'user'; + } + /** * saves record into backend * diff --git a/calendar/inc/class.calendar_egw_record.inc.php b/calendar/inc/class.calendar_egw_record.inc.php index 334ea21a58..dd23f6d864 100644 --- a/calendar/inc/class.calendar_egw_record.inc.php +++ b/calendar/inc/class.calendar_egw_record.inc.php @@ -108,6 +108,16 @@ class calendar_egw_record implements importexport_iface_egw_record return $this->identifier; } + /** + * Gets the URL icon representitive of the record + * This could be as general as the application icon, or as specific as a contact photo + * + * @return string Full URL of an icon, or appname/icon_name + */ + public function get_icon() { + return 'calendar/navbar'; + } + /** * saves record into backend * diff --git a/importexport/inc/class.importexport_definition.inc.php b/importexport/inc/class.importexport_definition.inc.php index a24a3e182e..2a83d444b8 100644 --- a/importexport/inc/class.importexport_definition.inc.php +++ b/importexport/inc/class.importexport_definition.inc.php @@ -257,6 +257,16 @@ class importexport_definition implements importexport_iface_egw_record { } + /** + * Gets the URL icon representitive of the record + * This could be as general as the application icon, or as specific as a contact photo + * + * @return string Full URL of an icon, or appname/icon_name + */ + public function get_icon() { + return self::_appname . '/navbar'; + } + /** * saves record into backend * diff --git a/importexport/inc/class.importexport_iface_egw_record.inc.php b/importexport/inc/class.importexport_iface_egw_record.inc.php index e246ac5edd..7b4b779953 100644 --- a/importexport/inc/class.importexport_iface_egw_record.inc.php +++ b/importexport/inc/class.importexport_iface_egw_record.inc.php @@ -14,11 +14,11 @@ * class importexport_iface_egw_record * This a the abstract interface of an egw record. * A record is e.g. a single address or or single event. - * The idea behind is that we can have metaoperation over differnt apps by + * The idea behind is that we can have metaoperation over differnt apps by * having a common interface. - * A record is identified by a identifier. As we are a Webapp and want to + * A record is identified by a identifier. As we are a Webapp and want to * deal with the objects in the browser, identifier should be a string! - * + * * @todo lots! of discussion with other developers * @todo move to api once developers accepted it! * @todo functions for capabilities of object @@ -51,7 +51,7 @@ interface importexport_iface_egw_record public function __set($_attribute_name, $data); /** - * converts this object to array. + * converts this object to array. * @abstract We need such a function cause PHP5 * dosn't allow objects do define it's own casts :-( * once PHP can deal with object casts we will change to them! @@ -62,7 +62,7 @@ interface importexport_iface_egw_record /** * gets title of record - * + * *@return string tiltle */ public function get_title(); @@ -80,11 +80,18 @@ interface importexport_iface_egw_record * @return string identifier of this record */ public function get_identifier(); - + + /** + * Gets the URL icon representitive of the record + * This could be as general as the application icon, or as specific as a contact photo + * + * @return string Full URL of an icon, or appname/icon_name + */ + public function get_icon(); /** * saves record into backend - * + * * @return string identifier */ public function save ( $_dst_identifier ); @@ -109,7 +116,7 @@ interface importexport_iface_egw_record /** * delets current record from backend * @return void - * + * */ public function delete (); diff --git a/infolog/inc/class.infolog_egw_record.inc.php b/infolog/inc/class.infolog_egw_record.inc.php index 2a95ef5edd..b8f77218d3 100644 --- a/infolog/inc/class.infolog_egw_record.inc.php +++ b/infolog/inc/class.infolog_egw_record.inc.php @@ -108,6 +108,26 @@ class infolog_egw_record implements importexport_iface_egw_record return $this->identifier; } + /** + * Gets the URL icon representitive of the record + * This could be as general as the application icon, or as specific as a contact photo + * + * @return string Full URL of an icon, or appname/icon_name + */ + public function get_icon() { + $icon = 'infolog/navbar'; + $ui = new infolog_ui(); + if (!($icon = $ui->icons['type'][$this->info_type])) + { + $icon = $ui->icons['status'][$this->info_status]; + } + if (!$icon) + { + $icon = 'navbar'; + } + return 'infolog/'.$icon; + } + /** * saves record into backend * diff --git a/resources/inc/class.resources_egw_record.inc.php b/resources/inc/class.resources_egw_record.inc.php index 1463ad9be5..00577529ea 100644 --- a/resources/inc/class.resources_egw_record.inc.php +++ b/resources/inc/class.resources_egw_record.inc.php @@ -103,6 +103,21 @@ class resources_egw_record implements importexport_iface_egw_record return $this->identifier; } + /** + * Gets the URL icon representitive of the record + * This could be as general as the application icon, or as specific as a contact photo + * + * @return string Full URL of an icon, or appname/icon_name + */ + public function get_icon() { + $bo = new resources_bo(); + if(!$icon = $bo->get_picture($this->identifier,$this->picture_src)) + { + $icon = 'resources/navbar'; + } + return $icon; + } + /** * saves record into backend * diff --git a/timesheet/inc/class.timesheet_egw_record.inc.php b/timesheet/inc/class.timesheet_egw_record.inc.php index d74233d44b..eaaa4ad21a 100644 --- a/timesheet/inc/class.timesheet_egw_record.inc.php +++ b/timesheet/inc/class.timesheet_egw_record.inc.php @@ -116,6 +116,16 @@ class timesheet_egw_record implements importexport_iface_egw_record return $this->identifier; } + /** + * Gets the URL icon representitive of the record + * This could be as general as the application icon, or as specific as a contact photo + * + * @return string Full URL of an icon, or appname/icon_name + */ + public function get_icon() { + return 'timesheet/navbar'; + } + /** * saves record into backend *