@@ -51,8 +51,9 @@ |
||
51 | 51 | print '</div>'; |
52 | 52 | } else { |
53 | 53 | $class = ''; |
54 | - if ($linked_resource['rowid'] == GETPOST('lineid')) |
|
55 | - $class = 'highlight'; |
|
54 | + if ($linked_resource['rowid'] == GETPOST('lineid')) { |
|
55 | + $class = 'highlight'; |
|
56 | + } |
|
56 | 57 | |
57 | 58 | print '<div class="tagtr oddeven'.($class ? ' '.$class : '').'">'; |
58 | 59 |
@@ -54,10 +54,12 @@ discard block |
||
54 | 54 | { |
55 | 55 | $listofselectedid[$toselectid] = $toselectid; |
56 | 56 | $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); |
57 | - if ($objecttmp->element == 'societe') |
|
58 | - $thirdpartyid = $objecttmp->id; |
|
59 | - if ($objecttmp->element == 'expensereport') |
|
60 | - $thirdpartyid = $objecttmp->fk_user_author; |
|
57 | + if ($objecttmp->element == 'societe') { |
|
58 | + $thirdpartyid = $objecttmp->id; |
|
59 | + } |
|
60 | + if ($objecttmp->element == 'expensereport') { |
|
61 | + $thirdpartyid = $objecttmp->fk_user_author; |
|
62 | + } |
|
61 | 63 | $listofselectedthirdparties[$thirdpartyid] = $thirdpartyid; |
62 | 64 | $listofselectedref[$thirdpartyid][$toselectid] = $objecttmp->ref; |
63 | 65 | } |
@@ -82,16 +84,20 @@ discard block |
||
82 | 84 | $formmail->fromid = $user->id; |
83 | 85 | } |
84 | 86 | $formmail->trackid = $trackid; |
85 | - if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
87 | + if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { |
|
88 | + // If bit 2 is set |
|
86 | 89 | { |
87 | 90 | include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
91 | + } |
|
88 | 92 | $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid); |
89 | 93 | } |
90 | 94 | $formmail->withfrom = 1; |
91 | 95 | $liste = $langs->trans("AllRecipientSelected", count($arrayofselected)); |
92 | - if (count($listofselectedthirdparties) == 1) // Only 1 different recipient selected, we can suggest contacts |
|
96 | + if (count($listofselectedthirdparties) == 1) { |
|
97 | + // Only 1 different recipient selected, we can suggest contacts |
|
93 | 98 | { |
94 | 99 | $liste = array(); |
100 | + } |
|
95 | 101 | $thirdpartyid = array_shift($listofselectedthirdparties); |
96 | 102 | if ($objecttmp->element == 'expensereport') |
97 | 103 | { |
@@ -41,8 +41,11 @@ discard block |
||
41 | 41 | if (GETPOST('action', 'aZ09') == 'edit'.$note_public) |
42 | 42 | { |
43 | 43 | $value_public = dol_concatdesc($value_public, ($value_public ? "\n" : "")."-- ".$stringtoadd); |
44 | - if (dol_textishtml($value_public)) $value_public .= "<br>\n"; |
|
45 | - else $value_public .= "\n"; |
|
44 | + if (dol_textishtml($value_public)) { |
|
45 | + $value_public .= "<br>\n"; |
|
46 | + } else { |
|
47 | + $value_public .= "\n"; |
|
48 | + } |
|
46 | 49 | } |
47 | 50 | } |
48 | 51 | if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) |
@@ -51,8 +54,11 @@ discard block |
||
51 | 54 | if (GETPOST('action', 'aZ09') == 'edit'.$note_private) |
52 | 55 | { |
53 | 56 | $value_private = dol_concatdesc($value_private, ($value_private ? "\n" : "")."-- ".$stringtoadd); |
54 | - if (dol_textishtml($value_private)) $value_private .= "<br>\n"; |
|
55 | - else $value_private .= "\n"; |
|
57 | + if (dol_textishtml($value_private)) { |
|
58 | + $value_private .= "<br>\n"; |
|
59 | + } else { |
|
60 | + $value_private .= "\n"; |
|
61 | + } |
|
56 | 62 | } |
57 | 63 | } |
58 | 64 | |
@@ -82,8 +88,13 @@ discard block |
||
82 | 88 | } |
83 | 89 | //else dol_print_error('','Bad value '.$module.' for param module'); |
84 | 90 | |
85 | -if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. |
|
86 | -else $typeofdata = 'textarea:12:95%'; |
|
91 | +if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { |
|
92 | + $typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; |
|
93 | +} |
|
94 | +// Rem: This var is for all notes, not only thirdparties note. |
|
95 | +else { |
|
96 | + $typeofdata = 'textarea:12:95%'; |
|
97 | +} |
|
87 | 98 | |
88 | 99 | print '<!-- BEGIN PHP TEMPLATE NOTES -->'."\n"; |
89 | 100 | print '<div class="tagtable border table-border tableforfield centpercent">'."\n"; |
@@ -102,7 +102,9 @@ discard block |
||
102 | 102 | print $langs->trans("All"); |
103 | 103 | } else { |
104 | 104 | global $multicompanylabel_cache; |
105 | - if (!is_array($multicompanylabel_cache)) $multicompanylabel_cache = array(); |
|
105 | + if (!is_array($multicompanylabel_cache)) { |
|
106 | + $multicompanylabel_cache = array(); |
|
107 | + } |
|
106 | 108 | if (empty($multicompanylabel_cache[$extrafields->attributes[$elementtype]['entityid'][$key]])) { |
107 | 109 | global $mc; |
108 | 110 | $mc->getInfo($extrafields->attributes[$elementtype]['entityid'][$key]); |
@@ -118,7 +120,9 @@ discard block |
||
118 | 120 | } |
119 | 121 | } else { |
120 | 122 | $colspan = 13; |
121 | - if (!empty($conf->multicompany->enabled)) $colspan++; |
|
123 | + if (!empty($conf->multicompany->enabled)) { |
|
124 | + $colspan++; |
|
125 | + } |
|
122 | 126 | |
123 | 127 | print '<tr class="oddeven">'; |
124 | 128 | print '<td class="opacitymedium" colspan="'.$colspan.'">'; |
@@ -286,7 +286,9 @@ |
||
286 | 286 | |
287 | 287 | $res = vignette($file_path, $maxwidthmini, $maxheightmini, '_mini'); // We don't use ->addThumbs here because there is no object and we don't need all thumbs, only the "mini". |
288 | 288 | |
289 | - if (preg_match('/error/i', $res)) return false; |
|
289 | + if (preg_match('/error/i', $res)) { |
|
290 | + return false; |
|
291 | + } |
|
290 | 292 | return true; |
291 | 293 | } else { |
292 | 294 | return false; |
@@ -26,20 +26,39 @@ discard block |
||
26 | 26 | * \brief File to manage popup date selector |
27 | 27 | */ |
28 | 28 | |
29 | -if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // disabled |
|
29 | +if (!defined('NOREQUIREUSER')) { |
|
30 | + define('NOREQUIREUSER', '1'); |
|
31 | +} |
|
32 | +// disabled |
|
30 | 33 | //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language |
31 | -if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); |
|
34 | +if (!defined('NOREQUIRESOC')) { |
|
35 | + define('NOREQUIRESOC', '1'); |
|
36 | +} |
|
32 | 37 | //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations |
33 | -if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); |
|
34 | -if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); |
|
35 | -if (!defined('NOLOGIN')) define('NOLOGIN', 1); // disabled |
|
36 | -if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', 1); |
|
37 | -if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); |
|
38 | +if (!defined('NOCSRFCHECK')) { |
|
39 | + define('NOCSRFCHECK', 1); |
|
40 | +} |
|
41 | +if (!defined('NOTOKENRENEWAL')) { |
|
42 | + define('NOTOKENRENEWAL', 1); |
|
43 | +} |
|
44 | +if (!defined('NOLOGIN')) { |
|
45 | + define('NOLOGIN', 1); |
|
46 | +} |
|
47 | +// disabled |
|
48 | +if (!defined('NOREQUIREMENU')) { |
|
49 | + define('NOREQUIREMENU', 1); |
|
50 | +} |
|
51 | +if (!defined('NOREQUIREHTML')) { |
|
52 | + define('NOREQUIREHTML', 1); |
|
53 | +} |
|
38 | 54 | |
39 | 55 | require_once '../main.inc.php'; |
40 | 56 | require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
41 | 57 | |
42 | -if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php |
|
58 | +if (GETPOST('lang', 'aZ09')) { |
|
59 | + $langs->setDefaultLang(GETPOST('lang', 'aZ09')); |
|
60 | +} |
|
61 | +// If language was forced on URL by the main.inc.php |
|
43 | 62 | |
44 | 63 | // Load translation files required by the page |
45 | 64 | $langs->loadLangs(array("main", "agenda")); |
@@ -93,14 +112,22 @@ discard block |
||
93 | 112 | |
94 | 113 | $qualified = true; |
95 | 114 | |
96 | -if (!isset($_GET["sd"])) $_GET["sd"] = "00000000"; |
|
115 | +if (!isset($_GET["sd"])) { |
|
116 | + $_GET["sd"] = "00000000"; |
|
117 | +} |
|
97 | 118 | |
98 | -if (!isset($_GET["m"]) || !isset($_GET["y"])) $qualified = false; |
|
119 | +if (!isset($_GET["m"]) || !isset($_GET["y"])) { |
|
120 | + $qualified = false; |
|
121 | +} |
|
99 | 122 | if (isset($_GET["m"]) && isset($_GET["y"])) |
100 | 123 | { |
101 | - if ($_GET["m"] < 1 || $_GET["m"] > 12) $qualified = false; |
|
102 | - if ($_GET["y"] < 0 || $_GET["y"] > 9999) $qualified = false; |
|
103 | -} |
|
124 | + if ($_GET["m"] < 1 || $_GET["m"] > 12) { |
|
125 | + $qualified = false; |
|
126 | + } |
|
127 | + if ($_GET["y"] < 0 || $_GET["y"] > 9999) { |
|
128 | + $qualified = false; |
|
129 | + } |
|
130 | + } |
|
104 | 131 | |
105 | 132 | // If parameters provided, we show calendar |
106 | 133 | if ($qualified) |
@@ -171,11 +198,25 @@ discard block |
||
171 | 198 | <td class="dpButtons" |
172 | 199 | onClick="loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php echo $month?>','<?php echo $year - 1?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')"><<</td> |
173 | 200 | <td class="dpButtons" |
174 | - onClick="loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php if ($month == 1) echo "12"; else echo $month - 1?>','<?php if ($month == 1) echo $year - 1; else echo $year?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')"><</td> |
|
201 | + onClick="loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php if ($month == 1) { |
|
202 | + echo "12"; |
|
203 | +} else { |
|
204 | + echo $month - 1?>','<?php if ($month == 1) echo $year - 1; |
|
205 | +} |
|
206 | +else { |
|
207 | + echo $year?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')"><</td> |
|
175 | 208 | <td colspan="3" class="dpButtons" |
176 | 209 | onClick="loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php echo (int) dol_print_date($today, '%m')?>','<?php echo $todayArray["year"]?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')"><?php echo '-' ?></td> |
177 | 210 | <td class="dpButtons" |
178 | - onClick="loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php if ($month == 12) echo "1"; else echo $month + 1?>','<?php if ($month == 12) echo $year + 1; else echo $year; ?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')">></td> |
|
211 | + onClick="loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php if ($month == 12) echo "1"; |
|
212 | +} |
|
213 | +else { |
|
214 | + echo $month + 1?>','<?php if ($month == 12) echo $year + 1; |
|
215 | +} |
|
216 | +else { |
|
217 | + echo $year; |
|
218 | +} |
|
219 | +?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')">></td> |
|
179 | 220 | <td class="dpButtons" |
180 | 221 | onClick="loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php echo $month?>','<?php echo $year + 1?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')">>></td> |
181 | 222 | </tr> |
@@ -198,9 +239,11 @@ discard block |
||
198 | 239 | while (!$stoploop) |
199 | 240 | { |
200 | 241 | //print_r($mydate); |
201 | - if ($mydate < $firstdate) // At first run |
|
242 | + if ($mydate < $firstdate) { |
|
243 | + // At first run |
|
202 | 244 | { |
203 | 245 | echo "<tr class=\"dpWeek\">"; |
246 | + } |
|
204 | 247 | //echo $conf->global->MAIN_START_WEEK.' '.$firstdate["wday"].' '.$startday; |
205 | 248 | $cols = 0; |
206 | 249 | for ($i = 0; $i < 7; $i++) |
@@ -223,8 +266,11 @@ discard block |
||
223 | 266 | } |
224 | 267 | |
225 | 268 | $dayclass = "dpReg"; |
226 | - if ($thedate == $selDate) $dayclass = "dpSelected"; |
|
227 | - elseif ($thedate == $today) $dayclass = "dpToday"; |
|
269 | + if ($thedate == $selDate) { |
|
270 | + $dayclass = "dpSelected"; |
|
271 | + } elseif ($thedate == $today) { |
|
272 | + $dayclass = "dpToday"; |
|
273 | + } |
|
228 | 274 | |
229 | 275 | if ($langs->trans("FormatDateShortJavaInput") == "FormatDateShortJavaInput") |
230 | 276 | { |
@@ -239,7 +285,9 @@ discard block |
||
239 | 285 | echo ">".sprintf("%02s", $mydate["mday"])."</td>"; |
240 | 286 | $cols++; |
241 | 287 | |
242 | - if (($mydate["wday"] + 1) % 7 == $startday) echo "</TR>\n"; |
|
288 | + if (($mydate["wday"] + 1) % 7 == $startday) { |
|
289 | + echo "</TR>\n"; |
|
290 | + } |
|
243 | 291 | |
244 | 292 | //$thedate=strtotime("tomorrow",$thedate); |
245 | 293 | $day++; |
@@ -249,13 +297,17 @@ discard block |
||
249 | 297 | $stoploop = 1; |
250 | 298 | } else { |
251 | 299 | $mydate = dol_getdate($thedate); |
252 | - if ($firstdate["month"] != $mydate["month"]) $stoploop = 1; |
|
300 | + if ($firstdate["month"] != $mydate["month"]) { |
|
301 | + $stoploop = 1; |
|
302 | + } |
|
253 | 303 | } |
254 | 304 | } |
255 | 305 | |
256 | 306 | if ($cols < 7) |
257 | 307 | { |
258 | - for ($i = 6; $i >= $cols; $i--) echo "<td> </td>"; |
|
308 | + for ($i = 6; $i >= $cols; $i--) { |
|
309 | + echo "<td> </td>"; |
|
310 | + } |
|
259 | 311 | echo "</tr>\n"; |
260 | 312 | } |
261 | 313 | ?> |
@@ -109,7 +109,10 @@ discard block |
||
109 | 109 | { |
110 | 110 | $ok = 0; |
111 | 111 | |
112 | - if (empty($conf->ticket->enabled)) return 0; // Module not active, we do nothing |
|
112 | + if (empty($conf->ticket->enabled)) { |
|
113 | + return 0; |
|
114 | + } |
|
115 | + // Module not active, we do nothing |
|
113 | 116 | |
114 | 117 | switch ($action) { |
115 | 118 | case 'TICKET_ASSIGNED': |
@@ -284,10 +287,16 @@ discard block |
||
284 | 287 | } |
285 | 288 | |
286 | 289 | $qualified = true; |
287 | - if (empty($enabled)) $qualified = false; |
|
288 | - if (empty($perms)) $qualified = false; |
|
290 | + if (empty($enabled)) { |
|
291 | + $qualified = false; |
|
292 | + } |
|
293 | + if (empty($perms)) { |
|
294 | + $qualified = false; |
|
295 | + } |
|
289 | 296 | |
290 | - if ($qualified) $message_customer .= '<li>'.$langs->trans($key).' : '.$value.'</li>'; |
|
297 | + if ($qualified) { |
|
298 | + $message_customer .= '<li>'.$langs->trans($key).' : '.$value.'</li>'; |
|
299 | + } |
|
291 | 300 | } |
292 | 301 | |
293 | 302 | $message_customer .= '</ul>'; |
@@ -54,8 +54,12 @@ discard block |
||
54 | 54 | $offset = $limit * $page; |
55 | 55 | $pageprev = $page - 1; |
56 | 56 | $pagenext = $page + 1; |
57 | -if (!$sortorder) $sortorder = "ASC"; |
|
58 | -if (!$sortfield) $sortfield = "name"; |
|
57 | +if (!$sortorder) { |
|
58 | + $sortorder = "ASC"; |
|
59 | +} |
|
60 | +if (!$sortfield) { |
|
61 | + $sortfield = "name"; |
|
62 | +} |
|
59 | 63 | //if (! $sortfield) $sortfield="position_name"; |
60 | 64 | |
61 | 65 | // Initialize technical objects |
@@ -71,7 +75,9 @@ discard block |
||
71 | 75 | include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
72 | 76 | |
73 | 77 | //if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/myobject/" . dol_sanitizeFileName($object->id); |
74 | -if ($id > 0 || !empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity]."/myobject/".dol_sanitizeFileName($object->ref); |
|
78 | +if ($id > 0 || !empty($ref)) { |
|
79 | + $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity]."/myobject/".dol_sanitizeFileName($object->ref); |
|
80 | +} |
|
75 | 81 | |
76 | 82 | |
77 | 83 | /* |
@@ -43,11 +43,17 @@ discard block |
||
43 | 43 | |
44 | 44 | if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { |
45 | 45 | $nbNote = 0; |
46 | - if (!empty($object->note_private)) $nbNote++; |
|
47 | - if (!empty($object->note_public)) $nbNote++; |
|
46 | + if (!empty($object->note_private)) { |
|
47 | + $nbNote++; |
|
48 | + } |
|
49 | + if (!empty($object->note_public)) { |
|
50 | + $nbNote++; |
|
51 | + } |
|
48 | 52 | $head[$h][0] = dol_buildpath('/mymodule/myobject_note.php', 1).'?id='.$object->id; |
49 | 53 | $head[$h][1] = $langs->trans('Notes'); |
50 | - if ($nbNote > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>'; |
|
54 | + if ($nbNote > 0) { |
|
55 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>'; |
|
56 | + } |
|
51 | 57 | $head[$h][2] = 'note'; |
52 | 58 | $h++; |
53 | 59 | } |
@@ -59,7 +65,9 @@ discard block |
||
59 | 65 | $nbLinks = Link::count($db, $object->element, $object->id); |
60 | 66 | $head[$h][0] = dol_buildpath("/mymodule/myobject_document.php", 1).'?id='.$object->id; |
61 | 67 | $head[$h][1] = $langs->trans('Documents'); |
62 | - if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>'; |
|
68 | + if (($nbFiles + $nbLinks) > 0) { |
|
69 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>'; |
|
70 | + } |
|
63 | 71 | $head[$h][2] = 'document'; |
64 | 72 | $h++; |
65 | 73 |