getMonthText('emonth', $emonth),$sm->getDays('eday', $eday)));
+ $phpgw->template->set_var('lang_selfortoday',lang('Today'));
+ $phpgw->template->set_var('selfortoday',' ');
+ $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', 'info->data['info_access'] == 'private'?' checked':'') . '>');
+
+ $phpgw->template->set_var('delete_action',$phpgw->link('/info/delete.php'));
+
+ $phpgw->template->set_var('edit_button','');
+
+ if (!$action && $phpgw->info->check_access($info_id,PHPGW_ACL_DELETE)) {
+ $phpgw->template->set_var('delete_button','');
+ }
+ $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();
diff --git a/infolog/inc/about.inc.php b/infolog/inc/about.inc.php
new file mode 100644
index 0000000000..fb2cbba77e
--- /dev/null
+++ b/infolog/inc/about.inc.php
@@ -0,0 +1,8 @@
+Info Logwritten by Ralf Becker
adopted from todo written by Joseph Engo";
+
+ return $s;
+ }
\ No newline at end of file
diff --git a/infolog/inc/class.info.inc.php b/infolog/inc/class.info.inc.php
new file mode 100644
index 0000000000..b09621a1fb
--- /dev/null
+++ b/infolog/inc/class.info.inc.php
@@ -0,0 +1,402 @@
+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 "
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 "
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 ? "' : '');
+ }
+
+ function setStyleSheet( ) {
+ global $phpgw;
+ return array ( 'info_css' => '' );
+ }
+
+ function loadStyleSheet( ) {
+ list( $style ) = $this->setStyleSheet(); echo $style;
+ }
+
+ function accountInfo($id,$account_data=0) {
+ global $phpgw;
+
+ if (!$id) return ' ';
+
+ 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 = "\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 = "";
+
+ if ($p_id != ($proj_id = $info['info_proj_id']) && $proj = $this->readProj($proj_id)) {
+ $subject .= ''.$proj['title'].'';
+ }
+ if ($a_id != ($addr_id = $info['info_addr_id']) && $addr = $this->readAddr($addr_id)) {
+ if ($proj) $subject .= '
';
+ $addr = $this->addr2name( $addr );
+ $subject .= '$addr";
+ }
+ if (($from = $info['info_from']) && (!$addr || !strstr($addr,$from))) {
+ if ($addr) $subject .= '
';
+ $subject .= ''.$from.'';
+ }
+ if ($info['info_addr']) {
+ if ($addr || $from) $subject .= ': ';
+ $subject .= $info['info_addr'];
+ }
+ if ($proj || $addr || $from || $info['info_addr']) {
+ $subject .= '
';
+ }
+ $subject .= ''.$info['info_subject'].'';
+
+ if (!$info['info_enddate']) {
+ $enddate = ' ';
+ } 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 = "$enddate";
+ }
+ 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 = "$owner";
+
+ 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 "
grants: user=$user, grant=$grant
";
+ 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 "aclFilter('$filter')(user='$user') = '$filtermethod'
";
+
+ 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 '
edit(): query: '.$query;
+
+ $this->db->query($query,__LINE__,__FILE__);
+ }
+ }
\ No newline at end of file
diff --git a/infolog/inc/header.inc.php b/infolog/inc/header.inc.php
new file mode 100644
index 0000000000..e80ce56e07
--- /dev/null
+++ b/infolog/inc/header.inc.php
@@ -0,0 +1,16 @@
+
\ No newline at end of file
diff --git a/infolog/inc/hook_admin.inc.php b/infolog/inc/hook_admin.inc.php
new file mode 100644
index 0000000000..92a7aec590
--- /dev/null
+++ b/infolog/inc/hook_admin.inc.php
@@ -0,0 +1,20 @@
+common->image($appname,'navbar.gif');
+ section_start($appname,$imgpath);
+
+ section_item($phpgw->link('/info/csv_import.php'),lang('CSV-Import'));
+
+ section_end();
+?>
\ No newline at end of file
diff --git a/infolog/inc/hook_info_about.inc.php b/infolog/inc/hook_info_about.inc.php
new file mode 100644
index 0000000000..fb2cbba77e
--- /dev/null
+++ b/infolog/inc/hook_info_about.inc.php
@@ -0,0 +1,8 @@
+Info Logwritten by Ralf Becker
adopted from todo written by Joseph Engo";
+
+ return $s;
+ }
\ No newline at end of file
diff --git a/infolog/inc/hook_preferences.inc.php b/infolog/inc/hook_preferences.inc.php
new file mode 100644
index 0000000000..b1502cfb14
--- /dev/null
+++ b/infolog/inc/hook_preferences.inc.php
@@ -0,0 +1,40 @@
+ *
+ * ------------------------------------------------------- *
+ * 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 "
\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();
+}
+?>
diff --git a/infolog/index.php b/infolog/index.php
new file mode 100644
index 0000000000..8158dbc31d
--- /dev/null
+++ b/infolog/index.php
@@ -0,0 +1,231 @@
+ *
+ * based on todo written by Joseph Engo *
+ * -------------------------------------------- *
+ * 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 =
+ ''
+ . ''
+ . ''
+ . ''
+ . ''
+ . '';
+
+ if ($action)
+ $common_hidden_vars .= '';
+
+ switch ($action) {
+ case 'sp': // Sub-List
+ $common_hidden_vars .= '';
+ $phpgw->template->set_var(lang_info_action,lang('Info Log - Subprojects from'));
+ break;
+ case 'proj':
+ $common_hidden_vars .= '';
+ $proj = $phpgw->info->readProj($proj_id);
+ $phpgw->template->set_var(lang_info_action,lang('Info Log').' - '.$proj['title']);
+ break;
+ case 'addr':
+ $common_hidden_vars .= '';
+ $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','' . $phpgw->info->icon('action','edit') . '');
+ } else {
+ $phpgw->template->set_var('edit','');
+ }
+
+ if ($phpgw->info->check_access($db->f('info_id'),PHPGW_ACL_DELETE)) {
+ $phpgw->template->set_var('delete','' . $phpgw->info->icon('action','delete') . '');
+ } 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', '' . $phpgw->info->icon('action','view') . '');
+ } else { // else display ADD SUB-Icon
+ if ($phpgw->info->check_access($db->f('info_id'),PHPGW_ACL_ADD)) {
+ $phpgw->template->set_var('subadd', '' . $phpgw->info->icon('action','new') . '');
+ }
+ } // if parent --> display VIEW SUBS of Parent
+ if ($db->f('info_id_parent') && $action != 'sp') {
+ $phpgw->template->set_var('viewparent', '' . $phpgw->info->icon('action','parent') . '');
+ }
+
+ $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', '
'.lang('Back to Projectlist').'');
+ }
+
+ // get actual date and year for matrixview arguments
+/* $year = date('Y');
+ $month = date('m');
+ $phpgw->template->set_var('lang_matrixviewhref', '
'.lang('View Matrix of actual Month').''); */
+ // ============================================
+ // 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();
+?>
diff --git a/infolog/setup/details.inc.php b/infolog/setup/details.inc.php
new file mode 100644
index 0000000000..b4429f37c9
--- /dev/null
+++ b/infolog/setup/details.inc.php
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/infolog/setup/setup_info.inc.php b/infolog/setup/setup_info.inc.php
new file mode 100644
index 0000000000..6a16a6e0ab
--- /dev/null
+++ b/infolog/setup/setup_info.inc.php
@@ -0,0 +1,3 @@
+ "InfoLog", "app_order" => 1, "version" => "0.1");
+?>
diff --git a/infolog/templates/default/csv_import.tpl b/infolog/templates/default/csv_import.tpl
new file mode 100644
index 0000000000..bdc02eb36c
--- /dev/null
+++ b/infolog/templates/default/csv_import.tpl
@@ -0,0 +1,65 @@
+{info_css}{lang_info_action}
+
+
+
+
+
+
diff --git a/infolog/templates/default/delete.tpl b/infolog/templates/default/delete.tpl
new file mode 100644
index 0000000000..ac5195a0d3
--- /dev/null
+++ b/infolog/templates/default/delete.tpl
@@ -0,0 +1,50 @@
+{info_css}
+ {lang_info_action}
+
+
+
+
+ {lang_type} |
+ {lang_status} |
+ {lang_subject} |
+ {lang_startdate} |
+ {lang_enddate} |
+ {lang_owner} |
+ {lang_responsible} |
+
+
+ {type} |
+ {status} |
+ {subject} |
+ {startdate} |
+ {enddate} |
+ {owner} {datecreated} |
+ {responsible} |
+
+
+
+
+
+
+ {deleteheader}
+ |
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
\ No newline at end of file
diff --git a/infolog/templates/default/form.tpl b/infolog/templates/default/form.tpl
new file mode 100644
index 0000000000..fb00bedbf3
--- /dev/null
+++ b/infolog/templates/default/form.tpl
@@ -0,0 +1,161 @@
+
+
+{info_css}
+ {lang_info_action}
+
+
+ {error_list}
+
+
+
+
+