Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0

This commit is contained in:
Laurent Destailleur 2017-08-26 21:53:46 +02:00
commit c91f70cbf4
2 changed files with 29 additions and 24 deletions

View File

@ -1,12 +1,12 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -572,6 +572,11 @@ if ($action == 'mupdate')
} }
// Actions to delete doc
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
$permissioncreate = ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete));
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
/* /*
* View * View
@ -1449,7 +1454,7 @@ if ($id > 0)
*/ */
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id; $filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id; $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed=$user->rights->agenda->myactions->create; $genallowed=$user->rights->agenda->myactions->create;
$delallowed=$user->rights->agenda->myactions->delete; $delallowed=$user->rights->agenda->myactions->delete;

View File

@ -375,7 +375,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
$check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company) $check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company)
$checksoc = array('societe'); // Test for societe object $checksoc = array('societe'); // Test for societe object
$checkother = array('contact'); // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...). $checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...).
$checkproject = array('projet','project'); // Test for project object $checkproject = array('projet','project'); // Test for project object
$checktask = array('projet_task'); $checktask = array('projet_task');
$nocheck = array('barcode','stock','fournisseur'); // No test $nocheck = array('barcode','stock','fournisseur'); // No test