mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
Compare commits
38 Commits
22.0.0
...
78ca968db6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78ca968db6 | ||
|
|
a1476fd221 | ||
|
|
908880c82c | ||
|
|
3608e9b102 | ||
|
|
c2635f5242 | ||
|
|
2935a245a3 | ||
|
|
5589ed71b2 | ||
|
|
32f160355b | ||
|
|
5a61cc9393 | ||
|
|
7ed0af2a13 | ||
|
|
9e8460c3dc | ||
|
|
70f5e20572 | ||
|
|
30ecf80732 | ||
|
|
99fe044868 | ||
|
|
8ae27c3a5f | ||
|
|
5fa475a074 | ||
|
|
a16f3bdf31 | ||
|
|
dc7932700b | ||
|
|
534d4ed4bc | ||
|
|
50b90d795c | ||
|
|
3209eb4bd8 | ||
|
|
1f65548836 | ||
|
|
5de1fcca2f | ||
|
|
50afc9682b | ||
|
|
a3969c1d2c | ||
|
|
d87ebbf926 | ||
|
|
08b105502e | ||
|
|
bd2aba1a2f | ||
|
|
a4601686a6 | ||
|
|
bcf6d6a7a2 | ||
|
|
65a3b0893d | ||
|
|
92454d671f | ||
|
|
f43f2909ff | ||
|
|
60f089c015 | ||
|
|
7d898184b5 | ||
|
|
e818bf732d | ||
|
|
347bf3e4d6 | ||
|
|
b3a2257638 |
@@ -133,7 +133,7 @@
|
||||
|
||||
<rule ref="Generic.Formatting.SpaceAfterCast" />
|
||||
|
||||
<rule ref="Generic.Functions.CallTimePassByReference" />
|
||||
<!-- <rule ref="Generic.Functions.CallTimePassByReference" /> -->
|
||||
|
||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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&origin='.$object->element.'&originid='.$object->id, '');
|
||||
}
|
||||
|
||||
@@ -1174,7 +1174,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)."')";
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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.'>';
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user