';
$filearray = dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ?SORT_ASC:SORT_DESC), 1);
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousArchiveFiles"));
diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php
index c8a2a02498c..d21622d1f68 100644
--- a/htdocs/admin/tools/export.php
+++ b/htdocs/admin/tools/export.php
@@ -216,8 +216,7 @@ if ($errormsg) {
}*/
}
+$db->close();
// Redirect to backup page
header("Location: dolibarr_export.php".(GETPOST('page_y', 'int') ? '?page_y='.GETPOST('page_y', 'int') : ''));
-
-$db->close();
diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php
index ec2ad4a815a..0b9272c2418 100644
--- a/htdocs/admin/tools/export_files.php
+++ b/htdocs/admin/tools/export_files.php
@@ -127,10 +127,34 @@ $result = dol_mkdir($outputdir);
$utils = new Utils($db);
+if ($export_type == 'externalmodule' && ! empty($what)) {
+ $fulldirtocompress = DOL_DOCUMENT_ROOT.'/custom/'.dol_sanitizeFileName($what);
+} else {
+ $fulldirtocompress = DOL_DATA_ROOT;
+}
+$dirtoswitch = dirname($fulldirtocompress);
+$dirtocompress = basename($fulldirtocompress);
+
if ($compression == 'zip') {
$file .= '.zip';
$excludefiles = '/(\.back|\.old|\.log|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i';
- $ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, $excludefiles);
+
+ //var_dump($fulldirtocompress);
+ //var_dump($outputdir."/".$file);exit;
+
+ $rootdirinzip = '';
+ if ($export_type == 'externalmodule' && !empty($what)) {
+ $rootdirinzip = $what;
+
+ global $dolibarr_allow_download_external_modules;
+ if (empty($dolibarr_allow_download_external_modules)) {
+ print 'Download of external modules is not allowed by $dolibarr_allow_download_external_modules in conf.php file';
+ $db->close();
+ exit();
+ }
+ }
+
+ $ret = dol_compress_dir($fulldirtocompress, $outputdir."/".$file, $compression, $excludefiles, $rootdirinzip);
if ($ret < 0) {
if ($ret == -2) {
$langs->load("errors");
@@ -146,10 +170,12 @@ if ($compression == 'zip') {
$outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method
$file .= '.tar';
- // We also exclude '/temp/' dir and 'documents/admin/documents'
- $cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude 'dolibarr_*.log' --exclude 'documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT);
- $result = $utils->executeCLI($cmd, $outputfile);
+ // We also exclude '/temp/' dir and 'documents/admin/documents'
+ // We make escapement here and call executeCLI without escapement because we don't want to have the '*.log' escaped.
+ $cmd = "tar -cf ".escapeshellcmd($outputdir."/".$file)." --exclude-vcs --exclude-caches-all --exclude='temp' --exclude='*.log' --exclude='documents/admin/documents' -C '".escapeshellcmd(dol_sanitizePathName($dirtoswitch))."' '".escapeshellcmd(dol_sanitizeFileName($dirtocompress))."'";
+
+ $result = $utils->executeCLI($cmd, $outputfile, 0, null, 1);
$retval = $result['error'];
if ($result['result'] || !empty($retval)) {
@@ -173,15 +199,37 @@ if ($compression == 'zip') {
unlink($outputdir."/".$file);
}
}
+} else {
+ $errormsg = 'Bad value for compression method';
+ print $errormsg;
}
-if ($errormsg) {
- setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors');
+if ($export_type != 'externalmodule' || empty($what)) {
+ if ($errormsg) {
+ setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors');
+ } else {
+ setEventMessages($langs->trans("BackupFileSuccessfullyCreated").'.
'.$langs->trans("YouCanDownloadBackupFile"), null, 'mesgs');
+ }
+
+ $db->close();
+
+ // Redirect to calling page
+ $returnto = 'dolibarr_export.php';
+
+ header("Location: ".$returnto);
+ exit();
+} else {
+ $zipname = $outputdir."/".$file;
+
+ // Then download the zipped file.
+ header('Content-Type: application/zip');
+ header('Content-disposition: attachment; filename='.basename($zipname));
+ header('Content-Length: '.filesize($zipname));
+ readfile($zipname);
+
+ dol_delete_file($zipname);
+
+ $db->close();
+
+ exit();
}
-
-// Redirect t backup page
-header("Location: dolibarr_export.php");
-
-$time_end = time();
-
-$db->close();
diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php
index 855505a40ec..1f821bf733b 100644
--- a/htdocs/compta/accounting-files.php
+++ b/htdocs/compta/accounting-files.php
@@ -499,7 +499,7 @@ if ($result && $action == "dl" && !$error) {
$zip->addFromString('transactions.csv', $log);
$zip->close();
- ///Then download the zipped file.
+ // Then download the zipped file.
header('Content-Type: application/zip');
header('Content-disposition: attachment; filename='.basename($zipname));
header('Content-Length: '.filesize($zipname));
diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index 7f70a447c38..2e6ac4b6174 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -1066,7 +1066,7 @@ if ($action == 'create') {
// Autogeneration
$title = $langs->trans("Recurrence");
- print load_fiche_titre('
'.$title, '', '');
+ print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', '');
print dol_get_fiche_head(null, '', '', 0);
@@ -1455,7 +1455,7 @@ if ($action == 'create') {
print '
';
- print ' '.$title.' ';
+ print ''.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.' ';
// if "frequency" is empty or = 0, the reccurence is disabled
print '';
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index 12f554f4c5c..9619e1a9ddd 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -141,7 +141,7 @@ $arrayfields = array(
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>1),
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0),
'f.fk_cond_reglement'=>array('label'=>"PaymentTerm", 'checked'=>0),
- 'recurring'=>array('label'=>"RecurringInvoiceTemplate", 'checked'=>1),
+ 'recurring'=>array('label'=>"RecurringInvoice", 'checked'=>1),
'f.frequency'=>array('label'=>"Frequency", 'checked'=>1),
'f.unit_frequency'=>array('label'=>"FrequencyUnit", 'checked'=>1),
'f.nb_gen_done'=>array('label'=>"NbOfGenerationDoneShort", 'checked'=>1),
@@ -359,7 +359,11 @@ if ($search_date_when_end) {
$sql .= " AND f.date_when <= '".$db->idate($search_date_when_end)."'";
}
-$sql .= $db->order($sortfield, $sortorder);
+$tmpsortfield = $sortfield;
+if ($tmpsortfield == 'recurring') {
+ $tmpsortfield = 'f.frequency';
+}
+$sql .= $db->order($tmpsortfield, $sortorder);
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
@@ -773,8 +777,9 @@ if ($resql) {
$totalarray['nbfield']++;
}
}
+ // Is it a recurring invoice
if (!empty($arrayfields['recurring']['checked'])) {
- print ' '.yn($objp->frequency ? 1 : 0).' ';
+ print ''.($objp->frequency ? img_picto($langs->trans("Frequency").': '.$objp->frequency.' '.$objp->unit_frequency, 'recurring', 'class="opacitymedium"').' ' : '').yn($objp->frequency ? 1 : 0).' ';
if (!$i) {
$totalarray['nbfield']++;
}
diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example
index 71f0a82e32f..7bb58d6b701 100644
--- a/htdocs/conf/conf.php.example
+++ b/htdocs/conf/conf.php.example
@@ -331,6 +331,12 @@ $dolibarr_cron_allow_cli='0';
// Examples:
// $dolibarr_strict_mode=0;
+// dolibarr_allow_download_external_modules
+// Provide a link to download the zip of an external modules installed into custom directory from the web admin.
+// Default value: 0
+// Examples:
+// $dolibarr_allow_download_external_modules=0;
+
//#################################
diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php
index fad5b67cf27..cdbda7a17b8 100644
--- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php
@@ -46,7 +46,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
?>
trans("Contract"); ?>
- getNomUrl(1); ?>
+ getNomUrl(1); ?>
date_contrat, 'day'); ?>
global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : 'common';
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$mode;
if ($nbofactivatedmodules <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only minimal initial modules enabled)
- $head[$h][1] = $form->textwithpicto($langs->trans("AvailableModules"), $desc);
- $head[$h][1] .= img_warning($langs->trans("YouMustEnableOneModule"));
+ //$head[$h][1] = $form->textwithpicto($langs->trans("AvailableModules"), $desc);
+ $head[$h][1] = $langs->trans("AvailableModules");
+ $head[$h][1] .= $form->textwithpicto('', $langs->trans("YouMustEnableOneModule").'.'.$desc.' ', 1, warning);
} else {
//$head[$h][1] = $langs->trans("AvailableModules").$form->textwithpicto(''.$nbofactivatedmodules.' / '.$nboftotalmodules.' ', $desc, 1, 'help', '', 1, 3);
$head[$h][1] = $langs->trans("AvailableModules").''.$nbofactivatedmodules.' / '.$nboftotalmodules.' ';
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 2bd4ada3ad0..7312faf6b5e 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -2004,11 +2004,15 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring
// Skip directories (they would be added automatically)
if (!$file->isDir()) {
// Get real and relative path for current file
- $filePath = $file->getRealPath();
- $relativePath = substr($filePath, strlen($rootPath) + 1);
+ $filePath = $file->getPath(); // the full path with filename using the $inputdir root.
+ $fileName = $file->getFilename();
+ $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory.
+
+ //$relativePath = substr($fileFullRealPath, strlen($rootPath) + 1);
+ $relativePath = substr(($filePath ? $filePath.'/' : '').$fileName, strlen($rootPath) + 1);
// Add current file to archive
- $zip->addFile($filePath, $relativePath);
+ $zip->addFile($fileFullRealPath, $relativePath);
}
}
@@ -2196,22 +2200,29 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles =
}
// Create recursive directory iterator
+ // This does not return symbolic links
/** @var SplFileInfo[] $files */
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($inputdir),
RecursiveIteratorIterator::LEAVES_ONLY
);
+ //var_dump($inputdir);
foreach ($files as $name => $file) {
// Skip directories (they would be added automatically)
if (!$file->isDir()) {
// Get real and relative path for current file
- $filePath = $file->getRealPath();
- $relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($filePath, strlen($inputdir) + 1);
+ $filePath = $file->getPath(); // the full path with filename using the $inputdir root.
+ $fileName = $file->getFilename();
+ $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory.
- if (empty($excludefiles) || !preg_match($excludefiles, $filePath)) {
+ //$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($fileFullRealPath, strlen($inputdir) + 1);
+ $relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr(($filePath ? $filePath.'/' : '').$fileName, strlen($inputdir) + 1);
+
+ //var_dump($filePath);var_dump($fileFullRealPath);var_dump($relativePath);
+ if (empty($excludefiles) || !preg_match($excludefiles, $fileFullRealPath)) {
// Add current file to archive
- $zip->addFile($filePath, $relativePath);
+ $zip->addFile($fileFullRealPath, $relativePath);
}
}
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 5fdc9ea155b..36e6f300819 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -835,7 +835,7 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options =
$out = dol_string_onlythesehtmltags($out, 0, 1, 1);
- // We should also exclude non expected attributes
+ // We should also exclude non expected HTML attributes and clean content of some attributes.
if (!empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)) {
// Warning, the function may add a LF so we are forced to trim to compare with old $out without having always a difference and an infinit loop.
$out = trim(dol_string_onlythesehtmlattributes($out));
@@ -3649,7 +3649,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'salary', 'shipment', 'state', 'supplier_invoice', 'supplier_invoicea', 'supplier_invoicer', 'supplier_invoiced',
'technic', 'ticket',
'error', 'warning',
- 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource',
+ 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'recurring',
'shapes', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
'uncheck', 'user-cog', 'vat', 'website', 'workstation',
@@ -3695,7 +3695,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'partnership'=>'handshake', 'payment'=>'money-check-alt', 'payment_vat'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
- 'refresh'=>'redo', 'region'=>'map-marked', 'resource'=>'laptop-house',
+ 'refresh'=>'redo', 'region'=>'map-marked', 'resource'=>'laptop-house', 'recurring'=>'history',
'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s',
'supplier'=>'building', 'technic'=>'cogs',
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
@@ -6476,9 +6476,27 @@ function dol_string_onlythesehtmlattributes($stringtoclean, $allowed_attributes
if (is_object($dom)) {
for ($els = $dom->getElementsByTagname('*'), $i = $els->length - 1; $i >= 0; $i--) {
for ($attrs = $els->item($i)->attributes, $ii = $attrs->length - 1; $ii >= 0; $ii--) {
- // Delete attribute if not into allowed_attributes
- if (! empty($attrs->item($ii)->name) && ! in_array($attrs->item($ii)->name, $allowed_attributes)) {
- $els->item($i)->removeAttribute($attrs->item($ii)->name);
+ //var_dump($attrs->item($ii));
+ if (! empty($attrs->item($ii)->name)) {
+ // Delete attribute if not into allowed_attributes
+ if (! in_array($attrs->item($ii)->name, $allowed_attributes)) {
+ $els->item($i)->removeAttribute($attrs->item($ii)->name);
+ } elseif (in_array($attrs->item($ii)->name, array('style'))) {
+ $valuetoclean = $attrs->item($ii)->value;
+
+ do {
+ $oldvaluetoclean = $valuetoclean;
+ $valuetoclean = preg_replace('/\/\*.*\*\//m', '', $valuetoclean); // clean css comments
+ $valuetoclean = preg_replace('/position\s*:\s*[a-z]+/mi', '', $valuetoclean);
+ if ($els->item($i)->tagName == 'a') { // more paranoiac cleaning for clickable tags.
+ $valuetoclean = preg_replace('/display\s*://m', '', $valuetoclean);
+ $valuetoclean = preg_replace('/z-index\s*://m', '', $valuetoclean);
+ $valuetoclean = preg_replace('/\s+(top|left|right|bottom)\s*://m', '', $valuetoclean);
+ }
+ } while ($oldvaluetoclean != $valuetoclean);
+
+ $attrs->item($ii)->value = $valuetoclean;
+ }
}
}
}
diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php
index 557bbe6dcf5..032d567d35b 100644
--- a/htdocs/core/lib/memory.lib.php
+++ b/htdocs/core/lib/memory.lib.php
@@ -93,7 +93,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
$dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists
$rescode = $dolmemcache->getResultCode();
if ($rescode == 0) {
- return is_countable($data) ? count($data) : 0;
+ return is_array($data) ? count($data) : 0;
} else {
return -$rescode;
}
@@ -113,7 +113,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
$result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists
if ($result) {
- return is_countable($data) ? count($data) : 0;
+ return is_array($data) ? count($data) : 0;
} else {
return -1;
}
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 07ecf19de63..8f73eb5a88c 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1793,6 +1793,31 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->user->user->lire, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
$newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->user->user->creer);
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->user->user->lire);
+
+ $newmenu->add("/hrm/index.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillsManagement"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
+
+ if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm_sm") {
+ // Skills
+ $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Skills"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="pictofixedwidth"'));
+ //$newmenu->add("/hrm/skill_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewSkill"), 1, $user->rights->hrm->all->write);
+ //$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
+
+ // Job (Description of work to do and skills required)
+ $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("JobsPosition"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'technic', 'class="pictofixedwidth"'));
+ //$newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->rights->hrm->all->write);
+ //$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
+
+ // Position = Link job - user
+ $newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("EmployeePositions"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user-cog', 'class="pictofixedwidth"'));
+ //$newmenu->add("/hrm/position.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Position")), 1, $user->rights->hrm->all->write);
+ //$newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
+
+ // Evaluation
+ $newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Evalutions"), 1, $user->rights->hrm->evaluation->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
+ //$newmenu->add("/hrm/evaluation_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewEval"), 1, $user->rights->hrm->evaluation->write);
+ //$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->evaluation->read);
+ $newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillComparison"), 1, $user->rights->hrm->evaluation->read || $user->rights->hrm->compare->read);
+ }
}
// Leave/Holiday/Vacation module
@@ -1850,29 +1875,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="pictofixedwidth"'));
}
}
-
- if (!empty($conf->hrm->enabled)) {
- // Skills
- $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("skill"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'shapes', 'class="pictofixedwidth"'));
- $newmenu->add("/hrm/skill_card.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->trans("NewSkill"), 1, $user->rights->hrm->all->write);
- $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
-
- // Job
- $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Job"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'technic', 'class="pictofixedwidth"'));
- $newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->rights->hrm->all->write);
- $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
-
- // Position
- $newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Position"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user-cog', 'class="pictofixedwidth"'));
- $newmenu->add("/hrm/position.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->transnoentities("NewObject", $langs->trans("Position")), 1, $user->rights->hrm->all->write);
- $newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
-
- // Evaluation
- $newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Eval"), 0, $user->rights->hrm->evaluation->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
- $newmenu->add("/hrm/evaluation_card.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->trans("NewEval"), 1, $user->rights->hrm->evaluation->write);
- $newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->evaluation->read);
- $newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Compare"), 1, $user->rights->hrm->compare->read);
- }
}
diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
index 08d31e3cd95..3ba612c7ed3 100644
--- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
+++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
@@ -176,7 +176,9 @@ class doc_generic_bom_odt extends ModelePDFBom
$texte .= ' ';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= ' ';
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index 1e6aeac79e5..ecfa3075fbd 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -189,7 +189,9 @@ class doc_generic_order_odt extends ModelePDFCommandes
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
index a640d342ddc..41a442fc5df 100644
--- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
+++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
@@ -174,7 +174,9 @@ class doc_generic_contract_odt extends ModelePDFContract
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index c504d97a854..9affbcda6e4 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -187,7 +187,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index ef20b4ff389..ecd645b3796 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -186,7 +186,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
index 593986d4b7d..c466b52af05 100644
--- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
+++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
@@ -176,7 +176,9 @@ class doc_generic_member_odt extends ModelePDFMember
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php
index b13e5b6bbba..8feb6bd7ac0 100644
--- a/htdocs/core/modules/modHRM.class.php
+++ b/htdocs/core/modules/modHRM.class.php
@@ -196,21 +196,21 @@ class modHRM extends DolibarrModules
$r = 0;
// Skill / Job / Position
- $this->rights[$r][0] = 4010; // Permission id (must not be already used)
+ $this->rights[$r][0] = 4001; // Permission id (must not be already used)
$this->rights[$r][1] = 'Read skill/job/position'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'all';
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->all->read)
$r++;
- $this->rights[$r][0] = 4011; // Permission id (must not be already used)
+ $this->rights[$r][0] = 4002; // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/modify skill/job/position'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'all';
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->all->write)
$r++;
- $this->rights[$r][0] = 4012; // Permission id (must not be already used)
+ $this->rights[$r][0] = 4003; // Permission id (must not be already used)
$this->rights[$r][1] = 'Delete skill/job/position'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'all';
@@ -226,7 +226,7 @@ class modHRM extends DolibarrModules
$r++;
$this->rights[$r][0] = 4021; // Permission id (must not be already used)
- $this->rights[$r][1] = 'Create/modify your own evaluation'; // Permission label
+ $this->rights[$r][1] = 'Create/modify your evaluation'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'evaluation';
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->write)
@@ -240,7 +240,7 @@ class modHRM extends DolibarrModules
$r++;
$this->rights[$r][0] = 4023; // Permission id (must not be already used)
- $this->rights[$r][1] = 'Delete all evaluations'; // Permission label
+ $this->rights[$r][1] = 'Delete evaluations'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'evaluation';
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->delete)
diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
index c2d697b4a4d..e4cd4f69b46 100644
--- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
+++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
@@ -183,7 +183,9 @@ class doc_generic_mo_odt extends ModelePDFMo
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
index d702299769e..e59fcf4f8d5 100644
--- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
+++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
@@ -182,7 +182,9 @@ class doc_generic_product_odt extends ModelePDFProduct
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index f86f5b55a9c..a77ee9e33ab 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -474,7 +474,9 @@ class doc_generic_project_odt extends ModelePDFProjects
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index 3890c6526bc..dbfc7c22e90 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -441,7 +441,9 @@ class doc_generic_task_odt extends ModelePDFTask
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index fb0991c8da1..e54538507da 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -214,7 +214,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
index 4729231ac8b..7f59efc47ce 100644
--- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
+++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
@@ -181,7 +181,9 @@ class doc_generic_reception_odt extends ModelePdfReception
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
index 6427a6a60a3..26447005d01 100644
--- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
+++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
@@ -172,7 +172,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
index 1d02b8003da..6755be2e230 100644
--- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
+++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
@@ -185,7 +185,9 @@ class doc_generic_stock_odt extends ModelePDFStock
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
index dfb05d2d55f..6984f2ab200 100644
--- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
@@ -184,7 +184,9 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
index 18e5a210aa1..cff1ba4bd0e 100644
--- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
@@ -211,7 +211,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
index e20cbf44cf7..26d3657e8e2 100644
--- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
+++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
@@ -173,7 +173,9 @@ class doc_generic_ticket_odt extends ModelePDFTicket
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
index 050eb43d44a..0313e639b5f 100644
--- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
+++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
@@ -205,7 +205,9 @@ class doc_generic_user_odt extends ModelePDFUser
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
index a934c7a50d9..399e603b96a 100644
--- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
+++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
@@ -197,7 +197,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
$texte .= '';
$texte .= '';
+ $texte .= '';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte .= ' ';
$texte .= ' ';
$texte .= '';
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 7dbead5536b..e29b928140e 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -936,7 +936,7 @@ if ($resql) {
$moreforfilter .= '';
$tmptitle = $langs->trans('IncludingProductWithTag');
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
- $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
+ $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1);
$moreforfilter .= '
';
}
@@ -1367,11 +1367,11 @@ if ($resql) {
print '';
if (!empty($arrayfields['f.ref']['checked'])) {
- print '';
+ print ' ';
print '';
// Picto + Ref
- print '';
+ print ' ';
print $facturestatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
$filename = dol_sanitizeFileName($obj->ref);
diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php
index 478b267ac1f..0b247e7f5f4 100644
--- a/htdocs/hrm/class/skill.class.php
+++ b/htdocs/hrm/class/skill.class.php
@@ -241,29 +241,46 @@ class Skill extends CommonObject
}
/**
- * @param int $i rank from which we want to create skilldets
+ * createSkills
+ *
+ * @param int $i Rank from which we want to create skilldets (level $i to HRM_MAXRANK wil be created)
* @return null
*/
public function createSkills($i = 1)
{
-
global $conf, $user, $langs;
$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : self::DEFAULT_MAX_RANK_PER_SKILL;
$defaultSkillDesc = !empty($conf->global->HRM_DEFAULT_SKILL_DESCRIPTION) ? $conf->global->HRM_DEFAULT_SKILL_DESCRIPTION : 'no Description';
+
+ $error = 0;
+
require_once __DIR__ . '/skilldet.class.php';
+
+ $this->db->begin();
+
+ // Create level of skills
for ($i; $i <= $MaxNumberSkill ; $i++) {
$skilldet = new Skilldet($this->db);
- $skilldet->description = $defaultSkillDesc . " " . $i ;
- $skilldet->rank = $i;
+ $skilldet->description = $defaultSkillDesc . " " . $i;
+ $skilldet->rankorder = $i;
$skilldet->fk_skill = $this->id;
$result = $skilldet->create($user);
-
- if ($result > 0) {
- setEventMessage($langs->trans('TraductionCreadted'), $i);
+ if ($result <= 0) {
+ $error++;
}
}
+
+ if (! $error) {
+ $this->db->commit();
+
+ setEventMessage($langs->trans('SkillCreated'), $i);
+ return 1;
+ } else {
+ $this->db->rollback();
+ return -1;
+ }
}
/**
@@ -384,7 +401,7 @@ class Skill extends CommonObject
/**
* Load object lines in memory from the database
*
- * @return array|int <0 if KO, 0 if not found, array if OK
+ * @return array <0 if KO, array of skill level found
*/
public function fetchLines()
{
@@ -393,7 +410,7 @@ class Skill extends CommonObject
$skilldet = new Skilldet($this->db);
$this->lines = $skilldet->fetchAll('ASC', '', '', '', array('fk_skill' => $this->id), '');
- return (count($this->lines) > 0 ) ? $this->lines : 0;
+ return (count($this->lines) > 0 ) ? $this->lines : array();
}
diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php
index c3acdd0982e..0e0ce87382f 100644
--- a/htdocs/hrm/class/skilldet.class.php
+++ b/htdocs/hrm/class/skilldet.class.php
@@ -104,18 +104,18 @@ class Skilldet extends CommonObject
*/
public $fields=array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
- 'rankorder' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>2, 'notnull'=>0, 'visible'=>2,),
+ 'fk_skill' => array('type'=>'integer:Skill:/hrm/class/skill.class.php', 'label'=>'fk_skill', 'enabled'=>'1', 'position'=>5, 'notnull'=>1, 'visible'=>0,),
+ 'rankorder' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>10, 'notnull'=>0, 'visible'=>2,),
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,),
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>0,),
- 'fk_skill' => array('type'=>'integer:Skill:/hrm/class/skill.class.php', 'label'=>'fk_skill', 'enabled'=>'1', 'position'=>513, 'notnull'=>1, 'visible'=>0,),
);
public $rowid;
+ public $fk_skill;
+ public $rankorder;
public $description;
public $fk_user_creat;
public $fk_user_modif;
- public $fk_skill;
- public $rank;
// END MODULEBUILDER PROPERTIES
diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php
index 07097443628..dc641cb6d09 100644
--- a/htdocs/hrm/compare.php
+++ b/htdocs/hrm/compare.php
@@ -36,21 +36,25 @@
require_once '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-
-ini_set('display_errors', 1);
-
require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm.lib.php';
-$permissiontoread = $user->rights->hrm->compare->read;
+$permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare->read;
+$permissiontoadd = 0;
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
$langs->load('hrm');
+
+
+/*
+ * View
+ */
+
$css = array();
$css[] = '/hrm/css/style.css';
llxHeader('', $langs->trans('SkillComparison'), '', '', 0, 0, '', $css);
diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php
index 0b887667561..6bd777401f7 100644
--- a/htdocs/hrm/index.php
+++ b/htdocs/hrm/index.php
@@ -153,7 +153,7 @@ if (!empty($conf->holiday->enabled)) {
print '';
print ''.$langs->trans("Holidays").' ';
print '';
- print '';
+ print ' ';
$out = '';
$nb_holiday = 0;
@@ -163,8 +163,9 @@ if (!empty($conf->holiday->enabled)) {
$nb_holiday += $nb_type;
$out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': '.($nb_type ? price2num($nb_type) : 0).' ';
}
- print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).' ';
- print $out;
+ $balancetoshow = $langs->trans('SoldeCPUser', '{s1}');
+ print ''.str_replace('{s1}', img_picto('', 'holiday', 'class="paddingleft pictofixedwidth"').''.round($nb_holiday, 5).' ', $balancetoshow).'
';
+ print ''.$out.' ';
print ' ';
print ' ';
diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php
index 9c1821fb8d7..a352988c297 100644
--- a/htdocs/hrm/skill_agenda.php
+++ b/htdocs/hrm/skill_agenda.php
@@ -147,7 +147,7 @@ if ($object->id > 0) {
// Object card
// ------------------------------------------------------------
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
$morehtmlref = '';
$morehtmlref.= $object->label;
diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php
index 3c72b5478ce..6fa601249db 100644
--- a/htdocs/hrm/skill_card.php
+++ b/htdocs/hrm/skill_card.php
@@ -21,8 +21,8 @@
/**
* \file skill_card.php
- * \ingroup hrm
- * \brief Page to create/edit/view skill
+ * \ingroup hrm
+ * \brief Page to create/edit/view skill
*/
@@ -84,6 +84,8 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
+$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL;
+
/*
* Actions
@@ -98,14 +100,14 @@ if ($reshook < 0) {
if (empty($reshook)) {
$error = 0;
- $backurlforlist = dol_buildpath('/hrm/skill_list.php', 1);
+ $backurlforlist = DOL_URL_ROOT.'/hrm/skill_list.php';
if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
- $backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__');
}
}
}
@@ -166,8 +168,6 @@ if (empty($reshook)) {
/*
* View
- *
- * Put here all code to build page
*/
$form = new Form($db);
@@ -186,9 +186,9 @@ if ($action == 'create') {
print '
';
}
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 6acc4701c90..cb46a33f594 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -370,8 +370,7 @@ if (empty($reshook)) {
}
if ($result > 0) {
- header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
- exit;
+ $action = '';
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -1946,6 +1945,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print ''."\n";
print ' ';
print ' ';
+ print ' ';
}
print ''."\n";
@@ -1955,7 +1955,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print $form->select_dolgroups('', 'group', 1, $exclude, 0, '', '', $object->entity);
print ' ';
print ' ';
- print ' ';
+ print ' ';
}
print ''."\n";
@@ -1972,7 +1972,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '';
print '';
if ($caneditgroup) {
- print '';
+ print ' ';
print img_picto($langs->trans("RemoveFromGroup"), 'unlink');
print ' ';
} else {
diff --git a/htdocs/user/list.php b/htdocs/user/list.php
index e302a0fac85..c55fdeac682 100644
--- a/htdocs/user/list.php
+++ b/htdocs/user/list.php
@@ -726,7 +726,7 @@ if (!empty($arrayfields['u.tms']['checked'])) {
if (!empty($arrayfields['u.statut']['checked'])) {
// Status
print ' ';
- print $form->selectarray('search_statut', array('-1'=>'', '0'=>$langs->trans('Disabled'), '1'=>$langs->trans('Enabled')), $search_statut);
+ print $form->selectarray('search_statut', array('-1'=>'', '0'=>$langs->trans('Disabled'), '1'=>$langs->trans('Enabled')), $search_statut, 0, 0, 0, '', 0, 0, 0, '', 'minwidth50');
print ' ';
}
// Action column
diff --git a/test/phpunit/testvirus.txt b/test/phpunit/testvirus.txt
index 4a130462173..cef4658b70f 100644
--- a/test/phpunit/testvirus.txt
+++ b/test/phpunit/testvirus.txt
@@ -1,2 +1,2 @@
-# Remove this line and replace the ABC with X50 to get a file that is detected by antiviruses.
-ABC!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
\ No newline at end of file
+# Remove this line and replace the ABC with X5 to get a file that is detected by antiviruses.
+ABO!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
\ No newline at end of file