@@ -59,7 +59,9 @@ discard block |
||
59 | 59 | $head[$h][0] = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$object->id; |
60 | 60 | $head[$h][1] = $langs->trans("Subscriptions"); |
61 | 61 | $head[$h][2] = 'subscription'; |
62 | - if ($nbSubscription > 0) $head[$h][1].= ' <span class="badge">'.$nbSubscription.'</span>'; |
|
62 | + if ($nbSubscription > 0) { |
|
63 | + $head[$h][1].= ' <span class="badge">'.$nbSubscription.'</span>'; |
|
64 | + } |
|
63 | 65 | $h++; |
64 | 66 | } |
65 | 67 | |
@@ -70,13 +72,21 @@ discard block |
||
70 | 72 | complete_head_from_modules($conf,$langs,$object,$head,$h,'member'); |
71 | 73 | |
72 | 74 | $nbNote = 0; |
73 | - if(!empty($object->note)) $nbNote++; |
|
74 | - if(!empty($object->note_private)) $nbNote++; |
|
75 | - if(!empty($object->note_public)) $nbNote++; |
|
75 | + if(!empty($object->note)) { |
|
76 | + $nbNote++; |
|
77 | + } |
|
78 | + if(!empty($object->note_private)) { |
|
79 | + $nbNote++; |
|
80 | + } |
|
81 | + if(!empty($object->note_public)) { |
|
82 | + $nbNote++; |
|
83 | + } |
|
76 | 84 | $head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id; |
77 | 85 | $head[$h][1] = $langs->trans("Note"); |
78 | 86 | $head[$h][2] = 'note'; |
79 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
87 | + if ($nbNote > 0) { |
|
88 | + $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
89 | + } |
|
80 | 90 | $h++; |
81 | 91 | |
82 | 92 | // Attachments |
@@ -87,7 +97,9 @@ discard block |
||
87 | 97 | $nbLinks=Link::count($db, $object->element, $object->id); |
88 | 98 | $head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id; |
89 | 99 | $head[$h][1] = $langs->trans('Documents'); |
90 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
100 | + if (($nbFiles+$nbLinks) > 0) { |
|
101 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
102 | + } |
|
91 | 103 | $head[$h][2] = 'document'; |
92 | 104 | $h++; |
93 | 105 |
@@ -45,7 +45,9 @@ discard block |
||
45 | 45 | $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); |
46 | 46 | $head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id; |
47 | 47 | $head[$h][1] = $langs->trans("ContactsAddresses"); |
48 | - if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
48 | + if ($nbContact > 0) { |
|
49 | + $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
50 | + } |
|
49 | 51 | $head[$h][2] = 'contact'; |
50 | 52 | $h++; |
51 | 53 | } |
@@ -59,11 +61,17 @@ discard block |
||
59 | 61 | if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) |
60 | 62 | { |
61 | 63 | $nbNote = 0; |
62 | - if(!empty($object->note_private)) $nbNote++; |
|
63 | - if(!empty($object->note_public)) $nbNote++; |
|
64 | + if(!empty($object->note_private)) { |
|
65 | + $nbNote++; |
|
66 | + } |
|
67 | + if(!empty($object->note_public)) { |
|
68 | + $nbNote++; |
|
69 | + } |
|
64 | 70 | $head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id; |
65 | 71 | $head[$h][1] = $langs->trans("Notes"); |
66 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
72 | + if ($nbNote > 0) { |
|
73 | + $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
74 | + } |
|
67 | 75 | $head[$h][2] = 'note'; |
68 | 76 | $h++; |
69 | 77 | } |
@@ -75,7 +83,9 @@ discard block |
||
75 | 83 | $nbLinks=Link::count($db, $object->element, $object->id); |
76 | 84 | $head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id; |
77 | 85 | $head[$h][1] = $langs->trans("Documents"); |
78 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
86 | + if (($nbFiles+$nbLinks) > 0) { |
|
87 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
88 | + } |
|
79 | 89 | $head[$h][2] = 'documents'; |
80 | 90 | $h++; |
81 | 91 |
@@ -55,8 +55,7 @@ |
||
55 | 55 | $_Avery_Labels[$row['code']]['custom_x']=$row['custom_x']; |
56 | 56 | $_Avery_Labels[$row['code']]['custom_y']=$row['custom_y']; |
57 | 57 | } |
58 | -} |
|
59 | -else |
|
58 | +} else |
|
60 | 59 | { |
61 | 60 | dol_print_error($db); |
62 | 61 | } |
@@ -69,7 +69,9 @@ discard block |
||
69 | 69 | $nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1); |
70 | 70 | $head[$tab][0] = DOL_URL_ROOT.'/contact/note.php?id='.$object->id; |
71 | 71 | $head[$tab][1] = $langs->trans("Note"); |
72 | - if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
72 | + if($nbNote > 0) { |
|
73 | + $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
74 | + } |
|
73 | 75 | $head[$tab][2] = 'note'; |
74 | 76 | $tab++; |
75 | 77 | } |
@@ -81,7 +83,9 @@ discard block |
||
81 | 83 | $nbLinks=Link::count($db, $object->element, $object->id); |
82 | 84 | $head[$tab][0] = DOL_URL_ROOT.'/contact/document.php?id='.$object->id; |
83 | 85 | $head[$tab][1] = $langs->trans("Documents"); |
84 | - if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
86 | + if (($nbFiles+$nbLinks) > 0) { |
|
87 | + $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
88 | + } |
|
85 | 89 | $head[$tab][2] = 'documents'; |
86 | 90 | $tab++; |
87 | 91 |
@@ -59,7 +59,9 @@ discard block |
||
59 | 59 | $nbLinks=Link::count($db, $object->element, $object->id); |
60 | 60 | $head[$tab][0] = DOL_URL_ROOT.'/loan/document.php?id='.$object->id; |
61 | 61 | $head[$tab][1] = $langs->trans("Documents"); |
62 | - if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
62 | + if (($nbFiles+$nbLinks) > 0) { |
|
63 | + $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
64 | + } |
|
63 | 65 | $head[$tab][2] = 'documents'; |
64 | 66 | $tab++; |
65 | 67 | |
@@ -68,7 +70,9 @@ discard block |
||
68 | 70 | $nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1); |
69 | 71 | $head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id; |
70 | 72 | $head[$tab][1] = $langs->trans("Notes"); |
71 | - if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
73 | + if($nbNote > 0) { |
|
74 | + $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
75 | + } |
|
72 | 76 | $head[$tab][2] = 'note'; |
73 | 77 | $tab++; |
74 | 78 | } |
@@ -40,17 +40,33 @@ discard block |
||
40 | 40 | $regeximgext='\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.xpm|\.xbm|\.svg'; // See also into product.class.php |
41 | 41 | |
42 | 42 | // Case filename is not a format image |
43 | - if (! preg_match('/('.$regeximgext.')$/i',$file,$reg)) return -1; |
|
43 | + if (! preg_match('/('.$regeximgext.')$/i',$file,$reg)) { |
|
44 | + return -1; |
|
45 | + } |
|
44 | 46 | |
45 | 47 | // Case filename is a format image but not supported by this PHP |
46 | 48 | $imgfonction=''; |
47 | - if (strtolower($reg[1]) == '.gif') $imgfonction = 'imagecreatefromgif'; |
|
48 | - if (strtolower($reg[1]) == '.png') $imgfonction = 'imagecreatefrompng'; |
|
49 | - if (strtolower($reg[1]) == '.jpg') $imgfonction = 'imagecreatefromjpeg'; |
|
50 | - if (strtolower($reg[1]) == '.jpeg') $imgfonction = 'imagecreatefromjpeg'; |
|
51 | - if (strtolower($reg[1]) == '.bmp') $imgfonction = 'imagecreatefromwbmp'; |
|
52 | - if (strtolower($reg[1]) == '.xpm') $imgfonction = 'imagecreatefromxpm'; |
|
53 | - if (strtolower($reg[1]) == '.xbm') $imgfonction = 'imagecreatefromxbm'; |
|
49 | + if (strtolower($reg[1]) == '.gif') { |
|
50 | + $imgfonction = 'imagecreatefromgif'; |
|
51 | + } |
|
52 | + if (strtolower($reg[1]) == '.png') { |
|
53 | + $imgfonction = 'imagecreatefrompng'; |
|
54 | + } |
|
55 | + if (strtolower($reg[1]) == '.jpg') { |
|
56 | + $imgfonction = 'imagecreatefromjpeg'; |
|
57 | + } |
|
58 | + if (strtolower($reg[1]) == '.jpeg') { |
|
59 | + $imgfonction = 'imagecreatefromjpeg'; |
|
60 | + } |
|
61 | + if (strtolower($reg[1]) == '.bmp') { |
|
62 | + $imgfonction = 'imagecreatefromwbmp'; |
|
63 | + } |
|
64 | + if (strtolower($reg[1]) == '.xpm') { |
|
65 | + $imgfonction = 'imagecreatefromxpm'; |
|
66 | + } |
|
67 | + if (strtolower($reg[1]) == '.xbm') { |
|
68 | + $imgfonction = 'imagecreatefromxbm'; |
|
69 | + } |
|
54 | 70 | if ($imgfonction) |
55 | 71 | { |
56 | 72 | if (! function_exists($imgfonction)) |
@@ -76,7 +92,9 @@ discard block |
||
76 | 92 | { |
77 | 93 | $ret=array(); |
78 | 94 | |
79 | - if (image_format_supported($file) < 0) return $ret; |
|
95 | + if (image_format_supported($file) < 0) { |
|
96 | + return $ret; |
|
97 | + } |
|
80 | 98 | |
81 | 99 | $filetoread = $file; |
82 | 100 | if (!$url) |
@@ -122,25 +140,20 @@ discard block |
||
122 | 140 | { |
123 | 141 | // Si le fichier n'a pas ete indique |
124 | 142 | return 'Bad parameter file'; |
125 | - } |
|
126 | - elseif (! file_exists($file)) |
|
143 | + } elseif (! file_exists($file)) |
|
127 | 144 | { |
128 | 145 | // Si le fichier passe en parametre n'existe pas |
129 | 146 | return $langs->trans("ErrorFileNotFound",$file); |
130 | - } |
|
131 | - elseif(image_format_supported($file) < 0) |
|
147 | + } elseif(image_format_supported($file) < 0) |
|
132 | 148 | { |
133 | 149 | return 'This filename '.$file.' does not seem to be an image filename.'; |
134 | - } |
|
135 | - elseif(!is_numeric($newWidth) && !is_numeric($newHeight)) |
|
150 | + } elseif(!is_numeric($newWidth) && !is_numeric($newHeight)) |
|
136 | 151 | { |
137 | 152 | return 'Wrong value for parameter newWidth or newHeight'; |
138 | - } |
|
139 | - elseif ($mode == 0 && $newWidth <= 0 && $newHeight <= 0) |
|
153 | + } elseif ($mode == 0 && $newWidth <= 0 && $newHeight <= 0) |
|
140 | 154 | { |
141 | 155 | return 'At least newHeight or newWidth must be defined for resizing'; |
142 | - } |
|
143 | - elseif ($mode == 1 && ($newWidth <= 0 || $newHeight <= 0)) |
|
156 | + } elseif ($mode == 1 && ($newWidth <= 0 || $newHeight <= 0)) |
|
144 | 157 | { |
145 | 158 | return 'Both newHeight or newWidth must be defined for croping'; |
146 | 159 | } |
@@ -151,11 +164,14 @@ discard block |
||
151 | 164 | $imgWidth = $infoImg[0]; // Largeur de l'image |
152 | 165 | $imgHeight = $infoImg[1]; // Hauteur de l'image |
153 | 166 | |
154 | - if ($mode == 0) // If resize, we check parameters |
|
167 | + if ($mode == 0) { |
|
168 | + // If resize, we check parameters |
|
155 | 169 | { |
156 | 170 | if ($newWidth <= 0) |
157 | 171 | { |
158 | - $newWidth=intval(($newHeight / $imgHeight) * $imgWidth); // Keep ratio |
|
172 | + $newWidth=intval(($newHeight / $imgHeight) * $imgWidth); |
|
173 | + } |
|
174 | + // Keep ratio |
|
159 | 175 | } |
160 | 176 | if ($newHeight <= 0) |
161 | 177 | { |
@@ -218,8 +234,7 @@ discard block |
||
218 | 234 | { |
219 | 235 | // Compatibilite image GIF |
220 | 236 | $imgThumb = imagecreate($newWidth, $newHeight); |
221 | - } |
|
222 | - else |
|
237 | + } else |
|
223 | 238 | { |
224 | 239 | $imgThumb = imagecreatetruecolor($newWidth, $newHeight); |
225 | 240 | } |
@@ -254,7 +269,9 @@ discard block |
||
254 | 269 | $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); |
255 | 270 | break; |
256 | 271 | } |
257 | - if (function_exists("imagefill")) imagefill($imgThumb, 0, 0, $trans_colour); |
|
272 | + if (function_exists("imagefill")) { |
|
273 | + imagefill($imgThumb, 0, 0, $trans_colour); |
|
274 | + } |
|
258 | 275 | |
259 | 276 | dol_syslog("dol_imageResizeOrCrop: convert image from ($imgWidth x $imgHeight) at position ($src_x x $src_y) to ($newWidth x $newHeight) as $extImg, newquality=$newquality"); |
260 | 277 | //imagecopyresized($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight); // Insere l'image de base redimensionnee |
@@ -284,7 +301,9 @@ discard block |
||
284 | 301 | } |
285 | 302 | |
286 | 303 | // Set permissions on file |
287 | - if (! empty($conf->global->MAIN_UMASK)) @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); |
|
304 | + if (! empty($conf->global->MAIN_UMASK)) { |
|
305 | + @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); |
|
306 | + } |
|
288 | 307 | |
289 | 308 | // Free memory. This does not delete image. |
290 | 309 | imagedestroy($img); |
@@ -365,24 +384,20 @@ discard block |
||
365 | 384 | { |
366 | 385 | // Si le fichier n'a pas ete indique |
367 | 386 | return 'ErrorBadParameters'; |
368 | - } |
|
369 | - elseif (! file_exists($file)) |
|
387 | + } elseif (! file_exists($file)) |
|
370 | 388 | { |
371 | 389 | // Si le fichier passe en parametre n'existe pas |
372 | 390 | dol_syslog($langs->trans("ErrorFileNotFound",$file),LOG_ERR); |
373 | 391 | return $langs->trans("ErrorFileNotFound",$file); |
374 | - } |
|
375 | - elseif(image_format_supported($file) < 0) |
|
392 | + } elseif(image_format_supported($file) < 0) |
|
376 | 393 | { |
377 | 394 | dol_syslog('This file '.$file.' does not seem to be an image format file name.',LOG_WARNING); |
378 | 395 | return 'ErrorBadImageFormat'; |
379 | - } |
|
380 | - elseif(!is_numeric($maxWidth) || empty($maxWidth) || $maxWidth < -1){ |
|
396 | + } elseif(!is_numeric($maxWidth) || empty($maxWidth) || $maxWidth < -1){ |
|
381 | 397 | // Si la largeur max est incorrecte (n'est pas numerique, est vide, ou est inferieure a 0) |
382 | 398 | dol_syslog('Wrong value for parameter maxWidth',LOG_ERR); |
383 | 399 | return 'Error: Wrong value for parameter maxWidth'; |
384 | - } |
|
385 | - elseif(!is_numeric($maxHeight) || empty($maxHeight) || $maxHeight < -1){ |
|
400 | + } elseif(!is_numeric($maxHeight) || empty($maxHeight) || $maxHeight < -1){ |
|
386 | 401 | // Si la hauteur max est incorrecte (n'est pas numerique, est vide, ou est inferieure a 0) |
387 | 402 | dol_syslog('Wrong value for parameter maxHeight',LOG_ERR); |
388 | 403 | return 'Error: Wrong value for parameter maxHeight'; |
@@ -394,8 +409,14 @@ discard block |
||
394 | 409 | $imgWidth = $infoImg[0]; // Largeur de l'image |
395 | 410 | $imgHeight = $infoImg[1]; // Hauteur de l'image |
396 | 411 | |
397 | - if ($maxWidth == -1) $maxWidth=$infoImg[0]; // If size is -1, we keep unchanged |
|
398 | - if ($maxHeight == -1) $maxHeight=$infoImg[1]; // If size is -1, we keep unchanged |
|
412 | + if ($maxWidth == -1) { |
|
413 | + $maxWidth=$infoImg[0]; |
|
414 | + } |
|
415 | + // If size is -1, we keep unchanged |
|
416 | + if ($maxHeight == -1) { |
|
417 | + $maxHeight=$infoImg[1]; |
|
418 | + } |
|
419 | + // If size is -1, we keep unchanged |
|
399 | 420 | |
400 | 421 | // Si l'image est plus petite que la largeur et la hauteur max, on ne cree pas de vignette |
401 | 422 | if ($infoImg[0] < $maxWidth && $infoImg[1] < $maxHeight) |
@@ -481,8 +502,7 @@ discard block |
||
481 | 502 | // Si largeur determinante |
482 | 503 | $thumbWidth = $maxWidth; |
483 | 504 | $thumbHeight = $thumbWidth / $imgWhFact; |
484 | - } |
|
485 | - else |
|
505 | + } else |
|
486 | 506 | { |
487 | 507 | // Si hauteur determinante |
488 | 508 | $thumbHeight = $maxHeight; |
@@ -492,15 +512,16 @@ discard block |
||
492 | 512 | $thumbWidth=round($thumbWidth); |
493 | 513 | |
494 | 514 | // Define target format |
495 | - if (empty($targetformat)) $targetformat=$infoImg[2]; |
|
515 | + if (empty($targetformat)) { |
|
516 | + $targetformat=$infoImg[2]; |
|
517 | + } |
|
496 | 518 | |
497 | 519 | // Create empty image |
498 | 520 | if ($targetformat == IMAGETYPE_GIF) |
499 | 521 | { |
500 | 522 | // Compatibilite image GIF |
501 | 523 | $imgThumb = imagecreate($thumbWidth, $thumbHeight); |
502 | - } |
|
503 | - else |
|
524 | + } else |
|
504 | 525 | { |
505 | 526 | $imgThumb = imagecreatetruecolor($thumbWidth, $thumbHeight); |
506 | 527 | } |
@@ -550,7 +571,9 @@ discard block |
||
550 | 571 | $newquality='NU'; |
551 | 572 | break; |
552 | 573 | } |
553 | - if (function_exists("imagefill")) imagefill($imgThumb, 0, 0, $trans_colour); |
|
574 | + if (function_exists("imagefill")) { |
|
575 | + imagefill($imgThumb, 0, 0, $trans_colour); |
|
576 | + } |
|
554 | 577 | |
555 | 578 | dol_syslog("vignette: convert image from ($imgWidth x $imgHeight) to ($thumbWidth x $thumbHeight) as $extImg, newquality=$newquality"); |
556 | 579 | //imagecopyresized($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight); // Insere l'image de base redimensionnee |
@@ -587,7 +610,9 @@ discard block |
||
587 | 610 | } |
588 | 611 | |
589 | 612 | // Set permissions on file |
590 | - if (! empty($conf->global->MAIN_UMASK)) @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); |
|
613 | + if (! empty($conf->global->MAIN_UMASK)) { |
|
614 | + @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); |
|
615 | + } |
|
591 | 616 | |
592 | 617 | // Free memory. This does not delete image. |
593 | 618 | imagedestroy($img); |
@@ -51,10 +51,12 @@ discard block |
||
51 | 51 | { |
52 | 52 | // delivery link |
53 | 53 | $object->fetchObjectLinked($object->id,$object->element); |
54 | - if (count($object->linkedObjectsIds['delivery']) > 0) // If there is a delivery |
|
54 | + if (count($object->linkedObjectsIds['delivery']) > 0) { |
|
55 | + // If there is a delivery |
|
55 | 56 | { |
56 | 57 | // Take first one element of array |
57 | 58 | $tmp = reset($object->linkedObjectsIds['delivery']); |
59 | + } |
|
58 | 60 | |
59 | 61 | $head[$h][0] = DOL_URL_ROOT."/livraison/card.php?id=".$tmp; |
60 | 62 | $head[$h][1] = $langs->trans("DeliveryCard"); |
@@ -74,7 +76,9 @@ discard block |
||
74 | 76 | $nbContact = count($objectsrc->liste_contact(-1,'internal')) + count($objectsrc->liste_contact(-1,'external')); |
75 | 77 | $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id; |
76 | 78 | $head[$h][1] = $langs->trans("ContactsAddresses"); |
77 | - if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
79 | + if ($nbContact > 0) { |
|
80 | + $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
81 | + } |
|
78 | 82 | $head[$h][2] = 'contact'; |
79 | 83 | $h++; |
80 | 84 | } |
@@ -86,16 +90,24 @@ discard block |
||
86 | 90 | $nbLinks=Link::count($db, $object->element, $object->id); |
87 | 91 | $head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$object->id; |
88 | 92 | $head[$h][1] = $langs->trans('Documents'); |
89 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
93 | + if (($nbFiles+$nbLinks) > 0) { |
|
94 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
95 | + } |
|
90 | 96 | $head[$h][2] = 'documents'; |
91 | 97 | $h++; |
92 | 98 | |
93 | 99 | $nbNote = 0; |
94 | - if (!empty($object->note_private)) $nbNote++; |
|
95 | - if (!empty($object->note_public)) $nbNote++; |
|
100 | + if (!empty($object->note_private)) { |
|
101 | + $nbNote++; |
|
102 | + } |
|
103 | + if (!empty($object->note_public)) { |
|
104 | + $nbNote++; |
|
105 | + } |
|
96 | 106 | $head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id; |
97 | 107 | $head[$h][1] = $langs->trans("Notes"); |
98 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
108 | + if ($nbNote > 0) { |
|
109 | + $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
110 | + } |
|
99 | 111 | $head[$h][2] = 'note'; |
100 | 112 | $h++; |
101 | 113 | |
@@ -199,7 +211,9 @@ discard block |
||
199 | 211 | $sql.= " AND obj.fk_".$origin." = ".$origin_id; |
200 | 212 | $sql.= " AND obj.rowid = ed.fk_origin_line"; |
201 | 213 | $sql.= " AND ed.fk_expedition = e.rowid"; |
202 | - if ($filter) $sql.= $filter; |
|
214 | + if ($filter) { |
|
215 | + $sql.= $filter; |
|
216 | + } |
|
203 | 217 | |
204 | 218 | $sql.= " ORDER BY obj.fk_product"; |
205 | 219 | |
@@ -212,8 +226,11 @@ discard block |
||
212 | 226 | |
213 | 227 | if ($num) |
214 | 228 | { |
215 | - if ($filter) print load_fiche_titre($langs->trans("OtherSendingsForSameOrder")); |
|
216 | - else print load_fiche_titre($langs->trans("SendingsAndReceivingForSameOrder")); |
|
229 | + if ($filter) { |
|
230 | + print load_fiche_titre($langs->trans("OtherSendingsForSameOrder")); |
|
231 | + } else { |
|
232 | + print load_fiche_titre($langs->trans("SendingsAndReceivingForSameOrder")); |
|
233 | + } |
|
217 | 234 | |
218 | 235 | print '<table class="liste" width="100%">'; |
219 | 236 | print '<tr class="liste_titre">'; |
@@ -268,8 +285,12 @@ discard block |
||
268 | 285 | |
269 | 286 | $outputlangs = $langs; |
270 | 287 | $newlang=''; |
271 | - if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; |
|
272 | - if (empty($newlang)) $newlang=$object->thirdparty->default_lang; |
|
288 | + if (empty($newlang) && ! empty($_REQUEST['lang_id'])) { |
|
289 | + $newlang=$_REQUEST['lang_id']; |
|
290 | + } |
|
291 | + if (empty($newlang)) { |
|
292 | + $newlang=$object->thirdparty->default_lang; |
|
293 | + } |
|
273 | 294 | if (! empty($newlang)) |
274 | 295 | { |
275 | 296 | $outputlangs = new Translate("",$conf); |
@@ -277,8 +298,7 @@ discard block |
||
277 | 298 | } |
278 | 299 | |
279 | 300 | $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; |
280 | - } |
|
281 | - else |
|
301 | + } else |
|
282 | 302 | { |
283 | 303 | $label = (! empty($objp->label)?$objp->label:$objp->product_label); |
284 | 304 | } |
@@ -305,12 +325,14 @@ discard block |
||
305 | 325 | } |
306 | 326 | |
307 | 327 | print '</td>'; |
308 | - } |
|
309 | - else |
|
328 | + } else |
|
310 | 329 | { |
311 | 330 | print "<td>"; |
312 | - if ($objp->fk_product_type==1) $text = img_object($langs->trans('Service'),'service'); |
|
313 | - else $text = img_object($langs->trans('Product'),'product'); |
|
331 | + if ($objp->fk_product_type==1) { |
|
332 | + $text = img_object($langs->trans('Service'),'service'); |
|
333 | + } else { |
|
334 | + $text = img_object($langs->trans('Product'),'product'); |
|
335 | + } |
|
314 | 336 | |
315 | 337 | if (! empty($objp->label)) { |
316 | 338 | $text.= ' <strong>'.$objp->label.'</strong>'; |
@@ -388,7 +410,10 @@ discard block |
||
388 | 410 | //var_dump($expedition->linkedObjects); |
389 | 411 | |
390 | 412 | $receiving=''; |
391 | - if (count($expedition->linkedObjects['delivery']) > 0) $receiving=reset($expedition->linkedObjects['delivery']); // Take first link |
|
413 | + if (count($expedition->linkedObjects['delivery']) > 0) { |
|
414 | + $receiving=reset($expedition->linkedObjects['delivery']); |
|
415 | + } |
|
416 | + // Take first link |
|
392 | 417 | |
393 | 418 | if (! empty($receiving)) |
394 | 419 | { |
@@ -412,8 +437,7 @@ discard block |
||
412 | 437 | print '<td align="right">'; |
413 | 438 | print dol_print_date($receiving->date_delivery,'day'); |
414 | 439 | print '</td>'; |
415 | - } |
|
416 | - else |
|
440 | + } else |
|
417 | 441 | { |
418 | 442 | //print '<td> </td>'; |
419 | 443 | print '<td> </td>'; |
@@ -427,8 +451,7 @@ discard block |
||
427 | 451 | print '</table>'; |
428 | 452 | } |
429 | 453 | $db->free($resql); |
430 | - } |
|
431 | - else |
|
454 | + } else |
|
432 | 455 | { |
433 | 456 | dol_print_error($db); |
434 | 457 | } |
@@ -60,17 +60,25 @@ |
||
60 | 60 | $nbContact = count($objectsrc->liste_contact(-1,'internal')) + count($objectsrc->liste_contact(-1,'external')); |
61 | 61 | $head[$h][0] = DOL_URL_ROOT."/reception/contact.php?id=".$object->id; |
62 | 62 | $head[$h][1] = $langs->trans("ContactsAddresses"); |
63 | - if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
63 | + if ($nbContact > 0) { |
|
64 | + $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
65 | + } |
|
64 | 66 | $head[$h][2] = 'contact'; |
65 | 67 | $h++; |
66 | 68 | } |
67 | 69 | |
68 | 70 | $nbNote = 0; |
69 | - if (!empty($object->note_private)) $nbNote++; |
|
70 | - if (!empty($object->note_public)) $nbNote++; |
|
71 | + if (!empty($object->note_private)) { |
|
72 | + $nbNote++; |
|
73 | + } |
|
74 | + if (!empty($object->note_public)) { |
|
75 | + $nbNote++; |
|
76 | + } |
|
71 | 77 | $head[$h][0] = DOL_URL_ROOT."/reception/note.php?id=".$object->id; |
72 | 78 | $head[$h][1] = $langs->trans("Notes"); |
73 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
79 | + if ($nbNote > 0) { |
|
80 | + $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
81 | + } |
|
74 | 82 | $head[$h][2] = 'note'; |
75 | 83 | $h++; |
76 | 84 |
@@ -52,18 +52,26 @@ |
||
52 | 52 | $nbLinks=Link::count($db, $object->element, $object->id); |
53 | 53 | $head[$h][0] = DOL_URL_ROOT.'/expensereport/document.php?id='.$object->id; |
54 | 54 | $head[$h][1] = $langs->trans('Documents'); |
55 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
55 | + if (($nbFiles+$nbLinks) > 0) { |
|
56 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
57 | + } |
|
56 | 58 | $head[$h][2] = 'documents'; |
57 | 59 | $h++; |
58 | 60 | |
59 | 61 | if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) |
60 | 62 | { |
61 | 63 | $nbNote = 0; |
62 | - if(!empty($object->note_private)) $nbNote++; |
|
63 | - if(!empty($object->note_public)) $nbNote++; |
|
64 | + if(!empty($object->note_private)) { |
|
65 | + $nbNote++; |
|
66 | + } |
|
67 | + if(!empty($object->note_public)) { |
|
68 | + $nbNote++; |
|
69 | + } |
|
64 | 70 | $head[$h][0] = DOL_URL_ROOT.'/expensereport/note.php?id='.$object->id; |
65 | 71 | $head[$h][1] = $langs->trans('Notes'); |
66 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
72 | + if ($nbNote > 0) { |
|
73 | + $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
74 | + } |
|
67 | 75 | $head[$h][2] = 'note'; |
68 | 76 | $h++; |
69 | 77 | } |