Fix php-cs-fixer

This commit is contained in:
Laurent Destailleur 2023-12-04 12:36:45 +01:00
parent eebe4370fb
commit 705ebea947
46 changed files with 381 additions and 218 deletions

View File

@ -51,7 +51,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$fuserid = (GETPOST('fuserid', 'int') ?GETPOST('fuserid', 'int') : $user->id);
$fuserid = (GETPOST('fuserid', 'int') ? GETPOST('fuserid', 'int') : $user->id);
$socid = GETPOST('socid', 'int');
// Load translation files required by the page
@ -823,15 +823,15 @@ if (empty($reshook)) {
// If status pending validation and validator = validator or user, or rights to do for others
if (($object->statut == Holiday::STATUS_VALIDATED || $object->statut == Holiday::STATUS_APPROVED) &&
(!empty($user->admin) || $user->id == $object->fk_validator || $cancreate || $cancreateall)) {
$db->begin();
$db->begin();
$oldstatus = $object->statut;
$object->date_cancel = dol_now();
$object->fk_user_cancel = $user->id;
$object->statut = Holiday::STATUS_CANCELED;
$object->status = Holiday::STATUS_CANCELED;
$oldstatus = $object->statut;
$object->date_cancel = dol_now();
$object->fk_user_cancel = $user->id;
$object->statut = Holiday::STATUS_CANCELED;
$object->status = Holiday::STATUS_CANCELED;
$result = $object->update($user);
$result = $object->update($user);
if ($result >= 0 && $oldstatus == Holiday::STATUS_APPROVED) { // holiday was already validated, status 3, so we must increase back the balance
// Call trigger
@ -864,7 +864,7 @@ if (empty($reshook)) {
$db->rollback();
}
// If no SQL error, we redirect to the request form
// If no SQL error, we redirect to the request form
if (!$error && $result > 0) {
// To
$destinataire = new User($db);
@ -1107,7 +1107,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')' : '');
$arraytypeleaves[$val['rowid']] = $labeltoshow;
}
print $form->selectarray('type', $arraytypeleaves, (GETPOST('type', 'alpha') ?GETPOST('type', 'alpha') : ''), 1, 0, 0, '', 0, 0, 0, '', '', true);
print $form->selectarray('type', $arraytypeleaves, (GETPOST('type', 'alpha') ? GETPOST('type', 'alpha') : ''), 1, 0, 0, '', 0, 0, 0, '', '', true);
if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
@ -1127,7 +1127,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print $form->selectDate($tmpdate, 'date_debut_', 0, 0, 0, '', 1, 1);
}
print '     ';
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday', 'alpha') ?GETPOST('starthalfday', 'alpha') : 'morning'));
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday', 'alpha') ? GETPOST('starthalfday', 'alpha') : 'morning'));
print '</td>';
print '</tr>';
@ -1144,7 +1144,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print $form->selectDate($tmpdate, 'date_fin_', 0, 0, 0, '', 1, 1);
}
print ' &nbsp; &nbsp; ';
print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday', 'alpha') ?GETPOST('endhalfday', 'alpha') : 'afternoon'));
print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday', 'alpha') ? GETPOST('endhalfday', 'alpha') : 'afternoon'));
print '</td>';
print '</tr>';
@ -1317,7 +1317,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
$tmpdate = dol_mktime(0, 0, 0, GETPOST('date_debut_month', 'int'), GETPOST('date_debut_day', 'int'), GETPOST('date_debut_year', 'int'));
print $form->selectDate($tmpdate ? $tmpdate : $object->date_debut, 'date_debut_');
print ' &nbsp; &nbsp; ';
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday') ?GETPOST('starthalfday') : $starthalfday));
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday') ? GETPOST('starthalfday') : $starthalfday));
print '</td>';
print '</tr>';
}
@ -1340,7 +1340,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print '<td>';
print $form->selectDate($object->date_fin, 'date_fin_');
print ' &nbsp; &nbsp; ';
print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday') ?GETPOST('endhalfday') : $endhalfday));
print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday') ? GETPOST('endhalfday') : $endhalfday));
print '</td>';
print '</tr>';
}

View File

@ -48,8 +48,8 @@ $cancel = GETPOST('cancel', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$fuserid = (GETPOST('fuserid', 'int') ?GETPOST('fuserid', 'int') : $user->id);
$users = (GETPOST('users', 'array') ?GETPOST('users', 'array') : array($user->id));
$fuserid = (GETPOST('fuserid', 'int') ? GETPOST('fuserid', 'int') : $user->id);
$users = (GETPOST('users', 'array') ? GETPOST('users', 'array') : array($user->id));
$groups = GETPOST('groups', 'array');
$socid = GETPOST('socid', 'int');
$autoValidation = GETPOST('autoValidation', 'int');
@ -277,7 +277,7 @@ if (empty($reshook)) {
/** USERS */
if (is_array($users) && count($users) > 0) {
foreach ($users as $u) {
$TusersToProcess[$u] = $u;
$TusersToProcess[$u] = $u;
}
}
foreach ($TusersToProcess as $u) {
@ -327,7 +327,7 @@ if (empty($reshook)) {
$htemp->statut = Holiday::STATUS_VALIDATED;
$resultValidated = $htemp->update($approverid);
if ($resultValidated < 0 ) {
if ($resultValidated < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
@ -336,7 +336,9 @@ if (empty($reshook)) {
if ($AutoSendMail && !$error) {
// send a mail to the user
$returnSendMail = sendMail($result, $cancreate, $now, $autoValidation);
if (!empty($returnSendMail->msg)) setEventMessage($returnSendMail->msg, $returnSendMail->style);
if (!empty($returnSendMail->msg)) {
setEventMessage($returnSendMail->msg, $returnSendMail->style);
}
}
}
}
@ -538,7 +540,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')' : '');
$arraytypeleaves[$val['rowid']] = $labeltoshow;
}
print $form->selectarray('type', $arraytypeleaves, (GETPOST('type', 'alpha') ?GETPOST('type', 'alpha') : ''), 1, 0, 0, '', 0, 0, 0, '', '', true);
print $form->selectarray('type', $arraytypeleaves, (GETPOST('type', 'alpha') ? GETPOST('type', 'alpha') : ''), 1, 0, 0, '', 0, 0, 0, '', '', true);
if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
@ -559,7 +561,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print $form->selectDate($tmpdate, 'date_debut_', 0, 0, 0, '', 1, 1);
}
print ' &nbsp; &nbsp; ';
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday', 'alpha') ?GETPOST('starthalfday', 'alpha') : 'morning'));
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday', 'alpha') ? GETPOST('starthalfday', 'alpha') : 'morning'));
print '</td>';
print '</tr>';
@ -576,7 +578,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print $form->selectDate($tmpdate, 'date_fin_', 0, 0, 0, '', 1, 1);
}
print ' &nbsp; &nbsp; ';
print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday', 'alpha') ?GETPOST('endhalfday', 'alpha') : 'afternoon'));
print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday', 'alpha') ? GETPOST('endhalfday', 'alpha') : 'afternoon'));
print '</td>';
print '</tr>';

View File

@ -269,13 +269,16 @@ class Holiday extends CommonObject
// Check parameters
if (empty($this->fk_user) || !is_numeric($this->fk_user) || $this->fk_user < 0) {
$this->error = "ErrorBadParameterFkUser"; return -1;
$this->error = "ErrorBadParameterFkUser";
return -1;
}
if (empty($this->fk_validator) || !is_numeric($this->fk_validator) || $this->fk_validator < 0) {
$this->error = "ErrorBadParameterFkValidator"; return -1;
$this->error = "ErrorBadParameterFkValidator";
return -1;
}
if (empty($this->fk_type) || !is_numeric($this->fk_type) || $this->fk_type < 0) {
$this->error = "ErrorBadParameterFkType"; return -1;
$this->error = "ErrorBadParameterFkType";
return -1;
}
// Insert request
@ -312,7 +315,8 @@ class Holiday extends CommonObject
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->errors[] = "Error ".$this->db->lasterror();
$error++;
$this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@ -765,7 +769,8 @@ class Holiday extends CommonObject
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->errors[] = "Error ".$this->db->lasterror();
$error++;
$this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@ -796,7 +801,8 @@ class Holiday extends CommonObject
$sql .= " WHERE filepath = 'holiday/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@ -939,7 +945,8 @@ class Holiday extends CommonObject
dol_syslog(get_class($this)."::approve", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->errors[] = "Error ".$this->db->lasterror();
$error++;
$this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@ -1069,7 +1076,8 @@ class Holiday extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->errors[] = "Error ".$this->db->lasterror();
$error++;
$this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@ -1118,7 +1126,8 @@ class Holiday extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->errors[] = "Error ".$this->db->lasterror();
$error++;
$this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@ -1404,7 +1413,7 @@ class Holiday extends CommonObject
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
@ -1546,7 +1555,6 @@ class Holiday extends CommonObject
*/
public function updateConfCP($name, $value)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
$sql .= " value = '".$this->db->escape($value)."'";
$sql .= " WHERE name = '".$this->db->escape($name)."'";
@ -2026,7 +2034,8 @@ class Holiday extends CommonObject
dol_syslog(get_class($this)."::fetch_users_approver_holiday sql=".$sql);
$result = $this->db->query($sql);
if ($result) {
$num_rows = $this->db->num_rows($result); $i = 0;
$num_rows = $this->db->num_rows($result);
$i = 0;
while ($i < $num_rows) {
$objp = $this->db->fetch_object($result);
array_push($users_validator, $objp->fk_user);
@ -2064,7 +2073,6 @@ class Holiday extends CommonObject
*/
public function countActiveUsersWithoutCP()
{
$sql = "SELECT count(u.rowid) as compteur";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u LEFT OUTER JOIN ".MAIN_DB_PREFIX."holiday_users hu ON (hu.fk_user=u.rowid)";
$sql .= " WHERE u.statut > 0 AND hu.fk_user IS NULL";
@ -2139,7 +2147,8 @@ class Holiday extends CommonObject
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->errors[] = "Error ".$this->db->lasterror();
$error++;
$this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {

View File

@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$langs->loadlangs(array('users', 'other', 'holiday', 'hrm'));
$action = GETPOST('action', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'defineholidaylist';
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'defineholidaylist';
$massaction = GETPOST('massaction', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST('optioncss', 'aZ');
@ -44,7 +44,7 @@ $search_name = GETPOST('search_name', 'alpha');
$search_supervisor = GETPOST('search_supervisor', 'int');
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
@ -99,7 +99,8 @@ $arrayfields = array(
*/
if (GETPOST('cancel', 'alpha')) {
$action = 'list'; $massaction = '';
$action = 'list';
$massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';

View File

@ -138,7 +138,7 @@ if ($object->id) {
// Build file list
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];

View File

@ -51,7 +51,7 @@ $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'holidaylist'; // To manage different context of search
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'holidaylist'; // To manage different context of search
$mode = GETPOST('mode', 'alpha'); // for switch mode view result
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
@ -66,7 +66,7 @@ $diroutputmassaction = $conf->holiday->dir_output.'/temp/massgeneration/'.$user-
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@ -83,7 +83,7 @@ if (!$sortfield) {
$sortfield = "cp.ref";
}
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_ref = GETPOST('search_ref', 'alphanohtml');
$search_day_create = GETPOST('search_day_create', 'int');
$search_month_create = GETPOST('search_month_create', 'int');
@ -211,14 +211,14 @@ if (empty($reshook)) {
}
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
}
// Mass actions
$objectclass = 'Holiday';
$objectlabel = 'Holiday';
$uploaddir = $conf->holiday->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
// Mass actions
$objectclass = 'Holiday';
$objectlabel = 'Holiday';
$uploaddir = $conf->holiday->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@ -987,14 +987,18 @@ if ($id && !$user->hasRight('holiday', 'readall') && !in_array($id, $childids))
print '<td class="center" title="'.dol_print_date($db->jdate($obj->date_valid), 'dayhour').'">';
print dol_print_date($db->jdate($obj->date_valid), 'day');
print '</td>';
if (!$i) $totalarray['nbfield']++;
if (!$i) {
$totalarray['nbfield']++;
}
}
// Date approval
if (!empty($arrayfields['cp.date_approval']['checked'])) {
print '<td class="center" title="'.dol_print_date($db->jdate($obj->date_approval), 'dayhour').'">';
print dol_print_date($db->jdate($obj->date_approval), 'day');
print '</td>';
if (!$i) $totalarray['nbfield']++;
if (!$i) {
$totalarray['nbfield']++;
}
}
// Extra fields
@ -1118,7 +1122,7 @@ function showMyBalance($holiday, $user_id)
foreach ($typeleaves as $key => $val) {
$nb_type = $holiday->getCPforUser($user_id, $val['rowid']);
$nb_holiday += $nb_type;
$out .= ' - '.$val['label'].': <strong>'.($nb_type ?price2num($nb_type) : 0).'</strong><br>';
$out .= ' - '.$val['label'].': <strong>'.($nb_type ? price2num($nb_type) : 0).'</strong><br>';
}
$out = $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'<br>'.$out;

View File

@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->loadLangs(array('holiday', 'hrm'));
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view';
$massaction = GETPOST('massaction', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ');
$optioncss = GETPOST('optioncss', 'aZ');
@ -81,7 +81,8 @@ $result = restrictedArea($user, 'holiday', $id, '');
*/
if (GETPOST('cancel', 'alpha')) {
$action = 'list'; $massaction = '';
$action = 'list';
$massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
@ -145,8 +146,8 @@ $title = $langs->trans('CPTitreMenu');
llxHeader('', $title);
$search_month = GETPOST("remonth", 'int') ?GETPOST("remonth", 'int') : date("m", time());
$search_year = GETPOST("reyear", 'int') ?GETPOST("reyear", 'int') : date("Y", time());
$search_month = GETPOST("remonth", 'int') ? GETPOST("remonth", 'int') : date("m", time());
$search_year = GETPOST("reyear", 'int') ? GETPOST("reyear", 'int') : date("Y", time());
$year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
$sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday, cp.statut as status";

View File

@ -37,14 +37,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$mode = GETPOST('mode', 'alpha');
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
@ -103,7 +103,8 @@ if (!$user->hasRight('holiday', 'readall')) {
*/
if (GETPOST('cancel', 'alpha')) {
$action = 'list'; $massaction = '';
$action = 'list';
$massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';

View File

@ -40,8 +40,12 @@ $permissiontoadd = $user->admin;
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0);
if (!isModEnabled('hrm')) accessforbidden();
if (empty($permissiontoread)) accessforbidden();
if (!isModEnabled('hrm')) {
accessforbidden();
}
if (empty($permissiontoread)) {
accessforbidden();
}
$sortorder = GETPOST('sortorder', 'aZ09comma');
$sortfield = GETPOST('sortfield', 'aZ09comma');
@ -56,7 +60,7 @@ if (empty($page) || $page == -1) {
$page = 0;
}
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@ -46,8 +46,12 @@ $permissiontoadd = $user->admin;
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0);
if (!isModEnabled('hrm')) accessforbidden();
if (empty($permissiontoread)) accessforbidden();
if (!isModEnabled('hrm')) {
accessforbidden();
}
if (empty($permissiontoread)) {
accessforbidden();
}
/*

View File

@ -244,7 +244,9 @@ class Evaluation extends CommonObject
$line->fk_rank = 0;
$res = $line->create($user, $notrigger);
if ($res > 0) $this->lines[] = $line;
if ($res > 0) {
$this->lines[] = $line;
}
}
}
}
@ -581,13 +583,15 @@ class Evaluation extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'evaluation/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'evaluation/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'evaluation/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@ -643,12 +647,15 @@ class Evaluation extends CommonObject
$sql.= "LIMIT 1 ";
$res = $this->db->query($sql);
if (!$res) { dol_print_error($this->db);}
if (!$res) {
dol_print_error($this->db);
}
$Tab = $this->db->fetch_object($res);
if (empty($Tab)) return null;
else {
if (empty($Tab)) {
return null;
} else {
$evaluation = new Evaluation($this->db);
$evaluation->fetch($Tab->rowid);

View File

@ -567,7 +567,8 @@ class EvaluationLine extends CommonObjectLine
$sql .= " WHERE filepath = 'evaluationline/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments

View File

@ -558,13 +558,15 @@ class Job extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'job/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'job/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'job/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@ -616,7 +618,9 @@ class Job extends CommonObject
{
$Tab = $this->getForUser($fk_user);
if (empty($Tab)) return '';
if (empty($Tab)) {
return '';
}
$lastpos = array_shift($Tab);

View File

@ -575,7 +575,8 @@ class Position extends CommonObject
$sql .= " WHERE filepath = 'position/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@ -874,9 +875,7 @@ class Position extends CommonObject
$vacantId = $keyprefix.$key.'vacant'.$keysuffix;
$out = parent::showInputField($val, $key, $value, $moreparam, $keysuffix, $keyprefix, $morecss);
$out .= '<label class="nowrap position-fk-user classfortooltip" title="'.dol_escape_js($langs->trans('VacantCheckboxHelper')).'"><input type="checkbox" id="'.$vacantId.'" name="'.$vacantId.'" />&nbsp;'.$langs->trans("Vacant").'</label>';
?>
$out .= '<label class="nowrap position-fk-user classfortooltip" title="'.dol_escape_js($langs->trans('VacantCheckboxHelper')).'"><input type="checkbox" id="'.$vacantId.'" name="'.$vacantId.'" />&nbsp;'.$langs->trans("Vacant").'</label>'; ?>
<script type="text/javascript">
$(document).ready(function () {
var checkbox = $('#<?php print $vacantId; ?>');
@ -923,7 +922,7 @@ class Position extends CommonObject
}
/**
/**
* Load the info information in the object
*
* @param int $id Id of object

View File

@ -626,13 +626,15 @@ class Skill extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'skill/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'skill/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'skill/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@ -1120,9 +1122,9 @@ class Skill extends CommonObject
global $langs;
$result = '';
switch ($code) {
case 0 : $result = $langs->trans("TypeKnowHow"); break; //"Savoir Faire"
case 1 : $result = $langs->trans("TypeHowToBe"); break; // "Savoir être"
case 9 : $result = $langs->trans("TypeKnowledge"); break; //"Savoir"
case 0: $result = $langs->trans("TypeKnowHow"); break; //"Savoir Faire"
case 1: $result = $langs->trans("TypeHowToBe"); break; // "Savoir être"
case 9: $result = $langs->trans("TypeKnowledge"); break; //"Savoir"
}
return $result;
}

View File

@ -549,13 +549,15 @@ class Skilldet extends CommonObjectLine
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'skilldet/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'skilldet/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'skilldet/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments

View File

@ -378,7 +378,6 @@ class SkillRank extends CommonObject
*/
public function cloneFromCurrentSkill($currentSkill, $fk_user)
{
global $user;
$this->fk_skill = $currentSkill->fk_skill;
@ -599,13 +598,15 @@ class SkillRank extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'skillrank/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'skillrank/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'skillrank/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
$error++;
$this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments

View File

@ -51,8 +51,12 @@ $job = new Job($db);
$permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read;
$permissiontoadd = 0;
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) {
accessforbidden();
}
/*
@ -113,7 +117,9 @@ print dol_get_fiche_head($head, 'compare', '', 1);
$fk_usergroup2 = 0;
$fk_job = (int) GETPOST('fk_job');
if ($fk_job <= 0) $fk_usergroup2 = GETPOST('fk_usergroup2');
if ($fk_job <= 0) {
$fk_usergroup2 = GETPOST('fk_usergroup2');
}
$fk_usergroup1 = GETPOST('fk_usergroup1');
@ -284,17 +290,22 @@ llxFooter();
*/
function diff(&$TMergedSkills)
{
$out = '<ul class="diff">';
foreach ($TMergedSkills as $id => &$sk) {
$class = 'diffnote';
if (empty($sk->rate2)) $class .= ' toohappy';
elseif (empty($sk->rate1)) $class .= ' toosad';
elseif ($sk->rate1 == $sk->rate2) $class .= ' happy';
elseif ($sk->rate2 < $sk->rate1) $class .= ' veryhappy';
elseif ($sk->rate2 > $sk->rate1) $class .= ' sad';
if (empty($sk->rate2)) {
$class .= ' toohappy';
} elseif (empty($sk->rate1)) {
$class .= ' toosad';
} elseif ($sk->rate1 == $sk->rate2) {
$class .= ' happy';
} elseif ($sk->rate2 < $sk->rate1) {
$class .= ' veryhappy';
} elseif ($sk->rate2 > $sk->rate1) {
$class .= ' sad';
}
$out .= '<li fk_skill="' . $id . '" class="' . $class . '" style="text-align:center;">
<span class="' . $class . '">&nbsp;</span>
@ -329,8 +340,11 @@ function rate(&$TMergedSkills, $field)
$how_many = ($field === 'rate1') ? $sk->how_many_max1 : $sk->how_many_max2;
}
if ($field === 'rate2' && $fk_job > 0) $trad = $langs->trans('RequiredRank');
else $trad = $langs->trans('HighestRank');
if ($field === 'rate2' && $fk_job > 0) {
$trad = $langs->trans('RequiredRank');
} else {
$trad = $langs->trans('HighestRank');
}
$out .= '<li fk_skill="' . $id . '" style="text-align:center;">
<p><span class="' . $class . ' classfortooltip" title="' . $trad . '">' . $note . '</span>' . ($how_many > 0 ? '<span class="bubble classfortooltip" title="' . $langs->trans('HowManyUserWithThisMaxNote') . '">' . $how_many . '</span>' : '') . '</p>
@ -350,7 +364,6 @@ function rate(&$TMergedSkills, $field)
*/
function skillList(&$TMergedSkills)
{
$out = '<ul class="competence">';
foreach ($TMergedSkills as $id => &$sk) {
@ -374,24 +387,27 @@ function skillList(&$TMergedSkills)
*/
function mergeSkills($TSkill1, $TSkill2)
{
$Tab = array();
foreach ($TSkill1 as &$sk) {
if (empty($Tab[$sk->fk_skill])) $Tab[$sk->fk_skill] = new stdClass;
if (empty($Tab[$sk->fk_skill])) {
$Tab[$sk->fk_skill] = new stdClass();
}
$Tab[$sk->fk_skill]->rate1 = $sk->rankorder;
$Tab[$sk->fk_skill]->how_many_max1 = $sk->how_many_max;
$Tab[$sk->fk_skill]->label = $sk->label;
$Tab[$sk->fk_skill]->description = $sk->description;
$Tab[$sk->fk_skill]->rate1 = $sk->rankorder;
$Tab[$sk->fk_skill]->how_many_max1 = $sk->how_many_max;
$Tab[$sk->fk_skill]->label = $sk->label;
$Tab[$sk->fk_skill]->description = $sk->description;
}
foreach ($TSkill2 as &$sk) {
if (empty($Tab[$sk->fk_skill])) $Tab[$sk->fk_skill] = new stdClass;
$Tab[$sk->fk_skill]->rate2 = $sk->rankorder;
$Tab[$sk->fk_skill]->label = $sk->label;
$Tab[$sk->fk_skill]->description = $sk->description;
$Tab[$sk->fk_skill]->how_many_max2 = $sk->how_many_max;
if (empty($Tab[$sk->fk_skill])) {
$Tab[$sk->fk_skill] = new stdClass();
}
$Tab[$sk->fk_skill]->rate2 = $sk->rankorder;
$Tab[$sk->fk_skill]->label = $sk->label;
$Tab[$sk->fk_skill]->description = $sk->description;
$Tab[$sk->fk_skill]->how_many_max2 = $sk->how_many_max;
}
return $Tab;
@ -436,12 +452,16 @@ function displayUsersListWithPicto(&$TUser, $fk_usergroup = 0, $namelist = 'list
$user->fetch($obj->rowid);
$name = $user->getFullName($langs);
if (empty($name)) $name = $user->login;
if (empty($name)) {
$name = $user->login;
}
if (in_array($user->id, $TExcludedId)) {
$class .= ' disabled';
} else {
if (!in_array($user->id, $TUser)) $TUser[] = $user->id;
if (!in_array($user->id, $TUser)) {
$TUser[] = $user->id;
}
}
$desc = '';
@ -458,7 +478,9 @@ function displayUsersListWithPicto(&$TUser, $fk_usergroup = 0, $namelist = 'list
$desc .= $langs->trans('NoEval');
}
if (!empty($user->array_options['options_DDA'])) $desc .= '<br>' . $langs->trans('Anciennete') . ' : ' . dol_print_date(strtotime($user->array_options['options_DDA']));
if (!empty($user->array_options['options_DDA'])) {
$desc .= '<br>' . $langs->trans('Anciennete') . ' : ' . dol_print_date(strtotime($user->array_options['options_DDA']));
}
$out .= '<li fk_user="' . $user->id . '" class="' . $class . '">
' . $form->showphoto('userphoto', $user, 0, 0, 0, 'photoref', 'small', 1, 0, 1) . '
@ -486,7 +508,9 @@ function getSkillForUsers($TUser)
global $db;
//I go back to the user with the highest score in a given group for all the skills assessed in that group
if (empty($TUser)) return array();
if (empty($TUser)) {
return array();
}
$sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill, ';
$sql.= ' MAX(sr.rankorder) as rankorder';
@ -502,7 +526,7 @@ function getSkillForUsers($TUser)
if ($resql) {
//For each skill, we count the number of times that the max score has been reached within a given group
$num = 0;
while ($obj = $db->fetch_object($resql) ) {
while ($obj = $db->fetch_object($resql)) {
$sql1 = "SELECT COUNT(rowid) as how_many_max FROM ".MAIN_DB_PREFIX."hrm_skillrank as sr";
$sql1.=" WHERE sr.rankorder = ".((int) $obj->rankorder);
$sql1.=" AND sr.objecttype = '".$db->escape(SkillRank::SKILLRANK_TYPE_USER)."'";
@ -541,7 +565,9 @@ function getSkillForJob($fk_job)
{
global $db;
if (empty($fk_job)) return array();
if (empty($fk_job)) {
return array();
}
$sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill,';
$sql.= " MAX(sr.rankorder) as rankorder";
@ -556,7 +582,7 @@ function getSkillForJob($fk_job)
if ($resql) {
$num = 0;
while ($obj = $db->fetch_object($resql) ) {
while ($obj = $db->fetch_object($resql)) {
$Tab[$num] = new stdClass();
$Tab[$num]->fk_skill = $obj->fk_skill;
$Tab[$num]->label = $obj->label;

View File

@ -62,7 +62,7 @@ $coldisplay = 0;
<!-- BEGIN PHP TEMPLATE htm/core/tpl/objectline_view.tpl.php -->
<tr id="row-<?php print $line->id?>" class="drag drop oddeven" <?php print $domData; ?> >
<?php if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { ?>
<td class="linecolnum center"><span class="opacitymedium"><?php $coldisplay++; ?><?php print ($i + 1); ?></span></td>
<td class="linecolnum center"><span class="opacitymedium"><?php $coldisplay++; ?><?php print($i + 1); ?></span></td>
<?php } ?>
<td class="linecollabel"><?php $coldisplay++; ?><div id="line_<?php print $line->id; ?>"></div>
<?php
@ -119,22 +119,22 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin
/*
if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) {
print '<td class="linecolmove tdlineupdown center">';
$coldisplay++;
if ($i > 0) { ?>
<a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
<?php print img_up('default', 0, 'imgupforline'); ?>
</a>
<?php }
if ($i < $num - 1) { ?>
<a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
<?php print img_down('default', 0, 'imgdownforline'); ?>
</a>
<?php }
print '</td>';
print '<td class="linecolmove tdlineupdown center">';
$coldisplay++;
if ($i > 0) { ?>
<a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
<?php print img_up('default', 0, 'imgupforline'); ?>
</a>
<?php }
if ($i < $num - 1) { ?>
<a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
<?php print img_down('default', 0, 'imgdownforline'); ?>
</a>
<?php }
print '</td>';
} else {
print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'></td>';
$coldisplay++;
print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'></td>';
$coldisplay++;
}*/
} else {
//print '<td colspan="3"></td>';

View File

@ -62,8 +62,12 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0);
if (!isModEnabled('hrm')) accessforbidden();
if (empty($permissiontoread)) accessforbidden();
if (!isModEnabled('hrm')) {
accessforbidden();
}
if (empty($permissiontoread)) {
accessforbidden();
}
/*
@ -96,7 +100,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
$object->status = GETPOST('status', 'int');
$object->fk_user_author = $user->id;
$object->datec = dol_now();
$object->entity = GETPOST('entity', 'int') > 0 ?GETPOST('entity', 'int') : $conf->entity;
$object->entity = GETPOST('entity', 'int') > 0 ? GETPOST('entity', 'int') : $conf->entity;
$id = $object->create($user);
@ -132,7 +136,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
$object->country_id = GETPOST('country_id', 'int');
$object->fk_user_mod = $user->id;
$object->status = GETPOST('status', 'int');
$object->entity = GETPOST('entity', 'int') > 0 ?GETPOST('entity', 'int') : $conf->entity;
$object->entity = GETPOST('entity', 'int') > 0 ? GETPOST('entity', 'int') : $conf->entity;
$result = $object->update($user);

View File

@ -42,11 +42,11 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_agenda_label = GETPOST('search_agenda_label');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@ -86,8 +86,12 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
if (!isModEnabled('hrm')) accessforbidden();
if (empty($permissiontoread)) accessforbidden();
if (!isModEnabled('hrm')) {
accessforbidden();
}
if (empty($permissiontoread)) {
accessforbidden();
}
/*
@ -178,20 +182,20 @@ if ($object->id > 0) {
}
}
}*/
$morehtmlref .= '</div>';
$morehtmlref .= '</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
$object->info($object->id);
dol_print_object_info($object, 1);
$object->info($object->id);
dol_print_object_info($object, 1);
print '</div>';
print '</div>';
print dol_get_fiche_end();
print dol_get_fiche_end();
}

View File

@ -101,7 +101,9 @@ $permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include
if (!isModEnabled('hrm')) {
accessforbidden();
}
if (!$permissiontoread) accessforbidden();
if (!$permissiontoread) {
accessforbidden();
}
/*

View File

@ -97,7 +97,9 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti
if (!isModEnabled("hrm")) {
accessforbidden();
}
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) {
accessforbidden();
}
/*
@ -210,7 +212,7 @@ if (empty($reshook)) {
}
}
if ($action == 'reopen' ) {
if ($action == 'reopen') {
// no update here we just change the evaluation status
$object->setStatut(Evaluation::STATUS_VALIDATED);
}
@ -611,9 +613,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
print '</table>';
print '</div>';
?>
print '</div>'; ?>
<script>

View File

@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
$langs->loadLangs(array('hrm', 'companies', 'other', 'mails'));
// Get Parameters
$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha');
$lineid = GETPOST('lineid', 'int');
$socid = GETPOST('socid', 'int');

View File

@ -89,8 +89,12 @@ $permissiontoread = $user->rights->hrm->evaluation->read;
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*
@ -121,7 +125,7 @@ if ($object->id) {
// Build file list
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];

View File

@ -43,7 +43,7 @@ require_once __DIR__.'/class/evaluation.class.php';
$langs->loadLangs(array('hrm', 'other'));
// Get Parameters
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
@ -145,13 +145,17 @@ if (!isModEnabled('hrm')) {
}
// Security check (enable the most restrictive one)
if ($user->socid > 0) accessforbidden();
if ($user->socid > 0) {
accessforbidden();
}
//if ($user->socid > 0) accessforbidden();
//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
//if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (!$permissiontoread) {
accessforbidden();
}

View File

@ -96,8 +96,12 @@ $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of ac
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*

View File

@ -88,8 +88,12 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) {
accessforbidden();
}
/*
@ -437,9 +441,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (empty($reshook)) {
$object->formAddObjectLine(1, $mysoc, $soc);
}
}
}

View File

@ -88,8 +88,12 @@ $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of act
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*
@ -120,7 +124,7 @@ if ($object->id) {
// Build file list
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];

View File

@ -43,7 +43,7 @@ require_once __DIR__.'/class/job.class.php';
$langs->loadLangs(array('hrm', 'other'));
// Get Parameters
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
@ -138,7 +138,9 @@ $permissiontoadd = $user->rights->hrm->all->write;
$permissiontodelete = $user->rights->hrm->all->delete;
// Security check (enable the most restrictive one)
if ($user->socid > 0) accessforbidden();
if ($user->socid > 0) {
accessforbidden();
}
//if ($user->socid > 0) accessforbidden();
//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
@ -146,7 +148,9 @@ if ($user->socid > 0) accessforbidden();
if (!isModEnabled('hrm')) {
accessforbidden('Module hrm not enabled');
}
if (!$permissiontoread) accessforbidden();
if (!$permissiontoread) {
accessforbidden();
}

View File

@ -67,8 +67,12 @@ $permissionnote = $user->rights->hrm->all->write; // Used by the include of acti
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*

View File

@ -118,7 +118,9 @@ function displayRankInfos($selected_rank, $fk_skill, $inputname = 'TNote', $mode
if (!is_array($Lines) && $Lines<0) {
setEventMessages($skilldet->error, $skilldet->errors, 'errors');
}
if (empty($Lines)) return $langs->trans('SkillHasNoLines');
if (empty($Lines)) {
return $langs->trans('SkillHasNoLines');
}
$ret = '<!-- field jquery --><span title="'.$langs->trans('NA').'" class="radio_js_bloc_number '.$inputname.'_'.$fk_skill.(empty($selected_rank) ? ' selected' : '').'">';
$ret .= $langs->trans('NA');

View File

@ -218,7 +218,7 @@ if (empty($reshook)) {
}
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
}
// Mass actions

View File

@ -99,8 +99,12 @@ $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of act
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*

View File

@ -63,8 +63,12 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) {
accessforbidden();
}
$langs->loadLangs(array("hrm", "other"));

View File

@ -88,8 +88,12 @@ $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of ac
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*
@ -120,7 +124,7 @@ if ($object->id) {
// Build file list
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];

View File

@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php';
$langs->loadLangs(array('hrm', 'other'));
// Get Parameters
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
@ -139,7 +139,9 @@ $permissiontoadd = $user->rights->hrm->all->write;
$permissiontodelete = $user->rights->hrm->all->delete;
// Security check (enable the most restrictive one)
if ($user->socid > 0) accessforbidden();
if ($user->socid > 0) {
accessforbidden();
}
//if ($user->socid > 0) accessforbidden();
//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
@ -147,7 +149,9 @@ if ($user->socid > 0) accessforbidden();
if (!isModEnabled('hrm')) {
accessforbidden('Module hrm not enabled');
}
if (!$permissiontoread) accessforbidden();
if (!$permissiontoread) {
accessforbidden();
}

View File

@ -65,8 +65,12 @@ $permissiontoread = $user->rights->hrm->all->read; // Used by the include of act
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*

View File

@ -98,8 +98,12 @@ $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of act
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*

View File

@ -208,7 +208,7 @@ if ($action == 'create') {
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="action" value="add">';
$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?' ) ."objecttype=job";
$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?') ."objecttype=job";
if ($backtopage) {
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
}
@ -314,7 +314,7 @@ if (($id || $ref) && $action == 'edit') {
// if (!empty($val['help'])) {
// print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help']));
// } else {
print $langs->trans($val['label']).'&nbsp;'.$langs->trans('rank').'&nbsp;'.$sk->rankorder;
print $langs->trans($val['label']).'&nbsp;'.$langs->trans('rank').'&nbsp;'.$sk->rankorder;
// }
print '</td>';
print '<td class="valuefieldcreate">';
@ -333,7 +333,7 @@ if (($id || $ref) && $action == 'edit') {
$check = 'restricthtml';
}
$skilldetArray = GETPOST("descriptionline", "array");
$skilldetArray = GETPOST("descriptionline", "array");
if (empty($skilldetArray)) {
$value = GETPOSTISSET($key) ? GETPOST($key, $check) : $sk->$key;
} else {
@ -626,7 +626,7 @@ if ($action != "create" && $action != "edit") {
print '<input type="hidden" name="id" value="' . $id . '">';
}
$param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . (!empty($user->rowid) ? $user->rowid :0);
$param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . (!empty($user->rowid) ? $user->rowid : 0);
$backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . $id;
$param = "";
$massactionbutton = "";
@ -816,7 +816,9 @@ if ($action != "create" && $action != "edit") {
print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
}
if (!empty($resql)) $db->free($resql);
if (!empty($resql)) {
$db->free($resql);
}
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook

View File

@ -88,8 +88,12 @@ $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of ac
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*
@ -120,7 +124,7 @@ if ($object->id) {
// Build file list
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];

View File

@ -44,7 +44,7 @@ $langs->loadLangs(array('hrm', 'other'));
// Get Parameters
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
@ -151,13 +151,17 @@ if (!isModEnabled('hrm')) {
}
// Security check (enable the most restrictive one)
if ($user->socid > 0) accessforbidden();
if ($user->socid > 0) {
accessforbidden();
}
//if ($user->socid > 0) accessforbidden();
//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
//if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (!$permissiontoread) {
accessforbidden();
}

View File

@ -65,8 +65,12 @@ $permissiontoread = $user->rights->hrm->all->read; // Used by the include of act
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
if (empty($conf->hrm->enabled)) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*

View File

@ -147,10 +147,14 @@ if (empty($reshook)) {
$skillAdded->fk_object = $id;
$skillAdded->objecttype = $objecttype;
$ret = $skillAdded->create($user);
if ($ret < 0) setEventMessages($skillAdded->error, null, 'errors');
if ($ret < 0) {
setEventMessages($skillAdded->error, null, 'errors');
}
//else unset($TSkillsToAdd);
}
if ($ret > 0) setEventMessages($langs->trans("SaveAddSkill"), null);
if ($ret > 0) {
setEventMessages($langs->trans("SaveAddSkill"), null);
}
}
} elseif ($action == 'saveSkill') {
if (!empty($TNote)) {
@ -445,9 +449,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
print '</table>';
if ($objecttype != 'user' && $permissiontoadd) print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>';
if ($objecttype != 'user' && $permissiontoadd) {
print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>';
}
print '</div>';
if ($objecttype != 'user' && $permissiontoadd) print '</form>';
if ($objecttype != 'user' && $permissiontoadd) {
print '</form>';
}
}

View File

@ -274,13 +274,16 @@ class Import
// Check parameters
if (empty($this->model_name)) {
$this->error = 'ErrorWrongParameters'; return -1;
$this->error = 'ErrorWrongParameters';
return -1;
}
if (empty($this->datatoimport)) {
$this->error = 'ErrorWrongParameters'; return -1;
$this->error = 'ErrorWrongParameters';
return -1;
}
if (empty($this->hexa)) {
$this->error = 'ErrorWrongParameters'; return -1;
$this->error = 'ErrorWrongParameters';
return -1;
}
$this->db->begin();
@ -362,7 +365,8 @@ class Import
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->errors[] = "Error ".$this->db->lasterror();
$error++;
$this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {

View File

@ -1201,7 +1201,7 @@ if ($step == 4 && $datatoimport) {
}
}
// Source required
$example = !empty($objimport->array_import_examplevalues[0][$tmpcode])?$objimport->array_import_examplevalues[0][$tmpcode]:"";
$example = !empty($objimport->array_import_examplevalues[0][$tmpcode]) ? $objimport->array_import_examplevalues[0][$tmpcode] : "";
// Example
if (empty($objimport->array_import_convertvalue[0][$tmpcode])) { // If source file does not need convertion
if ($example) {
@ -1867,7 +1867,8 @@ if ($step == 5 && $datatoimport) {
if ($result > 0) {
global $tablewithentity_cache;
$tablewithentity_cache = array();
$sourcelinenb = 0; $endoffile = 0;
$sourcelinenb = 0;
$endoffile = 0;
// Loop on each input file record
while (($sourcelinenb < $nboflines) && !$endoffile) {
@ -2279,7 +2280,8 @@ if ($step == 6 && $datatoimport) {
if ($result > 0) {
global $tablewithentity_cache;
$tablewithentity_cache = array();
$sourcelinenb = 0; $endoffile = 0;
$sourcelinenb = 0;
$endoffile = 0;
while ($sourcelinenb < $nboflines && !$endoffile) {
$sourcelinenb++;