[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: infolog/inc class.boinfolog.inc.php,1.30,1.31 cl
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: infolog/inc class.boinfolog.inc.php,1.30,1.31 class.bolink.inc.php,1.18,1.19 class.uiinfolog.inc.php,1.69,1.70 hook_settings.inc.php,1.3,1.4 |
Date: |
Sun, 29 Jun 2003 13:03:49 -0400 |
Update of /cvsroot/phpgroupware/infolog/inc
In directory subversions:/tmp/cvs-serv30579
Modified Files:
class.boinfolog.inc.php class.bolink.inc.php
class.uiinfolog.inc.php hook_settings.inc.php
Log Message:
.16 conform app-headers
added display of all links to the list-page (configurable in the preferences)
Index: class.boinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.boinfolog.inc.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** class.boinfolog.inc.php 20 Mar 2003 17:31:01 -0000 1.30
--- class.boinfolog.inc.php 29 Jun 2003 17:03:47 -0000 1.31
***************
*** 26,33 ****
'search' => True,
'get_rows' => True,
- 'accountInfo' => True, // in class boinfolog
(this class)
- /* 'readProj' => True,
- 'readAddr' => True,
- 'addr2name' => True,*/
'attach_file' => True,
'delete_attached'=> True,
--- 26,29 ----
***************
*** 96,120 ****
}
- function accountInfo($id,$account_data=0)
- {
- if (!$id) return ' ';
-
- if (!is_array($account_data))
- {
- if (!isset($this->account_data[$id]))
// do some cacheing
- {
-
$GLOBALS['phpgw']->accounts->accounts($id);
-
$GLOBALS['phpgw']->accounts->read_repository();
- $this->account_data[$id] =
$GLOBALS['phpgw']->accounts->data;
- }
- $account_data = $this->account_data[$id];
- }
- if
($GLOBALS['phpgw_info']['user']['preferences']['infolog']['longNames'])
- {
- return $account_data['firstname'].'
'.$account_data['lastname'];
- }
- return $account_data['account_lid'];
- }
-
/*
* check's if user has the requiered rights on entry $info_id
--- 92,95 ----
***************
*** 138,141 ****
--- 113,121 ----
$nr = $link['link_app1'] == 'infolog' &&
$link['link_id1'] == $info['info_id'] ? '2' : '1';
$title =
$this->link->title($link['link_app'.$nr],$link['link_id'.$nr]);
+
+ if (htmlentities($title) == $info['info_from'])
+ {
+ $info['info_from'] = $title; //
correct old entries
+ }
if ($link['link_app'.$nr] == $not_app &&
$link['link_id'.$nr] == $not_id)
{
***************
*** 146,154 ****
return False;
}
! if ($info['info_from'] == '' ||
$info['info_from'] == $title)
! {
! $info['info_link_view'] =
$this->link->view($link['link_app'.$nr],$link['link_id'.$nr]);
! $info['info_from'] =
$info['info_link_title'] = $title;
! }
//echo " title='$title'</p>\n";
return $title;
--- 126,132 ----
return False;
}
! $info['info_link_view'] =
$this->link->view($link['link_app'.$nr],$link['link_id'.$nr]);
! $info['info_link_title'] = $title;
!
//echo " title='$title'</p>\n";
return $title;
***************
*** 167,170 ****
--- 145,149 ----
}
$this->link_id2from($data);
+ ;
if ($data['info_link_title'] == $data['info_from'])
{
***************
*** 194,197 ****
--- 173,181 ----
if ($check_defaults)
{
+ if (!$values['info_enddate'] &&
+ ($values['info_status'] == 'done' ||
$values['info_status'] == 'billed'))
+ {
+ $values['info_enddate'] = time();
// set enddate to today if status == done
+ }
if ($values['info_responsible'] &&
$values['info_status'] == 'offer')
{
***************
*** 229,392 ****
}
-
- function vfs_path($info_id,$file='')
- {
- return $this->vfs_basedir . '/' . $info_id . ($file ?
'/' . $file : '');
- }
-
- /*
- ** Put a file to the corrosponding place in the VFS and
set the attributes
- ** ACL check is done by the VFS
- */
- function
attach_file($info_id,$filepos,$name,$size,$type,$comment='',$full_fname='',$ip='')
- {
- //echo "<p>attach_file: info_id='$info_id',
filepos='$filepos', name='$name', size='$size', type='$type',
comment='$comment', full_fname='$full_fname', ip='$ip'</p>\n";
-
- // create the root for attached files in infolog, if it
does not exists
- if
(!($this->vfs->file_exists($this->vfs_basedir,array(RELATIVE_ROOT))))
- {
- $this->vfs->override_acl = 1;
-
$this->vfs->mkdir($this->vfs_basedir,array(RELATIVE_ROOT));
- $this->vfs->override_acl = 0;
- }
-
- $dir=$this->vfs_path($info_id);
- if
(!($this->vfs->file_exists($dir,array(RELATIVE_ROOT))))
- {
- $this->vfs->override_acl = 1;
- $this->vfs->mkdir($dir,array(RELATIVE_ROOT));
- $this->vfs->override_acl = 0;
- }
- $fname = $this->vfs_path($info_id,$name);
- $tfname = '';
- if ($full_fname)
- {
- $full_fname =
str_replace('\\\\','/',$full_fname); // vfs uses only '/'
- @reset($this->link_pathes);
- while ((list($valid,$trans) =
@each($this->link_pathes)) && !$tfname)
- { // check case-insensitive for WIN etc.
- $check = $valid[0] == '\\' ||
strstr(':',$valid) ? 'eregi' : 'ereg';
- $valid2 = str_replace('\\','/',$valid);
- //echo "<p>attach_file:
ereg('".$this->send_file_ips[$valid]."',
'$ip')=".ereg($this->send_file_ips[$valid],$ip)."</p>\n";
- if
($check('^('.$valid2.')(.*)$',$full_fname,$parts) &&
-
ereg($this->send_file_ips[$valid],$ip) && // right IP
-
$this->vfs->file_exists($trans.$parts[2],array(RELATIVE_NONE|VFS_REAL)))
- {
- $tfname = $trans.$parts[2];
- }
- //echo "<p>attach_file:
full_fname='$full_fname', valid2='$valid2', trans='$trans', check=$check,
tfname='$tfname', parts=(x,'${parts[1]}','${parts[2]}')</p>\n";
- }
- if ($tfname &&
!$this->vfs->securitycheck($tfname))
- {
- return lang('Invalid filename').':
'.$tfname;
- }
- }
- $this->vfs->override_acl = 1;
- if ($tfname) // file is local
- {
-
$this->vfs->symlink($tfname,$fname,array(RELATIVE_NONE|VFS_REAL,RELATIVE_ROOT));
- }
- else
- {
-
$this->vfs->cp($filepos,$fname,array(RELATIVE_NONE|VFS_REAL,RELATIVE_ROOT));
- }
- $this->vfs->set_attributes ($fname, array
(RELATIVE_ROOT),
- array ('mime_type' => $type,
- 'comment' => stripslashes
($comment),
- 'app' => 'infolog'));
- $this->vfs->override_acl = 0;
- }
-
- function delete_attached($info_id,$fname = '')
- {
- $file = $this->vfs_path($info_id,$fname);
-
- if ($this->vfs->file_exists($file,array(RELATIVE_ROOT)))
- {
- $this->vfs->override_acl = 1;
- $this->vfs->delete($file,array(RELATIVE_ROOT));
- $this->vfs->override_acl = 0;
- }
- }
-
- function info_attached($info_id,$filename)
- {
- $this->vfs->override_acl = 1;
- $attachments =
$this->vfs->ls($this->vfs_path($info_id,$filename),array(REALTIVE_NONE));
- $this->vfs->override_acl = 0;
-
- if (!count($attachments) || !$attachments[0]['name'])
- {
- return False;
- }
- return $attachments[0];
- }
-
- function list_attached($info_id)
- {
- $this->vfs->override_acl = 1;
- $attachments =
$this->vfs->ls($this->vfs_path($info_id),array(REALTIVE_NONE));
- $this->vfs->override_acl = 0;
-
- if (!count($attachments) || !$attachments[0]['name'])
- {
- return False;
- }
- while (list($keys,$fileinfo) = each($attachments))
- {
- $attached[$fileinfo['name']] =
$fileinfo['comment'];
- }
- return $attached;
- }
-
- function is_win_path($path)
- {
- return $path[0] == '\\' || strstr($path,':');
- }
-
- function read_attached($info_id,$filename)
- {
- if (!$info_id || !$filename ||
!$this->check_access($info_id,PHPGW_ACL_READ))
- {
- return False;
- }
- $this->vfs->override_acl = 1;
- return
$this->vfs->read($this->vfs_path($info_id,$filename),array(RELATIVE_ROOT));
- }
-
- /*
- * Checks if filename should be local availible and if so
returns 'file:/path' for HTTP-redirect
- * else return False
- */
- function attached_local($info_id,$filename,$ip,$win_user)
- {
- //echo "<p>attached_local(info_id='$info_id',
filename='$filename', ip='$ip', win_user='$win_user',
count(send_file_ips)=".count($this->send_file_ips).")</p>\n";
-
- if (!$info_id || !$filename ||
!$this->check_access($info_id,PHPGW_ACL_READ) ||
- !count($this->send_file_ips))
- {
- return False;
- }
- $link = $this->vfs->readlink
($this->vfs_path($info_id,$filename), array (RELATIVE_ROOT));
-
- if ($link)
- {
- reset($this->link_pathes); $fname = '';
- while ((list($valid,$trans) =
each($this->link_pathes)) && !$fname)
- {
- if (!$this->is_win_path($valid) ==
!$win_user && // valid for this OS
-
eregi('^'.$trans.'(.*)$',$link,$parts) && // right path
-
ereg($this->send_file_ips[$valid],$ip)) // right IP
- {
- $fname = $valid . $parts[1];
- $fname = !$win_user ?
str_replace('\\','/',$fname) : str_replace('/','\\',$fname);
- return 'file:'.($win_user ?
'//' : '' ).$fname;
- }
- // echo "<p>attached_local: link=$link,
valid=$valid, trans='$trans', fname='$fname',
parts=(x,'${parts[1]}','${parts[2]}')</p>\n";
- }
- }
- return False;
- }
-
/*!
@function link_title
--- 213,216 ----
Index: class.bolink.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.bolink.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.bolink.inc.php 27 Jun 2003 11:15:33 -0000 1.18
--- class.bolink.inc.php 29 Jun 2003 17:03:47 -0000 1.19
***************
*** 874,880 ****
if ($addr['org_name'])
{
! $name = $addr['org_name'].': '.$name;
}
! return $name;
}
--- 874,880 ----
if ($addr['org_name'])
{
! $name = $addr['org_name'].($name !== '' ? ':
'.$name : '');
}
! return stripslashes($name); // addressbook
returns quotes with slashes
}
Index: class.uiinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.uiinfolog.inc.php,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -r1.69 -r1.70
*** class.uiinfolog.inc.php 27 Jun 2003 11:34:21 -0000 1.69
--- class.uiinfolog.inc.php 29 Jun 2003 17:03:47 -0000 1.70
***************
*** 102,105 ****
--- 102,119 ----
$readonlys['view[0]'] = True; // no parent
+ $show_links =
$GLOBALS['phpgw_info']['user']['preferences']['infolog']['show_links'];
+
+ if ($show_links != 'none' && ($links =
$this->link->get_links('infolog',$info['info_id'])))
+ {
+ foreach ($links as $link)
+ {
+ if ($link['link_id'] !=
$info['info_link_id'] &&
+ ($link['app'] != $action ||
$link['id'] != $action_id) &&
+ ($show_links == 'all' ||
($show_links == 'links') === ($link['app'] != $this->link->vfs_appname)))
+ {
+ $info['filelinks'][] = $link;
+ }
+ }
+ }
return $info;
}
***************
*** 134,138 ****
}
! function index($values = 0,$action='',$action_id='',$referer=0)
{
$referer = is_array($values) ? $values['referer'] :
$referer;
--- 148,152 ----
}
! function index($values =
0,$action='',$action_id='',$referer=0,$extra_app_header=False)
{
$referer = is_array($values) ? $values['referer'] :
$referer;
***************
*** 200,204 ****
}
$values['main'][1] =
$this->get_info($action_id,&$readonlys['main']);
- $values['appheader'] =
$this->messages['sp'];
break;
}
--- 214,217 ----
***************
*** 210,213 ****
--- 223,232 ----
$values['nm']['get_rows'] =
'infolog.uiinfolog.get_rows';
$values['nm']['no_filter2'] = True;
+ $values['nm']['header_right'] =
'infolog.index.header_right';
+ if ($extra_app_header)
+ {
+ $values['nm']['header_left'] =
'infolog.index.header_left';
+ }
+ $values['nm']['bottom_too'] = True;
$persist['action'] = $values['nm']['action'] = $action;
$persist['action_id'] = $values['nm']['action_id'] =
$action_id;
***************
*** 267,274 ****
$content['info_link_id'] =
$content['link_to']['primary'];
}
- if (intval($content['info_link_id']) > 0 &&
!$this->link->get_link($content['info_link_id']))
- {
- $content['info_link_id'] = 0; // link
has been deleted
- }
if ($content['set_today'])
{
--- 286,289 ----
***************
*** 332,335 ****
--- 347,355 ----
$content = $this->bo->so->data;
+ if (intval($content['info_link_id']) > 0 &&
!$this->link->get_link($content['info_link_id']))
+ {
+ $content['info_link_id'] = 0; // link
has been deleted
+ }
+
if (!$info_id && $action_id && $action == 'sp')
// new SubProject
{
***************
*** 354,357 ****
--- 374,381 ----
$content['info_des'] = '';
$content['info_lastmodified'] = '';
+ if ($content['info_startdate'] <
time()) // parent-startdate is in the past => today
+ {
+ $content['info_startdate'] =
time();
+ }
}
else
***************
*** 380,383 ****
--- 404,408 ----
}
break;
+
case 'addressbook':
case 'projects':
***************
*** 385,389 ****
default: // to allow other apps
to participate
$content['info_link_id'] =
$this->link->link('infolog',$content['link_to']['to_id'],$action,$action_id);
! case 'new':
if ($type != '')
{
--- 410,420 ----
default: // to allow other apps
to participate
$content['info_link_id'] =
$this->link->link('infolog',$content['link_to']['to_id'],$action,$action_id);
! case '':
! if ($info_id)
! {
! break; // normal edit
! }
! case 'new': // new entry
! $content['info_startdate'] =
time();
if ($type != '')
{
***************
*** 391,397 ****
}
break;
- /* default:
- $action = '';
- break;*/
}
$content['link_to']['primary'] =
$content['info_link_id'] ? $content['info_link_id'] : True;
--- 422,425 ----
***************
*** 403,407 ****
}
$readonlys['delete'] = $action != '';
! $content['appheader'] = $this->messages[$info_id ?
'edit' : ($action == 'sp' ? 'add_sub' : 'add')];
//echo "<p>uiinfolog.edit(info_id=$info_id,mode=$mode)
content = "; _debug_array($content);
--- 431,435 ----
}
$readonlys['delete'] = $action != '';
! $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->messages[$info_id ? 'edit' : ($action == 'sp' ? 'add_sub' :
'add')]);
//echo "<p>uiinfolog.edit(info_id=$info_id,mode=$mode)
content = "; _debug_array($content);
***************
*** 601,605 ****
'menuaction' => $view,
$view_id => $args[$view_id]
! ));
$GLOBALS['phpgw_info']['flags']['currentapp'] =
$save_app;
unset($GLOBALS['phpgw_info']['etemplate']['hooked']);
--- 629,633 ----
'menuaction' => $view,
$view_id => $args[$view_id]
! ),True);
$GLOBALS['phpgw_info']['flags']['currentapp'] =
$save_app;
unset($GLOBALS['phpgw_info']['etemplate']['hooked']);
Index: hook_settings.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/hook_settings.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** hook_settings.inc.php 31 Mar 2003 18:49:13 -0000 1.3
--- hook_settings.inc.php 29 Jun 2003 17:03:47 -0000 1.4
***************
*** 22,26 ****
create_check_box('List no Subs/Childs','listNoSubs',
'Should InfoLog show Subtasks, -calls or -notes in the normal
view or not. You can always view the Subs via there parent.');
!
create_check_box('Show full usernames','longNames',
'Should InfoLog use full names (surname and familyname) or just
the loginnames.');
--- 22,35 ----
create_check_box('List no Subs/Childs','listNoSubs',
'Should InfoLog show Subtasks, -calls or -notes in the normal
view or not. You can always view the Subs via there parent.');
! /*
create_check_box('Show full usernames','longNames',
'Should InfoLog use full names (surname and familyname) or just
the loginnames.');
+ */
+ $show_links = array(
+ 'all' => lang('all links and attachments'),
+ 'links' => lang('only the links'),
+ 'attach' => lang('only the attachments'),
+ 'none' => lang('no links or attachments')
+ );
+ create_select_box('Show in the InfoLog list','show_links',$show_links,
+ 'Should InfoLog show the links to other applications and/or the
file-attachments in the InfoLog list (normal view when u enter InfoLog).');
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: infolog/inc class.boinfolog.inc.php,1.30,1.31 class.bolink.inc.php,1.18,1.19 class.uiinfolog.inc.php,1.69,1.70 hook_settings.inc.php,1.3,1.4,
Ralf Becker <address@hidden> <=