Completed
Push — master ( aa44e9...fa84e5 )
by Ralf
90:14 queued 73:21
created
timesheet/setup/tables_update.inc.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 function timesheet_upgrade0_1_001()
17 17
 {
18
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_timesheet','pl_id',array(
18
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_timesheet', 'pl_id', array(
19 19
 		'type' => 'int',
20 20
 		'precision' => '4',
21 21
 		'default' => '0'
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 
28 28
 function timesheet_upgrade0_2_001()
29 29
 {
30
-	$GLOBALS['egw_setup']->oProc->CreateTable('egw_timesheet_extra',array(
30
+	$GLOBALS['egw_setup']->oProc->CreateTable('egw_timesheet_extra', array(
31 31
 		'fd' => array(
32
-			'ts_id' => array('type' => 'int','precision' => '4','nullable' => False),
33
-			'ts_extra_name' => array('type' => 'varchar','precision' => '32','nullable' => False),
34
-			'ts_extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '')
32
+			'ts_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
33
+			'ts_extra_name' => array('type' => 'varchar', 'precision' => '32', 'nullable' => False),
34
+			'ts_extra_value' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '')
35 35
 		),
36
-		'pk' => array('ts_id','ts_extra_name'),
36
+		'pk' => array('ts_id', 'ts_extra_name'),
37 37
 		'fk' => array(),
38 38
 		'ix' => array(),
39 39
 		'uc' => array()
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 function timesheet_upgrade1_4()
53 53
 {
54 54
 	// delete empty cf's generated by 1.4
55
-	$GLOBALS['egw_setup']->db->delete('egw_timesheet_extra',"ts_extra_value=''",__LINE__,__FILE__,'timesheet');
55
+	$GLOBALS['egw_setup']->db->delete('egw_timesheet_extra', "ts_extra_value=''", __LINE__, __FILE__, 'timesheet');
56 56
 
57 57
 	return $GLOBALS['setup_info']['timesheet']['currentver'] = '1.6';
58 58
 }
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
 
61 61
 function timesheet_upgrade1_6()
62 62
 {
63
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_timesheet','ts_status',array(
63
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_timesheet', 'ts_status', array(
64 64
 		'type' => 'int',
65 65
 		'precision' => '4'
66 66
 	));
67 67
 
68
-	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_timesheet','ts_status');
68
+	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_timesheet', 'ts_status');
69 69
 
70 70
 	return $GLOBALS['setup_info']['timesheet']['currentver'] = '1.7.001';
71 71
 }
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
  */
93 93
 function timesheet_upgrade1_9_001()
94 94
 {
95
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet','ts_project',array(
95
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet', 'ts_project', array(
96 96
 		'type' => 'varchar',
97 97
 		'precision' => '255',
98 98
 		'comment' => 'project title'
99 99
 	));
100
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet','ts_title',array(
100
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet', 'ts_title', array(
101 101
 		'type' => 'varchar',
102 102
 		'precision' => '255',
103 103
 		'nullable' => False,
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	// returns NULL, if there are no rows!
109 109
 	if ((int)$max_description_length <= 16384 && $GLOBALS['egw_setup']->oProc->max_varchar_length >= 16384)
110 110
 	{
111
-		$GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet','ts_description',array(
111
+		$GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet', 'ts_description', array(
112 112
 			'type' => 'varchar',
113 113
 			'precision' => '16384',
114 114
 			'comment' => 'description of the timesheet entry'
Please login to merge, or discard this patch.
timesheet/setup/default_records.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @version $Id$
10 10
  */
11 11
 
12
-foreach(array(
12
+foreach (array(
13 13
 	'history'     => 'history',
14 14
 ) as $name => $value)
15 15
 {
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
 			'config_app' => 'timesheet',
20 20
 			'config_name' => $name,
21 21
 			'config_value' => $value,
22
-		),array(
22
+		), array(
23 23
 			'config_app' => 'timesheet',
24 24
 			'config_name' => $name,
25
-		),__LINE__,__FILE__
25
+		), __LINE__, __FILE__
26 26
 	);
27 27
 }
28 28
 
Please login to merge, or discard this patch.
timesheet/inc/class.timesheet_egw_record.inc.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 	// Used in conversions
28 28
 	static $types = array(
29
-		'select-account' => array('ts_owner','ts_modifier'),
29
+		'select-account' => array('ts_owner', 'ts_modifier'),
30 30
 		'date-time' => array('ts_start', 'ts_modified'),
31 31
 		'select-cat' => array('cat_id'),
32 32
 		'links' => array('pl_id'),
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @param string $_identifier
43 43
 	 */
44
-	public function __construct( $_identifier='' ){
44
+	public function __construct($_identifier = '') {
45 45
 		$this->identifier = $_identifier;
46 46
 		$this->botimesheet = new timesheet_bo();
47 47
 		$data = $this->botimesheet->read($this->identifier);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 //		if (empty($this->timesheetentry)) {
93 93
 //			$this->get_record();
94 94
 //		}
95
-		return $this->timesheetentry['ts_project'] . ' - ' . $this->timesheetentry['ts_title'];
95
+		return $this->timesheetentry['ts_project'].' - '.$this->timesheetentry['ts_title'];
96 96
 	}
97 97
 
98 98
 	/**
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
 	 * @todo add some checks
102 102
 	 * @return void
103 103
 	 */
104
-	public function set_record(array $_record){
104
+	public function set_record(array $_record) {
105 105
 		$this->timesheetentry = $_record;
106 106
 		// Check for linked project ID
107
-		if($this->timesheetentry['ts_project']) {
107
+		if ($this->timesheetentry['ts_project']) {
108 108
 			$links = Link::get_links('timesheet', $_record['ts_id'], 'projectmanager');
109
-			foreach($links as $app_id) {
109
+			foreach ($links as $app_id) {
110 110
 				$this->timesheetentry['pm_id'] = $app_id;
111 111
 				break;
112 112
 			}
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 *
138 138
 	 * @return string identifier
139 139
 	 */
140
-	public function save ( $_dst_identifier ) {
140
+	public function save($_dst_identifier) {
141 141
 		unset($_dst_identifier);
142 142
 	}
143 143
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 * @param string $_dst_identifier
148 148
 	 * @return string dst_identifier
149 149
 	 */
150
-	public function copy ( $_dst_identifier ) {
150
+	public function copy($_dst_identifier) {
151 151
 		unset($_dst_identifier);
152 152
 	}
153 153
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @param string $_dst_identifier
159 159
 	 * @return string dst_identifier
160 160
 	 */
161
-	public function move ( $_dst_identifier ) {
161
+	public function move($_dst_identifier) {
162 162
 		unset($_dst_identifier);
163 163
 	}
164 164
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 * delets current record from backend
167 167
 	 *
168 168
 	 */
169
-	public function delete () {
169
+	public function delete() {
170 170
 
171 171
 	}
172 172
 
Please login to merge, or discard this patch.
Braces   +32 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,12 +41,16 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @param string $_identifier
43 43
 	 */
44
-	public function __construct( $_identifier='' ){
44
+	public function __construct( $_identifier='' )
45
+	{
45 46
 		$this->identifier = $_identifier;
46 47
 		$this->botimesheet = new timesheet_bo();
47 48
 		$data = $this->botimesheet->read($this->identifier);
48 49
 		// set ts_project from ts_project_blur, where it get moved, if it is no custom value
49
-		if (empty($data['ts_project'])) $data['ts_project'] = $data['ts_project_blur'];
50
+		if (empty($data['ts_project']))
51
+		{
52
+			$data['ts_project'] = $data['ts_project_blur'];
53
+		}
50 54
 		$this->set_record($data);
51 55
 	}
52 56
 
@@ -55,7 +59,8 @@  discard block
 block discarded – undo
55 59
 	 *
56 60
 	 * @param string $_attribute_name
57 61
 	 */
58
-	public function __get($_attribute_name) {
62
+	public function __get($_attribute_name)
63
+	{
59 64
 		return $this->timesheetentry[$_attribute_name];
60 65
 	}
61 66
 
@@ -65,7 +70,8 @@  discard block
 block discarded – undo
65 70
 	 * @param string $_attribute_name
66 71
 	 * @param data $data
67 72
 	 */
68
-	public function __set($_attribute_name, $data) {
73
+	public function __set($_attribute_name, $data)
74
+	{
69 75
 		$this->timesheetentry[$_attribute_name] = $data;
70 76
 	}
71 77
 
@@ -77,7 +83,8 @@  discard block
 block discarded – undo
77 83
 	 *
78 84
 	 * @return array complete record as associative array
79 85
 	 */
80
-	public function get_record_array() {
86
+	public function get_record_array()
87
+	{
81 88
 		return $this->timesheetentry;
82 89
 	}
83 90
 
@@ -101,12 +108,15 @@  discard block
 block discarded – undo
101 108
 	 * @todo add some checks
102 109
 	 * @return void
103 110
 	 */
104
-	public function set_record(array $_record){
111
+	public function set_record(array $_record)
112
+	{
105 113
 		$this->timesheetentry = $_record;
106 114
 		// Check for linked project ID
107
-		if($this->timesheetentry['ts_project']) {
115
+		if($this->timesheetentry['ts_project'])
116
+		{
108 117
 			$links = Link::get_links('timesheet', $_record['ts_id'], 'projectmanager');
109
-			foreach($links as $app_id) {
118
+			foreach($links as $app_id)
119
+			{
110 120
 				$this->timesheetentry['pm_id'] = $app_id;
111 121
 				break;
112 122
 			}
@@ -118,7 +128,8 @@  discard block
 block discarded – undo
118 128
 	 *
119 129
 	 * @return string identifier of current record
120 130
 	 */
121
-	public function get_identifier() {
131
+	public function get_identifier()
132
+	{
122 133
 		return $this->identifier;
123 134
 	}
124 135
 
@@ -128,7 +139,8 @@  discard block
 block discarded – undo
128 139
 	 *
129 140
 	 * @return string Full URL of an icon, or appname/icon_name
130 141
 	 */
131
-	public function get_icon() {
142
+	public function get_icon()
143
+	{
132 144
 		return 'timesheet/navbar';
133 145
 	}
134 146
 
@@ -137,7 +149,8 @@  discard block
 block discarded – undo
137 149
 	 *
138 150
 	 * @return string identifier
139 151
 	 */
140
-	public function save ( $_dst_identifier ) {
152
+	public function save ( $_dst_identifier )
153
+	{
141 154
 		unset($_dst_identifier);
142 155
 	}
143 156
 
@@ -147,7 +160,8 @@  discard block
 block discarded – undo
147 160
 	 * @param string $_dst_identifier
148 161
 	 * @return string dst_identifier
149 162
 	 */
150
-	public function copy ( $_dst_identifier ) {
163
+	public function copy ( $_dst_identifier )
164
+	{
151 165
 		unset($_dst_identifier);
152 166
 	}
153 167
 
@@ -158,7 +172,8 @@  discard block
 block discarded – undo
158 172
 	 * @param string $_dst_identifier
159 173
 	 * @return string dst_identifier
160 174
 	 */
161
-	public function move ( $_dst_identifier ) {
175
+	public function move ( $_dst_identifier )
176
+	{
162 177
 		unset($_dst_identifier);
163 178
 	}
164 179
 
@@ -166,7 +181,8 @@  discard block
 block discarded – undo
166 181
 	 * delets current record from backend
167 182
 	 *
168 183
 	 */
169
-	public function delete () {
184
+	public function delete ()
185
+	{
170 186
 
171 187
 	}
172 188
 
@@ -174,7 +190,8 @@  discard block
 block discarded – undo
174 190
 	 * destructor
175 191
 	 *
176 192
 	 */
177
-	public function __destruct() {
193
+	public function __destruct()
194
+	{
178 195
 		unset ($this->botimesheet);
179 196
 	}
180 197
 
Please login to merge, or discard this patch.
timesheet/inc/class.timesheet_wizard_import_csv.inc.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 		$this->mapping_fields = array('ts_id' => lang('Timesheet ID')) + $bo->field2label;
36 36
 
37 37
 		// These aren't in the list
38
-                $this->mapping_fields += array(
39
-                        'ts_modified'   => lang('Modified'),
40
-                );
38
+				$this->mapping_fields += array(
39
+						'ts_modified'   => lang('Modified'),
40
+				);
41 41
 
42 42
 		// List each custom field
43 43
 		unset($this->mapping_fields['customfields']);
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 				);
114 114
 			}
115 115
 			$sel_options = array(
116
-                                'translate_status'	=> $options + array($set_to => $ui->status_labels),
117
-                                'translate_cat_id'	=> $options + array($set_to => $cat_list),
118
-                        );
116
+								'translate_status'	=> $options + array($set_to => $ui->status_labels),
117
+								'translate_cat_id'	=> $options + array($set_to => $cat_list),
118
+						);
119 119
 			$preserv = $content;
120 120
 			foreach($sel_options as $field => $options) {
121 121
 				if(!array_key_exists($field,$content)) $content[$field] = $content['plugin_options'][$field];
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		// List each custom field
43 43
 		unset($this->mapping_fields['customfields']);
44 44
 		$custom = Api\Storage\Customfields::get('timesheet');
45
-		foreach($custom as $name => $data) {
45
+		foreach ($custom as $name => $data) {
46 46
 			$this->mapping_fields['#'.$name] = $data['label'];
47 47
 		}
48 48
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 	function wizard_step45(&$content, &$sel_options, &$readonlys, &$preserv)
74 74
 	{
75
-		if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true));
75
+		if ($this->debug) error_log(__METHOD__.'->$content '.print_r($content, true));
76 76
 
77 77
 		// return from step45
78 78
 		if ($content['step'] == 'wizard_step45')
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
 			switch (array_search('pressed', $content['button']))
81 81
 			{
82 82
 				case 'next':
83
-					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1);
83
+					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], 1);
84 84
 				case 'previous' :
85
-					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1);
85
+					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], -1);
86 86
 				case 'finish':
87 87
 					return 'wizard_finish';
88 88
 				default :
89
-					return $this->wizard_step45($content,$sel_options,$readonlys,$preserv);
89
+					return $this->wizard_step45($content, $sel_options, $readonlys, $preserv);
90 90
 			}
91 91
 		}
92 92
 		// init step45
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
 				'~skip~' => lang('Skip record'),
102 102
 				'add' => lang('Add'),
103 103
 			);
104
-			$set_to = lang('Set to') . ':';
105
-			$categories = new Api\Categories('','timesheet');
104
+			$set_to = lang('Set to').':';
105
+			$categories = new Api\Categories('', 'timesheet');
106 106
 			$cat_list = array();
107
-			foreach((array)$categories->return_sorted_array(0,False,'','','',true) as $cat) {
108
-				$s = str_repeat('&nbsp;',$cat['level']) . stripslashes($cat['name']);
107
+			foreach ((array)$categories->return_sorted_array(0, False, '', '', '', true) as $cat) {
108
+				$s = str_repeat('&nbsp;', $cat['level']).stripslashes($cat['name']);
109 109
 
110 110
 				$cat_list[$cat['id']] = empty($cat['description']) ? $s : array(
111 111
 					'label' => $s,
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
                                 'translate_cat_id'	=> $options + array($set_to => $cat_list),
118 118
                         );
119 119
 			$preserv = $content;
120
-			foreach($sel_options as $field => $options) {
121
-				if(!array_key_exists($field,$content)) $content[$field] = $content['plugin_options'][$field];
120
+			foreach ($sel_options as $field => $options) {
121
+				if (!array_key_exists($field, $content)) $content[$field] = $content['plugin_options'][$field];
122 122
 			}
123 123
 			unset ($preserv['button']);
124 124
 			return $this->step_templates['wizard_step45'];
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	
135 135
 	function wizard_step60(&$content, &$sel_options, &$readonlys, &$preserv)
136 136
 	{
137
-		if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true));
137
+		if ($this->debug) error_log(__METHOD__.'->$content '.print_r($content, true));
138 138
 		unset($content['no_owner_map']);
139 139
 
140 140
 		// return from step60
@@ -143,13 +143,13 @@  discard block
 block discarded – undo
143 143
 			switch (array_search('pressed', $content['button']))
144 144
 			{
145 145
 				case 'next':
146
-					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1);
146
+					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], 1);
147 147
 				case 'previous' :
148
-					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1);
148
+					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], -1);
149 149
 				case 'finish':
150 150
 					return 'wizard_finish';
151 151
 				default :
152
-					return $this->wizard_step60($content,$sel_options,$readonlys,$preserv);
152
+					return $this->wizard_step60($content, $sel_options, $readonlys, $preserv);
153 153
 			}
154 154
 		}
155 155
 		// init step60
@@ -158,17 +158,17 @@  discard block
 block discarded – undo
158 158
 			$content['msg'] = $this->steps['wizard_step60'];
159 159
 			$content['step'] = 'wizard_step60';
160 160
 			$preserv = $content;
161
-			if(!array_key_exists($content['record_owner']) && $content['plugin_options']) {
161
+			if (!array_key_exists($content['record_owner']) && $content['plugin_options']) {
162 162
 				$content['record_owner'] = $content['plugin_options']['record_owner'];
163 163
 			}
164
-			if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) {
164
+			if (!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) {
165 165
 				$content['owner_from_csv'] = $content['plugin_options']['owner_from_csv'];
166 166
 			}
167
-			if(!array_key_exists($content['change_owner']) && $content['plugin_options']) {
167
+			if (!array_key_exists($content['change_owner']) && $content['plugin_options']) {
168 168
 				$content['change_owner'] = $content['plugin_options']['change_owner'];
169 169
 			}
170 170
 
171
-			if(!in_array('ts_owner', $content['field_mapping'])) {
171
+			if (!in_array('ts_owner', $content['field_mapping'])) {
172 172
 				$content['no_owner_map'] = true;
173 173
 			}
174 174
 
Please login to merge, or discard this patch.
Braces   +26 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@  discard block
 block discarded – undo
42 42
 		// List each custom field
43 43
 		unset($this->mapping_fields['customfields']);
44 44
 		$custom = Api\Storage\Customfields::get('timesheet');
45
-		foreach($custom as $name => $data) {
45
+		foreach($custom as $name => $data)
46
+		{
46 47
 			$this->mapping_fields['#'.$name] = $data['label'];
47 48
 		}
48 49
 
@@ -72,7 +73,10 @@  discard block
 block discarded – undo
72 73
 
73 74
 	function wizard_step45(&$content, &$sel_options, &$readonlys, &$preserv)
74 75
 	{
75
-		if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true));
76
+		if($this->debug)
77
+		{
78
+			error_log(__METHOD__.'->$content '.print_r($content,true));
79
+		}
76 80
 
77 81
 		// return from step45
78 82
 		if ($content['step'] == 'wizard_step45')
@@ -104,7 +108,8 @@  discard block
 block discarded – undo
104 108
 			$set_to = lang('Set to') . ':';
105 109
 			$categories = new Api\Categories('','timesheet');
106 110
 			$cat_list = array();
107
-			foreach((array)$categories->return_sorted_array(0,False,'','','',true) as $cat) {
111
+			foreach((array)$categories->return_sorted_array(0,False,'','','',true) as $cat)
112
+			{
108 113
 				$s = str_repeat('&nbsp;',$cat['level']) . stripslashes($cat['name']);
109 114
 
110 115
 				$cat_list[$cat['id']] = empty($cat['description']) ? $s : array(
@@ -117,8 +122,12 @@  discard block
 block discarded – undo
117 122
                                 'translate_cat_id'	=> $options + array($set_to => $cat_list),
118 123
                         );
119 124
 			$preserv = $content;
120
-			foreach($sel_options as $field => $options) {
121
-				if(!array_key_exists($field,$content)) $content[$field] = $content['plugin_options'][$field];
125
+			foreach($sel_options as $field => $options)
126
+			{
127
+				if(!array_key_exists($field,$content))
128
+				{
129
+					$content[$field] = $content['plugin_options'][$field];
130
+				}
122 131
 			}
123 132
 			unset ($preserv['button']);
124 133
 			return $this->step_templates['wizard_step45'];
@@ -134,7 +143,10 @@  discard block
 block discarded – undo
134 143
 	
135 144
 	function wizard_step60(&$content, &$sel_options, &$readonlys, &$preserv)
136 145
 	{
137
-		if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true));
146
+		if($this->debug)
147
+		{
148
+			error_log(__METHOD__.'->$content '.print_r($content,true));
149
+		}
138 150
 		unset($content['no_owner_map']);
139 151
 
140 152
 		// return from step60
@@ -158,17 +170,21 @@  discard block
 block discarded – undo
158 170
 			$content['msg'] = $this->steps['wizard_step60'];
159 171
 			$content['step'] = 'wizard_step60';
160 172
 			$preserv = $content;
161
-			if(!array_key_exists($content['record_owner']) && $content['plugin_options']) {
173
+			if(!array_key_exists($content['record_owner']) && $content['plugin_options'])
174
+			{
162 175
 				$content['record_owner'] = $content['plugin_options']['record_owner'];
163 176
 			}
164
-			if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) {
177
+			if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options'])
178
+			{
165 179
 				$content['owner_from_csv'] = $content['plugin_options']['owner_from_csv'];
166 180
 			}
167
-			if(!array_key_exists($content['change_owner']) && $content['plugin_options']) {
181
+			if(!array_key_exists($content['change_owner']) && $content['plugin_options'])
182
+			{
168 183
 				$content['change_owner'] = $content['plugin_options']['change_owner'];
169 184
 			}
170 185
 
171
-			if(!in_array('ts_owner', $content['field_mapping'])) {
186
+			if(!in_array('ts_owner', $content['field_mapping']))
187
+			{
172 188
 				$content['no_owner_map'] = true;
173 189
 			}
174 190
 
Please login to merge, or discard this patch.
timesheet/inc/class.timesheet_hooks.inc.php 3 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 if (!defined('TIMESHEET_APP'))
20 20
 {
21
-	define('TIMESHEET_APP','timesheet');
21
+	define('TIMESHEET_APP', 'timesheet');
22 22
 }
23 23
 
24 24
 /**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	static function search_link($location)
44 44
 	{
45
-		unset($location);	// not used, but required by function signature
45
+		unset($location); // not used, but required by function signature
46 46
 
47 47
 		return array(
48 48
 			'query' => TIMESHEET_APP.'.timesheet_bo.link_query',
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 			'add_id'     => 'link_id',
65 65
 			'add_popup'  => '630x480',
66 66
 			'file_access'=> TIMESHEET_APP.'.timesheet_bo.file_access',
67
-			'file_access_user' => true,	// file_access supports 4th parameter $user
67
+			'file_access_user' => true, // file_access supports 4th parameter $user
68 68
 			'notify'     => TIMESHEET_APP.'.timesheet_bo.notify',
69 69
 			'merge' => true,
70 70
 		);
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	static function cumulate($param)
82 82
 	{
83
-		$links = Link::get_3links(TIMESHEET_APP,'projectmanager',$param['pm_id']);
83
+		$links = Link::get_3links(TIMESHEET_APP, 'projectmanager', $param['pm_id']);
84 84
 
85 85
 		$rows = array();
86
-		foreach($links as $link)
86
+		foreach ($links as $link)
87 87
 		{
88 88
 			$rows[$link['id']] = array(
89 89
 				'pm_id'       => $link['id2'],
@@ -115,37 +115,37 @@  discard block
 block discarded – undo
115 115
 			display_sidebox($appname, lang('Favorites'), Framework\Favorites::list_favorites($appname));
116 116
 
117 117
 			$file = array(
118
-				'Timesheet list' => Egw::link('/index.php',array(
118
+				'Timesheet list' => Egw::link('/index.php', array(
119 119
 					'menuaction' => 'timesheet.timesheet_ui.index',
120 120
 					'ajax' => 'true')),
121 121
 				array(
122
-					'text' => lang('Add %1',lang(Link::get_registry($appname, 'entry'))),
122
+					'text' => lang('Add %1', lang(Link::get_registry($appname, 'entry'))),
123 123
 					'no_lang' => true,
124 124
 					'link' => "javascript:egw.open('','$appname','add')"
125 125
 				),
126 126
 			);
127
-			$file['Placeholders'] = Egw::link('/index.php','menuaction=timesheet.timesheet_merge.show_replacements');
128
-			display_sidebox($appname,$GLOBALS['egw_info']['apps'][$appname]['title'].' '.lang('Menu'),$file);
127
+			$file['Placeholders'] = Egw::link('/index.php', 'menuaction=timesheet.timesheet_merge.show_replacements');
128
+			display_sidebox($appname, $GLOBALS['egw_info']['apps'][$appname]['title'].' '.lang('Menu'), $file);
129 129
 		}
130 130
 
131 131
 		if ($GLOBALS['egw_info']['user']['apps']['admin'])
132 132
 		{
133 133
 			$file = Array(
134
-				'Site Configuration' => Egw::link('/index.php','menuaction=admin.admin_config.index&appname=' . $appname,'&ajax=true'),
135
-				'Custom fields' => Egw::link('/index.php','menuaction=admin.customfields.index&appname='.$appname.'&use_private=1'),
136
-				'Global Categories'  => Egw::link('/index.php',array(
134
+				'Site Configuration' => Egw::link('/index.php', 'menuaction=admin.admin_config.index&appname='.$appname, '&ajax=true'),
135
+				'Custom fields' => Egw::link('/index.php', 'menuaction=admin.customfields.index&appname='.$appname.'&use_private=1'),
136
+				'Global Categories'  => Egw::link('/index.php', array(
137 137
 					'menuaction' => 'admin.admin_categories.index',
138 138
 					'appname'    => $appname,
139 139
 					'global_cats'=> True)),
140
-				'Edit Status' => Egw::link('/index.php','menuaction=timesheet.timesheet_ui.editstatus'),
140
+				'Edit Status' => Egw::link('/index.php', 'menuaction=timesheet.timesheet_ui.editstatus'),
141 141
 			);
142 142
 			if ($location == 'admin')
143 143
 			{
144
-				display_section($appname,$file);
144
+				display_section($appname, $file);
145 145
 			}
146 146
 			else
147 147
 			{
148
-				display_sidebox($appname,lang('Admin'),$file);
148
+				display_sidebox($appname, lang('Admin'), $file);
149 149
 			}
150 150
 		}
151 151
 	}
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 				'size'   => 60,
179 179
 				'label'  => 'Default document to insert entries',
180 180
 				'name'   => 'default_document',
181
-				'help'   => lang('If you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. That icon allows to download the specified document with the data inserted.',lang('timesheet')).' '.
181
+				'help'   => lang('If you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. That icon allows to download the specified document with the data inserted.', lang('timesheet')).' '.
182 182
 					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'ts_title').' '.
183
-					lang('The following document-types are supported:'). implode(',',Api\Storage\Merge::get_file_extensions()),
183
+					lang('The following document-types are supported:').implode(',', Api\Storage\Merge::get_file_extensions()),
184 184
 				'run_lang' => false,
185 185
 				'xmlrpc' => True,
186 186
 				'admin'  => False,
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 				'label'  => 'Directory with documents to insert entries',
192 192
 				'name'   => 'document_dir',
193 193
 				'help'   => lang('If you specify a directory (full vfs path) here, %1 displays an action for each document. That action allows to download the specified document with the %1 data inserted.', lang('timesheet')).' '.
194
-					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','ts_title').' '.
195
-					lang('The following document-types are supported:'). implode(',',Api\Storage\Merge::get_file_extensions()),
194
+					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'ts_title').' '.
195
+					lang('The following document-types are supported:').implode(',', Api\Storage\Merge::get_file_extensions()),
196 196
 				'run_lang' => false,
197 197
 				'xmlrpc' => True,
198 198
 				'admin'  => False,
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	 */
252 252
 	public static function acl_rights($params)
253 253
 	{
254
-		unset($params);	// not used, but required by function signature
254
+		unset($params); // not used, but required by function signature
255 255
 
256 256
 		return array(
257 257
 			Acl::READ    => 'read',
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 */
269 269
 	public static function categories($data)
270 270
 	{
271
-		unset($data);	// not used, but required by function signature
271
+		unset($data); // not used, but required by function signature
272 272
 
273 273
 		return true;
274 274
 	}
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,10 @@
 block discarded – undo
156 156
 	static function settings()
157 157
 	{
158 158
 		$settings = array();
159
-		if (is_null(self::$timesheet_bo)) self::$timesheet_bo = new timesheet_bo();
159
+		if (is_null(self::$timesheet_bo))
160
+		{
161
+			self::$timesheet_bo = new timesheet_bo();
162
+		}
160 163
 		if (self::$timesheet_bo->status_labels)
161 164
 		{
162 165
 			$settings['predefined_status'] = array(
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 
109 109
 		if ($GLOBALS['egw_info']['user']['apps']['admin'] && !Api\Header\UserAgent::mobile())
110 110
 		{
111
-			$file = Array(
111
+			$file = array(
112 112
 				'Site configuration' => Egw::link('/index.php',array(
113 113
 					'menuaction' => 'infolog.infolog_ui.admin' )),
114 114
 				'Global Categories'  => Egw::link('/index.php',array(
Please login to merge, or discard this patch.
timesheet/inc/class.timesheet_tracking.inc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 
74 74
 		//set fields for tracking
75 75
 		$this->field2history = array_keys($this->bo->db_cols);
76
-		$this->field2history = array_diff(array_combine($this->field2history,$this->field2history),array('ts_modified'));
77
-		$this->field2history += array('customfields'   => '#c');	// to display old customfield data in history
76
+		$this->field2history = array_diff(array_combine($this->field2history, $this->field2history), array('ts_modified'));
77
+		$this->field2history += array('customfields'   => '#c'); // to display old customfield data in history
78 78
 
79 79
 		// custom fields are now handled by parent::__construct('tracker')
80 80
 		parent::__construct('timesheet');
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 * @param array $old =null old/last state of the entry or null for a new entry
92 92
 	 * @return mixed
93 93
 	 */
94
-	function get_config($name,$data,$old=null)
94
+	function get_config($name, $data, $old = null)
95 95
 	{
96 96
 		$timesheet = $data['ts_id'];
97 97
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * @param array $old
110 110
 	 * @return string
111 111
 	 */
112
-	function get_subject($data,$old)
112
+	function get_subject($data, $old)
113 113
 	{
114 114
 		return '#'.$data['ts_id'].' - '.$data['ts_title'];
115 115
 	}
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 * @param array $old
122 122
 	 * @return string
123 123
 	 */
124
-	function get_message($data,$old)
124
+	function get_message($data, $old)
125 125
 	{
126 126
 		if (!$data['ts_modified'] || !$old)
127 127
 		{
Please login to merge, or discard this patch.
timesheet/inc/class.timesheet_merge.inc.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -70,23 +70,23 @@  discard block
 block discarded – undo
70 70
 	 * @param string &$content=null content to create some replacements only if they are use
71 71
 	 * @return array|boolean
72 72
 	 */
73
-	protected function get_replacements($id,&$content=null)
73
+	protected function get_replacements($id, &$content = null)
74 74
 	{
75 75
 		if (!($replacements = $this->timesheet_replacements($id, '', $content)))
76 76
 		{
77 77
 			return false;
78 78
 		}
79
-		if (!(strpos($content,'$$ts_project/') === false))
79
+		if (!(strpos($content, '$$ts_project/') === false))
80 80
 		{
81 81
 			// Check to see if it's actually a project, then load
82
-			if($replacements['$$pm_id$$'])
82
+			if ($replacements['$$pm_id$$'])
83 83
 			{
84
-				if(!$this->pm)
84
+				if (!$this->pm)
85 85
 				{
86 86
 					$this->pm = new projectmanager_merge();
87 87
 				}
88 88
 				$this->pm->projectmanager_bo = new projectmanager_bo($replacements['$$pm_id$$']);
89
-				$replacements += $this->pm->projectmanager_replacements($replacements['$$pm_id$$'],'ts_project');
89
+				$replacements += $this->pm->projectmanager_replacements($replacements['$$pm_id$$'], 'ts_project');
90 90
 			}
91 91
 		}
92 92
 		return $replacements;
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
 	 * @param string $prefix='' prefix like eg. 'erole'
100 100
 	 * @return array|boolean
101 101
 	 */
102
-	public function timesheet_replacements($id,$prefix='', &$content = null)
102
+	public function timesheet_replacements($id, $prefix = '', &$content = null)
103 103
 	{
104 104
 		$record = new timesheet_egw_record($id);
105 105
 		$info = array();
106 106
 
107 107
 		// Get project manager ID
108
-		$links = Link\Storage::get_links('timesheet',$id,'projectmanager');
109
-		if($links)
108
+		$links = Link\Storage::get_links('timesheet', $id, 'projectmanager');
109
+		if ($links)
110 110
 		{
111 111
 			$record->pm_id = current($links);
112 112
 		}
@@ -114,15 +114,15 @@  discard block
 block discarded – undo
114 114
 		// Convert to human friendly values
115 115
 		$types = timesheet_egw_record::$types;
116 116
 		$_selects = array('status' => $this->bo->status_labels);
117
-		foreach($_selects['status'] as &$status)
117
+		foreach ($_selects['status'] as &$status)
118 118
 		{
119 119
 			$status = str_replace('&nbsp;', '', $status);
120 120
 		}
121
-		foreach($_selects as $name => $value)
121
+		foreach ($_selects as $name => $value)
122 122
 		{
123 123
 			$selects['ts_'.$name] = $value;
124 124
 		}
125
-		if($content && strpos($content, '#') !== 0)
125
+		if ($content && strpos($content, '#') !== 0)
126 126
 		{
127 127
 			$this->cf_link_to_expand($record->get_record_array(), $content, $info);
128 128
 		}
@@ -131,25 +131,25 @@  discard block
 block discarded – undo
131 131
 
132 132
 		$array = $record->get_record_array();
133 133
 		$array['ts_total'] = $array['ts_quantity'] * $array['ts_unitprice'];
134
-		foreach(array('ts_duration','ts_quantity','ts_unitprice','ts_total') as $key)
134
+		foreach (array('ts_duration', 'ts_quantity', 'ts_unitprice', 'ts_total') as $key)
135 135
 		{
136
-			$array[$key] = self::number_format($array[$key],2,$this->mimetype);
136
+			$array[$key] = self::number_format($array[$key], 2, $this->mimetype);
137 137
 		}
138 138
 
139 139
 		// Set any missing custom fields, or the marker will stay
140
-		foreach(array_keys($this->bo->customfields) as $name)
140
+		foreach (array_keys($this->bo->customfields) as $name)
141 141
 		{
142
-			if(!$array['#'.$name]) $array['#'.$name] = '';
142
+			if (!$array['#'.$name]) $array['#'.$name] = '';
143 143
 		}
144 144
 
145 145
 		// Links
146 146
 		$array += $this->get_all_links('timesheet', $id, $prefix, $content);
147 147
 
148 148
 		// Add markers
149
-		foreach($array as $key => &$value)
149
+		foreach ($array as $key => &$value)
150 150
 		{
151
-			if(!$value) $value = '';
152
-			$info['$$'.($prefix ? $prefix.'/':'').$key.'$$'] = $value;
151
+			if (!$value) $value = '';
152
+			$info['$$'.($prefix ? $prefix.'/' : '').$key.'$$'] = $value;
153 153
 		}
154 154
 		return $info;
155 155
 	}
@@ -169,11 +169,11 @@  discard block
 block discarded – undo
169 169
 
170 170
 		$n = 0;
171 171
 		$fields = array('ts_id' => lang('Timesheet ID')) + $this->bo->field2label + array('ts_total' => lang('total'));
172
-		foreach($fields as $name => $label)
172
+		foreach ($fields as $name => $label)
173 173
 		{
174
-			if (in_array($name,array('pl_id','customfields'))) continue;	// dont show them
174
+			if (in_array($name, array('pl_id', 'customfields'))) continue; // dont show them
175 175
 
176
-			if (in_array($name,array('ts_title', 'ts_description')) && $n&1)		// main values, which should be in the first column
176
+			if (in_array($name, array('ts_title', 'ts_description')) && $n&1)		// main values, which should be in the first column
177 177
 			{
178 178
 				echo "</tr>\n";
179 179
 				$n++;
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		}
186 186
 
187 187
 		echo '<tr><td colspan="4"><h3>'.lang('Custom fields').":</h3></td></tr>";
188
-		foreach($this->bo->customfields as $name => $field)
188
+		foreach ($this->bo->customfields as $name => $field)
189 189
 		{
190 190
 			echo '<tr><td>{{#'.$name.'}}</td><td colspan="3">'.$field['label']."</td></tr>\n";
191 191
 		}
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		echo '<tr><td colspan="4"><h3>'.lang('Project fields').':</h3></td></tr>';
194 194
 		$pm_merge = new projectmanager_merge();
195 195
 		$i = 0;
196
-		foreach($pm_merge->projectmanager_fields as $name => $label)
196
+		foreach ($pm_merge->projectmanager_fields as $name => $label)
197 197
 		{
198 198
 			if (!($i&1)) echo '<tr>';
199 199
 			echo '<td>{{ts_project/'.$name.'}}</td><td>'.$label.'</td>';
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		}
203 203
 
204 204
 		echo '<tr><td colspan="4"><h3>'.lang('General fields:')."</h3></td></tr>";
205
-		foreach(array(
205
+		foreach (array(
206 206
 			'link' => lang('HTML link to the current record'),
207 207
 			'links' => lang('Titles of any entries linked to the current record, excluding attached files'),
208 208
  			'attachments' => lang('List of files linked to the current record'),
Please login to merge, or discard this patch.
Braces   +33 added lines, -8 removed lines patch added patch discarded remove patch
@@ -139,7 +139,10 @@  discard block
 block discarded – undo
139 139
 		// Set any missing custom fields, or the marker will stay
140 140
 		foreach(array_keys($this->bo->customfields) as $name)
141 141
 		{
142
-			if(!$array['#'.$name]) $array['#'.$name] = '';
142
+			if(!$array['#'.$name])
143
+			{
144
+				$array['#'.$name] = '';
145
+			}
143 146
 		}
144 147
 
145 148
 		// Links
@@ -148,7 +151,10 @@  discard block
 block discarded – undo
148 151
 		// Add markers
149 152
 		foreach($array as $key => &$value)
150 153
 		{
151
-			if(!$value) $value = '';
154
+			if(!$value)
155
+			{
156
+				$value = '';
157
+			}
152 158
 			$info['$$'.($prefix ? $prefix.'/':'').$key.'$$'] = $value;
153 159
 		}
154 160
 		return $info;
@@ -171,16 +177,29 @@  discard block
 block discarded – undo
171 177
 		$fields = array('ts_id' => lang('Timesheet ID')) + $this->bo->field2label + array('ts_total' => lang('total'));
172 178
 		foreach($fields as $name => $label)
173 179
 		{
174
-			if (in_array($name,array('pl_id','customfields'))) continue;	// dont show them
180
+			if (in_array($name,array('pl_id','customfields')))
181
+			{
182
+				continue;
183
+			}
184
+			// dont show them
175 185
 
176
-			if (in_array($name,array('ts_title', 'ts_description')) && $n&1)		// main values, which should be in the first column
186
+			if (in_array($name,array('ts_title', 'ts_description')) && $n&1)
187
+			{
188
+				// main values, which should be in the first column
177 189
 			{
178 190
 				echo "</tr>\n";
191
+			}
179 192
 				$n++;
180 193
 			}
181
-			if (!($n&1)) echo '<tr>';
194
+			if (!($n&1))
195
+			{
196
+				echo '<tr>';
197
+			}
182 198
 			echo '<td>{{'.$name.'}}</td><td>'.lang($label).'</td>';
183
-			if ($n&1) echo "</tr>\n";
199
+			if ($n&1)
200
+			{
201
+				echo "</tr>\n";
202
+			}
184 203
 			$n++;
185 204
 		}
186 205
 
@@ -195,9 +214,15 @@  discard block
 block discarded – undo
195 214
 		$i = 0;
196 215
 		foreach($pm_merge->projectmanager_fields as $name => $label)
197 216
 		{
198
-			if (!($i&1)) echo '<tr>';
217
+			if (!($i&1))
218
+			{
219
+				echo '<tr>';
220
+			}
199 221
 			echo '<td>{{ts_project/'.$name.'}}</td><td>'.$label.'</td>';
200
-			if ($i&1) echo "</tr>\n";
222
+			if ($i&1)
223
+			{
224
+				echo "</tr>\n";
225
+			}
201 226
 			$i++;
202 227
 		}
203 228
 
Please login to merge, or discard this patch.
timesheet/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@
 block discarded – undo
28 28
 {
29 29
 	Framework::render('<p style="text-align: center; color:red; font-weight: bold;">'.
30 30
 		lang('Your database is NOT up to date (%1 vs. %2), please run %3setup%4 to update your database.',
31
-		$ts_version,$GLOBALS['egw_info']['apps'][TIMESHEET_APP]['version'],
32
-		'<a href="../setup/">','</a>')."</p>\n", null, true);
31
+		$ts_version, $GLOBALS['egw_info']['apps'][TIMESHEET_APP]['version'],
32
+		'<a href="../setup/">', '</a>')."</p>\n", null, true);
33 33
 	exit();
34 34
 }
35 35
 
36
-Framework::redirect_link('/index.php',array('menuaction'=>TIMESHEET_APP.'.timesheet_ui.index'));
36
+Framework::redirect_link('/index.php', array('menuaction'=>TIMESHEET_APP.'.timesheet_ui.index'));
Please login to merge, or discard this patch.
notifications/download.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	)
21 21
 );
22 22
 
23
-ini_set('zlib.output_compression',0);
23
+ini_set('zlib.output_compression', 0);
24 24
 include('../header.inc.php');
25 25
 
26 26
 ob_start();
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 check_load_extension('zip', true);
29 29
 
30 30
 $document = EGW_SERVER_ROOT.'/notifications/java/full-eGwNotifier.jar';
31
-$archive = tempnam($GLOBALS['egw_info']['server']['temp_dir'], basename($document,'.jar').'-').'.jar';
32
-$ret=copy($document, $archive);
31
+$archive = tempnam($GLOBALS['egw_info']['server']['temp_dir'], basename($document, '.jar').'-').'.jar';
32
+$ret = copy($document, $archive);
33 33
 error_log("copy('$document', '$archive' returned ".array2string($ret));
34 34
 $document = 'zip://'.$archive.'#'.($config_file = 'lib/conf/egwnotifier.const.xml');
35 35
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 function replace_callback($matches)
40 40
 {
41 41
 	$replacement = $matches[3];
42
-	switch($matches[1])
42
+	switch ($matches[1])
43 43
 	{
44 44
 		case 'egw_dc_url':
45 45
 			$replacement = $GLOBALS['egw_info']['server']['webserver_url'];
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		case 'egw_debuging_level':
61 61
 			break;
62 62
 		default:
63
-			$replacement = lang($r=$replacement);
63
+			$replacement = lang($r = $replacement);
64 64
 			/* uncomment this to have missing translations add to en langfile
65 65
 			// if no translation found, check if en langfile is writable and add phrase, if not already there
66 66
 			if ($r === $replacement)
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 	if (is_string($htmlscflags))
91 91
 	{
92
-		$htmlscflags = 16;	// #define ENT_XML1		16
92
+		$htmlscflags = 16; // #define ENT_XML1		16
93 93
 	}
94 94
 
95 95
 	return '<'.$matches[1].'>'.htmlspecialchars($replacement, $htmlscflags, Api\Translation::charset()).'</'.$matches[1].'>';
@@ -118,6 +118,6 @@  discard block
 block discarded – undo
118 118
 ob_end_clean();
119 119
 
120 120
 Api\Header\Content::type('egroupware-notifier-'.$GLOBALS['egw_info']['user']['account_lid'].'.jar', 'application/x-java-archive', filesize($archive));
121
-readfile($archive,'rb');
121
+readfile($archive, 'rb');
122 122
 
123 123
 @unlink($archive);
Please login to merge, or discard this patch.