Initial revision

This commit is contained in:
seek3r 2001-05-23 19:07:45 +00:00
parent 4935ab6eb6
commit f184b96979
41 changed files with 2047 additions and 0 deletions

326
infolog/csv_import.php Normal file
View File

@ -0,0 +1,326 @@
<?php
/**************************************************************************\
* phpGroupWare - Info Log: CSV - Import *
* http://www.phpgroupware.org *
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_info["flags"]["currentapp"] = "info";
$phpgw_info["flags"]["enable_contacts_class"] = True;
include("../header.inc.php");
$phpgw->info = createobject('info.info');
$t = new Template($phpgw_info["server"]["app_tpl"]); // $t->unknows = 'keep'; $t->debug = 1;
$t->set_file(array("import" => "csv_import.tpl"));
$t->set_block('import','filename','filenamehandle');
$t->set_block('import','fheader','fheaderhandle');
$t->set_block('import','fields','fieldshandle');
$t->set_block('import','ffooter','ffooterhandle');
$t->set_block('import','imported','importedhandle');
// $t->set_var("navbar_bg",$phpgw_info["theme"]["navbar_bg"]);
// $t->set_var("navbar_text",$phpgw_info["theme"]["navbar_text"]);
if ($action == 'download' && (!$fieldsep || !$csvfile || !($fp=fopen($csvfile,"r")))) {
$action = '';
}
$t->set_var("action_url",$phpgw->link("/info/csv_import.php"));
$t->set_var( $phpgw->info->setStyleSheet( ));
$t->set_var("lang_info_action",lang("Import CSV-File into Info Log"));
$PSep = '||'; // Pattern-Separator, separats the pattern-replacement-pairs in trans
$ASep = '|>'; // Assignment-Separator, separats pattern and replacesment
$VPre = '|#'; // Value-Prefix, is expanded to \ for ereg_replace
$CPre = '|['; $CPreReg = '\|\['; // |{csv-fieldname} is expanded to the value of the csv-field
$CPos = ']'; $CPosReg = '\]'; // if used together with @ (replacement is eval-ed) value gets autom. quoted
function dump_array( $arr ) {
while (list($key,$val) = each($arr))
$ret .= ($ret ? ',' : '(') . "'$key' => '$val'";
return $ret.')';
}
function index( $value,$arr ) {
while (list ($key,$val) = each($arr))
if ($value == $val)
return $key;
return False;
}
function addr_id( $n_family,$n_given,$org_name ) { // find in Addressbook, at least n_family AND (n_given OR org_name) have to match
$contacts = createobject('phpgwapi.contacts');
$addrs = $contacts->read( 0,0,array('id'),'',"n_family=$n_family,n_given=$n_given,org_name=$org_name" );
if (!count($addrs))
$addrs = $contacts->read( 0,0,array('id'),'',"n_family=$n_family,n_given=$n_given" );
if (!count($addrs))
$addrs = $contacts->read( 0,0,array('id'),'',"n_family=$n_family,org_name=$org_name" );
if (count($addrs))
return $addrs[0]['id'];
return False;
}
$cat2id = array( );
function cat_id( $cats )
{
if (!$cats)
return '';
$cats = explode(',',$cats);
while (list($k,$cat) = each($cats)) {
if (isset($cat2id[$cat])) {
$ids[$cat] = $cat2id[$cat]; // cat is in cache
} else {
if (!is_object($phpgw->categories)) {
$phpgw->categories = createobject('phpgwapi.categories');
}
if ($id = $phpgw->categories->name2id( $cat )) { // cat exists
$cat2id[$cat] = $ids[$cat] = $id;
} else { // create new cat
$phpgw->categories->add( $cat,0,$cat,'','public',0);
$cat2id[$cat] = $ids[$cat] = $phpgw->categories->name2id( $cat );
}
}
}
return implode( ',',$ids );
}
switch ($action) {
case '': // Start, ask Filename
$t->set_var('lang_csvfile',lang('CSV-Filename'));
$t->set_var('lang_fieldsep',lang('Fieldseparator'));
$t->set_var('fieldsep',$fieldsep ? $fieldsep : ',');
$t->set_var('submit',lang('Download'));
$t->set_var('csvfile',$csvfile);
$t->set_var('enctype','ENCTYPE="multipart/form-data"');
$hiddenvars .= '<input type="hidden" name="action" value="download">'."\n";
$t->parse('filenamehandle','filename');
break;
case 'download':
$pref_file = '/tmp/csv_import_info_log.php';
if (is_readable($pref_file) && ($prefs = fopen($pref_file,'r'))) {
eval(fread($prefs,8000));
// echo "<p>defaults = array".dump_array($defaults)."</p>\n";
} else {
$defaults = array();
}
$t->set_var('lang_csv_fieldname',lang('CSV-Fieldname'));
$t->set_var('lang_info_fieldname',lang('Info Log-Fieldname'));
$t->set_var('lang_translation',lang("Translation").' <a href="#help">'.lang('help').'</a>');
$t->set_var('submit',lang('Import'));
$t->set_var('lang_debug',lang('Test Import (show importable records <u>only</u> in browser)'));
$t->parse('fheaderhandle','fheader');
$hiddenvars .= '<input type="hidden" name="action" value="import">'."\n".
'<input type="hidden" name="fieldsep" value="'.$fieldsep."\">\n".
'<input type="hidden" name="pref_file" value="'.$pref_file."\">\n";
$info_names = array( 'type' => 'Type: task,phone,note,confirm,reject,email,fax',
'from' => 'From: text(64) free text if no Addressbook-entry assigned',
'addr' => 'Addr: text(64) phone-nr/email-address',
'subject' => 'Subject: text(64)',
'des' => 'Description: text long free text',
'owner' => 'Owner: int(11) user-id of owner, if empty current user',
'responsible' => 'Responsible: int(11) user-id of resp. person',
'access' => 'Access: public,private',
'cat' => 'Cathegory: int(11) cathegory-id',
'datecreated' => 'Date Created: DateTime if empty = Start Date or now',
'startdate' => 'Start Date: DateTime',
'enddate' => 'End Date: DateTime',
'pri' => 'Priority: urgent,high,normal,low',
'time' => 'Time: int(11) time used in min',
'bill_cat' => 'Billing Cathegory: int(11)',
'status' => 'Status: offer,ongoing,call,will-call,done,billed',
'confirm' => 'Confirmation: not,accept,finish,both when to confirm',
'cat_id' => 'Categorie id(s), to set use @cat_id(Cat1,Cat2)',
'addr_id' => 'Addressbook id, to set use @addr_id(nlast,nfirst,org)' );
$mktime_lotus = "${PSep}0?([0-9]+)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*).*$ASep@mktime(${VPre}4,${VPre}5,${VPre}6,${VPre}2,${VPre}3,${VPre}1)";
$defaults += array( 'Land' => "addr$PSep.*[(]+([0-9]+)[)]+$ASep+${VPre}1 (${CPre}Ortsvorwahl$CPos) ${CPre}Telefon$CPos$PSep${CPre}Telefon$CPos",
'Notiz' => 'des',
'Privat' => "access${PSep}1${ASep}private${PSep}public",
'Startdatum' => 'startdate'.$mktime_lotus,
'Enddatum' => 'enddate'.$mktime_lotus,
'Erledigt' => "status${PSep}1${ASep}done${PSep}call",
'Nachname' => "addr_id${PSep}@addr_id(${CPre}Nachname$CPos,${CPre}Vorname$CPos,${CPre}Firma$CPos)",
'Firma' => "from${PSep}.+$ASep${CPre}Firma$CPos: ${CPre}Nachname$CPos, ${CPre}Vorname$CPos".
"${PSep}${CPre}Nachname$CPos, ${CPre}Vorname$CPos",
'no CSV 1' => "type${PSep}phone",
'no CSV 2' => "subject${PSep}@substr(${CPre}Notiz$CPos,0,60).' ...'" );
$info_name_options = "<option value=\"\">none\n";
while (list($field,$name) = each($info_names)) {
$info_name_options .= "<option value=\"$field\">".$phpgw->strip_html($name)."\n";
}
$csv_fields = fgetcsv($fp,8000,$fieldsep);
$csv_fields[] = 'no CSV 1'; // eg. for static assignments
$csv_fields[] = 'no CSV 2';
$csv_fields[] = 'no CSV 3';
while (list($csv_idx,$csv_field) = each($csv_fields)) {
$t->set_var('csv_field',$csv_field);
$t->set_var('csv_idx',$csv_idx);
if ($def = $defaults[$csv_field]) {
list( $info,$trans ) = explode($PSep,$def,2);
$t->set_var('trans',$trans);
$t->set_var('info_fields',str_replace($info.'">',$info.'" selected>',$info_name_options));
} else {
$t->set_var('trans','');
$t->set_var('info_fields',$info_name_options);
}
$t->parse('fieldshandle','fields',True);
}
$t->set_var('lang_start',lang('Startrecord'));
$t->set_var('start',$start);
$t->set_var('lang_max',lang('Number of records to read (<=200)'));
$t->set_var('max',200);
$t->parse('ffooterhandle','ffooter');
fclose($fp);
$old = $csvfile; $csvfile = $phpgw_info['server']['temp_dir'].'/info_log_import_'.basename($csvfile);
rename($old,$csvfile);
$hiddenvars .= '<input type="hidden" name="csvfile" value="'.$csvfile.'">';
$help_on_trans = "<a name='help'><b>How to use Translation's</b><p>".
"Translations enable you to change / adapt the content of each CSV field for your needs. <br>".
"General syntax is: <b>pattern1 ${ASep} replacement1 ${PSep} ... ${PSep} patternN ${ASep} replacementN</b><br>".
"If the pattern-part of a pair is ommited it will match everything ('^.*$'), which is only ".
"usefull for the last pair, as they are worked from left to right.<p>".
"First example: <b>1${ASep}private${PSep}public</b><br>".
"This will translate a '1' in the CVS field to 'privat' and everything else to 'public'.<p>".
"Patterns as well as the replacement can be regular expressions (the replacement is done via ereg_replace). ".
"If, after all replacements, the value starts with an '@' the whole value is eval()'ed, so you ".
"may use all php, phpgw plus your own functions. This is quiet powerfull, but <u>circumvents all ACL</u>.<p>".
"Example using regular expressions and '@'-eval(): <br><b>$mktime_lotus</b><br>".
"It will read a date of the form '2001-05-20 08:00:00.00000000000000000' (and many more, see the regular expr.). ".
"The&nbsp;[&nbsp;.:-]-separated fields are read and assigned in different order to @mktime(). Please note to use ".
"${VPre} insted of a backslash (I couldn't get backslash through all the involved templates and forms.) ".
"plus the field-number of the pattern.<p>".
"In addintion to the fields assign by the pattern of the reg.exp. you can use all other CSV-fields, with the ".
"syntax <b>${CPre}CVS-FIELDNAME$CPos</b>. Here is an example: <br>".
"<b>.+$ASep${CPre}Company$CPos: ${CPre}NFamily$CPos, ${CPre}NGiven$CPos$PSep${CPre}NFamily$CPos, ${CPre}NGiven$CPos</b><br>".
"It is used on the CVS-field 'Company' and constructs a something like <i>Company: FamilyName, GivenName</i> or ".
"<i>FamilyName, GivenName</i> if 'Company' is empty.<p>".
"You can use the 'No CVS #'-fields to assign cvs-values to more than on field, the following example uses the ".
"cvs-field 'Note' (which gots already assingned to the description) and construct a short subject: ".
"<b>@substr(${CPre}Note$CPos,0,60).' ...'</b><p>".
"Their is two important user-function for the Info Log:<br>".
"<b>@addr_id(${CPre}NFamily$CPos,${CPre}NGiven$CPos,${CPre}Company$CPos)</b> ".
"searches the addressbook for an address and returns the id if it founds an exact match of at least ".
"<i>NFamily</i> AND (<i>NGiven</i> OR <i>Company</i>). This is necessary to link your imported InfoLog-entrys ".
"with the addressbook.<br>".
"<b>@cat_id(Cat1,...,CatN)</b> returns a (','-separated) list with the cat_id's. If a category isn't found, it ".
"will be automaticaly added.<p>".
"I hope that helped to understand the features, if not <a href='mailto:RalfBecker@outdoor-training.de'>ask</a>.";
$t->set_var('help_on_trans',lang($help_on_trans)); // I don't think anyone will translate this
break;
case 'import':
$fp=fopen($csvfile,"r");
$csv_fields = fgetcsv($fp,8000,$fieldsep);
$info_fields = array_diff($info_fields,array( '' )); // throw away empty / not assigned entrys
if ($pref_file) {
// echo "writing pref_file ...<p>";
if (file_exists($pref_file)) rename($pref_file,$pref_file.'.old');
$pref = fopen($pref_file,'w');
while (list($csv_idx,$info) = each($info_fields)) {
$defaults[$csv_fields[$csv_idx]] = $info;
if ($trans[$csv_idx])
$defaults[$csv_fields[$csv_idx]] .= $PSep.$trans[$csv_idx];
}
fwrite($pref,'$defaults = array'.dump_array( $defaults ).';');
fclose($pref);
}
$log = "<table border=1>\n\t<tr><td>#</td>\n";
reset($info_fields);
while (list($csv_idx,$info) = each($info_fields)) { // convert $trans[$csv_idx] into array of pattern => value
// if (!$debug) echo "<p>$csv_idx: ".$csv_fields[$csv_idx].": $info".($trans[$csv_idx] ? ': '.$trans[$csv_idx] : '')."</p>";
$pat_reps = explode($PSep,stripslashes($trans[$csv_idx]));
$replaces = ''; $values = '';
if ($pat_reps[0] != '') {
while (list($k,$pat_rep) = each($pat_reps)) {
list($pattern,$replace) = explode($ASep,$pat_rep,2);
if ($replace == '') { $replace = $pattern; $pattern = '^.*$'; }
$values[$pattern] = $replace; // replace two with only one, added by the form
$replaces .= ($replaces != '' ? $PSep : '') . $pattern . $ASep . $replace;
}
$trans[$csv_idx] = $values;
} else
unset( $trans[$csv_idx] );
$log .= "\t\t<td><b>$info</b></td>\n";
}
if ($start < 1) $start = 1;
for ($i = 1; $i < $start && fgetcsv($fp,8000,$fieldsep); ++$i) ; // overread lines before our start-record
for ($anz = 0; $anz < $max && ($fields = fgetcsv($fp,8000,$fieldsep)); ++$anz) {
$log .= "\t</tr><tr><td>".($start+$anz)."</td>\n";
reset($info_fields); $values = array();
while (list($csv_idx,$info) = each($info_fields)) {
//echo "<p>$csv: $info".($trans[$csv] ? ': '.$trans[$csv] : '')."</p>";
$val = $fields[$csv_idx];
if (isset($trans[$csv_idx])) {
$trans_csv = $trans[$csv_idx];
while (list($pattern,$replace) = each($trans_csv)) {
if (ereg((string) $pattern,$val)) {
// echo "<p>csv_idx='$csv_idx',info='$info',trans_csv=".dump_array($trans_csv).",ereg_replace('$pattern','$replace','$val') = ";
$val = ereg_replace((string) $pattern,str_replace($VPre,'\\',$replace),(string) $val);
// echo "'$val'</p>";
$quote = $val[0] == '@' ? "'" : '';
$reg = $CPreReg.'([a-zA-Z_0-9]+)'.$CPosReg;
while (ereg($reg,$val,$vars)) { // expand all CSV fields
$val = str_replace($CPre.$vars[1].$CPos,$quote.$fields[index($vars[1],$csv_fields)].$quote,$val);
}
if ($val[0] == '@') {
$val = 'return '.substr($val,1).';';
// echo "<p>eval('$val')=";
$val = eval($val);
// echo "'$val'</p>";
}
if ($pattern[0] != '@' || $val)
break;
}
}
}
$values[$info] = $val;
$log .= "\t\t<td>$val</td>\n";
}
if (!isset($values['datecreated'])) $values['datecreated'] = $values['startdate'];
if (!$debug) {
$phpgw->info->write($values);
}
}
$log .= "\t</tr>\n</table>\n";
$t->set_var('anz_imported',$debug ? lang( '%1 records read (not yet imported, you may go back and uncheck Test Import)',
$anz,'<a href="javascript:history.back()">','</a>' ) :
lang( '%1 records imported',$anz ));
$t->set_var('log',$log);
$t->parse('importedhandle','imported');
break;
}
$t->set_var('hiddenvars',$hiddenvars);
$t->pfp('out','import',True);
$phpgw->common->phpgw_footer();
?>

82
infolog/delete.php Normal file
View File

@ -0,0 +1,82 @@
<?php
/**************************************************************************\
* phpGroupWare - Info Log *
* http://www.phpgroupware.org *
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
* based on todo written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_info['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'nofooter' => True,
'currentapp' => 'info'
);
include('../header.inc.php');
if (! $info_id) {
Header('Location: ' . $phpgw->link('/info/index.php',"&sort=$sort&order=$order&query=$query&start=$start"
. "&filter=$filter&cat_id=$cat_id"));
}
$phpgw->info = createobject('info.info');
if (! $phpgw->info->check_access($info_id,PHPGW_ACL_DELETE)) {
Header('Location: ' . $phpgw->link('/info/index.php',"&sort=$sort&order=$order&query=$query&start=$start"
. "&filter=$filter&cat_id$cat_id"));
}
if ($confirm) {
$phpgw->info->delete($info_id);
Header('Location: ' . $phpgw->link('/info/index.php',"cd=16&sort=$sort&order=$order&query=$query&start="
. "$start&filter=$filter&cat_id=$cat_id"));
} else {
$phpgw->common->phpgw_header();
echo parse_navbar();
$common_hidden_vars =
"<input type=\"hidden\" name=\"sort\" value=\"$sort\">\n"
. "<input type=\"hidden\" name=\"order\" value=\"$order\">\n"
. "<input type=\"hidden\" name=\"query\" value=\"$query\">\n"
. "<input type=\"hidden\" name=\"start\" value=\"$start\">\n"
. "<input type=\"hidden\" name=\"filter\" value=\"$filter\">\n";
$phpgw->template = new Template($phpgw->common->get_tpl_dir('info'));
$phpgw->template->set_file(array( 'info_delete' => 'delete.tpl' ));
$phpgw->template->set_var( $phpgw->info->setStyleSheet( ));
$phpgw->template->set_var( $phpgw->info->infoHeaders( ));
$phpgw->template->set_var( $phpgw->info->formatInfo( $info_id ));
$phpgw->template->set_var('lang_info_action',lang('Info Log - Delete'));
$phpgw->template->set_var('deleteheader',lang('Are you sure you want to delete this entry'));
$nolinkf = $phpgw->link('/info/index.php',"sort=$sort&order=$order&query=$query&start=$start&filter=$filter");
$nolink = '<a href="' . $nolinkf . '">' . lang('No') .'</a>';
$phpgw->template->set_var('nolink',$nolink);
$phpgw->template->set_var('cancel_action',$nolinkf);
$phpgw->template->set_var('lang_cancel',lang('No - Cancel'));
$yeslinkf = $phpgw->link('/info/delete.php',"info_id=$info_id&confirm=True&sort="
. "$sort&order=$order&query=$query&start=$start&filter=$filter");
$yeslink = '<a href="' . $yeslinkf . '">' . lang('Yes') . '</a>';
$phpgw->template->set_var('yeslink',$yeslink);
$phpgw->template->set_var('delete_action',$yeslinkf);
$phpgw->template->set_var('lang_delete',lang('Yes - Delete'));
$phpgw->template->pfp('out','info_delete');
$phpgw->common->phpgw_footer();
echo parse_navbar_end();
}
?>

View File

@ -0,0 +1,56 @@
# $Id$
#DROP TABLE info;
CREATE TABLE info (
info_id int(11) unsigned PRIMARY KEY NOT NULL auto_increment,
info_type enum('task','phone','note','confirm','reject','email','fax') NOT NULL, # type of entry
info_addr_id int(11) DEFAULT '0' NOT NULL, # concerning address: e.g. call from or to (if applicable or 0)
info_proj_id int(11) DEFAULT '0' NOT NULL, # concerned project (if applicable or 0)
info_from varchar(64), # free text if no addr. or proj., e.g. name of person to call / who called
info_addr varchar(64), # type: call: nr to call. email: email-addr.
info_subject varchar(64) NOT NULL,
info_des text, # long description of subject
info_owner int(11) NOT NULL, # creator of task, ...
info_responsible int(11) DEFAULT '0' NOT NULL, # 0 if owner, else person the task is delegated to
info_access varchar(10) DEFAULT 'public', # public or private (private should include responsible person)
info_cat int(11) DEFAULT '0' NOT NULL, # free cathegory
info_datecreated int(11) DEFAULT '0' NOT NULL, # date of creation
info_startdate int(11) DEFAULT '0' NOT NULL, # begin of task
info_enddate int(11) DEFAULT '0' NOT NULL, # sheduled end of task
info_id_parent int(11) DEFAULT '0' NOT NULL, # id of parent-task or -call
info_pri enum('urgent','high','normal','low') DEFAULT 'Normal',# priority of the task / call
info_time int(11) DEFAULT '0' NOT NULL, # time needed for the task
info_bill_cat int(11) DEFAULT '0' NOT NULL, # 0 == not billed
info_status enum('offer','ongoing','call','will-call','done','billed') DEFAULT 'done', # offer means responsible person wanted/searched
info_confirm enum('not','accept','finish','both') DEFAULT 'not' # confirmation, not or when task is accepted or finished or on both
);
# some test data:
# phone-calls
INSERT INTO info (info_type,info_addr_id,info_from,info_addr,info_subject,info_des,info_owner,info_responsible,info_access,info_pri,info_status) VALUES
('phone',0,'Hugo X.','+49 (631) 12345','Was steht an','...',599440,599441,'public','urgent','call'),
('phone',1,'','','Besprechungstermin','Wann treffen wir uns wegen',599441,599440,'public','normal','call');
# notes
INSERT INTO info (info_type,info_addr_id,info_from,info_subject,info_des,info_owner) VALUES
('note',0,'Hugo X.','Wie geht das','so und so',599440),
('note',1,'','zusätzliche Daten','1. + 2. + 3.',599441);
# tasks
INSERT INTO info (info_type,info_addr_id,info_from,info_subject,info_des,info_owner,info_responsible,info_access,info_pri,info_status,info_confirm) VALUES
('task',0,'','Bauauftrag','wir brauche 10 Mohawks',599440,0,'public','low','offer','both'),
('task',2,'Ralf','Konzept vorlegen','Wann treffen wir uns wegen',599440,599441,'privat','high','ongoing','done');
# confirmation
INSERT INTO info (info_type,info_id_parent,info_subject,info_des,info_owner,info_status,info_time) VALUES
('confirm',6,'war ne harte Nuß','blah blah blah',599441,'done',10);
# email
INSERT INTO info (info_type,info_addr_id,info_from,info_addr,info_subject,info_des,info_owner,info_responsible,info_access,info_pri) VALUES
('email',0,'Ralf Becker','RalfBecker@outdoor-training.de','Was steht an','...',599440,0,'public','normal'),
('email',1,'Birgit Becker','BirgitBecker@outdoor-training.de','Besprechungstermin','Wann treffen wir uns wegen',599441,599440,'public','urgent');

71
infolog/doc/lang_de.sql Normal file
View File

@ -0,0 +1,71 @@
INSERT INTO lang VALUES ('info','common','de','InfoLog');
INSERT INTO lang VALUES ('urgency','info','de','Priorität');
INSERT INTO lang VALUES ('sub','info','de','Teil-<br>projekte');
INSERT INTO lang VALUES ('add sub','info','de','neues Teilprojekt anlegen');
INSERT INTO lang VALUES ('view subs','info','de','Teilprojekte anzeigen');
INSERT INTO lang VALUES ('type','info','de','Typ');
INSERT INTO lang VALUES ('urgent','info','de','Dringend');
INSERT INTO lang VALUES ('confirm','info','de','Bestätigung');
INSERT INTO lang VALUES ('not','info','de','keine');
INSERT INTO lang VALUES ('done','info','de','erledigt');
INSERT INTO lang VALUES ('accept','info','de','bei Annahme');
INSERT INTO lang VALUES ('both','info','de','Annahme+erledigt');
INSERT INTO lang VALUES ('offer','info','de','Angebot');
INSERT INTO lang VALUES ('ongoing','info','de','in Arbeit');
INSERT INTO lang VALUES ('call','info','de','anrufen');
INSERT INTO lang VALUES ('will-call','info','de','ruft zurück');
INSERT INTO lang VALUES ('billed','info','de','abgerechnet');
INSERT INTO lang VALUES ('finish','info','de','wenn erledigt');
INSERT INTO lang VALUES ('from','info','de','Von');
INSERT INTO lang VALUES ('phone/email','info','de','Telefon/Email');
INSERT INTO lang VALUES ('note','info','de','Notiz');
INSERT INTO lang VALUES ('fax','info','de','Fax');
INSERT INTO lang VALUES ('task','info','de','Auftrag');
INSERT INTO lang VALUES ('phone','info','de','Anruf');
INSERT INTO lang VALUES ('reject','info','de','Absage');
INSERT INTO lang VALUES ('not assigned','info','de','nicht zugewiesen');
INSERT INTO lang VALUES ('responsible','info','de','Auftrag an');
INSERT INTO lang VALUES ('duration','info','de','Dauer');
INSERT INTO lang VALUES ('days','info','de','Tage');
INSERT INTO lang VALUES ('today','info','de','Heute');
INSERT INTO lang VALUES ('startdate','info','de','Startdatum');
INSERT INTO lang VALUES ('enddate','info','de','Enddatum');
INSERT INTO lang VALUES ('info log - edit','info','de','Info Log - Bearbeiten');
INSERT INTO lang VALUES ('info log','info','de','Info Log');
INSERT INTO lang VALUES ('info log - delete','info','de','Info Log - Löschen');
INSERT INTO lang VALUES ('are you sure you want to delete this entry','info','de','Sind Sie sicher, dass Sie diesen Eintrag löschen wollen?');
INSERT INTO lang VALUES ('phonecall','info','de','Telefonanruf');
INSERT INTO lang VALUES ('no - cancel','info','de','Nein - Abbruch');
INSERT INTO lang VALUES ('yes - delete','info','de','Ja - Löschen');
INSERT INTO lang VALUES ('info log - new','info','de','Info Log - Anlegen');
INSERT INTO lang VALUES ('info log - new subproject','info','de','Info Log - Anlegen Teilprojekt');
INSERT INTO lang VALUES ('re:','info','de','Re: ');
INSERT INTO lang VALUES ('info log - subprojects from','info','de','Info Log - Teilprojekte von');
INSERT INTO lang VALUES ('back to projectlist','info','de','Zurück zur Gesamtliste');
INSERT INTO lang VALUES ('view other subs','info','de','andere Teileprojekte anzeigen');
INSERT INTO lang VALUES ('action','info','de','Befehle');
INSERT INTO lang VALUES ('showing x - x of x','info','de','Einträge %1 - %2 von %3');
INSERT INTO lang VALUES ('datecreated','info','de','Erstellt am');
INSERT INTO lang VALUES ('you have entered an invalid ending date','info','de','Sie haben ein ungültiges Enddatum angegeben');
INSERT INTO lang VALUES ('you have entered an invalid starting date','info','de','Sie haben ein ungültiges Startdatum eingegeben');
INSERT INTO lang VALUES ('owner','info','de','Erstellt von');
INSERT INTO lang VALUES ('no entrys found for %1, try again ...','info','de','Keine Einträge für %1 gefunden, nochmal versuchen ...');
INSERT INTO lang VALUES ('search for:','info','de','Suchen nach:');
INSERT INTO lang VALUES ('project','info','de','Projekt');
INSERT INTO lang VALUES ('pattern for search in addressbook','info','de','Muster für Suche im Adressbuch');
INSERT INTO lang VALUES ('pattern for search in projects','info','de','Muster für Suche des Projekts');
INSERT INTO lang VALUES ('not set, use button to search for','info','de','nicht gesetzt, Button zum Suchen verwenden');
INSERT INTO lang VALUES ('import csv-file into info log','info','de','Import CSV-Datei ins Info Log');
INSERT INTO lang VALUES ('csv-fieldname','info','de','CSV-Feldname');
INSERT INTO lang VALUES ('info log-fieldname','info','de','Info Log-Feldname');
INSERT INTO lang VALUES ('translation','info','de','Translation');
INSERT INTO lang VALUES ('import','info','de','Import');
INSERT INTO lang VALUES ('startrecord','info','de','Startdatensatz');
INSERT INTO lang VALUES ('number of records to read (<=200)','info','de','Anzahl Datensätze lesen (<=200)');
INSERT INTO lang VALUES ('test import (show importable records <u>only</u> in browser)','info','de','Test Import (zeige importierbare Datensätze <u>nur</u> im Browser)');
INSERT INTO lang VALUES ('csv-filename','info','de','CSV-Dateiname');
INSERT INTO lang VALUES ('fieldseparator','info','de','Feldbegrenzer');
INSERT INTO lang VALUES ('download','info','de','Datei laden');
INSERT INTO lang VALUES ('%1 records imported','info','de','%1 Datensätze importiert');
INSERT INTO lang VALUES ('%1 records read (not yet imported, you may go back and uncheck test import)','info','de','%1 Datensätze gelesen (noch nicht importiert, sie können %2zurück%3 gehen und Test Import ausschalten)');
INSERT INTO lang VALUES ('%1 records read (not yet imported, you may go back and uncheck test import)','info','en','%1 records read (not yet imported, you may go %2back%3 and uncheck Test Import)');

321
infolog/edit.php Normal file
View File

@ -0,0 +1,321 @@
<?php
/**************************************************************************\
* phpGroupWare - Info Log *
* http://www.phpgroupware.org *
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
* based on info written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_info['flags'] = array(
'currentapp' => 'info',
'noheader' => True,
'nofooter' => True,
'nonavbar' => True,
'enable_categories_class' => True
);
include('../header.inc.php');
if ((!isset($info_id) || !$info_id) && !$action) {
Header('Location: ' . $phpgw->link('/info/index.php',sprintf('sort=%s&order=%s&query=%s&start=%s'
. '&filter=%s&cat_id=%s',$sort,$order,$query,$start,$filter,$cat_id)));
}
$phpgw->info = createobject('info.info');
if ($submit) {
if (strlen($des) >= 8000) {
$error[] = lang('Description can not exceed 8000 characters in length');
}
if (!$subject && !$des) {
$error[] = lang('You must enter a subject or a description');
}
// check wether to write dates or not
if ($selfortoday) {
$startdate = time(); // startdate is today (checkbox is clicked)
} else {
if ($smonth || $sday || $syear) {
if ($sday && !$smonth) $smonth = date('m',time());
if ($sday && !$syear) $syear = date('Y',time());
if (! checkdate($smonth,$sday,$syear)) {
$error[] = lang('You have entered an invalid starting date');
} else {
$startdate = mktime(12,0,0,$smonth, $sday, $syear);
}
} else {
$startdate = 0;
}
}
// Check ending date
if ($dur_days > 0) {
$enddate = mktime(12,0,0,date('m',$startdate), date('d',$startdate)+$dur_days, date('Y',$startdate));
} else
if ($emonth || $eday || $eyear) {
if ($eday && !$emonth) $emonth = date('m',time());
if ($eday && !$eyear) $eyear = date('Y',time());
if (!checkdate($emonth,$eday,$eyear)) {
$error[] = lang('You have entered an invalid ending date');
} else {
$enddate = mktime(12,0,0,$emonth,$eday,$eyear);
}
} else {
$enddate = 0;
}
if ($enddate < $startdate && $enddate && $startdate) {
$error[] = lang('Ending date can not be before start date');
}
if ($access) {
$access = 'private';
} else {
$access = 'public';
}
if (! is_array($error)) {
$phpgw->info->write(array(
'type' => $type,
'from' => $from,
'addr' => $addr,
'addr_id' => $addr_id,
'proj_id' => $proj_id,
'subject' => $subject,
'des' => $des,
'pri' => $pri,
'status' => $status,
'confirm' => $confirm,
'access' => $access,
'cat' => $info_cat,
'startdate' => $startdate,
'enddate' => $enddate,
'info_id' => $info_id,
'id_parent' => $id_parent,
'responsible' => $responsible
));
if (!$addrsearch && !$projectsearch) {
Header('Location: ' . $phpgw->link('/info/index.php', "cd=15&sort=$sort&order=$order&query=$query&".
"start=$start&filter=$filter&cat_id=$cat_id"));
}
}
}
$phpgw->info->read( $info_id );
if ($info_id && $action == 'sp') { // new SubProject
if (!$phpgw->info->check_access($info_id,PHPGW_ACL_ADD)) {
Header('Location: ' . $phpgw->link('/info/index.php',"sort=$sort&order=$order&query=$query&start=$start&filter=$filter"));
$phpgw->common->phpgw_exit();
}
$parent = $phpgw->info->data;
$phpgw->info->data['info_id'] = $info_id = 0;
$phpgw->info->owner = $phpgw_info['user']['account_id'];
$phpgw->info->data['info_id_parent'] = $parent['info_id'];
if ($parent['info_type'] == 'task' && $parent['info_status'] == 'offer') {
$phpgw->info->data['info_type'] = 'confirm';
$phpgw->info->data['info_responsible'] = $parent['info_owner']; // confirmation to parent
}
$phpgw->info->data['info_status'] = 'ongoing';
$phpgw->info->data['info_confirm'] = 'not';
$phpgw->info->data['info_subject'] = lang('Re:').' '.$parent['info_subject'];
$phpgw->info->data['info_des'] = '';
} else {
if ($info_id && !$phpgw->info->check_access($info_id,PHPGW_ACL_EDIT)) {
Header('Location: ' . $phpgw->link('/info/index.php',"sort=$sort&order=$order&query=$query&start=$start&filter=$filter"));
$phpgw->common->phpgw_exit();
}
}
$common_hidden_vars =
'<input type="hidden" name="sort" value="' . $sort . '">'
. '<input type="hidden" name="order" value="' . $order. '">'
. '<input type="hidden" name="query" value="' . $query . '">'
. '<input type="hidden" name="start" value="' . $start . '">'
. '<input type="hidden" name="filter" value="' . $filter . '">'
. '<input type="hidden" name="info_id" value="' . $info_id. '">'
. '<input type="hidden" name="id_parent" value="' . ($id_parent = $phpgw->info->data['info_id_parent']). '">'
. '<input type="hidden" name="action" value="' . $action. '">';
$phpgw->common->phpgw_header();
echo parse_navbar();
$phpgw->db->query("select * from info where info_id='$info_id'");
$phpgw->db->next_record();
$pri_selected[$phpgw->info->data['info_pri']] = ' selected';
$status_selected[$phpgw->info->data['info_status']] = ' selected';
$phpgw->template->set_file(array('info_edit' => 'form.tpl'));
// ====================================================================
// create two seperate blocks, addblock will be cut off from template
// editblock contains the buttons and forms for edit
// ====================================================================
$phpgw->template->set_block('info_edit', 'add', 'addhandle');
$phpgw->template->set_block('info_edit', 'edit', 'edithandle');
$phpgw->template->set_block('info_edit', 'subpro', 'subprohandle');
if (is_array($error)) {
$phpgw->template->set_var('error_list',$phpgw->common->error_list($error));
}
switch ($action) {
case 'sp':
$info_action = 'Info Log - New Subproject'; break;
case 'new':
$info_action = 'Info Log - New'; break;
default:
$info_action = 'Info Log - Edit'; break;
}
$phpgw->template->set_var('lang_info_action',lang($info_action).($addrsearch?' - '.lang('Search for:')." '$addrsearch'":''));
$phpgw->template->set_var($phpgw->info->setStyleSheet( ));
$phpgw->template->set_var('lang_category',lang('Category'));
$phpgw->template->set_var('lang_none',lang('None'));
$phpgw->template->set_var('cat_list',$phpgw->categories->formated_list('select','all',$phpgw->info->data['info_cat'],'True'));
$phpgw->template->set_var('actionurl',$phpgw->link('/info/edit.php'));
$phpgw->template->set_var('common_hidden_vars',$common_hidden_vars);
$phpgw->template->set_var('lang_owner',lang('Owner'));
$phpgw->template->set_var('owner_info',$phpgw->info->accountInfo($phpgw->info->data['info_owner']));
$phpgw->template->set_var('lang_type',lang('Type'));
$phpgw->template->set_var('type_list',$phpgw->info->getEnum('type',$phpgw->info->data['info_type'],$phpgw->info->enums['type']));
$phpgw->template->set_var('lang_prfrom', lang('From'));
$phpgw->template->set_var('fromval', $phpgw->strip_html($phpgw->info->data['info_from']));
$phpgw->template->set_var('lang_praddr', lang('Phone/Email'));
$phpgw->template->set_var('addrval', $phpgw->strip_html($phpgw->info->data['info_addr']));
$phpgw->template->set_var('lang_search', lang('Search'));
$phpgw->template->set_var('lang_prproject', lang('Project'));
$phpgw->template->set_var('lang_proj_prompt', lang('Pattern for Search in Projects'));
if (($proj_id = $phpgw->info->data['info_proj_id']) || $projectsearch) {
$projects = createobject('projects.projects');
if ($projectsearch) {
$projs = $projects->read_projects( 0,0,$projectsearch );
if (count($projs)) {
$project = '<select name="proj_id">';
while (list( $key,$proj ) = each( $projs )) {
$project .= '<option value="'.$proj['id'].'">'.$phpgw->strip_html($proj['title'])."\n";
}
$project .= '<option value="0">'.lang('none')."\n";
$project .= '</select>';
} else {
$project = lang( 'No entrys found for %1, try again ...',"'$projectsearch'" );
}
} else { // read name/company from addressbook entry info_addr_id
list( $proj ) = $projects->read_single_project( $proj_id );
if (count($proj)) {
$project = $proj['title'].'<input type="hidden" name="proj_id" value="' . $proj_id . '">';
$customer_id = $proj['customer'];
}
}
}
if (!$project)
$project = '<span class=note>'.lang('not set, use Button to search for').'</span>';
$phpgw->template->set_var('project', $project);
$phpgw->template->set_var('lang_praddrbook', lang('Addressbook'));
$phpgw->template->set_var('lang_addr_prompt', lang('Pattern for Search in Addressbook'));
if (($addr_id = $phpgw->info->data['info_addr_id']) || $addrsearch) {
$contacts = createobject('phpgwapi.contacts');
if ($addrsearch) {
$addrs = $contacts->read( 0,0,'',$addrsearch,'','DESC','org_name,n_family,n_given' );
if (count($addrs)) {
$addrbook = '<select name="addr_id">';
while (list( $key,$addr ) = each( $addrs )) {
$addrbook .= '<option value="'.$addr['id'].'">'.$phpgw->info->addr2name( $addr )."\n";
}
$addrbook .= '<option value="0">'.lang('none')."\n";
$addrbook .= '</select>';
} else {
$addrbook = lang( 'No entrys found for %1, try again ...',"'$addrsearch'" );
}
} else { // read name/company from addressbook entry info_addr_id
list( $addr ) = $contacts->read_single_entry( $addr_id );
if (count($addr)) {
$addrbook = $phpgw->info->addr2name( $addr ).'<input type="hidden" name="addr_id" value="' . $addr_id . '">';
}
}
}
if (!$addrbook)
$addrbook = '<span class=note>'.lang('not set, use Button to search for').'</span>';
$phpgw->template->set_var('addrbook', $addrbook);
$phpgw->template->set_var('lang_prsubject', lang('Subject'));
$phpgw->template->set_var('subjectval', $phpgw->strip_html($phpgw->info->data['info_subject']));
$phpgw->template->set_var('lang_prdesc', lang('Description'));
$phpgw->template->set_var('descval', $phpgw->strip_html($phpgw->info->data['info_des']));
// get month/day/year fields for startdate and enddate
if ($phpgw->info->data['info_startdate'] == 0) {
$sday = $smonth = $syear = 0;
} else {
$sday = date('d',$phpgw->info->data['info_startdate']);
$smonth = date('m',$phpgw->info->data['info_startdate']);
$syear = date('Y',$phpgw->info->data['info_startdate']);
}
if ($phpgw->info->data['info_enddate'] == 0) {
$eday = $emonth = $eyear = 0;
} else {
$eday = date('d',$phpgw->info->data['info_enddate']);
$emonth = date('m',$phpgw->info->data['info_enddate']);
$eyear = date('Y',$phpgw->info->data['info_enddate']);
}
// get an instance of select box class
$sm = CreateObject('phpgwapi.sbox');
$phpgw->template->set_var('lang_start_date',lang('Start Date'));
$phpgw->template->set_var('start_select_date',$phpgw->common->dateformatorder($sm->getYears('syear',$syear,$syear<date('Y')?$syear:date('Y')-2),
$sm->getMonthText('smonth', $smonth),$sm->getDays('sday', $sday)));
$phpgw->template->set_var('lang_end_date',lang('End Date'));
$phpgw->template->set_var('end_select_date',$phpgw->common->dateformatorder($sm->getYears('eyear', $eyear,$eyear<date('Y')?$eyear:date('Y')-2),
$sm->getMonthText('emonth', $emonth),$sm->getDays('eday', $eday)));
$phpgw->template->set_var('lang_selfortoday',lang('Today'));
$phpgw->template->set_var('selfortoday','<input type="checkbox" name="selfortoday" value="True">&nbsp;');
$phpgw->template->set_var('lang_dur_days',lang('Duration'));
$phpgw->template->set_var('days',lang('days'));
$phpgw->template->set_var('lang_status',lang('Status'));
$phpgw->template->set_var('status_list',$phpgw->info->getEnum('status',$phpgw->info->data['info_status'],$phpgw->info->enums['status']));
$phpgw->template->set_var('lang_priority',lang('Priority'));
$phpgw->template->set_var('priority_list',$phpgw->info->getEnum('pri',$phpgw->info->data['info_pri'],$phpgw->info->enums['priority']));
$phpgw->template->set_var('lang_confirm',lang('Confirm'));
$phpgw->template->set_var('confirm_list',$phpgw->info->getEnum('confirm',$phpgw->info->data['info_confirm'],$phpgw->info->enums['confirm']));
$phpgw->template->set_var('lang_responsible',lang('Responsible'));
$phpgw->template->set_var('responsible_list',$phpgw->info->getAccount('responsible',$phpgw->info->data['info_responsible']));
$phpgw->template->set_var('lang_access_type',lang('Private'));
$phpgw->template->set_var('access_list', '<input type="checkbox" name="access" value="True"' . ($phpgw->info->data['info_access'] == 'private'?' checked':'') . '>');
$phpgw->template->set_var('delete_action',$phpgw->link('/info/delete.php'));
$phpgw->template->set_var('edit_button','<input type="submit" name="submit" value="' . lang('Save') . '">');
if (!$action && $phpgw->info->check_access($info_id,PHPGW_ACL_DELETE)) {
$phpgw->template->set_var('delete_button','<input type="submit" name="delete" value="' . lang('Delete') . '">');
}
$phpgw->template->set_var('edithandle','');
$phpgw->template->set_var('addhandle','');
$phpgw->template->set_var('subprohandle','');
$phpgw->template->pfp('out','info_edit');
$phpgw->template->pfp('edithandle','edit');
// I would like to have it calculate the amount of days and drop it in days from now.
$phpgw->common->phpgw_footer();
echo parse_navbar_end();

View File

@ -0,0 +1,8 @@
<?php
function about_app($tpl,$handle)
{
$s = "<b>Info Log</b><p>written by <a href='mailto:RalfBecker@outdoor-training.de'>Ralf Becker</a><br>adopted from todo written by Joseph Engo";
return $s;
}

View File

@ -0,0 +1,402 @@
<?php
/**************************************************************************\
* phpGroupWare - Info *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
class info
{
var $db,$db2;
var $grants;
var $icons;
var $enums;
var $data = array( );
function info( $info_id = 0) {
global $phpgw;
$this->db = $phpgw->db;
$this->db2 = $phpgw->db; // for getAccounts and accountInfo
$this->grants = $phpgw->acl->get_grants('info');
$this->enums = array( 'priority' => array( 'urgent' => 'urgent','high' => 'high','normal' => 'normal','low' => 'low' ),
'status' => array( 'offer' => 'offer','ongoing' => 'ongoing','call' => 'call',
'will-call' => 'will-call','done' => 'done','billed' => 'billed' ),
'confirm' => array( 'not' => 'not','accept' => 'accept','finish' => 'finish','both' => 'both' ),
'type' => array( 'task' => 'task','phone' => 'phone','note' => 'note','confirm' => 'confirm',
'reject' => 'reject','email' => 'email','fax' => 'fax' ));
$this->icons = array( 'type' => array( 'task' => 'task.gif', 'task_alt' => 'Task',
'phone' => 'phone.gif', 'phone_alt' => 'Phonecall',
'note' => 'note.gif', 'note_alt' => 'Note',
'confirm' => 'confirm.gif','confirm_alt' => 'Confirmation',
'reject' => 'reject.gif', 'reject_alt' => 'Reject',
'email' => 'email.gif', 'email_alt' => 'Email' ),
'action' => array( 'new' => 'new.gif', 'new_alt' => 'Add Sub',
'view' => 'view.gif', 'view_alt' => 'View Subs',
'parent' => 'parent.gif', 'parent_alt' => 'View other Subs',
'edit' => 'edit.gif', 'edit_alt' => 'Edit',
'delete' => 'delete.gif', 'delete_alt' => 'Delete' ),
'status' => array( 'billed' => 'billed.gif', 'billed_alt' => 'billed',
'done' => 'done.gif', 'done_alt' => 'done',
'will-call' => 'will-call.gif', 'will-call_alt' => 'will-call',
'call' => 'call.gif', 'call_alt' => 'call',
'ongoing' => 'ongoing.gif','ongoing_alt' => 'ongoing',
'offer' => 'offer.gif', 'offer_alt' => 'offer' ));
$this->longnames = 0; // should go into preferences
$this->listChilds = 1;
$this->read( $info_id);
}
function icon($cat,$id,$status='') {
// echo "<br>icon('$cat','$id','$status')";
global $phpgw,$DOCUMENT_ROOT;
$icons = &$this->icons[$cat];
if (!$status || !($icon = $icons[$id.'_'.$status]))
$icon = $icons[$id];
if ($icon) {
$fname = $phpgw->common->get_image_dir() . '/' . $icon;
if (!is_readable($fname)) {
$icon = False; // echo "<br>Can't read '$fname' !!!";
} else {
$icon = $phpgw->common->get_image_path() . '/' . $icon;
}
}
if (!$status || !($alt = $icons[$id.'_'.$status.'_alt']))
if (!($alt = $icons[$id.'_alt']))
$alt = $id;
return ($icon ? "<img src='$icon' alt='" : '') . lang($alt) . ($icon ? '\' border=0>' : '');
}
function setStyleSheet( ) {
global $phpgw;
return array ( 'info_css' => '<link rel="stylesheet" type="text/css" href="'.
str_replace( '/images','',$phpgw->common->get_image_path()).'/info.css">' );
}
function loadStyleSheet( ) {
list( $style ) = $this->setStyleSheet(); echo $style;
}
function accountInfo($id,$account_data=0) {
global $phpgw;
if (!$id) return '&nbsp;';
if (!$cache[$id]['lid']) {
if (!is_array($account_data)) {
$accounts = createobject('phpgwapi.accounts',$id);
$accounts->db = $this->db2;
$accounts->read_repository();
$account_data = $accounts->data;
}
$cache[$id]['lid'] = $account_data['account_lid'];
$cache[$id]['firstname'] = $account_data['firstname'];
$cache[$id]['lastname'] = $account_data['lastname'];
}
if ($this->longnames)
return $cache[$id]['firstname'].' '.$cache[$id]['lastname'];
return $cache[$id]['lid'];
}
function getEnum($name, $selected=0, $arr=0,$no_lang=0) { // should be in class common.sbox
if (!is_array($arr))
$arr = array('no','yes');
$out = "<select name=\"$name\">\n";
while ($apair = each($arr)) {
$out .= '<option value="'.$apair[0].'"';
if($selected == $apair[0]) $out .= " SELECTED";
$out .= ">" . ($no_lang ? $apair[1] : lang($apair[1])) . "</option>\n";
}
$out .= "</select>\n";
return $out;
}
function getAccount($name,$selected=0) {
$accounts = createobject('phpgwapi.accounts');
$accounts->db = $this->db2;
$accs = $accounts->get_list('accounts');
$aarr = Array(lang('not assigned'));
while ($a = current($accs)) {
$aarr[$a['account_id']] = $this->accountInfo($a['account_id'],$a);
next($accs);
}
return $this->getEnum($name,$selected,$aarr,1);
}
function addr2name( $addr ) {
global $phpgw;
$name = $addr['n_family'];
if ($addr['n_given'])
$name .= ', '.$addr['n_given'];
else
if ($addr['n_prefix'])
$name .= ', '.$addr['n_prefix'];
if ($addr['org_name'])
$name = $addr['org_name'].': '.$name;
return $phpgw->strip_html($name);
}
function readProj($proj_id) {
if ($proj_id) {
if (!is_object($this->projects)) {
$this->projects = createobject('projects.projects');
}
if (list( $proj ) = $this->projects->read_single_project( $proj_id ))
return $proj;
}
return False;
}
function readAddr($addr_id) {
if ($addr_id) {
if (!is_object($this->contacts)) {
$this->contacts = createobject('phpgwapi.contacts');
}
if (list( $addr ) = $this->contacts->read_single_entry( $addr_id ))
return $addr;
}
return False;
}
function formatInfo($info=0,$p_id=0,$a_id=0) { // $info: info_id or array with one row form info-db
global $phpgw,$phpgw_info; // no Proj.Info if proj_id == p_id / no Addr.Info if addr_id == a_id
if (!is_array($info) && (!$info || !is_array($info = $this->read($info))))
$info = $this->data;
$done = $info['info_status'] == 'done' || $info['info_status'] == 'billed';
$css_class = $info['info_pri'].($done ? '_done' : '');
$subject = "<span class=$css_class>";
if ($p_id != ($proj_id = $info['info_proj_id']) && $proj = $this->readProj($proj_id)) {
$subject .= '<b><a href="'.$phpgw->link('/info/index.php',"filter=$filter&action=proj&proj_id=$proj_id").
'">'.$proj['title'].'</a></b>';
}
if ($a_id != ($addr_id = $info['info_addr_id']) && $addr = $this->readAddr($addr_id)) {
if ($proj) $subject .= '<br>';
$addr = $this->addr2name( $addr );
$subject .= '<b><a href="'.$phpgw->link('/info/index.php',"filter=$filter&action=addr&addr_id=$addr_id").
"\">$addr</a></b>";
}
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>';
}
$subject .= '<b>'.$info['info_subject'].'</b></span>';
if (!$info['info_enddate']) {
$enddate = '&nbsp;';
} else {
$enddate = $phpgw->common->show_date($info['info_enddate'],$phpgw_info['user']['preferences']['common']['dateformat']);
if (!$done && $info['info_enddate'] < time()+(60*60)*$phpgw_info['user']['preferences']['common']['tz_offset'])
$enddate = "<span class=overdue>$enddate</span>";
}
if (!($responsible = $info['info_responsible']) && $info['info_status'] == 'offer') {
$responsible = $phpgw->info->icon('status','offer');
} else {
$responsible = $phpgw->info->accountInfo($responsible);
}
$owner = $phpgw->info->accountInfo($info['info_owner']);
if ($info['info_access'] == 'private')
$owner = "<span class=private>$owner</span>";
return array(
'type' => $phpgw->info->icon('type',$info['info_type']),
'status' => $phpgw->info->icon('status',$info['info_status']),
'pri' => lang($info['info_pri']),
'subject' => $subject,
'des' => $info['info_des'],
'startdate' => $phpgw->common->show_date($info['info_startdate'],$phpgw_info['user']['preferences']['common']['dateformat']),
'enddate' => $enddate,
'owner' => $owner,
'datecreated' => $phpgw->common->show_date($info['info_datecreated'],$phpgw_info['user']['preferences']['common']['dateformat']),
'responsible' => $responsible );
}
function infoHeaders( $do_sort_header=0,$sort=0,$order=0) {
global $phpgw,$phpgw_info;
$headers['th_bg'] = $phpgw_info['theme']['th_bg'];
$fields = array( 'type','status','urgency','subject','startdate','enddate','owner','datecreated','responsible' );
for ( ;$f = $h = current($fields); $f = next($fields)) {
$lang = lang(ucfirst( $f ));
if ($do_sort_header) {
$headers['sort_'.$f] = $phpgw->nextmatchs->show_sort_order($sort,'info_'.$f,$order,'/info/index.php',$lang);
} else {
$headers['lang_'.$f] = $lang;
}
}
return $headers;
}
function debug( $str ) {
/* $stdout = fopen('/tmp/log','a');
fwrite( $stdout,"\r\n".$str );
fclose( $stdout ); */
}
function check_access( $info_id,$required_rights ) {
global $phpgw_info;
if ($info_id != $this->data['info_id']) { // already loaded?
$private_info = $this; // dont change our own internal data, dont use new as it changes $phpgw->db
$info = $private_info->read($info_id);
} else {
$info = $this->data;
}
if (!$info || !$info_id)
return False;
$owner = $info['info_owner'];
$user = $phpgw_info['user']['account_id'];
$access_ok = $owner == $user || // user has all rights
!!($this->grants[$owner] & $required_rights) && // ACL only on public entrys || $owner granted _PRIVATE
($info['info_access'] == 'public' || !!($this->grants[$owner] & PHPGW_ACL_PRIVATE));
// $this->debug("check_access(info_id=$info_id (owner=$owner, user=$user),required_rights=$required_rights): access".($access_ok?"Ok":"Denied"));
return $access_ok;
}
function aclFilter($filter = 'none') { // sql to be AND into a query to ensure ACL is respected (incl. _PRIVATE)
global $phpgw_info; // filter: none - list all entrys user have rights to see
// private - list only his personal entrys (incl. those he is responsible for !!!)
if (isset($this->acl_filter[$filter]))
return $this->acl_filter[$filter]; // used cached filter if found
if (is_array($this->grants)) {
while (list($user,$grant) = each($this->grants)) {
// echo "<p>grants: user=$user, grant=$grant</p>";
if ($grant & (PHPGW_ACL_READ|PHPGW_ACL_EDIT))
$public_user_list[] = $user;
if ($grant & PHPGW_ACL_PRIVATE)
$private_user_list[] = $user;
}
if (count($private_user_list)) {
$has_private_access = 'info_owner IN ('.implode(',',$private_user_list).')';
}
}
$user = $phpgw_info['user']['account_id'];
$filtermethod = " (info_owner=$user"; // user has all rights
if ($filter == 'private') { // private means own entrys plus the one user is responsible for (and has rights to see)
$filtermethod .= " OR info_responsible=$user AND (info_access='public'".($has_private_access?" OR $has_private_access":'').')';
} else { // none --> all entrys user has rights to see
if ($has_private_access) {
$filtermethod .= " OR $has_private_access";
}
if (count($public_user_list)) {
$filtermethod .= " OR (info_access='public' AND info_owner IN(" . implode(',',$public_user_list) . '))';
}
}
$filtermethod .= ') ';
// echo "<p>aclFilter('$filter')(user='$user') = '$filtermethod'</p>";
return $this->acl_filter[$filter] = $filtermethod; // cache the filter
}
function read($info_id) { // did _not_ ensure ACL, has to be done by the calling code
if ($info_id <= 0 || $info_id != $this->data['info_id'] &&
(!$this->db->query("select * from info where info_id='$info_id'") || !$this->db->next_record()))
{
$this->init( );
return False;
}
if ($info_id != $this->data['info_id']) { // data yet read in
$this->data = $this->db->Record;
if ($this->data['info_subject'] == (substr($this->data['info_des'],0,60).' ...')) {
$this->data['info_subject'] = '';
}
if ($this->data['info_addr_id'] && $this->data['info_from'] == $this->addr2name( $this->readAddr( $this->data['info_addr_id'] ))) {
$this->data['info_from'] = '';
}
}
return $this->data;
}
function init() {
global $phpgw_info;
$this->data = array( 'info_owner' => $phpgw_info['user']['account_id'],
'info_pri' => 'normal' );
}
function delete($info_id) { // did _not_ ensure ACL, has to be done by the calling code
global $phpgw_info;
$this->db->query("delete from info where info_id='$info_id' or info_id_parent='"
. "$info_id' AND ((info_access='public' and info_owner != '"
. $phpgw_info['user']['account_id'] . "') or (info_owner='"
. $phpgw_info['user']['account_id'] . "'))" ,__LINE__,__FILE__);
if ($this->data['info_id'] == $info_id)
$this->init( );
}
function write($values) { // did _not_ ensure ACL, has to be done by the calling code
global $phpgw_info;
if ($values['responsible'] && $values['status'] == 'offer') {
$values['status'] = 'ongoing'; // have to match if not finished
}
if (!$values['info_id'] && !$values['owner']) {
// $this->debug( "write(value[info_id]==0,values[owner]==0) --> owner set to user" );
$values['owner'] = $phpgw_info['user']['account_id']; // user gets owner
}
if (!$values['info_id'] && !$values['datecreated'])
$values['datecreated'] = time(); // set creation time
if (!$values['subject']) $values['subject'] = substr($values['des'],0,60).' ...';
if ($values['addr_id'] && !$values['from'])
$values['from'] = $this->addr2name( $this->readAddr( $values['addr_id'] ));
while (list($key,$val) = each($values)) {
$this->data['info_'.$key] = $val; // update internal data
switch ($key) {
case 'info_id':
break; // later in where clause
case 'des': case 'subject': case 'from': case 'addr':
$val = addslashes($val);
default:
if ($query) $query .= ',';
$query .= "info_$key='$val'";
}
}
if ($values['info_id']) {
$query = 'update info set '.$query.' where info_id=\'' . $values['info_id'] .'\'';
} else {
$query = 'insert into info set '.$query;
/*
* need to set $this->data['info_id'] with assigned autoincrement id
*/
}
//echo '<br>edit(): query: '.$query;
$this->db->query($query,__LINE__,__FILE__);
}
}

View File

@ -0,0 +1,16 @@
<?php
/**************************************************************************\
* phpGroupWare - Info *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/* Application header: shown after phpgroupware-header and befor app */
?>

View File

@ -0,0 +1,20 @@
<?php
/**************************************************************************\
* phpGroupWare - Info Log administration *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$imgpath = $phpgw->common->image($appname,'navbar.gif');
section_start($appname,$imgpath);
section_item($phpgw->link('/info/csv_import.php'),lang('CSV-Import'));
section_end();
?>

View File

@ -0,0 +1,8 @@
<?php
function about_app($tpl,$handle)
{
$s = "<b>Info Log</b><p>written by <a href='mailto:RalfBecker@outdoor-training.de'>Ralf Becker</a><br>adopted from todo written by Joseph Engo";
return $s;
}

View File

@ -0,0 +1,40 @@
<?php
/**************************************************************************\
* phpGroupWare *
* http://www.phpgroupware.org *
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
* ------------------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
{
echo "<p>\n";
$imgfile = $phpgw->common->get_image_dir($appname) . '/' . $appname . '.gif';
if (file_exists($imgfile)) {
$imgpath = $phpgw->common->get_image_path($appname) . '/' . $appname . '.gif';
} else {
$imgfile = $phpgw->common->get_image_dir($appname) . '/navbar.gif';
if (file_exists($imgfile)) {
$imgpath = $phpgw->common->get_image_path($appname) . '/navbar.gif';
} else {
$imgpath = '';
}
}
section_start(ucfirst($appname),$imgpath);
section_item($phpgw->link('/preferences/acl_preferences.php','acl_app=info'),
lang('Grant InfoLog Access'));
section_item($phpgw->link('/preferences/categories.php','cats_app=info'),
lang('InfoLog categories'));
section_end();
}
?>

231
infolog/index.php Normal file
View File

@ -0,0 +1,231 @@
<?php
/**************************************************************************\
* phpGroupWare - Info Log *
* http://www.phpgroupware.org *
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
* based on todo written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_info['flags'] = array(
'currentapp' => 'info',
'enable_nextmatchs_class' => True,
'enable_categories_class' => True
);
include('../header.inc.php');
$phpgw->info = createobject('info.info');
$db = $phpgw->db;
$db2 = $phpgw->db;
$phpgw->template = new Template($phpgw->common->get_tpl_dir('info'));
$phpgw->template->set_file(array( 'info_list_t' => 'list.tpl' ));
$phpgw->template->set_block('info_list_t','info_list','list');
$grants = $phpgw->acl->get_grants('info');
$common_hidden_vars =
'<input type="hidden" name="sort" value="' . $sort . '">'
. '<input type="hidden" name="order" value="' . $order . '">'
. '<input type="hidden" name="query" value="' . $query . '">'
. '<input type="hidden" name="start" value="' . $start . '">'
. '<input type="hidden" name="filter" value="' . $filter . '">'
. '<input type="hidden" name="cat_id" value="' . $cat_id . '">';
if ($action)
$common_hidden_vars .= '<input type="hidden" name="action" value="'.$action.'">';
switch ($action) {
case 'sp': // Sub-List
$common_hidden_vars .= '<input type="hidden" name="info_id" value="' . $info_id . '">';
$phpgw->template->set_var(lang_info_action,lang('Info Log - Subprojects from'));
break;
case 'proj':
$common_hidden_vars .= '<input type="hidden" name="proj_id" value="' . $proj_id . '">';
$proj = $phpgw->info->readProj($proj_id);
$phpgw->template->set_var(lang_info_action,lang('Info Log').' - '.$proj['title']);
break;
case 'addr':
$common_hidden_vars .= '<input type="hidden" name="addr_id" value="' . $addr_id . '">';
$addr = $phpgw->info->readAddr($addr_id);
$phpgw->template->set_var(lang_info_action,lang('Info Log').' - '.$phpgw->info->addr2name($addr));
break;
default:
$phpgw->template->set_var(lang_info_action,lang('Info Log'));
break;
}
$phpgw->template->set_var($phpgw->info->setStyleSheet( ));
$phpgw->template->set_var(actionurl,$phpgw->link('/info/edit.php?action=new'));
$phpgw->template->set_var('cat_form',$phpgw->link('/info/index.php'));
$phpgw->template->set_var('lang_category',lang('Category'));
$phpgw->template->set_var('lang_all',lang('All'));
$phpgw->template->set_var('lang_select',lang('Select'));
$phpgw->template->set_var('categories',$phpgw->categories->formated_list('select','all',$cat_id,'True'));
$phpgw->template->set_var(common_hidden_vars,$common_hidden_vars);
// ===========================================
// list header variable template-declarations
// ===========================================
$phpgw->template->set_var( $phpgw->info->infoHeaders( 1,$sort,$order ));
$phpgw->template->set_var(h_lang_sub,lang('Sub'));
$phpgw->template->set_var(h_lang_action,lang('Action'));
// -------------- end header declaration -----------------
if (! $start) {
$start = 0;
}
if ($order) {
$ordermethod = 'order by ' . $order . ' ' . $sort;
} else {
$ordermethod = 'order by info_datecreated desc'; // newest first
}
if (!$filter) {
$filter = 'none';
}
$filtermethod = $phpgw->info->aclFilter($filter);
if ($cat_id) {
$filtermethod .= " AND info_cat='$cat_id' ";
}
if ($action == 'addr') $filtermethod .= " AND info_addr_id=$addr_id ";
if ($action == 'proj') $filtermethod .= " AND info_proj_id=$proj_id ";
// we search in _from, _subject and _des for $query
if ($query) $sql_query = "AND (info_from like '%$query%' OR info_subject like '%$query%' OR info_des like '%$query%') ";
$pid = 'AND info_id_parent='.($action == 'sp' ? $info_id : 0);
if ($phpgw->info->listChilds && $action != 'sp')
$pid = '';
$db->query("SELECT COUNT(*) FROM info WHERE $filtermethod $pid $sql_query",__LINE__,__FILE__);
$db->next_record();
$total = $db->f(0);
if ($total <= $start) $start = 0;
if ($total > $phpgw_info['user']['preferences']['common']['maxmatchs']) {
$to = $start + $phpgw_info['user']['preferences']['common']['maxmatchs']; if ($to > $total) $to = $total;
$total_matchs = lang('showing x - x of x',($start + 1),$to,$total);
} else {
$total_matchs = lang('showing x',$total);
}
$phpgw->template->set_var('total_matchs',$total_matchs);
// ==========================================
// project description if subprojectlist
// ==========================================
$phpgw->template->set_block('info_list_t','projdetails','projdetailshandle');
switch ($action) {
case 'sp': // details of parent
$phpgw->template->set_var( $phpgw->info->infoHeaders( ));
$phpgw->template->set_var( $phpgw->info->formatInfo( $info_id ));
$phpgw->template->parse('projdetailshandle','projdetails',True);
break;
case 'addr':
break;
case 'proj':
break;
}
// ===========================================
// nextmatch variable template-declarations
// ===========================================
$next_matchs = $phpgw->nextmatchs->show_tpl('/info/index.php',$start,$total,
"&order=$order&filter=$filter&sort=$sort&query=$query&action=$action&info_id=$info_id&cat_id=$cat_id",
'95%',$phpgw_info['theme']['th_bg']);
$phpgw->template->set_var(next_matchs,$next_matchs);
// ---------- end nextmatch template --------------------
$limit = $db->limit($start);
$db->query($q="SELECT * FROM info WHERE $filtermethod $pid $sql_query $ordermethod $limit",__LINE__,__FILE__);
while ($db->next_record()) {
// ========================================
// check if actual project has subprojects
// ========================================
$db2->query("select count(*) as cnt from info where info_id_parent=" .$db->f('info_id'),__LINE__,__FILE__);
$db2->next_record();
if ($db2->f('cnt') > 0) {
$subproact = 1;
} else {
$subproact = 0;
}
// -----------------------------------------
$phpgw->nextmatchs->template_alternate_row_color(&$phpgw->template);
$phpgw->template->set_var( $phpgw->info->formatInfo( $db->Record,$proj_id,$addr_id ));
if ($phpgw->info->check_access($db->f('info_id'),PHPGW_ACL_EDIT)) {
$phpgw->template->set_var('edit','<a href="' . $phpgw->link('/info/edit.php','info_id=' . $db->f('info_id')
. '&sort=' . $sort . '&order=' . $order . '&query=' . $query . '&start=' . $start . '&filter=' . $filter)
. '">' . $phpgw->info->icon('action','edit') . '</a>');
} else {
$phpgw->template->set_var('edit','');
}
if ($phpgw->info->check_access($db->f('info_id'),PHPGW_ACL_DELETE)) {
$phpgw->template->set_var('delete','<a href="' . $phpgw->link('/info/delete.php','info_id=' . $db->f('info_id')
. '&sort=' . $sort . '&order=' . $order . '&query=' . $query . '&start=' . $start . '&filter=' . $filter)
. '">' . $phpgw->info->icon('action','delete') . '</a>');
} else {
$phpgw->template->set_var('delete','');
}
$phpgw->template->set_var('subadd', ''); // defaults no icons
$phpgw->template->set_var('viewsub', '');
$phpgw->template->set_var('viewparent', '');
if ($subproact > 0) { // if subprojects exist, display VIEW SUB icon
$phpgw->template->set_var('viewsub', '<a href="' . $phpgw->link('/info/index.php','info_id=' . $db->f('info_id')
. "&filter=$filter&action=sp") . '">' . $phpgw->info->icon('action','view') . '</a>');
} else { // else display ADD SUB-Icon
if ($phpgw->info->check_access($db->f('info_id'),PHPGW_ACL_ADD)) {
$phpgw->template->set_var('subadd', '<a href="' . $phpgw->link('/info/edit.php','info_id=' . $db->f('info_id') .
'&filter=' . $filter . '&action=sp') . '">' . $phpgw->info->icon('action','new') . '</a>');
}
} // if parent --> display VIEW SUBS of Parent
if ($db->f('info_id_parent') && $action != 'sp') {
$phpgw->template->set_var('viewparent', '<a href="' . $phpgw->link('/info/index.php','info_id=' . $db->f('info_id_parent') .
"&filter=$filter&action=sp") . '">' . $phpgw->info->icon('action','parent') . '</a>');
}
$phpgw->template->parse('list','info_list',True);
// -------------- end record declaration ------------------------
}
// =========================================================
// back2project list href declaration for subproject list
// =========================================================
if ($action) {
$phpgw->template->set_var('lang_back2projects', '<br><a href="' .
$phpgw->link('/info/index.php',"filter=$filter").
'">'.lang('Back to Projectlist').'</a>');
}
// get actual date and year for matrixview arguments
/* $year = date('Y');
$month = date('m');
$phpgw->template->set_var('lang_matrixviewhref', '<br><a href="' . $phpgw->link('/info/graphview.php',"month=$month&year=$year&filter=$filter").
'">'.lang('View Matrix of actual Month').'</a>'); */
// ============================================
// template declaration for Add Form
// ============================================
$phpgw->template->set_var(lang_add,lang('Add'));
$phpgw->template->pfp('out','info_list_t',true);
// -------------- end Add form declaration ------------------------
$phpgw->common->phpgw_footer();
?>

View File

@ -0,0 +1,10 @@
<?php
// include('../version.inc.php');
$phpgw_info['setup']['info']['name'] = 'info';
$phpgw_info['setup']['info']['version'] = "0.1";
$phpgw_info['setup']['info']['app_order'] = 1;
$phpgw_info['setup']['info']['tables'] = "info";
$hooks = Array();
$hooks_string = implode (',', $hooks);
$phpgw_info['setup']['info']['hooks'] = $hooks_string;
?>

View File

@ -0,0 +1,3 @@
<?php
$setup_info["info"] = array("name" => "InfoLog", "app_order" => 1, "version" => "0.1");
?>

View File

@ -0,0 +1,65 @@
{info_css}<p class=action>{lang_info_action}<br>
<hr noshade width="98%" align="center" size="1">
<center>
<FORM {enctype} action="{action_url}" method="post">
<TABLE>
<!-- BEGIN filename -->
<TR>
<TD>{lang_csvfile}</td>
<td><INPUT NAME="csvfile" SIZE=30 TYPE="file" VALUE="{csvfile}"></td>
</tr>
<tr>
<td>{lang_fieldsep}</td>
<td><input name="fieldsep" size=1 value="{fieldsep}"></td>
</tr>
<tr><td>&nbsp;</td>
<td><INPUT NAME="convert" TYPE="submit" VALUE="{submit}"></TD>
</TR>
<!-- END filename -->
<!-- BEGIN fheader -->
<tr>
<td><b>{lang_csv_fieldname}</b></td>
<td><b>{lang_info_fieldname}</b></td>
<td><b>{lang_translation}</b></td>
</tr>
<!-- END fheader -->
<!-- BEGIN fields -->
<tr>
<td>{csv_field}</td>
<td><SELECT name="info_fields[{csv_idx}]">{info_fields}</select></td>
<td><input name="trans[{csv_idx}]" size=60 value="{trans}"></td>
</tr>
<!-- END fields -->
<!-- BEGIN ffooter -->
<tr>
<td rowspan=2 valign="middle"><br><INPUT NAME="convert" TYPE="submit" VALUE="{submit}"></TD>
<td colspan=2><br>
{lang_start} <INPUT name="start" type="text" size="5" value="{start}"> &nbsp; &nbsp;
{lang_max} <INPUT name="max" type="text" size="3" value="{max}"><td>
</tr>
<tr>
<td><INPUT name="debug" type="checkbox" value="1" checked> {lang_debug}</td>
</TR>
<tr><td colspan=3>&nbsp;<p>
{help_on_trans}
</td></tr>
<!-- END ffooter -->
<!-- BEGIN imported -->
<tr>
<td colspan=2 align=center>
{log}<p>
{anz_imported}
</td>
</TR>
<!-- END imported -->
</TABLE>
{hiddenvars}</form>
</CENTER>

View File

@ -0,0 +1,50 @@
{info_css}
<p class=action>{lang_info_action}<br>
<hr noshade width="98%" align="center" size="1">
<center>
<table width=95% border=0 cellspacing=1 cellpadding=3>
<tr bgcolor="{th_bg}">
<td width="5%" class=list>{lang_type}</td>
<td width="5%" class=list>{lang_status}</td>
<td class=list>{lang_subject}</td>
<td width="10%" class=list>{lang_startdate}</td>
<td width="10%" class=list>{lang_enddate}</td>
<td width="10%" class=list>{lang_owner}</td>
<td width="10%" class=list>{lang_responsible}</td>
</tr>
<tr bgcolor="{th_bg}" valign="top">
<td class=list>{type}</td>
<td class=list>{status}</td>
<td class=list>{subject}</td>
<td class=list>{startdate}</td>
<td class=list>{enddate}</td>
<td class=list>{owner}<br>{datecreated}</td>
<td class=list">{responsible}</td>
</tr>
</table><p>
<table border=0 with=65%>
<tr>
<td align=center colspan=2>
<b>{deleteheader}</b>
</td>
</tr>
<tr>
<td>
<!-- {nolink} -->
<form action="{cancel_action}" method="POST">
{common_hidden_vars}
<INPUT type="submit" value="{lang_cancel}">
</form>
</td>
<td>
<!-- {yeslink} -->
<form action="{delete_action}" method="POST">
{common_hidden_vars}
<INPUT type="submit" value="{lang_delete}">
</form>
</td>
</tr>
</table>
</center>

View File

@ -0,0 +1,161 @@
<SCRIPT language="JavaScript">
function doSearch(field,ask)
{
field.value = prompt(ask,"");
if (field.value != 'null') {
if (field.value.length == 0)
field.value = field.value + '%';
field.form.submit.click();
} else
field.value = '';
}
</script>
{info_css}
<p class=action>{lang_info_action}<br>
<hr noshade width="98%" align="center" size="1">
<center>{error_list}</center>
<center>
<form method="POST" name="EditorForm" action="{actionurl}">
{common_hidden_vars}
<table width="90%" border="0" cellspacing="0" cellpadding="2">
<!-- BEGIN subpro -->
<tr>
<td colspan="2">{lang_project}:</td>
<td colspan="2">{lang_projdesc}</td>
</tr>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<!-- END subpro -->
<tr>
<td>{lang_type}:</td>
<td>{type_list}</td>
<td>{lang_owner}:</td>
<td>{owner_info}</td>
</tr>
<tr>
<td><input type="hidden" name="projectsearch" value="">
<input type="button" onClick="doSearch(this.form.projectsearch,'{lang_proj_prompt}')" value="{lang_prproject}"></td>
<td colspan="3">{project}</td>
</tr>
<tr>
<td><input type="hidden" name="addrsearch" value="">
<input type="button" onClick="doSearch(this.form.addrsearch,'{lang_addr_prompt}')" value="{lang_praddrbook}"></td>
<td colspan="3">{addrbook}</td>
</tr>
<tr>
<td colspan="4"><hr size="1"></td>
</tr>
<tr>
<td>{lang_prfrom}:</td>
<td colspan="3"><input name="from" size="64" maxlength="64" value="{fromval}"></td>
</tr>
<tr>
<td>{lang_praddr}:</td>
<td colspan="3"><input name="addr" size="64" maxlength="64" value="{addrval}"></td>
</tr>
<tr>
<td colspan="4"><hr size="1"></td>
</tr>
<tr>
<td>{lang_prsubject}:</td>
<td colspan="3"><input name="subject" size="64" maxlength="64" value="{subjectval}"></td>
</tr>
<tr>
<td valign="top">{lang_prdesc}:</td>
<td colspan="3"><textarea name="des" rows=4 cols=50 wrap="VIRTUAL">{descval}</textarea></td>
</tr>
<tr>
<td colspan="4"><hr size="1"></td>
</tr>
<tr>
<td width="15%">{lang_start_date}:</td>
<td width="40%">{start_select_date}</td>
<td width="15%">{lang_selfortoday}</td>
<td>{selfortoday}</td>
</tr>
<tr>
<td>{lang_end_date}:</td>
<td>{end_select_date}</td>
<td>{lang_dur_days}</td>
<td><input name="dur_days" size="3" maxlength="2" value="">&nbsp;{dur_days}</td>
</tr>
<tr>
<td colspan="4"><hr size="1"></td>
</tr>
<tr>
<td>{lang_status}:</td>
<td>{status_list}</td>
<td>{lang_category}</td>
<td><select name="info_cat"><option value="0">{lang_none}</option>{cat_list}</select></td>
</tr>
<tr>
<td>{lang_priority}:</td>
<td>{priority_list}</td>
<td>{lang_confirm}</td>
<td>{confirm_list}</td>
</tr>
<tr>
<td>{lang_responsible}:</td>
<td>{responsible_list}</td>
<td>{lang_access_type}:</td>
<td>{access_list}</td>
</tr>
</table>
<!-- BEGIN add -->
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td height="35" width="50%">
<div align="center">
<input type="submit" name="submit" value="{lang_addsubmitb}">
</div>
</td>
<td height="35" width="50%">
<div align="center">
<input type="reset" name="reset" value="{lang_addresetb}">
</div>
</td>
</tr>
</table>
</form>
</center>
</html>
<!-- END add -->
<!-- BEGIN edit -->
<table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td height="62">
{edit_button}
&nbsp;
</form>
</td>
<td height="62">
<form action="{delete_action}" method="POST">
{common_hidden_vars}
{delete_button}
</form>
</td>
</tr>
</table>
</center>
</html>
<!-- END edit -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

View File

@ -0,0 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>phpGroupWare Info Log Icons</title>
</head>
<body bgcolor=Silver>
Types:<br>
<img src="phone.gif" width="20" height="20" alt="Telefon" border="0"> &nbsp;
<img src="task.gif" width="20" height="20" alt="Aufgabe" border="0"> &nbsp;
<img src="note.gif" width="20" height="20" alt="Notiz" border="0"> &nbsp;
<img src="confirm.gif" width="20" height="20" alt="Bestätigung" border="0"> &nbsp;
<img src="reject.gif" width="20" height="20" alt="Absage" border="0">
<p>
Status:<br>
<img src="offer.gif" width="20" height="20" alt="Angebot" border="0"> &nbsp;
<img src="ongoing.gif" width="20" height="20" alt="läuft" border="0"> &nbsp;
<img src="call.gif" width="20" height="20" alt="anrufen" border="0"> &nbsp;
<img src="will-call.gif" width="20" height="20" alt="ruft zurück" border="0">
&nbsp;
<img src="done.gif" width="20" height="20" alt="erledigt" border="0"> &nbsp;
<img src="billed.gif" width="20" height="20" alt="abgerechnet" border="0">
<p>
Actions:<br>
<img src="new.gif" width="20" height="20" alt="neue Teilaufgabe" border="0">
&nbsp;
<img src="view.gif" width="20" height="20" alt="Teilaufgagen anzeigen"
border="0"> &nbsp;
<img src="edit.gif" width="20" height="20" alt="bearbeiten" border="0"> &nbsp;
<img src="delete.gif" width="20" height="20" alt="löschen" border="0">
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

View File

@ -0,0 +1,10 @@
p,td { font-face: "Arial, Helvetica, sans-serif"; }
.list { font-size:11pt; }
.action { font-size:18pt; margin-bottom:0px; }
.low,.pri_low_done { color:#606060; }
.normal,.pri_normal_done { color:black }
.high { color:#cc0000; } .high_done { color:#800000; }
.urgent { color:#ff00ff; } .urgent_done { color:#800080; }
.overdue { color:#cc0000; font-weight:bold; }
.private { font-style:italic; }
.note { color:#808080; font-style:italic; }

View File

@ -0,0 +1,91 @@
{info_css}
<p class=action>{lang_info_action}</p>
<hr noshade width="98%" align="center" size="1">
<center>
<!-- BEGIN projdetails -->
<table width=95% border=0 cellspacing=1 cellpadding=3>
<tr bgcolor="{th_bg}">
<td width="3%" class=list>{lang_type}</td>
<td width="5%" class=list>{lang_status}</td>
<td class=list>{lang_subject}</td>
<td width="10%" class=list>{lang_startdate}<br> <!-- </td>
<td width="10%" class=list>-->{lang_enddate}</td>
<td width="10%" class=list>{lang_owner}<br>{lang_datecreated}</td>
<td width="10%" class=list>{lang_responsible}</td>
</tr>
<tr bgcolor="{th_bg}" valign="top">
<td class=list>{type}</td>
<td class=list>{status}</td>
<td class=list>{subject}<br>{des}</td>
<td class=list>{startdate}<br><!-- </td>
<td class=list>-->{enddate}</td>
<td class=list>{owner}<br>{datecreated}</td>
<td class=list">{responsible}</td>
</tr>
</table><p>
<!-- END projdetails -->
<TABLE><tr valign="middle"><td>
<form method="POST" name="cat" action="{cat_form}">
{lang_category}
<select name="cat_filter" onChange="this.form.submit();">
<option value="0">{lang_all}</option>
{categories}
</select>
<noscript><input type="submit" name="cats" value="{lang_select}"></noscript>
</form>
</td><td>
{total_matchs}
</td></tr></table>
{next_matchs}
<table width=95% border=0 cellspacing=1 cellpadding=3>
<tr bgcolor="{th_bg}">
<td width="2%" class=list>{sort_type}</td>
<td width="4%" class=list>{sort_status}</td>
<td class=list>{sort_subject}</td>
<td width="5%" class=list>{sort_startdate}<br> <!-- </td>
<td width="5%" class=list>-->{sort_enddate}</td>
<td width="5%" class=list>{sort_owner}<br>{sort_datecreated}</td>
<td width="7%" class=list>{sort_responsible}</td>
<td width="3%" class=list>{h_lang_sub}</td>
<td width="3%" class=list>{h_lang_action}</td>
</tr>
</form>
<!-- BEGIN info_list -->
<tr bgcolor="{tr_color}" valign="top">
<td class=list>{type}</td>
<td class=list>{status}</td>
<td class=list>{subject}<br>
{des}</td>
<td class=list>{startdate}<br> <!--</td>
<td class=list>-->{enddate}</td>
<td class=list>{owner}<br>{datecreated}</td>
<td class=list>{responsible}</td>
<td class=list>{subadd}
{viewsub}
{viewparent}</td>
<td class=list>{edit}&nbsp;{delete}</td>
</tr>
<!-- END info_list -->
</table>
<form method="POST" action="{actionurl}">
{common_hidden_vars}
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4%">
<div align="right">
<input type="submit" name="Add" value="{lang_add}">
</div>
</td>
<td width="72%">&nbsp;</td>
<td width="24%">&nbsp;</td>
</tr>
<tr>
<td colspan="3">{lang_back2projects}<!-- {lang_matrixviewhref} --></td>
</tr>
</table>
</form>
</center>

View File

@ -0,0 +1,25 @@
{errors}
{title}
<table border="0" align="center" width="70%">
<tr>
{nml}
<td width="40%">
<div align="center">
<form method="POST" action="{action_url}">
{common_hidden_vars}
<input type="text" name="query" value="{search_value}">
<input type="submit" name="search" value="{search}">
</form>
</div>
</td>
{nmr}
</tr>
</table>
<form method="POST" action="{action_url}">
<table border="0" align="center" width="50%">
{row}
</table>
{common_hidden_vars_form}
<input type="hidden" name="processed" value="{processed}">
<center><input type="submit" name="submit" value="{submit_lang}"></center>
</form>

View File

@ -0,0 +1,9 @@
<!-- $Id$ -->
<tr bgcolor="{row_color}">
<td>{user}</td>
<td align="center"><input type="checkbox" name="{read}" value="Y"{read_selected}></td>
<td align="center"><input type="checkbox" name="{add}" value="Y"{add_selected}></td>
<td align="center"><input type="checkbox" name="{edit}" value="Y"{edit_selected}></td>
<td align="center"><input type="checkbox" name="{delete}" value="Y"{delete_selected}></td>
<td align="center"><input type="checkbox" name="{private}" value="Y"{private_selected}></td>
</tr>

View File

@ -0,0 +1,8 @@
<tr bgcolor="{bg_color}">
<td>{string}</td>
<td align="center" width="8%">{read_lang}</td>
<td align="center" width="8%">{add_lang}</td>
<td align="center" width="8%">{edit_lang}</td>
<td align="center" width="8%">{delete_lang}</td>
<td align="center" width="8%">{private_lang}</td>
</tr>