diff --git a/infolog/inc/class.infolog_bo.inc.php b/infolog/inc/class.infolog_bo.inc.php index d3b908e9f1..279e599c55 100644 --- a/infolog/inc/class.infolog_bo.inc.php +++ b/infolog/inc/class.infolog_bo.inc.php @@ -162,9 +162,8 @@ class infolog_bo * Constructor Infolog BO * * @param int $info_id - * @param boolean $instanciate_link=true should the link class be instanciated, used by the link-registry to prevent infinit recursion */ - function __construct($info_id = 0,$instanciate_link=true) + function __construct($info_id = 0) { $this->enums = $this->stock_enums = array( 'priority' => array ( @@ -209,7 +208,7 @@ class infolog_bo { if (isset($config_data['status']) && is_array($config_data['status'])) { - foreach($config_data['status'] as $key => $data) + foreach(array_keys($config_data['status']) as $key) { if (!is_array($this->status[$key])) { @@ -305,7 +304,7 @@ class infolog_bo { if ($links) $link_types = customfields_widget::get_customfield_link_types(); - foreach($this->customfields as $name => $field) + foreach($this->customfields as $field) { if ((!$type || empty($field['type2']) || in_array($type,explode(',',$field['type2']))) && (!$links || in_array($field['type'],$link_types))) @@ -866,7 +865,7 @@ class infolog_bo $values['info_owner'] = $this->so->user; } - if ($info_from_set = ($values['info_link_id'] && isset($values['info_from']) && empty($values['info_from']))) + if (($info_from_set = ($values['info_link_id'] && isset($values['info_from']) && empty($values['info_from'])))) { $values['info_from'] = $this->link_id2from($values); } @@ -932,7 +931,7 @@ class infolog_bo } $values['info_id'] = $info_id; $to_write['info_id'] = $info_id; - + error_log(__LINE__); error_log(array2string($values)); // if the info responbsible array is not passed, fetch it from old. @@ -967,7 +966,7 @@ class infolog_bo { // Some custom fields (multiselect with nothing selected) will be missing, // and that's OK. Don't put them back. - foreach($missing_fields as $field => $m_value) + foreach(array_keys($missing_fields) as $field) { if(array_key_exists($field, $values_in)) { @@ -1266,7 +1265,7 @@ class infolog_bo $content = array(); if (is_array($ids)) { - foreach ($ids as $id => $info ) + foreach(array_keys($ids) as $id) { $content[$id] = $this->link_title($id); } @@ -1285,6 +1284,7 @@ class infolog_bo */ function file_access($id,$check,$rel_path=null,$user=null) { + unset($rel_path); // not used return $this->check_access($id,$check,0,$user); } @@ -1341,18 +1341,10 @@ class infolog_bo foreach ($infos as $info) { $start = new egw_time($info['info_startdate'],egw_time::$user_timezone); - $time = (int) $start->format('Hi'); - $date = $start->format('Y/m/d'); - /* As event-like infologs are not showen in current calendar, - we need to present all open infologs to the user! (2006-06-27 nelius) - if ($do_events && !$time || - !$do_events && $time && $date == $date_wanted) - { - continue; - }*/ $title = ($do_events?common::formattime($start->format('H'),$start->format('i')).' ':''). $info['info_subject']; $view = egw_link::view('infolog',$info['info_id']); + $size = null; $edit = egw_link::edit('infolog',$info['info_id'], $size); $edit['size'] = $size; $content=array(); @@ -1364,7 +1356,7 @@ class infolog_bo $content[] = html::image($app,$name,lang($name),'border="0" width="15" height="15"').' '; } $content[] = html::a_href($title,$view); - $content = html::table(array(1 => $content)); + $html = html::table(array(1 => $content)); $to_include[] = array( 'starttime' => $info['info_startdate'], @@ -1373,7 +1365,7 @@ class infolog_bo 'view' => $view, 'edit' => $edit, 'icons' => $icons, - 'content' => $content + 'content' => $html, ); } if ($query['total'] <= ($query['start']+=count($infos))) @@ -1400,7 +1392,7 @@ class infolog_bo 'subs' => true, 'cols' => 'info_id,info_type,info_status,info_percent,info_id_parent', ); - $ids = $infos = array(); + $infos = array(); foreach($this->search($query) as $row) { $infos[$row['info_id']] = array( @@ -1747,9 +1739,10 @@ class infolog_bo $parentID = False; $myfilter = array('col_filter' => array('info_uid'=>$_guid)) ; - if ($_guid && ($found=$this->search($myfilter)) && ($uidmatch = array_shift($found))) { + if ($_guid && ($found=$this->search($myfilter)) && ($uidmatch = array_shift($found))) + { $parentID = $uidmatch['info_id']; - }; + } return $parentID; } @@ -1814,6 +1807,7 @@ class infolog_bo . "()[description]: $description"); } // Avoid quotation problems + $matches = null; if (preg_match_all('/[\x20-\x7F]*/m', $text, $matches, PREG_SET_ORDER)) { $text = ''; diff --git a/infolog/inc/class.infolog_so.inc.php b/infolog/inc/class.infolog_so.inc.php index 160af0ce21..67894c0d1c 100644 --- a/infolog/inc/class.infolog_so.inc.php +++ b/infolog/inc/class.infolog_so.inc.php @@ -189,6 +189,7 @@ class infolog_so */ function aclFilter($filter = False) { + $vars = null; preg_match('/(my|responsible|delegated|own|privat|private|all|user)([0-9,-]*)/',$filter_was=$filter,$vars); $filter = $vars[1]; $f_user = $vars[2]; @@ -278,6 +279,7 @@ class infolog_so */ function statusFilter($filter = '',$prefix_and=true) { + $vars = null; preg_match('/(done|open|offer|deleted|\+deleted)/',$filter,$vars); $filter = $vars[1]; @@ -306,6 +308,7 @@ class infolog_so */ function dateFilter($filter = '') { + $vars = null; preg_match('/(open-upcoming|upcoming|today|overdue|date|enddate)([-\\/.0-9]*)/',$filter,$vars); $filter = $vars[1]; @@ -494,9 +497,8 @@ class infolog_so $new_responsible = explode(',',$row['info_responsible']); unset($new_responsible[array_search($args['account_id'],$new_responsible)]); if ((int)$args['new_owner']) $new_responsible[] = (int)$args['new_owner']; - $new_responsible = implode(',',$new_responsible); $this->db->update($this->info_table,array( - 'info_responsible' => $new_responsible, + 'info_responsible' => implode(',',$new_responsible), ),array('info_id' => $row['info_id']),__LINE__,__FILE__,'infolog'); } @@ -713,7 +715,7 @@ class infolog_so } else { - static $table_def; + static $table_def = null; if (is_null($table_def)) $table_def = $this->db->get_table_definitions('infolog',$this->info_table); if (substr($val,0,5) != 'info_' && isset($table_def['fd']['info_'.$val])) $val = 'info_'.$val; if ($val == 'info_des' && $this->db->capabilities['order_on_text'] !== true) @@ -731,7 +733,7 @@ class infolog_so { $ordermethod = 'ORDER BY info_datemodified DESC'; // newest first } - $acl_filter = $filtermethod = $this->aclFilter($query['filter']); + $filtermethod = $this->aclFilter($query['filter']); if (!$query['col_filter']['info_status']) $filtermethod .= $this->statusFilter($query['filter']); $filtermethod .= $this->dateFilter($query['filter']); $cfcolfilter=0; @@ -820,12 +822,11 @@ class infolog_so ctype_digit($query['search'] ? ' UNION (SELECT '.$this->db->quote($query['search']).')' : '').')'; */ /* old code searching the table direct */ - $pattern = ' '.$this->db->capabilities[egw_db::CAPABILITY_CASE_INSENSITIV_LIKE].' '.$this->db->quote('%'.$query['search'].'%'); - $columns = array('info_from','info_addr','info_location','info_subject','info_extra_value'); // at the moment MaxDB 7.5 cant cast nor search text columns, it's suppost to change in 7.6 if ($this->db->capabilities['like_on_text']) $columns[] = 'info_des'; + $wildcard = $op = null; $search = so_sql::search2criteria($query['search'], $wildcard, $op, null, $columns); $sql_query = 'AND ('.(is_numeric($query['search']) ? 'main.info_id='.(int)$query['search'].' OR ' : ''). implode($op, $search) .')'; @@ -892,7 +893,7 @@ class infolog_so $ids[$info['info_id']] = $info; } - static $index_load_cfs; + static $index_load_cfs = null; if (is_null($index_load_cfs) && $query['col_filter']['info_type']) { $config_data = config::read('infolog'); diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index b4f406be2c..8901af1d75 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -357,7 +357,6 @@ class infolog_ui { $infos = array( ); } - $details = $query['filter2'] == 'all'; // add a '-details' to the name of the columnselection pref if ($details) { @@ -420,7 +419,7 @@ class infolog_ui { if ($col[0] == '#') { - foreach($main as $n => $v) + foreach(array_keys($main) as $n) { if ($n[0] == '#' && !in_array($n, $columselection)) unset($main[$n]); } @@ -593,7 +592,7 @@ class infolog_ui } } // Copy same custom fields - foreach(config::get_customfields('calendar') as $name => $settings) + foreach(array_keys(config::get_customfields('calendar')) as $name) { if ($this->bo->customfields[$name]) $event['#'.$name] = $infolog['#'.$name]; } @@ -615,6 +614,7 @@ class infolog_ui */ function index($values = null,$action='',$action_id='',$called_as=0,$extra_app_header=False,$return_html=False,$own_referer='',$action_title='') { + unset($extra_app_header); // not used, but dont want to change signature if (is_array($values)) { $called_as = $values['called_as']; @@ -682,6 +682,7 @@ class infolog_ui unset($values[$multi_action.'_popup']); unset($values[$multi_action]); } + $success = $failed = $action_msg = null; if ($this->action($values['nm']['multi_action'], $values['nm']['selected'], $values['nm']['select_all'], $success, $failed, $action_msg, $values['nm'], $msg, $values['nm']['checkboxes']['no_notifications'])) { @@ -774,8 +775,8 @@ class infolog_ui } else { - list($do,$do_id) = isset($values['main']) ? each($values['main']) : @each($values['nm']['rows']); - list($do_id) = @each($do_id); + list($do,$do2) = isset($values['main']) ? each($values['main']) : @each($values['nm']['rows']); + list($do_id) = @each($do2); switch((string)$do) { case 'close': @@ -820,7 +821,6 @@ class infolog_ui $readonlys['cancel'] = $action != 'sp'; $this->tmpl->read('infolog.index'); - if ($colfilter) $values['nm']['col_filter'] = $persist['col_filter'] = $colfilter; $values['nm']['options-filter'] = $this->filters; $values['nm']['get_rows'] = 'infolog.infolog_ui.get_rows'; $values['nm']['options-filter2'] = (in_array($this->prefs['show_links'],array('all','no_describtion')) ? array() : array( @@ -854,7 +854,7 @@ class infolog_ui if (!$values['main']['no_customfields']) { // set the column-header of the main table for the customfields. - foreach($this->bo->customfields as $lname => $data) + foreach(array_keys($this->bo->customfields) as $lname) { $values['main']['customfields'].=$lname."\n"; } @@ -863,7 +863,10 @@ class infolog_ui $values['nm']['header_right'] = 'infolog.index.header_right'; if ($values['nm']['filter']=='bydate') { - foreach (array_keys($values['nm']['col_filter']) as $colfk) if (is_int($colfk)) unset($values['nm']['col_filter']); + foreach (array_keys($values['nm']['col_filter']) as $colfk) + { + if (is_int($colfk)) unset($values['nm']['col_filter']); + } } $values['action'] = $persist['action'] = $values['nm']['action'] = $action; $values['action_id'] = $persist['action_id'] = $values['nm']['action_id'] = $action_id; @@ -887,7 +890,7 @@ class infolog_ui $this->tmpl->set_dom_id("{$this->tmpl->name}-$action-$action_id"); } // add scrollbar to long description, if user choose so in his prefs - if ($this->prefs['limit_des_lines'] > 0 || (string)$this->prefs['limit_des_lines'] == ''); + if ($this->prefs['limit_des_lines'] > 0 || (string)$this->prefs['limit_des_lines'] == '') { $values['css'] .= '