@@ -136,8 +136,12 @@ |
||
| 136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
| 137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
| 140 | -if (!$permissiontoread) accessforbidden(); |
|
| 139 | +if (empty($conf->hrm->enabled)) { |
|
| 140 | + accessforbidden(); |
|
| 141 | +} |
|
| 142 | +if (!$permissiontoread) { |
|
| 143 | + accessforbidden(); |
|
| 144 | +} |
|
| 141 | 145 | |
| 142 | 146 | |
| 143 | 147 | /* |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | // Load Dolibarr environment |
| 30 | 30 | require '../main.inc.php'; |
| 31 | 31 | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 34 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
| 35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 34 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | // Load translation files required by the page |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
| 152 | 152 | |
| 153 | 153 | $morehtmlref = '<div class="refid">'; |
| 154 | - $morehtmlref.= $object->label; |
|
| 154 | + $morehtmlref .= $object->label; |
|
| 155 | 155 | $morehtmlref .= '</div>'; |
| 156 | 156 | |
| 157 | 157 | |
@@ -136,8 +136,12 @@ |
||
| 136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
| 137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
| 140 | -if (!$permissiontoread) accessforbidden(); |
|
| 139 | +if (empty($conf->hrm->enabled)) { |
|
| 140 | + accessforbidden(); |
|
| 141 | +} |
|
| 142 | +if (!$permissiontoread) { |
|
| 143 | + accessforbidden(); |
|
| 144 | +} |
|
| 141 | 145 | |
| 142 | 146 | |
| 143 | 147 | /* |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
| 33 | 33 | require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; |
| 34 | 34 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
| 35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
| 37 | 37 | |
| 38 | 38 | // Load translation files required by the page |
| 39 | 39 | $langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
| 132 | 132 | |
| 133 | 133 | $morehtmlref = '<div class="refid">'; |
| 134 | - $morehtmlref.= $object->label; |
|
| 134 | + $morehtmlref .= $object->label; |
|
| 135 | 135 | $morehtmlref .= '</div>'; |
| 136 | 136 | |
| 137 | 137 | dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); |
@@ -136,8 +136,12 @@ |
||
| 136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
| 137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
| 140 | -if (!$permissiontoread) accessforbidden(); |
|
| 139 | +if (empty($conf->hrm->enabled)) { |
|
| 140 | + accessforbidden(); |
|
| 141 | +} |
|
| 142 | +if (!$permissiontoread) { |
|
| 143 | + accessforbidden(); |
|
| 144 | +} |
|
| 141 | 145 | |
| 142 | 146 | |
| 143 | 147 | /* |
@@ -29,9 +29,9 @@ |
||
| 29 | 29 | // Load Dolibarr environment |
| 30 | 30 | require '../main.inc.php'; |
| 31 | 31 | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';; |
|
| 33 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; |
|
| 34 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; ; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
|
| 34 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; |
|
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | // Load translation files required by the page |
@@ -136,8 +136,12 @@ |
||
| 136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
| 137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
| 140 | -if (!$permissiontoread) accessforbidden(); |
|
| 139 | +if (empty($conf->hrm->enabled)) { |
|
| 140 | + accessforbidden(); |
|
| 141 | +} |
|
| 142 | +if (!$permissiontoread) { |
|
| 143 | + accessforbidden(); |
|
| 144 | +} |
|
| 141 | 145 | |
| 142 | 146 | |
| 143 | 147 | /* |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | // Load Dolibarr environment |
| 30 | 30 | require '../main.inc.php'; |
| 31 | 31 | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; |
|
| 33 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php'; |
|
| 34 | 34 | |
| 35 | 35 | // Load translation files required by the page |
| 36 | 36 | $langs->loadLangs(array('hrm', 'companies')); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
| 105 | 105 | |
| 106 | 106 | $morehtmlref = '<div class="refid">'; |
| 107 | - $morehtmlref.= $object->label; |
|
| 107 | + $morehtmlref .= $object->label; |
|
| 108 | 108 | $morehtmlref .= '</div>'; |
| 109 | 109 | |
| 110 | 110 | |
@@ -136,8 +136,12 @@ |
||
| 136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
| 137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
| 140 | -if (!$permissiontoread) accessforbidden(); |
|
| 139 | +if (empty($conf->hrm->enabled)) { |
|
| 140 | + accessforbidden(); |
|
| 141 | +} |
|
| 142 | +if (!$permissiontoread) { |
|
| 143 | + accessforbidden(); |
|
| 144 | +} |
|
| 141 | 145 | |
| 142 | 146 | |
| 143 | 147 | /* |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | // Load Dolibarr environment |
| 30 | 30 | require '../main.inc.php'; |
| 31 | 31 | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
| 33 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
| 34 | 34 | |
| 35 | 35 | // Load translation files required by the page |
| 36 | 36 | $langs->loadLangs(array('hrm', 'companies')); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
| 107 | 107 | |
| 108 | 108 | $morehtmlref = '<div class="refid">'; |
| 109 | - $morehtmlref.= $object->label; |
|
| 109 | + $morehtmlref .= $object->label; |
|
| 110 | 110 | $morehtmlref .= '</div>'; |
| 111 | 111 | |
| 112 | 112 | |
@@ -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. |
@@ -914,11 +914,11 @@ |
||
| 914 | 914 | |
| 915 | 915 | |
| 916 | 916 | /** |
| 917 | - * Load the info information in the object |
|
| 918 | - * |
|
| 919 | - * @param int $id Id of object |
|
| 920 | - * @return void |
|
| 921 | - */ |
|
| 917 | + * Load the info information in the object |
|
| 918 | + * |
|
| 919 | + * @param int $id Id of object |
|
| 920 | + * @return void |
|
| 921 | + */ |
|
| 922 | 922 | public function info($id) |
| 923 | 923 | { |
| 924 | 924 | $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | llxHeader('', $title, '', '', 0, 0, $arrayjs); |
| 78 | 78 | |
| 79 | -print load_fiche_titre($title, '', $memberstatic->picto); |
|
| 79 | +print load_fiche_titre($title, '', $memberstatic->picto); |
|
| 80 | 80 | |
| 81 | 81 | //dol_mkdir($dir); |
| 82 | 82 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | if ($mode == 'memberbyregion') { //+ |
| 173 | 173 | $data[] = array( |
| 174 | 174 | 'label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')), |
| 175 | - 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label :'<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')), |
|
| 175 | + 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')), |
|
| 176 | 176 | 'label2'=>($obj->label2 ? $obj->label2 : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>'), |
| 177 | 177 | 'nb'=>$obj->nb, |
| 178 | 178 | 'lastdate'=>$db->jdate($obj->lastdate), |
@@ -221,7 +221,7 @@ |
||
| 221 | 221 | $i = 0; |
| 222 | 222 | |
| 223 | 223 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 224 | - $param.='&limit='.urlencode($limit); |
|
| 224 | + $param .= '&limit='.urlencode($limit); |
|
| 225 | 225 | } |
| 226 | 226 | $param = "&id=".urlencode($id); |
| 227 | 227 | |
@@ -239,7 +239,7 @@ |
||
| 239 | 239 | print '<input type="submit" value="'.$langs->trans("ViewAndVote").'" id="viewandvote" name="viewandvote" class="button width500">'; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | -if (! $foundaction) { |
|
| 242 | +if (!$foundaction) { |
|
| 243 | 243 | print '<span class="opacitymedium">'.$langs->trans("NoPublicActionsAllowedForThisEvent").'</span>'; |
| 244 | 244 | } |
| 245 | 245 | |