@@ -241,12 +241,12 @@ |
||
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
244 | - * Delete a language for this member type |
|
245 | - * |
|
246 | - * @param string $langtodelete Language code to delete |
|
247 | - * @param User $user Object user making delete |
|
248 | - * @return int <0 if KO, >0 if OK |
|
249 | - */ |
|
244 | + * Delete a language for this member type |
|
245 | + * |
|
246 | + * @param string $langtodelete Language code to delete |
|
247 | + * @param User $user Object user making delete |
|
248 | + * @return int <0 if KO, >0 if OK |
|
249 | + */ |
|
250 | 250 | public function delMultiLangs($langtodelete, $user) |
251 | 251 | { |
252 | 252 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang"; |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | $this->amount = $obj->amount; |
518 | 518 | $this->caneditamount = $obj->caneditamount; |
519 | 519 | $this->mail_valid = $obj->mail_valid; |
520 | - $this->note = $obj->note_public; // deprecated |
|
520 | + $this->note = $obj->note_public; // deprecated |
|
521 | 521 | $this->note_public = $obj->note_public; |
522 | 522 | $this->vote = $obj->vote; |
523 | 523 | |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | } elseif ($this->duration_value > 0) { |
717 | 717 | $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); |
718 | 718 | } |
719 | - $datas['duration'] .= " " . (!empty($this->duration_unit) && isset($dur[$this->duration_unit]) ? $langs->trans($dur[$this->duration_unit]) : ''); |
|
719 | + $datas['duration'] .= " ".(!empty($this->duration_unit) && isset($dur[$this->duration_unit]) ? $langs->trans($dur[$this->duration_unit]) : ''); |
|
720 | 720 | } |
721 | 721 | |
722 | 722 | return $datas; |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | } |
768 | 768 | } |
769 | 769 | $linkstart = '<a href="'.$url.'"'; |
770 | - $linkstart .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
770 | + $linkstart .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
771 | 771 | $linkstart .= $dataparams.' class="'.$classfortooltip.'">'; |
772 | 772 | |
773 | 773 | $linkend = '</a>'; |
@@ -263,7 +263,7 @@ |
||
263 | 263 | echo '<div>'; |
264 | 264 | echo '<table class="noborder centpercent">'; |
265 | 265 | echo '<thead>'; |
266 | -echo '<tr class="liste_titre"><th>' . $langs->trans('Parameter') . '</th><th>' . $langs->trans('Value') . '</th></tr>'; |
|
266 | +echo '<tr class="liste_titre"><th>'.$langs->trans('Parameter').'</th><th>'.$langs->trans('Value').'</th></tr>'; |
|
267 | 267 | echo '</thead>'; |
268 | 268 | echo '<tbody>'; |
269 | 269 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * \brief Module to show box of members |
25 | 25 | */ |
26 | 26 | |
27 | -include_once DOL_DOCUMENT_ROOT . '/core/boxes/modules_boxes.php'; |
|
27 | +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; |
|
28 | 28 | |
29 | 29 | |
30 | 30 | /** |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | |
84 | 84 | $this->max = $max; |
85 | 85 | |
86 | - include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
87 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php'; |
|
86 | + include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
87 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; |
|
88 | 88 | $memberstatic = new Adherent($this->db); |
89 | 89 | $statictype = new AdherentType($this->db); |
90 | 90 | |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | $numb = 0; |
101 | 101 | |
102 | 102 | $sql = "SELECT c.subscription, c.dateadh as dateh"; |
103 | - $sql .= " FROM " . MAIN_DB_PREFIX . "adherent as d, " . MAIN_DB_PREFIX . "subscription as c"; |
|
104 | - $sql .= " WHERE d.entity IN (" . getEntity('adherent') . ")"; |
|
103 | + $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c"; |
|
104 | + $sql .= " WHERE d.entity IN (".getEntity('adherent').")"; |
|
105 | 105 | $sql .= " AND d.rowid = c.fk_adherent"; |
106 | 106 | |
107 | 107 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $this->info_box_contents[0][0] = array( |
217 | 217 | 'td' => '', |
218 | 218 | 'maxlength' => 500, |
219 | - 'text' => ($this->db->error() . ' sql=' . $sql), |
|
219 | + 'text' => ($this->db->error().' sql='.$sql), |
|
220 | 220 | ); |
221 | 221 | } |
222 | 222 | } else { |
@@ -100,7 +100,7 @@ |
||
100 | 100 | while ($line < $num) { |
101 | 101 | $objp = $this->db->fetch_object($result); |
102 | 102 | $date = $this->db->jdate($objp->date_movement); |
103 | - $journal = $objp->code_journal; |
|
103 | + $journal = $objp->code_journal; |
|
104 | 104 | $label = $objp->label_operation; |
105 | 105 | $amount = $objp->amount; |
106 | 106 |
@@ -110,7 +110,9 @@ |
||
110 | 110 | accessforbidden(); |
111 | 111 | } |
112 | 112 | //$result = restrictedArea($user, 'productbatch'); |
113 | -if (!$permissiontoread) accessforbidden(); |
|
113 | +if (!$permissiontoread) { |
|
114 | + accessforbidden(); |
|
115 | +} |
|
114 | 116 | |
115 | 117 | |
116 | 118 | /* |
@@ -507,7 +507,7 @@ |
||
507 | 507 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
508 | 508 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
509 | 509 | } |
510 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
510 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
511 | 511 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
512 | 512 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; |
513 | 513 | $totalarray['nbfield']++; |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $object->town = GETPOST('town', 'alpha'); |
85 | 85 | $object->country_id = GETPOST("country_id", 'int'); |
86 | 86 | $object->status = GETPOST('status', 'int'); |
87 | - $object->fk_user_author = $user->id; |
|
87 | + $object->fk_user_author = $user->id; |
|
88 | 88 | $object->datec = dol_now(); |
89 | 89 | $object->entity = GETPOST('entity', 'int') > 0 ?GETPOST('entity', 'int') : $conf->entity; |
90 | 90 |
@@ -46,8 +46,12 @@ |
||
46 | 46 | //if ($user->socid > 0) $socid = $user->socid; |
47 | 47 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
48 | 48 | //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); |
49 | -if (!isModEnabled('hrm')) accessforbidden(); |
|
50 | -if (empty($permissiontoread)) accessforbidden(); |
|
49 | +if (!isModEnabled('hrm')) { |
|
50 | + accessforbidden(); |
|
51 | +} |
|
52 | +if (empty($permissiontoread)) { |
|
53 | + accessforbidden(); |
|
54 | +} |
|
51 | 55 | |
52 | 56 | |
53 | 57 | /* |
@@ -92,7 +92,7 @@ |
||
92 | 92 | /** |
93 | 93 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
94 | 94 | */ |
95 | - public $fields=array( |
|
95 | + public $fields = array( |
|
96 | 96 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>0,), |
97 | 97 | 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>'1', 'position'=>15, 'notnull'=>1, 'visible'=>-2, 'default'=>'1', 'index'=>1,), |
98 | 98 | 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>20, 'notnull'=>0, 'visible'=>-1,), |
@@ -177,8 +177,12 @@ discard block |
||
177 | 177 | |
178 | 178 | $this->db = $db; |
179 | 179 | |
180 | - if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; |
|
181 | - if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; |
|
180 | + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { |
|
181 | + $this->fields['rowid']['visible'] = 0; |
|
182 | + } |
|
183 | + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { |
|
184 | + $this->fields['entity']['enabled'] = 0; |
|
185 | + } |
|
182 | 186 | |
183 | 187 | // Unset fields that are disabled |
184 | 188 | foreach ($this->fields as $key => $val) { |
@@ -220,7 +224,9 @@ discard block |
||
220 | 224 | |
221 | 225 | // Load source object |
222 | 226 | $result = $object->fetchCommon($fromid); |
223 | - if ($result > 0 && !empty($object->table_element_line)) $object->fetchLines(); |
|
227 | + if ($result > 0 && !empty($object->table_element_line)) { |
|
228 | + $object->fetchLines(); |
|
229 | + } |
|
224 | 230 | |
225 | 231 | // get lines so they will be clone |
226 | 232 | //foreach($this->lines as $line) |
@@ -232,8 +238,12 @@ discard block |
||
232 | 238 | unset($object->import_key); |
233 | 239 | |
234 | 240 | // Clear fields |
235 | - if (property_exists($object, 'ref')) $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; |
|
236 | - if (property_exists($object, 'label')) $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; |
|
241 | + if (property_exists($object, 'ref')) { |
|
242 | + $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; |
|
243 | + } |
|
244 | + if (property_exists($object, 'label')) { |
|
245 | + $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; |
|
246 | + } |
|
237 | 247 | if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; } |
238 | 248 | if (property_exists($object, 'date_creation')) { $object->date_creation = dol_now(); } |
239 | 249 | if (property_exists($object, 'date_modification')) { $object->date_modification = null; } |
@@ -270,8 +280,9 @@ discard block |
||
270 | 280 | if (!$error) { |
271 | 281 | // copy external contacts if same company |
272 | 282 | if (property_exists($this, 'socid') && $this->socid == $object->socid) { |
273 | - if ($this->copy_linked_contact($object, 'external') < 0) |
|
274 | - $error++; |
|
283 | + if ($this->copy_linked_contact($object, 'external') < 0) { |
|
284 | + $error++; |
|
285 | + } |
|
275 | 286 | } |
276 | 287 | } |
277 | 288 | |
@@ -320,8 +331,11 @@ discard block |
||
320 | 331 | $sql = "SELECT "; |
321 | 332 | $sql .= $this->getFieldList(); |
322 | 333 | $sql .= " FROM ".$this->db->prefix().$this->table_element." as t"; |
323 | - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= " WHERE t.entity IN (".getEntity($this->element).")"; |
|
324 | - else $sql .= " WHERE 1 = 1"; |
|
334 | + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { |
|
335 | + $sql .= " WHERE t.entity IN (".getEntity($this->element).")"; |
|
336 | + } else { |
|
337 | + $sql .= " WHERE 1 = 1"; |
|
338 | + } |
|
325 | 339 | // Manage filter |
326 | 340 | $sqlwhere = array(); |
327 | 341 | if (count($filter) > 0) { |
@@ -437,8 +451,12 @@ discard block |
||
437 | 451 | $sql = "UPDATE ".$this->db->prefix().$this->table_element; |
438 | 452 | $sql .= " SET ref = '".$this->db->escape($num)."',"; |
439 | 453 | $sql .= " status = ".self::STATUS_VALIDATED; |
440 | - if (!empty($this->fields['date_validation'])) $sql .= ", date_validation = '".$this->db->idate($now)."'"; |
|
441 | - if (!empty($this->fields['fk_user_valid'])) $sql .= ", fk_user_valid = ".$user->id; |
|
454 | + if (!empty($this->fields['date_validation'])) { |
|
455 | + $sql .= ", date_validation = '".$this->db->idate($now)."'"; |
|
456 | + } |
|
457 | + if (!empty($this->fields['fk_user_valid'])) { |
|
458 | + $sql .= ", fk_user_valid = ".$user->id; |
|
459 | + } |
|
442 | 460 | $sql .= " WHERE rowid = ".((int) $this->id); |
443 | 461 | |
444 | 462 | dol_syslog(get_class($this)."::validate()", LOG_DEBUG); |
@@ -452,7 +470,9 @@ discard block |
||
452 | 470 | if (!$error && !$notrigger) { |
453 | 471 | // Call trigger |
454 | 472 | $result = $this->call_trigger('PRODUCTFOURNISSEURPRICE_VALIDATE', $user); |
455 | - if ($result < 0) $error++; |
|
473 | + if ($result < 0) { |
|
474 | + $error++; |
|
475 | + } |
|
456 | 476 | // End call triggers |
457 | 477 | } |
458 | 478 | } |
@@ -573,7 +593,10 @@ discard block |
||
573 | 593 | { |
574 | 594 | global $conf, $langs, $hookmanager; |
575 | 595 | |
576 | - if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips |
|
596 | + if (!empty($conf->dol_no_mouse_hover)) { |
|
597 | + $notooltip = 1; |
|
598 | + } |
|
599 | + // Force disable tooltips |
|
577 | 600 | |
578 | 601 | $result = ''; |
579 | 602 | |
@@ -589,8 +612,12 @@ discard block |
||
589 | 612 | if ($option != 'nolink') { |
590 | 613 | // Add param to save lastsearch_values or not |
591 | 614 | $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); |
592 | - if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1; |
|
593 | - if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1'; |
|
615 | + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { |
|
616 | + $add_save_lastsearch_values = 1; |
|
617 | + } |
|
618 | + if ($add_save_lastsearch_values) { |
|
619 | + $url .= '&save_lastsearch_values=1'; |
|
620 | + } |
|
594 | 621 | } |
595 | 622 | |
596 | 623 | $linkclose = ''; |
@@ -601,7 +628,9 @@ discard block |
||
601 | 628 | } |
602 | 629 | $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; |
603 | 630 | $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; |
604 | - } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
|
631 | + } else { |
|
632 | + $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
|
633 | + } |
|
605 | 634 | |
606 | 635 | $linkstart = '<a href="'.$url.'"'; |
607 | 636 | $linkstart .= $linkclose.'>'; |
@@ -610,7 +639,9 @@ discard block |
||
610 | 639 | $result .= $linkstart; |
611 | 640 | |
612 | 641 | if (empty($this->showphoto_on_popup)) { |
613 | - if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
642 | + if ($withpicto) { |
|
643 | + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
644 | + } |
|
614 | 645 | } else { |
615 | 646 | if ($withpicto) { |
616 | 647 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
@@ -636,7 +667,9 @@ discard block |
||
636 | 667 | } |
637 | 668 | } |
638 | 669 | |
639 | - if ($withpicto != 2) $result .= $this->ref; |
|
670 | + if ($withpicto != 2) { |
|
671 | + $result .= $this->ref; |
|
672 | + } |
|
640 | 673 | |
641 | 674 | $result .= $linkend; |
642 | 675 | //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); |
@@ -645,8 +678,11 @@ discard block |
||
645 | 678 | $hookmanager->initHooks(array('productfournisseurpricedao')); |
646 | 679 | $parameters = array('id'=>$this->id, 'getnomurl' => &$result); |
647 | 680 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
648 | - if ($reshook > 0) $result = $hookmanager->resPrint; |
|
649 | - else $result .= $hookmanager->resPrint; |
|
681 | + if ($reshook > 0) { |
|
682 | + $result = $hookmanager->resPrint; |
|
683 | + } else { |
|
684 | + $result .= $hookmanager->resPrint; |
|
685 | + } |
|
650 | 686 | |
651 | 687 | return $result; |
652 | 688 | } |
@@ -686,7 +722,9 @@ discard block |
||
686 | 722 | |
687 | 723 | $statusType = 'status'.$status; |
688 | 724 | //if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; |
689 | - if ($status == self::STATUS_CANCELED) $statusType = 'status6'; |
|
725 | + if ($status == self::STATUS_CANCELED) { |
|
726 | + $statusType = 'status6'; |
|
727 | + } |
|
690 | 728 | |
691 | 729 | return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); |
692 | 730 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * View |
44 | 44 | */ |
45 | 45 | |
46 | -$form = new Form($db); // $form is required as global value into dol_banner_tab |
|
46 | +$form = new Form($db); // $form is required as global value into dol_banner_tab |
|
47 | 47 | |
48 | 48 | llxHeader('', $langs->trans("CronInfo")); |
49 | 49 |
@@ -97,8 +97,8 @@ |
||
97 | 97 | $month_current = dol_print_date(dol_now(), '%m'); |
98 | 98 | $year_start = $year; |
99 | 99 | } |
100 | -$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
101 | -$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
100 | +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
101 | +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
102 | 102 | // Quarter |
103 | 103 | if (empty($date_start) || empty($date_end)) { // We define date_start and date_end |
104 | 104 | $q = GETPOST("q", "int"); |