diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 4c4d44c3a6e..855571e834b 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -201,9 +201,9 @@ if ($object->id > 0) {
// Date start
print '
| '.$langs->trans("DateActionEnd").' | ';
if (!$object->fulldayevent) {
- print dol_print_date($object->datef, 'dayhour');
+ print dol_print_date($object->datef, 'dayhour', 'tzuser');
} else {
- print dol_print_date($object->datef, 'day');
+ print dol_print_date($object->datef, 'day', 'tzuser');
}
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now - $delay_warning)) {
print img_warning($langs->trans("Late"));
diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php
index 03209ad7673..0a979e01d39 100644
--- a/htdocs/compta/bank/account_statement_document.php
+++ b/htdocs/compta/bank/account_statement_document.php
@@ -120,6 +120,8 @@ if (GETPOST("rel") == 'prev') {
$found = true;
}
+$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php
+
/*
* Actions
diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php
index ec46002b031..7dce00005f3 100644
--- a/htdocs/compta/bank/document.php
+++ b/htdocs/compta/bank/document.php
@@ -74,6 +74,8 @@ if ($id > 0 || !empty($ref)) {
$result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', '');
+$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php
+
/*
* Actions
diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php
index 5f55f4c2559..ad199caaf5a 100644
--- a/htdocs/compta/bank/various_payment/document.php
+++ b/htdocs/compta/bank/various_payment/document.php
@@ -69,6 +69,9 @@ $object->fetch($id, $ref);
$upload_dir = $conf->bank->dir_output.'/'.dol_sanitizeFileName($object->id);
$modulepart = 'banque';
+$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php
+
+
/*
* Actions
diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php
index cdb4b5f0f0f..2a16d6e4f49 100644
--- a/htdocs/compta/deplacement/document.php
+++ b/htdocs/compta/deplacement/document.php
@@ -42,12 +42,6 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'deplacement', $id, '');
-
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
@@ -74,6 +68,14 @@ $object->fetch($id, $ref);
$upload_dir = $conf->deplacement->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart = 'trip';
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'deplacement', $id, '');
+
+$permissiontoadd = $user->rights->deplacement->creer; // Used by the include of actions_dellink.inc.php
+
/*
* Actions
diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php
index 1fbfdfa296a..d0cf3a1f34c 100644
--- a/htdocs/compta/sociales/document.php
+++ b/htdocs/compta/sociales/document.php
@@ -78,6 +78,8 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges');
+$permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php
+
/*
* Actions
diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php
index e2f0dcec96d..67de87d0c21 100644
--- a/htdocs/compta/tva/document.php
+++ b/htdocs/compta/tva/document.php
@@ -79,6 +79,8 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'tax', '', 'tva', 'charges');
+$permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php
+
/*
* Actions
@@ -86,7 +88,7 @@ $result = restrictedArea($user, 'tax', '', 'tva', 'charges');
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
-if ($action == 'setlib' && $user->rights->tax->charges->creer) {
+if ($action == 'setlib' && $permissiontoadd) {
$object->fetch($id);
$result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', '', 'text', '', $user, 'TAX_MODIFY');
if ($result < 0) {
diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php
index 3005c6b7827..1870e7b8d9c 100644
--- a/htdocs/contact/document.php
+++ b/htdocs/contact/document.php
@@ -49,12 +49,6 @@ if (!empty($canvas)) {
$objcanvas->getCanvas('contact', 'contactcard', $canvas);
}
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission
-
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -91,6 +85,15 @@ $modulepart = 'contact';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contactdocument'));
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission
+
+$permissiontoadd = $user->rights->societe->contact->creer; // Used by the include of actions_dellink.inc.php
+
+
/*
* Actions
*/
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index 690b5432a1b..c54823ee142 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -84,6 +84,8 @@ $modulepart = 'contract';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contractcard', 'globalcard'));
+$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_dellink.inc.php
+
/*
* Actions
diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php
index ad9ca441e8a..86d4e923131 100644
--- a/htdocs/core/actions_linkedfiles.inc.php
+++ b/htdocs/core/actions_linkedfiles.inc.php
@@ -36,8 +36,19 @@ if (GETPOST('uploadform', 'int') && empty($_POST) && empty($_FILES)) {
die;
}
+if ((GETPOST('sendit', 'alpha')
+ || GETPOST('linkit', 'restricthtml')
+ || ($action == 'confirm_deletefile' && $confirm == 'yes')
+ || ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha'))
+ || ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha'))) && empty($permissiontoadd)) {
+ dol_syslog('The file actions_linkedfiles.inc.php was included but paramater $permissiontoadd as not set before.');
+ print 'The file actions_linkedfiles.inc.php was included but paramater $permissiontoadd as not set before.';
+ die;
+}
+
+
// Submit file/link
-if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) {
+if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && !empty($permissiontoadd)) {
if (!empty($_FILES)) {
if (is_array($_FILES['userfile']['tmp_name'])) {
$userfiles = $_FILES['userfile']['tmp_name'];
@@ -75,7 +86,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!is
}
}
}
-} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) {
+} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC) && !empty($permissiontoadd)) {
$link = GETPOST('link', 'alpha');
if ($link) {
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') {
@@ -87,7 +98,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!is
// Delete file/link
-if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiontoadd) || $permissiontoadd)) {
+if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissiontoadd)) {
$urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
if (GETPOST('section', 'alpha')) {
// For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir
@@ -158,7 +169,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiont
exit;
}
}
-} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) {
+} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && !empty($permissiontoadd)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$langs->load('link');
$link = new Link($db);
@@ -176,7 +187,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiont
} else {
//error fetching
}
-} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) {
+} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha') && !empty($permissiontoadd)) {
// For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
if (!empty($upload_dir)) {
$filenamefrom = dol_sanitizeFileName(GETPOST('renamefilefrom', 'alpha'), '_', 0); // Do not remove accents
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 2a42d4a3d00..f46c1051c53 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -205,12 +205,14 @@ if ($type == 'directory') {
'product',
'tax',
'project',
+ 'project_task',
'fichinter',
'user',
'expensereport',
'holiday',
'recruitment-recruitmentcandidature',
'banque',
+ 'chequereceipt',
'mrp-mo'
);
@@ -243,6 +245,8 @@ if ($type == 'directory') {
$upload_dir = $conf->tax->dir_output;
} elseif ($module == 'project') {
$upload_dir = $conf->projet->dir_output;
+ } elseif ($module == 'project_task') {
+ $upload_dir = $conf->projet->dir_output;
} elseif ($module == 'fichinter') {
$upload_dir = $conf->ficheinter->dir_output;
} elseif ($module == 'user') {
@@ -255,8 +259,10 @@ if ($type == 'directory') {
$upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature';
} elseif ($module == 'banque') {
$upload_dir = $conf->bank->dir_output;
+ } elseif ($module == 'chequereceipt') {
+ $upload_dir = $conf->bank->dir_output.'/checkdeposits';
} elseif ($module == 'mrp-mo') {
- $upload_dir = $conf->mrp->dir_output.'/mo';
+ $upload_dir = $conf->mrp->dir_output;
} else {
$parameters = array('modulepart'=>$module);
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php
new file mode 100644
index 00000000000..05ae866463f
--- /dev/null
+++ b/htdocs/core/bookmarks_page.php
@@ -0,0 +1,126 @@
+
+ *
+ * This file is a modified version of datepicker.php from phpBSM to fix some
+ * bugs, to add new features and to dramatically increase speed.
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file htdocs/core/bookmarks_page.php
+ * \brief File to return a page with the complete list of bookmarks (all search input fields)
+ */
+
+//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
+//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
+//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
+//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
+if (!defined('NOCSRFCHECK')) {
+ define('NOCSRFCHECK', 1);
+}
+if (!defined('NOTOKENRENEWAL')) {
+ define('NOTOKENRENEWAL', 1);
+}
+//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
+if (!defined('NOREQUIREMENU')) {
+ define('NOREQUIREMENU', 1);
+}
+//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
+
+require_once '../main.inc.php';
+
+if (GETPOST('lang', 'aZ09')) {
+ $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
+}
+
+$langs->load("main");
+
+$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
+$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
+
+
+/*
+ * View
+ */
+
+$title = $langs->trans("Bookmarks");
+
+// URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests
+$head = ''."\n";
+$arrayofjs = array();
+$arrayofcss = array();
+top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
+
+
+
+print ''."\n";
+print '';
+//print ' ';
+
+$nbofsearch = 0;
+
+// Instantiate hooks of thirdparty module
+$hookmanager->initHooks(array('bookmarks'));
+
+// Define $bookmarks
+$bookmarks = '';
+
+
+$arrayresult = array();
+//include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';
+
+$i = 0;
+$accesskeyalreadyassigned = array();
+foreach ($arrayresult as $key => $val) {
+ $tmp = explode('?', $val['url']);
+ $urlaction = $tmp[0];
+ $keysearch = 'search_all';
+
+ $accesskey = '';
+ if (!$accesskeyalreadyassigned[$val['label'][0]]) {
+ $accesskey = $val['label'][0];
+ $accesskeyalreadyassigned[$accesskey] = $accesskey;
+ }
+
+ //$bookmarks .= printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, $val['img'], $showtitlebefore, ($i > 0 ? 0 : 1));
+
+ $i++;
+}
+
+
+// Execute hook printSearchForm
+$parameters = array('bookmarks'=>$bookmarks);
+$reshook = $hookmanager->executeHooks('printBookmarks', $parameters); // Note that $action and $object may have been modified by some hooks
+if (empty($reshook)) {
+ $bookmarks .= $hookmanager->resPrint;
+} else {
+ $bookmarks = $hookmanager->resPrint;
+}
+
+
+print "\n";
+print "\n";
+print ' ';
+print '';
+print ''."\n";
+print ' ';
+print "\n\n";
+
+print ' ';
+print ' |