Passed
Push — master ( 65bdac...4e88da )
by Alxarafe
32:38
created
dolibarr/htdocs/core/lib/bank.lib.php 1 patch
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -67,27 +67,27 @@  discard block
 block discarded – undo
67 67
 
68 68
     if ($object->courant != Account::TYPE_CASH)
69 69
     {
70
-    	$nbReceipts=0;
71
-
72
-    	// List of all standing receipts
73
-    	$sql = "SELECT COUNT(DISTINCT(b.num_releve)) as nb";
74
-    	$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
75
-    	$sql.= " WHERE b.fk_account = ".$object->id;
76
-
77
-    	$resql = $db->query($sql);
78
-    	if ($resql)
79
-    	{
80
-    		$obj = $db->fetch_object($resql);
81
-    		if ($obj) $nbReceipts = $obj->nb;
82
-    		$db->free($resql);
83
-    	}
84
-
85
-    	$head[$h][0] = DOL_URL_ROOT."/compta/bank/releve.php?account=".$object->id;
86
-	    $head[$h][1] = $langs->trans("AccountStatements");
87
-	    if (($nbReceipts) > 0) $head[$h][1].= ' <span class="badge">'.($nbReceipts).'</span>';
88
-	    $head[$h][2] = 'statement';
89
-	    $h++;
90
-	}
70
+        $nbReceipts=0;
71
+
72
+        // List of all standing receipts
73
+        $sql = "SELECT COUNT(DISTINCT(b.num_releve)) as nb";
74
+        $sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
75
+        $sql.= " WHERE b.fk_account = ".$object->id;
76
+
77
+        $resql = $db->query($sql);
78
+        if ($resql)
79
+        {
80
+            $obj = $db->fetch_object($resql);
81
+            if ($obj) $nbReceipts = $obj->nb;
82
+            $db->free($resql);
83
+        }
84
+
85
+        $head[$h][0] = DOL_URL_ROOT."/compta/bank/releve.php?account=".$object->id;
86
+        $head[$h][1] = $langs->trans("AccountStatements");
87
+        if (($nbReceipts) > 0) $head[$h][1].= ' <span class="badge">'.($nbReceipts).'</span>';
88
+        $head[$h][2] = 'statement';
89
+        $h++;
90
+    }
91 91
 
92 92
     // Attached files
93 93
     require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     $head[$h][2] = 'document';
102 102
     $h++;
103 103
 
104
-	// Show more tabs from modules
104
+    // Show more tabs from modules
105 105
     // Entries must be declared in modules descriptor with line
106 106
     // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
107 107
     // $this->tabs = array('entity:-tabname);   												to remove a tab
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     $head[$h][2] = 'info';
113 113
     $h++;*/
114 114
 
115
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank', 'remove');
115
+    complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank', 'remove');
116 116
 
117 117
     return $head;
118 118
 }
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
  */
125 125
 function bank_admin_prepare_head($object)
126 126
 {
127
-	global $langs, $conf, $user;
128
-	$h = 0;
129
-	$head = array();
127
+    global $langs, $conf, $user;
128
+    $h = 0;
129
+    $head = array();
130 130
 
131
-	$head[$h][0] = DOL_URL_ROOT . '/admin/bank.php';
132
-	$head[$h][1] = $langs->trans("Miscellaneous");
133
-	$head[$h][2] = 'general';
134
-	$h++;
131
+    $head[$h][0] = DOL_URL_ROOT . '/admin/bank.php';
132
+    $head[$h][1] = $langs->trans("Miscellaneous");
133
+    $head[$h][2] = 'general';
134
+    $h++;
135 135
 
136 136
     $head[$h][0] = DOL_URL_ROOT . '/admin/chequereceipts.php';
137 137
     $head[$h][1] = $langs->trans("CheckReceiptShort");
@@ -139,20 +139,20 @@  discard block
 block discarded – undo
139 139
     $h++;
140 140
 
141 141
 
142
-	// Show more tabs from modules
143
-	// Entries must be declared in modules descriptor with line
144
-	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
145
-	// $this->tabs = array('entity:-tabname);   												to remove a tab
146
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin');
142
+    // Show more tabs from modules
143
+    // Entries must be declared in modules descriptor with line
144
+    // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
145
+    // $this->tabs = array('entity:-tabname);   												to remove a tab
146
+    complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin');
147 147
 
148
-	$head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php';
149
-	$head[$h][1] = $langs->trans("ExtraFields");
150
-	$head[$h][2] = 'attributes';
151
-	$h++;
148
+    $head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php';
149
+    $head[$h][1] = $langs->trans("ExtraFields");
150
+    $head[$h][2] = 'attributes';
151
+    $h++;
152 152
 
153
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin', 'remove');
153
+    complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin', 'remove');
154 154
 
155
-	return $head;
155
+    return $head;
156 156
 }
157 157
 
158 158
 /**
@@ -164,15 +164,15 @@  discard block
 block discarded – undo
164 164
 function various_payment_prepare_head($object)
165 165
 {
166 166
 
167
-	global $db, $langs, $conf;
167
+    global $db, $langs, $conf;
168 168
 
169
-	$h = 0;
170
-	$head = array();
169
+    $h = 0;
170
+    $head = array();
171 171
 
172
-	$head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$object->id;
173
-	$head[$h][1] = $langs->trans("Card");
174
-	$head[$h][2] = 'card';
175
-	$h++;
172
+    $head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$object->id;
173
+    $head[$h][1] = $langs->trans("Card");
174
+    $head[$h][2] = 'card';
175
+    $h++;
176 176
 
177 177
     // Show more tabs from modules
178 178
     // Entries must be declared in modules descriptor with line
@@ -180,25 +180,25 @@  discard block
 block discarded – undo
180 180
     // $this->tabs = array('entity:-tabname);   												to remove a tab
181 181
     complete_head_from_modules($conf,$langs,$object,$head,$h,'various_payment');
182 182
 
183
-	require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
183
+    require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
184 184
     require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
185
-	$upload_dir = $conf->banque->dir_output . "/" . dol_sanitizeFileName($object->ref);
186
-	$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
185
+    $upload_dir = $conf->banque->dir_output . "/" . dol_sanitizeFileName($object->ref);
186
+    $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
187 187
     $nbLinks=Link::count($db, $object->element, $object->id);
188
-	$head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/document.php?id='.$object->id;
189
-	$head[$h][1] = $langs->trans('Documents');
190
-	if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
191
-	$head[$h][2] = 'documents';
192
-	$h++;
188
+    $head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/document.php?id='.$object->id;
189
+    $head[$h][1] = $langs->trans('Documents');
190
+    if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
191
+    $head[$h][2] = 'documents';
192
+    $h++;
193 193
 
194
-	$head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/info.php?id='.$object->id;
195
-	$head[$h][1] = $langs->trans("Info");
196
-	$head[$h][2] = 'info';
197
-	$h++;
194
+    $head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/info.php?id='.$object->id;
195
+    $head[$h][1] = $langs->trans("Info");
196
+    $head[$h][2] = 'info';
197
+    $h++;
198 198
 
199
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'various_payment', 'remove');
199
+    complete_head_from_modules($conf,$langs,$object,$head,$h,'various_payment', 'remove');
200 200
 
201
-	return $head;
201
+    return $head;
202 202
 }
203 203
 
204 204
 /**
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/fiscalyear.lib.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,28 +29,28 @@
 block discarded – undo
29 29
  */
30 30
 function fiscalyear_prepare_head(Fiscalyear $object)
31 31
 {
32
-	global $langs, $conf;
32
+    global $langs, $conf;
33 33
 
34
-	$h = 0;
35
-	$head = array();
34
+    $h = 0;
35
+    $head = array();
36 36
 
37
-	$head[$h][0] = DOL_URL_ROOT . '/accountancy/admin/fiscalyear_card.php?id=' . $object->id;
38
-	$head[$h][1] = $langs->trans("Card");
39
-	$head[$h][2] = 'card';
40
-	$h++;
37
+    $head[$h][0] = DOL_URL_ROOT . '/accountancy/admin/fiscalyear_card.php?id=' . $object->id;
38
+    $head[$h][1] = $langs->trans("Card");
39
+    $head[$h][2] = 'card';
40
+    $h++;
41 41
 
42
-	// Show more tabs from modules
43
-	// Entries must be declared in modules descriptor with line
42
+    // Show more tabs from modules
43
+    // Entries must be declared in modules descriptor with line
44 44
     // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
45 45
     // $this->tabs = array('entity:-tabname);   												to remove a tab
46
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear');
46
+    complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear');
47 47
 
48
-	$head[$h][0] = DOL_URL_ROOT . '/accountancy/admin/fiscalyear_info.php?id=' . $object->id;
49
-	$head[$h][1] = $langs->trans("Info");
50
-	$head[$h][2] = 'info';
51
-	$h++;
48
+    $head[$h][0] = DOL_URL_ROOT . '/accountancy/admin/fiscalyear_info.php?id=' . $object->id;
49
+    $head[$h][1] = $langs->trans("Info");
50
+    $head[$h][2] = 'info';
51
+    $h++;
52 52
 
53
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear','remove');
53
+    complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear','remove');
54 54
 
55
-	return $head;
55
+    return $head;
56 56
 }
57 57
\ No newline at end of file
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/functions_ch.lib.php 1 patch
Indentation   +136 added lines, -136 removed lines patch added patch discarded remove patch
@@ -31,140 +31,140 @@
 block discarded – undo
31 31
  */
32 32
 function dol_ch_controle_bvrb($bvrb)
33 33
 {
34
-	// Init array for control
35
-	$tableau[0][0]=0;
36
-	$tableau[0][1]=9;
37
-	$tableau[0][2]=4;
38
-	$tableau[0][3]=6;
39
-	$tableau[0][4]=8;
40
-	$tableau[0][5]=2;
41
-	$tableau[0][6]=7;
42
-	$tableau[0][7]=1;
43
-	$tableau[0][8]=3;
44
-	$tableau[0][9]=5;
45
-	$tableau[0][10]=0;
46
-
47
-	$tableau[1][0]=9;
48
-	$tableau[1][1]=4;
49
-	$tableau[1][2]=6;
50
-	$tableau[1][3]=8;
51
-	$tableau[1][4]=2;
52
-	$tableau[1][5]=7;
53
-	$tableau[1][6]=1;
54
-	$tableau[1][7]=3;
55
-	$tableau[1][8]=5;
56
-	$tableau[1][9]=0;
57
-	$tableau[1][10]=9;
58
-
59
-	$tableau[2][0]=4;
60
-	$tableau[2][1]=6;
61
-	$tableau[2][2]=8;
62
-	$tableau[2][3]=2;
63
-	$tableau[2][4]=7;
64
-	$tableau[2][5]=1;
65
-	$tableau[2][6]=3;
66
-	$tableau[2][7]=5;
67
-	$tableau[2][8]=0;
68
-	$tableau[2][9]=9;
69
-	$tableau[2][10]=8;
70
-
71
-	$tableau[3][0]=6;
72
-	$tableau[3][1]=8;
73
-	$tableau[3][2]=2;
74
-	$tableau[3][3]=7;
75
-	$tableau[3][4]=1;
76
-	$tableau[3][5]=3;
77
-	$tableau[3][6]=5;
78
-	$tableau[3][7]=0;
79
-	$tableau[3][8]=9;
80
-	$tableau[3][9]=4;
81
-	$tableau[3][10]=7;
82
-
83
-	$tableau[4][0]=8;
84
-	$tableau[4][1]=2;
85
-	$tableau[4][2]=7;
86
-	$tableau[4][3]=1;
87
-	$tableau[4][4]=3;
88
-	$tableau[4][5]=5;
89
-	$tableau[4][6]=0;
90
-	$tableau[4][7]=9;
91
-	$tableau[4][8]=4;
92
-	$tableau[4][9]=6;
93
-	$tableau[4][10]=6;
94
-
95
-	$tableau[5][0]=2;
96
-	$tableau[5][1]=7;
97
-	$tableau[5][2]=1;
98
-	$tableau[5][3]=3;
99
-	$tableau[5][4]=5;
100
-	$tableau[5][5]=0;
101
-	$tableau[5][6]=9;
102
-	$tableau[5][7]=4;
103
-	$tableau[5][8]=6;
104
-	$tableau[5][9]=8;
105
-	$tableau[5][10]=5;
106
-
107
-	$tableau[6][0]=7;
108
-	$tableau[6][1]=1;
109
-	$tableau[6][2]=3;
110
-	$tableau[6][3]=5;
111
-	$tableau[6][4]=0;
112
-	$tableau[6][5]=9;
113
-	$tableau[6][6]=4;
114
-	$tableau[6][7]=6;
115
-	$tableau[6][8]=8;
116
-	$tableau[6][9]=2;
117
-	$tableau[6][10]=4;
118
-
119
-	$tableau[7][0]=1;
120
-	$tableau[7][1]=3;
121
-	$tableau[7][2]=5;
122
-	$tableau[7][3]=0;
123
-	$tableau[7][4]=9;
124
-	$tableau[7][5]=4;
125
-	$tableau[7][6]=6;
126
-	$tableau[7][7]=8;
127
-	$tableau[7][8]=2;
128
-	$tableau[7][9]=7;
129
-	$tableau[7][10]=3;
130
-
131
-	$tableau[8][0]=3;
132
-	$tableau[8][1]=5;
133
-	$tableau[8][2]=0;
134
-	$tableau[8][3]=9;
135
-	$tableau[8][4]=4;
136
-	$tableau[8][5]=6;
137
-	$tableau[8][6]=8;
138
-	$tableau[8][7]=2;
139
-	$tableau[8][8]=7;
140
-	$tableau[8][9]=1;
141
-	$tableau[8][10]=2;
142
-
143
-	$tableau[9][0]=5;
144
-	$tableau[9][1]=0;
145
-	$tableau[9][2]=9;
146
-	$tableau[9][3]=4;
147
-	$tableau[9][4]=6;
148
-	$tableau[9][5]=8;
149
-	$tableau[9][6]=2;
150
-	$tableau[9][7]=7;
151
-	$tableau[9][8]=1;
152
-	$tableau[9][9]=3;
153
-	$tableau[9][10]=1;
154
-
155
-
156
-	// Clean data
157
-	$bv=str_replace(' ','',$bvrb);
158
-
159
-	// Make control
160
-	$report=0;
161
-	while (dol_strlen($bv)>1)
162
-	{
163
-		$match=substr($bv,0,1);
164
-		$report=$tableau[$report][$match];
165
-		$bv=substr($bv,1);
166
-	}
167
-	$controle=$tableau[$report][10];
168
-
169
-	return ($controle==$bv);
34
+    // Init array for control
35
+    $tableau[0][0]=0;
36
+    $tableau[0][1]=9;
37
+    $tableau[0][2]=4;
38
+    $tableau[0][3]=6;
39
+    $tableau[0][4]=8;
40
+    $tableau[0][5]=2;
41
+    $tableau[0][6]=7;
42
+    $tableau[0][7]=1;
43
+    $tableau[0][8]=3;
44
+    $tableau[0][9]=5;
45
+    $tableau[0][10]=0;
46
+
47
+    $tableau[1][0]=9;
48
+    $tableau[1][1]=4;
49
+    $tableau[1][2]=6;
50
+    $tableau[1][3]=8;
51
+    $tableau[1][4]=2;
52
+    $tableau[1][5]=7;
53
+    $tableau[1][6]=1;
54
+    $tableau[1][7]=3;
55
+    $tableau[1][8]=5;
56
+    $tableau[1][9]=0;
57
+    $tableau[1][10]=9;
58
+
59
+    $tableau[2][0]=4;
60
+    $tableau[2][1]=6;
61
+    $tableau[2][2]=8;
62
+    $tableau[2][3]=2;
63
+    $tableau[2][4]=7;
64
+    $tableau[2][5]=1;
65
+    $tableau[2][6]=3;
66
+    $tableau[2][7]=5;
67
+    $tableau[2][8]=0;
68
+    $tableau[2][9]=9;
69
+    $tableau[2][10]=8;
70
+
71
+    $tableau[3][0]=6;
72
+    $tableau[3][1]=8;
73
+    $tableau[3][2]=2;
74
+    $tableau[3][3]=7;
75
+    $tableau[3][4]=1;
76
+    $tableau[3][5]=3;
77
+    $tableau[3][6]=5;
78
+    $tableau[3][7]=0;
79
+    $tableau[3][8]=9;
80
+    $tableau[3][9]=4;
81
+    $tableau[3][10]=7;
82
+
83
+    $tableau[4][0]=8;
84
+    $tableau[4][1]=2;
85
+    $tableau[4][2]=7;
86
+    $tableau[4][3]=1;
87
+    $tableau[4][4]=3;
88
+    $tableau[4][5]=5;
89
+    $tableau[4][6]=0;
90
+    $tableau[4][7]=9;
91
+    $tableau[4][8]=4;
92
+    $tableau[4][9]=6;
93
+    $tableau[4][10]=6;
94
+
95
+    $tableau[5][0]=2;
96
+    $tableau[5][1]=7;
97
+    $tableau[5][2]=1;
98
+    $tableau[5][3]=3;
99
+    $tableau[5][4]=5;
100
+    $tableau[5][5]=0;
101
+    $tableau[5][6]=9;
102
+    $tableau[5][7]=4;
103
+    $tableau[5][8]=6;
104
+    $tableau[5][9]=8;
105
+    $tableau[5][10]=5;
106
+
107
+    $tableau[6][0]=7;
108
+    $tableau[6][1]=1;
109
+    $tableau[6][2]=3;
110
+    $tableau[6][3]=5;
111
+    $tableau[6][4]=0;
112
+    $tableau[6][5]=9;
113
+    $tableau[6][6]=4;
114
+    $tableau[6][7]=6;
115
+    $tableau[6][8]=8;
116
+    $tableau[6][9]=2;
117
+    $tableau[6][10]=4;
118
+
119
+    $tableau[7][0]=1;
120
+    $tableau[7][1]=3;
121
+    $tableau[7][2]=5;
122
+    $tableau[7][3]=0;
123
+    $tableau[7][4]=9;
124
+    $tableau[7][5]=4;
125
+    $tableau[7][6]=6;
126
+    $tableau[7][7]=8;
127
+    $tableau[7][8]=2;
128
+    $tableau[7][9]=7;
129
+    $tableau[7][10]=3;
130
+
131
+    $tableau[8][0]=3;
132
+    $tableau[8][1]=5;
133
+    $tableau[8][2]=0;
134
+    $tableau[8][3]=9;
135
+    $tableau[8][4]=4;
136
+    $tableau[8][5]=6;
137
+    $tableau[8][6]=8;
138
+    $tableau[8][7]=2;
139
+    $tableau[8][8]=7;
140
+    $tableau[8][9]=1;
141
+    $tableau[8][10]=2;
142
+
143
+    $tableau[9][0]=5;
144
+    $tableau[9][1]=0;
145
+    $tableau[9][2]=9;
146
+    $tableau[9][3]=4;
147
+    $tableau[9][4]=6;
148
+    $tableau[9][5]=8;
149
+    $tableau[9][6]=2;
150
+    $tableau[9][7]=7;
151
+    $tableau[9][8]=1;
152
+    $tableau[9][9]=3;
153
+    $tableau[9][10]=1;
154
+
155
+
156
+    // Clean data
157
+    $bv=str_replace(' ','',$bvrb);
158
+
159
+    // Make control
160
+    $report=0;
161
+    while (dol_strlen($bv)>1)
162
+    {
163
+        $match=substr($bv,0,1);
164
+        $report=$tableau[$report][$match];
165
+        $bv=substr($bv,1);
166
+    }
167
+    $controle=$tableau[$report][10];
168
+
169
+    return ($controle==$bv);
170 170
 }
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/oauth.lib.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 );
30 30
 if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
31 31
 {
32
-	$supportedoauth2array['OAUTH_STRIPE_TEST_NAME']='stripetest';
33
-	$supportedoauth2array['OAUTH_STRIPE_LIVE_NAME']='stripelive';
32
+    $supportedoauth2array['OAUTH_STRIPE_TEST_NAME']='stripetest';
33
+    $supportedoauth2array['OAUTH_STRIPE_LIVE_NAME']='stripelive';
34 34
 }
35 35
 $supportedoauth2array['OAUTH_GITHUB_NAME']='github';
36 36
 
@@ -220,17 +220,17 @@  discard block
 block discarded – undo
220 220
         'OAUTH_STRAVA_ID',
221 221
         'OAUTH_STRAVA_SECRET',
222 222
     ),
223
-	array(
224
-		'OAUTH_STRIPE_TEST_NAME',
225
-		'OAUTH_STRIPE_TEST_ID',
226
-		'STRIPE_TEST_SECRET_KEY',
227
-	),
228
-	array(
229
-		'OAUTH_STRIPE_LIVE_NAME',
230
-		'OAUTH_STRIPE_LIVE_ID',
231
-		'STRIPE_LIVE_SECRET_KEY',
232
-	),
233
-	array(
223
+    array(
224
+        'OAUTH_STRIPE_TEST_NAME',
225
+        'OAUTH_STRIPE_TEST_ID',
226
+        'STRIPE_TEST_SECRET_KEY',
227
+    ),
228
+    array(
229
+        'OAUTH_STRIPE_LIVE_NAME',
230
+        'OAUTH_STRIPE_LIVE_ID',
231
+        'STRIPE_LIVE_SECRET_KEY',
232
+    ),
233
+    array(
234 234
         'OAUTH_TUMBLR_NAME',
235 235
         'OAUTH_TUMBLR_ID',
236 236
         'OAUTH_TUMBLR_SECRET',
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/holiday.lib.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
  */
30 30
 function holiday_prepare_head($object)
31 31
 {
32
-	global $db, $langs, $conf, $user;
32
+    global $db, $langs, $conf, $user;
33 33
 
34
-	$h = 0;
35
-	$head = array();
34
+    $h = 0;
35
+    $head = array();
36 36
 
37 37
     $head[$h][0] = DOL_URL_ROOT.'/holiday/card.php?id='.$object->id;
38 38
     $head[$h][1] = $langs->trans("Card");
@@ -57,23 +57,23 @@  discard block
 block discarded – undo
57 57
     // $this->tabs = array('entity:-tabname);   												to remove a tab
58 58
     complete_head_from_modules($conf,$langs,$object,$head,$h,'holiday');
59 59
 
60
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'holiday','remove');
60
+    complete_head_from_modules($conf,$langs,$object,$head,$h,'holiday','remove');
61 61
 
62
-	return $head;
62
+    return $head;
63 63
 }
64 64
 
65 65
 
66 66
 /**
67 67
  *  Return array head with list of tabs to view object informations
68 68
  *
69
-  *  @return array           		head
69
+ *  @return array           		head
70 70
  */
71 71
 function holiday_admin_prepare_head()
72 72
 {
73
-	global $db, $langs, $conf, $user;
73
+    global $db, $langs, $conf, $user;
74 74
 
75
-	$h = 0;
76
-	$head = array();
75
+    $h = 0;
76
+    $head = array();
77 77
 
78 78
     $head[$h][0] = DOL_URL_ROOT.'/admin/holiday.php';
79 79
     $head[$h][1] = $langs->trans("Setup");
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     // $this->tabs = array('entity:-tabname);   												to remove a tab
87 87
     complete_head_from_modules($conf,$langs,null,$head,$h,'holiday_admin');
88 88
 
89
-	complete_head_from_modules($conf,$langs,null,$head,$h,'holiday_admin','remove');
89
+    complete_head_from_modules($conf,$langs,null,$head,$h,'holiday_admin','remove');
90 90
 
91
-	return $head;
91
+    return $head;
92 92
 }
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/geturl.lib.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     $PROXY_USER=empty($conf->global->MAIN_PROXY_USER)?0:$conf->global->MAIN_PROXY_USER;
42 42
     $PROXY_PASS=empty($conf->global->MAIN_PROXY_PASS)?0:$conf->global->MAIN_PROXY_PASS;
43 43
 
44
-	dol_syslog("getURLContent postorget=".$postorget." URL=".$url." param=".$param);
44
+    dol_syslog("getURLContent postorget=".$postorget." URL=".$url." param=".$param);
45 45
 
46 46
     //setting the curl parameters.
47 47
     $ch = curl_init();
@@ -52,17 +52,17 @@  discard block
 block discarded – undo
52 52
      exit;*/
53 53
     curl_setopt($ch, CURLOPT_URL, $url);
54 54
     curl_setopt($ch, CURLOPT_VERBOSE, 1);
55
-	curl_setopt($ch, CURLOPT_USERAGENT, 'Dolibarr geturl function');
55
+    curl_setopt($ch, CURLOPT_USERAGENT, 'Dolibarr geturl function');
56 56
 
57
-	@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, ($followlocation?true:false));   // We use @ here because this may return warning if safe mode is on or open_basedir is on
57
+    @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, ($followlocation?true:false));   // We use @ here because this may return warning if safe mode is on or open_basedir is on
58 58
 
59
-	if (count($addheaders)) curl_setopt($ch, CURLOPT_HTTPHEADER, $addheaders);
60
-	curl_setopt($ch, CURLINFO_HEADER_OUT, true);	// To be able to retrieve request header and log it
59
+    if (count($addheaders)) curl_setopt($ch, CURLOPT_HTTPHEADER, $addheaders);
60
+    curl_setopt($ch, CURLINFO_HEADER_OUT, true);	// To be able to retrieve request header and log it
61 61
 
62
-	// By default use tls decied by PHP.
63
-	// You can force, if supported a version like TLSv1 or TLSv1.2
64
-	if (! empty($conf->global->MAIN_CURL_SSLVERSION)) curl_setopt($ch, CURLOPT_SSLVERSION, $conf->global->MAIN_CURL_SSLVERSION);
65
-	//curl_setopt($ch, CURLOPT_SSLVERSION, 6); for tls 1.2
62
+    // By default use tls decied by PHP.
63
+    // You can force, if supported a version like TLSv1 or TLSv1.2
64
+    if (! empty($conf->global->MAIN_CURL_SSLVERSION)) curl_setopt($ch, CURLOPT_SSLVERSION, $conf->global->MAIN_CURL_SSLVERSION);
65
+    //curl_setopt($ch, CURLOPT_SSLVERSION, 6); for tls 1.2
66 66
 
67 67
     //turning off the server and peer verification(TrustManager Concept).
68 68
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
@@ -75,37 +75,37 @@  discard block
 block discarded – undo
75 75
     curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);		// We want response
76 76
     if ($postorget == 'POST')
77 77
     {
78
-    	curl_setopt($ch, CURLOPT_POST, 1);	// POST
79
-    	curl_setopt($ch, CURLOPT_POSTFIELDS, $param);	// Setting param x=a&y=z as POST fields
78
+        curl_setopt($ch, CURLOPT_POST, 1);	// POST
79
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $param);	// Setting param x=a&y=z as POST fields
80 80
     }
81 81
     else if ($postorget == 'PUT')
82 82
     {
83
-    	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
84
-    	if (! is_array($param)) parse_str($param, $array_param);
85
-    	else
86
-    	{
87
-    	    dol_syslog("parameter param must be a string", LOG_WARNING);
88
-    	    $array_param=$param;
89
-    	}
90
-    	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param));	// Setting param x=a&y=z as PUT fields
83
+        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
84
+        if (! is_array($param)) parse_str($param, $array_param);
85
+        else
86
+        {
87
+            dol_syslog("parameter param must be a string", LOG_WARNING);
88
+            $array_param=$param;
89
+        }
90
+        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param));	// Setting param x=a&y=z as PUT fields
91 91
     }
92 92
     else if ($postorget == 'PUTALREADYFORMATED')
93 93
     {
94
-    	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
95
-    	curl_setopt($ch, CURLOPT_POSTFIELDS, $param);	// param = content of post, like a xml string
94
+        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
95
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $param);	// param = content of post, like a xml string
96 96
     }
97 97
     else if ($postorget == 'HEAD')
98 98
     {
99
-    	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD'
100
-    	curl_setopt($ch, CURLOPT_NOBODY, true);
99
+        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD'
100
+        curl_setopt($ch, CURLOPT_NOBODY, true);
101 101
     }
102 102
     else if ($postorget == 'DELETE')
103 103
     {
104
-    	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');	// POST
104
+        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');	// POST
105 105
     }
106 106
     else
107 107
     {
108
-    	curl_setopt($ch, CURLOPT_POST, 0);			// GET
108
+        curl_setopt($ch, CURLOPT_POST, 0);			// GET
109 109
     }
110 110
 
111 111
     //if USE_PROXY constant set at begin of this method.
@@ -133,27 +133,27 @@  discard block
 block discarded – undo
133 133
         $rep['content']=$response;
134 134
 
135 135
         // moving to display page to display curl errors
136
-		$rep['curl_error_no']=curl_errno($ch);
136
+        $rep['curl_error_no']=curl_errno($ch);
137 137
         $rep['curl_error_msg']=curl_error($ch);
138 138
 
139
-		dol_syslog("getURLContent response array is ".join(',',$rep));
139
+        dol_syslog("getURLContent response array is ".join(',',$rep));
140 140
     }
141 141
     else
142 142
     {
143
-    	$info = curl_getinfo($ch);
143
+        $info = curl_getinfo($ch);
144 144
 
145
-    	// Ad keys to $rep
146
-    	$rep = $info;
147
-    	//$rep['header_size']=$info['header_size'];
148
-    	//$rep['http_code']=$info['http_code'];
149
-    	dol_syslog("getURLContent http_code=".$rep['http_code']);
145
+        // Ad keys to $rep
146
+        $rep = $info;
147
+        //$rep['header_size']=$info['header_size'];
148
+        //$rep['http_code']=$info['http_code'];
149
+        dol_syslog("getURLContent http_code=".$rep['http_code']);
150 150
 
151 151
         // Add more keys to $rep
152 152
         $rep['content']=$response;
153
-    	$rep['curl_error_no']='';
154
-    	$rep['curl_error_msg']='';
153
+        $rep['curl_error_no']='';
154
+        $rep['curl_error_msg']='';
155 155
 
156
-    	//closing the curl
156
+        //closing the curl
157 157
         curl_close($ch);
158 158
     }
159 159
 
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
  */
171 171
 function getDomainFromURL($url)
172 172
 {
173
-	$tmpdomain = preg_replace('/^https?:\/\//i', '', $url);				// Remove http(s)://
174
-	$tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain);				// Remove part after domain
175
-	$tmpdomain = preg_replace('/\.[^\.]+$/', '', $tmpdomain);			// Remove first level domain (.com, .net, ...)
176
-	$tmpdomain = preg_replace('/^[^\.]+\./', '', $tmpdomain);			// Remove part www. before domain name
173
+    $tmpdomain = preg_replace('/^https?:\/\//i', '', $url);				// Remove http(s)://
174
+    $tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain);				// Remove part after domain
175
+    $tmpdomain = preg_replace('/\.[^\.]+$/', '', $tmpdomain);			// Remove first level domain (.com, .net, ...)
176
+    $tmpdomain = preg_replace('/^[^\.]+\./', '', $tmpdomain);			// Remove part www. before domain name
177 177
 
178
-	return $tmpdomain;
178
+    return $tmpdomain;
179 179
 }
180 180
 
181 181
 /**
@@ -188,13 +188,13 @@  discard block
 block discarded – undo
188 188
  */
189 189
 function getRootURLFromURL($url)
190 190
 {
191
-	$prefix='';
192
-	$tmpurl = $url;
193
-	if (preg_match('/^(https?:\/\/)/i', $tmpurl, $reg)) $prefix = $reg[1];
194
-	$tmpurl = preg_replace('/^https?:\/\//i', '', $tmpurl);				// Remove http(s)://
195
-	$tmpurl = preg_replace('/\/.*$/i', '', $tmpurl);					// Remove part after domain
191
+    $prefix='';
192
+    $tmpurl = $url;
193
+    if (preg_match('/^(https?:\/\/)/i', $tmpurl, $reg)) $prefix = $reg[1];
194
+    $tmpurl = preg_replace('/^https?:\/\//i', '', $tmpurl);				// Remove http(s)://
195
+    $tmpurl = preg_replace('/\/.*$/i', '', $tmpurl);					// Remove part after domain
196 196
 
197
-	return $prefix.$tmpurl;
197
+    return $prefix.$tmpurl;
198 198
 }
199 199
 
200 200
 /**
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
  */
206 206
 function removeHtmlComment($content)
207 207
 {
208
-	$content = preg_replace('/<!--[^\-]+-->/', '', $content);
209
-	return $content;
208
+    $content = preg_replace('/<!--[^\-]+-->/', '', $content);
209
+    return $content;
210 210
 }
211 211
 
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/modulebuilder.lib.php 1 patch
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -46,37 +46,37 @@  discard block
 block discarded – undo
46 46
 
47 47
     if (! empty($addfieldentry['arrayofkeyval']) && ! is_array($addfieldentry['arrayofkeyval']))
48 48
     {
49
-    	dol_print_error('', 'Bad parameter addfieldentry with a property arrayofkeyval defined but that is not an array.');
50
-    	return -1;
49
+        dol_print_error('', 'Bad parameter addfieldentry with a property arrayofkeyval defined but that is not an array.');
50
+        return -1;
51 51
     }
52 52
 
53 53
     // Check parameters
54 54
     if (count($addfieldentry) > 0)
55 55
     {
56 56
         if (empty($addfieldentry['name']))
57
-    	{
58
-    		setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Name")), null, 'errors');
59
-    		return -2;
60
-    	}
57
+        {
58
+            setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Name")), null, 'errors');
59
+            return -2;
60
+        }
61 61
         if (empty($addfieldentry['label']))
62
-    	{
63
-    		setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Label")), null, 'errors');
64
-    		return -2;
65
-    	}
62
+        {
63
+            setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Label")), null, 'errors');
64
+            return -2;
65
+        }
66 66
 
67
-    	if (! preg_match('/^(price|boolean|sellist|integer|date|timestamp|varchar|double|text|html)/', $addfieldentry['type']))
67
+        if (! preg_match('/^(price|boolean|sellist|integer|date|timestamp|varchar|double|text|html)/', $addfieldentry['type']))
68 68
 
69
-    	{
70
-    		setEventMessages($langs->trans('BadFormatForType', $objectname), null, 'errors');
71
-    		return -2;
72
-    	}
69
+        {
70
+            setEventMessages($langs->trans('BadFormatForType', $objectname), null, 'errors');
71
+            return -2;
72
+        }
73 73
     }
74 74
 
75 75
     $pathoffiletoeditsrc=$readdir.'/class/'.strtolower($objectname).'.class.php';
76 76
     $pathoffiletoedittarget=$destdir.'/class/'.strtolower($objectname).'.class.php'.($readdir != $destdir ? '.new' : '');
77 77
     if (! dol_is_file($pathoffiletoeditsrc))
78 78
     {
79
-    	$langs->load("errors");
79
+        $langs->load("errors");
80 80
         setEventMessages($langs->trans("ErrorFileNotFound", $pathoffiletoeditsrc), null, 'errors');
81 81
         return -3;
82 82
     }
@@ -96,21 +96,21 @@  discard block
 block discarded – undo
96 96
         // Edit class files
97 97
         $contentclass = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r');
98 98
 
99
-	    // Update ->fields (add or remove entries)
99
+        // Update ->fields (add or remove entries)
100 100
         if (count($object->fields))
101 101
         {
102
-        	if (is_array($addfieldentry) && count($addfieldentry))
103
-        	{
104
-				$name=$addfieldentry['name'];
105
-        		unset($addfieldentry['name']);
106
-
107
-        		$object->fields[$name]=$addfieldentry;
108
-        	}
109
-        	if (! empty($delfieldentry))
110
-        	{
111
-        		$name=$delfieldentry;
112
-        		unset($object->fields[$name]);
113
-        	}
102
+            if (is_array($addfieldentry) && count($addfieldentry))
103
+            {
104
+                $name=$addfieldentry['name'];
105
+                unset($addfieldentry['name']);
106
+
107
+                $object->fields[$name]=$addfieldentry;
108
+            }
109
+            if (! empty($delfieldentry))
110
+            {
111
+                $name=$delfieldentry;
112
+                unset($object->fields[$name]);
113
+            }
114 114
         }
115 115
 
116 116
         dol_sort_array($object->fields, 'position');
@@ -143,28 +143,28 @@  discard block
 block discarded – undo
143 143
                 if ($val['showoncombobox']) $texttoinsert.= " 'showoncombobox'=>'".$val['showoncombobox']."',";
144 144
                 if ($val['arrayofkeyval'])
145 145
                 {
146
-                	$texttoinsert.= " 'arrayofkeyval'=>array(";
147
-                	$i=0;
148
-                	foreach($val['arrayofkeyval'] as $key2 => $val2)
149
-                	{
150
-                		if ($i) $texttoinsert.=", ";
151
-                		$texttoinsert.="'".$key2."'=>'".$val2."'";
152
-                		$i++;
153
-                	}
154
-                	$texttoinsert.= ")";
146
+                    $texttoinsert.= " 'arrayofkeyval'=>array(";
147
+                    $i=0;
148
+                    foreach($val['arrayofkeyval'] as $key2 => $val2)
149
+                    {
150
+                        if ($i) $texttoinsert.=", ";
151
+                        $texttoinsert.="'".$key2."'=>'".$val2."'";
152
+                        $i++;
153
+                    }
154
+                    $texttoinsert.= ")";
155 155
                 }
156 156
                 $texttoinsert.= "),\n";
157 157
             }
158 158
         }
159 159
 
160 160
         $texttoinsert.= "\t".');'."\n";
161
-		//print ($texttoinsert);exit;
161
+        //print ($texttoinsert);exit;
162 162
 
163 163
         if (count($object->fields))
164 164
         {
165
-        	$typetotypephp=array('integer'=>'integer', 'varchar'=>'string');
165
+            $typetotypephp=array('integer'=>'integer', 'varchar'=>'string');
166 166
 
167
-        	foreach($object->fields as $key => $val)
167
+            foreach($object->fields as $key => $val)
168 168
             {
169 169
                 $i++;
170 170
                 //$typephp=$typetotypephp[$val['type']];
@@ -224,22 +224,22 @@  discard block
 block discarded – undo
224 224
     // Edit .sql file
225 225
     $pathoffiletoeditsrc=$readdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql';
226 226
     $pathoffiletoedittarget=$destdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql'.($readdir != $destdir ? '.new' : '');
227
-	if (! dol_is_file($pathoffiletoeditsrc))
227
+    if (! dol_is_file($pathoffiletoeditsrc))
228 228
     {
229
-    	$langs->load("errors");
230
-    	setEventMessages($langs->trans("ErrorFileNotFound", $pathoffiletoeditsrc), null, 'errors');
231
-    	return -1;
229
+        $langs->load("errors");
230
+        setEventMessages($langs->trans("ErrorFileNotFound", $pathoffiletoeditsrc), null, 'errors');
231
+        return -1;
232 232
     }
233 233
 
234 234
     // Load object from myobject.class.php
235 235
     try
236 236
     {
237
-    	if (! is_object($object))
238
-    	{
239
-    		include_once $pathoffiletoclasssrc;
240
-        	if (class_exists($objectname)) $object=new $objectname($db);
241
-        	else return -1;
242
-    	}
237
+        if (! is_object($object))
238
+        {
239
+            include_once $pathoffiletoclasssrc;
240
+            if (class_exists($objectname)) $object=new $objectname($db);
241
+            else return -1;
242
+        }
243 243
     }
244 244
     catch(Exception $e)
245 245
     {
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
             if ($key == 'entity') $texttoinsert.= ' DEFAULT 1';
271 271
             else
272 272
             {
273
-            	if ($val['default'] != '')
274
-            	{
275
-            		if (preg_match('/^null$/i', $val['default'])) $texttoinsert.= " DEFAULT NULL";
276
-            		else if (preg_match('/varchar/', $type )) $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'";
277
-            		else $texttoinsert.= (($val['default'] > 0)?' DEFAULT '.$val['default']:'');
278
-            	}
273
+                if ($val['default'] != '')
274
+                {
275
+                    if (preg_match('/^null$/i', $val['default'])) $texttoinsert.= " DEFAULT NULL";
276
+                    else if (preg_match('/varchar/', $type )) $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'";
277
+                    else $texttoinsert.= (($val['default'] > 0)?' DEFAULT '.$val['default']:'');
278
+                }
279 279
             }
280 280
             $texttoinsert.= (($val['notnull'] > 0)?' NOT NULL':'');
281 281
             if ($i < count($object->fields)) $texttoinsert.=", ";
@@ -289,11 +289,11 @@  discard block
 block discarded – undo
289 289
     $result = file_put_contents($pathoffiletoedittarget, $contentsql);
290 290
     if ($result)
291 291
     {
292
-    	@chmod($pathoffiletoedittarget, octdec($newmask));
292
+        @chmod($pathoffiletoedittarget, octdec($newmask));
293 293
     }
294 294
     else
295 295
     {
296
-    	$error++;
296
+        $error++;
297 297
     }
298 298
 
299 299
     // Edit .key.sql file
@@ -316,12 +316,12 @@  discard block
 block discarded – undo
316 316
             }
317 317
             if (! empty($val['foreignkey']))
318 318
             {
319
-            	$tmp=explode('.',$val['foreignkey']);
320
-            	if (! empty($tmp[0]) && ! empty($tmp[1]))
321
-            	{
322
-            		$texttoinsert.= "ALTER TABLE llx_".strtolower($module).'_'.strtolower($objectname)." ADD CONSTRAINT llx_".strtolower($module).'_'.strtolower($objectname)."_".$key." FOREIGN KEY (".$key.") REFERENCES ".$tmp[0]."(".$tmp[1].");";
323
-            		$texttoinsert.= "\n";
324
-            	}
319
+                $tmp=explode('.',$val['foreignkey']);
320
+                if (! empty($tmp[0]) && ! empty($tmp[1]))
321
+                {
322
+                    $texttoinsert.= "ALTER TABLE llx_".strtolower($module).'_'.strtolower($objectname)." ADD CONSTRAINT llx_".strtolower($module).'_'.strtolower($objectname)."_".$key." FOREIGN KEY (".$key.") REFERENCES ".$tmp[0]."(".$tmp[1].");";
323
+                    $texttoinsert.= "\n";
324
+                }
325 325
             }
326 326
         }
327 327
     }
@@ -334,11 +334,11 @@  discard block
 block discarded – undo
334 334
     $result2 = file_put_contents($pathoffiletoedittarget, $contentsql);
335 335
     if ($result)
336 336
     {
337
-    	@chmod($pathoffiletoedittarget, octdec($newmask));
337
+        @chmod($pathoffiletoedittarget, octdec($newmask));
338 338
     }
339 339
     else
340 340
     {
341
-    	$error++;
341
+        $error++;
342 342
     }
343 343
 
344 344
     return $error ? -1 : 1;
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/member.lib.php 1 patch
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -32,36 +32,36 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function member_prepare_head(Adherent $object)
34 34
 {
35
-	global $db, $langs, $conf, $user;
36
-
37
-	$h = 0;
38
-	$head = array();
39
-
40
-	$head[$h][0] = DOL_URL_ROOT.'/adherents/card.php?rowid='.$object->id;
41
-	$head[$h][1] = $langs->trans("Card");
42
-	$head[$h][2] = 'general';
43
-	$h++;
44
-
45
-	if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
46
-		&& (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
47
-	{
48
-		$langs->load("ldap");
49
-
50
-		$head[$h][0] = DOL_URL_ROOT.'/adherents/ldap.php?id='.$object->id;
51
-		$head[$h][1] = $langs->trans("LDAPCard");
52
-		$head[$h][2] = 'ldap';
53
-		$h++;
54
-	}
55
-
56
-	if (! empty($user->rights->adherent->cotisation->lire))
57
-	{
58
-		$nbSubscription = is_array($object->subscriptions)?count($object->subscriptions):0;
59
-		$head[$h][0] = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$object->id;
60
-		$head[$h][1] = $langs->trans("Subscriptions");
61
-		$head[$h][2] = 'subscription';
62
-		if ($nbSubscription > 0) $head[$h][1].= ' <span class="badge">'.$nbSubscription.'</span>';
63
-		$h++;
64
-	}
35
+    global $db, $langs, $conf, $user;
36
+
37
+    $h = 0;
38
+    $head = array();
39
+
40
+    $head[$h][0] = DOL_URL_ROOT.'/adherents/card.php?rowid='.$object->id;
41
+    $head[$h][1] = $langs->trans("Card");
42
+    $head[$h][2] = 'general';
43
+    $h++;
44
+
45
+    if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
46
+        && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
47
+    {
48
+        $langs->load("ldap");
49
+
50
+        $head[$h][0] = DOL_URL_ROOT.'/adherents/ldap.php?id='.$object->id;
51
+        $head[$h][1] = $langs->trans("LDAPCard");
52
+        $head[$h][2] = 'ldap';
53
+        $h++;
54
+    }
55
+
56
+    if (! empty($user->rights->adherent->cotisation->lire))
57
+    {
58
+        $nbSubscription = is_array($object->subscriptions)?count($object->subscriptions):0;
59
+        $head[$h][0] = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$object->id;
60
+        $head[$h][1] = $langs->trans("Subscriptions");
61
+        $head[$h][2] = 'subscription';
62
+        if ($nbSubscription > 0) $head[$h][1].= ' <span class="badge">'.$nbSubscription.'</span>';
63
+        $h++;
64
+    }
65 65
 
66 66
     // Show more tabs from modules
67 67
     // Entries must be declared in modules descriptor with line
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
     if(!empty($object->note_private)) $nbNote++;
75 75
     if(!empty($object->note_public)) $nbNote++;
76 76
     $head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id;
77
-	$head[$h][1] = $langs->trans("Note");
78
-	$head[$h][2] = 'note';
77
+    $head[$h][1] = $langs->trans("Note");
78
+    $head[$h][2] = 'note';
79 79
     if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
80
-	$h++;
80
+    $h++;
81 81
 
82 82
     // Attachments
83 83
     require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -91,23 +91,23 @@  discard block
 block discarded – undo
91 91
     $head[$h][2] = 'document';
92 92
     $h++;
93 93
 
94
-	// Show agenda tab
95
-	if (! empty($conf->agenda->enabled))
96
-	{
97
-	    $head[$h][0] = DOL_URL_ROOT."/adherents/agenda.php?id=".$object->id;
98
-	    $head[$h][1] = $langs->trans("Events");
99
-	    if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
100
-	    {
101
-	        $head[$h][1].= '/';
102
-	        $head[$h][1].= $langs->trans("Agenda");
103
-	    }
104
-	    $head[$h][2] = 'agenda';
105
-	    $h++;
106
-	}
107
-
108
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'member','remove');
109
-
110
-	return $head;
94
+    // Show agenda tab
95
+    if (! empty($conf->agenda->enabled))
96
+    {
97
+        $head[$h][0] = DOL_URL_ROOT."/adherents/agenda.php?id=".$object->id;
98
+        $head[$h][1] = $langs->trans("Events");
99
+        if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
100
+        {
101
+            $head[$h][1].= '/';
102
+            $head[$h][1].= $langs->trans("Agenda");
103
+        }
104
+        $head[$h][2] = 'agenda';
105
+        $h++;
106
+    }
107
+
108
+    complete_head_from_modules($conf,$langs,$object,$head,$h,'member','remove');
109
+
110
+    return $head;
111 111
 }
112 112
 
113 113
 /**
@@ -118,26 +118,26 @@  discard block
 block discarded – undo
118 118
  */
119 119
 function member_type_prepare_head(AdherentType $object)
120 120
 {
121
-	global $langs, $conf, $user;
121
+    global $langs, $conf, $user;
122 122
 
123
-	$h=0;
124
-	$head = array();
123
+    $h=0;
124
+    $head = array();
125 125
 
126
-	$head[$h][0] = DOL_URL_ROOT.'/adherents/type.php?rowid='.$object->id;
127
-	$head[$h][1] = $langs->trans("Card");
128
-	$head[$h][2] = 'card';
129
-	$h++;
126
+    $head[$h][0] = DOL_URL_ROOT.'/adherents/type.php?rowid='.$object->id;
127
+    $head[$h][1] = $langs->trans("Card");
128
+    $head[$h][2] = 'card';
129
+    $h++;
130 130
 
131
-	if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE))
132
-		&& (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
133
-	{
134
-		$langs->load("ldap");
131
+    if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE))
132
+        && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
133
+    {
134
+        $langs->load("ldap");
135 135
 
136
-		$head[$h][0] = DOL_URL_ROOT.'/adherents/type_ldap.php?rowid='.$object->id;
137
-		$head[$h][1] = $langs->trans("LDAPCard");
138
-		$head[$h][2] = 'ldap';
139
-		$h++;
140
-	}
136
+        $head[$h][0] = DOL_URL_ROOT.'/adherents/type_ldap.php?rowid='.$object->id;
137
+        $head[$h][1] = $langs->trans("LDAPCard");
138
+        $head[$h][2] = 'ldap';
139
+        $h++;
140
+    }
141 141
 
142 142
     // Show more tabs from modules
143 143
     // Entries must be declared in modules descriptor with line
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
     // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
146 146
     complete_head_from_modules($conf,$langs,$object,$head,$h,'membertype');
147 147
 
148
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'membertype','remove');
148
+    complete_head_from_modules($conf,$langs,$object,$head,$h,'membertype','remove');
149 149
 
150
-	return $head;
150
+    return $head;
151 151
 }
152 152
 
153 153
 /**
@@ -261,28 +261,28 @@  discard block
 block discarded – undo
261 261
  */
262 262
 function subscription_prepare_head(Subscription $object)
263 263
 {
264
-	global $db, $langs, $conf, $user;
264
+    global $db, $langs, $conf, $user;
265 265
 
266
-	$h = 0;
267
-	$head = array();
266
+    $h = 0;
267
+    $head = array();
268 268
 
269
-	$head[$h][0] = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$object->id;
270
-	$head[$h][1] = $langs->trans("Card");
271
-	$head[$h][2] = 'general';
272
-	$h++;
269
+    $head[$h][0] = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$object->id;
270
+    $head[$h][1] = $langs->trans("Card");
271
+    $head[$h][2] = 'general';
272
+    $h++;
273 273
 
274
-	$head[$h][0] = DOL_URL_ROOT.'/adherents/subscription/info.php?rowid='.$object->id;
275
-	$head[$h][1] = $langs->trans("Info");
276
-	$head[$h][2] = 'info';
277
-	$h++;
274
+    $head[$h][0] = DOL_URL_ROOT.'/adherents/subscription/info.php?rowid='.$object->id;
275
+    $head[$h][1] = $langs->trans("Info");
276
+    $head[$h][2] = 'info';
277
+    $h++;
278 278
 
279
-	// Show more tabs from modules
280
-	// Entries must be declared in modules descriptor with line
281
-	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
282
-	// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
283
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'subscription');
279
+    // Show more tabs from modules
280
+    // Entries must be declared in modules descriptor with line
281
+    // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
282
+    // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
283
+    complete_head_from_modules($conf,$langs,$object,$head,$h,'subscription');
284 284
 
285
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'subscription','remove');
285
+    complete_head_from_modules($conf,$langs,$object,$head,$h,'subscription','remove');
286 286
 
287
-	return $head;
287
+    return $head;
288 288
 }
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/contract.lib.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
  */
31 31
 function contract_prepare_head(Contrat $object)
32 32
 {
33
-	global $db, $langs, $conf;
33
+    global $db, $langs, $conf;
34 34
 	
35
-	$h = 0;
36
-	$head = array();
37
-
38
-	$head[$h][0] = DOL_URL_ROOT.'/contrat/card.php?id='.$object->id;
39
-	$head[$h][1] = $langs->trans("ContractCard");
40
-	$head[$h][2] = 'card';
41
-	$h++;
42
-
43
-	if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
44
-	{
45
-	    $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
46
-	    $head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id;
47
-		$head[$h][1] = $langs->trans("ContactsAddresses");
48
-		if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
49
-		$head[$h][2] = 'contact';
50
-		$h++;
51
-	}
35
+    $h = 0;
36
+    $head = array();
37
+
38
+    $head[$h][0] = DOL_URL_ROOT.'/contrat/card.php?id='.$object->id;
39
+    $head[$h][1] = $langs->trans("ContractCard");
40
+    $head[$h][2] = 'card';
41
+    $h++;
42
+
43
+    if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
44
+    {
45
+        $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
46
+        $head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id;
47
+        $head[$h][1] = $langs->trans("ContactsAddresses");
48
+        if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
49
+        $head[$h][2] = 'contact';
50
+        $h++;
51
+    }
52 52
 
53 53
     // Show more tabs from modules
54 54
     // Entries must be declared in modules descriptor with line
@@ -58,35 +58,35 @@  discard block
 block discarded – undo
58 58
 
59 59
     if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
60 60
     {
61
-    	$nbNote = 0;
61
+        $nbNote = 0;
62 62
         if(!empty($object->note_private)) $nbNote++;
63
-		if(!empty($object->note_public)) $nbNote++;
64
-    	$head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id;
65
-    	$head[$h][1] = $langs->trans("Notes");
66
-		if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
67
-    	$head[$h][2] = 'note';
68
-    	$h++;
63
+        if(!empty($object->note_public)) $nbNote++;
64
+        $head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id;
65
+        $head[$h][1] = $langs->trans("Notes");
66
+        if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
67
+        $head[$h][2] = 'note';
68
+        $h++;
69 69
     }
70 70
 
71
-	require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
71
+    require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
72 72
     require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
73
-	$upload_dir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref);
74
-	$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
73
+    $upload_dir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref);
74
+    $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
75 75
     $nbLinks=Link::count($db, $object->element, $object->id);
76
-	$head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id;
77
-	$head[$h][1] = $langs->trans("Documents");
78
-	if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
79
-	$head[$h][2] = 'documents';
80
-	$h++;
76
+    $head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id;
77
+    $head[$h][1] = $langs->trans("Documents");
78
+    if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
79
+    $head[$h][2] = 'documents';
80
+    $h++;
81 81
 
82
-	$head[$h][0] = DOL_URL_ROOT.'/contrat/info.php?id='.$object->id;
83
-	$head[$h][1] = $langs->trans("Info");
84
-	$head[$h][2] = 'info';
85
-	$h++;
82
+    $head[$h][0] = DOL_URL_ROOT.'/contrat/info.php?id='.$object->id;
83
+    $head[$h][1] = $langs->trans("Info");
84
+    $head[$h][2] = 'info';
85
+    $h++;
86 86
 
87 87
     complete_head_from_modules($conf,$langs,$object,$head,$h,'contract','remove');
88 88
 
89
-	return $head;
89
+    return $head;
90 90
 }
91 91
 
92 92
 /**
@@ -96,24 +96,24 @@  discard block
 block discarded – undo
96 96
  */
97 97
 function contract_admin_prepare_head()
98 98
 {
99
-	global $langs, $conf, $user;
99
+    global $langs, $conf, $user;
100 100
 
101
-	$h = 0;
102
-	$head = array();
101
+    $h = 0;
102
+    $head = array();
103 103
 
104
-	$head[$h][0] = DOL_URL_ROOT."/admin/contract.php";
105
-	$head[$h][1] = $langs->trans("Contracts");
106
-	$head[$h][2] = 'contract';
107
-	$h++;
104
+    $head[$h][0] = DOL_URL_ROOT."/admin/contract.php";
105
+    $head[$h][1] = $langs->trans("Contracts");
106
+    $head[$h][2] = 'contract';
107
+    $h++;
108 108
 
109
-	// Show more tabs from modules
110
-	// Entries must be declared in modules descriptor with line
111
-	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
112
-	// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
113
-	complete_head_from_modules($conf,$langs,null,$head,$h,'contract_admin');
109
+    // Show more tabs from modules
110
+    // Entries must be declared in modules descriptor with line
111
+    // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
112
+    // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
113
+    complete_head_from_modules($conf,$langs,null,$head,$h,'contract_admin');
114 114
 
115
-	$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php';
116
-	$head[$h][1] = $langs->trans("ExtraFields");
115
+    $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php';
116
+    $head[$h][1] = $langs->trans("ExtraFields");
117 117
     $head[$h][2] = 'attributes';
118 118
     $h++;
119 119
 
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
 
125 125
 
126 126
 
127
-	complete_head_from_modules($conf,$langs,null,$head,$h,'contract_admin','remove');
127
+    complete_head_from_modules($conf,$langs,null,$head,$h,'contract_admin','remove');
128 128
 
129
-		return $head;
129
+        return $head;
130 130
 }
131 131
 
Please login to merge, or discard this patch.