@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
81 | 81 | require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
82 | 82 | require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
83 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
84 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
83 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
84 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
85 | 85 | |
86 | 86 | |
87 | 87 | // Load translation files required by the page |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
199 | 199 | |
200 | 200 | $morehtmlref = '<div class="refid">'; |
201 | - $morehtmlref.= $object->label; |
|
201 | + $morehtmlref .= $object->label; |
|
202 | 202 | $morehtmlref .= '</div>'; |
203 | 203 | |
204 | 204 |
@@ -58,8 +58,8 @@ |
||
58 | 58 | |
59 | 59 | require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
60 | 60 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
61 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; |
|
62 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; |
|
61 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
|
62 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; |
|
63 | 63 | |
64 | 64 | // Load translation files required by the page |
65 | 65 | $langs->loadLangs(array("hrm", "companies", "other", "mails")); |
@@ -272,11 +272,11 @@ |
||
272 | 272 | } |
273 | 273 | |
274 | 274 | if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { |
275 | - $sql = "SELECT " . $typethirdparty . " FROM " . MAIN_DB_PREFIX . "societe_perentity"; |
|
276 | - $sql .= " WHERE " . $typethirdparty . " = '" . $db->escape($code) . "'"; |
|
275 | + $sql = "SELECT ".$typethirdparty." FROM ".MAIN_DB_PREFIX."societe_perentity"; |
|
276 | + $sql .= " WHERE ".$typethirdparty." = '".$db->escape($code)."'"; |
|
277 | 277 | } else { |
278 | - $sql = "SELECT " . $typethirdparty . " FROM " . MAIN_DB_PREFIX . "societe"; |
|
279 | - $sql .= " WHERE " . $typethirdparty . " = '" . $db->escape($code) . "'"; |
|
278 | + $sql = "SELECT ".$typethirdparty." FROM ".MAIN_DB_PREFIX."societe"; |
|
279 | + $sql .= " WHERE ".$typethirdparty." = '".$db->escape($code)."'"; |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | $resql = $db->query($sql); |
@@ -91,8 +91,8 @@ |
||
91 | 91 | $label_default = getDolGlobalString('TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT'); |
92 | 92 | $qty_default = 1; |
93 | 93 | |
94 | - print '<input type="text" id="label" name="label" class="takepospay" value="' . $label_default . '" style="width:40%;" placeholder="' . $langs->trans('Label') . '">'; |
|
95 | - print '<input type="text" id="qty" name="qty" class="takepospay" value="' . $qty_default . '" style="width:10%;" placeholder="' . $langs->trans('Qty') . '">'; |
|
94 | + print '<input type="text" id="label" name="label" class="takepospay" value="'.$label_default.'" style="width:40%;" placeholder="'.$langs->trans('Label').'">'; |
|
95 | + print '<input type="text" id="qty" name="qty" class="takepospay" value="'.$qty_default.'" style="width:10%;" placeholder="'.$langs->trans('Qty').'">'; |
|
96 | 96 | } |
97 | 97 | ?> |
98 | 98 | <input type="button" class="button takepospay clearboth" value="OK" onclick="Save();"> |
@@ -173,13 +173,13 @@ |
||
173 | 173 | if ($action == 'without_details') { |
174 | 174 | $qty = GETPOST('qty', 'int') > 0 ? GETPOST('qty', 'int') : 1; |
175 | 175 | print '<tr>'; |
176 | - print '<td>' . GETPOST('label', 'alphanohtml') . '</td>'; |
|
177 | - print '<td class="right">' . $qty . '</td>'; |
|
178 | - print '<td class="right">' . price(price2num($object->total_ttc / $qty, 'MU'), 1) . '</td>'; |
|
176 | + print '<td>'.GETPOST('label', 'alphanohtml').'</td>'; |
|
177 | + print '<td class="right">'.$qty.'</td>'; |
|
178 | + print '<td class="right">'.price(price2num($object->total_ttc / $qty, 'MU'), 1).'</td>'; |
|
179 | 179 | if (!empty($conf->global->TAKEPOS_SHOW_HT_RECEIPT)) { |
180 | - print '<td class="right">' . price($object->total_ht, 1) . '</td>'; |
|
180 | + print '<td class="right">'.price($object->total_ht, 1).'</td>'; |
|
181 | 181 | } |
182 | - print '<td class="right">' . price($object->total_ttc, 1) . '</td>'; |
|
182 | + print '<td class="right">'.price($object->total_ttc, 1).'</td>'; |
|
183 | 183 | print '</tr>'; |
184 | 184 | } else { |
185 | 185 | foreach ($object->lines as $line) { |
@@ -273,7 +273,7 @@ |
||
273 | 273 | print '<tr class="oddeven"><td>'; |
274 | 274 | print $langs->trans('PrintWithoutDetailsLabelDefault'); |
275 | 275 | print '<td colspan="2">'; |
276 | - print '<input type="text" name="TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT" value="' . getDolGlobalString('TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT') . '" />'; |
|
276 | + print '<input type="text" name="TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT" value="'.getDolGlobalString('TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT').'" />'; |
|
277 | 277 | print "</td></tr>\n"; |
278 | 278 | } |
279 | 279 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
61 | 61 | $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
62 | 62 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
63 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
63 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
64 | 64 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
65 | 65 | $search_country = GETPOST('search_country', 'alpha'); |
66 | 66 | $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); |
@@ -216,13 +216,13 @@ discard block |
||
216 | 216 | $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as l"; |
217 | 217 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; |
218 | 218 | if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { |
219 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
219 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
220 | 220 | } |
221 | 221 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = l.fk_code_ventilation"; |
222 | 222 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = l.fk_facture_fourn"; |
223 | 223 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
224 | 224 | if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { |
225 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
225 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
226 | 226 | } |
227 | 227 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; |
228 | 228 | $sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 "; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
60 | 60 | $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
61 | 61 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
62 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
62 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
63 | 63 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
64 | 64 | $search_country = GETPOST('search_country', 'alpha'); |
65 | 65 | $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); |
@@ -215,13 +215,13 @@ discard block |
||
215 | 215 | $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd"; |
216 | 216 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product"; |
217 | 217 | if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { |
218 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
218 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
219 | 219 | } |
220 | 220 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; |
221 | 221 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture"; |
222 | 222 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
223 | 223 | if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { |
224 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
224 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
225 | 225 | } |
226 | 226 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; |
227 | 227 | $sql .= " WHERE fd.fk_code_ventilation > 0"; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | |
28 | 28 | // Put here all includes required by your class file |
29 | -require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; |
|
29 | +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; |
|
30 | 30 | //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
31 | 31 | //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
32 | 32 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
104 | 104 | */ |
105 | - public $fields=array( |
|
105 | + public $fields = array( |
|
106 | 106 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'css'=>'left', 'comment'=>"Id"), |
107 | 107 | //'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), |
108 | 108 | 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>3,), |
@@ -268,10 +268,10 @@ discard block |
||
268 | 268 | |
269 | 269 | // Clear fields |
270 | 270 | if (property_exists($object, 'ref')) { |
271 | - $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_" . $object->ref : $this->fields['ref']['default']; |
|
271 | + $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; |
|
272 | 272 | } |
273 | 273 | if (property_exists($object, 'label')) { |
274 | - $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf") . " " . $object->label : $this->fields['label']['default']; |
|
274 | + $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; |
|
275 | 275 | } |
276 | 276 | if (property_exists($object, 'status')) { |
277 | 277 | $object->status = self::STATUS_DRAFT; |
@@ -383,9 +383,9 @@ discard block |
||
383 | 383 | |
384 | 384 | $sql = 'SELECT '; |
385 | 385 | $sql .= $this->getFieldList('t'); |
386 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
|
386 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
|
387 | 387 | if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { |
388 | - $sql .= ' WHERE t.entity IN (' . getEntity($this->table_element) . ')'; |
|
388 | + $sql .= ' WHERE t.entity IN ('.getEntity($this->table_element).')'; |
|
389 | 389 | } else { |
390 | 390 | $sql .= ' WHERE 1 = 1'; |
391 | 391 | } |
@@ -394,15 +394,15 @@ discard block |
||
394 | 394 | if (count($filter) > 0) { |
395 | 395 | foreach ($filter as $key => $value) { |
396 | 396 | if ($key == 't.rowid') { |
397 | - $sqlwhere[] = $key . '=' . $value; |
|
397 | + $sqlwhere[] = $key.'='.$value; |
|
398 | 398 | } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { |
399 | - $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\''; |
|
399 | + $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; |
|
400 | 400 | } elseif ($key == 'customsql') { |
401 | 401 | $sqlwhere[] = $value; |
402 | 402 | } elseif (strpos($value, '%') === false) { |
403 | - $sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')'; |
|
403 | + $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; |
|
404 | 404 | } else { |
405 | - $sqlwhere[] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\''; |
|
405 | + $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; |
|
406 | 406 | } |
407 | 407 | } |
408 | 408 | } |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $sql .= $this->db->order($sortfield, $sortorder); |
415 | 415 | } |
416 | 416 | if (!empty($limit)) { |
417 | - $sql .= ' ' . $this->db->plimit($limit, $offset); |
|
417 | + $sql .= ' '.$this->db->plimit($limit, $offset); |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | $resql = $this->db->query($sql); |
@@ -435,8 +435,8 @@ discard block |
||
435 | 435 | |
436 | 436 | return $records; |
437 | 437 | } else { |
438 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
439 | - dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); |
|
438 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
439 | + dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); |
|
440 | 440 | |
441 | 441 | return -1; |
442 | 442 | } |
@@ -497,13 +497,13 @@ discard block |
||
497 | 497 | { |
498 | 498 | global $conf, $langs; |
499 | 499 | |
500 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
500 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
501 | 501 | |
502 | 502 | $error = 0; |
503 | 503 | |
504 | 504 | // Protection |
505 | 505 | if ($this->status == self::STATUS_VALIDATED) { |
506 | - dol_syslog(get_class($this) . "::validate action abandonned: already validated", LOG_WARNING); |
|
506 | + dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING); |
|
507 | 507 | return 0; |
508 | 508 | } |
509 | 509 | |
@@ -529,18 +529,18 @@ discard block |
||
529 | 529 | |
530 | 530 | if (!empty($num)) { |
531 | 531 | // Validate |
532 | - $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element; |
|
533 | - $sql .= " SET ref = '" . $this->db->escape($num) . "',"; |
|
534 | - $sql .= " status = " . self::STATUS_VALIDATED; |
|
532 | + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; |
|
533 | + $sql .= " SET ref = '".$this->db->escape($num)."',"; |
|
534 | + $sql .= " status = ".self::STATUS_VALIDATED; |
|
535 | 535 | if (!empty($this->fields['date_validation'])) { |
536 | - $sql .= ", date_validation = '" . $this->db->idate($now) . "'"; |
|
536 | + $sql .= ", date_validation = '".$this->db->idate($now)."'"; |
|
537 | 537 | } |
538 | 538 | if (!empty($this->fields['fk_user_valid'])) { |
539 | - $sql .= ", fk_user_valid = " . ((int) $user->id); |
|
539 | + $sql .= ", fk_user_valid = ".((int) $user->id); |
|
540 | 540 | } |
541 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
541 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
542 | 542 | |
543 | - dol_syslog(get_class($this) . "::validate()", LOG_DEBUG); |
|
543 | + dol_syslog(get_class($this)."::validate()", LOG_DEBUG); |
|
544 | 544 | $resql = $this->db->query($sql); |
545 | 545 | if (!$resql) { |
546 | 546 | dol_print_error($this->db); |
@@ -564,8 +564,8 @@ discard block |
||
564 | 564 | // Rename directory if dir was a temporary ref |
565 | 565 | if (preg_match('/^[\(]?PROV/i', $this->ref)) { |
566 | 566 | // Now we rename also files into index |
567 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'position/" . $this->db->escape($this->newref) . "'"; |
|
568 | - $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'position/" . $this->db->escape($this->ref) . "' and entity = " . $conf->entity; |
|
567 | + $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'position/".$this->db->escape($this->newref)."'"; |
|
568 | + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'position/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; |
|
569 | 569 | $resql = $this->db->query($sql); |
570 | 570 | if (!$resql) { |
571 | 571 | $error++; |
@@ -575,20 +575,20 @@ discard block |
||
575 | 575 | // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments |
576 | 576 | $oldref = dol_sanitizeFileName($this->ref); |
577 | 577 | $newref = dol_sanitizeFileName($num); |
578 | - $dirsource = $conf->hrm->dir_output . '/position/' . $oldref; |
|
579 | - $dirdest = $conf->hrm->dir_output . '/position/' . $newref; |
|
578 | + $dirsource = $conf->hrm->dir_output.'/position/'.$oldref; |
|
579 | + $dirdest = $conf->hrm->dir_output.'/position/'.$newref; |
|
580 | 580 | if (!$error && file_exists($dirsource)) { |
581 | - dol_syslog(get_class($this) . "::validate() rename dir " . $dirsource . " into " . $dirdest); |
|
581 | + dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest); |
|
582 | 582 | |
583 | 583 | if (@rename($dirsource, $dirdest)) { |
584 | 584 | dol_syslog("Rename ok"); |
585 | 585 | // Rename docs starting with $oldref with $newref |
586 | - $listoffiles = dol_dir_list($conf->hrm->dir_output . '/position/' . $newref, 'files', 1, '^' . preg_quote($oldref, '/')); |
|
586 | + $listoffiles = dol_dir_list($conf->hrm->dir_output.'/position/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); |
|
587 | 587 | foreach ($listoffiles as $fileentry) { |
588 | 588 | $dirsource = $fileentry['name']; |
589 | - $dirdest = preg_replace('/^' . preg_quote($oldref, '/') . '/', $newref, $dirsource); |
|
590 | - $dirsource = $fileentry['path'] . '/' . $dirsource; |
|
591 | - $dirdest = $fileentry['path'] . '/' . $dirdest; |
|
589 | + $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); |
|
590 | + $dirsource = $fileentry['path'].'/'.$dirsource; |
|
591 | + $dirdest = $fileentry['path'].'/'.$dirdest; |
|
592 | 592 | @rename($dirsource, $dirdest); |
593 | 593 | } |
594 | 594 | } |
@@ -704,14 +704,14 @@ discard block |
||
704 | 704 | |
705 | 705 | $result = ''; |
706 | 706 | |
707 | - $label = img_picto('', $this->picto) . ' <u>' . $langs->trans("Position") . '</u>'; |
|
707 | + $label = img_picto('', $this->picto).' <u>'.$langs->trans("Position").'</u>'; |
|
708 | 708 | if (isset($this->status)) { |
709 | - $label .= ' ' . $this->getLibStatut(5); |
|
709 | + $label .= ' '.$this->getLibStatut(5); |
|
710 | 710 | } |
711 | 711 | $label .= '<br>'; |
712 | - $label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; |
|
712 | + $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref; |
|
713 | 713 | |
714 | - $url = dol_buildpath('/hrm/position_card.php', 1) . '?id=' . $this->id; |
|
714 | + $url = dol_buildpath('/hrm/position_card.php', 1).'?id='.$this->id; |
|
715 | 715 | |
716 | 716 | if ($option != 'nolink') { |
717 | 717 | // Add param to save lastsearch_values or not |
@@ -728,20 +728,20 @@ discard block |
||
728 | 728 | if (empty($notooltip)) { |
729 | 729 | if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
730 | 730 | $label = $langs->trans("ShowPosition"); |
731 | - $linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"'; |
|
731 | + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
|
732 | 732 | } |
733 | - $linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"'; |
|
734 | - $linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
733 | + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; |
|
734 | + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; |
|
735 | 735 | } else { |
736 | - $linkclose = ($morecss ? ' class="' . $morecss . '"' : ''); |
|
736 | + $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
|
737 | 737 | } |
738 | 738 | |
739 | 739 | if ($option == 'nolink') { |
740 | 740 | $linkstart = '<span'; |
741 | 741 | } else { |
742 | - $linkstart = '<a href="' . $url . '"'; |
|
742 | + $linkstart = '<a href="'.$url.'"'; |
|
743 | 743 | } |
744 | - $linkstart .= $linkclose . '>'; |
|
744 | + $linkstart .= $linkclose.'>'; |
|
745 | 745 | if ($option == 'nolink') { |
746 | 746 | $linkend = '</span>'; |
747 | 747 | } else { |
@@ -752,29 +752,29 @@ discard block |
||
752 | 752 | |
753 | 753 | if (empty($this->showphoto_on_popup)) { |
754 | 754 | if ($withpicto) { |
755 | - $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); |
|
755 | + $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); |
|
756 | 756 | } |
757 | 757 | } else { |
758 | 758 | if ($withpicto) { |
759 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
759 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
760 | 760 | |
761 | 761 | list($class, $module) = explode('@', $this->picto); |
762 | - $upload_dir = $conf->$module->multidir_output[$conf->entity] . "/$class/" . dol_sanitizeFileName($this->ref); |
|
762 | + $upload_dir = $conf->$module->multidir_output[$conf->entity]."/$class/".dol_sanitizeFileName($this->ref); |
|
763 | 763 | $filearray = dol_dir_list($upload_dir, "files"); |
764 | 764 | $filename = $filearray[0]['name']; |
765 | 765 | if (!empty($filename)) { |
766 | 766 | $pospoint = strpos($filearray[0]['name'], '.'); |
767 | 767 | |
768 | - $pathtophoto = $class . '/' . $this->ref . '/thumbs/' . substr($filename, 0, $pospoint) . '_mini' . substr($filename, $pospoint); |
|
769 | - if (empty($conf->global->{strtoupper($module . '_' . $class) . '_FORMATLISTPHOTOSASUSERS'})) { |
|
770 | - $result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo' . $module . '" alt="No photo" border="0" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $module . '&entity=' . $conf->entity . '&file=' . urlencode($pathtophoto) . '"></div></div>'; |
|
768 | + $pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint); |
|
769 | + if (empty($conf->global->{strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS'})) { |
|
770 | + $result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$module.'" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div></div>'; |
|
771 | 771 | } else { |
772 | - $result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $module . '&entity=' . $conf->entity . '&file=' . urlencode($pathtophoto) . '"></div>'; |
|
772 | + $result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div>'; |
|
773 | 773 | } |
774 | 774 | |
775 | 775 | $result .= '</div>'; |
776 | 776 | } else { |
777 | - $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); |
|
777 | + $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); |
|
778 | 778 | } |
779 | 779 | } |
780 | 780 | } |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); |
834 | 834 | } |
835 | 835 | |
836 | - $statusType = 'status' . $status; |
|
836 | + $statusType = 'status'.$status; |
|
837 | 837 | //if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; |
838 | 838 | if ($status == self::STATUS_CANCELED) { |
839 | 839 | $statusType = 'status6'; |
@@ -852,8 +852,8 @@ discard block |
||
852 | 852 | { |
853 | 853 | $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; |
854 | 854 | $sql .= ' fk_user_creat, fk_user_modif'; |
855 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
|
856 | - $sql .= ' WHERE t.rowid = ' . ((int) $id); |
|
855 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
|
856 | + $sql .= ' WHERE t.rowid = '.((int) $id); |
|
857 | 857 | $result = $this->db->query($sql); |
858 | 858 | if ($result) { |
859 | 859 | if ($this->db->num_rows($result)) { |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | $this->lines = array(); |
914 | 914 | |
915 | 915 | $objectline = new PositionLine($this->db); |
916 | - $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql' => 'fk_position = ' . $this->id)); |
|
916 | + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql' => 'fk_position = '.$this->id)); |
|
917 | 917 | |
918 | 918 | if (is_numeric($result)) { |
919 | 919 | $this->error = $this->error; |
@@ -942,20 +942,20 @@ discard block |
||
942 | 942 | if (!empty($conf->global->hrm_POSITION_ADDON)) { |
943 | 943 | $mybool = false; |
944 | 944 | |
945 | - $file = $conf->global->hrm_POSITION_ADDON . ".php"; |
|
945 | + $file = $conf->global->hrm_POSITION_ADDON.".php"; |
|
946 | 946 | $classname = $conf->global->hrm_POSITION_ADDON; |
947 | 947 | |
948 | 948 | // Include file with class |
949 | 949 | $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
950 | 950 | foreach ($dirmodels as $reldir) { |
951 | - $dir = dol_buildpath($reldir . "core/modules/hrm/"); |
|
951 | + $dir = dol_buildpath($reldir."core/modules/hrm/"); |
|
952 | 952 | |
953 | 953 | // Load file with numbering class (if found) |
954 | - $mybool |= @include_once $dir . $file; |
|
954 | + $mybool |= @include_once $dir.$file; |
|
955 | 955 | } |
956 | 956 | |
957 | 957 | if ($mybool === false) { |
958 | - dol_print_error('', "Failed to include file " . $file); |
|
958 | + dol_print_error('', "Failed to include file ".$file); |
|
959 | 959 | return ''; |
960 | 960 | } |
961 | 961 | |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | return ""; |
972 | 972 | } |
973 | 973 | } else { |
974 | - print $langs->trans("Error") . " " . $langs->trans("ClassNotFound") . ' ' . $classname; |
|
974 | + print $langs->trans("Error")." ".$langs->trans("ClassNotFound").' '.$classname; |
|
975 | 975 | return ""; |
976 | 976 | } |
977 | 977 | } else { |
@@ -988,7 +988,7 @@ discard block |
||
988 | 988 | { |
989 | 989 | $TPosition = array(); |
990 | 990 | |
991 | - $TPosition = $this->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_user=' . $userid)); |
|
991 | + $TPosition = $this->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_user='.$userid)); |
|
992 | 992 | |
993 | 993 | return $TPosition; |
994 | 994 | } |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | } |
1065 | 1065 | |
1066 | 1066 | |
1067 | -require_once DOL_DOCUMENT_ROOT . '/core/class/commonobjectline.class.php'; |
|
1067 | +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; |
|
1068 | 1068 | |
1069 | 1069 | /** |
1070 | 1070 | * Class PositionLine. You can also remove this and generate a CRUD class for lines objects. |