Passed
Push — master ( c34860...8f7a8e )
by Alxarafe
23:57
created
dolibarr/htdocs/margin/lib/margins.lib.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,10 +75,10 @@
 block discarded – undo
75 75
     if ($user->rights->societe->lire) {
76 76
         //$head[$h][0] = DOL_URL_ROOT."/margin/customerMargins.php";
77 77
         $head[$h][0] = BASE_URI . '?controller=margin&method=customerMargins';
78
-		$head[$h][1] = $langs->trans("CustomerMargins");
79
-		$head[$h][2] = 'customerMargins';
80
-		$h++;
81
-	}
78
+        $head[$h][1] = $langs->trans("CustomerMargins");
79
+        $head[$h][2] = 'customerMargins';
80
+        $h++;
81
+    }
82 82
 
83 83
     if ($user->rights->margins->read->all) {
84 84
         $title = 'UserMargins';
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/contact.lib.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -32,34 +32,34 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function contact_prepare_head(Contact $object)
34 34
 {
35
-	global $db, $langs, $conf, $user;
35
+    global $db, $langs, $conf, $user;
36 36
 
37
-	$tab = 0;
38
-	$head = array();
37
+    $tab = 0;
38
+    $head = array();
39 39
 
40 40
     // $head[$tab][0] = DOL_URL_ROOT.'/contact/card.php?id='.$object->id;
41 41
     $head[$tab][0] = BASE_URI . '?controller=contact&method=card&id=' . $object->id;
42
-	$head[$tab][1] = $langs->trans("Card");
43
-	$head[$tab][2] = 'card';
44
-	$tab++;
42
+    $head[$tab][1] = $langs->trans("Card");
43
+    $head[$tab][2] = 'card';
44
+    $tab++;
45 45
 
46
-	if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE))
47
-		&& (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
48
-	{
49
-		$langs->load("ldap");
46
+    if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE))
47
+        && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
48
+    {
49
+        $langs->load("ldap");
50 50
 
51 51
         // $head[$tab][0] = DOL_URL_ROOT.'/contact/ldap.php?id='.$object->id;
52 52
         $head[$tab][0] = BASE_URI . '?controller=contact&method=ldap&id=' . $object->id;
53
-		$head[$tab][1] = $langs->trans("LDAPCard");
54
-		$head[$tab][2] = 'ldap';
55
-		$tab++;
56
-	}
53
+        $head[$tab][1] = $langs->trans("LDAPCard");
54
+        $head[$tab][2] = 'ldap';
55
+        $tab++;
56
+    }
57 57
 
58 58
     // $head[$tab][0] = DOL_URL_ROOT.'/contact/perso.php?id='.$object->id;
59 59
     $head[$tab][0] = BASE_URI . '?controller=contact&method=perso&id=' . $object->id;
60
-	$head[$tab][1] = $langs->trans("PersonalInformations");
61
-	$head[$tab][2] = 'perso';
62
-	$tab++;
60
+    $head[$tab][1] = $langs->trans("PersonalInformations");
61
+    $head[$tab][2] = 'perso';
62
+    $tab++;
63 63
 
64 64
     // Show more tabs from modules
65 65
     // Entries must be declared in modules descriptor with line
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
 	$head[$tab][2] = 'info';
109 109
 	$tab++;*/
110 110
 
111
-	complete_head_from_modules($conf,$langs,$object,$head,$tab,'contact','remove');
111
+    complete_head_from_modules($conf,$langs,$object,$head,$tab,'contact','remove');
112 112
 
113
-	return $head;
113
+    return $head;
114 114
 }
115 115
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,9 @@  discard block
 block discarded – undo
73 73
         // $head[$tab][0] = DOL_URL_ROOT.'/contact/note.php?id='.$object->id;
74 74
         $head[$tab][0] = BASE_URI . '?controller=contact&method=note&id=' . $object->id;
75 75
         $head[$tab][1] = $langs->trans("Note");
76
-        if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>';
76
+        if($nbNote > 0) {
77
+            $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>';
78
+        }
77 79
         $head[$tab][2] = 'note';
78 80
         $tab++;
79 81
     }
@@ -86,7 +88,9 @@  discard block
 block discarded – undo
86 88
     // $head[$tab][0] = DOL_URL_ROOT.'/contact/document.php?id='.$object->id;
87 89
     $head[$tab][0] = BASE_URI . '?controller=contact&method=document&id=' . $object->id;
88 90
     $head[$tab][1] = $langs->trans("Documents");
89
-    if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
91
+    if (($nbFiles+$nbLinks) > 0) {
92
+        $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
93
+    }
90 94
     $head[$tab][2] = 'documents';
91 95
     $tab++;
92 96
 
Please login to merge, or discard this patch.
dolibarr/htdocs/don/card.php 2 patches
Indentation   +467 added lines, -467 removed lines patch added patch discarded remove patch
@@ -78,117 +78,117 @@  discard block
 block discarded – undo
78 78
 
79 79
 if ($action == 'update')
80 80
 {
81
-	if (! empty($cancel))
82
-	{
83
-		header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
84
-		exit;
85
-	}
81
+    if (! empty($cancel))
82
+    {
83
+        header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
84
+        exit;
85
+    }
86 86
 
87
-	$error=0;
87
+    $error=0;
88 88
 
89 89
     if (empty($donation_date))
90 90
     {
91
-	    setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors');
91
+        setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors');
92 92
         $action = "create";
93 93
         $error++;
94 94
     }
95 95
 
96
-	if (empty($amount))
97
-	{
98
-		setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors');
99
-		$action = "create";
100
-		$error++;
101
-	}
96
+    if (empty($amount))
97
+    {
98
+        setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors');
99
+        $action = "create";
100
+        $error++;
101
+    }
102 102
 
103
-	if (! $error)
104
-	{
105
-		$object->fetch($id);
106
-
107
-		$object->firstname   = GETPOST("firstname",'alpha');
108
-		$object->lastname    = GETPOST("lastname",'alpha');
109
-		$object->societe     = GETPOST("societe",'alpha');
110
-		$object->address     = GETPOST("address",'alpha');
111
-		$object->amount      = price2num(GETPOST("amount",'alpha'));
112
-		$object->town        = GETPOST("town",'alpha');
113
-		$object->zip         = GETPOST("zipcode",'alpha');
103
+    if (! $error)
104
+    {
105
+        $object->fetch($id);
106
+
107
+        $object->firstname   = GETPOST("firstname",'alpha');
108
+        $object->lastname    = GETPOST("lastname",'alpha');
109
+        $object->societe     = GETPOST("societe",'alpha');
110
+        $object->address     = GETPOST("address",'alpha');
111
+        $object->amount      = price2num(GETPOST("amount",'alpha'));
112
+        $object->town        = GETPOST("town",'alpha');
113
+        $object->zip         = GETPOST("zipcode",'alpha');
114 114
         $object->country_id  = GETPOST('country_id', 'int');
115 115
         $object->email       = GETPOST("email",'alpha');
116
-		$object->date        = $donation_date;
117
-		$object->public      = GETPOST("public",'alpha');
118
-		$object->fk_project  = GETPOST("fk_project",'alpha');
119
-		$object->note_private= GETPOST("note_private",'none');
120
-		$object->note_public = GETPOST("note_public",'none');
121
-		$object->modepaymentid = GETPOST('modepayment','int');
122
-
123
-		// Fill array 'array_options' with data from add form
116
+        $object->date        = $donation_date;
117
+        $object->public      = GETPOST("public",'alpha');
118
+        $object->fk_project  = GETPOST("fk_project",'alpha');
119
+        $object->note_private= GETPOST("note_private",'none');
120
+        $object->note_public = GETPOST("note_public",'none');
121
+        $object->modepaymentid = GETPOST('modepayment','int');
122
+
123
+        // Fill array 'array_options' with data from add form
124 124
         $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
125
-		if ($ret < 0) $error++;
125
+        if ($ret < 0) $error++;
126 126
 
127
-		if ($object->update($user) > 0)
128
-		{
129
-			header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
130
-			exit;
131
-		}
132
-	}
127
+        if ($object->update($user) > 0)
128
+        {
129
+            header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
130
+            exit;
131
+        }
132
+    }
133 133
 }
134 134
 
135 135
 if ($action == 'add')
136 136
 {
137
-	if (! empty($cancel))
138
-	{
139
-		header("Location: index.php");
140
-		exit;
141
-	}
137
+    if (! empty($cancel))
138
+    {
139
+        header("Location: index.php");
140
+        exit;
141
+    }
142 142
 
143
-	$error=0;
143
+    $error=0;
144 144
 
145 145
     if (empty($donation_date))
146 146
     {
147
-	    setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors');
147
+        setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors');
148 148
         $action = "create";
149 149
         $error++;
150 150
     }
151 151
 
152
-	if (empty($amount))
153
-	{
154
-		setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors');
155
-		$action = "create";
156
-		$error++;
157
-	}
152
+    if (empty($amount))
153
+    {
154
+        setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors');
155
+        $action = "create";
156
+        $error++;
157
+    }
158 158
 
159
-	if (! $error)
160
-	{
161
-		$object->firstname   = GETPOST("firstname",'alpha');
162
-		$object->lastname    = GETPOST("lastname",'alpha');
163
-		$object->societe     = GETPOST("societe",'alpha');
164
-		$object->address     = GETPOST("address",'alpha');
165
-		$object->amount      = price2num(GETPOST("amount",'alpha'));
166
-		$object->zip         = GETPOST("zipcode",'alpha');
167
-		$object->town        = GETPOST("town",'alpha');
159
+    if (! $error)
160
+    {
161
+        $object->firstname   = GETPOST("firstname",'alpha');
162
+        $object->lastname    = GETPOST("lastname",'alpha');
163
+        $object->societe     = GETPOST("societe",'alpha');
164
+        $object->address     = GETPOST("address",'alpha');
165
+        $object->amount      = price2num(GETPOST("amount",'alpha'));
166
+        $object->zip         = GETPOST("zipcode",'alpha');
167
+        $object->town        = GETPOST("town",'alpha');
168 168
         $object->country_id  = GETPOST('country_id', 'int');
169 169
         $object->email       = GETPOST("email",'alpha');
170
-		$object->date        = $donation_date;
171
-		$object->note_private= GETPOST("note_private",'none');
172
-		$object->note_public = GETPOST("note_public",'none');
173
-		$object->public      = GETPOST("public",'alpha');
174
-		$object->fk_project  = GETPOST("fk_project",'alpha');
175
-		$object->modepaymentid = GETPOST('modepayment','int');
176
-
177
-		// Fill array 'array_options' with data from add form
170
+        $object->date        = $donation_date;
171
+        $object->note_private= GETPOST("note_private",'none');
172
+        $object->note_public = GETPOST("note_public",'none');
173
+        $object->public      = GETPOST("public",'alpha');
174
+        $object->fk_project  = GETPOST("fk_project",'alpha');
175
+        $object->modepaymentid = GETPOST('modepayment','int');
176
+
177
+        // Fill array 'array_options' with data from add form
178 178
         $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
179
-		if ($ret < 0) $error++;
180
-
181
-		$res = $object->create($user);
182
-		if ($res > 0)
183
-		{
184
-			header("Location: ".$_SERVER['PHP_SELF'].'?id='.$res);
185
-			exit;
186
-		}
187
-		else
188
-		{
189
-			setEventMessages($object->error, $object->errors, 'errors');
190
-		}
191
-	}
179
+        if ($ret < 0) $error++;
180
+
181
+        $res = $object->create($user);
182
+        if ($res > 0)
183
+        {
184
+            header("Location: ".$_SERVER['PHP_SELF'].'?id='.$res);
185
+            exit;
186
+        }
187
+        else
188
+        {
189
+            setEventMessages($object->error, $object->errors, 'errors');
190
+        }
191
+    }
192 192
 }
193 193
 if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights->don->supprimer)
194 194
 {
@@ -207,46 +207,46 @@  discard block
 block discarded – undo
207 207
 }
208 208
 if ($action == 'valid_promesse')
209 209
 {
210
-	$object->fetch($id);
211
-	if ($object->valid_promesse($id, $user->id) >= 0)
212
-	{
213
-		setEventMessages($langs->trans("DonationValidated", $object->ref), null);
210
+    $object->fetch($id);
211
+    if ($object->valid_promesse($id, $user->id) >= 0)
212
+    {
213
+        setEventMessages($langs->trans("DonationValidated", $object->ref), null);
214 214
 
215
-		header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
216
-		exit;
217
-	}
215
+        header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
216
+        exit;
217
+    }
218 218
     else {
219
-	    setEventMessages($object->error, $object->errors, 'errors');
219
+        setEventMessages($object->error, $object->errors, 'errors');
220 220
     }
221 221
 }
222 222
 if ($action == 'set_cancel')
223 223
 {
224
-	$object->fetch($id);
225
-	if ($object->set_cancel($id) >= 0)
224
+    $object->fetch($id);
225
+    if ($object->set_cancel($id) >= 0)
226 226
     {
227 227
         header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
228 228
         exit;
229 229
     }
230 230
     else {
231
-	    setEventMessages($object->error, $object->errors, 'errors');
231
+        setEventMessages($object->error, $object->errors, 'errors');
232 232
     }
233 233
 }
234 234
 if ($action == 'set_paid')
235 235
 {
236
-	$object->fetch($id);
237
-	if ($object->set_paid($id, $modepayment) >= 0)
238
-	{
239
-		header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
240
-		exit;
241
-	}
236
+    $object->fetch($id);
237
+    if ($object->set_paid($id, $modepayment) >= 0)
238
+    {
239
+        header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
240
+        exit;
241
+    }
242 242
     else {
243
-	    setEventMessages($object->error, $object->errors, 'errors');
243
+        setEventMessages($object->error, $object->errors, 'errors');
244 244
     }
245 245
 }
246 246
 else if ($action == 'classin' && $user->rights->don->creer)
247 247
 {
248
-	$object->fetch($id);
249
-	$object->setProject($projectid);
248
+    $object->fetch($id);
249
+    $object->setProject($projectid);
250 250
 }
251 251
 
252 252
 // Actions to build doc
@@ -321,50 +321,50 @@  discard block
 block discarded – undo
321 321
 
322 322
 if ($action == 'create')
323 323
 {
324
-	print load_fiche_titre($langs->trans("AddDonation"));
324
+    print load_fiche_titre($langs->trans("AddDonation"));
325 325
 
326
-	print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
327
-	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
328
-	print '<input type="hidden" name="action" value="add">';
326
+    print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
327
+    print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
328
+    print '<input type="hidden" name="action" value="add">';
329 329
 
330
-	dol_fiche_head('');
330
+    dol_fiche_head('');
331 331
 
332
-	print '<table class="border" width="100%">';
333
-	print '<tbody>';
332
+    print '<table class="border" width="100%">';
333
+    print '<tbody>';
334 334
 
335
-	// Ref
336
-	print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td colspan="2">' . $langs->trans('Draft') . '</td></tr>';
335
+    // Ref
336
+    print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td colspan="2">' . $langs->trans('Draft') . '</td></tr>';
337 337
 
338
-	// Company
339
-	if (! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES))
340
-	{
341
-		// Thirdparty
342
-		print '<td>' . $langs->trans('Customer') . '</td>';
343
-		if ($soc->id > 0 && ! GETPOST('fac_rec','alpha'))
344
-		{
345
-			print '<td colspan="2">';
346
-			print $soc->getNomUrl(1);
347
-			print '<input type="hidden" name="socid" value="' . $soc->id . '">';
348
-			// Outstanding Bill
349
-			$outstandingBills = $soc->get_OutstandingBill();
350
-			print ' (' . $langs->trans('CurrentOutstandingBill') . ': ';
351
-			print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency);
352
-			if ($soc->outstanding_limit != '')
353
-			{
354
-				if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached"));
355
-				print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency);
356
-			}
357
-			print ')';
358
-			print '</td>';
359
-		}
360
-		else
361
-		{
362
-			print '<td colspan="2">';
363
-			print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
364
-			// Option to reload page to retrieve customer informations. Note, this clear other input
365
-			if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
366
-			{
367
-				print '<script type="text/javascript">
338
+    // Company
339
+    if (! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES))
340
+    {
341
+        // Thirdparty
342
+        print '<td>' . $langs->trans('Customer') . '</td>';
343
+        if ($soc->id > 0 && ! GETPOST('fac_rec','alpha'))
344
+        {
345
+            print '<td colspan="2">';
346
+            print $soc->getNomUrl(1);
347
+            print '<input type="hidden" name="socid" value="' . $soc->id . '">';
348
+            // Outstanding Bill
349
+            $outstandingBills = $soc->get_OutstandingBill();
350
+            print ' (' . $langs->trans('CurrentOutstandingBill') . ': ';
351
+            print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency);
352
+            if ($soc->outstanding_limit != '')
353
+            {
354
+                if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached"));
355
+                print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency);
356
+            }
357
+            print ')';
358
+            print '</td>';
359
+        }
360
+        else
361
+        {
362
+            print '<td colspan="2">';
363
+            print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
364
+            // Option to reload page to retrieve customer informations. Note, this clear other input
365
+            if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
366
+            {
367
+                print '<script type="text/javascript">
368 368
 				$(document).ready(function() {
369 369
 					$("#socid").change(function() {
370 370
 						var socid = $(this).val();
@@ -374,82 +374,82 @@  discard block
 block discarded – undo
374 374
 					});
375 375
 				});
376 376
 				</script>';
377
-			}
377
+            }
378 378
             //print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
379 379
             print ' <a href="' . BASE_URI . '?controller=societe&method=card&action=create&client=3&fournisseur=0&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '">' . $langs->trans("AddThirdParty") . '</a>';
380
-			print '</td>';
381
-		}
382
-		print '</tr>' . "\n";
383
-	}
380
+            print '</td>';
381
+        }
382
+        print '</tr>' . "\n";
383
+    }
384 384
 
385
-	// Date
386
-	print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Date").'</td><td>';
387
-	print $form->selectDate($donation_date?$donation_date:-1, '', '', '', '', "add", 1, 1);
388
-	print '</td>';
385
+    // Date
386
+    print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Date").'</td><td>';
387
+    print $form->selectDate($donation_date?$donation_date:-1, '', '', '', '', "add", 1, 1);
388
+    print '</td>';
389 389
 
390
-	// Amount
391
-	print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.dol_escape_htmltag(GETPOST("amount")).'" size="10"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
390
+    // Amount
391
+    print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.dol_escape_htmltag(GETPOST("amount")).'" size="10"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
392 392
 
393
-	// Public donation
394
-	print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
395
-	print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
396
-	print "</td></tr>\n";
393
+    // Public donation
394
+    print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
395
+    print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
396
+    print "</td></tr>\n";
397 397
 
398
-	if (empty($conf->societe->enabled) || empty($conf->global->DONATION_USE_THIRDPARTIES))
399
-	{
400
-		print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.dol_escape_htmltag(GETPOST("societe")).'" class="maxwidth200"></td></tr>';
401
-		print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.dol_escape_htmltag(GETPOST("lastname")).'" class="maxwidth200"></td></tr>';
402
-		print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.dol_escape_htmltag(GETPOST("firstname")).'" class="maxwidth200"></td></tr>';
403
-		print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
404
-		print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="3">'.dol_escape_htmltag(GETPOST("address")).'</textarea></td></tr>';
405
-
406
-		// Zip / Town
407
-		print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
408
-		print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
409
-		print ' ';
410
-		print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
411
-		print '</tr>';
412
-
413
-		// Country
414
-		print '<tr><td><label for="selectcountry_id">'.$langs->trans('Country').'</label></td><td class="maxwidthonsmartphone">';
415
-		print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id);
416
-		if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
417
-		print '</td></tr>';
418
-
419
-		print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.dol_escape_htmltag(GETPOST("email")).'" class="maxwidth200"></td></tr>';
420
-	}
398
+    if (empty($conf->societe->enabled) || empty($conf->global->DONATION_USE_THIRDPARTIES))
399
+    {
400
+        print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.dol_escape_htmltag(GETPOST("societe")).'" class="maxwidth200"></td></tr>';
401
+        print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.dol_escape_htmltag(GETPOST("lastname")).'" class="maxwidth200"></td></tr>';
402
+        print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.dol_escape_htmltag(GETPOST("firstname")).'" class="maxwidth200"></td></tr>';
403
+        print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
404
+        print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="3">'.dol_escape_htmltag(GETPOST("address")).'</textarea></td></tr>';
405
+
406
+        // Zip / Town
407
+        print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
408
+        print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
409
+        print ' ';
410
+        print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
411
+        print '</tr>';
412
+
413
+        // Country
414
+        print '<tr><td><label for="selectcountry_id">'.$langs->trans('Country').'</label></td><td class="maxwidthonsmartphone">';
415
+        print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id);
416
+        if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
417
+        print '</td></tr>';
421 418
 
422
-	// Payment mode
423
-	print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
424
-	$selected = GETPOST('modepayment','int');
425
-	$form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1);
426
-	print "</td></tr>\n";
419
+        print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.dol_escape_htmltag(GETPOST("email")).'" class="maxwidth200"></td></tr>';
420
+    }
427 421
 
428
-	// Public note
429
-	print '<tr>';
430
-	print '<td class="tdtop">' . $langs->trans('NotePublic') . '</td>';
431
-	print '<td>';
422
+    // Payment mode
423
+    print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
424
+    $selected = GETPOST('modepayment','int');
425
+    $form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1);
426
+    print "</td></tr>\n";
427
+
428
+    // Public note
429
+    print '<tr>';
430
+    print '<td class="tdtop">' . $langs->trans('NotePublic') . '</td>';
431
+    print '<td>';
432 432
 
433 433
     $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
434
-	print $doleditor->Create(1);
435
-	print '</td></tr>';
436
-
437
-	// Private note
438
-	if (empty($user->societe_id)) {
439
-		print '<tr>';
440
-		print '<td class="tdtop">' . $langs->trans('NotePrivate') . '</td>';
441
-		print '<td>';
442
-
443
-		$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
444
-		print $doleditor->Create(1);
445
-		print '</td></tr>';
446
-	}
434
+    print $doleditor->Create(1);
435
+    print '</td></tr>';
436
+
437
+    // Private note
438
+    if (empty($user->societe_id)) {
439
+        print '<tr>';
440
+        print '<td class="tdtop">' . $langs->trans('NotePrivate') . '</td>';
441
+        print '<td>';
447 442
 
448
-	if (! empty($conf->projet->enabled))
443
+        $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
444
+        print $doleditor->Create(1);
445
+        print '</td></tr>';
446
+    }
447
+
448
+    if (! empty($conf->projet->enabled))
449 449
     {
450 450
         print "<tr><td>".$langs->trans("Project")."</td><td>";
451 451
         $formproject->select_projects(-1, $projectid,'fk_project', 0, 0, 1, 1);
452
-		print "</td></tr>\n";
452
+        print "</td></tr>\n";
453 453
     }
454 454
 
455 455
     // Other attributes
@@ -458,21 +458,21 @@  discard block
 block discarded – undo
458 458
     print $hookmanager->resPrint;
459 459
     if (empty($reshook))
460 460
     {
461
-		print $object->showOptionals($extrafields,'edit',$parameters);
461
+        print $object->showOptionals($extrafields,'edit',$parameters);
462 462
     }
463 463
 
464 464
     print '</tbody>';
465
-	print "</table>\n";
465
+    print "</table>\n";
466 466
 
467
-	dol_fiche_end();
467
+    dol_fiche_end();
468 468
 
469
-	print '<div class="center">';
470
-	print '<input type="submit" class="button" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
471
-	print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
472
-	print '<input type="button" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" onClick="javascript:history.go(-1)">';
473
-	print '</div>';
469
+    print '<div class="center">';
470
+    print '<input type="submit" class="button" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
471
+    print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
472
+    print '<input type="button" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" onClick="javascript:history.go(-1)">';
473
+    print '</div>';
474 474
 
475
-	print "</form>\n";
475
+    print "</form>\n";
476 476
 }
477 477
 
478 478
 
@@ -484,80 +484,80 @@  discard block
 block discarded – undo
484 484
 
485 485
 if (! empty($id) && $action == 'edit')
486 486
 {
487
-	$result=$object->fetch($id);
488
-	if ($result < 0) {
489
-		dol_print_error($db,$object->error); exit;
490
-	}
491
-	$result=$object->fetch_optionals();
492
-	if ($result < 0) {
493
-		dol_print_error($db); exit;
494
-	}
487
+    $result=$object->fetch($id);
488
+    if ($result < 0) {
489
+        dol_print_error($db,$object->error); exit;
490
+    }
491
+    $result=$object->fetch_optionals();
492
+    if ($result < 0) {
493
+        dol_print_error($db); exit;
494
+    }
495 495
 
496
-	$hselected='card';
497
-	$head = donation_prepare_head($object);
496
+    $hselected='card';
497
+    $head = donation_prepare_head($object);
498 498
 
499
-	print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
500
-	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
501
-	print '<input type="hidden" name="action" value="update">';
502
-	print '<input type="hidden" name="rowid" value="'.$object->id.'">';
503
-	print '<input type="hidden" name="amount" value="'.$object->amount.'">';
499
+    print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
500
+    print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
501
+    print '<input type="hidden" name="action" value="update">';
502
+    print '<input type="hidden" name="rowid" value="'.$object->id.'">';
503
+    print '<input type="hidden" name="amount" value="'.$object->amount.'">';
504 504
 
505 505
 
506
-	dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
506
+    dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
507 507
 
508
-	print '<table class="border" width="100%">';
508
+    print '<table class="border" width="100%">';
509 509
 
510
-	// Ref
511
-	print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2">';
512
-	print $object->getNomUrl();
513
-	print '</td>';
514
-	print '</tr>';
510
+    // Ref
511
+    print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2">';
512
+    print $object->getNomUrl();
513
+    print '</td>';
514
+    print '</tr>';
515 515
 
516
-	// Date
517
-	print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Date").'</td><td>';
518
-	print $form->selectDate($object->date,'','','','',"update");
519
-	print '</td>';
516
+    // Date
517
+    print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Date").'</td><td>';
518
+    print $form->selectDate($object->date,'','','','',"update");
519
+    print '</td>';
520 520
 
521
-	// Amount
522
-	if ($object->statut == 0)
523
-	{
524
-		print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.dol_escape_htmltag($object->amount).'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
525
-	}
526
-	else
527
-	{
528
-		print '<tr><td>'.$langs->trans("Amount").'</td><td>';
529
-		print price($object->amount,0,$langs,0,0,-1,$conf->currency);
530
-		print '</td></tr>';
531
-	}
521
+    // Amount
522
+    if ($object->statut == 0)
523
+    {
524
+        print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.dol_escape_htmltag($object->amount).'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
525
+    }
526
+    else
527
+    {
528
+        print '<tr><td>'.$langs->trans("Amount").'</td><td>';
529
+        print price($object->amount,0,$langs,0,0,-1,$conf->currency);
530
+        print '</td></tr>';
531
+    }
532 532
 
533
-	print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
534
-	print $form->selectyesno("public",1,1);
535
-	print "</td>";
536
-	print "</tr>\n";
533
+    print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
534
+    print $form->selectyesno("public",1,1);
535
+    print "</td>";
536
+    print "</tr>\n";
537 537
 
538
-	$langs->load("companies");
539
-	print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="maxwidth200" value="'.dol_escape_htmltag($object->societe).'"></td></tr>';
540
-	print '<tr><td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="maxwidth200" value="'.dol_escape_htmltag($object->lastname).'"></td></tr>';
541
-	print '<tr><td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" class="maxwidth200" value="'.dol_escape_htmltag($object->firstname).'"></td></tr>';
542
-	print '<tr><td>'.$langs->trans("Address").'</td><td>';
543
-	print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag($object->address).'</textarea></td></tr>';
538
+    $langs->load("companies");
539
+    print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="maxwidth200" value="'.dol_escape_htmltag($object->societe).'"></td></tr>';
540
+    print '<tr><td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="maxwidth200" value="'.dol_escape_htmltag($object->lastname).'"></td></tr>';
541
+    print '<tr><td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" class="maxwidth200" value="'.dol_escape_htmltag($object->firstname).'"></td></tr>';
542
+    print '<tr><td>'.$langs->trans("Address").'</td><td>';
543
+    print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag($object->address).'</textarea></td></tr>';
544 544
 
545 545
     // Zip / Town
546 546
     print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
547
-	print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
547
+    print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
548 548
     print ' ';
549
-	print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
550
-	print '</tr>';
549
+    print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
550
+    print '</tr>';
551 551
 
552
-	// Country
553
-	print '<tr><td class="titlefieldcreate">'.$langs->trans('Country').'</td><td>';
554
-	print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id');
555
-	if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
556
-	print '</td></tr>';
552
+    // Country
553
+    print '<tr><td class="titlefieldcreate">'.$langs->trans('Country').'</td><td>';
554
+    print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id');
555
+    if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
556
+    print '</td></tr>';
557 557
 
558
-	print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" class="maxwidth200" value="'.dol_escape_htmltag($object->email).'"></td></tr>';
558
+    print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" class="maxwidth200" value="'.dol_escape_htmltag($object->email).'"></td></tr>';
559 559
 
560
-	// Payment mode
560
+    // Payment mode
561 561
     print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
562 562
     if ($object->modepaymentid) $selected = $object->modepaymentid;
563 563
     else $selected = '';
@@ -565,16 +565,16 @@  discard block
 block discarded – undo
565 565
     print "</td></tr>\n";
566 566
 
567 567
     // Status
568
-	print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
568
+    print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
569 569
 
570 570
     // Project
571 571
     if (! empty($conf->projet->enabled))
572 572
     {
573
-    	$formproject=new FormProjets($db);
573
+        $formproject=new FormProjets($db);
574 574
 
575 575
         $langs->load('projects');
576 576
         print '<tr><td>'.$langs->trans('Project').'</td><td>';
577
-		$formproject->select_projects(-1, $object->fk_project,'fk_project', 0, 0, 1, 1);
577
+        $formproject->select_projects(-1, $object->fk_project,'fk_project', 0, 0, 1, 1);
578 578
         print '</td></tr>';
579 579
     }
580 580
 
@@ -584,16 +584,16 @@  discard block
 block discarded – undo
584 584
     print $hookmanager->resPrint;
585 585
     if (empty($reshook))
586 586
     {
587
-      	print $object->showOptionals($extrafields,'edit');
587
+            print $object->showOptionals($extrafields,'edit');
588 588
     }
589 589
 
590
-	print "</table>\n";
590
+    print "</table>\n";
591 591
 
592
-	dol_fiche_end();
592
+    dol_fiche_end();
593 593
 
594
-	print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
594
+    print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
595 595
 
596
-	print "</form>\n";
596
+    print "</form>\n";
597 597
 }
598 598
 
599 599
 
@@ -605,68 +605,68 @@  discard block
 block discarded – undo
605 605
 /* ************************************************************ */
606 606
 if (! empty($id) && $action != 'edit')
607 607
 {
608
-	// Confirmation delete
608
+    // Confirmation delete
609 609
     if ($action == 'delete')
610 610
     {
611 611
         $text=$langs->trans("ConfirmDeleteADonation");
612 612
         print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteADonation"),$text,"confirm_delete",'','',1);
613 613
     }
614 614
 
615
-	$result=$object->fetch($id);
616
-	if ($result < 0) {
617
-		dol_print_error($db,$object->error); exit;
618
-	}
619
-	$result=$object->fetch_optionals();
620
-	if ($result < 0) {
621
-		dol_print_error($db); exit;
622
-	}
615
+    $result=$object->fetch($id);
616
+    if ($result < 0) {
617
+        dol_print_error($db,$object->error); exit;
618
+    }
619
+    $result=$object->fetch_optionals();
620
+    if ($result < 0) {
621
+        dol_print_error($db); exit;
622
+    }
623 623
 
624
-	$hselected='card';
624
+    $hselected='card';
625 625
 
626
-	$head = donation_prepare_head($object);
627
-	dol_fiche_head($head, $hselected, $langs->trans("Donation"), -1, 'generic');
626
+    $head = donation_prepare_head($object);
627
+    dol_fiche_head($head, $hselected, $langs->trans("Donation"), -1, 'generic');
628 628
 
629
-	// Print form confirm
630
-	print $formconfirm;
629
+    // Print form confirm
630
+    print $formconfirm;
631 631
 
632 632
     // $linkback = '<a href="'.DOL_URL_ROOT.'/don/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
633 633
     $linkback = '<a href="' . BASE_URI . '?controller=don&method=list' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
634 634
 
635
-	$morehtmlref='<div class="refidno">';
636
-	// Project
637
-	if (! empty($conf->projet->enabled))
638
-	{
639
-	    $langs->load("projects");
640
-	    $morehtmlref.=$langs->trans('Project') . ' ';
641
-	    if ($user->rights->don->creer)
642
-	    {
643
-	        if ($action != 'classify')
644
-	            $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
645
-	            if ($action == 'classify') {
646
-	                //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
635
+    $morehtmlref='<div class="refidno">';
636
+    // Project
637
+    if (! empty($conf->projet->enabled))
638
+    {
639
+        $langs->load("projects");
640
+        $morehtmlref.=$langs->trans('Project') . ' ';
641
+        if ($user->rights->don->creer)
642
+        {
643
+            if ($action != 'classify')
644
+                $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
645
+                if ($action == 'classify') {
646
+                    //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
647 647
                     $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '&id=' . $object->id . '">';
648
-	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
649
-	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
650
-	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
651
-	                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
652
-	                $morehtmlref.='</form>';
653
-	            } else {
654
-	                $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
655
-	            }
656
-	    } else {
657
-	        if (! empty($object->fk_project)) {
658
-	            $proj = new Project($db);
659
-	            $proj->fetch($object->fk_project);
648
+                    $morehtmlref.='<input type="hidden" name="action" value="classin">';
649
+                    $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
650
+                    $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
651
+                    $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
652
+                    $morehtmlref.='</form>';
653
+                } else {
654
+                    $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
655
+                }
656
+        } else {
657
+            if (! empty($object->fk_project)) {
658
+                $proj = new Project($db);
659
+                $proj->fetch($object->fk_project);
660 660
                 // $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
661 661
                 $morehtmlref .= '<a href="' . BASE_URI . '?controller=projet&methos=card&id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
662
-	            $morehtmlref.=$proj->ref;
663
-	            $morehtmlref.='</a>';
664
-	        } else {
665
-	            $morehtmlref.='';
666
-	        }
667
-	    }
668
-	}
669
-	$morehtmlref.='</div>';
662
+                $morehtmlref.=$proj->ref;
663
+                $morehtmlref.='</a>';
664
+            } else {
665
+                $morehtmlref.='';
666
+            }
667
+        }
668
+    }
669
+    $morehtmlref.='</div>';
670 670
 
671 671
 
672 672
     dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
@@ -678,195 +678,195 @@  discard block
 block discarded – undo
678 678
 
679 679
     print '<table class="border" width="100%">';
680 680
 
681
-	// Date
682
-	print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td colspan="2">';
683
-	print dol_print_date($object->date,"day");
684
-	print "</td>";
681
+    // Date
682
+    print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td colspan="2">';
683
+    print dol_print_date($object->date,"day");
684
+    print "</td>";
685 685
 
686 686
     print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="2">';
687
-	print price($object->amount,0,$langs,0,0,-1,$conf->currency);
688
-	print '</td></tr>';
687
+    print price($object->amount,0,$langs,0,0,-1,$conf->currency);
688
+    print '</td></tr>';
689 689
 
690
-	print '<tr><td>'.$langs->trans("PublicDonation").'</td><td colspan="2">';
691
-	print yn($object->public);
692
-	print '</td></tr>';
690
+    print '<tr><td>'.$langs->trans("PublicDonation").'</td><td colspan="2">';
691
+    print yn($object->public);
692
+    print '</td></tr>';
693 693
 
694
-	print '<tr><td>'.$langs->trans("Company").'</td><td colspan="2">'.$object->societe.'</td></tr>';
695
-	print '<tr><td>'.$langs->trans("Lastname").'</td><td colspan="2">'.$object->lastname.'</td></tr>';
696
-	print '<tr><td>'.$langs->trans("Firstname").'</td><td colspan="2">'.$object->firstname.'</td></tr>';
694
+    print '<tr><td>'.$langs->trans("Company").'</td><td colspan="2">'.$object->societe.'</td></tr>';
695
+    print '<tr><td>'.$langs->trans("Lastname").'</td><td colspan="2">'.$object->lastname.'</td></tr>';
696
+    print '<tr><td>'.$langs->trans("Firstname").'</td><td colspan="2">'.$object->firstname.'</td></tr>';
697 697
 
698
-	// Payment mode
699
-	print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
700
-	$form->form_modes_reglement(null, $object->modepaymentid,'none');
701
-	print "</td></tr>\n";
698
+    // Payment mode
699
+    print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
700
+    $form->form_modes_reglement(null, $object->modepaymentid,'none');
701
+    print "</td></tr>\n";
702 702
 
703
-	// Other attributes
704
-	$cols = 2;
705
-	include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
703
+    // Other attributes
704
+    $cols = 2;
705
+    include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
706 706
 
707
-	print '</table>';
707
+    print '</table>';
708 708
 
709
-	print '</div>';
710
-	print '<div class="fichehalfright">';
711
-	print '<div class="ficheaddleft">';
709
+    print '</div>';
710
+    print '<div class="fichehalfright">';
711
+    print '<div class="ficheaddleft">';
712 712
 
713
-	/*
713
+    /*
714 714
 	 * Payments
715 715
 	 */
716
-	$sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount,";
717
-	$sql.= "c.code as type_code,c.libelle as paiement_type";
718
-	$sql.= " FROM ".MAIN_DB_PREFIX."payment_donation as p";
719
-	$sql.= ", ".MAIN_DB_PREFIX."c_paiement as c ";
720
-	$sql.= ", ".MAIN_DB_PREFIX."don as d";
721
-	$sql.= " WHERE d.rowid = '".$id."'";
722
-	$sql.= " AND p.fk_donation = d.rowid";
723
-	$sql.= " AND d.entity IN (".getEntity('donation').")";
724
-	$sql.= " AND p.fk_typepayment = c.id";
725
-	$sql.= " ORDER BY dp";
726
-
727
-	//print $sql;
728
-	$resql = $db->query($sql);
729
-	if ($resql)
730
-	{
731
-		$num = $db->num_rows($resql);
732
-		$i = 0; $total = 0;
733
-		print '<table class="noborder" width="100%">';
734
-		print '<tr class="liste_titre">';
735
-		print '<td>'.$langs->trans("RefPayment").'</td>';
736
-		print '<td>'.$langs->trans("Date").'</td>';
737
-		print '<td>'.$langs->trans("Type").'</td>';
738
-   		print '<td align="right">'.$langs->trans("Amount").'</td>';
739
-   		print '</tr>';
740
-
741
-		while ($i < $num)
742
-		{
743
-			$objp = $db->fetch_object($resql);
744
-
745
-			print '<tr class="oddeven"><td>';
716
+    $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount,";
717
+    $sql.= "c.code as type_code,c.libelle as paiement_type";
718
+    $sql.= " FROM ".MAIN_DB_PREFIX."payment_donation as p";
719
+    $sql.= ", ".MAIN_DB_PREFIX."c_paiement as c ";
720
+    $sql.= ", ".MAIN_DB_PREFIX."don as d";
721
+    $sql.= " WHERE d.rowid = '".$id."'";
722
+    $sql.= " AND p.fk_donation = d.rowid";
723
+    $sql.= " AND d.entity IN (".getEntity('donation').")";
724
+    $sql.= " AND p.fk_typepayment = c.id";
725
+    $sql.= " ORDER BY dp";
726
+
727
+    //print $sql;
728
+    $resql = $db->query($sql);
729
+    if ($resql)
730
+    {
731
+        $num = $db->num_rows($resql);
732
+        $i = 0; $total = 0;
733
+        print '<table class="noborder" width="100%">';
734
+        print '<tr class="liste_titre">';
735
+        print '<td>'.$langs->trans("RefPayment").'</td>';
736
+        print '<td>'.$langs->trans("Date").'</td>';
737
+        print '<td>'.$langs->trans("Type").'</td>';
738
+            print '<td align="right">'.$langs->trans("Amount").'</td>';
739
+            print '</tr>';
740
+
741
+        while ($i < $num)
742
+        {
743
+            $objp = $db->fetch_object($resql);
744
+
745
+            print '<tr class="oddeven"><td>';
746 746
             // print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
747 747
             print '<a href="' . BASE_URI . '?controller=don/payment&method=card&id=' . $objp->rowid . '">' . img_object($langs->trans("Payment"), "payment") . ' ' . $objp->rowid . '</a></td>';
748
-			print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
749
-		    $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type;
748
+            print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
749
+            $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type;
750 750
             print "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
751
-			print '<td align="right">'.price($objp->amount)."</td>\n";
752
-			print "</tr>";
753
-			$totalpaid += $objp->amount;
754
-			$i++;
755
-		}
756
-
757
-		if ($object->paid == 0)
758
-		{
759
-			print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\">".price($totalpaid)."</td></tr>\n";
760
-			print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\">".price($object->amount)."</td></tr>\n";
761
-
762
-			$remaintopay = $object->amount - $totalpaid;
763
-
764
-			print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
765
-			print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':'').'><b>'.price($remaintopay)."</b></td></tr>\n";
766
-		}
767
-		print "</table>";
768
-		$db->free($resql);
769
-	}
770
-	else
771
-	{
772
-		dol_print_error($db);
773
-	}
751
+            print '<td align="right">'.price($objp->amount)."</td>\n";
752
+            print "</tr>";
753
+            $totalpaid += $objp->amount;
754
+            $i++;
755
+        }
756
+
757
+        if ($object->paid == 0)
758
+        {
759
+            print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\">".price($totalpaid)."</td></tr>\n";
760
+            print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\">".price($object->amount)."</td></tr>\n";
761
+
762
+            $remaintopay = $object->amount - $totalpaid;
763
+
764
+            print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
765
+            print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':'').'><b>'.price($remaintopay)."</b></td></tr>\n";
766
+        }
767
+        print "</table>";
768
+        $db->free($resql);
769
+    }
770
+    else
771
+    {
772
+        dol_print_error($db);
773
+    }
774 774
 
775
-	print '</div>';
776
-	print '</div>';
777
-	print '</div>';
775
+    print '</div>';
776
+    print '</div>';
777
+    print '</div>';
778 778
 
779
-	print '<div class="clearboth"></div>';
779
+    print '<div class="clearboth"></div>';
780 780
 
781 781
     dol_fiche_end();
782 782
 
783
-	$remaintopay = $object->amount - $totalpaid;
783
+    $remaintopay = $object->amount - $totalpaid;
784 784
 
785
-	// Actions buttons
785
+    // Actions buttons
786 786
 
787
-	print '<div class="tabsAction">';
787
+    print '<div class="tabsAction">';
788 788
 
789
-	print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=edit&rowid='.$object->id.'">'.$langs->trans('Modify').'</a></div>';
789
+    print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=edit&rowid='.$object->id.'">'.$langs->trans('Modify').'</a></div>';
790 790
 
791
-	if ($object->statut == 0)
792
-	{
793
-		print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?rowid='.$object->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a></div>';
794
-	}
791
+    if ($object->statut == 0)
792
+    {
793
+        print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?rowid='.$object->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a></div>';
794
+    }
795 795
 
796 796
     if (($object->statut == 0 || $object->statut == 1) && $totalpaid == 0 && $object->paid == 0)
797 797
     {
798 798
         print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?rowid='.$object->id.'&action=set_cancel">'.$langs->trans("ClassifyCanceled")."</a></div>";
799 799
     }
800 800
 
801
-	// Create payment
802
-	if ($object->statut == 1 && $object->paid == 0 && $user->rights->don->creer)
803
-	{
804
-		if ($remaintopay == 0)
805
-		{
806
-			print '<div class="inline-block divButAction"><span class="butActionRefused classfortooltip" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
807
-		}
808
-		else
809
-		{
810
-			print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/don/payment/payment.php?rowid=' . $object->id . '&amp;action=create">' . $langs->trans('DoPayment') . '</a></div>';
811
-		}
812
-	}
801
+    // Create payment
802
+    if ($object->statut == 1 && $object->paid == 0 && $user->rights->don->creer)
803
+    {
804
+        if ($remaintopay == 0)
805
+        {
806
+            print '<div class="inline-block divButAction"><span class="butActionRefused classfortooltip" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
807
+        }
808
+        else
809
+        {
810
+            print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/don/payment/payment.php?rowid=' . $object->id . '&amp;action=create">' . $langs->trans('DoPayment') . '</a></div>';
811
+        }
812
+    }
813 813
 
814
-	// Classify 'paid'
815
-	if ($object->statut == 1 && round($remaintopay) == 0 && $object->paid == 0 && $user->rights->don->creer)
816
-	{
817
-		print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?rowid='.$object->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
818
-	}
814
+    // Classify 'paid'
815
+    if ($object->statut == 1 && round($remaintopay) == 0 && $object->paid == 0 && $user->rights->don->creer)
816
+    {
817
+        print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?rowid='.$object->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
818
+    }
819 819
 
820
-	// Delete
821
-	if ($user->rights->don->supprimer)
822
-	{
823
-		if ($object->statut == -1 || $object->statut == 0)
824
-		{
825
-			print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$object->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
826
-		}
827
-		else
828
-		{
829
-			print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("Delete")."</a></div>";
830
-		}
831
-	}
832
-	else
833
-	{
834
-		print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("Delete")."</a></div>";
835
-	}
820
+    // Delete
821
+    if ($user->rights->don->supprimer)
822
+    {
823
+        if ($object->statut == -1 || $object->statut == 0)
824
+        {
825
+            print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$object->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
826
+        }
827
+        else
828
+        {
829
+            print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("Delete")."</a></div>";
830
+        }
831
+    }
832
+    else
833
+    {
834
+        print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("Delete")."</a></div>";
835
+    }
836 836
 
837
-	print "</div>";
837
+    print "</div>";
838 838
 
839 839
 
840 840
     print '<div class="fichecenter"><div class="fichehalfleft">';
841 841
 
842
-	/*
842
+    /*
843 843
 	 * Documents generes
844 844
 	 */
845
-	$filename	=	dol_sanitizeFileName($object->id);
846
-	$filedir	=	$conf->don->dir_output . "/" . dol_sanitizeFileName($object->id);
845
+    $filename	=	dol_sanitizeFileName($object->id);
846
+    $filedir	=	$conf->don->dir_output . "/" . dol_sanitizeFileName($object->id);
847 847
     $urlsource = $_SERVER['PHP_SELF'] . '&rowid=' . $object->id;
848
-	$genallowed	=	(($object->paid == 0 || $user->admin) && $user->rights->don->lire);
849
-	$delallowed	=	$user->rights->don->creer;
848
+    $genallowed	=	(($object->paid == 0 || $user->admin) && $user->rights->don->lire);
849
+    $delallowed	=	$user->rights->don->creer;
850 850
 
851
-	print $formfile->showdocuments('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
851
+    print $formfile->showdocuments('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
852 852
 
853
-	// Show links to link elements
854
-	$linktoelem = $form->showLinkToObjectBlock($object, null, array('don'));
855
-	$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
853
+    // Show links to link elements
854
+    $linktoelem = $form->showLinkToObjectBlock($object, null, array('don'));
855
+    $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
856 856
 
857
-		// Show online payment link
858
-		$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
857
+        // Show online payment link
858
+        $useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
859 859
 
860
-		if ($useonlinepayment) //$object->statut != Facture::STATUS_DRAFT &&
861
-		{
862
-			print '<br><!-- Link to pay -->'."\n";
863
-			require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
864
-			print showOnlinePaymentUrl('donation', $object->ref).'<br>';
865
-		}
860
+        if ($useonlinepayment) //$object->statut != Facture::STATUS_DRAFT &&
861
+        {
862
+            print '<br><!-- Link to pay -->'."\n";
863
+            require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
864
+            print showOnlinePaymentUrl('donation', $object->ref).'<br>';
865
+        }
866 866
 
867
-	print '</div><div class="fichehalfright"><div class="ficheaddleft">';
867
+    print '</div><div class="fichehalfright"><div class="ficheaddleft">';
868 868
 
869
-	print '</div></div></div>';
869
+    print '</div></div></div>';
870 870
 }
871 871
 
872 872
 llxFooter();
Please login to merge, or discard this patch.
Braces   +41 added lines, -35 removed lines patch added patch discarded remove patch
@@ -74,7 +74,9 @@  discard block
 block discarded – undo
74 74
  */
75 75
 
76 76
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
77
-if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
77
+if ($reshook < 0) {
78
+    setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
79
+}
78 80
 
79 81
 if ($action == 'update')
80 82
 {
@@ -122,7 +124,9 @@  discard block
 block discarded – undo
122 124
 
123 125
 		// Fill array 'array_options' with data from add form
124 126
         $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
125
-		if ($ret < 0) $error++;
127
+		if ($ret < 0) {
128
+		    $error++;
129
+		}
126 130
 
127 131
 		if ($object->update($user) > 0)
128 132
 		{
@@ -176,15 +180,16 @@  discard block
 block discarded – undo
176 180
 
177 181
 		// Fill array 'array_options' with data from add form
178 182
         $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
179
-		if ($ret < 0) $error++;
183
+		if ($ret < 0) {
184
+		    $error++;
185
+		}
180 186
 
181 187
 		$res = $object->create($user);
182 188
 		if ($res > 0)
183 189
 		{
184 190
 			header("Location: ".$_SERVER['PHP_SELF'].'?id='.$res);
185 191
 			exit;
186
-		}
187
-		else
192
+		} else
188 193
 		{
189 194
 			setEventMessages($object->error, $object->errors, 'errors');
190 195
 		}
@@ -198,8 +203,7 @@  discard block
 block discarded – undo
198 203
     {
199 204
         header("Location: index.php");
200 205
         exit;
201
-    }
202
-    else
206
+    } else
203 207
     {
204 208
         dol_syslog($object->error,LOG_DEBUG);
205 209
         setEventMessages($object->error, $object->errors, 'errors');
@@ -214,8 +218,7 @@  discard block
 block discarded – undo
214 218
 
215 219
 		header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
216 220
 		exit;
217
-	}
218
-    else {
221
+	} else {
219 222
 	    setEventMessages($object->error, $object->errors, 'errors');
220 223
     }
221 224
 }
@@ -226,8 +229,7 @@  discard block
 block discarded – undo
226 229
     {
227 230
         header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
228 231
         exit;
229
-    }
230
-    else {
232
+    } else {
231 233
 	    setEventMessages($object->error, $object->errors, 'errors');
232 234
     }
233 235
 }
@@ -238,12 +240,10 @@  discard block
 block discarded – undo
238 240
 	{
239 241
 		header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
240 242
 		exit;
241
-	}
242
-    else {
243
+	} else {
243 244
 	    setEventMessages($object->error, $object->errors, 'errors');
244 245
     }
245
-}
246
-else if ($action == 'classin' && $user->rights->don->creer)
246
+} else if ($action == 'classin' && $user->rights->don->creer)
247 247
 {
248 248
 	$object->fetch($id);
249 249
 	$object->setProject($projectid);
@@ -351,13 +351,14 @@  discard block
 block discarded – undo
351 351
 			print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency);
352 352
 			if ($soc->outstanding_limit != '')
353 353
 			{
354
-				if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached"));
354
+				if ($outstandingBills > $soc->outstanding_limit) {
355
+				    print img_warning($langs->trans("OutstandingBillReached"));
356
+				}
355 357
 				print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency);
356 358
 			}
357 359
 			print ')';
358 360
 			print '</td>';
359
-		}
360
-		else
361
+		} else
361 362
 		{
362 363
 			print '<td colspan="2">';
363 364
 			print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
@@ -413,7 +414,9 @@  discard block
 block discarded – undo
413 414
 		// Country
414 415
 		print '<tr><td><label for="selectcountry_id">'.$langs->trans('Country').'</label></td><td class="maxwidthonsmartphone">';
415 416
 		print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id);
416
-		if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
417
+		if ($user->admin) {
418
+		    print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
419
+		}
417 420
 		print '</td></tr>';
418 421
 
419 422
 		print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.dol_escape_htmltag(GETPOST("email")).'" class="maxwidth200"></td></tr>';
@@ -522,8 +525,7 @@  discard block
 block discarded – undo
522 525
 	if ($object->statut == 0)
523 526
 	{
524 527
 		print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.dol_escape_htmltag($object->amount).'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
525
-	}
526
-	else
528
+	} else
527 529
 	{
528 530
 		print '<tr><td>'.$langs->trans("Amount").'</td><td>';
529 531
 		print price($object->amount,0,$langs,0,0,-1,$conf->currency);
@@ -552,15 +554,20 @@  discard block
 block discarded – undo
552 554
 	// Country
553 555
 	print '<tr><td class="titlefieldcreate">'.$langs->trans('Country').'</td><td>';
554 556
 	print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id');
555
-	if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
557
+	if ($user->admin) {
558
+	    print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
559
+	}
556 560
 	print '</td></tr>';
557 561
 
558 562
 	print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" class="maxwidth200" value="'.dol_escape_htmltag($object->email).'"></td></tr>';
559 563
 
560 564
 	// Payment mode
561 565
     print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
562
-    if ($object->modepaymentid) $selected = $object->modepaymentid;
563
-    else $selected = '';
566
+    if ($object->modepaymentid) {
567
+        $selected = $object->modepaymentid;
568
+    } else {
569
+        $selected = '';
570
+    }
564 571
     $form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1);
565 572
     print "</td></tr>\n";
566 573
 
@@ -640,8 +647,9 @@  discard block
 block discarded – undo
640 647
 	    $morehtmlref.=$langs->trans('Project') . ' ';
641 648
 	    if ($user->rights->don->creer)
642 649
 	    {
643
-	        if ($action != 'classify')
644
-	            $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
650
+	        if ($action != 'classify') {
651
+	        	            $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
652
+	        }
645 653
 	            if ($action == 'classify') {
646 654
 	                //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
647 655
                     $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '&id=' . $object->id . '">';
@@ -766,8 +774,7 @@  discard block
 block discarded – undo
766 774
 		}
767 775
 		print "</table>";
768 776
 		$db->free($resql);
769
-	}
770
-	else
777
+	} else
771 778
 	{
772 779
 		dol_print_error($db);
773 780
 	}
@@ -804,8 +811,7 @@  discard block
 block discarded – undo
804 811
 		if ($remaintopay == 0)
805 812
 		{
806 813
 			print '<div class="inline-block divButAction"><span class="butActionRefused classfortooltip" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
807
-		}
808
-		else
814
+		} else
809 815
 		{
810 816
 			print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/don/payment/payment.php?rowid=' . $object->id . '&amp;action=create">' . $langs->trans('DoPayment') . '</a></div>';
811 817
 		}
@@ -823,13 +829,11 @@  discard block
 block discarded – undo
823 829
 		if ($object->statut == -1 || $object->statut == 0)
824 830
 		{
825 831
 			print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$object->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
826
-		}
827
-		else
832
+		} else
828 833
 		{
829 834
 			print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("Delete")."</a></div>";
830 835
 		}
831
-	}
832
-	else
836
+	} else
833 837
 	{
834 838
 		print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("Delete")."</a></div>";
835 839
 	}
@@ -857,9 +861,11 @@  discard block
 block discarded – undo
857 861
 		// Show online payment link
858 862
 		$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
859 863
 
860
-		if ($useonlinepayment) //$object->statut != Facture::STATUS_DRAFT &&
864
+		if ($useonlinepayment) {
865
+		    //$object->statut != Facture::STATUS_DRAFT &&
861 866
 		{
862 867
 			print '<br><!-- Link to pay -->'."\n";
868
+		}
863 869
 			require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
864 870
 			print showOnlinePaymentUrl('donation', $object->ref).'<br>';
865 871
 		}
Please login to merge, or discard this patch.
dolibarr/htdocs/don/note.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 
64 64
 if ($action == 'classin' && $user->rights->don->creer)
65 65
 {
66
-	$object->fetch($id);
67
-	$object->setProject($projectid);
66
+    $object->fetch($id);
67
+    $object->setProject($projectid);
68 68
 }
69 69
 
70 70
 /*
@@ -80,61 +80,61 @@  discard block
 block discarded – undo
80 80
 
81 81
 if ($id > 0 || ! empty($ref))
82 82
 {
83
-	$object = new Don($db);
84
-	$object->fetch($id,$ref);
83
+    $object = new Don($db);
84
+    $object->fetch($id,$ref);
85 85
 
86
-	$head = donation_prepare_head($object);
86
+    $head = donation_prepare_head($object);
87 87
 
88
-	dol_fiche_head($head, 'note', $langs->trans("Donation"), -1, 'generic');
88
+    dol_fiche_head($head, 'note', $langs->trans("Donation"), -1, 'generic');
89 89
 
90 90
     // $linkback = '<a href="'.DOL_URL_ROOT.'/don/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
91 91
     $linkback = '<a href="' . BASE_URI . '?controller=don&method=list' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
92 92
 
93
-	$morehtmlref='<div class="refidno">';
94
-	// Project
95
-	if (! empty($conf->projet->enabled))
96
-	{
97
-	    $langs->load("projects");
98
-	    $morehtmlref.=$langs->trans('Project') . ' ';
99
-	    if ($user->rights->don->creer)
100
-	    {
101
-	        if ($action != 'classify')
102
-	            // $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
103
-	            if ($action == 'classify') {
104
-	                //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
93
+    $morehtmlref='<div class="refidno">';
94
+    // Project
95
+    if (! empty($conf->projet->enabled))
96
+    {
97
+        $langs->load("projects");
98
+        $morehtmlref.=$langs->trans('Project') . ' ';
99
+        if ($user->rights->don->creer)
100
+        {
101
+            if ($action != 'classify')
102
+                // $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
103
+                if ($action == 'classify') {
104
+                    //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
105 105
                     $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '&id=' . $object->id . '">';
106
-	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
107
-	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
108
-	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
109
-	                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
110
-	                $morehtmlref.='</form>';
111
-	            } else {
106
+                    $morehtmlref.='<input type="hidden" name="action" value="classin">';
107
+                    $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
108
+                    $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
109
+                    $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
110
+                    $morehtmlref.='</form>';
111
+                } else {
112 112
                     $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '&id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
113
-	            }
114
-	    } else {
115
-	        if (! empty($object->fk_project)) {
116
-	            $proj = new Project($db);
117
-	            $proj->fetch($object->fk_project);
113
+                }
114
+        } else {
115
+            if (! empty($object->fk_project)) {
116
+                $proj = new Project($db);
117
+                $proj->fetch($object->fk_project);
118 118
                 //$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
119 119
                 $morehtmlref .= '<a href="' . BASE_URI . '?controller=projet&method=card&id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
120
-	            $morehtmlref.=$proj->ref;
121
-	            $morehtmlref.='</a>';
122
-	        } else {
123
-	            $morehtmlref.='';
124
-	        }
125
-	    }
126
-	}
127
-	$morehtmlref.='</div>';
120
+                $morehtmlref.=$proj->ref;
121
+                $morehtmlref.='</a>';
122
+            } else {
123
+                $morehtmlref.='';
124
+            }
125
+        }
126
+    }
127
+    $morehtmlref.='</div>';
128 128
 
129
-	dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
129
+    dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
130 130
 
131
-	print '<div class="fichecenter">';
132
-	print '<div class="underbanner clearboth"></div>';
131
+    print '<div class="fichecenter">';
132
+    print '<div class="underbanner clearboth"></div>';
133 133
 
134
-	$cssclass="titlefield";
135
-	include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
134
+    $cssclass="titlefield";
135
+    include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
136 136
 
137
-	dol_fiche_end();
137
+    dol_fiche_end();
138 138
 }
139 139
 
140 140
 llxFooter();
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 // Security check
49 49
 $socid=0;
50
-if ($user->societe_id) $socid=$user->societe_id;
50
+if ($user->societe_id) {
51
+    $socid=$user->societe_id;
52
+}
51 53
 $result=restrictedArea($user,'don',$id,'');
52 54
 
53 55
 $object = new Don($db);
@@ -98,11 +100,12 @@  discard block
 block discarded – undo
98 100
 	    $morehtmlref.=$langs->trans('Project') . ' ';
99 101
 	    if ($user->rights->don->creer)
100 102
 	    {
101
-	        if ($action != 'classify')
102
-	            // $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
103
+	        if ($action != 'classify') {
104
+	        	            // $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
103 105
 	            if ($action == 'classify') {
104 106
 	                //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
105 107
                     $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '&id=' . $object->id . '">';
108
+	        }
106 109
 	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
107 110
 	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
108 111
 	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
Please login to merge, or discard this patch.
dolibarr/htdocs/don/list.php 1 patch
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 
57 57
 if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
58 58
 {
59
-	$search_all="";
59
+    $search_all="";
60 60
     $search_ref="";
61
-	$search_company="";
62
-	$search_name="";
63
-	$search_amount="";
61
+    $search_company="";
62
+    $search_name="";
63
+    $search_amount="";
64 64
 }
65 65
 
66 66
 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 $sql.= " ON p.rowid = d.fk_projet WHERE d.entity IN (".getEntity('donation').")";
95 95
 if ($statut != '' && $statut != '-1')
96 96
 {
97
-	$sql .= " AND d.fk_statut IN (".$db->escape($statut).")";
97
+    $sql .= " AND d.fk_statut IN (".$db->escape($statut).")";
98 98
 }
99 99
 if (trim($search_ref) != '')
100 100
 {
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
 $nbtotalofrecords = '';
120 120
 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
121 121
 {
122
-	$result = $db->query($sql);
123
-	$nbtotalofrecords = $db->num_rows($result);
124
-	if (($page * $limit) > $nbtotalofrecords)	// if total resultset is smaller then paging size (filtering), goto and load page 0
125
-	{
126
-		$page = 0;
127
-		$offset = 0;
128
-	}
122
+    $result = $db->query($sql);
123
+    $nbtotalofrecords = $db->num_rows($result);
124
+    if (($page * $limit) > $nbtotalofrecords)	// if total resultset is smaller then paging size (filtering), goto and load page 0
125
+    {
126
+        $page = 0;
127
+        $offset = 0;
128
+    }
129 129
 }
130 130
 
131 131
 $sql.= $db->plimit($limit+1, $offset);
@@ -133,34 +133,34 @@  discard block
 block discarded – undo
133 133
 $resql = $db->query($sql);
134 134
 if ($resql)
135 135
 {
136
-	$num = $db->num_rows($resql);
137
-	$i = 0;
136
+    $num = $db->num_rows($resql);
137
+    $i = 0;
138 138
 
139
-	$param = '&statut='.$statut;
139
+    $param = '&statut='.$statut;
140 140
     //if ($page > 0) $param.= '&page='.$page;
141
-	if ($optioncss != '') $param.='&optioncss='.$optioncss;
141
+    if ($optioncss != '') $param.='&optioncss='.$optioncss;
142 142
 
143
-	$newcardbutton='';
144
-	if ($user->rights->don->creer)
145
-	{
143
+    $newcardbutton='';
144
+    if ($user->rights->don->creer)
145
+    {
146 146
         // $newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/don/card.php?action=create"><span class="valignmiddle">'.$langs->trans('NewDonation').'</span>';
147 147
         $newcardbutton = '<a class="butActionNew" href="' . BASE_URI . '?controller=don&method=card&action=create"><span class="valignmiddle">' . $langs->trans('NewDonation') . '</span>';
148
-		$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
149
-		$newcardbutton.= '</a>';
150
-	}
148
+        $newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
149
+        $newcardbutton.= '</a>';
150
+    }
151 151
 
152
-	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
152
+    print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
153 153
     if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
154
-	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
155
-	print '<input type="hidden" name="action" value="list">';
156
-	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
157
-	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
154
+    print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
155
+    print '<input type="hidden" name="action" value="list">';
156
+    print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
157
+    print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
158 158
     print '<input type="hidden" name="page" value="'.$page.'">';
159
-	print '<input type="hidden" name="type" value="'.$type.'">';
159
+    print '<input type="hidden" name="type" value="'.$type.'">';
160 160
 
161
-	print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords, 'title_generic.png', 0, $newcardbutton);
161
+    print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords, 'title_generic.png', 0, $newcardbutton);
162 162
 
163
-	if ($search_all)
163
+    if ($search_all)
164 164
     {
165 165
         foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
166 166
         print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall).'</div>';
@@ -195,65 +195,65 @@  discard block
 block discarded – undo
195 195
     $searchpicto=$form->showFilterAndCheckAddButtons(0);
196 196
     print $searchpicto;
197 197
     print '</td>';
198
-	print "</tr>\n";
198
+    print "</tr>\n";
199 199
 
200
-	print '<tr class="liste_titre">';
201
-	print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"d.rowid","", $param,"",$sortfield,$sortorder);
202
-	print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"d.societe","", $param,"",$sortfield,$sortorder);
203
-	print_liste_field_titre("Name",$_SERVER["PHP_SELF"],"d.lastname","", $param,"",$sortfield,$sortorder);
204
-	print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"d.datedon","", $param,'align="center"',$sortfield,$sortorder);
205
-	if (! empty($conf->projet->enabled))
206
-	{
207
-	    $langs->load("projects");
208
-	    print_liste_field_titre("Project",$_SERVER["PHP_SELF"],"fk_projet","", $param,"",$sortfield,$sortorder);
209
-	}
210
-	print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"d.amount","", $param,'align="right"',$sortfield,$sortorder);
211
-	print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"d.fk_statut","", $param,'align="right"',$sortfield,$sortorder);
212
-	print_liste_field_titre('');
213
-	print "</tr>\n";
200
+    print '<tr class="liste_titre">';
201
+    print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"d.rowid","", $param,"",$sortfield,$sortorder);
202
+    print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"d.societe","", $param,"",$sortfield,$sortorder);
203
+    print_liste_field_titre("Name",$_SERVER["PHP_SELF"],"d.lastname","", $param,"",$sortfield,$sortorder);
204
+    print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"d.datedon","", $param,'align="center"',$sortfield,$sortorder);
205
+    if (! empty($conf->projet->enabled))
206
+    {
207
+        $langs->load("projects");
208
+        print_liste_field_titre("Project",$_SERVER["PHP_SELF"],"fk_projet","", $param,"",$sortfield,$sortorder);
209
+    }
210
+    print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"d.amount","", $param,'align="right"',$sortfield,$sortorder);
211
+    print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"d.fk_statut","", $param,'align="right"',$sortfield,$sortorder);
212
+    print_liste_field_titre('');
213
+    print "</tr>\n";
214 214
 
215
-	while ($i < min($num,$limit))
216
-	{
217
-		$objp = $db->fetch_object($resql);
215
+    while ($i < min($num,$limit))
216
+    {
217
+        $objp = $db->fetch_object($resql);
218 218
 
219
-		print '<tr class="oddeven">';
220
-		$donationstatic->id=$objp->rowid;
221
-		$donationstatic->ref=$objp->rowid;
222
-		$donationstatic->lastname=$objp->lastname;
223
-		$donationstatic->firstname=$objp->firstname;
224
-		print "<td>".$donationstatic->getNomUrl(1)."</td>\n";
219
+        print '<tr class="oddeven">';
220
+        $donationstatic->id=$objp->rowid;
221
+        $donationstatic->ref=$objp->rowid;
222
+        $donationstatic->lastname=$objp->lastname;
223
+        $donationstatic->firstname=$objp->firstname;
224
+        print "<td>".$donationstatic->getNomUrl(1)."</td>\n";
225 225
         print "<td>".$objp->societe."</td>\n";
226
-		print "<td>".$donationstatic->getFullName($langs)."</td>\n";
227
-		print '<td align="center">'.dol_print_date($db->jdate($objp->datedon),'day').'</td>';
228
-		if (! empty($conf->projet->enabled))
229
-		{
230
-			print "<td>";
231
-			if ($objp->pid)
232
-			{
233
-				$projectstatic->id=$objp->pid;
234
-				$projectstatic->ref=$objp->ref;
235
-				$projectstatic->id=$objp->pid;
236
-				$projectstatic->public=$objp->public;
237
-				$projectstatic->title=$objp->title;
238
-				print $projectstatic->getNomUrl(1);
239
-			}
240
-			else print '&nbsp;';
241
-			print "</td>\n";
242
-		}
243
-		print '<td align="right">'.price($objp->amount).'</td>';
244
-		print '<td align="right">'.$donationstatic->LibStatut($objp->statut,5).'</td>';
226
+        print "<td>".$donationstatic->getFullName($langs)."</td>\n";
227
+        print '<td align="center">'.dol_print_date($db->jdate($objp->datedon),'day').'</td>';
228
+        if (! empty($conf->projet->enabled))
229
+        {
230
+            print "<td>";
231
+            if ($objp->pid)
232
+            {
233
+                $projectstatic->id=$objp->pid;
234
+                $projectstatic->ref=$objp->ref;
235
+                $projectstatic->id=$objp->pid;
236
+                $projectstatic->public=$objp->public;
237
+                $projectstatic->title=$objp->title;
238
+                print $projectstatic->getNomUrl(1);
239
+            }
240
+            else print '&nbsp;';
241
+            print "</td>\n";
242
+        }
243
+        print '<td align="right">'.price($objp->amount).'</td>';
244
+        print '<td align="right">'.$donationstatic->LibStatut($objp->statut,5).'</td>';
245 245
         print '<td></td>';
246
-		print "</tr>";
247
-		$i++;
248
-	}
249
-	print "</table>";
250
-	print '</div>';
246
+        print "</tr>";
247
+        $i++;
248
+    }
249
+    print "</table>";
250
+    print '</div>';
251 251
     print "</form>\n";
252 252
     $db->free($resql);
253 253
 }
254 254
 else
255 255
 {
256
-	dol_print_error($db);
256
+    dol_print_error($db);
257 257
 }
258 258
 
259 259
 llxFooter();
Please login to merge, or discard this patch.
dolibarr/htdocs/don/info.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@  discard block
 block discarded – undo
40 40
 $projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
41 41
 
42 42
 // Security check
43
-if ($user->societe_id) $socid = $user->societe_id;
43
+if ($user->societe_id) {
44
+    $socid = $user->societe_id;
45
+}
44 46
 $result = restrictedArea($user, 'don', $id, '');
45 47
 
46 48
 $object = new Don($db);
@@ -80,11 +82,12 @@  discard block
 block discarded – undo
80 82
     $langs->load("projects");
81 83
     $morehtmlref .= $langs->trans('Project') . ' ';
82 84
     if ($user->rights->don->creer) {
83
-        if ($action != 'classify')
84
-            // $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
85
+        if ($action != 'classify') {
86
+                    // $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
85 87
             if ($action == 'classify') {
86 88
                 //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
87 89
                 $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '&id=' . $object->id . '">';
90
+        }
88 91
                 $morehtmlref .= '<input type="hidden" name="action" value="classin">';
89 92
                 $morehtmlref .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
90 93
                 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
Please login to merge, or discard this patch.
dolibarr/htdocs/don/document.php 2 patches
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 
86 86
 if ($action == 'classin' && $user->rights->don->creer)
87 87
 {
88
-	$object->fetch($id);
89
-	$object->setProject($projectid);
88
+    $object->fetch($id);
89
+    $object->setProject($projectid);
90 90
 }
91 91
 
92 92
 /*
@@ -103,77 +103,77 @@  discard block
 block discarded – undo
103 103
 
104 104
 if ($object->id)
105 105
 {
106
-	$object->fetch_thirdparty();
106
+    $object->fetch_thirdparty();
107 107
 
108
-	$head=donation_prepare_head($object);
108
+    $head=donation_prepare_head($object);
109 109
 
110
-	dol_fiche_head($head, 'documents',  $langs->trans("Donation"), -1, 'generic');
110
+    dol_fiche_head($head, 'documents',  $langs->trans("Donation"), -1, 'generic');
111 111
 
112 112
 
113
-	// Build file list
114
-	$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
115
-	$totalsize=0;
116
-	foreach($filearray as $key => $file)
117
-	{
118
-		$totalsize+=$file['size'];
119
-	}
113
+    // Build file list
114
+    $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
115
+    $totalsize=0;
116
+    foreach($filearray as $key => $file)
117
+    {
118
+        $totalsize+=$file['size'];
119
+    }
120 120
 
121 121
     // $linkback = '<a href="'.DOL_URL_ROOT.'/don/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
122 122
     $linkback = '<a href="' . BASE_URI . '?controller=don&method=list' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
123 123
 
124
-	$morehtmlref='<div class="refidno">';
125
-	// Project
126
-	if (! empty($conf->projet->enabled))
127
-	{
128
-	    $langs->load("projects");
129
-	    $morehtmlref.=$langs->trans('Project') . ' ';
130
-	    if ($user->rights->don->creer)
131
-	    {
132
-	        if ($action != 'classify')
133
-	            // $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
134
-	            if ($action == 'classify') {
135
-	                //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
124
+    $morehtmlref='<div class="refidno">';
125
+    // Project
126
+    if (! empty($conf->projet->enabled))
127
+    {
128
+        $langs->load("projects");
129
+        $morehtmlref.=$langs->trans('Project') . ' ';
130
+        if ($user->rights->don->creer)
131
+        {
132
+            if ($action != 'classify')
133
+                // $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
134
+                if ($action == 'classify') {
135
+                    //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
136 136
                     $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '&id=' . $object->id . '">';
137
-	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
138
-	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
139
-	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
140
-	                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
141
-	                $morehtmlref.='</form>';
142
-	            } else {
143
-	                $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
144
-	            }
145
-	    } else {
146
-	        if (! empty($object->fk_project)) {
147
-	            $proj = new Project($db);
148
-	            $proj->fetch($object->fk_project);
137
+                    $morehtmlref.='<input type="hidden" name="action" value="classin">';
138
+                    $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
139
+                    $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
140
+                    $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
141
+                    $morehtmlref.='</form>';
142
+                } else {
143
+                    $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
144
+                }
145
+        } else {
146
+            if (! empty($object->fk_project)) {
147
+                $proj = new Project($db);
148
+                $proj->fetch($object->fk_project);
149 149
                 // $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
150 150
                 $morehtmlref .= '<a href="' . BASE_URI . '?controller=projet&method=card&id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
151 151
                 $morehtmlref .= $proj->ref;
152
-	            $morehtmlref.='</a>';
153
-	        } else {
154
-	            $morehtmlref.='';
155
-	        }
156
-	    }
157
-	}
158
-	$morehtmlref.='</div>';
152
+                $morehtmlref.='</a>';
153
+            } else {
154
+                $morehtmlref.='';
155
+            }
156
+        }
157
+    }
158
+    $morehtmlref.='</div>';
159 159
 
160 160
 
161
-	dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
161
+    dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
162 162
 
163
-	print '<div class="fichecenter">';
164
-	print '<div class="underbanner clearboth"></div>';
163
+    print '<div class="fichecenter">';
164
+    print '<div class="underbanner clearboth"></div>';
165 165
 
166 166
     print '<table class="border" width="100%">';
167 167
 
168
-	// Ref
169
-	/*
168
+    // Ref
169
+    /*
170 170
 	print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
171 171
 	print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
172 172
 	print '</td></tr>';
173 173
     */
174 174
 
175
-	// Societe
176
-	//print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>";
175
+    // Societe
176
+    //print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>";
177 177
 
178 178
     print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
179 179
     print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.dol_print_size($totalsize,1,1).'</td></tr>';
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 }
194 194
 else
195 195
 {
196
-	print $langs->trans("ErrorUnknown");
196
+    print $langs->trans("ErrorUnknown");
197 197
 }
198 198
 
199 199
 llxFooter();
Please login to merge, or discard this patch.
Braces   +13 added lines, -7 removed lines patch added patch discarded remove patch
@@ -54,7 +54,9 @@  discard block
 block discarded – undo
54 54
 $projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
55 55
 
56 56
 // Security check
57
-if ($user->societe_id) $socid=$user->societe_id;
57
+if ($user->societe_id) {
58
+    $socid=$user->societe_id;
59
+}
58 60
 $result = restrictedArea($user, 'don', $id, '');
59 61
 
60 62
 
@@ -66,8 +68,12 @@  discard block
 block discarded – undo
66 68
 $offset = $conf->liste_limit * $page;
67 69
 $pageprev = $page - 1;
68 70
 $pagenext = $page + 1;
69
-if (! $sortorder) $sortorder="ASC";
70
-if (! $sortfield) $sortfield="name";
71
+if (! $sortorder) {
72
+    $sortorder="ASC";
73
+}
74
+if (! $sortfield) {
75
+    $sortfield="name";
76
+}
71 77
 
72 78
 
73 79
 $object = new Don($db);
@@ -129,11 +135,12 @@  discard block
 block discarded – undo
129 135
 	    $morehtmlref.=$langs->trans('Project') . ' ';
130 136
 	    if ($user->rights->don->creer)
131 137
 	    {
132
-	        if ($action != 'classify')
133
-	            // $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
138
+	        if ($action != 'classify') {
139
+	        	            // $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
134 140
 	            if ($action == 'classify') {
135 141
 	                //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
136 142
                     $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '&id=' . $object->id . '">';
143
+	        }
137 144
 	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
138 145
 	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
139 146
 	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
@@ -190,8 +197,7 @@  discard block
 block discarded – undo
190 197
     $permtoedit = $user->rights->don->creer;
191 198
     $param = '&id=' . $object->id;
192 199
     include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
193
-}
194
-else
200
+} else
195 201
 {
196 202
 	print $langs->trans("ErrorUnknown");
197 203
 }
Please login to merge, or discard this patch.
dolibarr/htdocs/comm/propal/contact.php 2 patches
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -52,27 +52,27 @@  discard block
 block discarded – undo
52 52
 // Load object
53 53
 if ($id > 0 || ! empty($ref))
54 54
 {
55
-	$ret=$object->fetch($id, $ref);
56
-	if ($ret == 0)
57
-	{
58
-		$langs->load("errors");
59
-		setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors');
60
-		$error++;
61
-	}
62
-	else if ($ret < 0)
63
-	{
64
-		setEventMessages($object->error, $object->errors, 'errors');
65
-		$error++;
66
-	}
55
+    $ret=$object->fetch($id, $ref);
56
+    if ($ret == 0)
57
+    {
58
+        $langs->load("errors");
59
+        setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors');
60
+        $error++;
61
+    }
62
+    else if ($ret < 0)
63
+    {
64
+        setEventMessages($object->error, $object->errors, 'errors');
65
+        $error++;
66
+    }
67 67
 }
68 68
 if (! $error)
69 69
 {
70
-	$object->fetch_thirdparty();
70
+    $object->fetch_thirdparty();
71 71
 }
72 72
 else
73 73
 {
74
-	header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php');
75
-	exit;
74
+    header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php');
75
+    exit;
76 76
 }
77 77
 
78 78
 
@@ -84,52 +84,52 @@  discard block
 block discarded – undo
84 84
 {
85 85
     if ($object->id > 0)
86 86
     {
87
-    	$contactid = (GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('contactid','int'));
88
-  		$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
87
+        $contactid = (GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('contactid','int'));
88
+            $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
89 89
     }
90 90
 
91
-	if ($result >= 0)
92
-	{
93
-		header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
94
-		exit;
95
-	}
96
-	else
97
-	{
98
-		if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
99
-		{
100
-			$langs->load("errors");
101
-			setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
102
-		}
103
-		else
104
-		{
105
-			setEventMessages($object->error, $object->errors, 'errors');
106
-		}
107
-	}
91
+    if ($result >= 0)
92
+    {
93
+        header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
94
+        exit;
95
+    }
96
+    else
97
+    {
98
+        if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
99
+        {
100
+            $langs->load("errors");
101
+            setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
102
+        }
103
+        else
104
+        {
105
+            setEventMessages($object->error, $object->errors, 'errors');
106
+        }
107
+    }
108 108
 }
109 109
 
110 110
 // Toggle the status of a contact
111 111
 else if ($action == 'swapstatut' && $user->rights->propale->creer)
112 112
 {
113
-	if ($object->id > 0)
114
-	{
115
-	    $result=$object->swapContactStatus(GETPOST('ligne'));
116
-	}
113
+    if ($object->id > 0)
114
+    {
115
+        $result=$object->swapContactStatus(GETPOST('ligne'));
116
+    }
117 117
 }
118 118
 
119 119
 // Deletes a contact
120 120
 else if ($action == 'deletecontact' && $user->rights->propale->creer)
121 121
 {
122
-	$result = $object->delete_contact($lineid);
123
-
124
-	if ($result >= 0)
125
-	{
126
-		header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
127
-		exit;
128
-	}
129
-	else
130
-	{
131
-		dol_print_error($db);
132
-	}
122
+    $result = $object->delete_contact($lineid);
123
+
124
+    if ($result >= 0)
125
+    {
126
+        header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
127
+        exit;
128
+    }
129
+    else
130
+    {
131
+        dol_print_error($db);
132
+    }
133 133
 }
134 134
 /*
135 135
 else if ($action == 'setaddress' && $user->rights->propale->creer)
@@ -152,68 +152,68 @@  discard block
 block discarded – undo
152 152
 if ($object->id > 0)
153 153
 {
154 154
     $head = propal_prepare_head($object);
155
-	dol_fiche_head($head, 'contact', $langs->trans("Proposal"), -1, 'propal');
155
+    dol_fiche_head($head, 'contact', $langs->trans("Proposal"), -1, 'propal');
156 156
 
157 157
 
158
-	// Proposal card
158
+    // Proposal card
159 159
 
160 160
     //$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
161 161
     $linkback = '<a href="' . BASE_URI . '?controller=comm/propal&method=list.php&restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
162 162
 
163
-	$morehtmlref='<div class="refidno">';
164
-	// Ref customer
165
-	$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
166
-	$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
167
-	// Thirdparty
168
-	$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1,'customer');
169
-	// Project
170
-	if (! empty($conf->projet->enabled))
171
-	{
172
-	    $langs->load("projects");
173
-	    $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
174
-	    if ($user->rights->propal->creer)
175
-	    {
176
-	        if ($action != 'classify')
177
-	            //$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
178
-	            $morehtmlref.=' : ';
179
-	            if ($action == 'classify') {
180
-	                //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
163
+    $morehtmlref='<div class="refidno">';
164
+    // Ref customer
165
+    $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
166
+    $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
167
+    // Thirdparty
168
+    $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1,'customer');
169
+    // Project
170
+    if (! empty($conf->projet->enabled))
171
+    {
172
+        $langs->load("projects");
173
+        $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
174
+        if ($user->rights->propal->creer)
175
+        {
176
+            if ($action != 'classify')
177
+                //$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
178
+                $morehtmlref.=' : ';
179
+                if ($action == 'classify') {
180
+                    //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
181 181
                     $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '&id=' . $object->id . '">';
182
-	                $morehtmlref.='<input type="hidden" name="action" value="classin">';
183
-	                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
184
-	                $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
185
-	                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
186
-	                $morehtmlref.='</form>';
187
-	            } else {
188
-	                $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
189
-	            }
190
-	    } else {
191
-	        if (! empty($object->fk_project)) {
192
-	            $proj = new Project($db);
193
-	            $proj->fetch($object->fk_project);
182
+                    $morehtmlref.='<input type="hidden" name="action" value="classin">';
183
+                    $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
184
+                    $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
185
+                    $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
186
+                    $morehtmlref.='</form>';
187
+                } else {
188
+                    $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
189
+                }
190
+        } else {
191
+            if (! empty($object->fk_project)) {
192
+                $proj = new Project($db);
193
+                $proj->fetch($object->fk_project);
194 194
                 //$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
195 195
                 $morehtmlref .= '<a href="' . BASE_URI . '?controller=projet&method=card&id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
196
-	            $morehtmlref.=$proj->ref;
197
-	            $morehtmlref.='</a>';
198
-	        } else {
199
-	            $morehtmlref.='';
200
-	        }
201
-	    }
202
-	}
203
-	$morehtmlref.='</div>';
204
-
205
-	dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
206
-
207
-	dol_fiche_end();
208
-
209
-
210
-	// Contacts lines (modules that overwrite templates must declare this into descriptor)
211
-	$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
212
-	foreach($dirtpls as $reldir)
213
-	{
214
-		$res=@include dol_buildpath($reldir.'/contacts.tpl.php');
215
-		if ($res) break;
216
-	}
196
+                $morehtmlref.=$proj->ref;
197
+                $morehtmlref.='</a>';
198
+            } else {
199
+                $morehtmlref.='';
200
+            }
201
+        }
202
+    }
203
+    $morehtmlref.='</div>';
204
+
205
+    dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
206
+
207
+    dol_fiche_end();
208
+
209
+
210
+    // Contacts lines (modules that overwrite templates must declare this into descriptor)
211
+    $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
212
+    foreach($dirtpls as $reldir)
213
+    {
214
+        $res=@include dol_buildpath($reldir.'/contacts.tpl.php');
215
+        if ($res) break;
216
+    }
217 217
 }
218 218
 
219 219
 // End of page
Please login to merge, or discard this patch.
Braces   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -44,7 +44,9 @@  discard block
 block discarded – undo
44 44
 $action=GETPOST('action','alpha');
45 45
 
46 46
 // Security check
47
-if ($user->societe_id) $socid=$user->societe_id;
47
+if ($user->societe_id) {
48
+    $socid=$user->societe_id;
49
+}
48 50
 $result = restrictedArea($user, 'propal', $id);
49 51
 
50 52
 $object = new Propal($db);
@@ -58,8 +60,7 @@  discard block
 block discarded – undo
58 60
 		$langs->load("errors");
59 61
 		setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors');
60 62
 		$error++;
61
-	}
62
-	else if ($ret < 0)
63
+	} else if ($ret < 0)
63 64
 	{
64 65
 		setEventMessages($object->error, $object->errors, 'errors');
65 66
 		$error++;
@@ -68,8 +69,7 @@  discard block
 block discarded – undo
68 69
 if (! $error)
69 70
 {
70 71
 	$object->fetch_thirdparty();
71
-}
72
-else
72
+} else
73 73
 {
74 74
 	header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php');
75 75
 	exit;
@@ -92,15 +92,13 @@  discard block
 block discarded – undo
92 92
 	{
93 93
 		header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
94 94
 		exit;
95
-	}
96
-	else
95
+	} else
97 96
 	{
98 97
 		if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
99 98
 		{
100 99
 			$langs->load("errors");
101 100
 			setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
102
-		}
103
-		else
101
+		} else
104 102
 		{
105 103
 			setEventMessages($object->error, $object->errors, 'errors');
106 104
 		}
@@ -125,8 +123,7 @@  discard block
 block discarded – undo
125 123
 	{
126 124
 		header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
127 125
 		exit;
128
-	}
129
-	else
126
+	} else
130 127
 	{
131 128
 		dol_print_error($db);
132 129
 	}
@@ -173,9 +170,10 @@  discard block
 block discarded – undo
173 170
 	    $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
174 171
 	    if ($user->rights->propal->creer)
175 172
 	    {
176
-	        if ($action != 'classify')
177
-	            //$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
173
+	        if ($action != 'classify') {
174
+	        	            //$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
178 175
 	            $morehtmlref.=' : ';
176
+	        }
179 177
 	            if ($action == 'classify') {
180 178
 	                //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
181 179
                     $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '&id=' . $object->id . '">';
@@ -212,7 +210,9 @@  discard block
 block discarded – undo
212 210
 	foreach($dirtpls as $reldir)
213 211
 	{
214 212
 		$res=@include dol_buildpath($reldir.'/contacts.tpl.php');
215
-		if ($res) break;
213
+		if ($res) {
214
+		    break;
215
+		}
216 216
 	}
217 217
 }
218 218
 
Please login to merge, or discard this patch.
dolibarr/htdocs/admin/defaultvalues.php 1 patch
Braces   +65 added lines, -24 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
 // Load translation files required by the page
39 39
 $langs->loadLangs(array('companies', 'products', 'admin', 'sms', 'other', 'errors'));
40 40
 
41
-if (!$user->admin) accessforbidden();
41
+if (!$user->admin) {
42
+    accessforbidden();
43
+}
42 44
 
43 45
 $id = GETPOST('rowid', 'int');
44 46
 $action = GETPOST('action', 'alpha');
@@ -55,8 +57,12 @@  discard block
 block discarded – undo
55 57
 $offset = $limit * $page;
56 58
 $pageprev = $page - 1;
57 59
 $pagenext = $page + 1;
58
-if (!$sortfield) $sortfield = 'page,param';
59
-if (!$sortorder) $sortorder = 'ASC';
60
+if (!$sortfield) {
61
+    $sortfield = 'page,param';
62
+}
63
+if (!$sortorder) {
64
+    $sortorder = 'ASC';
65
+}
60 66
 
61 67
 $defaulturl = GETPOST('defaulturl');
62 68
 $defaultkey = GETPOST('defaultkey', 'alpha');
@@ -86,14 +92,18 @@  discard block
 block discarded – undo
86 92
 
87 93
 $parameters = array('socid' => $socid);
88 94
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);    // Note that $action and $object may have been modified by some hooks
89
-if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
95
+if ($reshook < 0) {
96
+    setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
97
+}
90 98
 
91 99
 include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
92 100
 
93 101
 // Purge search criteria
94
-if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
102
+if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
103
+    // All tests are required to be compatible with all browsers
95 104
 {
96 105
     $defaulturl = '';
106
+}
97 107
     $defaultkey = '';
98 108
     $defaultvalue = '';
99 109
     $toselect = '';
@@ -101,9 +111,12 @@  discard block
 block discarded – undo
101 111
 }
102 112
 
103 113
 if ($action == 'setMAIN_ENABLE_DEFAULT_VALUES') {
104
-    if (GETPOST('value')) dolibarr_set_const($db, 'MAIN_ENABLE_DEFAULT_VALUES', 1, 'chaine', 0, '', $conf->entity);
105
-    else dolibarr_set_const($db, 'MAIN_ENABLE_DEFAULT_VALUES', 0, 'chaine', 0, '', $conf->entity);
106
-}
114
+    if (GETPOST('value')) {
115
+        dolibarr_set_const($db, 'MAIN_ENABLE_DEFAULT_VALUES', 1, 'chaine', 0, '', $conf->entity);
116
+    } else {
117
+        dolibarr_set_const($db, 'MAIN_ENABLE_DEFAULT_VALUES', 0, 'chaine', 0, '', $conf->entity);
118
+    }
119
+    }
107 120
 
108 121
 if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('actionmodify')) {
109 122
     $error = 0;
@@ -199,16 +212,30 @@  discard block
 block discarded – undo
199 212
 print $langs->trans("DefaultValuesDesc") . "<br>\n";
200 213
 print "<br>\n";
201 214
 
202
-if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage=' . $contextpage;
203
-if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit=' . $limit;
204
-if ($optioncss != '') $param .= '&optioncss=' . $optioncss;
205
-if ($defaulturl) $param .= '&defaulturl=' . urlencode($defaulturl);
206
-if ($defaultkey) $param .= '&defaultkey=' . urlencode($defaultkey);
207
-if ($defaultvalue) $param .= '&defaultvalue=' . urlencode($defaultvalue);
215
+if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
216
+    $param .= '&contextpage=' . $contextpage;
217
+}
218
+if ($limit > 0 && $limit != $conf->liste_limit) {
219
+    $param .= '&limit=' . $limit;
220
+}
221
+if ($optioncss != '') {
222
+    $param .= '&optioncss=' . $optioncss;
223
+}
224
+if ($defaulturl) {
225
+    $param .= '&defaulturl=' . urlencode($defaulturl);
226
+}
227
+if ($defaultkey) {
228
+    $param .= '&defaultkey=' . urlencode($defaultkey);
229
+}
230
+if ($defaultvalue) {
231
+    $param .= '&defaultvalue=' . urlencode($defaultvalue);
232
+}
208 233
 
209 234
 
210 235
 print '<form action="' . $_SERVER["PHP_SELF"] . ((empty($user->entity) && $debug) ? '?debug=1' : '') . '" method="POST">';
211
-if ($optioncss != '') print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
236
+if ($optioncss != '') {
237
+    print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
238
+}
212 239
 print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
213 240
 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
214 241
 print '<input type="hidden" name="action" value="list">';
@@ -269,8 +296,11 @@  discard block
 block discarded – undo
269 296
     print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'value', '', $param, '', $sortfield, $sortorder);
270 297
 }
271 298
 // Entity
272
-if (!empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,page', '', $param, '', $sortfield, $sortorder);
273
-else print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
299
+if (!empty($conf->multicompany->enabled) && !$user->entity) {
300
+    print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,page', '', $param, '', $sortfield, $sortorder);
301
+} else {
302
+    print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
303
+}
274 304
 // Actions
275 305
 print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
276 306
 print "</tr>\n";
@@ -306,7 +336,9 @@  discard block
 block discarded – undo
306 336
 }
307 337
 print '<td align="center">';
308 338
 $disabled = '';
309
-if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) $disabled = ' disabled="disabled"';
339
+if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) {
340
+    $disabled = ' disabled="disabled"';
341
+}
310 342
 print '<input type="submit" class="button"' . $disabled . ' value="' . $langs->trans("Add") . '" name="add">';
311 343
 print "</td>\n";
312 344
 print '</tr>';
@@ -335,14 +367,20 @@  discard block
 block discarded – undo
335 367
 
336 368
         // Page
337 369
         print '<td>';
338
-        if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) print $obj->page;
339
-        else print '<input type="text" name="urlpage" value="' . dol_escape_htmltag($obj->page) . '">';
370
+        if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) {
371
+            print $obj->page;
372
+        } else {
373
+            print '<input type="text" name="urlpage" value="' . dol_escape_htmltag($obj->page) . '">';
374
+        }
340 375
         print '</td>' . "\n";
341 376
 
342 377
         // Field
343 378
         print '<td>';
344
-        if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) print $obj->param;
345
-        else print '<input type="text" name="key" value="' . dol_escape_htmltag($obj->param) . '">';
379
+        if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) {
380
+            print $obj->param;
381
+        } else {
382
+            print '<input type="text" name="key" value="' . dol_escape_htmltag($obj->param) . '">';
383
+        }
346 384
         print '</td>' . "\n";
347 385
 
348 386
         // Value
@@ -353,8 +391,11 @@  discard block
 block discarded – undo
353 391
             print '<input type="hidden" name="const['.$i.'][name]" value="'.$obj->transkey.'">';
354 392
             print '<input type="text" id="value_'.$i.'" class="flat inputforupdate" size="30" name="const['.$i.'][value]" value="'.dol_escape_htmltag($obj->transvalue).'">';
355 393
             */
356
-            if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) print $obj->value;
357
-            else print '<input type="text" name="value" value="' . dol_escape_htmltag($obj->value) . '">';
394
+            if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) {
395
+                print $obj->value;
396
+            } else {
397
+                print '<input type="text" name="value" value="' . dol_escape_htmltag($obj->value) . '">';
398
+            }
358 399
             print '</td>';
359 400
         }
360 401
 
Please login to merge, or discard this patch.