@@ -25,11 +25,11 @@ |
||
25 | 25 | // Used in conversions |
26 | 26 | static $types = array( |
27 | 27 | 'select' => array('info_type', 'info_status', 'info_priority', 'pl_id'), |
28 | - 'select-cat' => array('info_cat'), |
|
29 | - 'select-account' => array('info_owner','info_responsible','info_modifier'), |
|
30 | - 'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','info_created'), |
|
28 | + 'select-cat' => array('info_cat'), |
|
29 | + 'select-account' => array('info_owner','info_responsible','info_modifier'), |
|
30 | + 'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','info_created'), |
|
31 | 31 | 'links' => array('info_link_id'), |
32 | - ); |
|
32 | + ); |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * constructor |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | static $types = array( |
27 | 27 | 'select' => array('info_type', 'info_status', 'info_priority', 'pl_id'), |
28 | 28 | 'select-cat' => array('info_cat'), |
29 | - 'select-account' => array('info_owner','info_responsible','info_modifier'), |
|
30 | - 'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','info_created'), |
|
29 | + 'select-account' => array('info_owner', 'info_responsible', 'info_modifier'), |
|
30 | + 'date-time' => array('info_startdate', 'info_enddate', 'info_datecompleted', 'info_datemodified', 'info_created'), |
|
31 | 31 | 'links' => array('info_link_id'), |
32 | 32 | ); |
33 | 33 | |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @param string $_identifier |
39 | 39 | */ |
40 | - public function __construct( $_identifier='' ){ |
|
40 | + public function __construct($_identifier = '') { |
|
41 | 41 | $this->identifier = $_identifier; |
42 | - if(self::$bo == null) self::$bo = new infolog_bo(); |
|
43 | - if($_identifier) { |
|
42 | + if (self::$bo == null) self::$bo = new infolog_bo(); |
|
43 | + if ($_identifier) { |
|
44 | 44 | $rec = self::$bo->read($this->identifier); |
45 | 45 | if (is_array($rec)) $this->set_record($rec); |
46 | 46 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @todo add some checks |
96 | 96 | * @return void |
97 | 97 | */ |
98 | - public function set_record(array $_record){ |
|
98 | + public function set_record(array $_record) { |
|
99 | 99 | $this->record = $_record; |
100 | 100 | } |
101 | 101 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @return string identifier |
135 | 135 | */ |
136 | - public function save ( $_dst_identifier ) { |
|
136 | + public function save($_dst_identifier) { |
|
137 | 137 | |
138 | 138 | } |
139 | 139 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param string $_dst_identifier |
144 | 144 | * @return string dst_identifier |
145 | 145 | */ |
146 | - public function copy ( $_dst_identifier ) { |
|
146 | + public function copy($_dst_identifier) { |
|
147 | 147 | |
148 | 148 | } |
149 | 149 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @param string $_dst_identifier |
155 | 155 | * @return string dst_identifier |
156 | 156 | */ |
157 | - public function move ( $_dst_identifier ) { |
|
157 | + public function move($_dst_identifier) { |
|
158 | 158 | |
159 | 159 | } |
160 | 160 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | * delets current record from backend |
163 | 163 | * |
164 | 164 | */ |
165 | - public function delete () { |
|
165 | + public function delete() { |
|
166 | 166 | |
167 | 167 | } |
168 | 168 |
@@ -37,12 +37,20 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @param string $_identifier |
39 | 39 | */ |
40 | - public function __construct( $_identifier='' ){ |
|
40 | + public function __construct( $_identifier='' ) |
|
41 | + { |
|
41 | 42 | $this->identifier = $_identifier; |
42 | - if(self::$bo == null) self::$bo = new infolog_bo(); |
|
43 | - if($_identifier) { |
|
43 | + if(self::$bo == null) |
|
44 | + { |
|
45 | + self::$bo = new infolog_bo(); |
|
46 | + } |
|
47 | + if($_identifier) |
|
48 | + { |
|
44 | 49 | $rec = self::$bo->read($this->identifier); |
45 | - if (is_array($rec)) $this->set_record($rec); |
|
50 | + if (is_array($rec)) |
|
51 | + { |
|
52 | + $this->set_record($rec); |
|
53 | + } |
|
46 | 54 | } |
47 | 55 | } |
48 | 56 | |
@@ -51,7 +59,8 @@ discard block |
||
51 | 59 | * |
52 | 60 | * @param string $_attribute_name |
53 | 61 | */ |
54 | - public function __get($_attribute_name) { |
|
62 | + public function __get($_attribute_name) |
|
63 | + { |
|
55 | 64 | return $this->record[$_attribute_name]; |
56 | 65 | } |
57 | 66 | |
@@ -61,7 +70,8 @@ discard block |
||
61 | 70 | * @param string $_attribute_name |
62 | 71 | * @param data $data |
63 | 72 | */ |
64 | - public function __set($_attribute_name, $data) { |
|
73 | + public function __set($_attribute_name, $data) |
|
74 | + { |
|
65 | 75 | $this->record[$_attribute_name] = $data; |
66 | 76 | } |
67 | 77 | |
@@ -73,7 +83,8 @@ discard block |
||
73 | 83 | * |
74 | 84 | * @return array complete record as associative array |
75 | 85 | */ |
76 | - public function get_record_array() { |
|
86 | + public function get_record_array() |
|
87 | + { |
|
77 | 88 | return $this->record; |
78 | 89 | } |
79 | 90 | |
@@ -82,7 +93,8 @@ discard block |
||
82 | 93 | * |
83 | 94 | *@return string tiltle |
84 | 95 | */ |
85 | - public function get_title() { |
|
96 | + public function get_title() |
|
97 | + { |
|
86 | 98 | return self::$bo->link_title($this->record); |
87 | 99 | } |
88 | 100 | |
@@ -92,7 +104,8 @@ discard block |
||
92 | 104 | * @todo add some checks |
93 | 105 | * @return void |
94 | 106 | */ |
95 | - public function set_record(array $_record){ |
|
107 | + public function set_record(array $_record) |
|
108 | + { |
|
96 | 109 | $this->record = $_record; |
97 | 110 | } |
98 | 111 | |
@@ -101,7 +114,8 @@ discard block |
||
101 | 114 | * |
102 | 115 | * @return string identifier of current record |
103 | 116 | */ |
104 | - public function get_identifier() { |
|
117 | + public function get_identifier() |
|
118 | + { |
|
105 | 119 | return $this->identifier; |
106 | 120 | } |
107 | 121 | |
@@ -111,7 +125,8 @@ discard block |
||
111 | 125 | * |
112 | 126 | * @return string Full URL of an icon, or appname/icon_name |
113 | 127 | */ |
114 | - public function get_icon() { |
|
128 | + public function get_icon() |
|
129 | + { |
|
115 | 130 | $icon = 'infolog/navbar'; |
116 | 131 | $ui = new infolog_ui(); |
117 | 132 | if (!($icon = $ui->icons['type'][$this->info_type])) |
@@ -130,7 +145,8 @@ discard block |
||
130 | 145 | * |
131 | 146 | * @return string identifier |
132 | 147 | */ |
133 | - public function save ( $_dst_identifier ) { |
|
148 | + public function save ( $_dst_identifier ) |
|
149 | + { |
|
134 | 150 | |
135 | 151 | } |
136 | 152 | |
@@ -140,7 +156,8 @@ discard block |
||
140 | 156 | * @param string $_dst_identifier |
141 | 157 | * @return string dst_identifier |
142 | 158 | */ |
143 | - public function copy ( $_dst_identifier ) { |
|
159 | + public function copy ( $_dst_identifier ) |
|
160 | + { |
|
144 | 161 | |
145 | 162 | } |
146 | 163 | |
@@ -151,7 +168,8 @@ discard block |
||
151 | 168 | * @param string $_dst_identifier |
152 | 169 | * @return string dst_identifier |
153 | 170 | */ |
154 | - public function move ( $_dst_identifier ) { |
|
171 | + public function move ( $_dst_identifier ) |
|
172 | + { |
|
155 | 173 | |
156 | 174 | } |
157 | 175 | |
@@ -159,7 +177,8 @@ discard block |
||
159 | 177 | * delets current record from backend |
160 | 178 | * |
161 | 179 | */ |
162 | - public function delete () { |
|
180 | + public function delete () |
|
181 | + { |
|
163 | 182 | |
164 | 183 | } |
165 | 184 | |
@@ -167,7 +186,8 @@ discard block |
||
167 | 186 | * destructor |
168 | 187 | * |
169 | 188 | */ |
170 | - public function __destruct() { |
|
189 | + public function __destruct() |
|
190 | + { |
|
171 | 191 | } |
172 | 192 | |
173 | 193 | } // end of egw_addressbook_record |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $context['appname'] = 'infolog'; |
33 | 33 | |
34 | 34 | // Let parent handle the basic stuff |
35 | - parent::__construct($context,$need_reload); |
|
35 | + parent::__construct($context, $need_reload); |
|
36 | 36 | |
37 | 37 | $ui = new infolog_ui(); |
38 | 38 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type'])) |
74 | 74 | { |
75 | 75 | $query['template'] = $tpl->name; |
76 | - $query['custom_fields'] = true; // read the custom fields too |
|
76 | + $query['custom_fields'] = true; // read the custom fields too |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | $ui = new infolog_ui(); |
@@ -105,27 +105,27 @@ discard block |
||
105 | 105 | // Some processing to add values in for links and cats |
106 | 106 | $multi_action = $values['nm']['multi_action']; |
107 | 107 | // Action has an additional action - add / delete, etc. Buttons named <multi-action>_action[action_name] |
108 | - if(in_array($multi_action, array('link', 'responsible'))) |
|
108 | + if (in_array($multi_action, array('link', 'responsible'))) |
|
109 | 109 | { |
110 | 110 | // eTemplate ignores the _popup namespace, but et2 doesn't |
111 | - if($values[$multi_action.'_popup']) |
|
111 | + if ($values[$multi_action.'_popup']) |
|
112 | 112 | { |
113 | - $popup =& $values[$multi_action.'_popup']; |
|
113 | + $popup = & $values[$multi_action.'_popup']; |
|
114 | 114 | } |
115 | 115 | else |
116 | 116 | { |
117 | - $popup =& $values; |
|
117 | + $popup = & $values; |
|
118 | 118 | } |
119 | - $values['nm']['multi_action'] .= '_' . key($popup[$multi_action . '_action']); |
|
120 | - if($multi_action == 'link') |
|
119 | + $values['nm']['multi_action'] .= '_'.key($popup[$multi_action.'_action']); |
|
120 | + if ($multi_action == 'link') |
|
121 | 121 | { |
122 | - $popup[$multi_action] = $popup['link']['app'] . ':'.$popup['link']['id']; |
|
122 | + $popup[$multi_action] = $popup['link']['app'].':'.$popup['link']['id']; |
|
123 | 123 | } |
124 | - else if(is_array($popup[$multi_action])) |
|
124 | + else if (is_array($popup[$multi_action])) |
|
125 | 125 | { |
126 | - $popup[$multi_action] = implode(',',$popup[$multi_action]); |
|
126 | + $popup[$multi_action] = implode(',', $popup[$multi_action]); |
|
127 | 127 | } |
128 | - $values['nm']['multi_action'] .= '_' . $popup[$multi_action]; |
|
128 | + $values['nm']['multi_action'] .= '_'.$popup[$multi_action]; |
|
129 | 129 | unset($values[$multi_action.'_popup']); |
130 | 130 | unset($values[$multi_action]); |
131 | 131 | } |
@@ -133,24 +133,24 @@ discard block |
||
133 | 133 | if ($ui->action($values['nm']['multi_action'], $values['nm']['selected'], $values['nm']['select_all'], |
134 | 134 | $success, $failed, $action_msg, $values['nm'], $msg, $values['nm']['checkboxes']['no_notifications'])) |
135 | 135 | { |
136 | - $msg .= lang('%1 entries %2',$success,$action_msg); |
|
137 | - Api\Json\Response::get()->apply('egw.message',array($msg,'success')); |
|
138 | - foreach($values['nm']['selected'] as &$id) |
|
136 | + $msg .= lang('%1 entries %2', $success, $action_msg); |
|
137 | + Api\Json\Response::get()->apply('egw.message', array($msg, 'success')); |
|
138 | + foreach ($values['nm']['selected'] as &$id) |
|
139 | 139 | { |
140 | 140 | $id = 'infolog::'.$id; |
141 | 141 | } |
142 | 142 | // Directly request an update - this will get infolog tab too |
143 | - Api\Json\Response::get()->apply('egw.dataRefreshUIDs',array($values['nm']['selected'])); |
|
143 | + Api\Json\Response::get()->apply('egw.dataRefreshUIDs', array($values['nm']['selected'])); |
|
144 | 144 | } |
145 | - elseif(is_null($msg)) |
|
145 | + elseif (is_null($msg)) |
|
146 | 146 | { |
147 | - $msg .= lang('%1 entries %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed); |
|
148 | - Api\Json\Response::get()->apply('egw.message',array($msg,'error')); |
|
147 | + $msg .= lang('%1 entries %2, %3 failed because of insufficent rights !!!', $success, $action_msg, $failed); |
|
148 | + Api\Json\Response::get()->apply('egw.message', array($msg, 'error')); |
|
149 | 149 | } |
150 | - elseif($msg) |
|
150 | + elseif ($msg) |
|
151 | 151 | { |
152 | - $msg .= "\n".lang('%1 entries %2, %3 failed.',$success,$action_msg,$failed); |
|
153 | - Api\Json\Response::get()->apply('egw.message',array($msg,'error')); |
|
152 | + $msg .= "\n".lang('%1 entries %2, %3 failed.', $success, $action_msg, $failed); |
|
153 | + Api\Json\Response::get()->apply('egw.message', array($msg, 'error')); |
|
154 | 154 | } |
155 | 155 | unset($values['nm']['multi_action']); |
156 | 156 | unset($values['nm']['select_all']); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | * Construct the portlet |
28 | 28 | * |
29 | 29 | */ |
30 | - public function __construct(Array &$context = array(), &$need_reload = false) |
|
30 | + public function __construct(array &$context = array(), &$need_reload = false) |
|
31 | 31 | { |
32 | 32 | $context['appname'] = 'infolog'; |
33 | 33 |
@@ -21,13 +21,13 @@ |
||
21 | 21 | $bo = new infolog_tracking(new infolog_bo()); |
22 | 22 | $this->export_fields = array('info_id' => 'Infolog ID', 'pm_id' => 'Project ID', 'project' => 'Project Name') + $bo->field2label; |
23 | 23 | // Add in created date, in the appropriate place |
24 | - $first = array_splice($this->export_fields, 0, array_search('info_datemodified',array_keys($this->export_fields))); |
|
24 | + $first = array_splice($this->export_fields, 0, array_search('info_datemodified', array_keys($this->export_fields))); |
|
25 | 25 | $this->export_fields = array_merge($first, array('info_created'=>'creation'), $this->export_fields); |
26 | 26 | |
27 | 27 | // Custom fields |
28 | 28 | unset($this->export_fields['custom']); // Heading, not a real field |
29 | 29 | $custom = Api\Storage\Customfields::get('infolog', true); |
30 | - foreach($custom as $name => $data) { |
|
30 | + foreach ($custom as $name => $data) { |
|
31 | 31 | $this->export_fields['#'.$name] = $data['label']; |
32 | 32 | } |
33 | 33 | } |
@@ -14,7 +14,8 @@ discard block |
||
14 | 14 | |
15 | 15 | class infolog_wizard_export_csv extends importexport_wizard_basic_export_csv |
16 | 16 | { |
17 | - public function __construct() { |
|
17 | + public function __construct() |
|
18 | + { |
|
18 | 19 | parent::__construct(); |
19 | 20 | |
20 | 21 | // Field mapping |
@@ -27,7 +28,8 @@ discard block |
||
27 | 28 | // Custom fields |
28 | 29 | unset($this->export_fields['custom']); // Heading, not a real field |
29 | 30 | $custom = Api\Storage\Customfields::get('infolog', true); |
30 | - foreach($custom as $name => $data) { |
|
31 | + foreach($custom as $name => $data) |
|
32 | + { |
|
31 | 33 | $this->export_fields['#'.$name] = $data['label']; |
32 | 34 | } |
33 | 35 | } |
@@ -109,8 +109,8 @@ |
||
109 | 109 | */ |
110 | 110 | public function get_selectors_etpl() { |
111 | 111 | return array( |
112 | - 'name' => 'infolog.export_csv_selectors', |
|
113 | - 'content' => 'search' |
|
114 | - ); |
|
112 | + 'name' => 'infolog.export_csv_selectors', |
|
113 | + 'content' => 'search' |
|
114 | + ); |
|
115 | 115 | } |
116 | 116 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @param egw_record $_definition |
25 | 25 | */ |
26 | - public function export( $_stream, importexport_definition $_definition) { |
|
26 | + public function export($_stream, importexport_definition $_definition) { |
|
27 | 27 | $options = $_definition->plugin_options; |
28 | 28 | $this->bo = new infolog_bo(); |
29 | 29 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $ids = array(); |
34 | 34 | $query = array(); |
35 | - switch($options['selection']) |
|
35 | + switch ($options['selection']) |
|
36 | 36 | { |
37 | 37 | case 'search': |
38 | 38 | $query = array_merge(Api\Cache::getSession('infolog', 'session_data'), $query); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | break; |
46 | 46 | default: |
47 | - $ids = $this->selection = explode(',',$options['selection']); |
|
47 | + $ids = $this->selection = explode(',', $options['selection']); |
|
48 | 48 | break; |
49 | 49 | } |
50 | 50 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function get_filename() |
91 | 91 | { |
92 | - if(is_array($this->selection) && count($this->selection) == 1) |
|
92 | + if (is_array($this->selection) && count($this->selection) == 1) |
|
93 | 93 | { |
94 | 94 | return $this->bo->link_title(current($this->selection)); |
95 | 95 | } |
@@ -16,19 +16,24 @@ discard block |
||
16 | 16 | /** |
17 | 17 | * export iCal plugin of infolog |
18 | 18 | */ |
19 | -class infolog_export_ical extends infolog_export_csv { |
|
19 | +class infolog_export_ical extends infolog_export_csv |
|
20 | +{ |
|
20 | 21 | |
21 | 22 | /** |
22 | 23 | * Exports records as defined in $_definition |
23 | 24 | * |
24 | 25 | * @param egw_record $_definition |
25 | 26 | */ |
26 | - public function export( $_stream, importexport_definition $_definition) { |
|
27 | + public function export( $_stream, importexport_definition $_definition) |
|
28 | + { |
|
27 | 29 | $options = $_definition->plugin_options; |
28 | 30 | $this->bo = new infolog_bo(); |
29 | 31 | |
30 | 32 | $limit_exception = Api\Storage\Merge::is_export_limit_excepted(); |
31 | - if (!$limit_exception) $export_limit = Api\Storage\Merge::getExportLimit('infolog'); |
|
33 | + if (!$limit_exception) |
|
34 | + { |
|
35 | + $export_limit = Api\Storage\Merge::getExportLimit('infolog'); |
|
36 | + } |
|
32 | 37 | |
33 | 38 | $ids = array(); |
34 | 39 | $query = array(); |
@@ -57,7 +62,8 @@ discard block |
||
57 | 62 | * |
58 | 63 | * @return string name |
59 | 64 | */ |
60 | - public static function get_name() { |
|
65 | + public static function get_name() |
|
66 | + { |
|
61 | 67 | return lang('Infolog iCal export'); |
62 | 68 | } |
63 | 69 | |
@@ -66,7 +72,8 @@ discard block |
||
66 | 72 | * |
67 | 73 | * @return string descriprion |
68 | 74 | */ |
69 | - public static function get_description() { |
|
75 | + public static function get_description() |
|
76 | + { |
|
70 | 77 | return lang("Exports in iCal format."); |
71 | 78 | } |
72 | 79 | |
@@ -75,11 +82,13 @@ discard block |
||
75 | 82 | * |
76 | 83 | * @return string suffix |
77 | 84 | */ |
78 | - public static function get_filesuffix() { |
|
85 | + public static function get_filesuffix() |
|
86 | + { |
|
79 | 87 | return 'ics'; |
80 | 88 | } |
81 | 89 | |
82 | - public static function get_mimetype() { |
|
90 | + public static function get_mimetype() |
|
91 | + { |
|
83 | 92 | return 'text/infolog'; |
84 | 93 | } |
85 | 94 | |
@@ -118,7 +127,8 @@ discard block |
||
118 | 127 | * returns selectors of this plugin |
119 | 128 | * |
120 | 129 | */ |
121 | - public function get_selectors_etpl() { |
|
130 | + public function get_selectors_etpl() |
|
131 | + { |
|
122 | 132 | return array( |
123 | 133 | 'name' => 'infolog.export_csv_selectors', |
124 | 134 | 'content' => 'search' |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * Exports records as defined in $_definition |
29 | 29 | * |
30 | - * @param egw_record $_definition |
|
30 | + * @param importexport_definition $_definition |
|
31 | 31 | */ |
32 | 32 | public function export( $_stream, importexport_definition $_definition) { |
33 | 33 | $options = $_definition->plugin_options; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * |
229 | 229 | * @param $definition Specific definition |
230 | 230 | * |
231 | - * @return array ( |
|
231 | + * @return boolean ( |
|
232 | 232 | * name => string, |
233 | 233 | * content => array, |
234 | 234 | * sel_options => array, |
@@ -225,7 +225,7 @@ |
||
225 | 225 | |
226 | 226 | if ($show_links != 'none' && $show_links != 'no_describtion' && |
227 | 227 | $link['link_id'] != $info['info_link_id'] && |
228 | - ($link['app'] != $action || $link['id'] != $action_id) && |
|
228 | + ($link['app'] != $action || $link['id'] != $action_id) && |
|
229 | 229 | ($show_links == 'all' || ($show_links == 'links') === ($link['app'] != Link::VFS_APPNAME))) |
230 | 230 | { |
231 | 231 | $info['filelinks'][] = $link; |
@@ -295,6 +295,8 @@ discard block |
||
295 | 295 | * @param array &$query |
296 | 296 | * @param array &$rows |
297 | 297 | * @param array &$readonlys |
298 | + * @param type|null $rows |
|
299 | + * @param type|null $readonlys |
|
298 | 300 | * @return int |
299 | 301 | */ |
300 | 302 | function get_rows(&$query,&$rows,&$readonlys) |
@@ -575,7 +577,6 @@ discard block |
||
575 | 577 | * Hook for timesheet to set some extra data and links |
576 | 578 | * |
577 | 579 | * @param array $data |
578 | - * @param int $data[id] info_id |
|
579 | 580 | * @return array with key => value pairs to set in new timesheet and link_app/link_id arrays |
580 | 581 | */ |
581 | 582 | function timesheet_set($data) |
@@ -601,7 +602,6 @@ discard block |
||
601 | 602 | * Hook for calendar to set some extra data and links |
602 | 603 | * |
603 | 604 | * @param array $data event-array preset by calendar plus |
604 | - * @param int $data[entry_id] info_id |
|
605 | 605 | * @return array with key => value pairs to set in new event and link_app/link_id arrays |
606 | 606 | */ |
607 | 607 | function calendar_set($data) |
@@ -691,9 +691,6 @@ discard block |
||
691 | 691 | * Since the hook has no idea about infolog or preferences, we add the user's |
692 | 692 | * current sorting for infolog here so they're in the expected order |
693 | 693 | * |
694 | - * @param int $args[year], $args[month], $args[day] date of the events |
|
695 | - * @param int $args[owner] owner of the events |
|
696 | - * @param string $args[location] calendar_include_{events|todos} |
|
697 | 694 | * @return array of events (array with keys starttime, endtime, title, view, icon, content) |
698 | 695 | */ |
699 | 696 | public function cal_to_include($args) |
@@ -711,11 +708,11 @@ discard block |
||
711 | 708 | /** |
712 | 709 | * Shows the infolog list |
713 | 710 | * |
714 | - * @param array/string $values etemplate content or 'reset_action_view' if called by index.php to reset an action-view |
|
711 | + * @param integer $values etemplate content or 'reset_action_view' if called by index.php to reset an action-view |
|
715 | 712 | * @param string $action if set only entries liked to that $action:$action_id are shown |
716 | 713 | * @param string $action_id if set only entries liked to that $action:$action_id are shown |
717 | - * @param mixed $called_as is how we got called, for a hook eg. the call-params of that page containing the hook |
|
718 | - * @param boolean $e$extra_app_header * @param boolean $return_html=false |
|
714 | + * @param integer $called_as is how we got called, for a hook eg. the call-params of that page containing the hook |
|
715 | + * @param boolean $extra_app_header * @param boolean $return_html |
|
719 | 716 | * @param string $own_referer='' this is our own referer |
720 | 717 | * @param string $action_title='' app_header for the action, if '' we try the link-title |
721 | 718 | */ |
@@ -1327,7 +1324,7 @@ discard block |
||
1327 | 1324 | * @param array $query get_rows parameter |
1328 | 1325 | * @param string &$msg on return user feedback |
1329 | 1326 | * @param boolean $skip_notifications true to NOT notify users about changes |
1330 | - * @return boolean true if all actions succeded, false otherwise |
|
1327 | + * @return boolean|null true if all actions succeded, false otherwise |
|
1331 | 1328 | */ |
1332 | 1329 | function action($_action, $checked, $use_all, &$success, &$failed, &$action_msg, |
1333 | 1330 | array $query, &$msg, $skip_notifications = false) |
@@ -1572,9 +1569,9 @@ discard block |
||
1572 | 1569 | /** |
1573 | 1570 | * Closes an infolog |
1574 | 1571 | * |
1575 | - * @param int|array $values=0 info_id (default _GET[info_id]) |
|
1572 | + * @param int|array $values info_id (default _GET[info_id]) |
|
1576 | 1573 | * @param string $_referer='' |
1577 | - * @param boolean $closesingle=false |
|
1574 | + * @param boolean $closesingle |
|
1578 | 1575 | */ |
1579 | 1576 | function close($values=0,$_referer='',$closesingle=false,$skip_notification = false) |
1580 | 1577 | { |
@@ -1622,7 +1619,7 @@ discard block |
||
1622 | 1619 | /** |
1623 | 1620 | * Deletes an InfoLog entry |
1624 | 1621 | * |
1625 | - * @param array|int $values info_id (default _GET[info_id]) |
|
1622 | + * @param integer $values info_id (default _GET[info_id]) |
|
1626 | 1623 | * @param string $_referer |
1627 | 1624 | * @param string $called_by |
1628 | 1625 | * @param boolean $skip_notification Do not send notification of deletion |
@@ -55,32 +55,32 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @var string |
57 | 57 | */ |
58 | - var $duration_format = ','; // comma is necessary! |
|
58 | + var $duration_format = ','; // comma is necessary! |
|
59 | 59 | |
60 | 60 | var $icons = array( |
61 | 61 | 'type' => array( |
62 | - 'task' => 'task.gif', 'task_alt' => 'Task', |
|
63 | - 'phone' => 'phone.gif', 'phone_alt' => 'Phonecall', |
|
64 | - 'note' => 'note.gif', 'note_alt' => 'Note', |
|
65 | - 'confirm' => 'confirm.gif', 'confirm_alt' => 'Confirmation', |
|
66 | - 'reject' => 'reject.gif', 'reject_alt' => 'Reject', |
|
67 | - 'email' => 'email.gif', 'email_alt' => 'Email' ), |
|
62 | + 'task' => 'task.gif', 'task_alt' => 'Task', |
|
63 | + 'phone' => 'phone.gif', 'phone_alt' => 'Phonecall', |
|
64 | + 'note' => 'note.gif', 'note_alt' => 'Note', |
|
65 | + 'confirm' => 'confirm.gif', 'confirm_alt' => 'Confirmation', |
|
66 | + 'reject' => 'reject.gif', 'reject_alt' => 'Reject', |
|
67 | + 'email' => 'email.gif', 'email_alt' => 'Email' ), |
|
68 | 68 | 'action' => array( |
69 | - 'new' => 'new.gif', 'new_alt' => 'Add Sub', |
|
70 | - 'view' => 'view.gif', 'view_alt' => 'View Subs', |
|
71 | - 'parent' => 'parent.gif', 'parent_alt' => 'View other Subs', |
|
72 | - 'edit' => 'edit.gif', 'edit_alt' => 'Edit', |
|
73 | - 'addfile' => 'addfile.gif', 'addfile_alt' => 'Add a file', |
|
74 | - 'delete' => 'delete.gif', 'delete_alt' => 'Delete', |
|
75 | - 'close' => 'done.gif', 'close_alt' => 'Close' , |
|
76 | - 'close_all' => 'done_all.gif', 'close_all_alt' => 'Close' ), |
|
69 | + 'new' => 'new.gif', 'new_alt' => 'Add Sub', |
|
70 | + 'view' => 'view.gif', 'view_alt' => 'View Subs', |
|
71 | + 'parent' => 'parent.gif', 'parent_alt' => 'View other Subs', |
|
72 | + 'edit' => 'edit.gif', 'edit_alt' => 'Edit', |
|
73 | + 'addfile' => 'addfile.gif', 'addfile_alt' => 'Add a file', |
|
74 | + 'delete' => 'delete.gif', 'delete_alt' => 'Delete', |
|
75 | + 'close' => 'done.gif', 'close_alt' => 'Close', |
|
76 | + 'close_all' => 'done_all.gif', 'close_all_alt' => 'Close' ), |
|
77 | 77 | 'status' => array( |
78 | - 'billed' => 'billed.gif', 'billed_alt' => 'billed', |
|
79 | - 'done' => 'done.gif', 'done_alt' => 'done', |
|
78 | + 'billed' => 'billed.gif', 'billed_alt' => 'billed', |
|
79 | + 'done' => 'done.gif', 'done_alt' => 'done', |
|
80 | 80 | 'will-call' => 'will-call.gif', 'will-call_alt' => 'will-call', |
81 | - 'call' => 'call.gif', 'call_alt' => 'call', |
|
82 | - 'ongoing' => 'ongoing.gif', 'ongoing_alt' => 'ongoing', |
|
83 | - 'offer' => 'offer.gif', 'offer_alt' => 'offer' ) |
|
81 | + 'call' => 'call.gif', 'call_alt' => 'call', |
|
82 | + 'ongoing' => 'ongoing.gif', 'ongoing_alt' => 'ongoing', |
|
83 | + 'offer' => 'offer.gif', 'offer_alt' => 'offer' ) |
|
84 | 84 | ); |
85 | 85 | var $filters; |
86 | 86 | var $messages = array( |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | if ($GLOBALS['egw_info']['flags']['currentapp'] != 'infolog') Api\Translation::add_app('infolog'); |
101 | 101 | |
102 | 102 | // Make sure Global category is infolog - on first load, it may not be |
103 | - if($GLOBALS['egw_info']['flags']['currentapp'] == 'infolog' && !$GLOBALS['egw']->categories->app_name) |
|
103 | + if ($GLOBALS['egw_info']['flags']['currentapp'] == 'infolog' && !$GLOBALS['egw']->categories->app_name) |
|
104 | 104 | { |
105 | 105 | $GLOBALS['egw']->categories = new Api\Categories(); |
106 | 106 | } |
107 | 107 | |
108 | 108 | $this->bo = new infolog_bo(); |
109 | 109 | |
110 | - if($etemplate === null) |
|
110 | + if ($etemplate === null) |
|
111 | 111 | { |
112 | 112 | $etemplate = new Etemplate(); |
113 | 113 | } |
@@ -115,18 +115,18 @@ discard block |
||
115 | 115 | |
116 | 116 | $this->user = $GLOBALS['egw_info']['user']['account_id']; |
117 | 117 | |
118 | - $this->prefs =& $GLOBALS['egw_info']['user']['preferences']['infolog']; |
|
118 | + $this->prefs = & $GLOBALS['egw_info']['user']['preferences']['infolog']; |
|
119 | 119 | |
120 | 120 | // read the duration format from project-manager |
121 | 121 | if ($GLOBALS['egw_info']['apps']['projectmanager']) |
122 | 122 | { |
123 | 123 | $pm_config = Api\Config::read('projectmanager'); |
124 | - $this->duration_format = str_replace(',','',implode('', (array)$pm_config['duration_units'])); |
|
124 | + $this->duration_format = str_replace(',', '', implode('', (array)$pm_config['duration_units'])); |
|
125 | 125 | //error_log(__METHOD__."() ".__LINE__." duration_format=$this->duration_format, duration_unit=".array2string($pm_config['duration_units'])); |
126 | 126 | $this->hours_per_workday = $pm_config['hours_per_workday']; |
127 | 127 | unset($pm_config); |
128 | 128 | } |
129 | - $this->filters =& $this->bo->filters; |
|
129 | + $this->filters = & $this->bo->filters; |
|
130 | 130 | /* these are just for testing of the notifications |
131 | 131 | for($i = -1; $i <= 3; ++$i) |
132 | 132 | { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $this->filters['responsible-open-date'.date('Y-m-d',time()+$i*24*60*60)] = "responsible starting in $i day(s)"; |
146 | 146 | } |
147 | 147 | */ |
148 | - $GLOBALS['infolog_ui'] =& $this; // make ourself availible for ExecMethod of get_rows function |
|
148 | + $GLOBALS['infolog_ui'] = & $this; // make ourself availible for ExecMethod of get_rows function |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @param int $details |
160 | 160 | * @return array |
161 | 161 | */ |
162 | - function get_info($info,&$readonlys,$action='',$action_id='',$show_links=false,$details = 1) |
|
162 | + function get_info($info, &$readonlys, $action = '', $action_id = '', $show_links = false, $details = 1) |
|
163 | 163 | { |
164 | 164 | if (!is_array($info)) |
165 | 165 | { |
@@ -169,19 +169,19 @@ discard block |
||
169 | 169 | $done = $info['info_status'] == 'done' || $info['info_status'] == 'billed' || $info['info_status'] == 'cancelled'; //cancelled is regarded as a completed status as well in bo |
170 | 170 | // regard an infolog as done/billed/cancelled if its percentage is 100% when there is to status like the above for that type |
171 | 171 | if (!$done && !isset($this->bo->status[$info['info_type']]['done']) && !isset($this->bo->status[$info['info_type']]['billed']) && |
172 | - !isset($this->bo->status[$info['info_type']]['cancelled']) && (int)$info['info_percent']==100) $done = true ; |
|
173 | - $info['sub_class'] = $this->bo->enums['priority'][$info['info_priority']] . ($done ? '_done' : ''); |
|
172 | + !isset($this->bo->status[$info['info_type']]['cancelled']) && (int)$info['info_percent'] == 100) $done = true; |
|
173 | + $info['sub_class'] = $this->bo->enums['priority'][$info['info_priority']].($done ? '_done' : ''); |
|
174 | 174 | if (!$done && $info['info_enddate'] < $this->bo->user_time_now) |
175 | 175 | { |
176 | 176 | $info['end_class'] = 'infolog_overdue'; |
177 | 177 | } |
178 | 178 | if (!isset($info['info_anz_subs'])) $info['info_anz_subs'] = $this->bo->anzSubs($id); |
179 | - $this->bo->link_id2from($info,$action,$action_id); // unset from for $action:$action_id |
|
180 | - $info['info_percent'] = (int) $info['info_percent'].'%'; |
|
181 | - $editrights = $this->bo->check_access($info,Acl::EDIT); |
|
179 | + $this->bo->link_id2from($info, $action, $action_id); // unset from for $action:$action_id |
|
180 | + $info['info_percent'] = (int)$info['info_percent'].'%'; |
|
181 | + $editrights = $this->bo->check_access($info, Acl::EDIT); |
|
182 | 182 | $isresposible = $this->bo->is_responsible($info); |
183 | 183 | if ((!($editrights || // edit rights or more then standard responsible rights |
184 | - $isresposible && array_diff($this->bo->responsible_edit,array('info_status','info_percent','info_datecompleted'))))) |
|
184 | + $isresposible && array_diff($this->bo->responsible_edit, array('info_status', 'info_percent', 'info_datecompleted'))))) |
|
185 | 185 | { |
186 | 186 | $info['class'] .= 'rowNoEdit '; |
187 | 187 | } |
@@ -200,11 +200,11 @@ discard block |
||
200 | 200 | { |
201 | 201 | $info['class'] .= 'rowNoCloseAll '; |
202 | 202 | } |
203 | - if (!$this->bo->check_access($info,Acl::DELETE)) |
|
203 | + if (!$this->bo->check_access($info, Acl::DELETE)) |
|
204 | 204 | { |
205 | 205 | $info['class'] .= 'rowNoDelete '; |
206 | 206 | } |
207 | - if (!$this->bo->check_access($info,Acl::ADD)) |
|
207 | + if (!$this->bo->check_access($info, Acl::ADD)) |
|
208 | 208 | { |
209 | 209 | $info['class'] .= 'rowNoSubs '; |
210 | 210 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | if (!$show_links) $show_links = $this->prefs['show_links']; |
217 | 217 | if (($show_links != 'none' && $show_links != 'no_describtion' || |
218 | 218 | $this->prefs['show_times'] || isset($GLOBALS['egw_info']['user']['apps']['timesheet'])) && |
219 | - (isset($info['links']) || ($info['links'] = Link::get_links('infolog',$info['info_id'],'','link_lastmod DESC',true,true)))) |
|
219 | + (isset($info['links']) || ($info['links'] = Link::get_links('infolog', $info['info_id'], '', 'link_lastmod DESC', true, true)))) |
|
220 | 220 | { |
221 | 221 | $timesheets = array(); |
222 | 222 | foreach ($info['links'] as $link) |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $link_mod = Api\DateTime::server2user($link['lastmod']); |
226 | 226 | if ($info['row_mod'] < $link_mod) $info['row_mod'] = $link_mod; |
227 | 227 | |
228 | - if ($link['deleted']) continue; // skip deleted links, but incl. them in row_mod! |
|
228 | + if ($link['deleted']) continue; // skip deleted links, but incl. them in row_mod! |
|
229 | 229 | |
230 | 230 | if ($show_links != 'none' && $show_links != 'no_describtion' && |
231 | 231 | $link['link_id'] != $info['info_link_id'] && |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | } |
243 | 243 | if ($this->prefs['show_times'] && isset($GLOBALS['egw_info']['user']['apps']['timesheet']) && $timesheets) |
244 | 244 | { |
245 | - $sum = ExecMethod('timesheet.timesheet_bo.sum',$timesheets); |
|
245 | + $sum = ExecMethod('timesheet.timesheet_bo.sum', $timesheets); |
|
246 | 246 | $info['info_sum_timesheets'] = $sum['duration']; |
247 | 247 | // incl. max timesheet modification in row_mod |
248 | 248 | if ($info['row_mod'] < $sum['max_modified']) $info['row_mod'] = $sum['max_modified']; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } |
261 | 261 | $readonlys["edit_percent[$id]"] = true; |
262 | 262 | } |
263 | - elseif($readonlys["edit_percent[$id]"]) // show percent, but button is switched off |
|
263 | + elseif ($readonlys["edit_percent[$id]"]) // show percent, but button is switched off |
|
264 | 264 | { |
265 | 265 | $info['info_percent2'] = $info['info_percent']; |
266 | 266 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | protected static function filter(array $query) |
282 | 282 | { |
283 | 283 | $filter = $query['filter'] ? 'filter' : ($query['cat_id'] ? 'cat_id' : null); |
284 | - foreach((array)$query['col_filter'] as $name => $value) |
|
284 | + foreach ((array)$query['col_filter'] as $name => $value) |
|
285 | 285 | { |
286 | 286 | if ((string)$value !== '') |
287 | 287 | { |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | * @param array &$readonlys |
302 | 302 | * @return int |
303 | 303 | */ |
304 | - function get_rows(&$query,&$rows,&$readonlys) |
|
304 | + function get_rows(&$query, &$rows, &$readonlys) |
|
305 | 305 | { |
306 | 306 | //error_log(__METHOD__."() query[csv_export]=".array2string($query['csv_export']).", query[filter]=".array2string($query['filter']).", query[col_filter]=".array2string(array_diff($query['col_filter'],array('',0))).' '.function_backtrace()); |
307 | 307 | if (!$query['csv_export']) |
@@ -318,20 +318,20 @@ discard block |
||
318 | 318 | } |
319 | 319 | //error_log(__METHOD__."() prefs[listNoSubs]=".array2string($this->prefs['listNoSubs'])." --> parent_id=$parent_id"); |
320 | 320 | unset($query['col_filter']['parent_id']); |
321 | - if(!$query['action']) |
|
321 | + if (!$query['action']) |
|
322 | 322 | { |
323 | 323 | Api\Cache::setSession('infolog', $query['session_for'].'session_data', |
324 | - array_diff_key ($query, array_flip(array('rows','actions','action_links','placeholder_actions')))); |
|
324 | + array_diff_key($query, array_flip(array('rows', 'actions', 'action_links', 'placeholder_actions')))); |
|
325 | 325 | } |
326 | 326 | $query['actions'] = $this->get_actions($query); |
327 | 327 | $query['row_id'] = 'info_id'; |
328 | 328 | $query['row_modified'] = 'row_mod'; |
329 | 329 | $query['parent_id'] = 'info_id_parent'; |
330 | 330 | $query['is_parent'] = 'info_anz_subs'; |
331 | - $query['action_var'] = 'multi_action'; // as 'action' is already used in infolog |
|
331 | + $query['action_var'] = 'multi_action'; // as 'action' is already used in infolog |
|
332 | 332 | } |
333 | 333 | // nextmatch opened an infolog containing children --> do not filter them, always show all children |
334 | - elseif($query['csv_export'] === 'children') |
|
334 | + elseif ($query['csv_export'] === 'children') |
|
335 | 335 | { |
336 | 336 | $query['filter'] = $query['search'] = $query['cat_id'] = ''; |
337 | 337 | $query['col_filter'] = array('info_id_parent' => $query['col_filter']['info_id_parent']); |
@@ -351,17 +351,17 @@ discard block |
||
351 | 351 | $links['linked'] = array(); |
352 | 352 | unset($query['col_filter']['linked']); |
353 | 353 | } |
354 | - if($query['action'] && in_array($query['action'], array_keys($GLOBALS['egw_info']['apps'])) && $query['action_id']) |
|
354 | + if ($query['action'] && in_array($query['action'], array_keys($GLOBALS['egw_info']['apps'])) && $query['action_id']) |
|
355 | 355 | { |
356 | 356 | $link_filters['action'] = array('app'=>$query['action'], 'id' => $query['action_id']); |
357 | 357 | $links['action'] = array(); |
358 | 358 | } |
359 | - foreach($link_filters as $key => $link) |
|
359 | + foreach ($link_filters as $key => $link) |
|
360 | 360 | { |
361 | - if(!is_array($link)) |
|
361 | + if (!is_array($link)) |
|
362 | 362 | { |
363 | 363 | // Legacy string style |
364 | - list($app,$id) = explode(':',$link); |
|
364 | + list($app, $id) = explode(':', $link); |
|
365 | 365 | } |
366 | 366 | else |
367 | 367 | { |
@@ -369,25 +369,25 @@ discard block |
||
369 | 369 | $app = $link['app']; |
370 | 370 | $id = $link['id']; |
371 | 371 | } |
372 | - if(!is_array($id)) $id = explode(',',$id); |
|
373 | - if (!($linked = Link::get_links_multiple($app,$id,true,'infolog','',$query['col_filter']['info_status'] == 'deleted'))) |
|
372 | + if (!is_array($id)) $id = explode(',', $id); |
|
373 | + if (!($linked = Link::get_links_multiple($app, $id, true, 'infolog', '', $query['col_filter']['info_status'] == 'deleted'))) |
|
374 | 374 | { |
375 | - $rows = array(); // no infologs linked to selected link --> no rows to return |
|
375 | + $rows = array(); // no infologs linked to selected link --> no rows to return |
|
376 | 376 | return 0; |
377 | 377 | } |
378 | 378 | |
379 | 379 | |
380 | - foreach($linked as $infos) |
|
380 | + foreach ($linked as $infos) |
|
381 | 381 | { |
382 | - $links[$key] = array_merge($links[$key],$infos); |
|
382 | + $links[$key] = array_merge($links[$key], $infos); |
|
383 | 383 | } |
384 | 384 | $links[$key] = array_unique($links[$key]); |
385 | - if($key == 'linked') |
|
385 | + if ($key == 'linked') |
|
386 | 386 | { |
387 | 387 | $linked = array('app' => $app, 'id' => $id, 'title' => (count($id) == 1 ? Link::title($app, $id) : lang('multiple'))); |
388 | 388 | } |
389 | 389 | } |
390 | - if(count($links)) |
|
390 | + if (count($links)) |
|
391 | 391 | { |
392 | 392 | $query['col_filter']['info_id'] = count($links) > 1 ? call_user_func_array('array_intersect', $links) : $links[$key]; |
393 | 393 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $old_template = $query['template']; |
397 | 397 | |
398 | 398 | // Reset custom, type-specific template if type was cleared (without changing it for home) |
399 | - if(!$query['template'] || stripos($query['template'], 'infolog.index.rows') === 0) |
|
399 | + if (!$query['template'] || stripos($query['template'], 'infolog.index.rows') === 0) |
|
400 | 400 | { |
401 | 401 | $query['template'] = 'infolog.index.rows'; |
402 | 402 | } |
@@ -407,10 +407,10 @@ discard block |
||
407 | 407 | if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type'])) |
408 | 408 | { |
409 | 409 | $query['template'] = $tpl->name; |
410 | - $query['custom_fields'] = true; // read the custom fields too |
|
410 | + $query['custom_fields'] = true; // read the custom fields too |
|
411 | 411 | } |
412 | 412 | // If status is not valid for selected type, clear status filter |
413 | - if($query['col_filter']['info_status'] && $query['col_filter']['info_status'] != 'deleted' && |
|
413 | + if ($query['col_filter']['info_status'] && $query['col_filter']['info_status'] != 'deleted' && |
|
414 | 414 | !in_array($query['col_filter']['info_status'], array_keys($this->bo->status[$query['col_filter']['info_type']]))) |
415 | 415 | { |
416 | 416 | $query['col_filter']['info_status'] = ''; |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | } |
419 | 419 | } |
420 | 420 | // Framework\Template change forces the UI to do a full update first, no point in getting rows right now |
421 | - if($old_template && $old_template != $query['template']) return 0; |
|
421 | + if ($old_template && $old_template != $query['template']) return 0; |
|
422 | 422 | |
423 | 423 | // do we need to read the custom fields, depends on the column is enabled and customfields exist, prefs are filter specific |
424 | 424 | // so we have to check that as well |
@@ -431,14 +431,14 @@ discard block |
||
431 | 431 | |
432 | 432 | if (!$query['selectcols'] && $columselection) |
433 | 433 | { |
434 | - $columselection = is_array($columselection) ? $columselection : explode(',',$columselection); |
|
434 | + $columselection = is_array($columselection) ? $columselection : explode(',', $columselection); |
|
435 | 435 | } |
436 | 436 | else |
437 | 437 | { |
438 | - $columselection = $query['selectcols'] ? (is_array($query['selectcols']) ? $query['selectcols'] : explode(',',$query['selectcols'])) : array(); |
|
438 | + $columselection = $query['selectcols'] ? (is_array($query['selectcols']) ? $query['selectcols'] : explode(',', $query['selectcols'])) : array(); |
|
439 | 439 | } |
440 | 440 | // do we need to query the cf's |
441 | - $query['custom_fields'] = $this->bo->customfields && (!$columselection || in_array('customfields',$columselection)); |
|
441 | + $query['custom_fields'] = $this->bo->customfields && (!$columselection || in_array('customfields', $columselection)); |
|
442 | 442 | |
443 | 443 | $infos = $this->bo->search($query); |
444 | 444 | $query['col_filter'] = $orginal_colfilter; |
@@ -456,12 +456,12 @@ discard block |
||
456 | 456 | $query['default_cols'] = '!cat_id,info_datemodified,info_used_time_info_planned_time,info_used_time_info_planned_time_info_replanned_time,info_id'; |
457 | 457 | } |
458 | 458 | // set old show_times pref, that get_info calculates the cumulated time of the timesheets (we only check used&planned to work for both time cols) |
459 | - $this->prefs['show_times'] = strpos($this->prefs[$query['columnselection_pref']],'info_used_time_info_planned_time') !== false; |
|
459 | + $this->prefs['show_times'] = strpos($this->prefs[$query['columnselection_pref']], 'info_used_time_info_planned_time') !== false; |
|
460 | 460 | |
461 | 461 | // query all links and sub counts in one go |
462 | 462 | if ($infos && (!$query['csv_export'] || !is_array($query['csv_export']))) |
463 | 463 | { |
464 | - $links = Link::get_links_multiple('infolog',array_keys($infos),true,'','link_lastmod DESC',true); // true=incl. deleted |
|
464 | + $links = Link::get_links_multiple('infolog', array_keys($infos), true, '', 'link_lastmod DESC', true); // true=incl. deleted |
|
465 | 465 | $anzSubs = $this->bo->anzSubs(array_keys($infos)); |
466 | 466 | } |
467 | 467 | $rows = array(); |
@@ -472,26 +472,26 @@ discard block |
||
472 | 472 | $parents = $query['action'] == 'sp' && $query['action_id'] ? (array)$query['action_id'] : array(); |
473 | 473 | if (!empty($parents) && count($parents) == 1 && is_array($query['action_id'])) |
474 | 474 | { |
475 | - $query['action_id'] = array_shift($query['action_id']); // display single parent as app_header |
|
475 | + $query['action_id'] = array_shift($query['action_id']); // display single parent as app_header |
|
476 | 476 | } |
477 | 477 | } |
478 | 478 | |
479 | 479 | $parent_first = !empty($parents) && count($parents) == 1; |
480 | 480 | $parent_index = 0; |
481 | 481 | // et2 nextmatch listens to total, and only displays that many rows, so add parent in or we'll lose the last row |
482 | - if($parent_first || $query['action'] == 'sp' && is_array($query['action_id'])) $query['total']++; |
|
482 | + if ($parent_first || $query['action'] == 'sp' && is_array($query['action_id'])) $query['total']++; |
|
483 | 483 | |
484 | 484 | // Check to see if we need to remove description |
485 | - foreach($infos as $id => $info) |
|
485 | + foreach ($infos as $id => $info) |
|
486 | 486 | { |
487 | 487 | if (!$query['csv_export'] || !is_array($query['csv_export'])) |
488 | 488 | { |
489 | - $info['links'] =& $links[$id]; |
|
489 | + $info['links'] = & $links[$id]; |
|
490 | 490 | $info['info_anz_subs'] = (int)$anzSubs[$id]; |
491 | - $info = $this->get_info($info,$readonlys,null,null,false,$details); |
|
491 | + $info = $this->get_info($info, $readonlys, null, null, false, $details); |
|
492 | 492 | } |
493 | 493 | // for subs view ('sp') add parent(s) in front of subs once(!) |
494 | - if ( $parent_first && ($main = $this->bo->read($query['action_id'])) || |
|
494 | + if ($parent_first && ($main = $this->bo->read($query['action_id'])) || |
|
495 | 495 | $parents && ($parent_index = array_search($info['info_id_parent'], $parents)) !== false && |
496 | 496 | ($main = $this->bo->read($info['info_id_parent']))) |
497 | 497 | { |
@@ -501,11 +501,11 @@ discard block |
||
501 | 501 | // as read() always read them all, while search() only reads the selected ones |
502 | 502 | if ($query['custom_fields']) |
503 | 503 | { |
504 | - foreach($columselection as $col) |
|
504 | + foreach ($columselection as $col) |
|
505 | 505 | { |
506 | 506 | if ($col[0] == '#') |
507 | 507 | { |
508 | - foreach(array_keys($main) as $n) |
|
508 | + foreach (array_keys($main) as $n) |
|
509 | 509 | { |
510 | 510 | if ($n[0] == '#' && !in_array($n, $columselection)) unset($main[$n]); |
511 | 511 | } |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | } |
515 | 515 | } |
516 | 516 | $parent_first = false; |
517 | - if($query['start'] == 0) |
|
517 | + if ($query['start'] == 0) |
|
518 | 518 | { |
519 | 519 | array_splice($rows, $id, 0, array($main)); |
520 | 520 | unset($parents[$parent_index]); |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | if ($query['cat_id']) $rows['no_cat_id'] = true; |
528 | 528 | if ($query['no_actions']) $rows['no_actions'] = true; |
529 | 529 | $rows['no_timesheet'] = !isset($GLOBALS['egw_info']['user']['apps']['timesheet']); |
530 | - if($clear_status_filter) |
|
530 | + if ($clear_status_filter) |
|
531 | 531 | { |
532 | 532 | $rows['info_status'] = ''; |
533 | 533 | } |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | $headers[] = lang($this->filters[$query['filter']]); |
559 | 559 | } |
560 | 560 | if ($query['action'] && ($title = $query['action_title'] || is_array($query['action_id']) ? |
561 | - $query['action_title'] : Link::title($query['action']=='sp'?'infolog':$query['action'],$query['action_id']))) |
|
561 | + $query['action_title'] : Link::title($query['action'] == 'sp' ? 'infolog' : $query['action'], $query['action_id']))) |
|
562 | 562 | { |
563 | 563 | $headers[] = $title; |
564 | 564 | } |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | $GLOBALS['egw_info']['flags']['app_header'] = implode(': ', $headers); |
570 | 570 | } |
571 | 571 | |
572 | - if (isset($linked)) $query['col_filter']['linked'] = $linked; // add linked back to the colfilter |
|
572 | + if (isset($linked)) $query['col_filter']['linked'] = $linked; // add linked back to the colfilter |
|
573 | 573 | |
574 | 574 | return $query['total']; |
575 | 575 | } |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | $set['ts_unitprice'] = $info['info_price']; |
601 | 601 | } |
602 | 602 | |
603 | - foreach(Link::get_links('infolog',$info['info_id'],'','link_lastmod DESC',true) as $link) |
|
603 | + foreach (Link::get_links('infolog', $info['info_id'], '', 'link_lastmod DESC', true) as $link) |
|
604 | 604 | { |
605 | 605 | if ($link['app'] != 'timesheet' && $link['app'] != Link::VFS_APPNAME) |
606 | 606 | { |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | { |
627 | 627 | return $data; |
628 | 628 | } |
629 | - $event = array_merge($data,array( |
|
629 | + $event = array_merge($data, array( |
|
630 | 630 | 'category' => $GLOBALS['egw']->categories->check_list(Acl::READ, $infolog['info_cat']), |
631 | 631 | 'priority' => $infolog['info_priority'] + 1, |
632 | 632 | 'public' => $infolog['info_access'] != 'private', |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | 'end' => $infolog['info_enddate'] ? $infolog['info_enddate'] : $infolog['info_datecompleted'] |
638 | 638 | )); |
639 | 639 | unset($event['entry_id']); |
640 | - if (!$event['end']) $event['end'] = $event['start'] + (int) $GLOBALS['egw_info']['user']['preferences']['calendar']['defaultlength']*60; |
|
640 | + if (!$event['end']) $event['end'] = $event['start'] + (int)$GLOBALS['egw_info']['user']['preferences']['calendar']['defaultlength'] * 60; |
|
641 | 641 | |
642 | 642 | // Match Api\Categories by name |
643 | 643 | $event['category'] = $GLOBALS['egw']->categories->name2id(Api\Categories::id2name($infolog['info_cat'])); |
@@ -646,38 +646,38 @@ discard block |
||
646 | 646 | $event['owner'] = $user = $GLOBALS['egw_info']['user']['account_id']; |
647 | 647 | |
648 | 648 | // add/modify participants according to prefs |
649 | - $prefs = explode(',',$this->prefs['calendar_set'] ? $this->prefs['calendar_set'] : 'responsible,contact,user'); |
|
649 | + $prefs = explode(',', $this->prefs['calendar_set'] ? $this->prefs['calendar_set'] : 'responsible,contact,user'); |
|
650 | 650 | |
651 | 651 | // if no default participants (selected calendars) --> remove all |
652 | - if (!in_array('selected',$prefs)) |
|
652 | + if (!in_array('selected', $prefs)) |
|
653 | 653 | { |
654 | 654 | $event['participants'] = $event['participant_types'] = array(); |
655 | 655 | } |
656 | 656 | // Add responsible as participant |
657 | - if (in_array('responsible',$prefs)) |
|
657 | + if (in_array('responsible', $prefs)) |
|
658 | 658 | { |
659 | - foreach($infolog['info_responsible'] as $responsible) |
|
659 | + foreach ($infolog['info_responsible'] as $responsible) |
|
660 | 660 | { |
661 | 661 | $event['participants'][$responsible] = $event['participant_types']['u'][$responsible] = |
662 | - calendar_so::combine_status($user==$responsible?'A':'U'); |
|
662 | + calendar_so::combine_status($user == $responsible ? 'A' : 'U'); |
|
663 | 663 | } |
664 | 664 | } |
665 | 665 | // Add linked contact as participant |
666 | - if (in_array('contact',$prefs) && $infolog['info_link']['app'] == 'addressbook') |
|
666 | + if (in_array('contact', $prefs) && $infolog['info_link']['app'] == 'addressbook') |
|
667 | 667 | { |
668 | - $event['participants'][calendar_so::combine_user('c',$infolog['info_link']['id'])] = |
|
668 | + $event['participants'][calendar_so::combine_user('c', $infolog['info_link']['id'])] = |
|
669 | 669 | $event['participant_types']['c'][$infolog['info_link']['id']] = calendar_so::combine_status('U'); |
670 | 670 | } |
671 | - if (in_array('owner',$prefs)) |
|
671 | + if (in_array('owner', $prefs)) |
|
672 | 672 | { |
673 | 673 | $event['participants'][$infolog['info_owner']] = $event['participant_types']['u'][$infolog['info_owner']] = |
674 | - calendar_so::combine_status('A',1,'CHAIR'); |
|
674 | + calendar_so::combine_status('A', 1, 'CHAIR'); |
|
675 | 675 | } |
676 | 676 | // Add current user, if set or no other participants, which is not allowed |
677 | - if (in_array('user',$prefs)) |
|
677 | + if (in_array('user', $prefs)) |
|
678 | 678 | { |
679 | 679 | $event['participants'][$user] = $event['participant_types']['u'][$user] = |
680 | - calendar_so::combine_status('A',1,'CHAIR'); |
|
680 | + calendar_so::combine_status('A', 1, 'CHAIR'); |
|
681 | 681 | } |
682 | 682 | |
683 | 683 | // Add infolog link to calendar entry |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | $event['link_id'][] = $infolog['info_link']['id']; |
686 | 686 | |
687 | 687 | // Copy infolog's links |
688 | - foreach(Link::get_links('infolog',$infolog['info_id'],'','link_lastmod DESC',true) as $link) |
|
688 | + foreach (Link::get_links('infolog', $infolog['info_id'], '', 'link_lastmod DESC', true) as $link) |
|
689 | 689 | { |
690 | 690 | if ($link['app'] != Link::VFS_APPNAME) |
691 | 691 | { |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | } |
695 | 695 | } |
696 | 696 | // Copy same custom fields |
697 | - foreach(array_keys(Api\Storage\Customfields::get('calendar')) as $name) |
|
697 | + foreach (array_keys(Api\Storage\Customfields::get('calendar')) as $name) |
|
698 | 698 | { |
699 | 699 | if ($this->bo->customfields[$name]) $event['#'.$name] = $infolog['#'.$name]; |
700 | 700 | } |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | public function cal_to_include($args) |
716 | 716 | { |
717 | 717 | $nm = Api\Cache::getSession('infolog', 'session_data'); |
718 | - if($nm) |
|
718 | + if ($nm) |
|
719 | 719 | { |
720 | 720 | $args['order'] = $nm['order']; |
721 | 721 | $args['sort'] = $nm['sort']; |
@@ -735,9 +735,9 @@ discard block |
||
735 | 735 | * @param string $own_referer='' this is our own referer |
736 | 736 | * @param string $action_title='' app_header for the action, if '' we try the link-title |
737 | 737 | */ |
738 | - function index($values = null,$action='',$action_id='',$called_as=0,$extra_app_header=False,$return_html=False,$own_referer='',$action_title='') |
|
738 | + function index($values = null, $action = '', $action_id = '', $called_as = 0, $extra_app_header = False, $return_html = False, $own_referer = '', $action_title = '') |
|
739 | 739 | { |
740 | - unset($extra_app_header); // not used, but dont want to change signature |
|
740 | + unset($extra_app_header); // not used, but dont want to change signature |
|
741 | 741 | if (is_array($values)) |
742 | 742 | { |
743 | 743 | $called_as = $values['called_as']; |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | elseif ($own_referer === '') |
747 | 747 | { |
748 | 748 | $own_referer = Api\Header\Referer::get(); |
749 | - if (strpos($own_referer,'menuaction=infolog.infolog_ui.edit') !== false) |
|
749 | + if (strpos($own_referer, 'menuaction=infolog.infolog_ui.edit') !== false) |
|
750 | 750 | { |
751 | 751 | $own_referer = Api\Cache::getSession('infolog', 'own_session'); |
752 | 752 | } |
@@ -757,11 +757,11 @@ discard block |
||
757 | 757 | } |
758 | 758 | |
759 | 759 | // Handle legacy buttons like actions |
760 | - if(is_array($values)) |
|
760 | + if (is_array($values)) |
|
761 | 761 | { |
762 | - foreach(array('document', 'view', 'delete') as $button) |
|
762 | + foreach (array('document', 'view', 'delete') as $button) |
|
763 | 763 | { |
764 | - if(isset($values['nm']['rows'][$button])) |
|
764 | + if (isset($values['nm']['rows'][$button])) |
|
765 | 765 | { |
766 | 766 | list($id) = @each($values['nm']['rows'][$button]); |
767 | 767 | $values['nm']['multi_action'] = $button; |
@@ -781,27 +781,27 @@ discard block |
||
781 | 781 | // Some processing to add values in for links and cats |
782 | 782 | $multi_action = $values['nm']['multi_action']; |
783 | 783 | // Action has an additional action - add / delete, etc. Buttons named <multi-action>_action[action_name] |
784 | - if(in_array($multi_action, array('link', 'responsible', 'startdate', 'enddate'))) |
|
784 | + if (in_array($multi_action, array('link', 'responsible', 'startdate', 'enddate'))) |
|
785 | 785 | { |
786 | 786 | // eTemplate ignores the _popup namespace, but et2 doesn't |
787 | - if($values[$multi_action.'_popup']) |
|
787 | + if ($values[$multi_action.'_popup']) |
|
788 | 788 | { |
789 | - $popup =& $values[$multi_action.'_popup']; |
|
789 | + $popup = & $values[$multi_action.'_popup']; |
|
790 | 790 | } |
791 | 791 | else |
792 | 792 | { |
793 | - $popup =& $values; |
|
793 | + $popup = & $values; |
|
794 | 794 | } |
795 | - $values['nm']['multi_action'] .= '_' . key($popup[$multi_action . '_action']); |
|
796 | - if($multi_action == 'link') |
|
795 | + $values['nm']['multi_action'] .= '_'.key($popup[$multi_action.'_action']); |
|
796 | + if ($multi_action == 'link') |
|
797 | 797 | { |
798 | - $popup[$multi_action] = $popup['link']['app'] . ':'.$popup['link']['id']; |
|
798 | + $popup[$multi_action] = $popup['link']['app'].':'.$popup['link']['id']; |
|
799 | 799 | } |
800 | - else if(is_array($popup[$multi_action])) |
|
800 | + else if (is_array($popup[$multi_action])) |
|
801 | 801 | { |
802 | - $popup[$multi_action] = implode(',',$popup[$multi_action]); |
|
802 | + $popup[$multi_action] = implode(',', $popup[$multi_action]); |
|
803 | 803 | } |
804 | - $values['nm']['multi_action'] .= '_' . $popup[$multi_action]; |
|
804 | + $values['nm']['multi_action'] .= '_'.$popup[$multi_action]; |
|
805 | 805 | unset($values[$multi_action.'_popup']); |
806 | 806 | unset($values[$multi_action]); |
807 | 807 | } |
@@ -809,18 +809,18 @@ discard block |
||
809 | 809 | if ($this->action($values['nm']['multi_action'], $values['nm']['selected'], $values['nm']['select_all'], |
810 | 810 | $success, $failed, $action_msg, $values['nm'], $msg, $values['nm']['checkboxes']['no_notifications'])) |
811 | 811 | { |
812 | - $msg .= lang('%1 entries %2',$success,$action_msg); |
|
812 | + $msg .= lang('%1 entries %2', $success, $action_msg); |
|
813 | 813 | Framework::message($msg); |
814 | 814 | } |
815 | - elseif(is_null($msg)) |
|
815 | + elseif (is_null($msg)) |
|
816 | 816 | { |
817 | - $msg .= lang('%1 entries %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed); |
|
818 | - Framework::message($msg,'error'); |
|
817 | + $msg .= lang('%1 entries %2, %3 failed because of insufficent rights !!!', $success, $action_msg, $failed); |
|
818 | + Framework::message($msg, 'error'); |
|
819 | 819 | } |
820 | - elseif($msg) |
|
820 | + elseif ($msg) |
|
821 | 821 | { |
822 | - $msg .= "\n".lang('%1 entries %2, %3 failed.',$success,$action_msg,$failed); |
|
823 | - Framework::message($msg,'error'); |
|
822 | + $msg .= "\n".lang('%1 entries %2, %3 failed.', $success, $action_msg, $failed); |
|
823 | + Framework::message($msg, 'error'); |
|
824 | 824 | } |
825 | 825 | unset($values['nm']['multi_action']); |
826 | 826 | unset($values['nm']['select_all']); |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | $action_id = 0; |
844 | 844 | $action_title = ''; |
845 | 845 | } |
846 | - if($_GET['ajax'] === 'true') |
|
846 | + if ($_GET['ajax'] === 'true') |
|
847 | 847 | { |
848 | 848 | $nm['action'] = ''; |
849 | 849 | $nm['action_id'] = 0; |
@@ -859,8 +859,7 @@ discard block |
||
859 | 859 | |
860 | 860 | if (isset($_GET['filter']) && $_GET['filter'] != 'default' || !isset($values['nm']['filter']) && !$this->called_by) |
861 | 861 | { |
862 | - $values['nm']['filter'] = $_GET['filter'] && $_GET['filter'] != 'default' ? $_GET['filter'] : |
|
863 | - $this->prefs['defaultFilter']; |
|
862 | + $values['nm']['filter'] = $_GET['filter'] && $_GET['filter'] != 'default' ? $_GET['filter'] : $this->prefs['defaultFilter']; |
|
864 | 863 | } |
865 | 864 | if (!isset($values['nm']['order']) || !$values['nm']['order']) |
866 | 865 | { |
@@ -874,21 +873,21 @@ discard block |
||
874 | 873 | $action_title = $values['action_title'] = $action ? $action_title : $nm['action_title']; |
875 | 874 | $action = $values['action'] = $action ? $action : $nm['action']; |
876 | 875 | } |
877 | - if($_GET['search']) $values['nm']['search'] = $_GET['search']; |
|
876 | + if ($_GET['search']) $values['nm']['search'] = $_GET['search']; |
|
878 | 877 | |
879 | 878 | if ($values['nm']['add']) |
880 | 879 | { |
881 | 880 | $values['add'] = $values['nm']['add']; |
882 | 881 | unset($values['nm']['add']); |
883 | 882 | } |
884 | - unset($values['nm']['rows']['checked']); // not longer used, but hides button actions |
|
883 | + unset($values['nm']['rows']['checked']); // not longer used, but hides button actions |
|
885 | 884 | |
886 | 885 | if ($values['add'] || $values['cancel'] || isset($values['main'])) |
887 | 886 | { |
888 | 887 | if ($values['add']) |
889 | 888 | { |
890 | 889 | list($type) = each($values['add']); |
891 | - return $this->edit(0,$action,$action_id,$type,$called_as); |
|
890 | + return $this->edit(0, $action, $action_id, $type, $called_as); |
|
892 | 891 | } |
893 | 892 | elseif ($values['cancel'] && $own_referer) |
894 | 893 | { |
@@ -900,14 +899,14 @@ discard block |
||
900 | 899 | } |
901 | 900 | else |
902 | 901 | { |
903 | - list($do,$do2) = each($values['main']); |
|
902 | + list($do, $do2) = each($values['main']); |
|
904 | 903 | list($do_id) = @each($do2); |
905 | - switch((string)$do) |
|
904 | + switch ((string)$do) |
|
906 | 905 | { |
907 | 906 | case 'close': |
908 | - $closesingle=true; |
|
907 | + $closesingle = true; |
|
909 | 908 | case 'close_all': |
910 | - $this->close($do_id,$called_as,$closesingle); |
|
909 | + $this->close($do_id, $called_as, $closesingle); |
|
911 | 910 | break; |
912 | 911 | case 'view': |
913 | 912 | $value = array(); |
@@ -945,7 +944,7 @@ discard block |
||
945 | 944 | $this->tmpl->read('infolog.index'); |
946 | 945 | $values['nm']['options-filter'] = $this->filters; |
947 | 946 | $values['nm']['get_rows'] = 'infolog.infolog_ui.get_rows'; |
948 | - $values['nm']['options-filter2'] = (in_array($this->prefs['show_links'],array('all','no_describtion')) ? array() : array( |
|
947 | + $values['nm']['options-filter2'] = (in_array($this->prefs['show_links'], array('all', 'no_describtion')) ? array() : array( |
|
949 | 948 | '' => 'default', |
950 | 949 | )) + array( |
951 | 950 | 'no_describtion' => 'no details', |
@@ -966,34 +965,34 @@ discard block |
||
966 | 965 | else |
967 | 966 | { |
968 | 967 | // Allow saving parent ID into favorites |
969 | - $values['nm']['favorites'] = array('action','action_id'); |
|
968 | + $values['nm']['favorites'] = array('action', 'action_id'); |
|
970 | 969 | } |
971 | 970 | |
972 | 971 | // Allow add actions even when there's no rows |
973 | 972 | $values['nm']['placeholder_actions'] = array('new'); |
974 | 973 | |
975 | - if(!isset($values['nm']['filter2'])) $values['nm']['filter2'] = $this->prefs['nextmatch-'.($action ? 'infolog.'.$action : 'infolog.index.rows').'-details-pref']; |
|
974 | + if (!isset($values['nm']['filter2'])) $values['nm']['filter2'] = $this->prefs['nextmatch-'.($action ? 'infolog.'.$action : 'infolog.index.rows').'-details-pref']; |
|
976 | 975 | |
977 | 976 | // disable columns for main entry as set in the pref for details or no details |
978 | 977 | $values['nm']['columnselection_pref'] = 'nextmatch-'.($action ? 'infolog.'.$action : 'infolog.index.rows') |
979 | - .($values['nm']['filter2']=='all' ? '-details' : ''); |
|
978 | + .($values['nm']['filter2'] == 'all' ? '-details' : ''); |
|
980 | 979 | if ($action == 'sp') |
981 | 980 | { |
982 | 981 | $pref = $values['nm']['columnselection_pref']; |
983 | - foreach(array('info_used_time_info_planned_time_info_replanned_time','info_datemodified','info_owner_info_responsible','customfields') as $name) |
|
982 | + foreach (array('info_used_time_info_planned_time_info_replanned_time', 'info_datemodified', 'info_owner_info_responsible', 'customfields') as $name) |
|
984 | 983 | { |
985 | - $values['main']['no_'.$name] = strpos($this->prefs[$pref],$name) === false; |
|
984 | + $values['main']['no_'.$name] = strpos($this->prefs[$pref], $name) === false; |
|
986 | 985 | } |
987 | 986 | if (!$values['main']['no_customfields']) |
988 | 987 | { |
989 | 988 | // set the column-header of the main table for the customfields. |
990 | - foreach(array_keys($this->bo->customfields) as $lname) |
|
989 | + foreach (array_keys($this->bo->customfields) as $lname) |
|
991 | 990 | { |
992 | - $values['main']['customfields'].=$lname."\n"; |
|
991 | + $values['main']['customfields'] .= $lname."\n"; |
|
993 | 992 | } |
994 | 993 | } |
995 | 994 | } |
996 | - if ($values['nm']['filter']=='bydate') |
|
995 | + if ($values['nm']['filter'] == 'bydate') |
|
997 | 996 | { |
998 | 997 | foreach (array_keys($values['nm']['col_filter']) as $colfk) |
999 | 998 | { |
@@ -1026,7 +1025,7 @@ discard block |
||
1026 | 1025 | { |
1027 | 1026 | $values['css'] .= '<style type="text/css">@media screen { .infoDes { '. |
1028 | 1027 | ' max-height: '. |
1029 | - (($this->prefs['limit_des_lines'] ? $this->prefs['limit_des_lines'] : 5) * 1.35). // dono why em is not real lines |
|
1028 | + (($this->prefs['limit_des_lines'] ? $this->prefs['limit_des_lines'] : 5) * 1.35).// dono why em is not real lines |
|
1030 | 1029 | 'em; overflow: auto; }}</style>'; |
1031 | 1030 | } |
1032 | 1031 | |
@@ -1038,13 +1037,13 @@ discard block |
||
1038 | 1037 | |
1039 | 1038 | // remove group-types user has not any rights to as filter |
1040 | 1039 | // does not take implicit rights as delegated into account, so they will not be available as filters |
1041 | - foreach($this->bo->group_owners as $type => $group) |
|
1040 | + foreach ($this->bo->group_owners as $type => $group) |
|
1042 | 1041 | { |
1043 | 1042 | if (!isset($this->bo->grants[$group])) unset($sel_options['info_type'][$type]); |
1044 | 1043 | } |
1045 | 1044 | |
1046 | 1045 | |
1047 | - return $this->tmpl->exec('infolog.infolog_ui.index',$values,$sel_options,$readonlys,$persist,$return_html ? -1 : 0); |
|
1046 | + return $this->tmpl->exec('infolog.infolog_ui.index', $values, $sel_options, $readonlys, $persist, $return_html ? -1 : 0); |
|
1048 | 1047 | } |
1049 | 1048 | |
1050 | 1049 | /** |
@@ -1059,9 +1058,9 @@ discard block |
||
1059 | 1058 | if ($this->bo->group_owners) |
1060 | 1059 | { |
1061 | 1060 | // remove types owned by groups the user has no edit grant |
1062 | - foreach($this->bo->group_owners as $type => $group) |
|
1061 | + foreach ($this->bo->group_owners as $type => $group) |
|
1063 | 1062 | { |
1064 | - if (!($this->bo->grants[$group] & Acl::EDIT)) |
|
1063 | + if (!($this->bo->grants[$group]&Acl::EDIT)) |
|
1065 | 1064 | { |
1066 | 1065 | unset($types[$type]); |
1067 | 1066 | } |
@@ -1078,7 +1077,7 @@ discard block |
||
1078 | 1077 | */ |
1079 | 1078 | private function get_actions(array $query) |
1080 | 1079 | { |
1081 | - for($i = 0; $i <= 100; $i += 10) |
|
1080 | + for ($i = 0; $i <= 100; $i += 10) |
|
1082 | 1081 | { |
1083 | 1082 | $percent[$i] = $i.'%'; |
1084 | 1083 | } |
@@ -1087,9 +1086,9 @@ discard block |
||
1087 | 1086 | $types_add = array(); |
1088 | 1087 | // Do not add deleted type to add or change menus |
1089 | 1088 | unset($types['delete']); |
1090 | - foreach($types as $type => &$data) |
|
1089 | + foreach ($types as $type => &$data) |
|
1091 | 1090 | { |
1092 | - $image_exists = Api\Image::find('infolog',$type); |
|
1091 | + $image_exists = Api\Image::find('infolog', $type); |
|
1093 | 1092 | $data = array( |
1094 | 1093 | 'caption' => $data, |
1095 | 1094 | 'icon' => $image_exists ? $type : 'infolog/navbar', |
@@ -1101,9 +1100,9 @@ discard block |
||
1101 | 1100 | |
1102 | 1101 | $icons = null; |
1103 | 1102 | $statis = $this->bo->get_status($query['col_filter']['info_type'], $icons); |
1104 | - foreach($statis as $type => &$data) |
|
1103 | + foreach ($statis as $type => &$data) |
|
1105 | 1104 | { |
1106 | - $image_exists = Api\Image::find('infolog',$icons[$type]); |
|
1105 | + $image_exists = Api\Image::find('infolog', $icons[$type]); |
|
1107 | 1106 | $data = array( |
1108 | 1107 | 'caption' => $data, |
1109 | 1108 | 'icon' => $image_exists ? $icons[$type] : 'infolog/status', |
@@ -1115,10 +1114,10 @@ discard block |
||
1115 | 1114 | 'caption' => 'Open', |
1116 | 1115 | 'default' => true, |
1117 | 1116 | 'allowOnMultiple' => false, |
1118 | - 'onExecute' => Api\Header\UserAgent::mobile()?'javaScript:app.infolog.viewEntry':'', |
|
1117 | + 'onExecute' => Api\Header\UserAgent::mobile() ? 'javaScript:app.infolog.viewEntry' : '', |
|
1119 | 1118 | 'url' => 'menuaction=infolog.infolog_ui.edit&info_id=$id', |
1120 | 1119 | 'popup' => Link::get_registry('infolog', 'add_popup'), |
1121 | - 'group' => $group=1, |
|
1120 | + 'group' => $group = 1, |
|
1122 | 1121 | 'mobileViewTemplate' => 'view?'.filemtime(Api\Etemplate\Widget\Template::rel2path('/infolog/templates/mobile/view.xet')) |
1123 | 1122 | ), |
1124 | 1123 | 'parent' => array( |
@@ -1192,7 +1191,7 @@ discard block |
||
1192 | 1191 | 'icon' => 'completed', |
1193 | 1192 | ), |
1194 | 1193 | 'cat' => Etemplate\Widget\Nextmatch::category_action( |
1195 | - 'infolog',$group,'Change category','cat_' |
|
1194 | + 'infolog', $group, 'Change category', 'cat_' |
|
1196 | 1195 | ), |
1197 | 1196 | 'startdate' => array( |
1198 | 1197 | 'caption' => 'Start date', |
@@ -1240,7 +1239,7 @@ discard block |
||
1240 | 1239 | 'onExecute' => 'javaScript:app.infolog.infolog_menu_print' |
1241 | 1240 | ) |
1242 | 1241 | ); |
1243 | - ++$group; // integration with other apps |
|
1242 | + ++$group; // integration with other apps |
|
1244 | 1243 | if ($GLOBALS['egw_info']['user']['apps']['filemanager']) |
1245 | 1244 | { |
1246 | 1245 | $actions['filemanager'] = array( |
@@ -1258,7 +1257,7 @@ discard block |
||
1258 | 1257 | 'caption' => 'Schedule appointment', |
1259 | 1258 | 'group' => $group, |
1260 | 1259 | 'url' => 'menuaction=calendar.calendar_uiforms.edit&'. |
1261 | - Link::get_registry('calendar', 'add_app') . '[]=infolog&'.Link::get_registry('calendar','add_id').'[]=$id', |
|
1260 | + Link::get_registry('calendar', 'add_app').'[]=infolog&'.Link::get_registry('calendar', 'add_id').'[]=$id', |
|
1262 | 1261 | 'allowOnMultiple' => false, |
1263 | 1262 | 'popup' => Link::get_registry('calendar', 'add_popup'), |
1264 | 1263 | ); |
@@ -1296,7 +1295,7 @@ discard block |
||
1296 | 1295 | 'hint' => 'Convert to a ticket', |
1297 | 1296 | 'group' => $group, |
1298 | 1297 | 'url' => 'menuaction=tracker.tracker_ui.edit&'. |
1299 | - Link::get_registry('tracker', 'add_app') . '[]=infolog&'.Link::get_registry('tracker','add_id').'[]=$id', |
|
1298 | + Link::get_registry('tracker', 'add_app').'[]=infolog&'.Link::get_registry('tracker', 'add_id').'[]=$id', |
|
1300 | 1299 | 'allowOnMultiple' => false, |
1301 | 1300 | 'popup' => Link::get_registry('tracker', 'add_popup'), |
1302 | 1301 | ); |
@@ -1309,7 +1308,7 @@ discard block |
||
1309 | 1308 | $actions['ical'] = array( |
1310 | 1309 | 'icon' => 'ical', |
1311 | 1310 | 'caption' => 'Export iCal', |
1312 | - 'postSubmit' => true, // download needs post submit to work |
|
1311 | + 'postSubmit' => true, // download needs post submit to work |
|
1313 | 1312 | 'group' => $group, |
1314 | 1313 | 'allowOnMultiple' => true, |
1315 | 1314 | 'hideOnMobile' => true |
@@ -1362,14 +1361,14 @@ discard block |
||
1362 | 1361 | $success = $failed = 0; |
1363 | 1362 | if ($use_all) |
1364 | 1363 | { |
1365 | - @set_time_limit(0); // switch off the execution time limit, as it's for big selections to small |
|
1366 | - $query['num_rows'] = -1; // all |
|
1364 | + @set_time_limit(0); // switch off the execution time limit, as it's for big selections to small |
|
1365 | + $query['num_rows'] = -1; // all |
|
1367 | 1366 | $result = $readonlys = null; |
1368 | - $this->get_rows($query,$result,$readonlys); |
|
1367 | + $this->get_rows($query, $result, $readonlys); |
|
1369 | 1368 | $checked = array(); |
1370 | - foreach($result as $key => $info) |
|
1369 | + foreach ($result as $key => $info) |
|
1371 | 1370 | { |
1372 | - if(is_numeric($key)) |
|
1371 | + if (is_numeric($key)) |
|
1373 | 1372 | { |
1374 | 1373 | $checked[] = $info['info_id']; |
1375 | 1374 | } |
@@ -1380,29 +1379,29 @@ discard block |
||
1380 | 1379 | list($action, $settings) = explode('_', $_action, 2); |
1381 | 1380 | |
1382 | 1381 | // Actions that can handle a list of IDs |
1383 | - switch($action) |
|
1382 | + switch ($action) |
|
1384 | 1383 | { |
1385 | 1384 | case 'link': |
1386 | 1385 | list($add_remove, $link) = explode('_', $settings, 2); |
1387 | - list($app, $link_id) = explode(strpos($link,':') !== false ? ':' : ',', $link); |
|
1388 | - if(!$link_id) |
|
1386 | + list($app, $link_id) = explode(strpos($link, ':') !== false ? ':' : ',', $link); |
|
1387 | + if (!$link_id) |
|
1389 | 1388 | { |
1390 | 1389 | $action_msg = 'linked'; |
1391 | 1390 | $msg = lang('You need to select an entry for linking.'); |
1392 | 1391 | break; |
1393 | 1392 | } |
1394 | 1393 | $title = Link::title($app, $link_id); |
1395 | - foreach($checked as $id) |
|
1394 | + foreach ($checked as $id) |
|
1396 | 1395 | { |
1397 | - if(!$this->bo->check_access($id, Acl::EDIT)) |
|
1396 | + if (!$this->bo->check_access($id, Acl::EDIT)) |
|
1398 | 1397 | { |
1399 | 1398 | $failed++; |
1400 | 1399 | continue; |
1401 | 1400 | } |
1402 | - if($add_remove == 'add') |
|
1401 | + if ($add_remove == 'add') |
|
1403 | 1402 | { |
1404 | 1403 | $action_msg = lang('linked to %1', $title); |
1405 | - if(Link::link('infolog', $id, $app, $link_id)) |
|
1404 | + if (Link::link('infolog', $id, $app, $link_id)) |
|
1406 | 1405 | { |
1407 | 1406 | $success++; |
1408 | 1407 | } |
@@ -1429,20 +1428,20 @@ discard block |
||
1429 | 1428 | case 'ical': |
1430 | 1429 | // infolog_ical lets horde be auto-loaded, so it must go first |
1431 | 1430 | $boical = new infolog_ical(); |
1432 | - Api\Header\Content::type('todo.ics','text/calendar'); |
|
1431 | + Api\Header\Content::type('todo.ics', 'text/calendar'); |
|
1433 | 1432 | echo $boical->exportvCalendar($checked); |
1434 | 1433 | exit(); |
1435 | 1434 | |
1436 | 1435 | } |
1437 | 1436 | |
1438 | 1437 | // Actions that need to loop |
1439 | - foreach($checked as $id) |
|
1438 | + foreach ($checked as $id) |
|
1440 | 1439 | { |
1441 | - if(!$entry = $this->bo->read($id)) |
|
1440 | + if (!$entry = $this->bo->read($id)) |
|
1442 | 1441 | { |
1443 | 1442 | continue; |
1444 | 1443 | } |
1445 | - switch($action) |
|
1444 | + switch ($action) |
|
1446 | 1445 | { |
1447 | 1446 | case 'close': |
1448 | 1447 | $action_msg = lang('closed'); |
@@ -1452,8 +1451,8 @@ discard block |
||
1452 | 1451 | |
1453 | 1452 | case 'delete': |
1454 | 1453 | $action_msg = $settings == 'sub' ? lang(' (and children) deleted') : lang('deleted'); |
1455 | - $result = $this->bo->delete($id, $settings=='sub', false, $skip_notifications); |
|
1456 | - if($result == true) |
|
1454 | + $result = $this->bo->delete($id, $settings == 'sub', false, $skip_notifications); |
|
1455 | + if ($result == true) |
|
1457 | 1456 | { |
1458 | 1457 | $success++; |
1459 | 1458 | } |
@@ -1466,14 +1465,14 @@ discard block |
||
1466 | 1465 | case 'type': |
1467 | 1466 | $action_msg = lang('changed type'); |
1468 | 1467 | // Dont allow to change the type, if user has no delete rights from the group-owner |
1469 | - if ($id && !($this->bo->grants[$entry['info_owner']] & Acl::DELETE)) |
|
1468 | + if ($id && !($this->bo->grants[$entry['info_owner']]&Acl::DELETE)) |
|
1470 | 1469 | { |
1471 | 1470 | $failed++; |
1472 | 1471 | break; |
1473 | 1472 | } |
1474 | 1473 | $entry['info_type'] = $settings; |
1475 | 1474 | try { |
1476 | - $this->bo->write($entry, true,true,true,$skip_notifications,true); // Throw exceptions |
|
1475 | + $this->bo->write($entry, true, true, true, $skip_notifications, true); // Throw exceptions |
|
1477 | 1476 | } |
1478 | 1477 | catch (Api\Exception\WrongUserinput $e) |
1479 | 1478 | { |
@@ -1488,11 +1487,11 @@ discard block |
||
1488 | 1487 | $action_msg = lang('changed completion to %1%', $settings); |
1489 | 1488 | $entry['info_percent'] = $settings; |
1490 | 1489 | // Done and not-started entries will get changed right back if we don't change the status too |
1491 | - if(in_array($entry['info_status'],array('not-started','done','billed','cancelled','archive'))) |
|
1490 | + if (in_array($entry['info_status'], array('not-started', 'done', 'billed', 'cancelled', 'archive'))) |
|
1492 | 1491 | { |
1493 | 1492 | $entry['info_status'] = 'ongoing'; |
1494 | 1493 | } |
1495 | - if($entry['info_percent'] == 0) |
|
1494 | + if ($entry['info_percent'] == 0) |
|
1496 | 1495 | { |
1497 | 1496 | $entry['info_status'] = 'not-started'; |
1498 | 1497 | } |
@@ -1500,7 +1499,7 @@ discard block |
||
1500 | 1499 | { |
1501 | 1500 | $entry['info_status'] = 'done'; |
1502 | 1501 | } |
1503 | - if($this->bo->write($entry, true,true,true,$skip_notifications)) |
|
1502 | + if ($this->bo->write($entry, true, true, true, $skip_notifications)) |
|
1504 | 1503 | { |
1505 | 1504 | $success++; |
1506 | 1505 | } |
@@ -1512,24 +1511,23 @@ discard block |
||
1512 | 1511 | |
1513 | 1512 | case 'undelete': // set it to valid status != 'deleted' for that type |
1514 | 1513 | $settings = isset($this->bo->status[$entry['info_type']]['done']) ? |
1515 | - $this->bo->status[$entry['info_type']]['done'] : |
|
1516 | - $this->bo->status['defaults'][$entry['info_type']]; |
|
1514 | + $this->bo->status[$entry['info_type']]['done'] : $this->bo->status['defaults'][$entry['info_type']]; |
|
1517 | 1515 | // fall-through |
1518 | 1516 | case 'status': |
1519 | - if(isset($this->bo->status[$entry['info_type']][$settings])) |
|
1517 | + if (isset($this->bo->status[$entry['info_type']][$settings])) |
|
1520 | 1518 | { |
1521 | 1519 | $action_msg = lang('changed status to %1', lang($this->bo->status[$entry['info_type']][$settings])); |
1522 | - if(!in_array($settings,array('done','billed','cancelled','archive')) && $entry['info_percent'] == 100) |
|
1520 | + if (!in_array($settings, array('done', 'billed', 'cancelled', 'archive')) && $entry['info_percent'] == 100) |
|
1523 | 1521 | { |
1524 | 1522 | // Done entries will get changed right back if we don't change the completion too |
1525 | 1523 | $entry['info_percent'] = 10; |
1526 | 1524 | } |
1527 | - if(in_array($settings, array('not-started')) && $entry['info_percent'] > 0) |
|
1525 | + if (in_array($settings, array('not-started')) && $entry['info_percent'] > 0) |
|
1528 | 1526 | { |
1529 | 1527 | $entry['info_percent'] = 0; |
1530 | 1528 | } |
1531 | 1529 | $entry['info_status'] = $settings; |
1532 | - if($this->bo->write($entry, true,true,true,$skip_notifications)) |
|
1530 | + if ($this->bo->write($entry, true, true, true, $skip_notifications)) |
|
1533 | 1531 | { |
1534 | 1532 | $success++; |
1535 | 1533 | } |
@@ -1542,7 +1540,7 @@ discard block |
||
1542 | 1540 | break; |
1543 | 1541 | |
1544 | 1542 | case 'cat': |
1545 | - if($settings) |
|
1543 | + if ($settings) |
|
1546 | 1544 | { |
1547 | 1545 | $cat_name = Api\Categories::id2name($settings); |
1548 | 1546 | $action_msg = lang('changed category to %1', $cat_name); |
@@ -1552,7 +1550,7 @@ discard block |
||
1552 | 1550 | $action_msg = lang('removed category'); |
1553 | 1551 | } |
1554 | 1552 | $entry['info_cat'] = $settings; |
1555 | - if($this->bo->write($entry, true,true,true,$skip_notifications)) |
|
1553 | + if ($this->bo->write($entry, true, true, true, $skip_notifications)) |
|
1556 | 1554 | { |
1557 | 1555 | $success++; |
1558 | 1556 | } |
@@ -1564,15 +1562,15 @@ discard block |
||
1564 | 1562 | |
1565 | 1563 | case 'responsible': |
1566 | 1564 | list($add_remove, $user_str) = explode('_', $settings, 2); |
1567 | - $action_msg = ($add_remove == 'ok' ? lang('changed') : ($add_remove == 'add' ? lang('added') : lang('removed'))) . ' '; |
|
1565 | + $action_msg = ($add_remove == 'ok' ? lang('changed') : ($add_remove == 'add' ? lang('added') : lang('removed'))).' '; |
|
1568 | 1566 | $names = array(); |
1569 | 1567 | $users = explode(',', $user_str); |
1570 | - foreach($users as $account_id) |
|
1568 | + foreach ($users as $account_id) |
|
1571 | 1569 | { |
1572 | 1570 | $names[] = Api\Accounts::username($account_id); |
1573 | 1571 | } |
1574 | 1572 | $action_msg .= implode(', ', $names); |
1575 | - if($add_remove == 'ok') |
|
1573 | + if ($add_remove == 'ok') |
|
1576 | 1574 | { |
1577 | 1575 | $entry['info_responsible'] = (array)$users; |
1578 | 1576 | } |
@@ -1581,7 +1579,7 @@ discard block |
||
1581 | 1579 | $function = $add_remove == 'add' ? 'array_merge' : 'array_diff'; |
1582 | 1580 | $entry['info_responsible'] = array_unique($function($entry['info_responsible'], (array)$users)); |
1583 | 1581 | } |
1584 | - if($this->bo->write($entry, true,true,true,$skip_notifications)) |
|
1582 | + if ($this->bo->write($entry, true, true, true, $skip_notifications)) |
|
1585 | 1583 | { |
1586 | 1584 | $success++; |
1587 | 1585 | } |
@@ -1596,7 +1594,7 @@ discard block |
||
1596 | 1594 | list($ok, $date) = explode('_', $settings, 2); |
1597 | 1595 | $entry[$field] = $date ? Api\DateTime::to($date, 'ts') : null; |
1598 | 1596 | $action_msg = lang('changed'); |
1599 | - if($this->bo->write($entry, true,true,true,$skip_notifications)) |
|
1597 | + if ($this->bo->write($entry, true, true, true, $skip_notifications)) |
|
1600 | 1598 | { |
1601 | 1599 | $success++; |
1602 | 1600 | } |
@@ -1617,10 +1615,10 @@ discard block |
||
1617 | 1615 | * @param string $_referer='' |
1618 | 1616 | * @param boolean $closesingle=false |
1619 | 1617 | */ |
1620 | - function close($values=0,$_referer='',$closesingle=false,$skip_notification = false) |
|
1618 | + function close($values = 0, $_referer = '', $closesingle = false, $skip_notification = false) |
|
1621 | 1619 | { |
1622 | 1620 | //echo "<p>".__METHOD__."($values,$referer,$closeall)</p>\n"; |
1623 | - $info_id = (int) (is_array($values) ? $values['info_id'] : ($values ? $values : $_GET['info_id'])); |
|
1621 | + $info_id = (int)(is_array($values) ? $values['info_id'] : ($values ? $values : $_GET['info_id'])); |
|
1624 | 1622 | $referer = is_array($values) ? $values['referer'] : $_referer; |
1625 | 1623 | |
1626 | 1624 | if ($info_id) |
@@ -1630,11 +1628,11 @@ discard block |
||
1630 | 1628 | $status = $info['info_status']; |
1631 | 1629 | // closed stati assumed array('done','billed','cancelled') |
1632 | 1630 | if (isset($this->bo->status[$info['info_type']]['done'])) { |
1633 | - $status ='done'; |
|
1631 | + $status = 'done'; |
|
1634 | 1632 | } elseif (isset($this->bo->status[$info['info_type']]['billed'])) { |
1635 | - $status ='billed'; |
|
1633 | + $status = 'billed'; |
|
1636 | 1634 | } elseif (isset($this->bo->status[$info['info_type']]['cancelled'])) { |
1637 | - $status ='cancelled'; |
|
1635 | + $status = 'cancelled'; |
|
1638 | 1636 | } |
1639 | 1637 | #_debug_array($status); |
1640 | 1638 | $values = array( |
@@ -1644,15 +1642,15 @@ discard block |
||
1644 | 1642 | 'info_percent'=> 100, |
1645 | 1643 | 'info_datecompleted' => $this->bo->now_su, |
1646 | 1644 | ); |
1647 | - $this->bo->write($values, true,true,true,$skip_notification); |
|
1645 | + $this->bo->write($values, true, true, true, $skip_notification); |
|
1648 | 1646 | |
1649 | - $query = array('action'=>'sp','action_id'=>$info_id); |
|
1647 | + $query = array('action'=>'sp', 'action_id'=>$info_id); |
|
1650 | 1648 | if (!$closesingle) { |
1651 | - foreach((array)$this->bo->search($query) as $info) |
|
1649 | + foreach ((array)$this->bo->search($query) as $info) |
|
1652 | 1650 | { |
1653 | 1651 | if ($info['info_id_parent'] == $info_id) // search also returns linked entries! |
1654 | 1652 | { |
1655 | - $this->close($info['info_id'],$referer,$closesingle,$skip_notification); // we call ourselfs recursive to process subs from subs too |
|
1653 | + $this->close($info['info_id'], $referer, $closesingle, $skip_notification); // we call ourselfs recursive to process subs from subs too |
|
1656 | 1654 | } |
1657 | 1655 | } |
1658 | 1656 | } |
@@ -1668,9 +1666,9 @@ discard block |
||
1668 | 1666 | * @param string $called_by |
1669 | 1667 | * @param boolean $skip_notification Do not send notification of deletion |
1670 | 1668 | */ |
1671 | - function delete($values=0,$_referer='',$called_by='',$skip_notification=False) |
|
1669 | + function delete($values = 0, $_referer = '', $called_by = '', $skip_notification = False) |
|
1672 | 1670 | { |
1673 | - $info_id = (int) (is_array($values) ? $values['info_id'] : ($values ? $values : $_GET['info_id'])); |
|
1671 | + $info_id = (int)(is_array($values) ? $values['info_id'] : ($values ? $values : $_GET['info_id'])); |
|
1674 | 1672 | $referer = is_array($values) ? $values['referer'] : $_referer; |
1675 | 1673 | |
1676 | 1674 | if (!is_array($values) && $info_id > 0 && !$this->bo->anzSubs($info_id)) // entries without subs get confirmed by javascript |
@@ -1681,9 +1679,9 @@ discard block |
||
1681 | 1679 | |
1682 | 1680 | if (is_array($values) || $info_id <= 0) |
1683 | 1681 | { |
1684 | - if (($values['delete'] || $values['delete_subs']) && $info_id > 0 && $this->bo->check_access($info_id,Acl::DELETE)) |
|
1682 | + if (($values['delete'] || $values['delete_subs']) && $info_id > 0 && $this->bo->check_access($info_id, Acl::DELETE)) |
|
1685 | 1683 | { |
1686 | - $deleted = $this->bo->delete($info_id,$values['delete_subs'],$values['info_id_parent'], $skip_notification); |
|
1684 | + $deleted = $this->bo->delete($info_id, $values['delete_subs'], $values['info_id_parent'], $skip_notification); |
|
1687 | 1685 | } |
1688 | 1686 | if ($called_by) // direct call from the same request |
1689 | 1687 | { |
@@ -1693,7 +1691,7 @@ discard block |
||
1693 | 1691 | { |
1694 | 1692 | $this->edit(array( |
1695 | 1693 | 'info_id' => $info_id, |
1696 | - 'button' => array('deleted' => true), // not delete! |
|
1694 | + 'button' => array('deleted' => true), // not delete! |
|
1697 | 1695 | 'referer' => $referer, |
1698 | 1696 | 'msg' => $deleted ? lang('Infolog entry deleted') : '', |
1699 | 1697 | )); |
@@ -1701,7 +1699,7 @@ discard block |
||
1701 | 1699 | return $referer ? $this->tmpl->location($referer) : $this->index(); |
1702 | 1700 | } |
1703 | 1701 | $readonlys = $values = array(); |
1704 | - $values['main'][1] = $this->get_info($info_id,$readonlys['main']); |
|
1702 | + $values['main'][1] = $this->get_info($info_id, $readonlys['main']); |
|
1705 | 1703 | |
1706 | 1704 | $this->tmpl->read('infolog.delete'); |
1707 | 1705 | |
@@ -1722,7 +1720,7 @@ discard block |
||
1722 | 1720 | $GLOBALS['egw_info']['flags']['app_header'] = lang('InfoLog').' - '.lang('Delete'); |
1723 | 1721 | $GLOBALS['egw_info']['flags']['params']['manual'] = array('page' => 'ManualInfologDelete'); |
1724 | 1722 | |
1725 | - $this->tmpl->exec('infolog.infolog_ui.delete',$values,array(),$readonlys,$persist,$called_by == 'edit' ? 2 : 0); |
|
1723 | + $this->tmpl->exec('infolog.infolog_ui.delete', $values, array(), $readonlys, $persist, $called_by == 'edit' ? 2 : 0); |
|
1726 | 1724 | } |
1727 | 1725 | |
1728 | 1726 | /** |
@@ -1734,68 +1732,68 @@ discard block |
||
1734 | 1732 | * @param string $type Type of log-entry: note,todo,task |
1735 | 1733 | * @param string $referer array with param/get-vars of the refering page |
1736 | 1734 | */ |
1737 | - function edit($content = null,$action = '',$action_id=0,$type='',$referer='') |
|
1735 | + function edit($content = null, $action = '', $action_id = 0, $type = '', $referer = '') |
|
1738 | 1736 | { |
1739 | 1737 | if (($submit = is_array($content))) |
1740 | 1738 | { |
1741 | 1739 | //echo "infolog_ui::edit: content="; _debug_array($content); |
1742 | 1740 | $info_id = $content['info_id']; |
1743 | - $action = $content['action']; unset($content['action']); |
|
1741 | + $action = $content['action']; unset($content['action']); |
|
1744 | 1742 | $action_id = $content['action_id']; unset($content['action_id']); |
1745 | - $referer = $content['referer']; unset($content['referer']); |
|
1746 | - $no_popup = $content['no_popup']; unset($content['no_popup']); |
|
1743 | + $referer = $content['referer']; unset($content['referer']); |
|
1744 | + $no_popup = $content['no_popup']; unset($content['no_popup']); |
|
1747 | 1745 | |
1748 | 1746 | list($button) = @each($content['button']); |
1749 | - if (!$button && $action) $button = $action; // action selectbox |
|
1747 | + if (!$button && $action) $button = $action; // action selectbox |
|
1750 | 1748 | //info_cc expects an comma separated string |
1751 | 1749 | //error_log(__METHOD__.__LINE__.array2string($content)); |
1752 | 1750 | if (empty($content['info_cc'])) $content['info_cc'] = ""; |
1753 | 1751 | if (is_array($content['info_cc'])) |
1754 | 1752 | { |
1755 | - foreach($content['info_cc'] as $i => $value) |
|
1753 | + foreach ($content['info_cc'] as $i => $value) |
|
1756 | 1754 | { |
1757 | 1755 | //imap_rfc822 should not be used, but it works reliable here, until we have some regex solution or use horde stuff |
1758 | 1756 | $addresses = imap_rfc822_parse_adrlist($value, ''); |
1759 | 1757 | //error_log(__METHOD__.__LINE__.$value.'->'.array2string($addresses[0])); |
1760 | - $content['info_cc'][$i]=$addresses[0]->host ? $addresses[0]->mailbox.'@'.$addresses[0]->host : $addresses[0]->mailbox; |
|
1758 | + $content['info_cc'][$i] = $addresses[0]->host ? $addresses[0]->mailbox.'@'.$addresses[0]->host : $addresses[0]->mailbox; |
|
1761 | 1759 | } |
1762 | - if (!empty($content['info_cc'])) $content['info_cc'] = implode(',',$content['info_cc']); |
|
1760 | + if (!empty($content['info_cc'])) $content['info_cc'] = implode(',', $content['info_cc']); |
|
1763 | 1761 | } |
1764 | 1762 | unset($content['button']); |
1765 | 1763 | if ($button) |
1766 | 1764 | { |
1767 | 1765 | // Copy or schedule Infolog |
1768 | - if (in_array($button,array('copy','schedule','ical','tracker'))) |
|
1766 | + if (in_array($button, array('copy', 'schedule', 'ical', 'tracker'))) |
|
1769 | 1767 | { |
1770 | 1768 | $action = $button; |
1771 | - if (!$info_id || $this->bo->check_access($info_id,Acl::EDIT)) |
|
1769 | + if (!$info_id || $this->bo->check_access($info_id, Acl::EDIT)) |
|
1772 | 1770 | { |
1773 | - $button = 'apply'; // need to store infolog first |
|
1771 | + $button = 'apply'; // need to store infolog first |
|
1774 | 1772 | } |
1775 | 1773 | } |
1776 | 1774 | //Validate the enddate must be grather than startdate |
1777 | 1775 | if (!empty($content['info_enddate']) && !empty($content['info_startdate'])) |
1778 | 1776 | { |
1779 | - $duration_date = $content['info_enddate']-$content['info_startdate']; |
|
1777 | + $duration_date = $content['info_enddate'] - $content['info_startdate']; |
|
1780 | 1778 | if ($duration_date < 0) |
1781 | 1779 | { |
1782 | 1780 | $this->tmpl->set_validation_error('info_startdate', lang('Startdate must be before Enddate!!!')); |
1783 | - $button = $action = ''; // stop save or apply |
|
1781 | + $button = $action = ''; // stop save or apply |
|
1784 | 1782 | } |
1785 | 1783 | } |
1786 | 1784 | //echo "<p>infolog_ui::edit(info_id=$info_id) '$button' button pressed, content="; _debug_array($content); |
1787 | 1785 | if (($button == 'save' || $button == 'apply') && isset($content['info_subject']) && empty($content['info_subject'])) |
1788 | 1786 | { |
1789 | - $this->tmpl->set_validation_error('info_subject',lang('Field must not be empty !!!')); |
|
1790 | - $button = $action = ''; // stop save or apply |
|
1787 | + $this->tmpl->set_validation_error('info_subject', lang('Field must not be empty !!!')); |
|
1788 | + $button = $action = ''; // stop save or apply |
|
1791 | 1789 | } |
1792 | 1790 | if (($button == 'save' || $button == 'apply') && $info_id) |
1793 | 1791 | { |
1794 | 1792 | $old = $this->bo->read($info_id); |
1795 | - if (!($edit_acl = $this->bo->check_access($info_id,Acl::EDIT))) |
|
1793 | + if (!($edit_acl = $this->bo->check_access($info_id, Acl::EDIT))) |
|
1796 | 1794 | { |
1797 | 1795 | $status_only = $this->bo->is_responsible($old); |
1798 | - $undelete = $this->bo->check_access($old,infolog_bo::ACL_UNDELETE); |
|
1796 | + $undelete = $this->bo->check_access($old, infolog_bo::ACL_UNDELETE); |
|
1799 | 1797 | } |
1800 | 1798 | // enddate in the past gives warning |
1801 | 1799 | if (isset($content['info_enddate']) |
@@ -1808,46 +1806,45 @@ discard block |
||
1808 | 1806 | } |
1809 | 1807 | if (($button == 'save' || $button == 'apply') && (!$info_id || $edit_acl || $status_only || $undelete)) |
1810 | 1808 | { |
1811 | - $operation = $info_id ? 'edit' : 'add'; |
|
1809 | + $operation = $info_id ? 'edit' : 'add'; |
|
1812 | 1810 | |
1813 | 1811 | if (is_array($content['link_to']['to_id']) && count($content['link_to']['to_id'])) |
1814 | 1812 | { |
1815 | - $content['info_link_id'] = 0; // as field has to be int |
|
1813 | + $content['info_link_id'] = 0; // as field has to be int |
|
1816 | 1814 | } |
1817 | 1815 | $active_tab = $content['tabs']; |
1818 | 1816 | if (!($info_id = $this->bo->write($content, true, true, true, $content['no_notifications']))) |
1819 | 1817 | { |
1820 | - $content['msg'] = $info_id !== 0 || !$content['info_id'] ? lang('Error: saving the entry') : |
|
1821 | - lang('Error: the entry has been updated since you opened it for editing!').'<br />'. |
|
1822 | - lang('Copy your changes to the clipboard, %1reload the entry%2 and merge them.','<a href="'. |
|
1823 | - htmlspecialchars(Egw::link('/index.php',array( |
|
1818 | + $content['msg'] = $info_id !== 0 || !$content['info_id'] ? lang('Error: saving the entry') : lang('Error: the entry has been updated since you opened it for editing!').'<br />'. |
|
1819 | + lang('Copy your changes to the clipboard, %1reload the entry%2 and merge them.', '<a href="'. |
|
1820 | + htmlspecialchars(Egw::link('/index.php', array( |
|
1824 | 1821 | 'menuaction' => 'infolog.infolog_ui.edit', |
1825 | 1822 | 'info_id' => $content['info_id'], |
1826 | 1823 | 'no_popup' => $no_popup, |
1827 | 1824 | 'referer' => $referer, |
1828 | - ))).'">','</a>'); |
|
1829 | - $button = $action = ''; // not exiting edit |
|
1825 | + ))).'">', '</a>'); |
|
1826 | + $button = $action = ''; // not exiting edit |
|
1830 | 1827 | $info_id = $content['info_id']; |
1831 | 1828 | } |
1832 | 1829 | else |
1833 | 1830 | { |
1834 | - $GLOBALS['egw']->preferences->add('infolog','preferred_type',$content['info_type']); |
|
1835 | - $GLOBALS['egw']->preferences->save_repository(false,'user',false); |
|
1831 | + $GLOBALS['egw']->preferences->add('infolog', 'preferred_type', $content['info_type']); |
|
1832 | + $GLOBALS['egw']->preferences->save_repository(false, 'user', false); |
|
1836 | 1833 | $content['msg'] = lang('InfoLog entry saved'); |
1837 | - Framework::refresh_opener($content['msg'],'infolog',$info_id,$operation); |
|
1834 | + Framework::refresh_opener($content['msg'], 'infolog', $info_id, $operation); |
|
1838 | 1835 | } |
1839 | 1836 | $content['tabs'] = $active_tab; |
1840 | 1837 | |
1841 | - $pm_links = Link::get_links('infolog',$content['info_id'],'projectmanager'); |
|
1838 | + $pm_links = Link::get_links('infolog', $content['info_id'], 'projectmanager'); |
|
1842 | 1839 | |
1843 | 1840 | $content['link_to']['to_app'] = 'infolog'; |
1844 | 1841 | $content['link_to']['to_id'] = $info_id; |
1845 | 1842 | |
1846 | - if ($info_link_id && strpos($info_link_id,':') !== false) // updating info_link_id if necessary |
|
1843 | + if ($info_link_id && strpos($info_link_id, ':') !== false) // updating info_link_id if necessary |
|
1847 | 1844 | { |
1848 | - list($app,$id) = explode(':',$info_link_id); |
|
1849 | - $link = Link::get_link('infolog',$info_id,$app,$id); |
|
1850 | - if ((int) $content['info_link_id'] != (int) $link['link_id']) |
|
1845 | + list($app, $id) = explode(':', $info_link_id); |
|
1846 | + $link = Link::get_link('infolog', $info_id, $app, $id); |
|
1847 | + if ((int)$content['info_link_id'] != (int)$link['link_id']) |
|
1851 | 1848 | { |
1852 | 1849 | $content['info_link_id'] = $link['link_id']; |
1853 | 1850 | |
@@ -1859,7 +1856,7 @@ discard block |
||
1859 | 1856 | 'info_owner' => $content['info_owner'], |
1860 | 1857 | ); |
1861 | 1858 | //echo "<p>updating info_link_id: ".print_r($to_write,true)."</p>\n"; |
1862 | - $this->bo->write($to_write,False,true,true,true); // last true = no notifications, as no real change |
|
1859 | + $this->bo->write($to_write, False, true, true, true); // last true = no notifications, as no real change |
|
1863 | 1860 | |
1864 | 1861 | // Do not override info_contact if is already filled with contact |
1865 | 1862 | if ($content['info_contact']) |
@@ -1869,7 +1866,7 @@ discard block |
||
1869 | 1866 | } |
1870 | 1867 | |
1871 | 1868 | // we need eg. the new modification date, for further updates |
1872 | - $content = array_merge($content,$to_write); |
|
1869 | + $content = array_merge($content, $to_write); |
|
1873 | 1870 | } |
1874 | 1871 | } |
1875 | 1872 | } |
@@ -1880,33 +1877,33 @@ discard block |
||
1880 | 1877 | 'action' => $action, |
1881 | 1878 | 'action_id' => $action_id |
1882 | 1879 | ); |
1883 | - if (!($content['msg'] = $this->delete($info_id,$referer,'edit'))) return; // checks ACL first |
|
1880 | + if (!($content['msg'] = $this->delete($info_id, $referer, 'edit'))) return; // checks ACL first |
|
1884 | 1881 | |
1885 | - Framework::refresh_opener($content['msg'],'infolog',$info_id,'delete'); |
|
1882 | + Framework::refresh_opener($content['msg'], 'infolog', $info_id, 'delete'); |
|
1886 | 1883 | } |
1887 | 1884 | // called again after delete confirmation dialog |
1888 | - elseif ($button == 'deleted' && $content['msg']) |
|
1885 | + elseif ($button == 'deleted' && $content['msg']) |
|
1889 | 1886 | { |
1890 | - Framework::refresh_opener($content['msg'],'infolog',$info_id,'delete'); |
|
1887 | + Framework::refresh_opener($content['msg'], 'infolog', $info_id, 'delete'); |
|
1891 | 1888 | } |
1892 | 1889 | if ($button == 'save' || $button == 'cancel' || $button == 'delete' || $button == 'deleted') |
1893 | 1890 | { |
1894 | 1891 | if ($no_popup) |
1895 | 1892 | { |
1896 | - Egw::redirect_link($referer,array('msg' => $content['msg'])); |
|
1893 | + Egw::redirect_link($referer, array('msg' => $content['msg'])); |
|
1897 | 1894 | } |
1898 | 1895 | Framework::window_close(); |
1899 | 1896 | } |
1900 | 1897 | } |
1901 | 1898 | // on a type-change, set the status to the default status of that type, if the actual status is not supported by the new type |
1902 | - if (!array_key_exists($content['info_status'],$this->bo->status[$content['info_type']])) |
|
1899 | + if (!array_key_exists($content['info_status'], $this->bo->status[$content['info_type']])) |
|
1903 | 1900 | { |
1904 | 1901 | $content['info_status'] = $this->bo->status['defaults'][$content['info_type']]; |
1905 | 1902 | // Make sure we don't end up with invalid status / percent combinations |
1906 | 1903 | if ($content['info_status'] != 'done') |
1907 | 1904 | { |
1908 | 1905 | $content['info_datecompleted'] = ''; |
1909 | - if((int)$content['info_percent'] === 100) |
|
1906 | + if ((int)$content['info_percent'] === 100) |
|
1910 | 1907 | { |
1911 | 1908 | $content['info_percent'] = 10; |
1912 | 1909 | } |
@@ -1915,7 +1912,7 @@ discard block |
||
1915 | 1912 | { |
1916 | 1913 | $content['info_percent'] = 100; |
1917 | 1914 | } |
1918 | - if($content['info_status'] != 'not-started' && (int)$content['info_percent'] == 0) |
|
1915 | + if ($content['info_status'] != 'not-started' && (int)$content['info_percent'] == 0) |
|
1919 | 1916 | { |
1920 | 1917 | $content['info_percent'] = 10; |
1921 | 1918 | } |
@@ -1924,18 +1921,17 @@ discard block |
||
1924 | 1921 | else // new call via GET |
1925 | 1922 | { |
1926 | 1923 | //echo "<p>infolog_ui::edit: info_id=$info_id, action='$action', action_id='$action_id', type='$type', referer='$referer'</p>\n"; |
1927 | - $action = $action ? $action : $_REQUEST['action']; |
|
1924 | + $action = $action ? $action : $_REQUEST['action']; |
|
1928 | 1925 | $action_id = $action_id ? $action_id : $_REQUEST['action_id']; |
1929 | - $info_id = $content ? $content : $_REQUEST['info_id']; |
|
1930 | - $type = $type ? $type : $_REQUEST['type']; |
|
1931 | - $referer = $referer !== '' ? $referer : ($_GET['referer'] ? $_GET['referer'] : |
|
1932 | - Api\Header\Referer::get('/index.php?menuaction=infolog.infolog_ui.index')); |
|
1933 | - if (strpos($referer, 'msg=') !== false) $referer = preg_replace('/([&?]{1})msg=[^&]+&?/','\\1',$referer); // remove previou/old msg from referer |
|
1926 | + $info_id = $content ? $content : $_REQUEST['info_id']; |
|
1927 | + $type = $type ? $type : $_REQUEST['type']; |
|
1928 | + $referer = $referer !== '' ? $referer : ($_GET['referer'] ? $_GET['referer'] : Api\Header\Referer::get('/index.php?menuaction=infolog.infolog_ui.index')); |
|
1929 | + if (strpos($referer, 'msg=') !== false) $referer = preg_replace('/([&?]{1})msg=[^&]+&?/', '\\1', $referer); // remove previou/old msg from referer |
|
1934 | 1930 | $no_popup = $_GET['no_popup']; |
1935 | - $print = (int) $_REQUEST['print']; |
|
1931 | + $print = (int)$_REQUEST['print']; |
|
1936 | 1932 | //echo "<p>infolog_ui::edit: info_id=$info_id, action='$action', action_id='$action_id', type='$type', referer='$referer'</p>\n"; |
1937 | 1933 | |
1938 | - if (($content = $this->bo->read( $info_id || $action != 'sp' ? $info_id : $action_id )) === false) |
|
1934 | + if (($content = $this->bo->read($info_id || $action != 'sp' ? $info_id : $action_id)) === false) |
|
1939 | 1935 | { |
1940 | 1936 | Framework::window_close(lang('Permission denied!')); |
1941 | 1937 | } |
@@ -1947,29 +1943,29 @@ discard block |
||
1947 | 1943 | { |
1948 | 1944 | $content['info_cat'] = $this->prefs['cat_add_default']; |
1949 | 1945 | } |
1950 | - if ($_GET['msg']) $content['msg'] = strip_tags($_GET['msg']); // dont allow HTML! |
|
1946 | + if ($_GET['msg']) $content['msg'] = strip_tags($_GET['msg']); // dont allow HTML! |
|
1951 | 1947 | |
1952 | - switch($this->prefs['set_start']) |
|
1948 | + switch ($this->prefs['set_start']) |
|
1953 | 1949 | { |
1954 | - case 'date': default: $set_startdate = mktime(0,0,0,date('m',$this->bo->user_time_now),date('d',$this->bo->user_time_now),date('Y',$this->bo->user_time_now)); break; |
|
1950 | + case 'date': default: $set_startdate = mktime(0, 0, 0, date('m', $this->bo->user_time_now), date('d', $this->bo->user_time_now), date('Y', $this->bo->user_time_now)); break; |
|
1955 | 1951 | case 'datetime': $set_startdate = $this->bo->user_time_now; break; |
1956 | 1952 | case 'empty': $set_startdate = 0; break; |
1957 | 1953 | } |
1958 | 1954 | if ((int)$content['info_link_id'] > 0 && !Link::get_link($content['info_link_id'])) |
1959 | 1955 | { |
1960 | - $content['info_link_id'] = 0; // link has been deleted |
|
1956 | + $content['info_link_id'] = 0; // link has been deleted |
|
1961 | 1957 | if (!$content['info_custom_link']) $content['info_from'] = ''; |
1962 | 1958 | } |
1963 | 1959 | if (!$info_id && $action_id && $action == 'sp') // new SubProject |
1964 | 1960 | { |
1965 | - if (!$this->bo->check_access($action_id,Acl::ADD)) |
|
1961 | + if (!$this->bo->check_access($action_id, Acl::ADD)) |
|
1966 | 1962 | { |
1967 | - return $referer ? $this->tmpl->location($referer) : $this->index(0,$action,$action_id); |
|
1963 | + return $referer ? $this->tmpl->location($referer) : $this->index(0, $action, $action_id); |
|
1968 | 1964 | } |
1969 | 1965 | } |
1970 | 1966 | else |
1971 | 1967 | { |
1972 | - $undelete = $this->bo->check_access($content,infolog_bo::ACL_UNDELETE); |
|
1968 | + $undelete = $this->bo->check_access($content, infolog_bo::ACL_UNDELETE); |
|
1973 | 1969 | } |
1974 | 1970 | $content['links'] = $content['link_to'] = array( |
1975 | 1971 | 'to_id' => $info_id, |
@@ -1977,12 +1973,12 @@ discard block |
||
1977 | 1973 | ); |
1978 | 1974 | } |
1979 | 1975 | // new call via GET or some actions handled here, as they can happen both ways ($_GET[action] or button/action in GUI) |
1980 | - if (!$submit || in_array($action,array('sp','copy','schedule','ical','to_tracker'))) |
|
1976 | + if (!$submit || in_array($action, array('sp', 'copy', 'schedule', 'ical', 'to_tracker'))) |
|
1981 | 1977 | { |
1982 | 1978 | switch ($action) |
1983 | 1979 | { |
1984 | 1980 | case 'schedule': |
1985 | - Egw::redirect_link('/index.php',array( |
|
1981 | + Egw::redirect_link('/index.php', array( |
|
1986 | 1982 | 'menuaction' => 'calendar.calendar_uiforms.edit', |
1987 | 1983 | 'link_app' => 'infolog', |
1988 | 1984 | 'link_id' => $info_id, |
@@ -1990,7 +1986,7 @@ discard block |
||
1990 | 1986 | break; |
1991 | 1987 | case 'ical': |
1992 | 1988 | $boical = new infolog_ical(); |
1993 | - $result = $boical->exportVTODO($content,'2.0','PUBLISH',false); |
|
1989 | + $result = $boical->exportVTODO($content, '2.0', 'PUBLISH', false); |
|
1994 | 1990 | Api\Header\Content::type('todo.ics', 'text/calendar'); |
1995 | 1991 | echo $result; |
1996 | 1992 | exit(); |
@@ -2001,23 +1997,23 @@ discard block |
||
2001 | 1997 | if ($action == 'sp') // for sub-entries use type or category, like for new entries |
2002 | 1998 | { |
2003 | 1999 | if ($type) $content['info_type'] = $type; |
2004 | - if (is_numeric($_REQUEST['cat_id'])) $content['info_cat'] = (int) $_REQUEST['cat_id']; |
|
2000 | + if (is_numeric($_REQUEST['cat_id'])) $content['info_cat'] = (int)$_REQUEST['cat_id']; |
|
2005 | 2001 | } |
2006 | - unset($action); // it get stored in $content and will cause an other copy after [apply] |
|
2002 | + unset($action); // it get stored in $content and will cause an other copy after [apply] |
|
2007 | 2003 | break; |
2008 | 2004 | case 'to_tracker': |
2009 | - Egw::redirect_link('/index.php',array( |
|
2005 | + Egw::redirect_link('/index.php', array( |
|
2010 | 2006 | 'menuaction' => 'tracker.tracker_ui.edit', |
2011 | 2007 | Link::get_registry('tracker', 'add_app').'[]' => 'infolog', |
2012 | - Link::get_registry('tracker','add_id').'[]' => $info_id, |
|
2008 | + Link::get_registry('tracker', 'add_id').'[]' => $info_id, |
|
2013 | 2009 | )); |
2014 | 2010 | break; |
2015 | 2011 | case 'projectmanager': |
2016 | 2012 | $content['pm_id'] = $action_id; |
2017 | 2013 | default: // to allow other apps to participate |
2018 | 2014 | $content['info_subject'] = Link::title($action, $id); |
2019 | - $action_ids = explode(',',$action_id); |
|
2020 | - if(count($action_ids) == 1) |
|
2015 | + $action_ids = explode(',', $action_id); |
|
2016 | + if (count($action_ids) == 1) |
|
2021 | 2017 | { |
2022 | 2018 | $content['info_contact'] = array('app' => $action, 'id' => $action_id); |
2023 | 2019 | } |
@@ -2026,11 +2022,11 @@ discard block |
||
2026 | 2022 | Link::link('infolog', $content['link_to']['to_id'], $action, $id); |
2027 | 2023 | |
2028 | 2024 | // calling "infolog_set" hook for first, in case app wants to set some more values |
2029 | - if (!$n && ($set = Api\Hooks::single(array('location'=>'infolog_set','id'=>$action_id),$action))) |
|
2025 | + if (!$n && ($set = Api\Hooks::single(array('location'=>'infolog_set', 'id'=>$action_id), $action))) |
|
2030 | 2026 | { |
2031 | - foreach((array)$set['link_app'] as $i => $l_app) |
|
2027 | + foreach ((array)$set['link_app'] as $i => $l_app) |
|
2032 | 2028 | { |
2033 | - if (($l_id=$set['link_id'][$i])) Link::link('infolog',$content['link_to']['to_id'],$l_app,$l_id); |
|
2029 | + if (($l_id = $set['link_id'][$i])) Link::link('infolog', $content['link_to']['to_id'], $l_app, $l_id); |
|
2034 | 2030 | } |
2035 | 2031 | unset($set['link_app']); |
2036 | 2032 | unset($set['link_id']); |
@@ -2044,12 +2040,12 @@ discard block |
||
2044 | 2040 | { |
2045 | 2041 | if (!isset($pm_links)) |
2046 | 2042 | { |
2047 | - $pm_links = Link::get_links('infolog',$info_id,'projectmanager'); |
|
2043 | + $pm_links = Link::get_links('infolog', $info_id, 'projectmanager'); |
|
2048 | 2044 | } |
2049 | - break; // normal edit |
|
2045 | + break; // normal edit |
|
2050 | 2046 | } |
2051 | 2047 | case 'new': // new entry, set some defaults, if not set by infolog_set hook |
2052 | - if (empty($content['info_startdate'])) $content['info_startdate'] = (int) $_GET['startdate'] ? (int) $_GET['startdate'] : $set_startdate; |
|
2048 | + if (empty($content['info_startdate'])) $content['info_startdate'] = (int)$_GET['startdate'] ? (int)$_GET['startdate'] : $set_startdate; |
|
2053 | 2049 | if (empty($content['info_priority'])) $content['info_priority'] = 1; // normal |
2054 | 2050 | $content['info_owner'] = $this->user; |
2055 | 2051 | if ($type != '' && empty($content['info_type'])) |
@@ -2074,9 +2070,9 @@ discard block |
||
2074 | 2070 | if ($this->bo->group_owners) |
2075 | 2071 | { |
2076 | 2072 | // remove types owned by groups the user has no edit grant (current type is made readonly) |
2077 | - foreach($this->bo->group_owners as $type => $group) |
|
2073 | + foreach ($this->bo->group_owners as $type => $group) |
|
2078 | 2074 | { |
2079 | - if (!($this->bo->grants[$group] & Acl::EDIT)) |
|
2075 | + if (!($this->bo->grants[$group]&Acl::EDIT)) |
|
2080 | 2076 | { |
2081 | 2077 | if ($type == $content['info_type']) |
2082 | 2078 | { |
@@ -2094,7 +2090,7 @@ discard block |
||
2094 | 2090 | { |
2095 | 2091 | $content['info_owner'] = $this->bo->group_owners[$content['info_type']]; |
2096 | 2092 | // Dont allow to change the type, if user has no delete rights from the group-owner |
2097 | - if ($info_id && !($this->bo->grants[$content['info_owner']] & Acl::DELETE)) |
|
2093 | + if ($info_id && !($this->bo->grants[$content['info_owner']]&Acl::DELETE)) |
|
2098 | 2094 | { |
2099 | 2095 | //echo "<p>setting type to r/o as user has no delete rights from group #$group</p>\n"; |
2100 | 2096 | $readonlys['info_type'] = true; |
@@ -2102,7 +2098,7 @@ discard block |
||
2102 | 2098 | // disable info_access for group-owners |
2103 | 2099 | $readonlys['info_access'] = true; |
2104 | 2100 | } |
2105 | - elseif($GLOBALS['egw']->accounts->get_type($content['info_owner']) == 'g') |
|
2101 | + elseif ($GLOBALS['egw']->accounts->get_type($content['info_owner']) == 'g') |
|
2106 | 2102 | { |
2107 | 2103 | $content['info_owner'] = $this->user; |
2108 | 2104 | } |
@@ -2116,17 +2112,17 @@ discard block |
||
2116 | 2112 | // for no edit rights or implizit edit of responsible user make all fields readonly, but status and percent |
2117 | 2113 | if ($info_id && !$this->bo->check_access($content, Acl::EDIT) && !$undelete) |
2118 | 2114 | { |
2119 | - $readonlys['__ALL__'] = true; // make all fields not explicitly set readonly |
|
2115 | + $readonlys['__ALL__'] = true; // make all fields not explicitly set readonly |
|
2120 | 2116 | if ($this->bo->is_responsible($content)) |
2121 | 2117 | { |
2122 | - foreach($this->bo->responsible_edit as $name) |
|
2118 | + foreach ($this->bo->responsible_edit as $name) |
|
2123 | 2119 | { |
2124 | 2120 | $readonlys[$name] = false; |
2125 | 2121 | } |
2126 | 2122 | $readonlys['timestamp'] = $readonlys['info_des']; |
2127 | 2123 | $readonlys['button[edit]'] = $readonlys['button[save]'] = $readonlys['button[apply]'] = $readonlys['no_notifications'] = false; |
2128 | 2124 | } |
2129 | - $readonlys['action'] = $readonlys['button[cancel]'] = false; // always allowed |
|
2125 | + $readonlys['action'] = $readonlys['button[cancel]'] = false; // always allowed |
|
2130 | 2126 | } |
2131 | 2127 | elseif (!$info_id) |
2132 | 2128 | { |
@@ -2141,14 +2137,14 @@ discard block |
||
2141 | 2137 | |
2142 | 2138 | if (!($readonlys['button[delete]'] = !$info_id || !$this->bo->check_access($content, Acl::DELETE))) |
2143 | 2139 | { |
2144 | - $content['info_anz_subs'] = $this->bo->anzSubs($info_id); // to determine js confirmation of delete or not |
|
2140 | + $content['info_anz_subs'] = $this->bo->anzSubs($info_id); // to determine js confirmation of delete or not |
|
2145 | 2141 | } |
2146 | 2142 | $GLOBALS['egw_info']['flags']['app_header'] = lang($this->messages[$info_id ? 'edit' : ($action == 'sp' ? 'add_sub' : 'add')]); |
2147 | 2143 | |
2148 | 2144 | // use a typ-specific template (infolog.edit.xyz), if one exists, otherwise fall back to the generic one |
2149 | 2145 | if (!$this->tmpl->read('infolog.edit.'.$content['info_type'])) |
2150 | 2146 | { |
2151 | - $this->tmpl->read($print ? 'infolog.edit.print':'infolog.edit'); |
|
2147 | + $this->tmpl->read($print ? 'infolog.edit.print' : 'infolog.edit'); |
|
2152 | 2148 | } |
2153 | 2149 | if ($this->bo->has_customfields($content['info_type'])) |
2154 | 2150 | { |
@@ -2160,7 +2156,7 @@ discard block |
||
2160 | 2156 | } |
2161 | 2157 | if (!isset($GLOBALS['egw_info']['user']['apps']['projectmanager'])) |
2162 | 2158 | { |
2163 | - $readonlys['tabs']['project'] = true; // disable the project tab |
|
2159 | + $readonlys['tabs']['project'] = true; // disable the project tab |
|
2164 | 2160 | } |
2165 | 2161 | |
2166 | 2162 | $content['duration_format'] = $this->duration_format; |
@@ -2168,15 +2164,14 @@ discard block |
||
2168 | 2164 | if ($this->prefs['show_id']) $content['info_number'] = $info_id; |
2169 | 2165 | |
2170 | 2166 | // Check no notification preference, update if type changed |
2171 | - if($content['info_type'] != $content['old_type']) |
|
2167 | + if ($content['info_type'] != $content['old_type']) |
|
2172 | 2168 | { |
2173 | 2169 | $content['no_notifications'] = in_array($content['info_type'], !is_array($this->prefs['no_notification_types']) ? |
2174 | - explode(',',$this->prefs['no_notification_types']): |
|
2175 | - $this->prefs['no_notification_types'] |
|
2170 | + explode(',', $this->prefs['no_notification_types']) : $this->prefs['no_notification_types'] |
|
2176 | 2171 | ); |
2177 | 2172 | } |
2178 | 2173 | |
2179 | - $content['info_anz_subs'] = (int)$content['info_anz_subs']; // gives javascript error if empty! |
|
2174 | + $content['info_anz_subs'] = (int)$content['info_anz_subs']; // gives javascript error if empty! |
|
2180 | 2175 | |
2181 | 2176 | $old_pm_id = is_array($pm_links) ? array_shift($pm_links) : $content['old_pm_id']; |
2182 | 2177 | unset($content['old_pm_id']); |
@@ -2194,7 +2189,7 @@ discard block |
||
2194 | 2189 | 'Pr' => $this->bo->enums['priority'], |
2195 | 2190 | 'Ow' => 'select-account', |
2196 | 2191 | //'Ac', // info_access: private||public |
2197 | - 'St' => $this->bo->status[$content['info_type']]+array('deleted' => 'deleted'), |
|
2192 | + 'St' => $this->bo->status[$content['info_type']] + array('deleted' => 'deleted'), |
|
2198 | 2193 | 'Pe' => 'select-percent', |
2199 | 2194 | 'Co' => 'date-time', |
2200 | 2195 | 'st' => 'date-time', |
@@ -2211,7 +2206,7 @@ discard block |
||
2211 | 2206 | ); |
2212 | 2207 | $history_stati = array(); |
2213 | 2208 | $tracking = new infolog_tracking($this); |
2214 | - foreach($tracking->field2history as $field => $history) |
|
2209 | + foreach ($tracking->field2history as $field => $history) |
|
2215 | 2210 | { |
2216 | 2211 | $history_stati[$history] = $tracking->field2label[$field]; |
2217 | 2212 | } |
@@ -2256,8 +2251,8 @@ discard block |
||
2256 | 2251 | //$content['info_des'] = substr($content['info_des'],0,1793); |
2257 | 2252 | //echo "<p>infolog_ui.edit(info_id='$info_id',action='$action',action_id='$action_id') readonlys="; print_r($readonlys); echo ", content = "; _debug_array($content); |
2258 | 2253 | //$content['info_cc'] is expected (by the widget) to be an array of emailaddresses, but is stored as comma separated string |
2259 | - if (!empty($content['info_cc'])&&!is_array($content['info_cc']))$content['info_cc'] = explode(',',$content['info_cc']); |
|
2260 | - $preserve = array_merge( $preserv, array( // preserved values |
|
2254 | + if (!empty($content['info_cc']) && !is_array($content['info_cc']))$content['info_cc'] = explode(',', $content['info_cc']); |
|
2255 | + $preserve = array_merge($preserv, array( // preserved values |
|
2261 | 2256 | 'info_id' => $info_id, |
2262 | 2257 | 'action' => $action, |
2263 | 2258 | 'action_id' => $action_id, |
@@ -2266,7 +2261,7 @@ discard block |
||
2266 | 2261 | 'old_pm_id' => $old_pm_id, |
2267 | 2262 | 'old_type' => $content['info_type'], |
2268 | 2263 | )); |
2269 | - $this->tmpl->exec('infolog.infolog_ui.edit',$content,$sel_options,$readonlys,$preserve,$no_popup ? 0 : 2); |
|
2264 | + $this->tmpl->exec('infolog.infolog_ui.edit', $content, $sel_options, $readonlys, $preserve, $no_popup ? 0 : 2); |
|
2270 | 2265 | } |
2271 | 2266 | |
2272 | 2267 | /** |
@@ -2277,16 +2272,16 @@ discard block |
||
2277 | 2272 | * @param array &$content |
2278 | 2273 | * @param boolean $create_sub true: create a sub-entry instead of a copy, default false to create a copy |
2279 | 2274 | */ |
2280 | - private function create_copy(array &$content, $create_sub=false) |
|
2275 | + private function create_copy(array &$content, $create_sub = false) |
|
2281 | 2276 | { |
2282 | - $info_id = $content['info_id']; // it will be unset by exclude-fields |
|
2277 | + $info_id = $content['info_id']; // it will be unset by exclude-fields |
|
2283 | 2278 | |
2284 | 2279 | // empty fields configured to be excluded (also contains id, uid, ...) |
2285 | 2280 | $exclude_fields = $create_sub ? $this->bo->sub_excludefields : $this->bo->copy_excludefields; |
2286 | 2281 | foreach ($exclude_fields as $field) |
2287 | 2282 | { |
2288 | 2283 | unset($content[$field]); |
2289 | - if ($field == 'info_from') unset($content['info_link_id']); // both together is called contact in UI |
|
2284 | + if ($field == 'info_from') unset($content['info_link_id']); // both together is called contact in UI |
|
2290 | 2285 | } |
2291 | 2286 | if ($create_sub) |
2292 | 2287 | { |
@@ -2295,9 +2290,9 @@ discard block |
||
2295 | 2290 | // no startdate or startdate in the past --> set startdate from pref |
2296 | 2291 | if (!isset($content['info_startdate']) || $content['info_startdate'] < $this->bo->user_time_now) |
2297 | 2292 | { |
2298 | - switch($this->prefs['set_start']) |
|
2293 | + switch ($this->prefs['set_start']) |
|
2299 | 2294 | { |
2300 | - case 'date': default: $set_startdate = mktime(0,0,0,date('m',$this->bo->user_time_now),date('d',$this->bo->user_time_now),date('Y',$this->bo->user_time_now)); break; |
|
2295 | + case 'date': default: $set_startdate = mktime(0, 0, 0, date('m', $this->bo->user_time_now), date('d', $this->bo->user_time_now), date('Y', $this->bo->user_time_now)); break; |
|
2301 | 2296 | case 'datetime': $set_startdate = $this->bo->user_time_now; break; |
2302 | 2297 | case 'empty': $set_startdate = 0; break; |
2303 | 2298 | } |
@@ -2316,17 +2311,17 @@ discard block |
||
2316 | 2311 | // get a consistent status, percent and date-completed |
2317 | 2312 | if (!isset($content['info_status'])) $content['info_status'] = $this->bo->status['defaults'][$content['info_type']]; |
2318 | 2313 | if (!isset($content['info_percent'])) $content['info_percent'] = $content['info_status'] == 'done' ? '100%' : '0%'; |
2319 | - $content['info_datecompleted'] =$content['info_status'] == 'done' ? $this->bo->user_time_now : 0; |
|
2314 | + $content['info_datecompleted'] = $content['info_status'] == 'done' ? $this->bo->user_time_now : 0; |
|
2320 | 2315 | |
2321 | 2316 | if (!isset($content['info_cat'])) $content['info_cat'] = $this->prefs['cat_add_default']; |
2322 | 2317 | |
2323 | - if(!is_array($content['link_to'])) $content['link_to'] = array(); |
|
2318 | + if (!is_array($content['link_to'])) $content['link_to'] = array(); |
|
2324 | 2319 | $content['link_to']['to_app'] = 'infolog'; |
2325 | 2320 | $content['link_to']['to_id'] = 0; |
2326 | 2321 | // Get links to be copied, if not excluded |
2327 | - if (!in_array('link_to',$exclude_fields) || !in_array('attachments',$exclude_fields)) |
|
2322 | + if (!in_array('link_to', $exclude_fields) || !in_array('attachments', $exclude_fields)) |
|
2328 | 2323 | { |
2329 | - foreach(Link::get_links($content['link_to']['to_app'], $info_id) as $link) |
|
2324 | + foreach (Link::get_links($content['link_to']['to_app'], $info_id) as $link) |
|
2330 | 2325 | { |
2331 | 2326 | if ($link['app'] != Link::VFS_APPNAME && !in_array('link_to', $exclude_fields)) |
2332 | 2327 | { |
@@ -2350,24 +2345,23 @@ discard block |
||
2350 | 2345 | if (!isset($content['info_contact']) || empty($content['info_contact']) || $content['info_contact'] === 'copy:') |
2351 | 2346 | { |
2352 | 2347 | $linkinfos = Link::get_link($info_link_id); |
2353 | - $content['info_contact'] = $linkinfos['link_app1']=='infolog'? |
|
2354 | - array('app' => $linkinfos['link_app2'], 'id' => $linkinfos['link_id2']): |
|
2355 | - array('app' => $linkinfos['link_app1'], 'id' => $linkinfos['link_id1']); |
|
2348 | + $content['info_contact'] = $linkinfos['link_app1'] == 'infolog' ? |
|
2349 | + array('app' => $linkinfos['link_app2'], 'id' => $linkinfos['link_id2']) : array('app' => $linkinfos['link_app1'], 'id' => $linkinfos['link_id1']); |
|
2356 | 2350 | if ($content['info_contact']['app'] == 'projectmanager') |
2357 | 2351 | { |
2358 | - $content['pm_id'] = $linkinfos['link_app1']=='projectmanager'? $linkinfos['link_id1']:$linkinfos['link_id2']; |
|
2352 | + $content['pm_id'] = $linkinfos['link_app1'] == 'projectmanager' ? $linkinfos['link_id1'] : $linkinfos['link_id2']; |
|
2359 | 2353 | } |
2360 | 2354 | } |
2361 | 2355 | unset($content['info_link_id']); |
2362 | 2356 | } |
2363 | - $content['info_owner'] = !(int)$this->owner || !$this->bo->check_perms(Acl::ADD,0,$this->owner) ? $this->user : $this->owner; |
|
2357 | + $content['info_owner'] = !(int)$this->owner || !$this->bo->check_perms(Acl::ADD, 0, $this->owner) ? $this->user : $this->owner; |
|
2364 | 2358 | |
2365 | 2359 | if (!empty($content['info_subject'])) |
2366 | 2360 | { |
2367 | 2361 | if ($create_sub) |
2368 | 2362 | { |
2369 | 2363 | $config = Api\Config::read('infolog'); |
2370 | - $prefix = lang(empty($config['sub_prefix']) ? 'Re:': $config['sub_prefix']); |
|
2364 | + $prefix = lang(empty($config['sub_prefix']) ? 'Re:' : $config['sub_prefix']); |
|
2371 | 2365 | } |
2372 | 2366 | else |
2373 | 2367 | { |
@@ -2377,11 +2371,11 @@ discard block |
||
2377 | 2371 | } |
2378 | 2372 | if (!$create_sub) |
2379 | 2373 | { |
2380 | - $content['msg'] .= ($content['msg']?"\n":'').lang('%1 copied - the copy can now be edited', lang(Link::get_registry('infolog','entry'))); |
|
2374 | + $content['msg'] .= ($content['msg'] ? "\n" : '').lang('%1 copied - the copy can now be edited', lang(Link::get_registry('infolog', 'entry'))); |
|
2381 | 2375 | } |
2382 | 2376 | } |
2383 | 2377 | |
2384 | - function icon($cat,$id,$status='') |
|
2378 | + function icon($cat, $id, $status = '') |
|
2385 | 2379 | { |
2386 | 2380 | if (!$status || !($icon = $this->icons[$cat][$id.'_'.$status])) |
2387 | 2381 | { |
@@ -2398,7 +2392,7 @@ discard block |
||
2398 | 2392 | $alt = $id; |
2399 | 2393 | } |
2400 | 2394 | } |
2401 | - return $icon ? Api\Html::image('infolog',$icon,lang($alt),'border=0') : lang($alt); |
|
2395 | + return $icon ? Api\Html::image('infolog', $icon, lang($alt), 'border=0') : lang($alt); |
|
2402 | 2396 | } |
2403 | 2397 | |
2404 | 2398 | /** |
@@ -2446,27 +2440,27 @@ discard block |
||
2446 | 2440 | 'info_cc' => 'CC', |
2447 | 2441 | ); |
2448 | 2442 | // add customfields to field list |
2449 | - foreach(Api\Storage\Customfields::get('infolog') as $name => $data) |
|
2443 | + foreach (Api\Storage\Customfields::get('infolog') as $name => $data) |
|
2450 | 2444 | { |
2451 | 2445 | $excludefields['#'.$name] = $data['label']; |
2452 | 2446 | } |
2453 | 2447 | $sub_excludefields = $excludefields; |
2454 | - unset($sub_excludefields['info_id_parent']); // always set to parent! |
|
2448 | + unset($sub_excludefields['info_id_parent']); // always set to parent! |
|
2455 | 2449 | |
2456 | 2450 | $config = Api\Config::read('infolog'); |
2457 | 2451 | |
2458 | - if($content) |
|
2452 | + if ($content) |
|
2459 | 2453 | { |
2460 | 2454 | // Save |
2461 | 2455 | $button = key($content['button']); |
2462 | - if($button == 'save' || $button == 'apply') |
|
2456 | + if ($button == 'save' || $button == 'apply') |
|
2463 | 2457 | { |
2464 | - $this->bo->responsible_edit = array('info_status','info_percent','info_datecompleted'); |
|
2458 | + $this->bo->responsible_edit = array('info_status', 'info_percent', 'info_datecompleted'); |
|
2465 | 2459 | |
2466 | 2460 | if ($content['responsible_edit']) |
2467 | 2461 | { |
2468 | - $extra = array_intersect($content['responsible_edit'],array_keys($fields)); |
|
2469 | - $this->bo->responsible_edit = array_unique(array_merge($this->bo->responsible_edit,$extra)); |
|
2462 | + $extra = array_intersect($content['responsible_edit'], array_keys($fields)); |
|
2463 | + $this->bo->responsible_edit = array_unique(array_merge($this->bo->responsible_edit, $extra)); |
|
2470 | 2464 | } |
2471 | 2465 | Api\Config::save_value('copy_excludefields', $content['copy_excludefields'] ? $content['copy_excludefields'] : null, 'infolog'); |
2472 | 2466 | Api\Config::save_value('sub_excludefields', $content['sub_excludefields'] ? $content['sub_excludefields'] : array('*NONE*'), 'infolog'); |
@@ -2477,12 +2471,12 @@ discard block |
||
2477 | 2471 | Api\Config::save_value('sub_prefix', $content['sub_prefix'], 'infolog'); |
2478 | 2472 | Api\Config::save_value('allow_past_due_date', $content['allow_past_due_date'], 'infolog'); |
2479 | 2473 | // Notifications |
2480 | - $notifications =& $config[infolog_tracking::CUSTOM_NOTIFICATION]; |
|
2474 | + $notifications = & $config[infolog_tracking::CUSTOM_NOTIFICATION]; |
|
2481 | 2475 | $notifications[$content['notification_type']] = $content['notification']; |
2482 | - Api\Config::save_value(infolog_tracking::CUSTOM_NOTIFICATION, $notifications,'infolog'); |
|
2476 | + Api\Config::save_value(infolog_tracking::CUSTOM_NOTIFICATION, $notifications, 'infolog'); |
|
2483 | 2477 | } |
2484 | 2478 | |
2485 | - if($button == 'save' || $button == 'cancel') |
|
2479 | + if ($button == 'save' || $button == 'cancel') |
|
2486 | 2480 | { |
2487 | 2481 | Egw::redirect_link('/index.php', array( |
2488 | 2482 | 'menuaction' => 'admin.admin_ui.index', |
@@ -2505,7 +2499,7 @@ discard block |
||
2505 | 2499 | $GLOBALS['egw_info']['flags']['app_header'] = lang('InfoLog').' - '.lang('Site configuration'); |
2506 | 2500 | |
2507 | 2501 | // Load selected custom notification |
2508 | - if(!$content['notification_type']) |
|
2502 | + if (!$content['notification_type']) |
|
2509 | 2503 | { |
2510 | 2504 | $content['notification_type'] = '~global~'; |
2511 | 2505 | } |
@@ -2529,7 +2523,7 @@ discard block |
||
2529 | 2523 | ); |
2530 | 2524 | $preserve['notification_old_type'] = $content['notification_type']; |
2531 | 2525 | $this->tmpl->read('infolog.config'); |
2532 | - $this->tmpl->exec('infolog.infolog_ui.admin',$content,$sel_options,array(),$preserve); |
|
2526 | + $this->tmpl->exec('infolog.infolog_ui.admin', $content, $sel_options, array(), $preserve); |
|
2533 | 2527 | } |
2534 | 2528 | |
2535 | 2529 | /** |
@@ -2538,13 +2532,13 @@ discard block |
||
2538 | 2532 | * @param array $mailContent = null content of mail |
2539 | 2533 | * @return array |
2540 | 2534 | */ |
2541 | - function mail_import(array $mailContent=null) |
|
2535 | + function mail_import(array $mailContent = null) |
|
2542 | 2536 | { |
2543 | 2537 | // It would get called from compose as a popup with egw_data |
2544 | 2538 | if (!is_array($mailContent) && ($_GET['egw_data'])) |
2545 | 2539 | { |
2546 | 2540 | // get the mail raw data |
2547 | - Link::get_data ($_GET['egw_data']); |
|
2541 | + Link::get_data($_GET['egw_data']); |
|
2548 | 2542 | return false; |
2549 | 2543 | } |
2550 | 2544 | |
@@ -2575,7 +2569,7 @@ discard block |
||
2575 | 2569 | function hook_view($args) |
2576 | 2570 | { |
2577 | 2571 | // Load JS for infolog actions |
2578 | - Framework::includeJS('.','app','infolog'); |
|
2572 | + Framework::includeJS('.', 'app', 'infolog'); |
|
2579 | 2573 | |
2580 | 2574 | switch ($args['location']) |
2581 | 2575 | { |
@@ -2603,7 +2597,7 @@ discard block |
||
2603 | 2597 | { |
2604 | 2598 | return False; |
2605 | 2599 | } |
2606 | - $this->called_by = $app; // for read/save_sessiondata, to have different sessions for the hooks |
|
2600 | + $this->called_by = $app; // for read/save_sessiondata, to have different sessions for the hooks |
|
2607 | 2601 | |
2608 | 2602 | // Set to calling app, so actions wind up in the correct place client side |
2609 | 2603 | $GLOBALS['egw_info']['flags']['currentapp'] = $app; |
@@ -2611,11 +2605,11 @@ discard block |
||
2611 | 2605 | Api\Translation::add_app('infolog'); |
2612 | 2606 | |
2613 | 2607 | // Still want infolog Api\Categories though |
2614 | - $GLOBALS['egw']->categories = new Api\Categories('','infolog'); |
|
2615 | - $this->index(null,$app,$args[$view_id],array( |
|
2608 | + $GLOBALS['egw']->categories = new Api\Categories('', 'infolog'); |
|
2609 | + $this->index(null, $app, $args[$view_id], array( |
|
2616 | 2610 | 'menuaction' => $view, |
2617 | 2611 | isset($view_id2) ? $view_id2 : $view_id => $args[$view_id] |
2618 | - ),True); |
|
2612 | + ), True); |
|
2619 | 2613 | } |
2620 | 2614 | |
2621 | 2615 | /** |
@@ -2624,25 +2618,25 @@ discard block |
||
2624 | 2618 | * @param string $type infolog type to include only the matching custom fields if set |
2625 | 2619 | * @return array |
2626 | 2620 | */ |
2627 | - function csv_export_fields($type=null) |
|
2621 | + function csv_export_fields($type = null) |
|
2628 | 2622 | { |
2629 | 2623 | $fields = array( |
2630 | 2624 | 'info_type' => lang('Type'), |
2631 | 2625 | 'info_from' => lang('Contact'), |
2632 | 2626 | // 'info_link_id' => lang('primary link'), |
2633 | - 'info_cat' => array('label' => lang('Category'),'type' => 'select-cat'), |
|
2627 | + 'info_cat' => array('label' => lang('Category'), 'type' => 'select-cat'), |
|
2634 | 2628 | 'info_priority' => lang('Priority'), |
2635 | - 'info_owner' => array('label' => lang('Owner'),'type' => 'select-account'), |
|
2629 | + 'info_owner' => array('label' => lang('Owner'), 'type' => 'select-account'), |
|
2636 | 2630 | 'info_access' => lang('Access'), |
2637 | 2631 | 'info_status' => lang('Status'), |
2638 | 2632 | 'info_percent' => lang('Completed'), |
2639 | 2633 | 'info_datecompleted' => lang('Date completed'), |
2640 | 2634 | 'info_datemodified' => lang('Last modified'), |
2641 | - 'info_modifier' => array('label' => lang('Modifier'),'type' => 'select-account'), |
|
2635 | + 'info_modifier' => array('label' => lang('Modifier'), 'type' => 'select-account'), |
|
2642 | 2636 | 'info_location' => lang('Location'), |
2643 | 2637 | 'info_startdate' => lang('Startdate'), |
2644 | 2638 | 'info_enddate' => lang('Enddate'), |
2645 | - 'info_responsible' => array('label' => lang('Responsible'),'type' => 'select-account'), |
|
2639 | + 'info_responsible' => array('label' => lang('Responsible'), 'type' => 'select-account'), |
|
2646 | 2640 | 'info_subject' => lang('Subject'), |
2647 | 2641 | 'info_des' => lang('Description'), |
2648 | 2642 | 'info_id' => lang('Id'), |
@@ -2652,13 +2646,13 @@ discard block |
||
2652 | 2646 | 'pl_id' => lang('pricelist'), |
2653 | 2647 | 'info_price' => lang('price'), |
2654 | 2648 | ); |
2655 | - foreach($this->bo->timestamps as $name) |
|
2649 | + foreach ($this->bo->timestamps as $name) |
|
2656 | 2650 | { |
2657 | - $fields[$name] = array('label' => $fields[$name],'type' => 'date-time'); |
|
2651 | + $fields[$name] = array('label' => $fields[$name], 'type' => 'date-time'); |
|
2658 | 2652 | } |
2659 | - foreach($this->bo->customfields as $name => $data) |
|
2653 | + foreach ($this->bo->customfields as $name => $data) |
|
2660 | 2654 | { |
2661 | - if ($data['type2'] && $type && !in_array($type,explode(',',$data['type2']))) continue; |
|
2655 | + if ($data['type2'] && $type && !in_array($type, explode(',', $data['type2']))) continue; |
|
2662 | 2656 | |
2663 | 2657 | $fields['#'.$name] = array( |
2664 | 2658 | 'label' => $data['label'], |
@@ -97,7 +97,10 @@ discard block |
||
97 | 97 | */ |
98 | 98 | function __construct(Etemplate $etemplate = null) |
99 | 99 | { |
100 | - if ($GLOBALS['egw_info']['flags']['currentapp'] != 'infolog') Api\Translation::add_app('infolog'); |
|
100 | + if ($GLOBALS['egw_info']['flags']['currentapp'] != 'infolog') |
|
101 | + { |
|
102 | + Api\Translation::add_app('infolog'); |
|
103 | + } |
|
101 | 104 | |
102 | 105 | // Make sure Global category is infolog - on first load, it may not be |
103 | 106 | if($GLOBALS['egw_info']['flags']['currentapp'] == 'infolog' && !$GLOBALS['egw']->categories->app_name) |
@@ -169,13 +172,19 @@ discard block |
||
169 | 172 | $done = $info['info_status'] == 'done' || $info['info_status'] == 'billed' || $info['info_status'] == 'cancelled'; //cancelled is regarded as a completed status as well in bo |
170 | 173 | // regard an infolog as done/billed/cancelled if its percentage is 100% when there is to status like the above for that type |
171 | 174 | if (!$done && !isset($this->bo->status[$info['info_type']]['done']) && !isset($this->bo->status[$info['info_type']]['billed']) && |
172 | - !isset($this->bo->status[$info['info_type']]['cancelled']) && (int)$info['info_percent']==100) $done = true ; |
|
175 | + !isset($this->bo->status[$info['info_type']]['cancelled']) && (int)$info['info_percent']==100) |
|
176 | + { |
|
177 | + $done = true ; |
|
178 | + } |
|
173 | 179 | $info['sub_class'] = $this->bo->enums['priority'][$info['info_priority']] . ($done ? '_done' : ''); |
174 | 180 | if (!$done && $info['info_enddate'] < $this->bo->user_time_now) |
175 | 181 | { |
176 | 182 | $info['end_class'] = 'infolog_overdue'; |
177 | 183 | } |
178 | - if (!isset($info['info_anz_subs'])) $info['info_anz_subs'] = $this->bo->anzSubs($id); |
|
184 | + if (!isset($info['info_anz_subs'])) |
|
185 | + { |
|
186 | + $info['info_anz_subs'] = $this->bo->anzSubs($id); |
|
187 | + } |
|
179 | 188 | $this->bo->link_id2from($info,$action,$action_id); // unset from for $action:$action_id |
180 | 189 | $info['info_percent'] = (int) $info['info_percent'].'%'; |
181 | 190 | $editrights = $this->bo->check_access($info,Acl::EDIT); |
@@ -208,12 +217,21 @@ discard block |
||
208 | 217 | { |
209 | 218 | $info['class'] .= 'rowNoSubs '; |
210 | 219 | } |
211 | - if ($info['info_id_parent']) $info['class'] .= 'infolog_rowHasParent '; |
|
212 | - if ($info['info_anz_subs'] > 0) $info['class'] .= 'infolog_rowHasSubs '; |
|
220 | + if ($info['info_id_parent']) |
|
221 | + { |
|
222 | + $info['class'] .= 'infolog_rowHasParent '; |
|
223 | + } |
|
224 | + if ($info['info_anz_subs'] > 0) |
|
225 | + { |
|
226 | + $info['class'] .= 'infolog_rowHasSubs '; |
|
227 | + } |
|
213 | 228 | |
214 | 229 | $info['row_mod'] = $info['info_datemodified']; |
215 | 230 | |
216 | - if (!$show_links) $show_links = $this->prefs['show_links']; |
|
231 | + if (!$show_links) |
|
232 | + { |
|
233 | + $show_links = $this->prefs['show_links']; |
|
234 | + } |
|
217 | 235 | if (($show_links != 'none' && $show_links != 'no_describtion' || |
218 | 236 | $this->prefs['show_times'] || isset($GLOBALS['egw_info']['user']['apps']['timesheet'])) && |
219 | 237 | (isset($info['links']) || ($info['links'] = Link::get_links('infolog',$info['info_id'],'','link_lastmod DESC',true,true)))) |
@@ -223,9 +241,16 @@ discard block |
||
223 | 241 | { |
224 | 242 | // incl. link modification time into row_mod (link's lastmod is always in server-time!) |
225 | 243 | $link_mod = Api\DateTime::server2user($link['lastmod']); |
226 | - if ($info['row_mod'] < $link_mod) $info['row_mod'] = $link_mod; |
|
244 | + if ($info['row_mod'] < $link_mod) |
|
245 | + { |
|
246 | + $info['row_mod'] = $link_mod; |
|
247 | + } |
|
227 | 248 | |
228 | - if ($link['deleted']) continue; // skip deleted links, but incl. them in row_mod! |
|
249 | + if ($link['deleted']) |
|
250 | + { |
|
251 | + continue; |
|
252 | + } |
|
253 | + // skip deleted links, but incl. them in row_mod! |
|
229 | 254 | |
230 | 255 | if ($show_links != 'none' && $show_links != 'no_describtion' && |
231 | 256 | $link['link_id'] != $info['info_link_id'] && |
@@ -238,14 +263,20 @@ discard block |
||
238 | 263 | { |
239 | 264 | $info['pm_id'] = $link['id']; |
240 | 265 | } |
241 | - if ($link['app'] == 'timesheet') $timesheets[] = $link['id']; |
|
266 | + if ($link['app'] == 'timesheet') |
|
267 | + { |
|
268 | + $timesheets[] = $link['id']; |
|
269 | + } |
|
242 | 270 | } |
243 | 271 | if ($this->prefs['show_times'] && isset($GLOBALS['egw_info']['user']['apps']['timesheet']) && $timesheets) |
244 | 272 | { |
245 | 273 | $sum = ExecMethod('timesheet.timesheet_bo.sum',$timesheets); |
246 | 274 | $info['info_sum_timesheets'] = $sum['duration']; |
247 | 275 | // incl. max timesheet modification in row_mod |
248 | - if ($info['row_mod'] < $sum['max_modified']) $info['row_mod'] = $sum['max_modified']; |
|
276 | + if ($info['row_mod'] < $sum['max_modified']) |
|
277 | + { |
|
278 | + $info['row_mod'] = $sum['max_modified']; |
|
279 | + } |
|
249 | 280 | } |
250 | 281 | } |
251 | 282 | $info['info_type_label'] = $this->bo->enums['type'][$info['info_type']]; |
@@ -260,10 +291,13 @@ discard block |
||
260 | 291 | } |
261 | 292 | $readonlys["edit_percent[$id]"] = true; |
262 | 293 | } |
263 | - elseif($readonlys["edit_percent[$id]"]) // show percent, but button is switched off |
|
294 | + elseif($readonlys["edit_percent[$id]"]) |
|
295 | + { |
|
296 | + // show percent, but button is switched off |
|
264 | 297 | { |
265 | 298 | $info['info_percent2'] = $info['info_percent']; |
266 | 299 | } |
300 | + } |
|
267 | 301 | if ($this->prefs['show_id'] == 1 || $this->prefs['show_id'] == 2 && $details) |
268 | 302 | { |
269 | 303 | $info['info_number'] = $info['info_id']; |
@@ -337,10 +371,16 @@ discard block |
||
337 | 371 | $query['col_filter'] = array('info_id_parent' => $query['col_filter']['info_id_parent']); |
338 | 372 | } |
339 | 373 | $orginal_colfilter = $query['col_filter']; |
340 | - if (isset($parent_id)) $query['col_filter']['info_id_parent'] = (string)$parent_id; |
|
374 | + if (isset($parent_id)) |
|
375 | + { |
|
376 | + $query['col_filter']['info_id_parent'] = (string)$parent_id; |
|
377 | + } |
|
341 | 378 | |
342 | 379 | //echo "<p>infolog_ui.get_rows(start=$query[start],search='$query[search]',filter='$query[filter]',cat_id=$query[cat_id],action='$query[action]/$query[action_id]',col_filter=".print_r($query['col_filter'],True).",sort=$query[sort],order=$query[order])</p>\n"; |
343 | - if (!isset($query['start'])) $query['start'] = 0; |
|
380 | + if (!isset($query['start'])) |
|
381 | + { |
|
382 | + $query['start'] = 0; |
|
383 | + } |
|
344 | 384 | |
345 | 385 | // handle action and linked filter (show only entries linked to a certain other entry) |
346 | 386 | $link_filters = array(); |
@@ -369,7 +409,10 @@ discard block |
||
369 | 409 | $app = $link['app']; |
370 | 410 | $id = $link['id']; |
371 | 411 | } |
372 | - if(!is_array($id)) $id = explode(',',$id); |
|
412 | + if(!is_array($id)) |
|
413 | + { |
|
414 | + $id = explode(',',$id); |
|
415 | + } |
|
373 | 416 | if (!($linked = Link::get_links_multiple($app,$id,true,'infolog','',$query['col_filter']['info_status'] == 'deleted'))) |
374 | 417 | { |
375 | 418 | $rows = array(); // no infologs linked to selected link --> no rows to return |
@@ -418,7 +461,10 @@ discard block |
||
418 | 461 | } |
419 | 462 | } |
420 | 463 | // Framework\Template change forces the UI to do a full update first, no point in getting rows right now |
421 | - if($old_template && $old_template != $query['template']) return 0; |
|
464 | + if($old_template && $old_template != $query['template']) |
|
465 | + { |
|
466 | + return 0; |
|
467 | + } |
|
422 | 468 | |
423 | 469 | // do we need to read the custom fields, depends on the column is enabled and customfields exist, prefs are filter specific |
424 | 470 | // so we have to check that as well |
@@ -479,7 +525,10 @@ discard block |
||
479 | 525 | $parent_first = !empty($parents) && count($parents) == 1; |
480 | 526 | $parent_index = 0; |
481 | 527 | // et2 nextmatch listens to total, and only displays that many rows, so add parent in or we'll lose the last row |
482 | - if($parent_first || $query['action'] == 'sp' && is_array($query['action_id'])) $query['total']++; |
|
528 | + if($parent_first || $query['action'] == 'sp' && is_array($query['action_id'])) |
|
529 | + { |
|
530 | + $query['total']++; |
|
531 | + } |
|
483 | 532 | |
484 | 533 | // Check to see if we need to remove description |
485 | 534 | foreach($infos as $id => $info) |
@@ -507,7 +556,10 @@ discard block |
||
507 | 556 | { |
508 | 557 | foreach(array_keys($main) as $n) |
509 | 558 | { |
510 | - if ($n[0] == '#' && !in_array($n, $columselection)) unset($main[$n]); |
|
559 | + if ($n[0] == '#' && !in_array($n, $columselection)) |
|
560 | + { |
|
561 | + unset($main[$n]); |
|
562 | + } |
|
511 | 563 | } |
512 | 564 | break; |
513 | 565 | } |
@@ -524,8 +576,14 @@ discard block |
||
524 | 576 | } |
525 | 577 | unset($links); |
526 | 578 | |
527 | - if ($query['cat_id']) $rows['no_cat_id'] = true; |
|
528 | - if ($query['no_actions']) $rows['no_actions'] = true; |
|
579 | + if ($query['cat_id']) |
|
580 | + { |
|
581 | + $rows['no_cat_id'] = true; |
|
582 | + } |
|
583 | + if ($query['no_actions']) |
|
584 | + { |
|
585 | + $rows['no_actions'] = true; |
|
586 | + } |
|
529 | 587 | $rows['no_timesheet'] = !isset($GLOBALS['egw_info']['user']['apps']['timesheet']); |
530 | 588 | if($clear_status_filter) |
531 | 589 | { |
@@ -569,7 +627,11 @@ discard block |
||
569 | 627 | $GLOBALS['egw_info']['flags']['app_header'] = implode(': ', $headers); |
570 | 628 | } |
571 | 629 | |
572 | - if (isset($linked)) $query['col_filter']['linked'] = $linked; // add linked back to the colfilter |
|
630 | + if (isset($linked)) |
|
631 | + { |
|
632 | + $query['col_filter']['linked'] = $linked; |
|
633 | + } |
|
634 | + // add linked back to the colfilter |
|
573 | 635 | |
574 | 636 | return $query['total']; |
575 | 637 | } |
@@ -586,7 +648,10 @@ discard block |
||
586 | 648 | $set = array(); |
587 | 649 | if ((int)$data['id'] && ($info = $this->bo->read($data['id']))) |
588 | 650 | { |
589 | - if ($info['info_cat']) $set['cat_id'] = $info['info_cat']; |
|
651 | + if ($info['info_cat']) |
|
652 | + { |
|
653 | + $set['cat_id'] = $info['info_cat']; |
|
654 | + } |
|
590 | 655 | if ($info['info_used_time']) |
591 | 656 | { |
592 | 657 | $set['ts_duration'] = $info['info_used_time']; |
@@ -637,7 +702,10 @@ discard block |
||
637 | 702 | 'end' => $infolog['info_enddate'] ? $infolog['info_enddate'] : $infolog['info_datecompleted'] |
638 | 703 | )); |
639 | 704 | unset($event['entry_id']); |
640 | - if (!$event['end']) $event['end'] = $event['start'] + (int) $GLOBALS['egw_info']['user']['preferences']['calendar']['defaultlength']*60; |
|
705 | + if (!$event['end']) |
|
706 | + { |
|
707 | + $event['end'] = $event['start'] + (int) $GLOBALS['egw_info']['user']['preferences']['calendar']['defaultlength']*60; |
|
708 | + } |
|
641 | 709 | |
642 | 710 | // Match Api\Categories by name |
643 | 711 | $event['category'] = $GLOBALS['egw']->categories->name2id(Api\Categories::id2name($infolog['info_cat'])); |
@@ -696,7 +764,10 @@ discard block |
||
696 | 764 | // Copy same custom fields |
697 | 765 | foreach(array_keys(Api\Storage\Customfields::get('calendar')) as $name) |
698 | 766 | { |
699 | - if ($this->bo->customfields[$name]) $event['#'.$name] = $infolog['#'.$name]; |
|
767 | + if ($this->bo->customfields[$name]) |
|
768 | + { |
|
769 | + $event['#'.$name] = $infolog['#'.$name]; |
|
770 | + } |
|
700 | 771 | } |
701 | 772 | //error_log(__METHOD__.'('.array2string($data).') infolog='.array2string($infolog).' returning '.array2string($event)); |
702 | 773 | return $event; |
@@ -868,13 +939,19 @@ discard block |
||
868 | 939 | $values['nm']['sort'] = 'DESC'; |
869 | 940 | } |
870 | 941 | |
871 | - if (!$values['nm']['session_for'] && $this->called_by) $values['nm']['session_for'] = $this->called_by; |
|
942 | + if (!$values['nm']['session_for'] && $this->called_by) |
|
943 | + { |
|
944 | + $values['nm']['session_for'] = $this->called_by; |
|
945 | + } |
|
872 | 946 | |
873 | 947 | $action_id = $values['action_id'] = $action ? $action_id : $nm['action_id']; |
874 | 948 | $action_title = $values['action_title'] = $action ? $action_title : $nm['action_title']; |
875 | 949 | $action = $values['action'] = $action ? $action : $nm['action']; |
876 | 950 | } |
877 | - if($_GET['search']) $values['nm']['search'] = $_GET['search']; |
|
951 | + if($_GET['search']) |
|
952 | + { |
|
953 | + $values['nm']['search'] = $_GET['search']; |
|
954 | + } |
|
878 | 955 | |
879 | 956 | if ($values['nm']['add']) |
880 | 957 | { |
@@ -925,7 +1002,10 @@ discard block |
||
925 | 1002 | switch ($action) |
926 | 1003 | { |
927 | 1004 | case 'sp': |
928 | - if (!is_array($action_id) && strpos($action_id, 'infolog:') === 0) $action_id = (int)substr($action_id, 8); |
|
1005 | + if (!is_array($action_id) && strpos($action_id, 'infolog:') === 0) |
|
1006 | + { |
|
1007 | + $action_id = (int)substr($action_id, 8); |
|
1008 | + } |
|
929 | 1009 | if ((is_array($action_id) && !$this->bo->read(current($action_id))) || !$this->bo->read($action_id)) |
930 | 1010 | { |
931 | 1011 | $action = ''; |
@@ -972,7 +1052,10 @@ discard block |
||
972 | 1052 | // Allow add actions even when there's no rows |
973 | 1053 | $values['nm']['placeholder_actions'] = array('new'); |
974 | 1054 | |
975 | - if(!isset($values['nm']['filter2'])) $values['nm']['filter2'] = $this->prefs['nextmatch-'.($action ? 'infolog.'.$action : 'infolog.index.rows').'-details-pref']; |
|
1055 | + if(!isset($values['nm']['filter2'])) |
|
1056 | + { |
|
1057 | + $values['nm']['filter2'] = $this->prefs['nextmatch-'.($action ? 'infolog.'.$action : 'infolog.index.rows').'-details-pref']; |
|
1058 | + } |
|
976 | 1059 | |
977 | 1060 | // disable columns for main entry as set in the pref for details or no details |
978 | 1061 | $values['nm']['columnselection_pref'] = 'nextmatch-'.($action ? 'infolog.'.$action : 'infolog.index.rows') |
@@ -997,7 +1080,10 @@ discard block |
||
997 | 1080 | { |
998 | 1081 | foreach (array_keys($values['nm']['col_filter']) as $colfk) |
999 | 1082 | { |
1000 | - if (is_int($colfk)) unset($values['nm']['col_filter']); |
|
1083 | + if (is_int($colfk)) |
|
1084 | + { |
|
1085 | + unset($values['nm']['col_filter']); |
|
1086 | + } |
|
1001 | 1087 | } |
1002 | 1088 | } |
1003 | 1089 | $values['action'] = $persist['action'] = $values['nm']['action'] = $action; |
@@ -1040,7 +1126,10 @@ discard block |
||
1040 | 1126 | // does not take implicit rights as delegated into account, so they will not be available as filters |
1041 | 1127 | foreach($this->bo->group_owners as $type => $group) |
1042 | 1128 | { |
1043 | - if (!isset($this->bo->grants[$group])) unset($sel_options['info_type'][$type]); |
|
1129 | + if (!isset($this->bo->grants[$group])) |
|
1130 | + { |
|
1131 | + unset($sel_options['info_type'][$type]); |
|
1132 | + } |
|
1044 | 1133 | } |
1045 | 1134 | |
1046 | 1135 | |
@@ -1421,7 +1510,10 @@ discard block |
||
1421 | 1510 | return $failed == 0; |
1422 | 1511 | |
1423 | 1512 | case 'document': |
1424 | - if (!$settings) $settings = $this->prefs['default_document']; |
|
1513 | + if (!$settings) |
|
1514 | + { |
|
1515 | + $settings = $this->prefs['default_document']; |
|
1516 | + } |
|
1425 | 1517 | $document_merge = new infolog_merge(); |
1426 | 1518 | $msg = $document_merge->download($settings, $checked, '', $this->prefs['document_dir']); |
1427 | 1519 | $failed = count($checked); |
@@ -1629,11 +1721,16 @@ discard block |
||
1629 | 1721 | #_debug_array($info); |
1630 | 1722 | $status = $info['info_status']; |
1631 | 1723 | // closed stati assumed array('done','billed','cancelled') |
1632 | - if (isset($this->bo->status[$info['info_type']]['done'])) { |
|
1724 | + if (isset($this->bo->status[$info['info_type']]['done'])) |
|
1725 | + { |
|
1633 | 1726 | $status ='done'; |
1634 | - } elseif (isset($this->bo->status[$info['info_type']]['billed'])) { |
|
1727 | + } |
|
1728 | + elseif (isset($this->bo->status[$info['info_type']]['billed'])) |
|
1729 | + { |
|
1635 | 1730 | $status ='billed'; |
1636 | - } elseif (isset($this->bo->status[$info['info_type']]['cancelled'])) { |
|
1731 | + } |
|
1732 | + elseif (isset($this->bo->status[$info['info_type']]['cancelled'])) |
|
1733 | + { |
|
1637 | 1734 | $status ='cancelled'; |
1638 | 1735 | } |
1639 | 1736 | #_debug_array($status); |
@@ -1647,17 +1744,25 @@ discard block |
||
1647 | 1744 | $this->bo->write($values, true,true,true,$skip_notification); |
1648 | 1745 | |
1649 | 1746 | $query = array('action'=>'sp','action_id'=>$info_id); |
1650 | - if (!$closesingle) { |
|
1747 | + if (!$closesingle) |
|
1748 | + { |
|
1651 | 1749 | foreach((array)$this->bo->search($query) as $info) |
1652 | 1750 | { |
1653 | - if ($info['info_id_parent'] == $info_id) // search also returns linked entries! |
|
1751 | + if ($info['info_id_parent'] == $info_id) |
|
1654 | 1752 | { |
1655 | - $this->close($info['info_id'],$referer,$closesingle,$skip_notification); // we call ourselfs recursive to process subs from subs too |
|
1753 | + // search also returns linked entries! |
|
1754 | + { |
|
1755 | + $this->close($info['info_id'],$referer,$closesingle,$skip_notification); |
|
1756 | + } |
|
1757 | + // we call ourselfs recursive to process subs from subs too |
|
1656 | 1758 | } |
1657 | 1759 | } |
1658 | 1760 | } |
1659 | 1761 | } |
1660 | - if ($referer) $this->tmpl->location($referer); |
|
1762 | + if ($referer) |
|
1763 | + { |
|
1764 | + $this->tmpl->location($referer); |
|
1765 | + } |
|
1661 | 1766 | } |
1662 | 1767 | |
1663 | 1768 | /** |
@@ -1673,10 +1778,13 @@ discard block |
||
1673 | 1778 | $info_id = (int) (is_array($values) ? $values['info_id'] : ($values ? $values : $_GET['info_id'])); |
1674 | 1779 | $referer = is_array($values) ? $values['referer'] : $_referer; |
1675 | 1780 | |
1676 | - if (!is_array($values) && $info_id > 0 && !$this->bo->anzSubs($info_id)) // entries without subs get confirmed by javascript |
|
1781 | + if (!is_array($values) && $info_id > 0 && !$this->bo->anzSubs($info_id)) |
|
1782 | + { |
|
1783 | + // entries without subs get confirmed by javascript |
|
1677 | 1784 | { |
1678 | 1785 | $values = array('delete' => true); |
1679 | 1786 | } |
1787 | + } |
|
1680 | 1788 | //echo "<p>infolog_ui::delete(".print_r($values,true).",'$referer','$called_by') info_id=$info_id</p>\n"; |
1681 | 1789 | |
1682 | 1790 | if (is_array($values) || $info_id <= 0) |
@@ -1685,11 +1793,16 @@ discard block |
||
1685 | 1793 | { |
1686 | 1794 | $deleted = $this->bo->delete($info_id,$values['delete_subs'],$values['info_id_parent'], $skip_notification); |
1687 | 1795 | } |
1688 | - if ($called_by) // direct call from the same request |
|
1796 | + if ($called_by) |
|
1797 | + { |
|
1798 | + // direct call from the same request |
|
1689 | 1799 | { |
1690 | 1800 | return $deleted ? lang('InfoLog entry deleted') : ''; |
1691 | 1801 | } |
1692 | - if ($values['called_by'] == 'edit') // we run in the edit popup => give control back to edit |
|
1802 | + } |
|
1803 | + if ($values['called_by'] == 'edit') |
|
1804 | + { |
|
1805 | + // we run in the edit popup => give control back to edit |
|
1693 | 1806 | { |
1694 | 1807 | $this->edit(array( |
1695 | 1808 | 'info_id' => $info_id, |
@@ -1698,6 +1811,7 @@ discard block |
||
1698 | 1811 | 'msg' => $deleted ? lang('Infolog entry deleted') : '', |
1699 | 1812 | )); |
1700 | 1813 | } |
1814 | + } |
|
1701 | 1815 | return $referer ? $this->tmpl->location($referer) : $this->index(); |
1702 | 1816 | } |
1703 | 1817 | $readonlys = $values = array(); |
@@ -1746,10 +1860,17 @@ discard block |
||
1746 | 1860 | $no_popup = $content['no_popup']; unset($content['no_popup']); |
1747 | 1861 | |
1748 | 1862 | list($button) = @each($content['button']); |
1749 | - if (!$button && $action) $button = $action; // action selectbox |
|
1863 | + if (!$button && $action) |
|
1864 | + { |
|
1865 | + $button = $action; |
|
1866 | + } |
|
1867 | + // action selectbox |
|
1750 | 1868 | //info_cc expects an comma separated string |
1751 | 1869 | //error_log(__METHOD__.__LINE__.array2string($content)); |
1752 | - if (empty($content['info_cc'])) $content['info_cc'] = ""; |
|
1870 | + if (empty($content['info_cc'])) |
|
1871 | + { |
|
1872 | + $content['info_cc'] = ""; |
|
1873 | + } |
|
1753 | 1874 | if (is_array($content['info_cc'])) |
1754 | 1875 | { |
1755 | 1876 | foreach($content['info_cc'] as $i => $value) |
@@ -1759,7 +1880,10 @@ discard block |
||
1759 | 1880 | //error_log(__METHOD__.__LINE__.$value.'->'.array2string($addresses[0])); |
1760 | 1881 | $content['info_cc'][$i]=$addresses[0]->host ? $addresses[0]->mailbox.'@'.$addresses[0]->host : $addresses[0]->mailbox; |
1761 | 1882 | } |
1762 | - if (!empty($content['info_cc'])) $content['info_cc'] = implode(',',$content['info_cc']); |
|
1883 | + if (!empty($content['info_cc'])) |
|
1884 | + { |
|
1885 | + $content['info_cc'] = implode(',',$content['info_cc']); |
|
1886 | + } |
|
1763 | 1887 | } |
1764 | 1888 | unset($content['button']); |
1765 | 1889 | if ($button) |
@@ -1843,9 +1967,12 @@ discard block |
||
1843 | 1967 | $content['link_to']['to_app'] = 'infolog'; |
1844 | 1968 | $content['link_to']['to_id'] = $info_id; |
1845 | 1969 | |
1846 | - if ($info_link_id && strpos($info_link_id,':') !== false) // updating info_link_id if necessary |
|
1970 | + if ($info_link_id && strpos($info_link_id,':') !== false) |
|
1971 | + { |
|
1972 | + // updating info_link_id if necessary |
|
1847 | 1973 | { |
1848 | 1974 | list($app,$id) = explode(':',$info_link_id); |
1975 | + } |
|
1849 | 1976 | $link = Link::get_link('infolog',$info_id,$app,$id); |
1850 | 1977 | if ((int) $content['info_link_id'] != (int) $link['link_id']) |
1851 | 1978 | { |
@@ -1875,12 +2002,19 @@ discard block |
||
1875 | 2002 | } |
1876 | 2003 | elseif ($button == 'delete' && $info_id > 0) |
1877 | 2004 | { |
1878 | - if (!$referer && $action) $referer = array( |
|
2005 | + if (!$referer && $action) |
|
2006 | + { |
|
2007 | + $referer = array( |
|
1879 | 2008 | 'menuaction' => 'infolog.infolog_ui.index', |
1880 | 2009 | 'action' => $action, |
1881 | 2010 | 'action_id' => $action_id |
1882 | 2011 | ); |
1883 | - if (!($content['msg'] = $this->delete($info_id,$referer,'edit'))) return; // checks ACL first |
|
2012 | + } |
|
2013 | + if (!($content['msg'] = $this->delete($info_id,$referer,'edit'))) |
|
2014 | + { |
|
2015 | + return; |
|
2016 | + } |
|
2017 | + // checks ACL first |
|
1884 | 2018 | |
1885 | 2019 | Framework::refresh_opener($content['msg'],'infolog',$info_id,'delete'); |
1886 | 2020 | } |
@@ -1930,7 +2064,11 @@ discard block |
||
1930 | 2064 | $type = $type ? $type : $_REQUEST['type']; |
1931 | 2065 | $referer = $referer !== '' ? $referer : ($_GET['referer'] ? $_GET['referer'] : |
1932 | 2066 | Api\Header\Referer::get('/index.php?menuaction=infolog.infolog_ui.index')); |
1933 | - if (strpos($referer, 'msg=') !== false) $referer = preg_replace('/([&?]{1})msg=[^&]+&?/','\\1',$referer); // remove previou/old msg from referer |
|
2067 | + if (strpos($referer, 'msg=') !== false) |
|
2068 | + { |
|
2069 | + $referer = preg_replace('/([&?]{1})msg=[^&]+&?/','\\1',$referer); |
|
2070 | + } |
|
2071 | + // remove previou/old msg from referer |
|
1934 | 2072 | $no_popup = $_GET['no_popup']; |
1935 | 2073 | $print = (int) $_REQUEST['print']; |
1936 | 2074 | //echo "<p>infolog_ui::edit: info_id=$info_id, action='$action', action_id='$action_id', type='$type', referer='$referer'</p>\n"; |
@@ -1947,7 +2085,11 @@ discard block |
||
1947 | 2085 | { |
1948 | 2086 | $content['info_cat'] = $this->prefs['cat_add_default']; |
1949 | 2087 | } |
1950 | - if ($_GET['msg']) $content['msg'] = strip_tags($_GET['msg']); // dont allow HTML! |
|
2088 | + if ($_GET['msg']) |
|
2089 | + { |
|
2090 | + $content['msg'] = strip_tags($_GET['msg']); |
|
2091 | + } |
|
2092 | + // dont allow HTML! |
|
1951 | 2093 | |
1952 | 2094 | switch($this->prefs['set_start']) |
1953 | 2095 | { |
@@ -1958,13 +2100,19 @@ discard block |
||
1958 | 2100 | if ((int)$content['info_link_id'] > 0 && !Link::get_link($content['info_link_id'])) |
1959 | 2101 | { |
1960 | 2102 | $content['info_link_id'] = 0; // link has been deleted |
1961 | - if (!$content['info_custom_link']) $content['info_from'] = ''; |
|
2103 | + if (!$content['info_custom_link']) |
|
2104 | + { |
|
2105 | + $content['info_from'] = ''; |
|
2106 | + } |
|
1962 | 2107 | } |
1963 | - if (!$info_id && $action_id && $action == 'sp') // new SubProject |
|
2108 | + if (!$info_id && $action_id && $action == 'sp') |
|
2109 | + { |
|
2110 | + // new SubProject |
|
1964 | 2111 | { |
1965 | 2112 | if (!$this->bo->check_access($action_id,Acl::ADD)) |
1966 | 2113 | { |
1967 | 2114 | return $referer ? $this->tmpl->location($referer) : $this->index(0,$action,$action_id); |
2115 | + } |
|
1968 | 2116 | } |
1969 | 2117 | } |
1970 | 2118 | else |
@@ -1998,10 +2146,16 @@ discard block |
||
1998 | 2146 | case 'copy': |
1999 | 2147 | $info_id = 0; |
2000 | 2148 | $this->create_copy($content, $action == 'sp'); |
2001 | - if ($action == 'sp') // for sub-entries use type or category, like for new entries |
|
2149 | + if ($action == 'sp') |
|
2150 | + { |
|
2151 | + // for sub-entries use type or category, like for new entries |
|
2002 | 2152 | { |
2003 | 2153 | if ($type) $content['info_type'] = $type; |
2004 | - if (is_numeric($_REQUEST['cat_id'])) $content['info_cat'] = (int) $_REQUEST['cat_id']; |
|
2154 | + } |
|
2155 | + if (is_numeric($_REQUEST['cat_id'])) |
|
2156 | + { |
|
2157 | + $content['info_cat'] = (int) $_REQUEST['cat_id']; |
|
2158 | + } |
|
2005 | 2159 | } |
2006 | 2160 | unset($action); // it get stored in $content and will cause an other copy after [apply] |
2007 | 2161 | break; |
@@ -2030,7 +2184,10 @@ discard block |
||
2030 | 2184 | { |
2031 | 2185 | foreach((array)$set['link_app'] as $i => $l_app) |
2032 | 2186 | { |
2033 | - if (($l_id=$set['link_id'][$i])) Link::link('infolog',$content['link_to']['to_id'],$l_app,$l_id); |
|
2187 | + if (($l_id=$set['link_id'][$i])) |
|
2188 | + { |
|
2189 | + Link::link('infolog',$content['link_to']['to_id'],$l_app,$l_id); |
|
2190 | + } |
|
2034 | 2191 | } |
2035 | 2192 | unset($set['link_app']); |
2036 | 2193 | unset($set['link_id']); |
@@ -2049,8 +2206,15 @@ discard block |
||
2049 | 2206 | break; // normal edit |
2050 | 2207 | } |
2051 | 2208 | case 'new': // new entry, set some defaults, if not set by infolog_set hook |
2052 | - if (empty($content['info_startdate'])) $content['info_startdate'] = (int) $_GET['startdate'] ? (int) $_GET['startdate'] : $set_startdate; |
|
2053 | - if (empty($content['info_priority'])) $content['info_priority'] = 1; // normal |
|
2209 | + if (empty($content['info_startdate'])) |
|
2210 | + { |
|
2211 | + $content['info_startdate'] = (int) $_GET['startdate'] ? (int) $_GET['startdate'] : $set_startdate; |
|
2212 | + } |
|
2213 | + if (empty($content['info_priority'])) |
|
2214 | + { |
|
2215 | + $content['info_priority'] = 1; |
|
2216 | + } |
|
2217 | + // normal |
|
2054 | 2218 | $content['info_owner'] = $this->user; |
2055 | 2219 | if ($type != '' && empty($content['info_type'])) |
2056 | 2220 | { |
@@ -2060,8 +2224,14 @@ discard block |
||
2060 | 2224 | { |
2061 | 2225 | $content['info_type'] = $GLOBALS['egw_info']['user']['preferences']['infolog']['preferred_type']; |
2062 | 2226 | } |
2063 | - if (empty($content['info_status'])) $content['info_status'] = $this->bo->status['defaults'][$content['info_type']]; |
|
2064 | - if (empty($content['info_percent'])) $content['info_percent'] = $content['info_status'] == 'done' ? '100%' : '0%'; |
|
2227 | + if (empty($content['info_status'])) |
|
2228 | + { |
|
2229 | + $content['info_status'] = $this->bo->status['defaults'][$content['info_type']]; |
|
2230 | + } |
|
2231 | + if (empty($content['info_percent'])) |
|
2232 | + { |
|
2233 | + $content['info_percent'] = $content['info_status'] == 'done' ? '100%' : '0%'; |
|
2234 | + } |
|
2065 | 2235 | break; |
2066 | 2236 | } |
2067 | 2237 | if (!isset($this->bo->enums['type'][$content['info_type']])) |
@@ -2165,7 +2335,10 @@ discard block |
||
2165 | 2335 | |
2166 | 2336 | $content['duration_format'] = $this->duration_format; |
2167 | 2337 | $content['hours_per_workday'] = $this->hours_per_workday; |
2168 | - if ($this->prefs['show_id']) $content['info_number'] = $info_id; |
|
2338 | + if ($this->prefs['show_id']) |
|
2339 | + { |
|
2340 | + $content['info_number'] = $info_id; |
|
2341 | + } |
|
2169 | 2342 | |
2170 | 2343 | // Check no notification preference, update if type changed |
2171 | 2344 | if($content['info_type'] != $content['old_type']) |
@@ -2256,7 +2429,10 @@ discard block |
||
2256 | 2429 | //$content['info_des'] = substr($content['info_des'],0,1793); |
2257 | 2430 | //echo "<p>infolog_ui.edit(info_id='$info_id',action='$action',action_id='$action_id') readonlys="; print_r($readonlys); echo ", content = "; _debug_array($content); |
2258 | 2431 | //$content['info_cc'] is expected (by the widget) to be an array of emailaddresses, but is stored as comma separated string |
2259 | - if (!empty($content['info_cc'])&&!is_array($content['info_cc']))$content['info_cc'] = explode(',',$content['info_cc']); |
|
2432 | + if (!empty($content['info_cc'])&&!is_array($content['info_cc'])) |
|
2433 | + { |
|
2434 | + $content['info_cc'] = explode(',',$content['info_cc']); |
|
2435 | + } |
|
2260 | 2436 | $preserve = array_merge( $preserv, array( // preserved values |
2261 | 2437 | 'info_id' => $info_id, |
2262 | 2438 | 'action' => $action, |
@@ -2286,7 +2462,11 @@ discard block |
||
2286 | 2462 | foreach ($exclude_fields as $field) |
2287 | 2463 | { |
2288 | 2464 | unset($content[$field]); |
2289 | - if ($field == 'info_from') unset($content['info_link_id']); // both together is called contact in UI |
|
2465 | + if ($field == 'info_from') |
|
2466 | + { |
|
2467 | + unset($content['info_link_id']); |
|
2468 | + } |
|
2469 | + // both together is called contact in UI |
|
2290 | 2470 | } |
2291 | 2471 | if ($create_sub) |
2292 | 2472 | { |
@@ -2314,13 +2494,25 @@ discard block |
||
2314 | 2494 | $content['info_type'] = $types[0]; |
2315 | 2495 | } |
2316 | 2496 | // get a consistent status, percent and date-completed |
2317 | - if (!isset($content['info_status'])) $content['info_status'] = $this->bo->status['defaults'][$content['info_type']]; |
|
2318 | - if (!isset($content['info_percent'])) $content['info_percent'] = $content['info_status'] == 'done' ? '100%' : '0%'; |
|
2497 | + if (!isset($content['info_status'])) |
|
2498 | + { |
|
2499 | + $content['info_status'] = $this->bo->status['defaults'][$content['info_type']]; |
|
2500 | + } |
|
2501 | + if (!isset($content['info_percent'])) |
|
2502 | + { |
|
2503 | + $content['info_percent'] = $content['info_status'] == 'done' ? '100%' : '0%'; |
|
2504 | + } |
|
2319 | 2505 | $content['info_datecompleted'] =$content['info_status'] == 'done' ? $this->bo->user_time_now : 0; |
2320 | 2506 | |
2321 | - if (!isset($content['info_cat'])) $content['info_cat'] = $this->prefs['cat_add_default']; |
|
2507 | + if (!isset($content['info_cat'])) |
|
2508 | + { |
|
2509 | + $content['info_cat'] = $this->prefs['cat_add_default']; |
|
2510 | + } |
|
2322 | 2511 | |
2323 | - if(!is_array($content['link_to'])) $content['link_to'] = array(); |
|
2512 | + if(!is_array($content['link_to'])) |
|
2513 | + { |
|
2514 | + $content['link_to'] = array(); |
|
2515 | + } |
|
2324 | 2516 | $content['link_to']['to_app'] = 'infolog'; |
2325 | 2517 | $content['link_to']['to_id'] = 0; |
2326 | 2518 | // Get links to be copied, if not excluded |
@@ -2658,7 +2850,10 @@ discard block |
||
2658 | 2850 | } |
2659 | 2851 | foreach($this->bo->customfields as $name => $data) |
2660 | 2852 | { |
2661 | - if ($data['type2'] && $type && !in_array($type,explode(',',$data['type2']))) continue; |
|
2853 | + if ($data['type2'] && $type && !in_array($type,explode(',',$data['type2']))) |
|
2854 | + { |
|
2855 | + continue; |
|
2856 | + } |
|
2662 | 2857 | |
2663 | 2858 | $fields['#'.$name] = array( |
2664 | 2859 | 'label' => $data['label'], |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | // List each custom field |
35 | 35 | unset($this->mapping_fields['custom']); |
36 | 36 | $custom = Api\Storage\Customfields::get('infolog'); |
37 | - foreach($custom as $name => $data) { |
|
37 | + foreach ($custom as $name => $data) { |
|
38 | 38 | $this->mapping_fields['#'.$name] = $data['label']; |
39 | 39 | } |
40 | 40 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | # Skipped for now (or forever) |
63 | 63 | function wizard_step60(&$content, &$sel_options, &$readonlys, &$preserv) |
64 | 64 | { |
65 | - if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true)); |
|
65 | + if ($this->debug) error_log(__METHOD__.'->$content '.print_r($content, true)); |
|
66 | 66 | unset($content['no_owner_map']); |
67 | 67 | // Check that record owner has access |
68 | 68 | $access = true; |
69 | - if($content['record_owner']) |
|
69 | + if ($content['record_owner']) |
|
70 | 70 | { |
71 | 71 | $bo = new infolog_bo(); |
72 | - $access = $bo->check_access(0,Acl::EDIT, $content['record_owner']); |
|
72 | + $access = $bo->check_access(0, Acl::EDIT, $content['record_owner']); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | // return from step60 |
76 | 76 | if ($content['step'] == 'wizard_step60') |
77 | 77 | { |
78 | - if(!$access) { |
|
78 | + if (!$access) { |
|
79 | 79 | $step = $content['step']; |
80 | 80 | unset($content['step']); |
81 | 81 | return $step; |
@@ -83,34 +83,34 @@ discard block |
||
83 | 83 | switch (array_search('pressed', $content['button'])) |
84 | 84 | { |
85 | 85 | case 'next': |
86 | - return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1); |
|
86 | + return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], 1); |
|
87 | 87 | case 'previous' : |
88 | - return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1); |
|
88 | + return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], -1); |
|
89 | 89 | case 'finish': |
90 | 90 | return 'wizard_finish'; |
91 | 91 | default : |
92 | - return $this->wizard_step60($content,$sel_options,$readonlys,$preserv); |
|
92 | + return $this->wizard_step60($content, $sel_options, $readonlys, $preserv); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | // init step60 |
96 | 96 | else |
97 | 97 | { |
98 | 98 | $content['msg'] = $this->steps['wizard_step60']; |
99 | - if(!$access) { |
|
100 | - $content['msg'] .= "\n* " . lang('Owner does not have edit rights'); |
|
99 | + if (!$access) { |
|
100 | + $content['msg'] .= "\n* ".lang('Owner does not have edit rights'); |
|
101 | 101 | } |
102 | 102 | $content['step'] = 'wizard_step60'; |
103 | - if(!array_key_exists($content['record_owner']) && $content['plugin_options']) { |
|
103 | + if (!array_key_exists($content['record_owner']) && $content['plugin_options']) { |
|
104 | 104 | $content['record_owner'] = $content['plugin_options']['record_owner']; |
105 | 105 | } |
106 | - if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) { |
|
106 | + if (!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) { |
|
107 | 107 | $content['owner_from_csv'] = $content['plugin_options']['owner_from_csv']; |
108 | 108 | } |
109 | - if(!array_key_exists($content['change_owner']) && $content['plugin_options']) { |
|
109 | + if (!array_key_exists($content['change_owner']) && $content['plugin_options']) { |
|
110 | 110 | $content['change_owner'] = $content['plugin_options']['change_owner']; |
111 | 111 | } |
112 | 112 | |
113 | - if(!in_array('info_owner', $content['field_mapping'])) { |
|
113 | + if (!in_array('info_owner', $content['field_mapping'])) { |
|
114 | 114 | $content['no_owner_map'] = true; |
115 | 115 | } |
116 | 116 |
@@ -34,7 +34,8 @@ discard block |
||
34 | 34 | // List each custom field |
35 | 35 | unset($this->mapping_fields['custom']); |
36 | 36 | $custom = Api\Storage\Customfields::get('infolog'); |
37 | - foreach($custom as $name => $data) { |
|
37 | + foreach($custom as $name => $data) |
|
38 | + { |
|
38 | 39 | $this->mapping_fields['#'.$name] = $data['label']; |
39 | 40 | } |
40 | 41 | |
@@ -62,7 +63,10 @@ discard block |
||
62 | 63 | # Skipped for now (or forever) |
63 | 64 | function wizard_step60(&$content, &$sel_options, &$readonlys, &$preserv) |
64 | 65 | { |
65 | - if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true)); |
|
66 | + if($this->debug) |
|
67 | + { |
|
68 | + error_log(__METHOD__.'->$content '.print_r($content,true)); |
|
69 | + } |
|
66 | 70 | unset($content['no_owner_map']); |
67 | 71 | // Check that record owner has access |
68 | 72 | $access = true; |
@@ -75,7 +79,8 @@ discard block |
||
75 | 79 | // return from step60 |
76 | 80 | if ($content['step'] == 'wizard_step60') |
77 | 81 | { |
78 | - if(!$access) { |
|
82 | + if(!$access) |
|
83 | + { |
|
79 | 84 | $step = $content['step']; |
80 | 85 | unset($content['step']); |
81 | 86 | return $step; |
@@ -96,21 +101,26 @@ discard block |
||
96 | 101 | else |
97 | 102 | { |
98 | 103 | $content['msg'] = $this->steps['wizard_step60']; |
99 | - if(!$access) { |
|
104 | + if(!$access) |
|
105 | + { |
|
100 | 106 | $content['msg'] .= "\n* " . lang('Owner does not have edit rights'); |
101 | 107 | } |
102 | 108 | $content['step'] = 'wizard_step60'; |
103 | - if(!array_key_exists($content['record_owner']) && $content['plugin_options']) { |
|
109 | + if(!array_key_exists($content['record_owner']) && $content['plugin_options']) |
|
110 | + { |
|
104 | 111 | $content['record_owner'] = $content['plugin_options']['record_owner']; |
105 | 112 | } |
106 | - if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) { |
|
113 | + if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) |
|
114 | + { |
|
107 | 115 | $content['owner_from_csv'] = $content['plugin_options']['owner_from_csv']; |
108 | 116 | } |
109 | - if(!array_key_exists($content['change_owner']) && $content['plugin_options']) { |
|
117 | + if(!array_key_exists($content['change_owner']) && $content['plugin_options']) |
|
118 | + { |
|
110 | 119 | $content['change_owner'] = $content['plugin_options']['change_owner']; |
111 | 120 | } |
112 | 121 | |
113 | - if(!in_array('info_owner', $content['field_mapping'])) { |
|
122 | + if(!in_array('info_owner', $content['field_mapping'])) |
|
123 | + { |
|
114 | 124 | $content['no_owner_map'] = true; |
115 | 125 | } |
116 | 126 |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | var $productName = ''; |
68 | 68 | |
69 | 69 | /** |
70 | - * Shall we use the UID extensions of the description field? |
|
71 | - * |
|
72 | - * @var boolean |
|
73 | - */ |
|
70 | + * Shall we use the UID extensions of the description field? |
|
71 | + * |
|
72 | + * @var boolean |
|
73 | + */ |
|
74 | 74 | var $uidExtension = false; |
75 | 75 | |
76 | 76 | /** |
@@ -509,10 +509,10 @@ discard block |
||
509 | 509 | * @param boolean $merge =false merge data with existing entry (no longer used) |
510 | 510 | * @param int $user =null delegate new task to this account_id, default null |
511 | 511 | * @param string $charset =null The encoding charset for $text. Defaults to |
512 | - * utf-8 for new format, iso-8859-1 for old format. |
|
513 | - * @param string $caldav_name =null CalDAV URL name-part for new entries |
|
514 | - * @param array $callback_data =null array with callback and further parameters, first param is task to save |
|
515 | - * signature array callback($task, $param1, ...) |
|
512 | + * utf-8 for new format, iso-8859-1 for old format. |
|
513 | + * @param string $caldav_name =null CalDAV URL name-part for new entries |
|
514 | + * @param array $callback_data =null array with callback and further parameters, first param is task to save |
|
515 | + * signature array callback($task, $param1, ...) |
|
516 | 516 | * @return int|boolean integer info_id or false on error |
517 | 517 | */ |
518 | 518 | function importVTODO(&$_vcalData, $_taskID=-1, $merge=false, $user=null, $charset=null, $caldav_name=null, |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | * @param int $contentID =null infolog_id (or null, if unkown) |
598 | 598 | * @param boolean $relax =false if true, a weaker match algorithm is used |
599 | 599 | * @param string $charset The encoding charset for $text. Defaults to |
600 | - * utf-8 for new format, iso-8859-1 for old format. |
|
600 | + * utf-8 for new format, iso-8859-1 for old format. |
|
601 | 601 | * |
602 | 602 | * @return array of infolog_ids of matching entries |
603 | 603 | */ |
@@ -642,8 +642,8 @@ discard block |
||
642 | 642 | * @param string $_vcalData VTODO data |
643 | 643 | * @param int $_taskID =-1 infolog_id of the entry |
644 | 644 | * @param string $charset The encoding charset for $text. Defaults to |
645 | - * utf-8 for new format, iso-8859-1 for old format. |
|
646 | - * |
|
645 | + * utf-8 for new format, iso-8859-1 for old format. |
|
646 | + * |
|
647 | 647 | * @return array infolog entry or false on error |
648 | 648 | */ |
649 | 649 | function vtodotoegw($_vcalData, $_taskID=-1, $charset=null) |
@@ -1010,8 +1010,8 @@ discard block |
||
1010 | 1010 | * @param int $_noteID =-1 info_id, default -1 = new entry |
1011 | 1011 | * @param boolean $merge =false merge data with existing entry (no longer used) |
1012 | 1012 | * @param string $charset The encoding charset for $text. Defaults to |
1013 | - * utf-8 for new format, iso-8859-1 for old format. |
|
1014 | - * |
|
1013 | + * utf-8 for new format, iso-8859-1 for old format. |
|
1014 | + * |
|
1015 | 1015 | * @return int|boolean integer info_id or false on error |
1016 | 1016 | */ |
1017 | 1017 | function importVNOTE(&$_vcalData, $_type, $_noteID=-1, $merge=false, $charset=null) |
@@ -1045,7 +1045,7 @@ discard block |
||
1045 | 1045 | * @param int $contentID=null infolog_id (or null, if unkown) |
1046 | 1046 | * @param boolean $relax=false if true, a weaker match algorithm is used |
1047 | 1047 | * @param string $charset The encoding charset for $text. Defaults to |
1048 | - * utf-8 for new format, iso-8859-1 for old format. |
|
1048 | + * utf-8 for new format, iso-8859-1 for old format. |
|
1049 | 1049 | * |
1050 | 1050 | * @return infolog_id of a matching entry or false, if nothing was found |
1051 | 1051 | */ |
@@ -1067,8 +1067,8 @@ discard block |
||
1067 | 1067 | * @param string $_type content type (eg.g text/plain) |
1068 | 1068 | * @param int $_noteID =-1 infolog_id of the entry |
1069 | 1069 | * @param string $charset The encoding charset for $text. Defaults to |
1070 | - * utf-8 for new format, iso-8859-1 for old format. |
|
1071 | - * |
|
1070 | + * utf-8 for new format, iso-8859-1 for old format. |
|
1071 | + * |
|
1072 | 1072 | * @return array infolog entry or false on error |
1073 | 1073 | */ |
1074 | 1074 | function vnotetoegw($_data, $_type, $_noteID=-1, $charset=null) |
@@ -23,39 +23,39 @@ discard block |
||
23 | 23 | * @var array $priority_egw2ical conversion of the priority egw => ical |
24 | 24 | */ |
25 | 25 | var $priority_egw2ical = array( |
26 | - 0 => 9, // low |
|
27 | - 1 => 5, // normal |
|
28 | - 2 => 3, // high |
|
29 | - 3 => 1, // urgent |
|
26 | + 0 => 9, // low |
|
27 | + 1 => 5, // normal |
|
28 | + 2 => 3, // high |
|
29 | + 3 => 1, // urgent |
|
30 | 30 | ); |
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @var array $priority_ical2egw conversion of the priority ical => egw |
34 | 34 | */ |
35 | 35 | var $priority_ical2egw = array( |
36 | - 9 => 0, 8 => 0, 7 => 0, // low |
|
37 | - 6 => 1, 5 => 1, 4 => 1, 0 => 1, // normal |
|
38 | - 3 => 2, 2 => 2, // high |
|
39 | - 1 => 3, // urgent |
|
36 | + 9 => 0, 8 => 0, 7 => 0, // low |
|
37 | + 6 => 1, 5 => 1, 4 => 1, 0 => 1, // normal |
|
38 | + 3 => 2, 2 => 2, // high |
|
39 | + 1 => 3, // urgent |
|
40 | 40 | ); |
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @var array $priority_egw2funambol conversion of the priority egw => funambol |
44 | 44 | */ |
45 | 45 | var $priority_egw2funambol = array( |
46 | - 0 => 0, // low |
|
47 | - 1 => 1, // normal |
|
48 | - 2 => 2, // high |
|
49 | - 3 => 2, // urgent |
|
46 | + 0 => 0, // low |
|
47 | + 1 => 1, // normal |
|
48 | + 2 => 2, // high |
|
49 | + 3 => 2, // urgent |
|
50 | 50 | ); |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * @var array $priority_funambol2egw conversion of the priority funambol => egw |
54 | 54 | */ |
55 | 55 | var $priority_funambol2egw = array( |
56 | - 0 => 0, // low |
|
57 | - 1 => 1, // normal |
|
58 | - 2 => 3, // high |
|
56 | + 0 => 0, // low |
|
57 | + 1 => 1, // normal |
|
58 | + 2 => 3, // high |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @var boolean |
94 | 94 | */ |
95 | 95 | var $log = false; |
96 | - var $logfile="/tmp/log-infolog-vcal"; |
|
96 | + var $logfile = "/tmp/log-infolog-vcal"; |
|
97 | 97 | |
98 | 98 | |
99 | 99 | /** |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | * @param string $charset ='UTF-8' |
118 | 118 | * @return string|boolean string with vCal or false on error (eg. no permission to read the event) |
119 | 119 | */ |
120 | - function exportVCalendar(array $tasks, $_version='2.0', $_method=null, $charset='UTF-8') |
|
120 | + function exportVCalendar(array $tasks, $_version = '2.0', $_method = null, $charset = 'UTF-8') |
|
121 | 121 | { |
122 | 122 | $vcal = new Horde_Icalendar; |
123 | 123 | |
124 | - foreach($tasks as $task) |
|
124 | + foreach ($tasks as $task) |
|
125 | 125 | { |
126 | 126 | if (!$this->exportVTODO($task, $_version, $_method, $charset, $vcal)) |
127 | 127 | { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * |
143 | 143 | * @return string|boolean string with vCal or false on error (eg. no permission to read the event) |
144 | 144 | */ |
145 | - function exportVTODO($task, $_version='2.0',$_method='PUBLISH', $charset='UTF-8',Horde_Icalendar $vcal=null) |
|
145 | + function exportVTODO($task, $_version = '2.0', $_method = 'PUBLISH', $charset = 'UTF-8', Horde_Icalendar $vcal = null) |
|
146 | 146 | { |
147 | 147 | if (is_array($task)) |
148 | 148 | { |
@@ -167,10 +167,10 @@ discard block |
||
167 | 167 | { |
168 | 168 | if (!preg_match('/\[UID:.+\]/m', $taskData['info_des'])) |
169 | 169 | { |
170 | - $taskData['info_des'] .= "\n[UID:" . $taskData['info_uid'] . "]"; |
|
170 | + $taskData['info_des'] .= "\n[UID:".$taskData['info_uid']."]"; |
|
171 | 171 | if ($taskData['info_id_parent'] != '') |
172 | 172 | { |
173 | - $taskData['info_des'] .= "\n[PARENT_UID:" . $taskData['info_id_parent'] . "]"; |
|
173 | + $taskData['info_des'] .= "\n[PARENT_UID:".$taskData['info_id_parent']."]"; |
|
174 | 174 | } |
175 | 175 | } |
176 | 176 | } |
@@ -186,15 +186,15 @@ discard block |
||
186 | 186 | |
187 | 187 | if ($this->log) |
188 | 188 | { |
189 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n" . |
|
190 | - array2string($taskData)."\n",3,$this->logfile); |
|
189 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n". |
|
190 | + array2string($taskData)."\n", 3, $this->logfile); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | if (!isset($vcal)) $vcal = new Horde_Icalendar; |
194 | - $vcal->setAttribute('PRODID','-//EGroupware//NONSGML EGroupware InfoLog '.$GLOBALS['egw_info']['apps']['infolog']['version'].'//'. |
|
195 | - strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang']),array(),false); |
|
196 | - $vcal->setAttribute('VERSION',$_version,array(),false); |
|
197 | - if ($_method) $vcal->setAttribute('METHOD',$_method,array(),false); |
|
194 | + $vcal->setAttribute('PRODID', '-//EGroupware//NONSGML EGroupware InfoLog '.$GLOBALS['egw_info']['apps']['infolog']['version'].'//'. |
|
195 | + strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang']), array(), false); |
|
196 | + $vcal->setAttribute('VERSION', $_version, array(), false); |
|
197 | + if ($_method) $vcal->setAttribute('METHOD', $_method, array(), false); |
|
198 | 198 | |
199 | 199 | $tzid = $this->tzid; |
200 | 200 | if ($tzid && $tzid != 'UTC') |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
215 | - $vevent = Horde_Icalendar::newComponent('VTODO',$vcal); |
|
215 | + $vevent = Horde_Icalendar::newComponent('VTODO', $vcal); |
|
216 | 216 | |
217 | 217 | if (!isset($this->clientProperties['SUMMARY']['Size'])) |
218 | 218 | { |
@@ -236,9 +236,9 @@ discard block |
||
236 | 236 | $noTruncate = $this->clientProperties[$field]['NoTruncate']; |
237 | 237 | if ($this->log && $size > 0) |
238 | 238 | { |
239 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__ . |
|
240 | - "() $field Size: $size, NoTruncate: " . |
|
241 | - ($noTruncate ? 'TRUE' : 'FALSE') . "\n",3,$this->logfile); |
|
239 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__. |
|
240 | + "() $field Size: $size, NoTruncate: ". |
|
241 | + ($noTruncate ? 'TRUE' : 'FALSE')."\n", 3, $this->logfile); |
|
242 | 242 | } |
243 | 243 | //Horde::logMessage("VTODO $field Size: $size, NoTruncate: " . |
244 | 244 | // ($noTruncate ? 'TRUE' : 'FALSE'), __FILE__, __LINE__, PEAR_LOG_DEBUG); |
@@ -255,19 +255,19 @@ discard block |
||
255 | 255 | { |
256 | 256 | if ($this->log) |
257 | 257 | { |
258 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__ . |
|
259 | - "() $field omitted due to maximum size $size\n",3,$this->logfile); |
|
258 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__. |
|
259 | + "() $field omitted due to maximum size $size\n", 3, $this->logfile); |
|
260 | 260 | } |
261 | 261 | //Horde::logMessage("VTODO $field omitted due to maximum size $size", |
262 | 262 | // __FILE__, __LINE__, PEAR_LOG_WARNING); |
263 | 263 | continue; // skip field |
264 | 264 | } |
265 | 265 | // truncate the value to size |
266 | - $value = substr($value, 0, $size -1); |
|
266 | + $value = substr($value, 0, $size - 1); |
|
267 | 267 | if ($this->log) |
268 | 268 | { |
269 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__ . |
|
270 | - "() $field truncated to maximum size $size\n",3,$this->logfile); |
|
269 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__. |
|
270 | + "() $field truncated to maximum size $size\n", 3, $this->logfile); |
|
271 | 271 | } |
272 | 272 | //Horde::logMessage("VTODO $field truncated to maximum size $size", |
273 | 273 | // __FILE__, __LINE__, PEAR_LOG_INFO); |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | if ($_version == '1.0' && preg_match('/[^\x20-\x7F]/', $value)) |
288 | 288 | { |
289 | - $options['CHARSET'] = $charset; |
|
289 | + $options['CHARSET'] = $charset; |
|
290 | 290 | switch ($this->productManufacturer) |
291 | 291 | { |
292 | 292 | case 'groupdav': |
@@ -328,23 +328,23 @@ discard block |
||
328 | 328 | self::setDateOrTime($vevent, 'COMPLETED', $taskData['info_datecompleted'], $tzid); |
329 | 329 | } |
330 | 330 | |
331 | - $vevent->setAttribute('DTSTAMP',time()); |
|
331 | + $vevent->setAttribute('DTSTAMP', time()); |
|
332 | 332 | $vevent->setAttribute('CREATED', $taskData['info_created']); |
333 | 333 | $vevent->setAttribute('LAST-MODIFIED', $taskData['info_datemodified']); |
334 | - $vevent->setAttribute('CLASS',$taskData['info_access'] == 'public' ? 'PUBLIC' : 'PRIVATE'); |
|
335 | - $vevent->setAttribute('STATUS',$this->status2vtodo($taskData['info_status'])); |
|
334 | + $vevent->setAttribute('CLASS', $taskData['info_access'] == 'public' ? 'PUBLIC' : 'PRIVATE'); |
|
335 | + $vevent->setAttribute('STATUS', $this->status2vtodo($taskData['info_status'])); |
|
336 | 336 | // we try to preserv the original infolog status as X-INFOLOG-STATUS, so we can restore it, if the user does not modify STATUS |
337 | - $vevent->setAttribute('X-INFOLOG-STATUS',$taskData['info_status']); |
|
338 | - $vevent->setAttribute('PERCENT-COMPLETE',$taskData['info_percent']); |
|
337 | + $vevent->setAttribute('X-INFOLOG-STATUS', $taskData['info_status']); |
|
338 | + $vevent->setAttribute('PERCENT-COMPLETE', $taskData['info_percent']); |
|
339 | 339 | if ($this->productManufacturer == 'funambol' && |
340 | 340 | (strpos($this->productName, 'outlook') !== false |
341 | 341 | || strpos($this->productName, 'pocket pc') !== false)) |
342 | 342 | { |
343 | - $priority = (int) $this->priority_egw2funambol[$taskData['info_priority']]; |
|
343 | + $priority = (int)$this->priority_egw2funambol[$taskData['info_priority']]; |
|
344 | 344 | } |
345 | 345 | else |
346 | 346 | { |
347 | - $priority = (int) $this->priority_egw2ical[$taskData['info_priority']]; |
|
347 | + $priority = (int)$this->priority_egw2ical[$taskData['info_priority']]; |
|
348 | 348 | } |
349 | 349 | $vevent->setAttribute('PRIORITY', $priority); |
350 | 350 | |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | (count($taskData['info_responsible']) > 1 || |
354 | 354 | $taskData['info_responsible'][0] != $taskData['info_onwer'])) |
355 | 355 | { |
356 | - if (($url = $GLOBALS['egw']->accounts->id2name($taskData['info_owner'],'account_email'))) |
|
356 | + if (($url = $GLOBALS['egw']->accounts->id2name($taskData['info_owner'], 'account_email'))) |
|
357 | 357 | { |
358 | 358 | $url = 'MAILTO:'.$url; |
359 | 359 | } |
@@ -361,13 +361,13 @@ discard block |
||
361 | 361 | { |
362 | 362 | $url = 'urn:uuid:'.Api\CalDAV::generate_uid('accounts', $taskData['info_owner']); |
363 | 363 | } |
364 | - $vevent->setAttribute('ORGANIZER',$url,array( |
|
365 | - 'CN' => $GLOBALS['egw']->accounts->id2name($taskData['info_owner'],'account_fullname'), |
|
364 | + $vevent->setAttribute('ORGANIZER', $url, array( |
|
365 | + 'CN' => $GLOBALS['egw']->accounts->id2name($taskData['info_owner'], 'account_fullname'), |
|
366 | 366 | 'X-EGROUPWARE-UID' => $taskData['info_owner'], |
367 | 367 | ), true); |
368 | - foreach($taskData['info_responsible'] as $responsible) |
|
368 | + foreach ($taskData['info_responsible'] as $responsible) |
|
369 | 369 | { |
370 | - if (($url = $GLOBALS['egw']->accounts->id2name($responsible,'account_email'))) |
|
370 | + if (($url = $GLOBALS['egw']->accounts->id2name($responsible, 'account_email'))) |
|
371 | 371 | { |
372 | 372 | $url = 'MAILTO:'.$url; |
373 | 373 | } |
@@ -377,15 +377,15 @@ discard block |
||
377 | 377 | } |
378 | 378 | if ($responsible > 0) |
379 | 379 | { |
380 | - $vevent->setAttribute('ATTENDEE',$url,array( |
|
381 | - 'CN' => $GLOBALS['egw']->accounts->id2name($responsible,'account_fullname'), |
|
380 | + $vevent->setAttribute('ATTENDEE', $url, array( |
|
381 | + 'CN' => $GLOBALS['egw']->accounts->id2name($responsible, 'account_fullname'), |
|
382 | 382 | 'CUTYPE' => 'INDIVIDUAL', |
383 | 383 | 'X-EGROUPWARE-UID' => $responsible, |
384 | 384 | ), true); |
385 | 385 | } |
386 | 386 | elseif ($responsible < 0) |
387 | 387 | { |
388 | - $vevent->setAttribute('ATTENDEE',$url,array( |
|
388 | + $vevent->setAttribute('ATTENDEE', $url, array( |
|
389 | 389 | 'CN' => $GLOBALS['egw']->accounts->id2name($responsible), |
390 | 390 | 'CUTYPE' => 'GROUP', |
391 | 391 | 'X-EGROUPWARE-UID' => $responsible, |
@@ -396,17 +396,17 @@ discard block |
||
396 | 396 | // for CalDAV add all X-Properties previously parsed |
397 | 397 | if ($this->productManufacturer == 'groupdav') |
398 | 398 | { |
399 | - foreach($taskData as $name => $value) |
|
399 | + foreach ($taskData as $name => $value) |
|
400 | 400 | { |
401 | 401 | if (substr($name, 0, 2) == '##') |
402 | 402 | { |
403 | 403 | if ($name[2] == ':') |
404 | 404 | { |
405 | 405 | if (($v = json_php_unserialize($value)) && is_array($v)) $value = $v; |
406 | - foreach((array)$value as $compvData) |
|
406 | + foreach ((array)$value as $compvData) |
|
407 | 407 | { |
408 | - $comp = Horde_Icalendar::newComponent(substr($name,3), $vevent); |
|
409 | - $comp->parsevCalendar($compvData,substr($name,3)); |
|
408 | + $comp = Horde_Icalendar::newComponent(substr($name, 3), $vevent); |
|
409 | + $comp->parsevCalendar($compvData, substr($name, 3)); |
|
410 | 410 | $vevent->addComponent($comp); |
411 | 411 | } |
412 | 412 | } |
@@ -426,8 +426,8 @@ discard block |
||
426 | 426 | $retval = $vcal->exportvCalendar(); |
427 | 427 | if ($this->log) |
428 | 428 | { |
429 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n" . |
|
430 | - array2string($retval)."\n",3,$this->logfile); |
|
429 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n". |
|
430 | + array2string($retval)."\n", 3, $this->logfile); |
|
431 | 431 | } |
432 | 432 | // Horde::logMessage("exportVTODO:\n" . print_r($retval, true), |
433 | 433 | // __FILE__, __LINE__, PEAR_LOG_DEBUG); |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | } |
457 | 457 | $tz = self::$tz_cache[$tzid]; |
458 | 458 | } |
459 | - elseif(is_null($tzid)) |
|
459 | + elseif (is_null($tzid)) |
|
460 | 460 | { |
461 | 461 | $tz = Api\DateTime::$user_timezone; |
462 | 462 | } |
@@ -464,9 +464,9 @@ discard block |
||
464 | 464 | { |
465 | 465 | $tz = Api\DateTime::$server_timezone; |
466 | 466 | } |
467 | - if (!is_a($time,'DateTime')) |
|
467 | + if (!is_a($time, 'DateTime')) |
|
468 | 468 | { |
469 | - $time = new Api\DateTime($time,Api\DateTime::$server_timezone); |
|
469 | + $time = new Api\DateTime($time, Api\DateTime::$server_timezone); |
|
470 | 470 | } |
471 | 471 | $time->setTimezone($tz); |
472 | 472 | |
@@ -515,16 +515,16 @@ discard block |
||
515 | 515 | * signature array callback($task, $param1, ...) |
516 | 516 | * @return int|boolean integer info_id or false on error |
517 | 517 | */ |
518 | - function importVTODO(&$_vcalData, $_taskID=-1, $merge=false, $user=null, $charset=null, $caldav_name=null, |
|
519 | - array $callback_data=null) |
|
518 | + function importVTODO(&$_vcalData, $_taskID = -1, $merge = false, $user = null, $charset = null, $caldav_name = null, |
|
519 | + array $callback_data = null) |
|
520 | 520 | { |
521 | - unset($merge); // no longer used, but required by function signature |
|
521 | + unset($merge); // no longer used, but required by function signature |
|
522 | 522 | |
523 | 523 | if ($this->tzid) |
524 | 524 | { |
525 | 525 | date_default_timezone_set($this->tzid); |
526 | 526 | } |
527 | - $taskData = $this->vtodotoegw($_vcalData,$_taskID, $charset); |
|
527 | + $taskData = $this->vtodotoegw($_vcalData, $_taskID, $charset); |
|
528 | 528 | if ($this->tzid) |
529 | 529 | { |
530 | 530 | date_default_timezone_set($GLOBALS['egw_info']['server']['server_timezone']); |
@@ -555,8 +555,8 @@ discard block |
||
555 | 555 | |
556 | 556 | if ($this->log) |
557 | 557 | { |
558 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n" . |
|
559 | - array2string($taskData)."\n",3,$this->logfile); |
|
558 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n". |
|
559 | + array2string($taskData)."\n", 3, $this->logfile); |
|
560 | 560 | } |
561 | 561 | |
562 | 562 | if ($caldav_name) |
@@ -565,18 +565,18 @@ discard block |
||
565 | 565 | } |
566 | 566 | |
567 | 567 | // make sure not to empty fields not supported by iCal or not allowed to change by CalDAV |
568 | - if ($_taskID > 0 && ($old = $this->read($_taskID,true,'server'))) |
|
568 | + if ($_taskID > 0 && ($old = $this->read($_taskID, true, 'server'))) |
|
569 | 569 | { |
570 | 570 | // remove all values supported by iCal standard |
571 | 571 | $old = array_diff_key($old, array_flip(array( |
572 | - 'info_subject','info_des','info_location','info_cat','info_responsible', |
|
573 | - 'info_startdate','info_enddate','info_priority','info_location', |
|
574 | - 'info_access','info_status','info_percent','info_datecompleted', |
|
572 | + 'info_subject', 'info_des', 'info_location', 'info_cat', 'info_responsible', |
|
573 | + 'info_startdate', 'info_enddate', 'info_priority', 'info_location', |
|
574 | + 'info_access', 'info_status', 'info_percent', 'info_datecompleted', |
|
575 | 575 | ))); |
576 | 576 | // remove all iCal fields not supported by EGroupware (stored like custom fields) |
577 | - foreach(array_keys($old) as $name) |
|
577 | + foreach (array_keys($old) as $name) |
|
578 | 578 | { |
579 | - if (substr($name,0,2) == '##') unset($old[$name]); |
|
579 | + if (substr($name, 0, 2) == '##') unset($old[$name]); |
|
580 | 580 | } |
581 | 581 | // merge in again all infolog fields not supported by iCal or not allowed to change |
582 | 582 | $taskData = array_merge($taskData, $old); |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | * |
602 | 602 | * @return array of infolog_ids of matching entries |
603 | 603 | */ |
604 | - function searchVTODO($_vcalData, $contentID=null, $relax=false, $charset=null) |
|
604 | + function searchVTODO($_vcalData, $contentID = null, $relax = false, $charset = null) |
|
605 | 605 | { |
606 | 606 | $result = array(); |
607 | 607 | |
@@ -646,12 +646,12 @@ discard block |
||
646 | 646 | * |
647 | 647 | * @return array infolog entry or false on error |
648 | 648 | */ |
649 | - function vtodotoegw($_vcalData, $_taskID=-1, $charset=null) |
|
649 | + function vtodotoegw($_vcalData, $_taskID = -1, $charset = null) |
|
650 | 650 | { |
651 | 651 | if ($this->log) |
652 | 652 | { |
653 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."($_taskID)\n" . |
|
654 | - array2string($_vcalData)."\n",3,$this->logfile); |
|
653 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."($_taskID)\n". |
|
654 | + array2string($_vcalData)."\n", 3, $this->logfile); |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | $vcal = new Horde_Icalendar; |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | if ($this->log) |
665 | 665 | { |
666 | 666 | error_log(__FILE__.'['.__LINE__.'] '.__METHOD__. |
667 | - "(): No vCalendar Container found!\n",3,$this->logfile); |
|
667 | + "(): No vCalendar Container found!\n", 3, $this->logfile); |
|
668 | 668 | } |
669 | 669 | return false; |
670 | 670 | } |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | if ($this->log) |
688 | 688 | { |
689 | 689 | error_log(__FILE__.'['.__LINE__.'] '.__METHOD__. |
690 | - "(): Not a vTODO container, skipping...\n",3,$this->logfile); |
|
690 | + "(): Not a vTODO container, skipping...\n", 3, $this->logfile); |
|
691 | 691 | } |
692 | 692 | continue; |
693 | 693 | } |
@@ -714,24 +714,23 @@ discard block |
||
714 | 714 | ($this->_status2vtodo[$x_infolog_status] === 'COMPLETED') != is_scalar($completed)) |
715 | 715 | { |
716 | 716 | $percent_completed = $component->getAttributeDefault('PERCENT-COMPLETE', null); |
717 | - $status = $completed && is_scalar($completed) ? 'COMPLETED' : |
|
718 | - ($percent_completed && is_scalar($percent_completed) && $percent_completed > 0 ? 'IN-PROCESS' : 'NEEDS-ACTION'); |
|
717 | + $status = $completed && is_scalar($completed) ? 'COMPLETED' : ($percent_completed && is_scalar($percent_completed) && $percent_completed > 0 ? 'IN-PROCESS' : 'NEEDS-ACTION'); |
|
719 | 718 | $component->setAttribute('STATUS', $status); |
720 | 719 | if (!is_scalar($percent_completed)) |
721 | 720 | { |
722 | 721 | $component->setAttribute('PERCENT-COMPLETE', $percent_completed = $status == 'COMPLETED' ? |
723 | 722 | 100 : ($status == 'NEEDS-ACTION' ? 0 : 10)); |
724 | 723 | } |
725 | - if ($this->log) error_log(__METHOD__."() setting STATUS='$status' and PERCENT-COMPLETE=$percent_completed from COMPLETED and X-INFOLOG-STATUS='$x_infolog_status'\n",3,$this->logfile); |
|
724 | + if ($this->log) error_log(__METHOD__."() setting STATUS='$status' and PERCENT-COMPLETE=$percent_completed from COMPLETED and X-INFOLOG-STATUS='$x_infolog_status'\n", 3, $this->logfile); |
|
726 | 725 | } |
727 | 726 | // new task without status --> set a default status of NEEDS-ACTION, as otherwise task is marked closed |
728 | - elseif($_taskID <= 0 && !is_scalar($x_infolog_status) && !is_scalar($completed)) |
|
727 | + elseif ($_taskID <= 0 && !is_scalar($x_infolog_status) && !is_scalar($completed)) |
|
729 | 728 | { |
730 | 729 | $component->setAttribute('STATUS', 'NEEDS-ACTION'); |
731 | 730 | } |
732 | 731 | else |
733 | 732 | { |
734 | - if ($this->log) error_log(__METHOD__."() no STATUS, X-INFOLOG-STATUS='$x_infolog_status', COMPLETED".(is_scalar($completed)?'='.$completed:' not set')." --> leaving status and percent unchanged",3,$this->logfile); |
|
733 | + if ($this->log) error_log(__METHOD__."() no STATUS, X-INFOLOG-STATUS='$x_infolog_status', COMPLETED".(is_scalar($completed) ? '='.$completed : ' not set')." --> leaving status and percent unchanged", 3, $this->logfile); |
|
735 | 734 | } |
736 | 735 | } |
737 | 736 | foreach ($component->getAllAttributes() as $attribute) |
@@ -775,7 +774,7 @@ discard block |
||
775 | 774 | case 'DURATION': |
776 | 775 | if (!isset($taskData['info_startdate'])) |
777 | 776 | { |
778 | - $taskData['info_startdate'] = $component->getAttributeDefault('DTSTART', null); |
|
777 | + $taskData['info_startdate'] = $component->getAttributeDefault('DTSTART', null); |
|
779 | 778 | } |
780 | 779 | $attribute['value'] += $taskData['info_startdate']; |
781 | 780 | $taskData['##DURATION'] = $attribute['value']; |
@@ -787,11 +786,11 @@ discard block |
||
787 | 786 | break; |
788 | 787 | |
789 | 788 | case 'COMPLETED': |
790 | - $taskData['info_datecompleted'] = self::date2ts($attribute['value']); |
|
789 | + $taskData['info_datecompleted'] = self::date2ts($attribute['value']); |
|
791 | 790 | break; |
792 | 791 | |
793 | 792 | case 'DTSTART': |
794 | - $taskData['info_startdate'] = self::date2ts($attribute['value']); |
|
793 | + $taskData['info_startdate'] = self::date2ts($attribute['value']); |
|
795 | 794 | break; |
796 | 795 | |
797 | 796 | case 'PRIORITY': |
@@ -801,16 +800,16 @@ discard block |
||
801 | 800 | (strpos($this->productName, 'outlook') !== false |
802 | 801 | || strpos($this->productName, 'pocket pc') !== false)) |
803 | 802 | { |
804 | - $taskData['info_priority'] = (int) $this->priority_funambol2egw[$attribute['value']]; |
|
803 | + $taskData['info_priority'] = (int)$this->priority_funambol2egw[$attribute['value']]; |
|
805 | 804 | } |
806 | 805 | else |
807 | 806 | { |
808 | - $taskData['info_priority'] = (int) $this->priority_ical2egw[$attribute['value']]; |
|
807 | + $taskData['info_priority'] = (int)$this->priority_ical2egw[$attribute['value']]; |
|
809 | 808 | } |
810 | 809 | } |
811 | 810 | else |
812 | 811 | { |
813 | - $taskData['info_priority'] = 1; // default = normal |
|
812 | + $taskData['info_priority'] = 1; // default = normal |
|
814 | 813 | } |
815 | 814 | break; |
816 | 815 | |
@@ -833,7 +832,7 @@ discard block |
||
833 | 832 | case 'CATEGORIES': |
834 | 833 | if (!empty($attribute['value'])) |
835 | 834 | { |
836 | - $cats = $this->find_or_add_categories(explode(',',$attribute['value']), $_taskID); |
|
835 | + $cats = $this->find_or_add_categories(explode(',', $attribute['value']), $_taskID); |
|
837 | 836 | $taskData['info_cat'] = $cats[0]; |
838 | 837 | } |
839 | 838 | break; |
@@ -846,7 +845,7 @@ discard block |
||
846 | 845 | break; |
847 | 846 | |
848 | 847 | case 'PERCENT-COMPLETE': |
849 | - $taskData['info_percent'] = (int) $attribute['value']; |
|
848 | + $taskData['info_percent'] = (int)$attribute['value']; |
|
850 | 849 | break; |
851 | 850 | |
852 | 851 | case 'ATTENDEE': |
@@ -888,10 +887,10 @@ discard block |
||
888 | 887 | break; |
889 | 888 | } |
890 | 889 | // store included, but unsupported components like valarm as x-properties |
891 | - foreach($component->getComponents() as $comp) |
|
890 | + foreach ($component->getComponents() as $comp) |
|
892 | 891 | { |
893 | 892 | $name = '##:'.strtoupper($comp->getType()); |
894 | - $compvData = $comp->exportvCalendar($comp,'utf-8'); |
|
893 | + $compvData = $comp->exportvCalendar($comp, 'utf-8'); |
|
895 | 894 | if (isset($taskData[$name])) |
896 | 895 | { |
897 | 896 | $taskData[$name] = array($taskData[$name]); |
@@ -904,8 +903,8 @@ discard block |
||
904 | 903 | } |
905 | 904 | if ($this->log) |
906 | 905 | { |
907 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."($_taskID)\n" . |
|
908 | - ($taskData ? array2string($taskData) : 'FALSE') . "\n",3,$this->logfile); |
|
906 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."($_taskID)\n". |
|
907 | + ($taskData ? array2string($taskData) : 'FALSE')."\n", 3, $this->logfile); |
|
909 | 908 | } |
910 | 909 | return $taskData; |
911 | 910 | } |
@@ -919,14 +918,14 @@ discard block |
||
919 | 918 | * |
920 | 919 | * @return string|boolean VNOTE representation of the infolog entry or false on error |
921 | 920 | */ |
922 | - function exportVNOTE($_noteID, $_type, $charset='UTF-8') |
|
921 | + function exportVNOTE($_noteID, $_type, $charset = 'UTF-8') |
|
923 | 922 | { |
924 | - if(!($note = $this->read($_noteID, true, 'server'))) return false; |
|
923 | + if (!($note = $this->read($_noteID, true, 'server'))) return false; |
|
925 | 924 | |
926 | 925 | $note = Api\Translation::convert($note, |
927 | 926 | Api\Translation::charset(), $charset); |
928 | 927 | |
929 | - switch ($_type) |
|
928 | + switch ($_type) |
|
930 | 929 | { |
931 | 930 | case 'text/plain': |
932 | 931 | $txt = $note['info_subject']."\n\n".$note['info_des']; |
@@ -940,10 +939,10 @@ discard block |
||
940 | 939 | Api\Translation::charset(), $charset); |
941 | 940 | } |
942 | 941 | $vnote = new Horde_Icalendar_Vnote(); |
943 | - $vnote->setAttribute('PRODID','-//EGroupware//NONSGML EGroupware InfoLog '.$GLOBALS['egw_info']['apps']['infolog']['version'].'//'. |
|
942 | + $vnote->setAttribute('PRODID', '-//EGroupware//NONSGML EGroupware InfoLog '.$GLOBALS['egw_info']['apps']['infolog']['version'].'//'. |
|
944 | 943 | strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang'])); |
945 | 944 | $vnote->setAttribute('VERSION', '1.1'); |
946 | - foreach (array( 'SUMMARY' => $note['info_subject'], |
|
945 | + foreach (array('SUMMARY' => $note['info_subject'], |
|
947 | 946 | 'BODY' => $note['info_des'], |
948 | 947 | 'CATEGORIES' => $note['info_cat'], |
949 | 948 | ) as $field => $value) |
@@ -951,7 +950,7 @@ discard block |
||
951 | 950 | $options = array(); |
952 | 951 | if (preg_match('/[^\x20-\x7F]/', $value)) |
953 | 952 | { |
954 | - $options['CHARSET'] = $charset; |
|
953 | + $options['CHARSET'] = $charset; |
|
955 | 954 | switch ($this->productManufacturer) |
956 | 955 | { |
957 | 956 | case 'groupdav': |
@@ -981,21 +980,21 @@ discard block |
||
981 | 980 | } |
982 | 981 | if ($note['info_startdate']) |
983 | 982 | { |
984 | - $vnote->setAttribute('CREATED',$note['info_startdate']); |
|
983 | + $vnote->setAttribute('CREATED', $note['info_startdate']); |
|
985 | 984 | } |
986 | 985 | else |
987 | 986 | { |
988 | - $vnote->setAttribute('CREATED',$GLOBALS['egw']->contenthistory->getTSforAction('infolog_note',$_noteID,'add')); |
|
987 | + $vnote->setAttribute('CREATED', $GLOBALS['egw']->contenthistory->getTSforAction('infolog_note', $_noteID, 'add')); |
|
989 | 988 | } |
990 | - $vnote->setAttribute('LAST-MODIFIED',$GLOBALS['egw']->contenthistory->getTSforAction('infolog_note',$_noteID,'modify')); |
|
989 | + $vnote->setAttribute('LAST-MODIFIED', $GLOBALS['egw']->contenthistory->getTSforAction('infolog_note', $_noteID, 'modify')); |
|
991 | 990 | |
992 | 991 | #$vnote->setAttribute('CLASS',$taskData['info_access'] == 'public' ? 'PUBLIC' : 'PRIVATE'); |
993 | 992 | |
994 | 993 | $retval = $vnote->exportvCalendar(); |
995 | 994 | if ($this->log) |
996 | 995 | { |
997 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n" . |
|
998 | - array2string($retval)."\n",3,$this->logfile); |
|
996 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n". |
|
997 | + array2string($retval)."\n", 3, $this->logfile); |
|
999 | 998 | } |
1000 | 999 | return $retval; |
1001 | 1000 | } |
@@ -1014,25 +1013,25 @@ discard block |
||
1014 | 1013 | * |
1015 | 1014 | * @return int|boolean integer info_id or false on error |
1016 | 1015 | */ |
1017 | - function importVNOTE(&$_vcalData, $_type, $_noteID=-1, $merge=false, $charset=null) |
|
1016 | + function importVNOTE(&$_vcalData, $_type, $_noteID = -1, $merge = false, $charset = null) |
|
1018 | 1017 | { |
1019 | - unset($merge); // no longer used, but required by function signature |
|
1018 | + unset($merge); // no longer used, but required by function signature |
|
1020 | 1019 | if ($this->log) |
1021 | 1020 | { |
1022 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n" . |
|
1023 | - array2string($_vcalData)."\n",3,$this->logfile); |
|
1021 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n". |
|
1022 | + array2string($_vcalData)."\n", 3, $this->logfile); |
|
1024 | 1023 | } |
1025 | 1024 | |
1026 | 1025 | if (!($note = $this->vnotetoegw($_vcalData, $_type, $_noteID, $charset))) return false; |
1027 | 1026 | |
1028 | - if($_noteID > 0) $note['info_id'] = $_noteID; |
|
1027 | + if ($_noteID > 0) $note['info_id'] = $_noteID; |
|
1029 | 1028 | |
1030 | 1029 | if (empty($note['info_status'])) $note['info_status'] = 'done'; |
1031 | 1030 | |
1032 | 1031 | if ($this->log) |
1033 | 1032 | { |
1034 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n" . |
|
1035 | - array2string($note)."\n",3,$this->logfile); |
|
1033 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n". |
|
1034 | + array2string($note)."\n", 3, $this->logfile); |
|
1036 | 1035 | } |
1037 | 1036 | |
1038 | 1037 | return $this->write($note, true, true, false); |
@@ -1049,7 +1048,7 @@ discard block |
||
1049 | 1048 | * |
1050 | 1049 | * @return infolog_id of a matching entry or false, if nothing was found |
1051 | 1050 | */ |
1052 | - function searchVNOTE($_vcalData, $_type, $contentID=null, $relax=false, $charset=null) |
|
1051 | + function searchVNOTE($_vcalData, $_type, $contentID = null, $relax = false, $charset = null) |
|
1053 | 1052 | { |
1054 | 1053 | if (!($note = $this->vnotetoegw($_vcalData, $_type, $contentID, $charset))) return array(); |
1055 | 1054 | |
@@ -1071,12 +1070,12 @@ discard block |
||
1071 | 1070 | * |
1072 | 1071 | * @return array infolog entry or false on error |
1073 | 1072 | */ |
1074 | - function vnotetoegw($_data, $_type, $_noteID=-1, $charset=null) |
|
1073 | + function vnotetoegw($_data, $_type, $_noteID = -1, $charset = null) |
|
1075 | 1074 | { |
1076 | 1075 | if ($this->log) |
1077 | 1076 | { |
1078 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."($_type, $_noteID)\n" . |
|
1079 | - array2string($_data)."\n",3,$this->logfile); |
|
1077 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."($_type, $_noteID)\n". |
|
1078 | + array2string($_data)."\n", 3, $this->logfile); |
|
1080 | 1079 | } |
1081 | 1080 | $note = false; |
1082 | 1081 | |
@@ -1130,7 +1129,7 @@ discard block |
||
1130 | 1129 | case 'CATEGORIES': |
1131 | 1130 | if ($attribute['value']) |
1132 | 1131 | { |
1133 | - $cats = $this->find_or_add_categories(explode(',',$attribute['value']), $_noteID); |
|
1132 | + $cats = $this->find_or_add_categories(explode(',', $attribute['value']), $_noteID); |
|
1134 | 1133 | $note['info_cat'] = $cats[0]; |
1135 | 1134 | } |
1136 | 1135 | break; |
@@ -1141,8 +1140,8 @@ discard block |
||
1141 | 1140 | } |
1142 | 1141 | if ($this->log) |
1143 | 1142 | { |
1144 | - error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."($_type, $_noteID)\n" . |
|
1145 | - ($note ? array2string($note) : 'FALSE') ."\n",3,$this->logfile); |
|
1143 | + error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."($_type, $_noteID)\n". |
|
1144 | + ($note ? array2string($note) : 'FALSE')."\n", 3, $this->logfile); |
|
1146 | 1145 | } |
1147 | 1146 | return $note; |
1148 | 1147 | } |
@@ -1155,7 +1154,7 @@ discard block |
||
1155 | 1154 | * @param string $_productManufacturer |
1156 | 1155 | * @param string $_productName |
1157 | 1156 | */ |
1158 | - function setSupportedFields($_productManufacturer='', $_productName='') |
|
1157 | + function setSupportedFields($_productManufacturer = '', $_productName = '') |
|
1159 | 1158 | { |
1160 | 1159 | $state = &$_SESSION['SyncML.state']; |
1161 | 1160 | if (isset($state)) |
@@ -1207,10 +1206,10 @@ discard block |
||
1207 | 1206 | if ($this->log) |
1208 | 1207 | { |
1209 | 1208 | error_log(__FILE__.'['.__LINE__.'] '.__METHOD__. |
1210 | - '(' . $this->productManufacturer . |
|
1211 | - ', '. $this->productName .', ' . |
|
1212 | - ($this->tzid ? $this->tzid : Api\DateTime::$user_timezone->getName()) . |
|
1213 | - ")\n" , 3, $this->logfile); |
|
1209 | + '('.$this->productManufacturer. |
|
1210 | + ', '.$this->productName.', '. |
|
1211 | + ($this->tzid ? $this->tzid : Api\DateTime::$user_timezone->getName()). |
|
1212 | + ")\n", 3, $this->logfile); |
|
1214 | 1213 | } |
1215 | 1214 | |
1216 | 1215 | //Horde::logMessage('setSupportedFields(' . $this->productManufacturer . ', ' |
@@ -104,7 +104,10 @@ discard block |
||
104 | 104 | function __construct(&$_clientProperties = array()) |
105 | 105 | { |
106 | 106 | parent::__construct(); |
107 | - if ($this->log) $this->logfile = $GLOBALS['egw_info']['server']['temp_dir']."/log-infolog-vcal"; |
|
107 | + if ($this->log) |
|
108 | + { |
|
109 | + $this->logfile = $GLOBALS['egw_info']['server']['temp_dir']."/log-infolog-vcal"; |
|
110 | + } |
|
108 | 111 | $this->clientProperties = $_clientProperties; |
109 | 112 | } |
110 | 113 | |
@@ -150,7 +153,10 @@ discard block |
||
150 | 153 | } |
151 | 154 | else |
152 | 155 | { |
153 | - if (!($taskData = $this->read($task, true, 'server'))) return false; |
|
156 | + if (!($taskData = $this->read($task, true, 'server'))) |
|
157 | + { |
|
158 | + return false; |
|
159 | + } |
|
154 | 160 | } |
155 | 161 | |
156 | 162 | if ($taskData['info_id_parent']) |
@@ -190,11 +196,17 @@ discard block |
||
190 | 196 | array2string($taskData)."\n",3,$this->logfile); |
191 | 197 | } |
192 | 198 | |
193 | - if (!isset($vcal)) $vcal = new Horde_Icalendar; |
|
199 | + if (!isset($vcal)) |
|
200 | + { |
|
201 | + $vcal = new Horde_Icalendar; |
|
202 | + } |
|
194 | 203 | $vcal->setAttribute('PRODID','-//EGroupware//NONSGML EGroupware InfoLog '.$GLOBALS['egw_info']['apps']['infolog']['version'].'//'. |
195 | 204 | strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang']),array(),false); |
196 | 205 | $vcal->setAttribute('VERSION',$_version,array(),false); |
197 | - if ($_method) $vcal->setAttribute('METHOD',$_method,array(),false); |
|
206 | + if ($_method) |
|
207 | + { |
|
208 | + $vcal->setAttribute('METHOD',$_method,array(),false); |
|
209 | + } |
|
198 | 210 | |
199 | 211 | $tzid = $this->tzid; |
200 | 212 | if ($tzid && $tzid != 'UTC') |
@@ -273,7 +285,10 @@ discard block |
||
273 | 285 | // __FILE__, __LINE__, PEAR_LOG_INFO); |
274 | 286 | } |
275 | 287 | |
276 | - if (empty($value) && ($size < 0 || $noTruncate)) continue; |
|
288 | + if (empty($value) && ($size < 0 || $noTruncate)) |
|
289 | + { |
|
290 | + continue; |
|
291 | + } |
|
277 | 292 | |
278 | 293 | if ($field == 'RELATED-TO') |
279 | 294 | { |
@@ -402,7 +417,10 @@ discard block |
||
402 | 417 | { |
403 | 418 | if ($name[2] == ':') |
404 | 419 | { |
405 | - if (($v = json_php_unserialize($value)) && is_array($v)) $value = $v; |
|
420 | + if (($v = json_php_unserialize($value)) && is_array($v)) |
|
421 | + { |
|
422 | + $value = $v; |
|
423 | + } |
|
406 | 424 | foreach((array)$value as $compvData) |
407 | 425 | { |
408 | 426 | $comp = Horde_Icalendar::newComponent(substr($name,3), $vevent); |
@@ -530,7 +548,10 @@ discard block |
||
530 | 548 | date_default_timezone_set($GLOBALS['egw_info']['server']['server_timezone']); |
531 | 549 | } |
532 | 550 | |
533 | - if (!$taskData) return false; |
|
551 | + if (!$taskData) |
|
552 | + { |
|
553 | + return false; |
|
554 | + } |
|
534 | 555 | |
535 | 556 | // keep the dates |
536 | 557 | $this->time2time($taskData, $this->tzid, false); |
@@ -576,7 +597,10 @@ discard block |
||
576 | 597 | // remove all iCal fields not supported by EGroupware (stored like custom fields) |
577 | 598 | foreach(array_keys($old) as $name) |
578 | 599 | { |
579 | - if (substr($name,0,2) == '##') unset($old[$name]); |
|
600 | + if (substr($name,0,2) == '##') |
|
601 | + { |
|
602 | + unset($old[$name]); |
|
603 | + } |
|
580 | 604 | } |
581 | 605 | // merge in again all infolog fields not supported by iCal or not allowed to change |
582 | 606 | $taskData = array_merge($taskData, $old); |
@@ -722,7 +746,10 @@ discard block |
||
722 | 746 | $component->setAttribute('PERCENT-COMPLETE', $percent_completed = $status == 'COMPLETED' ? |
723 | 747 | 100 : ($status == 'NEEDS-ACTION' ? 0 : 10)); |
724 | 748 | } |
725 | - if ($this->log) error_log(__METHOD__."() setting STATUS='$status' and PERCENT-COMPLETE=$percent_completed from COMPLETED and X-INFOLOG-STATUS='$x_infolog_status'\n",3,$this->logfile); |
|
749 | + if ($this->log) |
|
750 | + { |
|
751 | + error_log(__METHOD__."() setting STATUS='$status' and PERCENT-COMPLETE=$percent_completed from COMPLETED and X-INFOLOG-STATUS='$x_infolog_status'\n",3,$this->logfile); |
|
752 | + } |
|
726 | 753 | } |
727 | 754 | // new task without status --> set a default status of NEEDS-ACTION, as otherwise task is marked closed |
728 | 755 | elseif($_taskID <= 0 && !is_scalar($x_infolog_status) && !is_scalar($completed)) |
@@ -731,12 +758,18 @@ discard block |
||
731 | 758 | } |
732 | 759 | else |
733 | 760 | { |
734 | - if ($this->log) error_log(__METHOD__."() no STATUS, X-INFOLOG-STATUS='$x_infolog_status', COMPLETED".(is_scalar($completed)?'='.$completed:' not set')." --> leaving status and percent unchanged",3,$this->logfile); |
|
761 | + if ($this->log) |
|
762 | + { |
|
763 | + error_log(__METHOD__."() no STATUS, X-INFOLOG-STATUS='$x_infolog_status', COMPLETED".(is_scalar($completed)?'='.$completed:' not set')." --> leaving status and percent unchanged",3,$this->logfile); |
|
764 | + } |
|
735 | 765 | } |
736 | 766 | } |
737 | 767 | foreach ($component->getAllAttributes() as $attribute) |
738 | 768 | { |
739 | - if (!$attribute['value'] && $attribute['value'] !== '0') continue; |
|
769 | + if (!$attribute['value'] && $attribute['value'] !== '0') |
|
770 | + { |
|
771 | + continue; |
|
772 | + } |
|
740 | 773 | |
741 | 774 | switch ($attribute['name']) |
742 | 775 | { |
@@ -921,7 +954,10 @@ discard block |
||
921 | 954 | */ |
922 | 955 | function exportVNOTE($_noteID, $_type, $charset='UTF-8') |
923 | 956 | { |
924 | - if(!($note = $this->read($_noteID, true, 'server'))) return false; |
|
957 | + if(!($note = $this->read($_noteID, true, 'server'))) |
|
958 | + { |
|
959 | + return false; |
|
960 | + } |
|
925 | 961 | |
926 | 962 | $note = Api\Translation::convert($note, |
927 | 963 | Api\Translation::charset(), $charset); |
@@ -1023,11 +1059,20 @@ discard block |
||
1023 | 1059 | array2string($_vcalData)."\n",3,$this->logfile); |
1024 | 1060 | } |
1025 | 1061 | |
1026 | - if (!($note = $this->vnotetoegw($_vcalData, $_type, $_noteID, $charset))) return false; |
|
1062 | + if (!($note = $this->vnotetoegw($_vcalData, $_type, $_noteID, $charset))) |
|
1063 | + { |
|
1064 | + return false; |
|
1065 | + } |
|
1027 | 1066 | |
1028 | - if($_noteID > 0) $note['info_id'] = $_noteID; |
|
1067 | + if($_noteID > 0) |
|
1068 | + { |
|
1069 | + $note['info_id'] = $_noteID; |
|
1070 | + } |
|
1029 | 1071 | |
1030 | - if (empty($note['info_status'])) $note['info_status'] = 'done'; |
|
1072 | + if (empty($note['info_status'])) |
|
1073 | + { |
|
1074 | + $note['info_status'] = 'done'; |
|
1075 | + } |
|
1031 | 1076 | |
1032 | 1077 | if ($this->log) |
1033 | 1078 | { |
@@ -1051,9 +1096,15 @@ discard block |
||
1051 | 1096 | */ |
1052 | 1097 | function searchVNOTE($_vcalData, $_type, $contentID=null, $relax=false, $charset=null) |
1053 | 1098 | { |
1054 | - if (!($note = $this->vnotetoegw($_vcalData, $_type, $contentID, $charset))) return array(); |
|
1099 | + if (!($note = $this->vnotetoegw($_vcalData, $_type, $contentID, $charset))) |
|
1100 | + { |
|
1101 | + return array(); |
|
1102 | + } |
|
1055 | 1103 | |
1056 | - if ($contentID) $note['info_id'] = $contentID; |
|
1104 | + if ($contentID) |
|
1105 | + { |
|
1106 | + $note['info_id'] = $contentID; |
|
1107 | + } |
|
1057 | 1108 | |
1058 | 1109 | unset($note['info_startdate']); |
1059 | 1110 | |
@@ -1105,7 +1156,10 @@ discard block |
||
1105 | 1156 | { |
1106 | 1157 | $_data = Api\Translation::convert($_data, $charset, 'utf-8'); |
1107 | 1158 | } |
1108 | - if (!$vnote->parsevCalendar($_data, 'VCALENDAR')) return false; |
|
1159 | + if (!$vnote->parsevCalendar($_data, 'VCALENDAR')) |
|
1160 | + { |
|
1161 | + return false; |
|
1162 | + } |
|
1109 | 1163 | |
1110 | 1164 | $components = $vnote->getComponent(); |
1111 | 1165 | foreach ($components as $component) |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * @param string $_version ='2.0' |
113 | 113 | * @param string $_method =null only set for iTip messages |
114 | 114 | * @param string $charset ='UTF-8' |
115 | - * @return string|boolean string with vCal or false on error (eg. no permission to read the event) |
|
115 | + * @return false|string string with vCal or false on error (eg. no permission to read the event) |
|
116 | 116 | */ |
117 | 117 | function exportVCalendar(array $tasks, $_version='2.0', $_method=null, $charset='UTF-8') |
118 | 118 | { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @param string $charset ='UTF-8' encoding of the vcalendar, default UTF-8 |
138 | 138 | * @param Horde_Icalendar $vcal =null optional iCalendar object to add vtodo to |
139 | 139 | * |
140 | - * @return string|boolean string with vCal or false on error (eg. no permission to read the event) |
|
140 | + * @return false|string string with vCal or false on error (eg. no permission to read the event) |
|
141 | 141 | */ |
142 | 142 | function exportVTODO($task, $_version='2.0',$_method='PUBLISH', $charset='UTF-8',Horde_Icalendar $vcal=null) |
143 | 143 | { |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | * @param string $_type content type (e.g. text/plain) |
917 | 917 | * @param string $charset ='UTF-8' encoding of the vcalendar, default UTF-8 |
918 | 918 | * |
919 | - * @return string|boolean VNOTE representation of the infolog entry or false on error |
|
919 | + * @return false|string VNOTE representation of the infolog entry or false on error |
|
920 | 920 | */ |
921 | 921 | function exportVNOTE($_noteID, $_type, $charset='UTF-8') |
922 | 922 | { |
@@ -1041,8 +1041,7 @@ discard block |
||
1041 | 1041 | * Search a matching infolog entry for the VNOTE data |
1042 | 1042 | * |
1043 | 1043 | * @param string $_vcalData VNOTE |
1044 | - * @param int $contentID=null infolog_id (or null, if unkown) |
|
1045 | - * @param boolean $relax=false if true, a weaker match algorithm is used |
|
1044 | + * @param int $contentID infolog_id (or null, if unkown) |
|
1046 | 1045 | * @param string $charset The encoding charset for $text. Defaults to |
1047 | 1046 | * utf-8 for new format, iso-8859-1 for old format. |
1048 | 1047 | * |
@@ -23,10 +23,10 @@ |
||
23 | 23 | if ($setup_info['infolog']['version'] != $GLOBALS['egw_info']['apps']['infolog']['version']) |
24 | 24 | { |
25 | 25 | $GLOBALS['egw']->framework->render('<p style="text-align: center; color:red; font-weight: bold;">'.lang('Your database is NOT up to date (%1 vs. %2), please run %3setup%4 to update your database.', |
26 | - $setup_info['infolog']['version'],$GLOBALS['egw_info']['apps']['infolog']['version'], |
|
27 | - '<a href="../setup/">','</a>')."</p>\n"); |
|
26 | + $setup_info['infolog']['version'], $GLOBALS['egw_info']['apps']['infolog']['version'], |
|
27 | + '<a href="../setup/">', '</a>')."</p>\n"); |
|
28 | 28 | exit(); |
29 | 29 | } |
30 | 30 | unset($setup_info); |
31 | 31 | |
32 | -ExecMethod('infolog.infolog_ui.index','reset_action_view'); |
|
32 | +ExecMethod('infolog.infolog_ui.index', 'reset_action_view'); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | ); |
82 | 82 | |
83 | 83 | $account_display = array( |
84 | - 'firstname' => lang('Firstname'). ' '.lang('Lastname'), |
|
84 | + 'firstname' => lang('Firstname').' '.lang('Lastname'), |
|
85 | 85 | 'lastname' => lang('Lastname').', '.lang('Firstname'), |
86 | 86 | 'username' => lang('username'), |
87 | 87 | 'firstall' => lang('Firstname').' '.lang('Lastname').' ['.lang('username').']', |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $lang = setup::get_lang(); |
96 | 96 | } |
97 | 97 | if (empty($lang)) $lang = 'en'; |
98 | - list(,$country) = explode('-',$lang); |
|
98 | + list(,$country) = explode('-', $lang); |
|
99 | 99 | if (empty($country) && class_exists('Locale')) $country = Locale::getRegion(Locale::getDefault()); |
100 | 100 | if (empty($country)) $country = 'de'; |
101 | 101 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | substr($GLOBALS['egw_info']['user']['preferences']['common']['rte_font_size'], -2) == 'px') |
105 | 105 | { |
106 | 106 | $prefs = $GLOBALS['egw']->preferences; |
107 | - foreach(array('user','default','forced') as $type) |
|
107 | + foreach (array('user', 'default', 'forced') as $type) |
|
108 | 108 | { |
109 | 109 | if (substr($prefs->{$type}['common']['rte_font_size'], -2) == 'px') |
110 | 110 | { |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | 'size' => 3, |
132 | 132 | 'xmlrpc' => True, |
133 | 133 | 'admin' => False, |
134 | - 'forced' => 20, // hidden as not used in eTemplate2 |
|
134 | + 'forced' => 20, // hidden as not used in eTemplate2 |
|
135 | 135 | ), |
136 | 136 | 'template_set' => array( |
137 | 137 | 'type' => 'select', |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | 'type' => 'select', |
158 | 158 | 'label' => 'Audio effect', |
159 | 159 | 'name' => 'audio_effect', |
160 | - 'values' => array('0'=>lang('Disable'),'1'=>lang('Enable')), |
|
160 | + 'values' => array('0'=>lang('Disable'), '1'=>lang('Enable')), |
|
161 | 161 | 'help' => 'Audio effect enables|disables sound effects used in the theme', |
162 | 162 | 'xmlrpc' => True, |
163 | 163 | 'admin' => False, |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | 'type' => 'multiselect', |
279 | 279 | 'label' => 'Permanent time zone selection', |
280 | 280 | 'name' => 'tz_selection', |
281 | - 'values' => $tzs ? call_user_func_array('array_merge',$tzs) : null, // only flat arrays supported |
|
281 | + 'values' => $tzs ? call_user_func_array('array_merge', $tzs) : null, // only flat arrays supported |
|
282 | 282 | 'help' => 'Please select timezones, you want to be able to quickly switch between. Switch is NOT shown, if less then two are selected.', |
283 | 283 | 'xmlrpc' => True, |
284 | 284 | 'admin' => False, |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | 'type' => 'select', |
410 | 410 | 'label' => 'Features of the editor', |
411 | 411 | 'name' => 'rte_features', |
412 | - 'values' => array('simple'=>'simple','extended'=>'regular','advanced'=>'everything'), |
|
412 | + 'values' => array('simple'=>'simple', 'extended'=>'regular', 'advanced'=>'everything'), |
|
413 | 413 | 'help' => 'How many toolbar buttons are available', |
414 | 414 | 'admin' => false, |
415 | 415 | 'default'=> 'extended' |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | { |
431 | 431 | $account_id = (int)$data['account_id']; |
432 | 432 | |
433 | - if($account_id > 0) // user |
|
433 | + if ($account_id > 0) // user |
|
434 | 434 | { |
435 | 435 | $GLOBALS['egw']->preferences->delete_user($account_id); |
436 | 436 | } |
@@ -462,10 +462,10 @@ discard block |
||
462 | 462 | */ |
463 | 463 | static function admin($args) |
464 | 464 | { |
465 | - unset($args); // unused, but required by function signature |
|
465 | + unset($args); // unused, but required by function signature |
|
466 | 466 | $appname = 'preferences'; |
467 | 467 | $file = Array( |
468 | - 'Site configuration' => Egw::link('/index.php','menuaction=admin.admin_config.index&appname=' . $appname.'&ajax=true'), |
|
468 | + 'Site configuration' => Egw::link('/index.php', 'menuaction=admin.admin_config.index&appname='.$appname.'&ajax=true'), |
|
469 | 469 | ); |
470 | 470 | display_section($appname, $file); |
471 | 471 | } |
@@ -90,14 +90,26 @@ discard block |
||
90 | 90 | 'all' => '['.lang('username').'] '.lang('Lastname').','.lang('Firstname'), |
91 | 91 | ); |
92 | 92 | |
93 | - if ($hook_data['setup']) // called via setup |
|
93 | + if ($hook_data['setup']) |
|
94 | + { |
|
95 | + // called via setup |
|
94 | 96 | { |
95 | 97 | $lang = setup::get_lang(); |
96 | 98 | } |
97 | - if (empty($lang)) $lang = 'en'; |
|
99 | + } |
|
100 | + if (empty($lang)) |
|
101 | + { |
|
102 | + $lang = 'en'; |
|
103 | + } |
|
98 | 104 | list(,$country) = explode('-',$lang); |
99 | - if (empty($country) && class_exists('Locale')) $country = Locale::getRegion(Locale::getDefault()); |
|
100 | - if (empty($country)) $country = 'de'; |
|
105 | + if (empty($country) && class_exists('Locale')) |
|
106 | + { |
|
107 | + $country = Locale::getRegion(Locale::getDefault()); |
|
108 | + } |
|
109 | + if (empty($country)) |
|
110 | + { |
|
111 | + $country = 'de'; |
|
112 | + } |
|
101 | 113 | |
102 | 114 | // check for old rte_font_size pref including px and split it in size and unit |
103 | 115 | if (!isset($GLOBALS['egw_setup']) && |
@@ -416,7 +428,10 @@ discard block |
||
416 | 428 | ), |
417 | 429 | ); |
418 | 430 | // disable thumbnails, if no size configured by admin |
419 | - if (!$GLOBALS['egw_info']['server']['link_list_thumbnail']) unset($settings['link_list_thumbnail']); |
|
431 | + if (!$GLOBALS['egw_info']['server']['link_list_thumbnail']) |
|
432 | + { |
|
433 | + unset($settings['link_list_thumbnail']); |
|
434 | + } |
|
420 | 435 | |
421 | 436 | return $settings; |
422 | 437 | } |
@@ -430,14 +445,20 @@ discard block |
||
430 | 445 | { |
431 | 446 | $account_id = (int)$data['account_id']; |
432 | 447 | |
433 | - if($account_id > 0) // user |
|
448 | + if($account_id > 0) |
|
449 | + { |
|
450 | + // user |
|
434 | 451 | { |
435 | 452 | $GLOBALS['egw']->preferences->delete_user($account_id); |
436 | 453 | } |
437 | - elseif ($account_id < 0) // group |
|
454 | + } |
|
455 | + elseif ($account_id < 0) |
|
456 | + { |
|
457 | + // group |
|
438 | 458 | { |
439 | 459 | $GLOBALS['egw']->preferences->delete_group($account_id); |
440 | 460 | } |
461 | + } |
|
441 | 462 | } |
442 | 463 | |
443 | 464 | /** |
@@ -464,7 +464,7 @@ |
||
464 | 464 | { |
465 | 465 | unset($args); // unused, but required by function signature |
466 | 466 | $appname = 'preferences'; |
467 | - $file = Array( |
|
467 | + $file = array( |
|
468 | 468 | 'Site configuration' => Egw::link('/index.php','menuaction=admin.admin_config.index&appname=' . $appname.'&ajax=true'), |
469 | 469 | ); |
470 | 470 | display_section($appname, $file); |