Passed
Branch develop (66e4de)
by Laurent
33:03
created
htdocs/projet/stats/index.php 1 patch
Braces   +23 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@  discard block
 block discarded – undo
28 28
 require_once DOL_DOCUMENT_ROOT.'/projet/class/projectstats.class.php';
29 29
 
30 30
 // Security check
31
-if (!$user->rights->projet->lire)
31
+if (!$user->rights->projet->lire) {
32 32
 	accessforbidden();
33
+}
33 34
 
34 35
 
35 36
 $WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
@@ -73,9 +74,15 @@  discard block
 block discarded – undo
73 74
 
74 75
 
75 76
 $stats_project = new ProjectStats($db);
76
-if (!empty($userid) && $userid != -1) $stats_project->userid = $userid;
77
-if (!empty($socid) && $socid != -1) $stats_project->socid = $socid;
78
-if (!empty($year)) $stats_project->year = $year;
77
+if (!empty($userid) && $userid != -1) {
78
+	$stats_project->userid = $userid;
79
+}
80
+if (!empty($socid) && $socid != -1) {
81
+	$stats_project->socid = $socid;
82
+}
83
+if (!empty($year)) {
84
+	$stats_project->year = $year;
85
+}
79 86
 
80 87
 /*
81 88
 if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
@@ -251,12 +258,16 @@  discard block
 block discarded – undo
251 258
 $stats_project->year = 0;
252 259
 $data_all_year = $stats_project->getAllByYear();
253 260
 
254
-if (!empty($year)) $stats_project->year = $year;
261
+if (!empty($year)) {
262
+	$stats_project->year = $year;
263
+}
255 264
 $arrayyears = array();
256 265
 foreach ($data_all_year as $val) {
257 266
 	$arrayyears[$val['year']] = $val['year'];
258 267
 }
259
-if (!count($arrayyears)) $arrayyears[$nowyear] = $nowyear;
268
+if (!count($arrayyears)) {
269
+	$arrayyears[$nowyear] = $nowyear;
270
+}
260 271
 
261 272
 
262 273
 $h = 0;
@@ -288,8 +299,12 @@  discard block
 block discarded – undo
288 299
 print '</td></tr>';*/
289 300
 // Year
290 301
 print '<tr><td>'.$langs->trans("Year").'</td><td>';
291
-if (!in_array($year, $arrayyears)) $arrayyears[$year] = $year;
292
-if (!in_array($nowyear, $arrayyears)) $arrayyears[$nowyear] = $nowyear;
302
+if (!in_array($year, $arrayyears)) {
303
+	$arrayyears[$year] = $year;
304
+}
305
+if (!in_array($nowyear, $arrayyears)) {
306
+	$arrayyears[$nowyear] = $nowyear;
307
+}
293 308
 arsort($arrayyears);
294 309
 print $form->selectarray('year', $arrayyears, $year, 0);
295 310
 print '</td></tr>';
Please login to merge, or discard this patch.
htdocs/projet/document.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@  discard block
 block discarded – undo
48 48
 $object = new Project($db);
49 49
 
50 50
 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
51
-if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
51
+if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) {
52
+	$object->fetchComments();
53
+}
52 54
 
53 55
 if ($id > 0 || !empty($ref)) {
54 56
 	$upload_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->ref);
@@ -67,8 +69,12 @@  discard block
 block discarded – undo
67 69
 if (!empty($conf->global->MAIN_DOC_SORT_FIELD)) { $sortfield = $conf->global->MAIN_DOC_SORT_FIELD; }
68 70
 if (!empty($conf->global->MAIN_DOC_SORT_ORDER)) { $sortorder = $conf->global->MAIN_DOC_SORT_ORDER; }
69 71
 
70
-if (!$sortorder) $sortorder = "ASC";
71
-if (!$sortfield) $sortfield = "name";
72
+if (!$sortorder) {
73
+	$sortorder = "ASC";
74
+}
75
+if (!$sortfield) {
76
+	$sortfield = "name";
77
+}
72 78
 
73 79
 
74 80
 
@@ -84,7 +90,9 @@  discard block
 block discarded – undo
84 90
  */
85 91
 
86 92
 $title = $langs->trans("Project").' - '.$langs->trans("Document").' - '.$object->ref.' '.$object->name;
87
-if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->ref.' '.$object->name.' - '.$langs->trans("Document");
93
+if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
94
+	$title = $object->ref.' '.$object->name.' - '.$langs->trans("Document");
95
+}
88 96
 $help_url = "EN:Module_Projects|FR:Module_Projets|ES:M&oacute;dulo_Proyectos";
89 97
 
90 98
 llxHeader('', $title, $help_url);
Please login to merge, or discard this patch.
htdocs/commande/customer.php 1 patch
Braces   +30 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@  discard block
 block discarded – undo
39 39
 	$socid = $user->socid;
40 40
 }
41 41
 
42
-if (!$user->rights->facture->creer)
43
-accessforbidden();
42
+if (!$user->rights->facture->creer) {
43
+	accessforbidden();
44
+}
44 45
 
45 46
 // Load translation files required by the page
46 47
 $langs->loadLangs(array("companies", "orders"));
@@ -53,8 +54,12 @@  discard block
 block discarded – undo
53 54
 $offset = $limit * $page;
54 55
 $pageprev = $page - 1;
55 56
 $pagenext = $page + 1;
56
-if (!$sortorder) $sortorder = "ASC";
57
-if (!$sortfield) $sortfield = "nom";
57
+if (!$sortorder) {
58
+	$sortorder = "ASC";
59
+}
60
+if (!$sortfield) {
61
+	$sortfield = "nom";
62
+}
58 63
 
59 64
 
60 65
 /*
@@ -71,19 +76,31 @@  discard block
 block discarded – undo
71 76
 
72 77
 $sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec, s.datea";
73 78
 $sql .= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
74
-if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
79
+if (!$user->rights->societe->client->voir && !$socid) {
80
+	$sql .= ", sc.fk_soc, sc.fk_user ";
81
+}
75 82
 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st, ".MAIN_DB_PREFIX."commande as c";
76
-if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
83
+if (!$user->rights->societe->client->voir && !$socid) {
84
+	$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
85
+}
77 86
 $sql .= " WHERE s.fk_stcomm = st.id AND c.fk_soc = s.rowid";
78 87
 $sql .= " AND s.entity IN (".getEntity('societe').")";
79
-if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
88
+if (!$user->rights->societe->client->voir && !$socid) {
89
+	$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
90
+}
80 91
 if (dol_strlen($stcomm))
81 92
 {
82 93
 	$sql .= " AND s.fk_stcomm=".$stcomm;
83 94
 }
84
-if (GETPOST("search_nom"))  $sql .= natural_search("s.nom", GETPOST("search_nom"));
85
-if (GETPOST("search_compta")) $sql .= natural_search("s.code_compta", GETPOST("search_compta"));
86
-if (GETPOST("search_code_client")) $sql .= natural_search("s.code_client", GETPOST("search_code_client"));
95
+if (GETPOST("search_nom")) {
96
+	$sql .= natural_search("s.nom", GETPOST("search_nom"));
97
+}
98
+if (GETPOST("search_compta")) {
99
+	$sql .= natural_search("s.code_compta", GETPOST("search_compta"));
100
+}
101
+if (GETPOST("search_code_client")) {
102
+	$sql .= natural_search("s.code_client", GETPOST("search_code_client"));
103
+}
87 104
 if (dol_strlen($begin))
88 105
 {
89 106
 	$sql .= " AND s.nom like '".$db->escape($begin)."'";
@@ -103,9 +120,11 @@  discard block
 block discarded – undo
103 120
 	$result = $db->query($sql);
104 121
 	$nbtotalofrecords = $db->num_rows($result);
105 122
 
106
-	if (($page * $limit) > $nbtotalofrecords)	// if total resultset is smaller then paging size (filtering), goto and load page 0
123
+	if (($page * $limit) > $nbtotalofrecords) {
124
+		// if total resultset is smaller then paging size (filtering), goto and load page 0
107 125
 	{
108 126
 		$page = 0;
127
+	}
109 128
 		$offset = 0;
110 129
 	}
111 130
 }
Please login to merge, or discard this patch.
htdocs/commande/document.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,8 +64,12 @@
 block discarded – undo
64 64
 if (!empty($conf->global->MAIN_DOC_SORT_FIELD)) { $sortfield = $conf->global->MAIN_DOC_SORT_FIELD; }
65 65
 if (!empty($conf->global->MAIN_DOC_SORT_ORDER)) { $sortorder = $conf->global->MAIN_DOC_SORT_ORDER; }
66 66
 
67
-if (!$sortorder) $sortorder = "ASC";
68
-if (!$sortfield) $sortfield = "name";
67
+if (!$sortorder) {
68
+	$sortorder = "ASC";
69
+}
70
+if (!$sortfield) {
71
+	$sortfield = "name";
72
+}
69 73
 
70 74
 $object = new Commande($db);
71 75
 
Please login to merge, or discard this patch.
htdocs/cashdesk/index.php 1 patch
Braces   +24 added lines, -6 removed lines patch added patch discarded remove patch
@@ -85,7 +85,10 @@  discard block
 block discarded – undo
85 85
 <div class="contenu">
86 86
 <div class="inline-block" style="vertical-align: top">
87 87
 <div class="principal_login">
88
-<?php if ($err) print dol_escape_htmltag($err)."<br><br>\n"; ?>
88
+<?php if ($err) {
89
+	print dol_escape_htmltag($err)."<br><br>\n";
90
+}
91
+?>
89 92
 <fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Identification"); ?></legend>
90 93
 <form id="frmLogin" method="POST" action="index_verif.php">
91 94
 	<input type="hidden" name="token" value="<?php echo newToken(); ?>" />
@@ -130,7 +133,10 @@  discard block
 block discarded – undo
130 133
 print '<td>';
131 134
 $disabled = 0;
132 135
 $langs->load("companies");
133
-if (!empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled = 1; // If a particular third party is defined, we disable choice
136
+if (!empty($conf->global->CASHDESK_ID_THIRDPARTY)) {
137
+	$disabled = 1;
138
+}
139
+// If a particular third party is defined, we disable choice
134 140
 print $form->select_company(GETPOST('socid', 'int') ?GETPOST('socid', 'int') : $conf->global->CASHDESK_ID_THIRDPARTY, 'socid', '(s.client IN (1,3) AND s.status = 1)', !$disabled, $disabled, 0, array(), 0, 'maxwidth300');
135 141
 //print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
136 142
 print '</td>';
@@ -143,7 +149,10 @@  discard block
 block discarded – undo
143 149
 	print '<td class="label1">'.$langs->trans("Warehouse").'</td>';
144 150
 	print '<td>';
145 151
 	$disabled = 0;
146
-	if ($conf->global->CASHDESK_ID_WAREHOUSE > 0) $disabled = 1; // If a particular stock is defined, we disable choice
152
+	if ($conf->global->CASHDESK_ID_WAREHOUSE > 0) {
153
+		$disabled = 1;
154
+	}
155
+	// If a particular stock is defined, we disable choice
147 156
 	print $formproduct->selectWarehouses((GETPOST('warehouseid') ?GETPOST('warehouseid', 'int') : (empty($conf->global->CASHDESK_ID_WAREHOUSE) ? 'ifone' : $conf->global->CASHDESK_ID_WAREHOUSE)), 'warehouseid', '', !$disabled, $disabled);
148 157
 	print '</td>';
149 158
 	print "</tr>\n";
@@ -153,7 +162,10 @@  discard block
 block discarded – undo
153 162
 print '<td class="label1">'.$langs->trans("CashDeskBankAccountForSell").'</td>';
154 163
 print '<td>';
155 164
 $defaultknown = 0;
156
-if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && $conf->global->CASHDESK_ID_BANKACCOUNT_CASH > 0) $defaultknown = 1; // If a particular stock is defined, we disable choice
165
+if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && $conf->global->CASHDESK_ID_BANKACCOUNT_CASH > 0) {
166
+	$defaultknown = 1;
167
+}
168
+// If a particular stock is defined, we disable choice
157 169
 $form->select_comptes(((GETPOST('bankid_cash') > 0) ?GETPOST('bankid_cash') : $conf->global->CASHDESK_ID_BANKACCOUNT_CASH), 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", ($defaultknown ? 0 : 2));
158 170
 print '</td>';
159 171
 print "</tr>\n";
@@ -162,7 +174,10 @@  discard block
 block discarded – undo
162 174
 print '<td class="label1">'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
163 175
 print '<td>';
164 176
 $defaultknown = 0;
165
-if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE) && $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE > 0) $defaultknown = 1; // If a particular stock is defined, we disable choice
177
+if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE) && $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE > 0) {
178
+	$defaultknown = 1;
179
+}
180
+// If a particular stock is defined, we disable choice
166 181
 $form->select_comptes(((GETPOST('bankid_cheque') > 0) ?GETPOST('bankid_cheque') : $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE), 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", ($defaultknown ? 0 : 2));
167 182
 print '</td>';
168 183
 print "</tr>\n";
@@ -171,7 +186,10 @@  discard block
 block discarded – undo
171 186
 print '<td class="label1">'.$langs->trans("CashDeskBankAccountForCB").'</td>';
172 187
 print '<td>';
173 188
 $defaultknown = 0;
174
-if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB) && $conf->global->CASHDESK_ID_BANKACCOUNT_CB > 0) $defaultknown = 1; // If a particular stock is defined, we disable choice
189
+if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB) && $conf->global->CASHDESK_ID_BANKACCOUNT_CB > 0) {
190
+	$defaultknown = 1;
191
+}
192
+// If a particular stock is defined, we disable choice
175 193
 $form->select_comptes(((GETPOST('bankid_cb') > 0) ?GETPOST('bankid_cb') : $conf->global->CASHDESK_ID_BANKACCOUNT_CB), 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", ($defaultknown ? 0 : 2));
176 194
 print '</td>';
177 195
 print "</tr>\n";
Please login to merge, or discard this patch.
htdocs/cashdesk/affContenu.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,9 @@
 block discarded – undo
58 58
 print '<div class="principal">';
59 59
 
60 60
 $page = GETPOST('menutpl', 'alpha');
61
-if (empty($page)) $page = 'facturation';
61
+if (empty($page)) {
62
+	$page = 'facturation';
63
+}
62 64
 
63 65
 if (in_array(
64 66
 		$page,
Please login to merge, or discard this patch.
htdocs/cashdesk/tpl/validation1.tpl.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,20 +52,23 @@
 block discarded – undo
52 52
 			case 'ESP':
53 53
 				echo $langs->trans("Cash");
54 54
 				$filtre = 'courant=2';
55
-				if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))
56
-					$selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"];
55
+				if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"])) {
56
+									$selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"];
57
+				}
57 58
 				break;
58 59
 			case 'CB':
59 60
 				echo $langs->trans("CreditCard");
60 61
 				$filtre = 'courant=1';
61
-				if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"]))
62
-					$selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CB"];
62
+				if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"])) {
63
+									$selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CB"];
64
+				}
63 65
 				break;
64 66
 			case 'CHQ':
65 67
 				echo $langs->trans("Cheque");
66 68
 				$filtre = 'courant=1';
67
-				if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"]))
68
-					$selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"];
69
+				if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"])) {
70
+									$selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"];
71
+				}
69 72
 				break;
70 73
 			case 'DIF':
71 74
 				echo $langs->trans("Reported");
Please login to merge, or discard this patch.
htdocs/loan/card.php 1 patch
Braces   +24 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,8 +27,12 @@  discard block
 block discarded – undo
27 27
 require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
28 28
 require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php';
29 29
 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
30
-if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
31
-if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
30
+if (!empty($conf->accounting->enabled)) {
31
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
32
+}
33
+if (!empty($conf->accounting->enabled)) {
34
+	require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
35
+}
32 36
 require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
33 37
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
34 38
 
@@ -44,7 +48,9 @@  discard block
 block discarded – undo
44 48
 
45 49
 // Security check
46 50
 $socid = GETPOST('socid', 'int');
47
-if ($user->socid) $socid = $user->socid;
51
+if ($user->socid) {
52
+	$socid = $user->socid;
53
+}
48 54
 $result = restrictedArea($user, 'loan', $id, '', '');
49 55
 
50 56
 $object = new Loan($db);
@@ -57,7 +63,9 @@  discard block
 block discarded – undo
57 63
  */
58 64
 
59 65
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
60
-if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
66
+if ($reshook < 0) {
67
+	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
68
+}
61 69
 if (empty($reshook))
62 70
 {
63 71
 	// Classify paid
@@ -208,16 +216,18 @@  discard block
 block discarded – undo
208 216
 	{
209 217
 		$object->fetch($id);
210 218
 		$result = $object->setProject($projectid);
211
-		if ($result < 0)
212
-			setEventMessages($object->error, $object->errors, 'errors');
219
+		if ($result < 0) {
220
+					setEventMessages($object->error, $object->errors, 'errors');
221
+		}
213 222
 	}
214 223
 
215 224
 	if ($action == 'setlabel' && $user->rights->loan->write)
216 225
 	{
217 226
 		$object->fetch($id);
218 227
 		$result = $object->setValueFrom('label', GETPOST('label'), '', '', 'text', '', $user, 'LOAN_MODIFY');
219
-		if ($result < 0)
220
-		setEventMessages($object->error, $object->errors, 'errors');
228
+		if ($result < 0) {
229
+				setEventMessages($object->error, $object->errors, 'errors');
230
+		}
221 231
 	}
222 232
 }
223 233
 
@@ -228,7 +238,9 @@  discard block
 block discarded – undo
228 238
 
229 239
 $form = new Form($db);
230 240
 $formproject = new FormProjets($db);
231
-if (!empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
241
+if (!empty($conf->accounting->enabled)) {
242
+	$formaccounting = new FormAccounting($db);
243
+}
232 244
 
233 245
 $title = $langs->trans("Loan").' - '.$langs->trans("Card");
234 246
 $help_url = 'EN:Module_Loan|FR:Module_Emprunt';
@@ -425,8 +437,9 @@  discard block
 block discarded – undo
425 437
 			$morehtmlref .= '<br>'.$langs->trans('Project').' ';
426 438
 			if ($user->rights->loan->write)
427 439
 			{
428
-				if ($action != 'classify')
429
-					$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
440
+				if ($action != 'classify') {
441
+									$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
442
+				}
430 443
 				if ($action == 'classify') {
431 444
 					//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
432 445
 					$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
Please login to merge, or discard this patch.
htdocs/loan/payment/card.php 1 patch
Braces   +13 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,7 +24,9 @@  discard block
 block discarded – undo
24 24
 require '../../main.inc.php';
25 25
 require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
26 26
 require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php';
27
-if (!empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
27
+if (!empty($conf->banque->enabled)) {
28
+	require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
29
+}
28 30
 
29 31
 // Load translation files required by the page
30 32
 $langs->loadLangs(array("bills", "banks", "companies", "loan"));
@@ -33,7 +35,9 @@  discard block
 block discarded – undo
33 35
 $id = GETPOST("id", 'int');
34 36
 $action = GETPOST('action', 'aZ09');
35 37
 $confirm = GETPOST('confirm');
36
-if ($user->socid) $socid = $user->socid;
38
+if ($user->socid) {
39
+	$socid = $user->socid;
40
+}
37 41
 // TODO ajouter regle pour restreindre acces paiement
38 42
 //$result = restrictedArea($user, 'facture', $id,'');
39 43
 
@@ -41,8 +45,10 @@  discard block
 block discarded – undo
41 45
 if ($id > 0)
42 46
 {
43 47
 	$result = $payment->fetch($id);
44
-	if (!$result) dol_print_error($db, 'Failed to get payment id '.$id);
45
-}
48
+	if (!$result) {
49
+		dol_print_error($db, 'Failed to get payment id '.$id);
50
+	}
51
+	}
46 52
 
47 53
 
48 54
 /*
@@ -238,10 +244,12 @@  discard block
 block discarded – undo
238 244
 
239 245
 			print '<td class="right">'.price($amount_payed).'</td>';
240 246
 			print "</tr>\n";
241
-			if ($objp->paid == 1)	// If at least one invoice is paid, disable delete
247
+			if ($objp->paid == 1) {
248
+				// If at least one invoice is paid, disable delete
242 249
 			{
243 250
 				$disable_delete = 1;
244 251
 			}
252
+			}
245 253
 			$total = $total + $objp->amount_capital;
246 254
 			$i++;
247 255
 		}
Please login to merge, or discard this patch.