# Copyright (c) 2008 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: CRMThreadList.pm,v 1.2 2008/07/15 21:27:08 dobbs Exp $ package Bivio::Biz::Model::CRMThreadList; use strict; use Bivio::Base 'Model.MailThreadList'; our($VERSION) = sprintf('%d.%02d', q$Revision: 1.2 $ =~ /\d+/g); sub PROPERTY_CLASS { return 'CRMThread'; } sub get_crm_thread_num { return _model(shift)->get('crm_thread_num'); } sub get_crm_thread_status { return _model(shift)->get('crm_thread_status'); } sub get_subject { return _model(shift)->get('subject'); } sub internal_initialize { my($self) = @_; return $self->merge_initialize_info($self->SUPER::internal_initialize, { version => 1, parent_id => 'CRMThread.crm_thread_num', other => [ ['RealmMail.thread_root_id', 'CRMThread.thread_root_id'], [qw(RealmMail.realm_id CRMThread.realm_id)], ], }); } sub _model { my($self) = @_; return $self->req->unsafe_get('Model.CRMThread') || ($self->has_cursor ? $self : $self->set_cursor_or_die(0)) ->get_model('CRMThread'); } 1;