Passed
Pull Request — master (#2)
by
unknown
26:19
created
dolibarr/htdocs/core/tpl/ajaxrow.tpl.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 
28 28
 // Protection to avoid direct call of template
29
-if (empty($object) || ! is_object($object))
29
+if (empty($object) || !is_object($object))
30 30
 {
31 31
 	print "Error, template page can't be called as URL";
32 32
 	exit;
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 
37 37
 <!-- BEGIN PHP TEMPLATE AJAXROW.TPL.PHP - Script to enable drag and drop on lines of a table -->
38 38
 <?php
39
-$id=$object->id;
40
-$fk_element=empty($object->fk_element)?$fk_element:$object->fk_element;
41
-$table_element_line=(empty($table_element_line)?$object->table_element_line:$table_element_line);
42
-$nboflines=(isset($object->lines)?count($object->lines):(isset($tasksarray)?count($tasksarray):(empty($nboflines)?0:$nboflines)));
43
-$forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1;
44
-$tagidfortablednd=(empty($tagidfortablednd)?'tablelines':$tagidfortablednd);
45
-$filepath=(empty($filepath)?'':$filepath);
39
+$id = $object->id;
40
+$fk_element = empty($object->fk_element) ? $fk_element : $object->fk_element;
41
+$table_element_line = (empty($table_element_line) ? $object->table_element_line : $table_element_line);
42
+$nboflines = (isset($object->lines) ?count($object->lines) : (isset($tasksarray) ?count($tasksarray) : (empty($nboflines) ? 0 : $nboflines)));
43
+$forcereloadpage = empty($conf->global->MAIN_FORCE_RELOAD_PAGE) ? 0 : 1;
44
+$tagidfortablednd = (empty($tagidfortablednd) ? 'tablelines' : $tagidfortablednd);
45
+$filepath = (empty($filepath) ? '' : $filepath);
46 46
 
47
-if (GETPOST('action','aZ09') != 'editline' && $nboflines > 1) { ?>
47
+if (GETPOST('action', 'aZ09') != 'editline' && $nboflines > 1) { ?>
48 48
 <script type="text/javascript">
49 49
 $(document).ready(function(){
50 50
 	$(".imgupforline").hide();
Please login to merge, or discard this patch.
dolibarr/htdocs/core/tpl/admin_extrafields_edit.tpl.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  */
28 28
 
29 29
 // Protection to avoid direct call of template
30
-if (empty($conf) || ! is_object($conf))
30
+if (empty($conf) || !is_object($conf))
31 31
 {
32 32
 	print "Error, template page can't be called as URL";
33 33
 	exit;
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
     		var list = jQuery("#list");
55 55
             var totalizable = jQuery("#totalizable");
56 56
     		<?php
57
-    		if((GETPOST('type','alpha') != "select") &&  (GETPOST('type','alpha') != "sellist"))
57
+    		if ((GETPOST('type', 'alpha') != "select") && (GETPOST('type', 'alpha') != "sellist"))
58 58
     		{
59 59
     			print 'jQuery("#value_choice").hide();';
60 60
     		}
61 61
 
62
-    		if (GETPOST('type','alpha') == "separate")
62
+    		if (GETPOST('type', 'alpha') == "separate")
63 63
     		{
64 64
 				print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);";
65 65
     			print 'jQuery("#value_choice").hide();';
@@ -145,37 +145,37 @@  discard block
 block discarded – undo
145 145
 <table summary="listofattributes" class="border centpercent">
146 146
 
147 147
 <?php
148
-$label=$extrafields->attributes[$elementtype]['label'][$attrname];
149
-$type=$extrafields->attributes[$elementtype]['type'][$attrname];
150
-$size=$extrafields->attributes[$elementtype]['size'][$attrname];
151
-$computed=$extrafields->attributes[$elementtype]['computed'][$attrname];
152
-$default=$extrafields->attributes[$elementtype]['default'][$attrname];
153
-$unique=$extrafields->attributes[$elementtype]['unique'][$attrname];
154
-$required=$extrafields->attributes[$elementtype]['required'][$attrname];
155
-$pos=$extrafields->attributes[$elementtype]['pos'][$attrname];
156
-$alwayseditable=$extrafields->attributes[$elementtype]['alwayseditable'][$attrname];
157
-$param=$extrafields->attributes[$elementtype]['param'][$attrname];
158
-$perms=$extrafields->attributes[$elementtype]['perms'][$attrname];
159
-$langfile=$extrafields->attributes[$elementtype]['langfile'][$attrname];
160
-$list=$extrafields->attributes[$elementtype]['list'][$attrname];
148
+$label = $extrafields->attributes[$elementtype]['label'][$attrname];
149
+$type = $extrafields->attributes[$elementtype]['type'][$attrname];
150
+$size = $extrafields->attributes[$elementtype]['size'][$attrname];
151
+$computed = $extrafields->attributes[$elementtype]['computed'][$attrname];
152
+$default = $extrafields->attributes[$elementtype]['default'][$attrname];
153
+$unique = $extrafields->attributes[$elementtype]['unique'][$attrname];
154
+$required = $extrafields->attributes[$elementtype]['required'][$attrname];
155
+$pos = $extrafields->attributes[$elementtype]['pos'][$attrname];
156
+$alwayseditable = $extrafields->attributes[$elementtype]['alwayseditable'][$attrname];
157
+$param = $extrafields->attributes[$elementtype]['param'][$attrname];
158
+$perms = $extrafields->attributes[$elementtype]['perms'][$attrname];
159
+$langfile = $extrafields->attributes[$elementtype]['langfile'][$attrname];
160
+$list = $extrafields->attributes[$elementtype]['list'][$attrname];
161 161
 $totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname];
162
-$help=$extrafields->attributes[$elementtype]['help'][$attrname];
163
-$entitycurrentorall=$extrafields->attributes[$elementtype]['entityid'][$attrname];
162
+$help = $extrafields->attributes[$elementtype]['help'][$attrname];
163
+$entitycurrentorall = $extrafields->attributes[$elementtype]['entityid'][$attrname];
164 164
 
165
-if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param))
165
+if ((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param))
166 166
 {
167 167
 	$param_chain = '';
168 168
 	foreach ($param['options'] as $key => $value)
169 169
 	{
170
-		if(strlen($key))
170
+		if (strlen($key))
171 171
 		{
172 172
 			$param_chain .= $key.','.$value."\n";
173 173
 		}
174 174
 	}
175 175
 }
176
-elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password'))
176
+elseif (($type == 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password'))
177 177
 {
178
-	$paramlist=array_keys($param['options']);
178
+	$paramlist = array_keys($param['options']);
179 179
 	$param_chain = $paramlist[0];
180 180
 }
181 181
 ?>
@@ -187,10 +187,10 @@  discard block
 block discarded – undo
187 187
 <tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
188 188
 <?php
189 189
 // Define list of possible type transition
190
-$typewecanchangeinto=array(
190
+$typewecanchangeinto = array(
191 191
 	'varchar'=>array('varchar', 'phone', 'mail', 'url', 'select', 'password', 'text', 'html'),
192
-	'text'=>array('text','html'),
193
-	'html'=>array('text','html'),
192
+	'text'=>array('text', 'html'),
193
+	'html'=>array('text', 'html'),
194 194
 	'password'=>array('password', 'varchar'),
195 195
 	'mail'=>array('varchar', 'phone', 'mail', 'url', 'select'),
196 196
     'url'=>array('varchar', 'phone', 'mail', 'url', 'select'),
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 );
200 200
 if (in_array($type, array_keys($typewecanchangeinto)))
201 201
 {
202
-    $newarray=array();
202
+    $newarray = array();
203 203
     print '<select id="type" class="flat type" name="type">';
204
-    foreach($type2label as $key => $val)
204
+    foreach ($type2label as $key => $val)
205 205
     {
206
-        $selected='';
207
-        if ($key == (GETPOST('type','alpha')?GETPOST('type','alpha'):$type)) $selected=' selected="selected"';
206
+        $selected = '';
207
+        if ($key == (GETPOST('type', 'alpha') ?GETPOST('type', 'alpha') : $type)) $selected = ' selected="selected"';
208 208
         if (in_array($key, $typewecanchangeinto[$type])) print '<option value="'.$key.'"'.$selected.'>'.$val.'</option>';
209 209
         else print '<option value="'.$key.'" disabled="disabled"'.$selected.'>'.$val.'</option>';
210 210
     }
@@ -229,37 +229,37 @@  discard block
 block discarded – undo
229 229
     <tr><td>
230 230
     	<textarea name="param" id="param" cols="80" rows="<?php echo ROWS_4 ?>"><?php echo dol_htmlcleanlastbr($param_chain); ?></textarea>
231 231
     </td><td>
232
-    <span id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0,'', 0, 2, 'helpvalue1')?></span>
233
-    <span id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0,'', 0, 2, 'helpvalue2')?></span>
234
-    <span id="helpchkbxlst"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0,'', 0, 2, 'helpvalue3')?></span>
235
-    <span id="helplink"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink"),1,0,'', 0, 2, 'helpvalue4')?></span>
236
-    <span id="helppassword"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"),1,0,'', 0, 2, 'helpvalue5')?></span>
232
+    <span id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?></span>
233
+    <span id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?></span>
234
+    <span id="helpchkbxlst"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?></span>
235
+    <span id="helplink"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?></span>
236
+    <span id="helppassword"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?></span>
237 237
     </td></tr>
238 238
     </table>
239 239
 </td>
240 240
 </tr>
241 241
 <!-- Position -->
242
-<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo dol_escape_htmltag($pos);  ?>"></td></tr>
242
+<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo dol_escape_htmltag($pos); ?>"></td></tr>
243 243
 <!-- Language file -->
244
-<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag($langfile);  ?>"></td></tr>
244
+<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag($langfile); ?>"></td></tr>
245 245
 <!-- Computed value -->
246 246
 <tr class="extra_computed_value"><td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?></td><td class="valeur"><input id="computed_value" class="quatrevingtpercent" type="text" name="computed_value" value="<?php echo dol_escape_htmltag($computed); ?>"></td></tr>
247 247
 <!-- Default Value (at sql setup level) -->
248 248
 <tr class="extra_default_value"><td><?php echo $langs->trans("DefaultValue").' ('.$langs->trans("Database").')'; ?></td><td class="valeur"><input id="default_value" type="text" name="default_value" size="5" value="<?php echo dol_escape_htmltag($default); ?>"></td></tr>
249 249
 <!-- Unique -->
250
-<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo ($unique?' checked':''); ?>></td></tr>
250
+<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo ($unique ? ' checked' : ''); ?>></td></tr>
251 251
 <!-- Required -->
252
-<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo ($required?' checked':''); ?>></td></tr>
252
+<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo ($required ? ' checked' : ''); ?>></td></tr>
253 253
 <!-- Always editable -->
254
-<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable?' checked':''); ?>></td></tr>
254
+<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable ? ' checked' : ''); ?>></td></tr>
255 255
 <tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
256
-</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo ($list!=''?$list:'1'); ?>"></td></tr>
257
-<tr class="extra_totalizable"><td><?php echo $form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ($totalizable?' checked':''); ?>></td></tr>
256
+</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo ($list != '' ? $list : '1'); ?>"></td></tr>
257
+<tr class="extra_totalizable"><td><?php echo $form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ($totalizable ? ' checked' : ''); ?>></td></tr>
258 258
 <!-- Help tooltip -->
259 259
 <tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag($help); ?>"></td></tr>
260 260
 <?php if ($conf->multicompany->enabled) { ?>
261 261
 	<!-- Multicompany entity -->
262
-    <tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (empty($entitycurrentorall) ?' checked':''); ?>></td></tr>
262
+    <tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (empty($entitycurrentorall) ? ' checked' : ''); ?>></td></tr>
263 263
 <?php } ?>
264 264
 <!-- Visibility -->
265 265
 </table>
Please login to merge, or discard this patch.
dolibarr/htdocs/core/tpl/document_actions_post_headers.tpl.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 // $param       = param to add to download links
26 26
 
27 27
 // Protection to avoid direct call of template
28
-if (empty($langs) || ! is_object($langs))
28
+if (empty($langs) || !is_object($langs))
29 29
 {
30 30
 	print "Error, template page can't be called as URL";
31 31
 	exit;
@@ -33,15 +33,15 @@  discard block
 block discarded – undo
33 33
 
34 34
 
35 35
 $langs->load("link");
36
-if (empty($relativepathwithnofile)) $relativepathwithnofile='';
37
-if (empty($permtoedit)) $permtoedit=-1;
36
+if (empty($relativepathwithnofile)) $relativepathwithnofile = '';
37
+if (empty($permtoedit)) $permtoedit = -1;
38 38
 
39 39
 // Drag and drop for up and down allowed on product, thirdparty, ...
40 40
 // The drag and drop call the page core/ajax/row.php
41 41
 // If you enable the move up/down of files here, check that page that include template set its sortorder on 'position_name' instead of 'name'
42 42
 // Also the object->fk_element must be defined.
43
-$disablemove=1;
44
-if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket', 'holiday', 'expensereport'))) $disablemove=0;
43
+$disablemove = 1;
44
+if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket', 'holiday', 'expensereport'))) $disablemove = 0;
45 45
 
46 46
 
47 47
 
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
 
52 52
 if ($action == 'delete')
53 53
 {
54
-	$langs->load("companies");	// Need for string DeleteFile+ConfirmDeleteFiles
54
+	$langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles
55 55
 	print $form->formconfirm(
56
-			$_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param),
56
+			$_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")).'&linkid='.GETPOST('linkid', 'int').(empty($param) ? '' : $param),
57 57
 			$langs->trans('DeleteFile'),
58 58
 			$langs->trans('ConfirmDeleteFile'),
59 59
 			'confirm_deletefile',
@@ -63,16 +63,16 @@  discard block
 block discarded – undo
63 63
 	);
64 64
 }
65 65
 
66
-$formfile=new FormFile($db);
66
+$formfile = new FormFile($db);
67 67
 
68 68
 // We define var to enable the feature to add prefix of uploaded files
69
-$savingdocmask='';
69
+$savingdocmask = '';
70 70
 if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX))
71 71
 {
72 72
 	//var_dump($modulepart);
73
-	if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','supplier_proposal','ficheinter','contract','expedition','project','project_task','expensereport','tax', 'produit', 'product_batch')))
73
+	if (in_array($modulepart, array('facture_fournisseur', 'commande_fournisseur', 'facture', 'commande', 'propal', 'supplier_proposal', 'ficheinter', 'contract', 'expedition', 'project', 'project_task', 'expensereport', 'tax', 'produit', 'product_batch')))
74 74
 	{
75
-		$savingdocmask=dol_sanitizeFileName($object->ref).'-__file__';
75
+		$savingdocmask = dol_sanitizeFileName($object->ref).'-__file__';
76 76
 	}
77 77
 	/*if (in_array($modulepart,array('member')))
78 78
 	{
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 // Show upload form (document and links)
84 84
 $formfile->form_attach_new_file(
85
-    $_SERVER["PHP_SELF"].'?id='.$object->id.(empty($withproject)?'':'&withproject=1'),
85
+    $_SERVER["PHP_SELF"].'?id='.$object->id.(empty($withproject) ? '' : '&withproject=1'),
86 86
     '',
87 87
     0,
88 88
     0,
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     $modulepart,
102 102
     $param,
103 103
     0,
104
-    $relativepathwithnofile,		// relative path with no file. For example "0/1"
104
+    $relativepathwithnofile, // relative path with no file. For example "0/1"
105 105
     $permission,
106 106
     0,
107 107
     '',
Please login to merge, or discard this patch.
dolibarr/htdocs/core/tpl/objectline_create.tpl.php 1 patch
Spacing   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -33,60 +33,60 @@  discard block
 block discarded – undo
33 33
  */
34 34
 
35 35
 // Protection to avoid direct call of template
36
-if (empty($object) || ! is_object($object))
36
+if (empty($object) || !is_object($object))
37 37
 {
38 38
 	print "Error, template page can't be called as URL";
39 39
 	exit;
40 40
 }
41 41
 
42 42
 
43
-$usemargins=0;
44
-if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande')))
43
+$usemargins = 0;
44
+if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande')))
45 45
 {
46
-    $usemargins=1;
46
+    $usemargins = 1;
47 47
 }
48 48
 
49
-if (! isset($dateSelector)) global $dateSelector;	// Take global var only if not already defined into function calling (for example formAddObjectLine)
49
+if (!isset($dateSelector)) global $dateSelector; // Take global var only if not already defined into function calling (for example formAddObjectLine)
50 50
 global $forceall, $forcetoshowtitlelines, $senderissupplier, $inputalsopricewithtax;
51 51
 
52
-if (! isset($dateSelector)) $dateSelector=1;    // For backward compatibility
53
-elseif (empty($dateSelector)) $dateSelector=0;
54
-if (empty($forceall)) $forceall=0;
55
-if (empty($senderissupplier)) $senderissupplier=0;
56
-if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0;
52
+if (!isset($dateSelector)) $dateSelector = 1; // For backward compatibility
53
+elseif (empty($dateSelector)) $dateSelector = 0;
54
+if (empty($forceall)) $forceall = 0;
55
+if (empty($senderissupplier)) $senderissupplier = 0;
56
+if (empty($inputalsopricewithtax)) $inputalsopricewithtax = 0;
57 57
 
58 58
 
59 59
 // Define colspan for button Add
60
-$colspan = 3;	// Col total ht + col edit + col delete
61
-if (in_array($object->element,array('propal','commande','order','facture','facturerec','invoice','supplier_proposal','order_supplier','invoice_supplier'))) $colspan++;	// With this, there is a column move button
60
+$colspan = 3; // Col total ht + col edit + col delete
61
+if (in_array($object->element, array('propal', 'commande', 'order', 'facture', 'facturerec', 'invoice', 'supplier_proposal', 'order_supplier', 'invoice_supplier'))) $colspan++; // With this, there is a column move button
62 62
 //print $object->element;
63 63
 
64 64
 // Lines for extrafield
65 65
 $objectline = null;
66 66
 if (!empty($extrafieldsline))
67 67
 {
68
-	if ($this->table_element_line=='commandedet') {
68
+	if ($this->table_element_line == 'commandedet') {
69 69
 		$objectline = new OrderLine($this->db);
70 70
 	}
71
-	elseif ($this->table_element_line=='propaldet') {
71
+	elseif ($this->table_element_line == 'propaldet') {
72 72
 		$objectline = new PropaleLigne($this->db);
73 73
 	}
74
-	elseif ($this->table_element_line=='supplier_proposaldet') {
74
+	elseif ($this->table_element_line == 'supplier_proposaldet') {
75 75
 		$objectline = new SupplierProposalLine($this->db);
76 76
 	}
77
-	elseif ($this->table_element_line=='facturedet') {
77
+	elseif ($this->table_element_line == 'facturedet') {
78 78
 		$objectline = new FactureLigne($this->db);
79 79
 	}
80
-	elseif ($this->table_element_line=='contratdet') {
80
+	elseif ($this->table_element_line == 'contratdet') {
81 81
 		$objectline = new ContratLigne($this->db);
82 82
 	}
83
-	elseif ($this->table_element_line=='commande_fournisseurdet') {
83
+	elseif ($this->table_element_line == 'commande_fournisseurdet') {
84 84
 		$objectline = new CommandeFournisseurLigne($this->db);
85 85
 	}
86
-	elseif ($this->table_element_line=='facture_fourn_det') {
86
+	elseif ($this->table_element_line == 'facture_fourn_det') {
87 87
 		$objectline = new SupplierInvoiceLine($this->db);
88 88
 	}
89
-	elseif ($this->table_element_line=='facturedet_rec') {
89
+	elseif ($this->table_element_line == 'facturedet_rec') {
90 90
 		$objectline = new FactureLigneRec($this->db);
91 91
 	}
92 92
 }
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 
96 96
 <!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->
97 97
 <?php
98
-$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines);
98
+$nolinesbefore = (count($this->lines) == 0 || $forcetoshowtitlelines);
99 99
 if ($nolinesbefore) {
100 100
 ?>
101
-<tr class="liste_titre<?php echo (($nolinesbefore || $object->element=='contrat')?'':' liste_titre_add_') ?> nodrag nodrop">
102
-	<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
101
+<tr class="liste_titre<?php echo (($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_add_') ?> nodrag nodrop">
102
+	<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
103 103
 	<td class="linecolnum" align="center"></td>
104 104
 	<?php } ?>
105 105
 	<td class="linecoldescription minwidth500imp">
@@ -113,15 +113,15 @@  discard block
 block discarded – undo
113 113
 	<?php } ?>
114 114
 	<td class="linecolvat" align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td>
115 115
 	<td class="linecoluht" align="right"><span id="title_up_ht"><?php echo $langs->trans('PriceUHT'); ?></span></td>
116
-	<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan++;?>
116
+	<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan++; ?>
117 117
 	<td class="linecoluht_currency" align="right"><span id="title_up_ht_currency"><?php echo $langs->trans('PriceUHTCurrency'); ?></span></td>
118 118
 	<?php } ?>
119
-	<?php if (! empty($inputalsopricewithtax)) { ?>
119
+	<?php if (!empty($inputalsopricewithtax)) { ?>
120 120
 	<td class="linecoluttc" align="right"><span id="title_up_ttc"><?php echo $langs->trans('PriceUTTC'); ?></span></td>
121 121
 	<?php } ?>
122 122
 	<td class="linecolqty" align="right"><?php echo $langs->trans('Qty'); ?></td>
123 123
 	<?php
124
-	if($conf->global->PRODUCT_USE_UNITS)
124
+	if ($conf->global->PRODUCT_USE_UNITS)
125 125
 	{
126 126
 		print '<td class="linecoluseunit" align="left">';
127 127
 		print '<span id="title_units">';
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
 	<td class="linecoldiscount" align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
133 133
 	<?php
134 134
 	if ($this->situation_cycle_ref) {
135
-		print '<td class="linecolcycleref" align="right">' . $langs->trans('Progress') . '</td>';
135
+		print '<td class="linecolcycleref" align="right">'.$langs->trans('Progress').'</td>';
136 136
 	}
137
-	if (! empty($usemargins))
137
+	if (!empty($usemargins))
138 138
 	{
139 139
 		if (!empty($user->rights->margins->creer)) {
140 140
 		?>
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
 		?>
151 151
 		</td>
152 152
 		<?php
153
-		if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>';
154
-		if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) 	echo '<td align="right" class="margininfos linecolmargin2"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>';
153
+		if ($user->rights->margins->creer && !empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>';
154
+		if ($user->rights->margins->creer && !empty($conf->global->DISPLAY_MARK_RATES)) 	echo '<td align="right" class="margininfos linecolmargin2"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>';
155 155
 	}
156 156
 	?>
157 157
 	<td class="linecoledit" colspan="<?php echo $colspan; ?>">&nbsp;</td>
@@ -159,17 +159,17 @@  discard block
 block discarded – undo
159 159
 <?php
160 160
 }
161 161
 ?>
162
-<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element=='contrat')?'':' liste_titre_create'; ?>">
162
+<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_create'; ?>">
163 163
 <?php
164 164
 // Adds a line numbering column
165
-if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
166
-	$coldisplay=2;
165
+if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
166
+	$coldisplay = 2;
167 167
 	?>
168 168
 	<td class="nobottom linecolnum" align="center" width="5"></td>
169 169
 	<?php
170 170
 }
171 171
 else {
172
-	$coldisplay=0;
172
+	$coldisplay = 0;
173 173
 }
174 174
 ?>
175 175
 
@@ -181,22 +181,22 @@  discard block
 block discarded – undo
181 181
 	if (empty($conf->global->MAIN_DISABLE_FREE_LINES))
182 182
 	{
183 183
 		$freelines = true;
184
-		$forceall=1;	// We always force all type for free lines (module product or service means we use predefined product or service)
184
+		$forceall = 1; // We always force all type for free lines (module product or service means we use predefined product or service)
185 185
 		if ($object->element == 'contrat')
186 186
 		{
187
-			if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1;	// With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set
188
-			else if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=3;
187
+			if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall = -1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set
188
+			else if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall = 3;
189 189
 		}
190 190
 
191 191
 		// Free line
192 192
 		echo '<span class="prod_entry_mode_free">';
193 193
 		// Show radio free line
194
-		if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled)))
194
+		if ($forceall >= 0 && (!empty($conf->product->enabled) || !empty($conf->service->enabled)))
195 195
 		{
196 196
 			echo '<label for="prod_entry_mode_free">';
197 197
 			echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"';
198 198
 			//echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked':'') );
199
-			echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : '');
199
+			echo (GETPOST('prod_entry_mode') == 'free' ? ' checked' : '');
200 200
 			echo '> ';
201 201
 			// Show type selector
202 202
 			echo $langs->trans("FreeLineOfType");
@@ -215,39 +215,39 @@  discard block
 block discarded – undo
215 215
 			}
216 216
 		}
217 217
 
218
-		echo $form->select_type_of_lines(isset($_POST["type"])?GETPOST("type",'alpha',2):-1,'type',1,1,$forceall);
218
+		echo $form->select_type_of_lines(isset($_POST["type"]) ?GETPOST("type", 'alpha', 2) : -1, 'type', 1, 1, $forceall);
219 219
 
220 220
 		echo '</span>';
221 221
 	}
222 222
 
223 223
 	// Predefined product/service
224
-	if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
224
+	if (!empty($conf->product->enabled) || !empty($conf->service->enabled))
225 225
 	{
226 226
 		if ($forceall >= 0 && $freelines) echo '<br>';
227 227
 		echo '<span class="prod_entry_mode_predef">';
228 228
 		echo '<label for="prod_entry_mode_predef">';
229
-		echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked':'').'> ';
229
+		echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode') == 'predef' ? ' checked' : '').'> ';
230 230
 		if (empty($senderissupplier))
231 231
 		{
232
-			if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell');
233
-			else if ((empty($conf->product->enabled) && ! empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell');
232
+			if (!empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell');
233
+			else if ((empty($conf->product->enabled) && !empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell');
234 234
 			else echo $langs->trans('PredefinedProductsAndServicesToSell');
235 235
 		}
236 236
 		else
237 237
 		{
238
-			if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase');
239
-			else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase');
238
+			if (!empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase');
239
+			else if (empty($conf->product->enabled) && !empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase');
240 240
 			else echo $langs->trans('PredefinedProductsAndServicesToPurchase');
241 241
 		}
242 242
 		echo '</label>';
243 243
 		echo ' ';
244 244
 
245
-		$filtertype='';
246
-		if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1';
245
+		$filtertype = '';
246
+		if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype = '1';
247 247
 
248 248
 		if (empty($senderissupplier))
249 249
 		{
250
-			if (! empty($conf->global->ENTREPOT_EXTRA_STATUS))
250
+			if (!empty($conf->global->ENTREPOT_EXTRA_STATUS))
251 251
 			{
252 252
 				// hide products in closed warehouse, but show products for internal transfer
253 253
 				$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
@@ -262,17 +262,17 @@  discard block
 block discarded – undo
262 262
 			// $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum
263 263
 		    if ($senderissupplier != 2)
264 264
 		    {
265
-    			$ajaxoptions=array(
266
-    					'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'),	// html id tags that will be edited with which ajax json response key
267
-    					'option_disabled' => 'idthatdoesnotexists',					// html id to disable once select is done
265
+    			$ajaxoptions = array(
266
+    					'update' => array('qty'=>'qty', 'remise_percent' => 'discount', 'idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key
267
+    					'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done
268 268
     					'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo)
269 269
     			);
270
-    			$alsoproductwithnosupplierprice=0;
270
+    			$alsoproductwithnosupplierprice = 0;
271 271
 		    }
272 272
 		    else
273 273
 		    {
274 274
 		        $ajaxoptions = array();
275
-		        $alsoproductwithnosupplierprice=1;
275
+		        $alsoproductwithnosupplierprice = 1;
276 276
 		    }
277 277
 
278 278
 			$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice);
@@ -283,23 +283,23 @@  discard block
 block discarded – undo
283 283
 
284 284
 	if (is_object($hookmanager) && empty($senderissupplier))
285 285
 	{
286
-        $parameters=array('fk_parent_line'=>GETPOST('fk_parent_line','int'));
287
-		$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
286
+        $parameters = array('fk_parent_line'=>GETPOST('fk_parent_line', 'int'));
287
+		$reshook = $hookmanager->executeHooks('formCreateProductOptions', $parameters, $object, $action);
288 288
 		if (!empty($hookmanager->resPrint)) {
289 289
 			print $hookmanager->resPrint;
290 290
 		}
291 291
 	}
292
-	if (is_object($hookmanager) && ! empty($senderissupplier))
292
+	if (is_object($hookmanager) && !empty($senderissupplier))
293 293
 	{
294
-		$parameters=array('htmlname'=>'addproduct');
295
-		$reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
294
+		$parameters = array('htmlname'=>'addproduct');
295
+		$reshook = $hookmanager->executeHooks('formCreateProductSupplierOptions', $parameters, $object, $action);
296 296
 		if (!empty($hookmanager->resPrint)) {
297 297
 			print $hookmanager->resPrint;
298 298
 		}
299 299
 	}
300 300
 
301 301
 
302
-	if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) {
302
+	if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
303 303
 
304 304
 		if (!empty($conf->variants->enabled)) {
305 305
 			echo '<div id="attributes_box"></div>';
@@ -310,16 +310,16 @@  discard block
 block discarded – undo
310 310
 
311 311
 	// Editor wysiwyg
312 312
 	require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
313
-	$nbrows=ROWS_2;
314
-	$enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0);
315
-	if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
316
-	$toolbarname='dolibarr_details';
317
-	if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes';
318
-	$doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,$toolbarname,'',false,true,$enabled,$nbrows,'98%');
313
+	$nbrows = ROWS_2;
314
+	$enabled = (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0);
315
+	if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT;
316
+	$toolbarname = 'dolibarr_details';
317
+	if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname = 'dolibarr_notes';
318
+	$doleditor = new DolEditor('dp_desc', GETPOST('dp_desc'), '', 100, $toolbarname, '', false, true, $enabled, $nbrows, '98%');
319 319
 	$doleditor->Create();
320 320
 
321 321
 	// Show autofill date for recuring invoices
322
-	if (! empty($conf->service->enabled) && $object->element == 'facturerec')
322
+	if (!empty($conf->service->enabled) && $object->element == 'facturerec')
323 323
 	{
324 324
 		echo '<div class="divlinefordates"><br>';
325 325
 		echo $langs->trans('AutoFillDateFrom').' ';
@@ -336,60 +336,60 @@  discard block
 block discarded – undo
336 336
 	if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier')	// We must have same test in printObjectLines
337 337
 	{
338 338
 	?>
339
-		<td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat maxwidth75" value="<?php echo (isset($_POST["fourn_ref"])?GETPOST("fourn_ref",'alpha',2):''); ?>"></td>
339
+		<td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat maxwidth75" value="<?php echo (isset($_POST["fourn_ref"]) ?GETPOST("fourn_ref", 'alpha', 2) : ''); ?>"></td>
340 340
 	<?php } ?>
341 341
 
342 342
 	<td class="nobottom linecolvat" align="right"><?php
343 343
 	if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true);
344
-	else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?GETPOST("tva_tx",'alpha',2):-1), $seller, $buyer, 0, 0, '', false, 1);
344
+	else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"]) ?GETPOST("tva_tx", 'alpha', 2) : -1), $seller, $buyer, 0, 0, '', false, 1);
345 345
 	?>
346 346
 	</td>
347 347
 	<td class="nobottom linecoluht" align="right">
348
-	<input type="text" size="5" name="price_ht" id="price_ht" class="flat right" value="<?php echo (isset($_POST["price_ht"])?GETPOST("price_ht",'alpha',2):''); ?>">
348
+	<input type="text" size="5" name="price_ht" id="price_ht" class="flat right" value="<?php echo (isset($_POST["price_ht"]) ?GETPOST("price_ht", 'alpha', 2) : ''); ?>">
349 349
 	</td>
350 350
 
351
-	<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan++;?>
351
+	<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan++; ?>
352 352
 	<td class="nobottom linecoluht_currency" align="right">
353
-	<input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat right" value="<?php echo (isset($_POST["multicurrency_price_ht"])?GETPOST("multicurrency_price_ht",'alpha',2):''); ?>">
353
+	<input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat right" value="<?php echo (isset($_POST["multicurrency_price_ht"]) ?GETPOST("multicurrency_price_ht", 'alpha', 2) : ''); ?>">
354 354
 	</td>
355 355
 	<?php } ?>
356 356
 
357
-	<?php if (! empty($inputalsopricewithtax)) { ?>
357
+	<?php if (!empty($inputalsopricewithtax)) { ?>
358 358
 	<td class="nobottom linecoluttc" align="right">
359
-	<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?GETPOST("price_ttc",'alpha',2):''); ?>">
359
+	<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"]) ?GETPOST("price_ttc", 'alpha', 2) : ''); ?>">
360 360
 	</td>
361 361
 	<?php } ?>
362
-	<td class="nobottom linecolqty" align="right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"])?GETPOST("qty",'alpha',2):1); ?>">
362
+	<td class="nobottom linecolqty" align="right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"]) ?GETPOST("qty", 'alpha', 2) : 1); ?>">
363 363
 	</td>
364 364
 	<?php
365
-	if($conf->global->PRODUCT_USE_UNITS)
365
+	if ($conf->global->PRODUCT_USE_UNITS)
366 366
 	{
367 367
 		print '<td class="nobottom linecoluseunit" align="left">';
368 368
 		print $form->selectUnits($line->fk_unit, "units");
369 369
 		print '</td>';
370 370
 	}
371 371
 	$remise_percent = $buyer->remise_percent;
372
-	if($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') {
372
+	if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') {
373 373
 		$remise_percent = $seller->remise_supplier_percent;
374 374
 	}
375 375
 	?>
376
-	<td class="nobottom nowrap linecoldiscount" align="right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat right" value="<?php echo (isset($_POST["remise_percent"])?GETPOST("remise_percent",'alpha',2):$remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
376
+	<td class="nobottom nowrap linecoldiscount" align="right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat right" value="<?php echo (isset($_POST["remise_percent"]) ?GETPOST("remise_percent", 'alpha', 2) : $remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
377 377
 	<?php
378 378
 	if ($this->situation_cycle_ref) {
379 379
 		$coldisplay++;
380 380
 		print '<td class="nobottom nowrap" align="right"><input class="falt right" type="text" size="1" value="0" name="progress">%</td>';
381 381
 	}
382
-	if (! empty($usemargins))
382
+	if (!empty($usemargins))
383 383
 	{
384 384
 		if (!empty($user->rights->margins->creer)) {
385 385
 		?>
386 386
 		<td align="right" class="nobottom margininfos linecolmargin">
387 387
 			<!-- For predef product -->
388
-			<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
388
+			<?php if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { ?>
389 389
 			<select id="fournprice_predef" name="fournprice_predef" class="flat" style="display: none;"></select>
390 390
 			<?php } ?>
391 391
 			<!-- For free product -->
392
-			<input type="text" size="5" id="buying_price" name="buying_price" class="flat right" value="<?php echo (isset($_POST["buying_price"])?GETPOST("buying_price",'alpha',2):''); ?>">
392
+			<input type="text" size="5" id="buying_price" name="buying_price" class="flat right" value="<?php echo (isset($_POST["buying_price"]) ?GETPOST("buying_price", 'alpha', 2) : ''); ?>">
393 393
 		</td>
394 394
 		<?php
395 395
 		$coldisplay++;
@@ -397,21 +397,21 @@  discard block
 block discarded – undo
397 397
 
398 398
 		if ($user->rights->margins->creer)
399 399
 		{
400
-			if (! empty($conf->global->DISPLAY_MARGIN_RATES))
400
+			if (!empty($conf->global->DISPLAY_MARGIN_RATES))
401 401
 			{
402
-				echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?GETPOST("np_marginRate",'alpha',2):'').'"><span class="np_marginRate hideonsmartphone">%</span></td>';
402
+				echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"]) ?GETPOST("np_marginRate", 'alpha', 2) : '').'"><span class="np_marginRate hideonsmartphone">%</span></td>';
403 403
 				$coldisplay++;
404 404
 			}
405
-			if (! empty($conf->global->DISPLAY_MARK_RATES))
405
+			if (!empty($conf->global->DISPLAY_MARK_RATES))
406 406
 			{
407
-				echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"])?GETPOST("np_markRate",'alpha',2):'').'"><span class="np_markRate hideonsmartphone">%</span></td>';
407
+				echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"]) ?GETPOST("np_markRate", 'alpha', 2) : '').'"><span class="np_markRate hideonsmartphone">%</span></td>';
408 408
 				$coldisplay++;
409 409
 			}
410 410
 		}
411 411
 		else
412 412
 		{
413
-			if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $coldisplay++;
414
-			if (! empty($conf->global->DISPLAY_MARK_RATES))   $coldisplay++;
413
+			if (!empty($conf->global->DISPLAY_MARGIN_RATES)) $coldisplay++;
414
+			if (!empty($conf->global->DISPLAY_MARK_RATES))   $coldisplay++;
415 415
 		}
416 416
 	}
417 417
 	?>
@@ -422,12 +422,12 @@  discard block
 block discarded – undo
422 422
 
423 423
 <?php
424 424
 if (is_object($objectline)) {
425
-	print $objectline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay+8), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
425
+	print $objectline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay + 8), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD) ? 0 : 1);
426 426
 }
427 427
 ?>
428 428
 
429 429
 <?php
430
-if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0')	// We show date field if required
430
+if ((!empty($conf->service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0')	// We show date field if required
431 431
 {
432 432
 	$colspan = 6;
433 433
 
@@ -465,35 +465,35 @@  discard block
 block discarded – undo
465 465
 		}
466 466
 	}
467 467
 
468
-	if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2;
468
+	if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan += 2;
469 469
 
470
-	if (! empty($usemargins))
470
+	if (!empty($usemargins))
471 471
 	{
472 472
 		if (!empty($user->rights->margins->creer)) $colspan++; // For the buying price
473
-		if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
474
-		if (! empty($conf->global->DISPLAY_MARK_RATES))   $colspan++;
473
+		if (!empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
474
+		if (!empty($conf->global->DISPLAY_MARK_RATES))   $colspan++;
475 475
 	}
476 476
 	?>
477 477
 
478 478
 	<tr id="trlinefordates" <?php echo $bcnd[$var]; ?>>
479
-	<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print '<td></td>'; } ?>
479
+	<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print '<td></td>'; } ?>
480 480
 	<td colspan="<?php echo $colspan; ?>">
481 481
 	<?php
482
-	$date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
483
-	$date_end=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
484
-	if (! empty($object->element) && $object->element == 'contrat')
482
+	$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
483
+	$date_end = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
484
+	if (!empty($object->element) && $object->element == 'contrat')
485 485
 	{
486 486
 		print $langs->trans("DateStartPlanned").' ';
487
-		print $form->selectDate($date_start,"date_start",$usehm,$usehm,1,"addproduct");
487
+		print $form->selectDate($date_start, "date_start", $usehm, $usehm, 1, "addproduct");
488 488
 		print ' &nbsp; '.$langs->trans("DateEndPlanned").' ';
489
-		print $form->selectDate($date_end,"date_end",$usehm,$usehm,1,"addproduct");
489
+		print $form->selectDate($date_end, "date_end", $usehm, $usehm, 1, "addproduct");
490 490
 	}
491 491
 	else
492 492
 	{
493 493
 		echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
494
-		print $form->selectDate($date_start, 'date_start', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, 1, "addproduct", 1, 0);
494
+		print $form->selectDate($date_start, 'date_start', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, 1, "addproduct", 1, 0);
495 495
 		echo ' '.$langs->trans('to').' ';
496
-		print $form->selectDate($date_end, 'date_end', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, 1, "addproduct", 1, 0);
496
+		print $form->selectDate($date_end, 'date_end', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, 1, "addproduct", 1, 0);
497 497
 	};
498 498
 	print '<script type="text/javascript">';
499 499
 	if (!$date_start) {
@@ -523,20 +523,20 @@  discard block
 block discarded – undo
523 523
 <script type="text/javascript">
524 524
 
525 525
 <?php
526
-if (! empty($usemargins) && $user->rights->margins->creer)
526
+if (!empty($usemargins) && $user->rights->margins->creer)
527 527
 {
528 528
 ?>
529 529
 
530 530
 	/* Some js test when we click on button "Add" */
531 531
 	jQuery(document).ready(function() {
532 532
 		<?php
533
-		if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { ?>
533
+		if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { ?>
534 534
 			$("input[name='np_marginRate']:first").blur(function(e) {
535 535
 				return checkFreeLine(e, "np_marginRate");
536 536
 			});
537 537
 		<?php
538 538
 		}
539
-		if (! empty($conf->global->DISPLAY_MARK_RATES)) { ?>
539
+		if (!empty($conf->global->DISPLAY_MARK_RATES)) { ?>
540 540
 			$("input[name='np_markRate']:first").blur(function(e) {
541 541
 				return checkFreeLine(e, "np_markRate");
542 542
 			});
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 	});
634 634
 
635 635
 	<?php
636
-	if(!$freelines) { ?>
636
+	if (!$freelines) { ?>
637 637
 		$("#prod_entry_mode_predef").click();
638 638
 	<?php
639 639
 	}
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 		jQuery('#trlinefordates').show();
650 650
 
651 651
 		<?php
652
-		if (! empty($usemargins) && $user->rights->margins->creer)
652
+		if (!empty($usemargins) && $user->rights->margins->creer)
653 653
 		{
654 654
 			$langs->load('stocks');
655 655
 			?>
Please login to merge, or discard this patch.
dolibarr/htdocs/core/tpl/bloc_showhide.tpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
 	exit;
25 25
 }
26 26
 
27
-$hide = true;	// Hide by default
28
-if (isset($parameters['showblocbydefault'])) $hide=(empty($parameters['showblocbydefault']) ? true : false);
27
+$hide = true; // Hide by default
28
+if (isset($parameters['showblocbydefault'])) $hide = (empty($parameters['showblocbydefault']) ? true : false);
29 29
 if (isset($object->extraparams[$blocname]['showhide'])) $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false);
30 30
 
31 31
 ?>
Please login to merge, or discard this patch.
dolibarr/htdocs/core/tpl/extrafields_list_print_fields.tpl.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,32 +1,32 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Protection to avoid direct call of template
4
-if (empty($conf) || ! is_object($conf))
4
+if (empty($conf) || !is_object($conf))
5 5
 {
6 6
 	print "Error, template page can't be called as URL";
7 7
 	exit;
8 8
 }
9 9
 
10
-if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element;
10
+if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey = $object->table_element;
11 11
 
12 12
 // Loop to show all columns of extrafields from $obj, $extrafields and $db
13
-if (! empty($extrafieldsobjectkey))	// $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
13
+if (!empty($extrafieldsobjectkey))	// $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
14 14
 {
15 15
 	if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
16 16
 	{
17
-		foreach($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val)
17
+		foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val)
18 18
 		{
19
-			if (! empty($arrayfields["ef.".$key]['checked']))
19
+			if (!empty($arrayfields["ef.".$key]['checked']))
20 20
 			{
21
-				$align=$extrafields->getAlignFlag($key, $extrafieldsobjectkey);
21
+				$align = $extrafields->getAlignFlag($key, $extrafieldsobjectkey);
22 22
 				print '<td';
23 23
 				if ($align) print ' align="'.$align.'"';
24 24
 				print '>';
25
-				$tmpkey='options_'.$key;
25
+				$tmpkey = 'options_'.$key;
26 26
 				if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey))
27 27
 				{
28 28
 					$datenotinstring = $obj->$tmpkey;
29
-					if (! is_numeric($obj->$tmpkey))	// For backward compatibility
29
+					if (!is_numeric($obj->$tmpkey))	// For backward compatibility
30 30
 					{
31 31
 						$datenotinstring = $db->jdate($datenotinstring);
32 32
 					}
@@ -39,18 +39,18 @@  discard block
 block discarded – undo
39 39
 
40 40
 				print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey);
41 41
 				print '</td>';
42
-				if (! $i) $totalarray['nbfield']++;
42
+				if (!$i) $totalarray['nbfield']++;
43 43
 
44 44
                 if ($extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) {
45
-                    if (! $i) {
45
+                    if (!$i) {
46 46
                         // we keep position for the first line
47 47
                         $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield'];
48 48
                     }
49 49
                     $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
50 50
                 }
51
-				if (! empty($val['isameasure']))
51
+				if (!empty($val['isameasure']))
52 52
 				{
53
-					if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey;
53
+					if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'ef.'.$tmpkey;
54 54
 					$totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey;
55 55
 				}
56 56
 			}
Please login to merge, or discard this patch.
dolibarr/htdocs/core/tpl/contacts.tpl.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 
24 24
 // Protection to avoid direct call of template
25
-if (empty($object) || ! is_object($object))
25
+if (empty($object) || !is_object($object))
26 26
 {
27 27
 	print "Error, template page can't be called as URL";
28 28
 	exit;
@@ -35,28 +35,28 @@  discard block
 block discarded – undo
35 35
 $module = $object->element;
36 36
 
37 37
 // Special cases
38
-if ($module == 'propal')				{ $permission=$user->rights->propale->creer; }
39
-elseif ($module == 'fichinter')			{ $permission=$user->rights->ficheinter->creer; }
40
-elseif ($module == 'order_supplier')	{ $permission=$user->rights->fournisseur->commande->creer; }
41
-elseif ($module == 'invoice_supplier')	{ $permission=$user->rights->fournisseur->facture->creer; }
42
-elseif ($module == 'project')		{ $permission=$user->rights->projet->creer; }
43
-elseif ($module == 'action')		{ $permission=$user->rights->agenda->myactions->create; }
44
-elseif ($module == 'shipping')		{ $permission=$user->rights->expedition->creer; }
45
-elseif ($module == 'reception')		{ $permission=$user->rights->reception->creer; }
46
-elseif ($module == 'project_task')	{ $permission=$user->rights->projet->creer; }
47
-elseif (! isset($permission) && isset($user->rights->$module->creer))
38
+if ($module == 'propal') { $permission = $user->rights->propale->creer; }
39
+elseif ($module == 'fichinter') { $permission = $user->rights->ficheinter->creer; }
40
+elseif ($module == 'order_supplier') { $permission = $user->rights->fournisseur->commande->creer; }
41
+elseif ($module == 'invoice_supplier') { $permission = $user->rights->fournisseur->facture->creer; }
42
+elseif ($module == 'project') { $permission = $user->rights->projet->creer; }
43
+elseif ($module == 'action') { $permission = $user->rights->agenda->myactions->create; }
44
+elseif ($module == 'shipping') { $permission = $user->rights->expedition->creer; }
45
+elseif ($module == 'reception') { $permission = $user->rights->reception->creer; }
46
+elseif ($module == 'project_task') { $permission = $user->rights->projet->creer; }
47
+elseif (!isset($permission) && isset($user->rights->$module->creer))
48 48
 {
49
-	$permission=$user->rights->$module->creer;
49
+	$permission = $user->rights->$module->creer;
50 50
 }
51
-elseif (! isset($permission)  && isset($user->rights->$module->write))
51
+elseif (!isset($permission) && isset($user->rights->$module->write))
52 52
 {
53
-	$permission=$user->rights->$module->write;
53
+	$permission = $user->rights->$module->write;
54 54
 }
55 55
 
56
-$formcompany= new FormCompany($db);
57
-$companystatic=new Societe($db);
58
-$contactstatic=new Contact($db);
59
-$userstatic=new User($db);
56
+$formcompany = new FormCompany($db);
57
+$companystatic = new Societe($db);
58
+$contactstatic = new Contact($db);
59
+$userstatic = new User($db);
60 60
 
61 61
 ?>
62 62
 
@@ -89,14 +89,14 @@  discard block
 block discarded – undo
89 89
 	<input type="hidden" name="action" value="addcontact" />
90 90
 	<input type="hidden" name="source" value="internal" />
91 91
 	<?php if ($withproject) print '<input type="hidden" name="withproject" value="'.$withproject.'">'; ?>
92
-		<div class="nowrap tagtd"><?php echo img_object('','user').' '.$langs->trans("Users"); ?></div>
92
+		<div class="nowrap tagtd"><?php echo img_object('', 'user').' '.$langs->trans("Users"); ?></div>
93 93
 		<div class="tagtd"><?php echo $conf->global->MAIN_INFO_SOCIETE_NOM; ?></div>
94
-		<div class="tagtd maxwidthonsmartphone"><?php echo $form->select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?></div>
94
+		<div class="tagtd maxwidthonsmartphone"><?php echo $form->select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?></div>
95 95
 		<div class="tagtd maxwidthonsmartphone">
96 96
 		<?php
97
-		$tmpobject=$object;
98
-		if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc;
99
-		echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal');
97
+		$tmpobject = $object;
98
+		if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject = $objectsrc;
99
+		echo $formcompany->selectTypeContact($tmpobject, '', 'type', 'internal');
100 100
 		?></div>
101 101
 		<div class="tagtd">&nbsp;</div>
102 102
 		<div class="tagtd center"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div>
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 	<input type="hidden" name="action" value="addcontact" />
117 117
 	<input type="hidden" name="source" value="external" />
118 118
 	<?php if ($withproject) print '<input type="hidden" name="withproject" value="'.$withproject.'">'; ?>
119
-		<div class="tagtd nowrap noborderbottom"><?php echo img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>
119
+		<div class="tagtd nowrap noborderbottom"><?php echo img_object('', 'contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>
120 120
 		<div class="tagtd nowrap maxwidthonsmartphone noborderbottom">
121
-			<?php $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid; ?>
121
+			<?php $selectedCompany = isset($_GET["newcompany"]) ? $_GET["newcompany"] : $object->socid; ?>
122 122
 			<?php
123 123
 			// add company icon before select list
124 124
 			if ($selectedCompany)
@@ -129,17 +129,17 @@  discard block
 block discarded – undo
129 129
 			<?php $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
130 130
 		</div>
131 131
 		<div class="tagtd maxwidthonsmartphone noborderbottom">
132
-			<?php $nbofcontacts=$form->select_contacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 0, 'minwidth100imp'); ?>
132
+			<?php $nbofcontacts = $form->select_contacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 0, 'minwidth100imp'); ?>
133 133
 		</div>
134 134
 		<div class="tagtd maxwidthonsmartphone noborderbottom">
135 135
 			<?php
136
-			$tmpobject=$object;
137
-			if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc;
138
-			$formcompany->selectTypeContact($tmpobject, '', 'type','external', 'position', 0, 'minwidth100imp'); ?>
136
+			$tmpobject = $object;
137
+			if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject = $objectsrc;
138
+			$formcompany->selectTypeContact($tmpobject, '', 'type', 'external', 'position', 0, 'minwidth100imp'); ?>
139 139
 		</div>
140 140
 		<div class="tagtd noborderbottom">&nbsp;</div>
141 141
 		<div class="tagtd center noborderbottom">
142
-			<input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (! $nbofcontacts) echo ' disabled'; ?>>
142
+			<input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (!$nbofcontacts) echo ' disabled'; ?>>
143 143
 		</div>
144 144
 	</form>
145 145
 
@@ -158,14 +158,14 @@  discard block
 block discarded – undo
158 158
 	</form>
159 159
 
160 160
 	<?php
161
-	$arrayofsource=array('internal','external');	// Show both link to user and thirdparties contacts
162
-	foreach($arrayofsource as $source) {
161
+	$arrayofsource = array('internal', 'external'); // Show both link to user and thirdparties contacts
162
+	foreach ($arrayofsource as $source) {
163 163
 
164
-		$tmpobject=$object;
165
-		if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc;
164
+		$tmpobject = $object;
165
+		if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject = $objectsrc;
166 166
 
167
-		$tab = $tmpobject->liste_contact(-1,$source);
168
-		$num=count($tab);
167
+		$tab = $tmpobject->liste_contact(-1, $source);
168
+		$num = count($tab);
169 169
 
170 170
 		$i = 0;
171 171
 		while ($i < $num) {
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 
174 174
 	<form class="tagtr oddeven">
175 175
 		<div class="tagtd" align="left">
176
-			<?php if ($tab[$i]['source']=='internal') echo $langs->trans("User"); ?>
177
-			<?php if ($tab[$i]['source']=='external') echo $langs->trans("ThirdPartyContact"); ?>
176
+			<?php if ($tab[$i]['source'] == 'internal') echo $langs->trans("User"); ?>
177
+			<?php if ($tab[$i]['source'] == 'external') echo $langs->trans("ThirdPartyContact"); ?>
178 178
 		</div>
179 179
 		<div class="tagtd" align="left">
180 180
 			<?php
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 			{
188 188
 				echo $conf->global->MAIN_INFO_SOCIETE_NOM;
189 189
 			}
190
-			if (! $tab[$i]['socid'])
190
+			if (!$tab[$i]['socid'])
191 191
 			{
192 192
 				echo '&nbsp;';
193 193
 			}
@@ -197,12 +197,12 @@  discard block
 block discarded – undo
197 197
 			<?php
198 198
 			$statusofcontact = $tab[$i]['status'];
199 199
 
200
-			if ($tab[$i]['source']=='internal')
200
+			if ($tab[$i]['source'] == 'internal')
201 201
 			{
202 202
 				$userstatic->fetch($tab[$i]['id']);
203 203
 				echo $userstatic->getNomUrl(-1, '', 0, 0, 0, 0, '', 'valignmiddle');
204 204
 			}
205
-			if ($tab[$i]['source']=='external')
205
+			if ($tab[$i]['source'] == 'external')
206 206
 			{
207 207
 				$contactstatic->fetch($tab[$i]['id']);
208 208
 				echo $contactstatic->getNomUrl(1, '', 0, 0, 0, 0, '', 'valignmiddle');
@@ -213,13 +213,13 @@  discard block
 block discarded – undo
213 213
 		<div class="tagtd center">
214 214
 			<?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; ?>
215 215
 			<?php
216
-			if ($tab[$i]['source']=='internal')
216
+			if ($tab[$i]['source'] == 'internal')
217 217
 			{
218
-				echo $userstatic->LibStatut($tab[$i]['statuscontact'],3);
218
+				echo $userstatic->LibStatut($tab[$i]['statuscontact'], 3);
219 219
 			}
220
-			if ($tab[$i]['source']=='external')
220
+			if ($tab[$i]['source'] == 'external')
221 221
 			{
222
-				echo $contactstatic->LibStatut($tab[$i]['statuscontact'],3);
222
+				echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3);
223 223
 			}
224 224
 			?>
225 225
 			<?php //if ($object->statut >= 0) echo '</a>'; ?>
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 	if (is_object($hookmanager))
242 242
 	{
243 243
 		$hookmanager->initHooks(array('contacttpl'));
244
-		$parameters=array();
245
-		$reshook=$hookmanager->executeHooks('formContactTpl',$parameters,$object,$action);
244
+		$parameters = array();
245
+		$reshook = $hookmanager->executeHooks('formContactTpl', $parameters, $object, $action);
246 246
 	}
247 247
 ?>
248 248
 <!-- END PHP TEMPLATE CONTACTS -->
Please login to merge, or discard this patch.
dolibarr/htdocs/core/tpl/card_presend.tpl.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  */
28 28
 
29 29
 // Protection to avoid direct call of template
30
-if (empty($conf) || ! is_object($conf))
30
+if (empty($conf) || !is_object($conf))
31 31
 {
32 32
 	print "Error, template page can't be called as URL";
33 33
 	exit;
@@ -38,21 +38,21 @@  discard block
 block discarded – undo
38 38
 {
39 39
 	$langs->load("mails");
40 40
 
41
-	$titreform='SendMail';
41
+	$titreform = 'SendMail';
42 42
 
43 43
 	$object->fetch_projet();
44 44
 
45
-	if (! in_array($object->element, array('societe', 'user', 'member')))
45
+	if (!in_array($object->element, array('societe', 'user', 'member')))
46 46
 	{
47 47
 		// TODO get also the main_lastdoc field of $object. If not found, try to guess with following code
48 48
 
49 49
 		$ref = dol_sanitizeFileName($object->ref);
50
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
51
-		$fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
50
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
51
+		$fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
52 52
 		//
53 53
 		if ($object->element == 'invoice_supplier')
54 54
 		{
55
-			$fileparams = dol_most_recent_file($diroutput . '/' . get_exdir($object->id,2,0,0,$object,$object->element).$ref, preg_quote($ref,'/').'([^\-])+');
55
+			$fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+');
56 56
 		}
57 57
 
58 58
 		$file = $fileparams['fullname'];
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	// Define output language
62 62
 	$outputlangs = $langs;
63 63
 	$newlang = '';
64
-	if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
64
+	if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id']))
65 65
 	{
66 66
 		$newlang = $_REQUEST['lang_id'];
67 67
 	}
@@ -75,27 +75,27 @@  discard block
 block discarded – undo
75 75
 		$outputlangs = new Translate('', $conf);
76 76
 		$outputlangs->setDefaultLang($newlang);
77 77
 		// Load traductions files requiredby by page
78
-		$outputlangs->loadLangs(array('commercial','bills','orders','contracts','members','propal','products','supplier_proposal','interventions'));
78
+		$outputlangs->loadLangs(array('commercial', 'bills', 'orders', 'contracts', 'members', 'propal', 'products', 'supplier_proposal', 'interventions'));
79 79
 	}
80 80
 
81
-	$topicmail='';
81
+	$topicmail = '';
82 82
 	if (empty($object->ref_client)) {
83 83
 		$topicmail = $outputlangs->trans($defaulttopic, '__REF__');
84
-	} else if (! empty($object->ref_client)) {
84
+	} else if (!empty($object->ref_client)) {
85 85
 		$topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REFCLIENT__)');
86 86
 	}
87 87
 
88 88
 	// Build document if it not exists
89
-	if (! in_array($object->element, array('societe', 'user', 'member')))
89
+	if (!in_array($object->element, array('societe', 'user', 'member')))
90 90
 	{
91
-		if ((! $file || ! is_readable($file)) && method_exists($object, 'generateDocument'))
91
+		if ((!$file || !is_readable($file)) && method_exists($object, 'generateDocument'))
92 92
 		{
93 93
 			$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
94 94
 			if ($result <= 0) {
95 95
 				dol_print_error($db, $object->error, $object->errors);
96 96
 				exit();
97 97
 			}
98
-			$fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
98
+			$fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
99 99
 			$file = $fileparams['fullname'];
100 100
 		}
101 101
 	}
@@ -108,21 +108,21 @@  discard block
 block discarded – undo
108 108
 	dol_fiche_head('');
109 109
 
110 110
 	// Create form for email
111
-	include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
111
+	include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
112 112
 	$formmail = new FormMail($db);
113 113
 
114
-	$formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang);
115
-	$formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
114
+	$formmail->param['langsmodels'] = (empty($newlang) ? $langs->defaultlang : $newlang);
115
+	$formmail->fromtype = (GETPOST('fromtype') ?GETPOST('fromtype') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user'));
116 116
 
117 117
 	if ($formmail->fromtype === 'user')
118 118
 	{
119 119
 		$formmail->fromid = $user->id;
120 120
 	}
121
-	$formmail->trackid=$trackid;
122
-	if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2))	// If bit 2 is set
121
+	$formmail->trackid = $trackid;
122
+	if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2))	// If bit 2 is set
123 123
 	{
124 124
 		include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
125
-		$formmail->frommail=dolAddEmailTrackId($formmail->frommail, $trackid);
125
+		$formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid);
126 126
 	}
127 127
 	$formmail->withfrom = 1;
128 128
 
@@ -158,18 +158,18 @@  discard block
 block discarded – undo
158 158
 		}
159 159
 	}
160 160
 	if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) {
161
-		$listeuser=array();
161
+		$listeuser = array();
162 162
 		$fuserdest = new User($db);
163 163
 
164
-		$result= $fuserdest->fetchAll('ASC', 't.lastname', 0, 0, array('customsql'=>'t.statut=1 AND t.employee=1 AND t.email IS NOT NULL AND t.email<>\'\''));
165
-		if ($result>0 && is_array($fuserdest->users) && count($fuserdest->users)>0) {
166
-			foreach($fuserdest->users as $uuserdest) {
167
-				$listeuser[$uuserdest->id] = $uuserdest->user_get_property($uuserdest->id,'email');
164
+		$result = $fuserdest->fetchAll('ASC', 't.lastname', 0, 0, array('customsql'=>'t.statut=1 AND t.employee=1 AND t.email IS NOT NULL AND t.email<>\'\''));
165
+		if ($result > 0 && is_array($fuserdest->users) && count($fuserdest->users) > 0) {
166
+			foreach ($fuserdest->users as $uuserdest) {
167
+				$listeuser[$uuserdest->id] = $uuserdest->user_get_property($uuserdest->id, 'email');
168 168
 			}
169
-		} elseif ($result<0) {
170
-			setEventMessages(null, $fuserdest->errors,'errors');
169
+		} elseif ($result < 0) {
170
+			setEventMessages(null, $fuserdest->errors, 'errors');
171 171
 		}
172
-		if (count($listeuser)>0) {
172
+		if (count($listeuser) > 0) {
173 173
 			$formmail->withtouser = $listeuser;
174 174
 			$formmail->withtoccuser = $listeuser;
175 175
 		}
@@ -185,12 +185,12 @@  discard block
 block discarded – undo
185 185
 	$formmail->withcancel = 1;
186 186
 
187 187
 	//$arrayoffamiliestoexclude=array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...);
188
-	if (! isset($arrayoffamiliestoexclude)) $arrayoffamiliestoexclude=null;
188
+	if (!isset($arrayoffamiliestoexclude)) $arrayoffamiliestoexclude = null;
189 189
 
190 190
 	// Make substitution in email content
191 191
 	$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object);
192
-	$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-read.php?tag=' . $object->thirdparty->tag . '&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
193
-	$substitutionarray['__PERSONALIZED__'] = '';	// deprecated
192
+	$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
193
+	$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
194 194
 	$substitutionarray['__CONTACTCIVNAME__'] = '';
195 195
 	$parameters = array(
196 196
 		'mode' => 'formemail'
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
 	// Find the good contact adress
201 201
 	$custcontact = '';
202 202
 	$contactarr = array();
203
-	$contactarr = $object->liste_contact(- 1, 'external');
203
+	$contactarr = $object->liste_contact(-1, 'external');
204 204
 
205 205
 	if (is_array($contactarr) && count($contactarr) > 0) {
206
-		require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
206
+		require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
207 207
         $contactstatic = new Contact($db);
208 208
 
209 209
 		foreach ($contactarr as $contact) {
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 	// Tableau des parametres complementaires
219 219
 	$formmail->param['action'] = 'send';
220 220
 	$formmail->param['models'] = $modelmail;
221
-	$formmail->param['models_id']=GETPOST('modelmailselected','int');
221
+	$formmail->param['models_id'] = GETPOST('modelmailselected', 'int');
222 222
 	$formmail->param['id'] = $object->id;
223
-	$formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
223
+	$formmail->param['returnurl'] = $_SERVER["PHP_SELF"].'?id='.$object->id;
224 224
 	$formmail->param['fileinit'] = array($file);
225 225
 
226 226
 	// Show form
Please login to merge, or discard this patch.
dolibarr/htdocs/core/tpl/admin_extrafields_add.tpl.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
  */
29 29
 
30 30
 // Protection to avoid direct call of template
31
-if (empty($conf) || ! is_object($conf))
31
+if (empty($conf) || !is_object($conf))
32 32
 {
33 33
 	print "Error, template page can't be called as URL";
34 34
 	exit;
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
     		var list = jQuery("#list");
56 56
             var totalizable = jQuery("#totalizable");
57 57
     		<?php
58
-    		if ((GETPOST('type','alpha') != "select") && (GETPOST('type','alpha') != "sellist"))
58
+    		if ((GETPOST('type', 'alpha') != "select") && (GETPOST('type', 'alpha') != "sellist"))
59 59
     		{
60 60
     			print 'jQuery("#value_choice").hide();';
61 61
     		}
62 62
 
63
-    		if (GETPOST('type','alpha') == "separate")
63
+    		if (GETPOST('type', 'alpha') == "separate")
64 64
     		{
65 65
 				print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);";
66 66
     			print 'jQuery("#value_choice").hide();';
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 				langfile.removeAttr('disabled');required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.removeAttr('disabled');
127 127
 			}
128 128
     	}
129
-    	init_typeoffields('<?php echo GETPOST('type','alpha'); ?>');
129
+    	init_typeoffields('<?php echo GETPOST('type', 'alpha'); ?>');
130 130
     	jQuery("#type").change(function() {
131 131
     		init_typeoffields($(this).val());
132 132
     	});
@@ -146,15 +146,15 @@  discard block
 block discarded – undo
146 146
 
147 147
 <table summary="listofattributes" class="border centpercent">
148 148
 <!-- Label -->
149
-<tr><td class="titlefield fieldrequired"><?php echo $langs->trans("LabelOrTranslationKey"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo GETPOST('label','alpha'); ?>"></td></tr>
149
+<tr><td class="titlefield fieldrequired"><?php echo $langs->trans("LabelOrTranslationKey"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo GETPOST('label', 'alpha'); ?>"></td></tr>
150 150
 <!-- Code -->
151
-<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?></td><td class="valeur"><input type="text" name="attrname" id="attrname"  size="10" value="<?php echo GETPOST('attrname','alpha'); ?>"> (<?php echo $langs->trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)</td></tr>
151
+<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?></td><td class="valeur"><input type="text" name="attrname" id="attrname"  size="10" value="<?php echo GETPOST('attrname', 'alpha'); ?>"> (<?php echo $langs->trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)</td></tr>
152 152
 <!-- Type -->
153 153
 <tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
154
-<?php print $form->selectarray('type',$type2label,GETPOST('type','alpha')); ?>
154
+<?php print $form->selectarray('type', $type2label, GETPOST('type', 'alpha')); ?>
155 155
 </td></tr>
156 156
 <!-- Size -->
157
-<tr class="extra_size"><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td class="valeur"><input id="size" type="text" name="size" size="5" value="<?php echo (GETPOST('size','alpha')?GETPOST('size','alpha'):''); ?>"></td></tr>
157
+<tr class="extra_size"><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td class="valeur"><input id="size" type="text" name="size" size="5" value="<?php echo (GETPOST('size', 'alpha') ?GETPOST('size', 'alpha') : ''); ?>"></td></tr>
158 158
 <!-- Default Value (for select list / radio/ checkbox) -->
159 159
 <tr id="value_choice">
160 160
 <td>
@@ -163,41 +163,41 @@  discard block
 block discarded – undo
163 163
 <td>
164 164
     <table class="nobordernopadding">
165 165
     <tr><td>
166
-    	<textarea name="param" id="param" cols="80" rows="<?php echo ROWS_4 ?>"><?php echo GETPOST('param','alpha'); ?></textarea>
166
+    	<textarea name="param" id="param" cols="80" rows="<?php echo ROWS_4 ?>"><?php echo GETPOST('param', 'alpha'); ?></textarea>
167 167
     </td><td>
168
-    <span id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0,'', 0, 2, 'helpvalue1')?></span>
169
-    <span id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0,'', 0, 2, 'helpvalue2')?></span>
170
-    <span id="helpchkbxlst"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0,'', 0, 2, 'helpvalue3')?></span>
171
-    <span id="helplink"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink"),1,0,'', 0, 2, 'helpvalue4')?></span>
172
-    <span id="helppassword"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"),1,0,'', 0, 2, 'helpvalue5')?></span>
168
+    <span id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?></span>
169
+    <span id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?></span>
170
+    <span id="helpchkbxlst"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?></span>
171
+    <span id="helplink"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?></span>
172
+    <span id="helppassword"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?></span>
173 173
     </td></tr>
174 174
     </table>
175 175
 </td>
176 176
 </tr>
177 177
 <!-- Position -->
178
-<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOSTISSET('pos')?GETPOST('pos','int'):100; ?>"></td></tr>
178
+<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOSTISSET('pos') ?GETPOST('pos', 'int') : 100; ?>"></td></tr>
179 179
 <!-- Language file -->
180
-<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" id="langfile" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag(GETPOST('langfile','alpha')); ?>"></td></tr>
180
+<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" id="langfile" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag(GETPOST('langfile', 'alpha')); ?>"></td></tr>
181 181
 <!-- Computed Value -->
182
-<tr class="extra_computed_value"><td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?></td><td class="valeur"><input id="computed_value" type="text" name="computed_value" class="quatrevingtpercent" value="<?php echo (GETPOST('computed_value','none')?GETPOST('computed_value','none'):''); ?>"></td></tr>
182
+<tr class="extra_computed_value"><td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?></td><td class="valeur"><input id="computed_value" type="text" name="computed_value" class="quatrevingtpercent" value="<?php echo (GETPOST('computed_value', 'none') ?GETPOST('computed_value', 'none') : ''); ?>"></td></tr>
183 183
 <!-- Default Value (at sql setup level) -->
184
-<tr class="extra_default_value"><td><?php echo $langs->trans("DefaultValue").' ('.$langs->trans("Database").')'; ?></td><td class="valeur"><input id="default_value" type="text" name="default_value" size="5" value="<?php echo (GETPOST('default_value','alpha')?GETPOST('default_value','alpha'):''); ?>"></td></tr>
184
+<tr class="extra_default_value"><td><?php echo $langs->trans("DefaultValue").' ('.$langs->trans("Database").')'; ?></td><td class="valeur"><input id="default_value" type="text" name="default_value" size="5" value="<?php echo (GETPOST('default_value', 'alpha') ?GETPOST('default_value', 'alpha') : ''); ?>"></td></tr>
185 185
 <!-- Unique -->
186
-<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo (GETPOST('unique','alpha')?' checked':''); ?>></td></tr>
186
+<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo (GETPOST('unique', 'alpha') ? ' checked' : ''); ?>></td></tr>
187 187
 <!-- Required -->
188
-<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo (GETPOST('required','alpha')?' checked':''); ?>></td></tr>
188
+<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo (GETPOST('required', 'alpha') ? ' checked' : ''); ?>></td></tr>
189 189
 <!-- Always editable -->
190
-<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable','alpha') || ! GETPOST('button','alpha'))?' checked':''); ?>></td></tr>
190
+<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable', 'alpha') || !GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr>
191 191
 <!-- Visibility -->
192 192
 <tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
193
-</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo GETPOST('list','int')!='' ? GETPOST('list','int') : '1'; ?>"></td></tr>
193
+</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo GETPOST('list', 'int') != '' ? GETPOST('list', 'int') : '1'; ?>"></td></tr>
194 194
 <!-- Totalizable -->
195
-<tr class="extra_totalizable"><td><?php echo $langs->trans("Totalizable"); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ((GETPOST('totalizable','alpha') || GETPOST('button','alpha'))?' checked':''); ?>></td></tr>
195
+<tr class="extra_totalizable"><td><?php echo $langs->trans("Totalizable"); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ((GETPOST('totalizable', 'alpha') || GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr>
196 196
 <!-- Help tooltip -->
197 197
 <tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag($help); ?>"></td></tr>
198 198
 <?php if ($conf->multicompany->enabled) { ?>
199 199
 	<!-- Multicompany entity -->
200
-    <tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (GETPOST('entitycurrentorall','alpha') ? '':' checked'); ?>></td></tr>
200
+    <tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (GETPOST('entitycurrentorall', 'alpha') ? '' : ' checked'); ?>></td></tr>
201 201
 <?php } ?>
202 202
 </table>
203 203
 
Please login to merge, or discard this patch.