[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: infolog/inc class.sbox2.inc.php,1.2,1.3 hook_cal
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: infolog/inc class.sbox2.inc.php,1.2,1.3 hook_calendar_view.inc.php,NONE,1.1 class.boinfolog.inc.php,1.16,1.17 class.soinfolog.inc.php,1.11,1.12 class.uiinfolog.inc.php,1.34,1.35 |
Date: |
Sun, 12 May 2002 03:13:12 -0400 |
Update of /cvsroot/phpgroupware/infolog/inc
In directory subversions:/tmp/cvs-serv27317
Modified Files:
class.boinfolog.inc.php class.soinfolog.inc.php
class.uiinfolog.inc.php
Added Files:
class.sbox2.inc.php hook_calendar_view.inc.php
Log Message:
enable infolog to associate entries to calendar-events
***** Error reading new file: [Errno 2] No such file or directory:
'hook_calendar_view.inc.php'
Index: class.boinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.boinfolog.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** class.boinfolog.inc.php 1 May 2002 17:16:27 -0000 1.16
--- class.boinfolog.inc.php 12 May 2002 07:13:09 -0000 1.17
***************
*** 112,115 ****
--- 112,119 ----
function addr2name( $addr )
{
+ if (!is_array($addr) && !($addr =
$this->readAddr($addr)))
+ {
+ return '';
+ }
$name = $addr['n_family'];
if ($addr['n_given'])
***************
*** 131,139 ****
}
function readProj($proj_id)
{
if ($proj_id)
{
! if (!is_object($this->projects))
{
$this->projects =
createobject('projects.boprojects');
--- 135,152 ----
}
+ function proj2name( $proj )
+ {
+ if (!is_array($proj))
+ {
+ $proj = $this->readProj($proj);
+ }
+ return is_array($proj) ? $proj['title'] : '';
+ }
+
function readProj($proj_id)
{
if ($proj_id)
{
! if (!is_object($this->projects) &&
file_exists(PHPGW_SERVER_ROOT.'/projects'))
{
$this->projects =
createobject('projects.boprojects');
***************
*** 163,166 ****
--- 176,216 ----
}
+ function event2name( $event )
+ {
+ if (!is_object($this->bocal) &&
file_exists(PHPGW_SERVER_ROOT.'/projects'))
+ {
+ $this->bocal =
createobject('calendar.bocalendar');
+ }
+ if (is_object($this->bocal) && !is_array($event) &&
(int) $event > 0)
+ {
+ $event = $this->bocal->read_entry($event);
+ }
+ if (!is_array($event))
+ {
+ return '';
+ }
+ $name =
$GLOBALS['phpgw']->common->show_date($this->bocal->maketime($event['start']) -
$this->bocal->datetime->tz_offset);
+ $name .= ' -- ' .
$GLOBALS['phpgw']->common->show_date($this->bocal->maketime($event['end']) -
$this->bocal->datetime->tz_offset);
+ $name .= ': ' . $event['title'];
+
+ return $GLOBALS['phpgw']->strip_html($name);
+ }
+
+ function readEvent($cal_id)
+ {
+ if ($cal_id)
+ {
+ if (!is_object($this->bocal) &&
file_exists(PHPGW_SERVER_ROOT.'/projects'))
+ {
+ $this->bocal =
createobject('calendar.bocalendar');
+ }
+ if (is_object($this->bocal) && $event =
$this->bocal->read_entry( $cal_id ))
+ {
+ return $event;
+ }
+ }
+ return False;
+ }
+
/*
* check's if user has the requiered rights on entry $info_id
***************
*** 210,214 ****
$values['owner'] = $this->so->user;
}
! $values['datecreated'] = time(); // is now
MODIFICATION-date
if (!$values['subject'])
--- 260,264 ----
$values['owner'] = $this->so->user;
}
! $values['datemodified'] = time();
if (!$values['subject'])
Index: class.soinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.soinfolog.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.soinfolog.inc.php 1 May 2002 17:16:27 -0000 1.11
--- class.soinfolog.inc.php 12 May 2002 07:13:09 -0000 1.12
***************
*** 242,246 ****
else
{
! $ordermethod = 'order by info_datecreated desc'; //
newest first
}
$filtermethod = $this->aclFilter($filter);
--- 242,246 ----
else
{
! $ordermethod = 'order by info_datemodified desc';
// newest first
}
$filtermethod = $this->aclFilter($filter);
***************
*** 258,261 ****
--- 258,263 ----
break;
case 'proj': $filtermethod .= " AND
info_proj_id=$action_id ";
+ break;
+ case 'event': $filtermethod .= " AND
info_event_id=$action_id ";
break;
}
Index: class.uiinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.uiinfolog.inc.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** class.uiinfolog.inc.php 1 May 2002 17:19:07 -0000 1.34
--- class.uiinfolog.inc.php 12 May 2002 07:13:09 -0000 1.35
***************
*** 113,119 ****
/*
* $info: info_id or array with one row form info-db
! * no Proj.Info if proj_id == p_id / no Addr.Info if addr_id ==
a_id
*/
! function formatInfo($info=0,$p_id=0,$a_id=0)
{
if (!is_array($info) && (!$info ||
--- 113,119 ----
/*
* $info: info_id or array with one row form info-db
! * no Proj.Info if action='proj' proj_id == action_id / no
Addr.Info if addr_id == a_id
*/
! function formatInfo($info=0,$action='',$action_id=0)
{
if (!is_array($info) && (!$info ||
***************
*** 128,132 ****
$subject = "<span class=$css_class>";
! if ($p_id != ($proj_id = $info['info_proj_id']) &&
$proj = $this->bo->readProj($proj_id))
{
--- 128,132 ----
$subject = "<span class=$css_class>";
! if (($action_id != ($proj_id = $info['info_proj_id'])
|| $action != 'proj') &&
$proj = $this->bo->readProj($proj_id))
{
***************
*** 136,140 ****
'action_id' => $proj_id )));
}
! if ($a_id != ($addr_id = $info['info_addr_id']) &&
$addr = $this->bo->readAddr($addr_id))
{
--- 136,140 ----
'action_id' => $proj_id )));
}
! if (($action_id != ($addr_id = $info['info_addr_id'])
|| $action != 'addr') &&
$addr = $this->bo->readAddr($addr_id))
{
***************
*** 142,162 ****
$addr = $this->bo->addr2name( $addr );
$subject .=
$this->html->bold($this->html->a_href($addr,'/index.php',
! array(
'menuaction' => 'addressbook.uiaddressbook.view',
!
'ab_id' => $addr_id)
! /*
$this->menuaction() + array( 'filter' => $filter,'action' => 'addr',
!
'action_id' => $addr_id )*/
));
}
if (($from = $info['info_from']) && (!$addr ||
!strstr($addr,$from)))
{
! if ($addr) $subject .= '<br>';
$subject .= '<b>'.$from.'</b>';
}
if ($info['info_addr'])
{
! if ($addr || $from) $subject .= ': ';
$subject .= $info['info_addr'];
}
! if ($proj || $addr || $from || $info['info_addr'])
{
$subject .= '<br>';
--- 142,186 ----
$addr = $this->bo->addr2name( $addr );
$subject .=
$this->html->bold($this->html->a_href($addr,'/index.php',
!
file_exists(PHPGW_SERVER_ROOT.'/addressbook') &&
!
$GLOBALS['phpgw_info']['user']['apps']['addressbook']['enabled'] ?
! array(
!
'menuaction' => 'addressbook.uiaddressbook.view',
!
'ab_id' => $addr_id
! ) :
$this->menuaction() + array(
!
'filter' => $filter,
!
'action' => 'addr',
!
'action_id' => $addr_id
! )
! ));
! }
! if (($action_id != ($event_id = $info['info_event_id'])
|| $action != 'event') &&
! $event = $this->bo->readEvent($event_id))
! {
! if ($proj || $addr) $subject .= '<br>';
! $event = $this->bo->event2name( $event );
! $subject .=
$this->html->bold($this->html->a_href($event,'/index.php',
!
file_exists(PHPGW_SERVER_ROOT.'/calendar') &&
!
$GLOBALS['phpgw_info']['user']['apps']['calendar']['enabled'] ?
! array(
!
'menuaction' => 'calendar.uicalendar.view',
!
'cal_id' => $event_id
! ) :
$this->menuaction() + array(
!
'filter' => $filter,
!
'action' => 'event',
!
'action_id' => $event_id
! )
));
}
if (($from = $info['info_from']) && (!$addr ||
!strstr($addr,$from)))
{
! if ($addr || $event) $subject .= '<br>';
$subject .= '<b>'.$from.'</b>';
}
if ($info['info_addr'])
{
! if ($addr || $from || $event) $subject .= ': ';
$subject .= $info['info_addr'];
}
! if ($proj || $addr || $from || $info['info_addr'] ||
$event)
{
$subject .= '<br>';
***************
*** 219,223 ****
'enddate' => $enddate,
'owner' => $owner,
! 'datecreated' =>
$GLOBALS['phpgw']->common->show_date($info['info_datecreated'],
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
'responsible' => $responsible,
--- 243,247 ----
'enddate' => $enddate,
'owner' => $owner,
! 'datemodified' =>
$GLOBALS['phpgw']->common->show_date($info['info_datemodified'],
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
'responsible' => $responsible,
***************
*** 238,242 ****
'enddate' => 'Enddate',
'owner' => 'Owner',
! 'datecreated' => 'last changed', // is
MODIFICATION date now
'responsible' => 'Responsible'
);
--- 262,266 ----
'enddate' => 'Enddate',
'owner' => 'Owner',
! 'datemodified' => 'last changed',
'responsible' => 'Responsible'
);
***************
*** 349,362 ****
$action_vars += array( 'id_project' =>
$action_id,
'proj_id' => $action_id);
- $proj = $this->bo->readProj($action_id);
$t->set_var(lang_info_action,lang('InfoLog').' - '.
!
$proj['title']);
break;
case 'addr':
$action_vars += array( 'id_addr' =>
$action_id,
'addr_id' => $action_id );
- $addr = $this->bo->readAddr($action_id);
$t->set_var(lang_info_action,lang('InfoLog').' - '.
!
$this->bo->addr2name($addr));
break;
default:
--- 373,389 ----
$action_vars += array( 'id_project' =>
$action_id,
'proj_id' => $action_id);
$t->set_var(lang_info_action,lang('InfoLog').' - '.
!
$this->bo->proj2name($action_id));
break;
case 'addr':
$action_vars += array( 'id_addr' =>
$action_id,
'addr_id' => $action_id );
$t->set_var(lang_info_action,lang('InfoLog').' - '.
!
$this->bo->addr2name($action_id));
! break;
! case 'event':
! $action_vars += array( 'id_event' =>
$action_id,'event_id' => $action_id);
!
$t->set_var(lang_info_action,lang('InfoLog').' - '.
!
$this->bo->event2name($action_id));
break;
default:
***************
*** 428,434 ****
break;
case 'addr':
- $nm_extra = "&action_id=$action_id";
- break;
case 'proj':
$nm_extra = "&action_id=$action_id";
break;
--- 455,460 ----
break;
case 'addr':
case 'proj':
+ case 'event':
$nm_extra = "&action_id=$action_id";
break;
***************
*** 473,477 ****
$this->nextmatchs->template_alternate_row_color(&$t);
! $t->set_var( $this->formatInfo(
$id,$proj_id,$addr_id ));
if ($this->bo->check_access($id,PHPGW_ACL_EDIT))
--- 499,503 ----
$this->nextmatchs->template_alternate_row_color(&$t);
! $t->set_var( $this->formatInfo(
$id,$action,$action_id ));
if ($this->bo->check_access($id,PHPGW_ACL_EDIT))
***************
*** 651,654 ****
--- 677,681 ----
global
$attachfile,$attachfile_name,$attachfile_size,$attachfile_type;
global $filecomment,$full_fname;
+ global $id_event,$query_event;
$t = $this->template; $html = $this->html;
***************
*** 769,773 ****
'info_id' => $info_id,
'id_parent' =>
$id_parent,
! 'responsible' =>
$responsible
));
--- 796,801 ----
'info_id' => $info_id,
'id_parent' =>
$id_parent,
! 'responsible' =>
$responsible,
! 'event_id' => $id_event
));
***************
*** 781,785 ****
}
! if (!$query_addr && !$query_project)
{
Header('Location: ' .
$html->link($referer, array('cd'=>15)));
--- 809,813 ----
}
! if (!$query_addr && !$query_project &&
!$query_event)
{
Header('Location: ' .
$html->link($referer, array('cd'=>15)));
***************
*** 853,857 ****
$info_action = 'InfoLog - New
Subproject';
break;
! case 'new': case 'addr': case 'proj':
$info_action = 'InfoLog - New';
if ($info_type &&
isset($this->bo->enums['type'][$info_type]))
--- 881,885 ----
$info_action = 'InfoLog - New
Subproject';
break;
! case 'new': case 'addr': case 'proj': case
'event':
$info_action = 'InfoLog - New';
if ($info_type &&
isset($this->bo->enums['type'][$info_type]))
***************
*** 875,879 ****
// get an instance of select box class
! $sb = CreateObject('phpgwapi.sbox2');
$t->set_var('lang_owner',lang('Owner'));
--- 903,907 ----
// get an instance of select box class
! $sb = CreateObject('infolog.sbox2');
$t->set_var('lang_owner',lang('Owner'));
***************
*** 900,903 ****
--- 928,934 ----
$t->set_var($sb->getAddress('addr',$id_addr,$query_addr));
+ if (!isset($id_event)) $id_event =
$this->bo->so->data['info_event_id'];
+
$t->set_var($sb->getEvent('event',$id_event,$query_event));
+
$t->set_var('lang_prsubject', lang('Subject'));
if (!isset($subject)) {
***************
*** 944,948 ****
if (!isset($responsible))
$responsible=$this->bo->so->data['info_responsible'];
$t->set_var('responsible_list',$sb->getAccount('responsible',
!
$responsible));
$t->set_var('lang_access_type',lang('Private'));
--- 975,979 ----
if (!isset($responsible))
$responsible=$this->bo->so->data['info_responsible'];
$t->set_var('responsible_list',$sb->getAccount('responsible',
!
$responsible,0,'accounts',-1));
$t->set_var('lang_access_type',lang('Private'));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: infolog/inc class.sbox2.inc.php,1.2,1.3 hook_calendar_view.inc.php,NONE,1.1 class.boinfolog.inc.php,1.16,1.17 class.soinfolog.inc.php,1.11,1.12 class.uiinfolog.inc.php,1.34,1.35,
Ralf Becker <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: infolog/doc create_tables.mysql,1.3,NONE create_tables.pgsql,1.1,NONE
- Next by Date:
[Phpgroupware-cvs] CVS: infolog/setup tables_baseline.inc.php,NONE,1.1 tables_update.inc.php,NONE,1.1 setup.inc.php,1.11,1.12 tables_current.inc.php,1.7,1.8
- Previous by thread:
[Phpgroupware-cvs] CVS: infolog/doc create_tables.mysql,1.3,NONE create_tables.pgsql,1.1,NONE
- Next by thread:
[Phpgroupware-cvs] CVS: infolog/setup tables_baseline.inc.php,NONE,1.1 tables_update.inc.php,NONE,1.1 setup.inc.php,1.11,1.12 tables_current.inc.php,1.7,1.8
- Index(es):