Compare commits

...

38 Commits

Author SHA1 Message Date
Laurent Destailleur
78ca968db6 Merge pull request #36517 from atm-florianm/SEC/commented-out-restrictedArea
SEC: FIX #36430 permissions not checked on other tabs of HRM evaluation card
2025-12-04 18:37:46 +01:00
atm-florian
a1476fd221 SEC: permissions not checked on other tabs of HRM evaluation card 2025-12-03 17:11:14 +01:00
Laurent Destailleur
908880c82c SEC: fix IDOR attack on employee evaluation. Missing permision test 7ed0af2a13
SEC: empty commit for CI automata
2025-11-26 15:41:53 +01:00
atm-florian
3608e9b102 SEC: 7ed0af2a13 2025-11-26 14:44:38 +01:00
Florian Mortgat
c2635f5242 FIX 17.0: perweek.php resets task progress to 0% when: (#36401)
* FIX 17.0: perweek.php resets task progress to 0% when:
1. the column "Declared real progress" is hidden (which means the corresponding form inputs won't be displayed)
2. and the user doesn't enter any time for that task (= leaves the input empty)

If the column is shown, the bug doesn't occur because the correct value is sent with $_POST.
If the user enters time, the bug doesn't occur because there is a GETPOSTISSET test for that case.

* Apply suggestion from @atm-florianm

variable name ($taskid vs $tmptaskid)
2025-11-24 16:32:27 +01:00
Laurent Destailleur
2935a245a3 Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-11-24 16:07:46 +01:00
Laurent Destailleur
5589ed71b2 Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2025-11-24 16:07:22 +01:00
Laurent Destailleur
32f160355b Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2025-11-24 16:03:52 +01:00
Florian Mortgat
5a61cc9393 FIX DA027383: permissions not checked on HRM evaluation card (#36328) (#36399)
Permissions involved:
- hrm->evaluation->readall: the user can view anyone's evaluations
- hrm->evaluation->read: the user can only view their or their subordinates' evaluations
2025-11-24 14:57:20 +01:00
Florian Mortgat
7ed0af2a13 FIX DA027383: permissions not checked on HRM evaluation card (#36328)
Permissions involved:
- hrm->evaluation->readall: the user can view anyone's evaluations
- hrm->evaluation->read: the user can only view their or their subordinates' evaluations
2025-11-24 12:21:51 +01:00
ldestailleur
9e8460c3dc Fix CI 2025-11-20 15:17:01 +01:00
ldestailleur
70f5e20572 Fix CI 2025-11-20 15:16:04 +01:00
lvessiller-opendsi
30ecf80732 FIX keep user who validate proposal on update (#36257) 2025-11-14 15:53:31 +01:00
Laurent Destailleur
99fe044868 Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-11-12 21:44:49 +01:00
Laurent Destailleur
8ae27c3a5f Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2025-11-12 21:44:34 +01:00
Frédéric FRANCE
5fa475a074 fix directory was always overwritten (#36148) 2025-11-07 18:43:26 +01:00
Florian Mortgat
a16f3bdf31 FIX 16.0: extrafield of type link to category causes SQL error in selectForFormsList() (#36074)
* FIX 16.0 (up to 19.0): extrafield of type link to category causes SQL error in selectForFormsList

* Apply suggestion from @atm-florianm
2025-11-04 13:06:58 +01:00
atm-GregM
dc7932700b Fix TICKET_ENABLE_PUBLIC_INTERFACE (#36073) 2025-11-04 12:25:57 +01:00
Laurent Destailleur
534d4ed4bc Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-11-03 13:49:06 +01:00
Laurent Destailleur
50b90d795c Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2025-11-03 13:48:51 +01:00
Laurent Destailleur
3209eb4bd8 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2025-11-03 13:46:49 +01:00
Marc de Lima Lucio
1f65548836 FIX: notifications: correctly report email delivery errors (#35864) 2025-10-20 23:53:07 +02:00
lvessiller-opendsi
5de1fcca2f FIX extra-field list depend on parent extra-filed list on direct edit (#35803) 2025-10-17 15:48:40 +02:00
lvessiller-opendsi
50afc9682b FIX create invoice from order using API and multi-entity (#35654)
* FIX create invoice from order using API and multi-entity

* FIX API not allow to access order in other entity on creating invoice from order

* Update api_invoices.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-10-06 13:56:50 +02:00
Marc de Lima Lucio
a3969c1d2c FIX: php 8+ warnings when creating deposits (#35582) 2025-10-01 16:21:05 +02:00
ldestailleur
d87ebbf926 Merge branch '17.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-09-25 11:55:28 +02:00
ldestailleur
08b105502e Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-09-25 11:55:21 +02:00
ldestailleur
bd2aba1a2f Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2025-09-25 11:54:59 +02:00
ldestailleur
a4601686a6 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2025-09-25 11:54:18 +02:00
lvessiller-opendsi
bcf6d6a7a2 FIX api orders : forward database error on failure (backpot commit d9e81cb) (#35478) 2025-09-25 11:47:51 +02:00
Dylan Bourdere
65a3b0893d fix undefined properties (#35435) 2025-09-22 20:31:50 +02:00
Dylan Bourdere
92454d671f rename tab name in comment of modulebuilder (#35431) 2025-09-22 12:11:32 +02:00
Frédéric FRANCE
f43f2909ff rule is deprecated (#35410) 2025-09-20 16:02:39 +02:00
Florian Mortgat
60f089c015 FIX 17.0: ContratLigne::fetch() returns 1 even if the line doesn't exist (#35324) 2025-09-12 15:19:20 +02:00
atm-lucas
7d898184b5 Modify condition display button (#35257) 2025-09-09 19:30:14 +02:00
lvessiller-opendsi
e818bf732d FIX extra field list depend on parent list when editing a card (#35165) 2025-09-01 19:55:00 +02:00
ldestailleur
347bf3e4d6 Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-08-07 16:14:00 +02:00
Maxime Kohlhaas
b3a2257638 Fix : contract line activation error when duration not defined (#34813)
* Fix : contract line activation error when duration not defined

* Fix of fix

* Update card.php

---------

Co-authored-by: x <x@x.x>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-08-06 21:22:47 +02:00
24 changed files with 132 additions and 67 deletions

View File

@@ -133,7 +133,7 @@
<rule ref="Generic.Formatting.SpaceAfterCast" />
<rule ref="Generic.Functions.CallTimePassByReference" />
<!-- <rule ref="Generic.Functions.CallTimePassByReference" /> -->
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />

View File

@@ -191,7 +191,6 @@ class Propal extends CommonObject
public $fin_validite;
public $user_author_id;
public $user_valid_id;
public $user_close_id;
/**
@@ -1456,7 +1455,9 @@ class Propal extends CommonObject
// Clear fields
$object->user_author = $user->id;
$object->user_valid = 0;
$object->user_validation_id = 0;
$object->date = $now;
$object->datep = $now; // deprecated
$object->fin_validite = $object->date + ($object->duree_validite * 24 * 3600);
@@ -1651,7 +1652,7 @@ class Propal extends CommonObject
$this->extraparams = (array) json_decode($obj->extraparams, true);
$this->user_author_id = $obj->fk_user_author;
$this->user_valid_id = $obj->fk_user_valid;
$this->user_validation_id = $obj->fk_user_valid;
$this->user_close_id = $obj->fk_user_cloture;
//Incoterms
@@ -1753,7 +1754,7 @@ class Propal extends CommonObject
$sql .= " total_ttc=".(isset($this->total_ttc) ? $this->total_ttc : "null").",";
$sql .= " fk_statut=".(isset($this->statut) ? $this->statut : "null").",";
$sql .= " fk_user_author=".(isset($this->user_author_id) ? $this->user_author_id : "null").",";
$sql .= " fk_user_valid=".(isset($this->user_valid) ? $this->user_valid : "null").",";
$sql .= " fk_user_valid = ".(!empty($this->user_validation_id) ? (int) $this->user_validation_id : "null").",";
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").",";
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
$sql .= " deposit_percent=".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null").",";
@@ -2046,7 +2047,7 @@ class Propal extends CommonObject
$this->ref = $num;
$this->brouillon = 0;
$this->statut = self::STATUS_VALIDATED;
$this->user_valid_id = $user->id;
$this->user_validation_id = $user->id;
$this->datev = $now;
$this->db->commit();
@@ -3321,9 +3322,7 @@ class Propal extends CommonObject
$this->user_creation = $cuser;
if ($obj->fk_user_valid) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
$this->user_validation_id = $obj->fk_user_valid;
}
if ($obj->fk_user_signature) {

View File

@@ -2872,7 +2872,7 @@ if ($action == 'create' && $usercancreate) {
// Create a purchase order
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_SALE_ORDER)) {
if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0) {
if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfProductsLines() > 0) {
if ($usercancreatepurchaseorder) {
print dolGetButtonAction('', $langs->trans('AddPurchaseOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id, '');
}

View File

@@ -1174,7 +1174,7 @@ class Commande extends CommonOrder
}
}
} else {
dol_print_error($this->db);
$this->error = $this->db->lasterror();
$this->db->rollback();
return -1;
}

View File

@@ -1507,6 +1507,9 @@ if (empty($reshook)) {
}
foreach ($TTotalByTva as $tva => &$total) {
if (empty($amountdeposit[$tva])) {
$amountdeposit[$tva] = 0;
}
$coef = $total / $srcobject->total_ttc; // Calc coef
$am = $amount * $coef;
$amount_ttc_diff += $am;
@@ -1531,6 +1534,9 @@ if (empty($reshook)) {
if ($qualified) {
$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
$tva_tx = $lines[$i]->tva_tx;
if (empty($amountdeposit[$tva_tx])) {
$amountdeposit[$tva_tx] = 0;
}
$amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $valuedeposit) / 100;
}
}

View File

@@ -332,6 +332,7 @@ class Invoices extends DolibarrApi
* @return int
* @throws RestException 400
* @throws RestException 401
* @throws RestException 403 Access not allowed for login
* @throws RestException 404
* @throws RestException 405
*/
@@ -349,6 +350,9 @@ class Invoices extends DolibarrApi
if (empty($orderid)) {
throw new RestException(400, 'Order ID is mandatory');
}
if (!DolibarrApi::_checkAccessToResource('commande', $orderid)) {
throw new RestException(403, 'Access not allowed on order for login '.DolibarrApiAccess::$user->login);
}
$order = new Commande($this->db);
$result = $order->fetch($orderid);

View File

@@ -1942,7 +1942,9 @@ if ($action == 'create') {
if ($objp->fk_product > 0) {
$product = new Product($db);
$product->fetch($objp->fk_product);
$dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit);
if (!empty($product->duration_value) && !empty($product->duration_unit)) {
$dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit);
}
}
}

View File

@@ -3079,7 +3079,7 @@ class ContratLigne extends CommonObjectLine
*
* @param int $id Id object
* @param string $ref Ref of contract line
* @return int <0 if KO, >0 if OK
* @return int <0 if KO, >0 if OK, 0 if not found
*/
public function fetch($id, $ref = '')
{
@@ -3200,6 +3200,9 @@ class ContratLigne extends CommonObjectLine
$this->rang = $obj->rang;
$this->fetch_optionals();
} else {
$this->db->free($resql);
return 0;
}
$this->db->free($resql);

View File

@@ -583,7 +583,6 @@ abstract class CommonObject
*/
public $fk_user_modif;
public $next_prev_filter;
/**
@@ -605,6 +604,10 @@ abstract class CommonObject
protected $labelStatus;
protected $labelStatusShort;
/**
* @var string output
*/
public $output;
/**
* @var array List of child tables. To test if we can delete object.
@@ -8452,7 +8455,7 @@ abstract class CommonObject
$("#"+child_list).hide();
//Show mother lists
} else if ($("#"+parent_list).val() != 0){
$("#"+parent_list).show();
showOptions'.$type.'(child_list, parent_list, orig_select[child_list]);
}
//Show the child list if the parent list value is selected
$("select[name=\""+parent_list+"\"]").click(function() {

View File

@@ -7821,6 +7821,8 @@ class Form
if ($tmpfieldstoshow) {
$fieldstoshow = $tmpfieldstoshow;
}
} else if ($objecttmp->element === 'category') {
$fieldstoshow = 't.label';
} else {
// For backward compatibility
$objecttmp->fields['ref'] = array('type'=>'varchar(30)', 'label'=>'Ref', 'showoncombobox'=>1);

View File

@@ -669,6 +669,12 @@ class Notify
'notification'
);
if (! empty($mailfile->error) || ! empty($mailfile->errors)) {
$this->error = $mailfile->error;
$this->errors = $mailfile->errors;
return -1;
}
if ($mailfile->sendfile()) {
if ($obj->type_target == 'touserid') {
$sql = "INSERT INTO ".$this->db->prefix()."notify (daten, fk_action, fk_soc, fk_user, type, objet_type, type_target, objet_id, email)";
@@ -933,6 +939,12 @@ class Notify
'notification'
);
if (! empty($mailfile->error) || ! empty($mailfile->errors)) {
$this->error = $mailfile->error;
$this->errors = $mailfile->errors;
return -1;
}
if ($mailfile->sendfile()) {
$sql = "INSERT INTO ".$this->db->prefix()."notify (daten, fk_action, fk_soc, fk_contact, type, type_target, objet_type, objet_id, email)";
$sql .= " VALUES ('".$this->db->idate(dol_now())."', ".((int) $notifcodedefid).", ".($object->socid > 0 ? ((int) $object->socid) : 'null').", null, 'email', 'tofixedemail', '".$this->db->escape($object_type)."', ".((int) $object->id).", '".$this->db->escape($conf->global->$param)."')";

View File

@@ -1292,6 +1292,40 @@ $(document).ready(function() {
});
// Code to manage the js for combo list with dependencies (called by extrafields_view.tpl.php)
function showOptions(child_list, parent_list) {
var parentInput = $("select[name="+parent_list+"]");
if (parentInput.length === 0) { // when parent extra-field is in view mode and the child is edited directly on card (on line edit)
parentInput = $("input[name="+parent_list+"]");
}
if (parentInput.length > 0) {
var val = parentInput.val();
var parentVal = parent_list + ":" + val;
if (val > 0) {
$("select[name=\""+child_list+"\"] option[parent]").prop("disabled", true).hide(); // hide not work with select2 element so disabled it
$("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").prop('disabled', false).show(); // show not work with select2 element so enabled it
} else {
$("select[name=\""+child_list+"\"] option").prop("disabled", false).show(); // show not work with select2 element so enabled it
}
}
}
function setListDependencies() {
console.log("setListDependencies");
jQuery("select option[parent]").parent().each(function() {
var child_list = $(this).attr("name");
var parent = $(this).find("option[parent]:first").attr("parent");
var infos = parent.split(":");
var parent_list = infos[0];
showOptions(child_list, parent_list);
/* Activate the handler to call showOptions on each future change */
$("select[name=\""+parent_list+"\"]").change(function() {
showOptions(child_list, parent_list);
});
});
}
/*
* Hacky fix for a bug in select2 with jQuery 3.6.0's new nested-focus "protection"
* see: https://github.com/select2/select2/issues/5993
@@ -1315,4 +1349,5 @@ $(document).on('select2:open', (e) => {
}
?>
// End of lib_head.js.php

View File

@@ -401,6 +401,10 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '',
$tableandshare = 'paiementcharge';
$parentfortableentity = 'fk_charge@chargesociales';
}
if ($features == 'evaluation') {
$features = 'hrm';
$feature2 = 'evaluation';
}
// Get more permissions checks from hooks
$parameters = array('features'=>$features, 'originalfeatures'=>$originalfeatures, 'objectid'=>$objectid, 'dbt_select'=>$dbt_select, 'idtype'=>$dbt_select, 'isdraft'=>$isdraft);
@@ -834,7 +838,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$checkother = array('contact', 'agenda', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
$checkproject = array('projet', 'project'); // Test for project object
$checktask = array('projet_task'); // Test for task object
$checkhierarchy = array('expensereport', 'holiday'); // check permission among the hierarchy of user
$checkhierarchy = array('expensereport', 'holiday', 'hrm'); // check permission among the hierarchy of user
$checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null)
$nocheck = array('barcode', 'stock'); // No test
@@ -1055,6 +1059,20 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
}
}
}
if ($feature == 'hrm' && in_array('evaluation', $feature2)) {
$useridtocheck = $object->fk_user;
if ($user->hasRight('hrm', 'evaluation', 'readall')) {
// the user can view evaluations for anyone
return true;
}
if (!$user->hasRight('hrm', 'evaluation', 'read')) {
// the user can't view any evaluations
return false;
}
// the user can only their own evaluations or their subordinates'
return in_array($useridtocheck, $childids);
}
}
// For some object, we also have to check it is public or owned by user

View File

@@ -253,6 +253,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
} else {
//var_dump($tmpkeyextra.'-'.$value.'-'.$object->table_element);
print $extrafields->showOutputField($tmpkeyextra, $value, '', $object->table_element);
print '<input type="hidden" value="' . $value . '" name="options_' . $tmpkeyextra . '" id="options_' . $tmpkeyextra . '"/>'; // it's needed when to get parent value when extra-field list depend on parent extra-field list
}
print '</td>';
@@ -267,31 +268,6 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
print '
<script>
jQuery(document).ready(function() {
function showOptions(child_list, parent_list)
{
var val = $("select[name="+parent_list+"]").val();
var parentVal = parent_list + ":" + val;
if(val > 0) {
$("select[name=\""+child_list+"\"] option[parent]").hide();
$("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").show();
} else {
$("select[name=\""+child_list+"\"] option").show();
}
}
function setListDependencies() {
jQuery("select option[parent]").parent().each(function() {
var child_list = $(this).attr("name");
var parent = $(this).find("option[parent]:first").attr("parent");
var infos = parent.split(":");
var parent_list = infos[0];
showOptions(child_list, parent_list);
/* Activate the handler to call showOptions on each future change */
$("select[name=\""+parent_list+"\"]").change(function() {
showOptions(child_list, parent_list);
});
});
}
setListDependencies();
});
</script>'."\n";

View File

@@ -77,9 +77,13 @@ class InterfaceNotification extends DolibarrTriggers
dol_syslog("Trigger '".$this->name."' for action '".$action."' launched by ".__FILE__.". id=".$object->id);
$notify = new Notify($this->db);
$notify->send($action, $object);
$result = $notify->send($action, $object);
return 1;
if ($result < 0) {
$this->errors = array_merge($this->errors, empty($notify->error) ? array() : array($notify->error), empty($notify->errors) ? array() : $notify->errors);
}
return $result;
}

View File

@@ -379,9 +379,11 @@ class InterfaceTicketEmail extends DolibarrTriggers
$message = dol_nl2br($message);
}
$message_customer .= '<p>'.$langs->trans('Message').' : <br><br>'.$message.'</p><br>';
$url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id;
$message_customer .= '<p>'.$langs->trans($see_ticket).' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
$message_customer .= '<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) {
$url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id;
$message_customer .= '<p>'.$langs->trans($see_ticket).' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
$message_customer .= '<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
}
$from = (empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? '' : $conf->global->MAIN_INFO_SOCIETE_NOM.' ').'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';

View File

@@ -86,6 +86,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
$upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1];
if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->eventorganization->multidir_output[$object->entity ? $object->entity : $conf->entity]."/conferenceorbooth/".get_exdir(0, 0, 0, 1, $object);
}
@@ -96,7 +97,6 @@ $permissiontoadd = $user->rights->eventorganization->write; // Used by the inclu
$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
$permissionnote = $user->rights->eventorganization->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->eventorganization->write; // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1];
// Security check
if ($user->socid > 0) {

View File

@@ -96,8 +96,9 @@ $permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft);
$isdraft = $object->status == Evaluation::STATUS_DRAFT ? 1 : 0;
restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (!isModEnabled('hrm')) {
accessforbidden();
}

View File

@@ -92,8 +92,8 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
//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);
$isdraft = ($object->status == Evaluation::STATUS_DRAFT) ? 1 : 0;
restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (!isModEnabled("hrm")) {
accessforbidden();
}

View File

@@ -62,10 +62,8 @@ $permission = $user->rights->hrm->evaluation->write;
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
//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();
$isdraft = $object->status == Evaluation::STATUS_DRAFT ? 1 : 0;
restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);

View File

@@ -85,10 +85,10 @@ $permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the includ
$permissiontoread = $user->rights->hrm->evaluation->read;
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
//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);
$isdraft = $object->status == Evaluation::STATUS_DRAFT ? 1 : 0;
restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();

View File

@@ -66,10 +66,10 @@ $permissiontoread = $user->rights->hrm->evaluation->read; // Used by the includ
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
//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();
$isdraft = (($object->status == Evaluation::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden();
/*

View File

@@ -185,13 +185,13 @@ class modMyModule extends DolibarrModules
// 'group' to add a tab in group view
// 'intervention' to add a tab in intervention view
// 'invoice' to add a tab in customer invoice view
// 'invoice_supplier' to add a tab in supplier invoice view
// 'supplier_invoice' to add a tab in supplier invoice view
// 'member' to add a tab in fundation member view
// 'opensurveypoll' to add a tab in opensurvey poll view
// 'order' to add a tab in sale order view
// 'order_supplier' to add a tab in supplier order view
// 'supplier_order' to add a tab in supplier order view
// 'payment' to add a tab in payment view
// 'payment_supplier' to add a tab in supplier payment view
// 'supplier_payment' to add a tab in supplier payment view
// 'product' to add a tab in product view
// 'propal' to add a tab in propal view
// 'project' to add a tab in project view

View File

@@ -307,7 +307,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac
}
}
if (!$updateoftaskdone) { // Check to update progress if no update were done on task.
if (!$updateoftaskdone && GETPOSTISSET($taskid.'progress')) { // Check to update progress if no update were done on task.
$object->fetch($taskid);
//var_dump($object->progress);
//var_dump(GETPOST($taskid . 'progress', 'int')); exit;