Skip to content

Commit 222cd76

Browse files
committed
Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0
2 parents 17ff2be + 47799b8 commit 222cd76

File tree

12 files changed

+56
-41
lines changed

12 files changed

+56
-41
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "CI-RELEASE"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
trigger-docker:
9+
steps:
10+
- name: Generate a token
11+
id: generate-token
12+
uses: actions/create-github-app-token@v2
13+
with:
14+
app-id: ${{ vars.RELEASE_DOCKER_ID }}
15+
private-key: ${{ secrets.RELEASE_DOCKER_SECRET }}
16+
17+
- uses: peter-evans/repository-dispatch@v4
18+
with:
19+
token: ${{ steps.generate-token.outputs.token }}
20+
repository: Dolibarr/dolibarr-docker
21+
event-type: new-release
22+
client-payload: '{"version": "${{ github.event.release.tag_name }}"}'

htdocs/compta/facture/card.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,25 +1733,25 @@
17331733

17341734
// Date start
17351735
$date_start = false;
1736-
if ($lines[$i]->date_debut_prevue) {
1736+
if (isset($lines[$i]->date_debut_prevue)) {
17371737
$date_start = $lines[$i]->date_debut_prevue;
17381738
}
1739-
if ($lines[$i]->date_debut_reel) {
1739+
if (isset($lines[$i]->date_debut_reel)) {
17401740
$date_start = $lines[$i]->date_debut_reel;
17411741
}
1742-
if ($lines[$i]->date_start) {
1742+
if (isset($lines[$i]->date_start)) {
17431743
$date_start = $lines[$i]->date_start;
17441744
}
17451745

17461746
// Date end
17471747
$date_end = false;
1748-
if ($lines[$i]->date_fin_prevue) {
1748+
if (isset($lines[$i]->date_fin_prevue)) {
17491749
$date_end = $lines[$i]->date_fin_prevue;
17501750
}
1751-
if ($lines[$i]->date_fin_reel) {
1751+
if (isset($lines[$i]->date_fin_reel)) {
17521752
$date_end = $lines[$i]->date_fin_reel;
17531753
}
1754-
if ($lines[$i]->date_end) {
1754+
if (isset($lines[$i]->date_end)) {
17551755
$date_end = $lines[$i]->date_end;
17561756
}
17571757

@@ -5862,10 +5862,9 @@ function js_recalculate_revenuestamp(){
58625862
}
58635863
}
58645864

5865-
// For situation invoice with excess received
5865+
// For situation invoice
58665866
if ($object->statut > Facture::STATUS_DRAFT
58675867
&& $object->type == Facture::TYPE_SITUATION
5868-
&& ($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits) > 0
58695868
&& $usercancreate
58705869
&& !$objectidnext
58715870
&& $object->is_last_in_cycle()

htdocs/core/actions_addupdatedelete.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@
358358

359359
$object->oldcopy = dol_clone($object, 2);
360360

361-
$attribute = GETPOST('attribute', 'alphanohtml');
361+
$attribute = GETPOST('attribute', 'aZ09');
362362

363363
$error = 0;
364364

htdocs/core/lib/functions.lib.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13641,8 +13641,8 @@ function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto')
1364113641
{
1364213642
if ($hourTime === 'getpost') {
1364313643
$hour = GETPOSTINT($prefix . 'hour');
13644-
$minute = GETPOSTINT($prefix . 'minute');
13645-
$second = GETPOSTINT($prefix . 'second');
13644+
$minute = GETPOSTINT($prefix . 'min');
13645+
$second = GETPOSTINT($prefix . 'sec');
1364613646
} elseif (preg_match('/^(\d\d):(\d\d):(\d\d)$/', $hourTime, $m)) {
1364713647
$hour = intval($m[1]);
1364813648
$minute = intval($m[2]);
@@ -13681,8 +13681,8 @@ function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto'
1368113681
if ($hourTime === 'getpost' || ($timestamp !== null && dol_print_date($timestamp, '%H:%M:%S') !== '00:00:00')) {
1368213682
$TParam = array_merge($TParam, array(
1368313683
$prefix . 'hour' => intval(dol_print_date($timestamp, '%H')),
13684-
$prefix . 'minute' => intval(dol_print_date($timestamp, '%M')),
13685-
$prefix . 'second' => intval(dol_print_date($timestamp, '%S'))
13684+
$prefix . 'min' => intval(dol_print_date($timestamp, '%M')),
13685+
$prefix . 'sec' => intval(dol_print_date($timestamp, '%S'))
1368613686
));
1368713687
}
1368813688

htdocs/core/lib/security.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,14 +907,14 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
907907
$checkonentitydone = 0;
908908

909909
// Array to define rules of checks to do
910-
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'payment_sc', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales', 'knowledgemanagement'); // Test on entity only (Objects with no link to company)
910+
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'payment_sc', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales', 'knowledgemanagement', 'stock'); // Test on entity only (Objects with no link to company)
911911
$checksoc = array('societe'); // Test for object Societe
912912
$checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
913913
$checkproject = array('projet', 'project'); // Test for project object
914914
$checktask = array('projet_task', 'project_task'); // Test for task object
915915
$checkhierarchy = array('expensereport', 'holiday', 'hrm'); // check permission among the hierarchy of user
916916
$checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null)
917-
$nocheck = array('barcode', 'stock'); // No test
917+
$nocheck = array('barcode'); // No test
918918

919919
//$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...).
920920

htdocs/hrm/evaluation_agenda.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@
9696
// Security check (enable the most restrictive one)
9797
//if ($user->socid > 0) accessforbidden();
9898
//if ($user->socid > 0) $socid = $user->socid;
99-
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
100-
//restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft);
99+
$isdraft = $object->status == Evaluation::STATUS_DRAFT ? 1 : 0;
100+
restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
101+
101102
if (!isModEnabled('hrm')) {
102103
accessforbidden();
103104
}

htdocs/hrm/evaluation_contact.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@
6262
// Security check (enable the most restrictive one)
6363
//if ($user->socid > 0) accessforbidden();
6464
//if ($user->socid > 0) $socid = $user->socid;
65-
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
66-
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
67-
//if (empty($conf->hrm->enabled)) accessforbidden();
68-
//if (!$permissiontoread) accessforbidden();
65+
$isdraft = $object->status == Evaluation::STATUS_DRAFT ? 1 : 0;
66+
restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
6967

7068

7169

htdocs/hrm/evaluation_document.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,12 @@
8585
$permissiontoread = $user->rights->hrm->evaluation->read;
8686

8787
// Security check (enable the most restrictive one)
88-
//if ($user->socid > 0) accessforbidden();
89-
//if ($user->socid > 0) $socid = $user->socid;
90-
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
91-
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
92-
if (empty($conf->hrm->enabled)) {
93-
accessforbidden();
94-
}
95-
if (!$permissiontoread) {
96-
accessforbidden();
97-
}
88+
89+
$isdraft = $object->status == Evaluation::STATUS_DRAFT ? 1 : 0;
90+
restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
91+
92+
if (!isModEnabled('hrm')) accessforbidden();
93+
if (!$permissiontoread) accessforbidden();
9894

9995

10096
/*

htdocs/hrm/evaluation_note.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@
6666
// Security check (enable the most restrictive one)
6767
//if ($user->socid > 0) accessforbidden();
6868
//if ($user->socid > 0) $socid = $user->socid;
69-
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
70-
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
71-
//if (empty($conf->hrm->enabled)) accessforbidden();
72-
//if (!$permissiontoread) accessforbidden();
69+
$isdraft = (($object->status == Evaluation::STATUS_DRAFT) ? 1 : 0);
70+
restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
71+
if (empty($conf->hrm->enabled)) accessforbidden();
72+
if (!$permissiontoread) accessforbidden();
7373

7474

7575
/*

htdocs/product/inventory/card.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
$include_sub_warehouse = !empty(GETPOST('include_sub_warehouse')) ? GETPOST('include_sub_warehouse') : 0;
4444

4545
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
46-
$result = restrictedArea($user, 'stock', $id);
46+
$result = restrictedArea($user, 'stock', $id, 'inventory&stock');
4747
} else {
48-
$result = restrictedArea($user, 'stock', $id, '', 'inventory_advance');
48+
$result = restrictedArea($user, 'stock', $id, 'inventory&stock', 'inventory_advance');
4949
}
5050

5151
// Initialize technical objects

0 commit comments

Comments
 (0)