.16 conform app-headers

added display of all links to the list-page (configurable in the preferences)
This commit is contained in:
Ralf Becker 2003-06-29 17:03:47 +00:00
parent 7073ae95c2
commit 213b3b5aad
7 changed files with 101 additions and 211 deletions

View File

@ -25,10 +25,6 @@
'anzSubs' => True,
'search' => True,
'get_rows' => True,
'accountInfo' => True, // in class boinfolog (this class)
/* 'readProj' => True,
'readAddr' => True,
'addr2name' => True,*/
'attach_file' => True,
'delete_attached'=> True,
'info_attached' => True,
@ -95,27 +91,6 @@
$this->read( $info_id);
}
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
*/
@ -137,6 +112,11 @@
{
$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)
{
if ($title == $info['info_from'])
@ -145,11 +125,9 @@
}
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;
}
$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;
}
@ -166,6 +144,7 @@
$data['info_subject'] = '';
}
$this->link_id2from($data);
;
if ($data['info_link_title'] == $data['info_from'])
{
$data['info_from'] = '';
@ -193,6 +172,11 @@
}
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')
{
$values['info_status'] = 'ongoing'; // have to match if not finished
@ -228,166 +212,6 @@
$action,$action_id,$ordermethod,$start,$total);
}
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
@syntax link_title( $id )

View File

@ -873,9 +873,9 @@
}
if ($addr['org_name'])
{
$name = $addr['org_name'].': '.$name;
$name = $addr['org_name'].($name !== '' ? ': '.$name : '');
}
return $name;
return stripslashes($name); // addressbook returns quotes with slashes
}
/*!

View File

@ -101,6 +101,20 @@
$readonlys["view[$id]"] = $info['info_anz_subs'] < 1;
$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;
}
@ -133,7 +147,7 @@
return $total;
}
function index($values = 0,$action='',$action_id='',$referer=0)
function index($values = 0,$action='',$action_id='',$referer=0,$extra_app_header=False)
{
$referer = is_array($values) ? $values['referer'] : $referer;
//echo "<p>uiinfolog::index(action='$action/$action_id',referer='$referer/$values[referer]')</p>\n";
@ -199,7 +213,6 @@
break;
}
$values['main'][1] = $this->get_info($action_id,&$readonlys['main']);
$values['appheader'] = $this->messages['sp'];
break;
}
$readonlys['cancel'] = $action != 'sp';
@ -209,6 +222,12 @@
$values['nm']['options-filter'] = $this->filters;
$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;
$persist['referer'] = $referer;
@ -266,10 +285,6 @@
{
$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'])
{
$content['info_startdate'] = time();
@ -331,6 +346,11 @@
$this->bo->read( $info_id || $action != 'sp' ? $info_id : $action_id );
$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
{
if (!$this->bo->check_access($action_id,PHPGW_ACL_ADD))
@ -353,6 +373,10 @@
$content['info_subject']=lang($this->messages['re']).' '.$parent['info_subject'];
$content['info_des'] = '';
$content['info_lastmodified'] = '';
if ($content['info_startdate'] < time()) // parent-startdate is in the past => today
{
$content['info_startdate'] = time();
}
}
else
{
@ -379,20 +403,24 @@
}
}
break;
case 'addressbook':
case 'projects':
case 'calendar':
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':
case '':
if ($info_id)
{
break; // normal edit
}
case 'new': // new entry
$content['info_startdate'] = time();
if ($type != '')
{
$content['info_type'] = $type;
}
break;
/* default:
$action = '';
break;*/
}
$content['link_to']['primary'] = $content['info_link_id'] ? $content['info_link_id'] : True;
@ -402,7 +430,7 @@
}
}
$readonlys['delete'] = $action != '';
$content['appheader'] = $this->messages[$info_id ? 'edit' : ($action == 'sp' ? 'add_sub' : 'add')];
$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);
$this->tmpl->read('infolog.edit');
@ -600,7 +628,7 @@
$this->index(0,$app,$args[$view_id],array(
'menuaction' => $view,
$view_id => $args[$view_id]
));
),True);
$GLOBALS['phpgw_info']['flags']['currentapp'] = $save_app;
unset($GLOBALS['phpgw_info']['etemplate']['hooked']);
}

View File

@ -21,6 +21,15 @@
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).');

File diff suppressed because one or more lines are too long

View File

@ -27,6 +27,7 @@ add file infolog de Datei zuf
add sub infolog de neuen Untereintrag anlegen
add: infolog de Hinzufügen:
all infolog de alle
all links and attachments infolog de alle Verknüpfungen und Anhänge
are you shure you want to delete this entry ? infolog de Sind Sie sicher, dass Sie diesen Eintrag löschen wollen?
are you sure you want to delete this entry infolog de Sind Sie sicher, dass Sie diesen Eintrag löschen wollen?
attach a file infolog de Datei anhängen
@ -111,6 +112,7 @@ new search infolog de Neue Suche
no - cancel infolog de Nein - Abbruch
no entries found, try again ... infolog de Kein Einträge gefunden, nochmal versuchen ...
no filter infolog de kein Filter
no links or attachments infolog de keine Verknüpfungen oder Anhänge
none infolog de keine
normal infolog de normal
not infolog de nicht
@ -119,6 +121,8 @@ note infolog de Notiz
number of records to read (<=200) infolog de Anzahl Datensätze lesen (<=200)
offer infolog de Angebot
ongoing infolog de in Arbeit
only the attachments infolog de nur die Anhänge
only the links infolog de nur die Verknüpfungen
open infolog de offen
optional note to the link infolog de zusätzliche Notiz zur Verknüfung
overdue infolog de überfällig
@ -141,7 +145,7 @@ re: infolog de Re:
reg. expr. for local ip's<br>eg. ^192\.168\.1\. infolog de reg. Ausdr. für lokale IP's<br>^192\.168\.1\.
reject infolog de Absage
remark infolog de Bemerkung
remove this link (not the entry itself) infolog de Diese Verknüpfung lösen (nicht den Eintrag selbst)
remove this link (not the entry itself) infolog de Diese Verknüpfung lösen (nicht den Eintrag selbst)
responsible infolog de Auftrag an
responsible user, priority, ... infolog de Verantwortlicher, Prioritäten, ...
save infolog de Speichern
@ -154,9 +158,14 @@ select a priority for this task infolog de eine Priorit
select a responsible user: a person you want to delegate this task infolog de einen Verantwortlichen auswählen: eine Person der Sie diese Aufgabe delegieren wollen
select an app to search in infolog de eine Anwendung zum Durchsuchen auswählen
select an entry to link with infolog de einen Eintrag zum Verküpfen auswählen
should infolog display your open entries - not finised tasks, phonecalls or notes - on the main screen. works only if you dont selected an application for the main screen (in your preferences). infolog de Soll InfoLog die offenen Einträge - nicht beendete Aufgaben, Anrufe oder Notizen - auf der Startsteite anzeigen. Funktioniert nur, wenn sie keine (einzelne) Anwendung für die Startseite ausgewählt haben (in ihren Einstellungen).
should infolog show subtasks, -calls or -notes in the normal view or not. you can always view the subs via there parent. infolog de Soll InfoLog Untereinträge in der normalen Ansicht anzeigen oder nicht. Sie können die Untereinträge immer über deren Haupteintrag anzeigen.
should infolog show the links to other applications and/or the file-attachments in the infolog list (normal view when u enter infolog). infolog de Soll InfoLog die Verknüpfungen zu anderen Anwendungen und/oder die Datei-Anhänge in der InfoLog Liste (normale Ansicht wenn InfoLog aufgerufen wird) anzeigen.
should infolog use full names (surname and familyname) or just the loginnames. infolog de Soll InfoLog den vollen Namen (Vor- und Familienname) oder nur die Benutzerkennung verwenden.
should this entry only be visible to you and people you grant privat access via the acl infolog de soll dieser Eintrag nur sichtbar sein für Sie und Personen denen Sie privaten Zugriff über die ACL erlaubt haben
show full usernames infolog de Kompletten Benutzernamen anzeigen
show open events: tasks/calls/notes on main screen infolog de Nicht erledigte Einträge: Aufgaben/Anrufe/Notizen auf Startseite anzeigen
show in the infolog list infolog de In der InfoLog Liste anzeigen
show open entries: tasks/calls/notes on main screen infolog de Nicht erledigte Einträge: Aufgaben/Anrufe/Notizen auf Startseite anzeigen
start a new search, cancel this link infolog de eine neue Suche starten, diese Verknüpfung abbrechen
startdate infolog de Startdatum
startdate enddate infolog de Startdatum Endedatum
@ -166,6 +175,7 @@ sub infolog de Unter-<br>eintr
subject infolog de Titel
task infolog de Auftrag
test import (show importable records <u>only</u> in browser) infolog de Test Import (zeige importierbare Datensätze <u>nur</u> im Browser)
this is the filter infolog uses when you enter the application. filters limit the entries to show in the actual view. there are filters to show only finished, still open or futures entries of yourself or all users. infolog de Das ist der Filter, den InfoLog benutzt wenn es das erste mal aufgerufen wird. Filter beschränken die aktuelle Anzeige. Es gibt Filter um nur beendete, offene oder zukünftige Einträge von Ihnen oder allen Benutzern anzuzeigen.
til when should the todo or phonecall be finished infolog de bis wann soll der Auftrag oder Anruf erledigt sein
today infolog de Heute
todo infolog de Auftrag

View File

@ -27,6 +27,7 @@ add file infolog en Add file
add sub infolog en add Sub
add: infolog en Add:
all infolog en All
all links and attachments infolog en all links and attachments
are you shure you want to delete this entry ? infolog en Are you shure you want to delete this entry ?
are you sure you want to delete this entry infolog en Are you sure you want to delete this entry
attach a file infolog en Attach a file
@ -111,6 +112,7 @@ new search infolog en New search
no - cancel infolog en No - Cancel
no entries found, try again ... infolog en no entries found, try again ...
no filter infolog en no Filter
no links or attachments infolog en no links or attachments
none infolog en None
normal infolog en normal
not infolog en not
@ -119,6 +121,8 @@ note infolog en Note
number of records to read (<=200) infolog en Number of records to read (<=200)
offer infolog en offer
ongoing infolog en ongoing
only the attachments infolog en only the attachments
only the links infolog en only the links
open infolog en open
optional note to the link infolog en optional note to the Link
overdue infolog en overdue
@ -153,9 +157,14 @@ select a priority for this task infolog en select a priority for this task
select a responsible user: a person you want to delegate this task infolog en select a responsible user: a person you want to delegate this task
select an app to search in infolog en Select an App to search in
select an entry to link with infolog en Select an entry to link with
should infolog display your open entries - not finised tasks, phonecalls or notes - on the main screen. works only if you dont selected an application for the main screen (in your preferences). infolog en Should InfoLog display your open entries - not finised tasks, phonecalls or notes - on the main screen. Works only if you dont selected an application for the main screen (in your preferences).
should infolog show subtasks, -calls or -notes in the normal view or not. you can always view the subs via there parent. infolog en Should InfoLog show Subtasks, -calls or -notes in the normal view or not. You can always view the Subs via there parent.
should infolog show the links to other applications and/or the file-attachments in the infolog list (normal view when u enter infolog). infolog en Should InfoLog show the links to other applications and/or the file-attachments in the InfoLog list (normal view when u enter InfoLog).
should infolog use full names (surname and familyname) or just the loginnames. infolog en Should InfoLog use full names (surname and familyname) or just the loginnames.
should this entry only be visible to you and people you grant privat access via the acl infolog en should this entry only be visible to you and people you grant privat access via the ACL
show full usernames infolog en Show full usernames
show open events: tasks/calls/notes on main screen infolog en Show open Events: Tasks/Calls/Notes on main screen
show in the infolog list infolog en Show in the InfoLog list
show open entries: tasks/calls/notes on main screen infolog en Show open entries: Tasks/Calls/Notes on main screen
start a new search, cancel this link infolog en start a new search, cancel this link
startdate infolog en Startdate
startdate enddate infolog en Startdate Enddate
@ -165,6 +174,7 @@ sub infolog en Sub
subject infolog en Subject
task infolog en ToDo
test import (show importable records <u>only</u> in browser) infolog en Test Import (show importable records <u>only</u> in browser)
this is the filter infolog uses when you enter the application. filters limit the entries to show in the actual view. there are filters to show only finished, still open or futures entries of yourself or all users. infolog en This is the filter InfoLog uses when you enter the application. Filters limit the entries to show in the actual view. There are filters to show only finished, still open or futures entries of yourself or all users.
til when should the todo or phonecall be finished infolog en til when should the ToDo or Phonecall be finished
today infolog en Today
todo infolog en ToDo