golden hour
/home/phakp/public_html/erp/core
⬆️ Go Up
Upload
File/Folder
Size
Actions
actions_addupdatedelete.inc.php
17.21 KB
Del
OK
actions_builddoc.inc.php
5.55 KB
Del
OK
actions_changeselectedfields.inc.php
1.57 KB
Del
OK
actions_comments.inc.php
2.55 KB
Del
OK
actions_dellink.inc.php
2.58 KB
Del
OK
actions_extrafields.inc.php
12.31 KB
Del
OK
actions_fetchobject.inc.php
1.87 KB
Del
OK
actions_lineupdown.inc.php
2.56 KB
Del
OK
actions_linkedfiles.inc.php
12.29 KB
Del
OK
actions_massactions.inc.php
59.67 KB
Del
OK
actions_printing.inc.php
3.29 KB
Del
OK
actions_sendmails.inc.php
18.35 KB
Del
OK
actions_setmoduleoptions.inc.php
5.35 KB
Del
OK
actions_setnotes.inc.php
3.63 KB
Del
OK
ajax
-
Del
OK
antispamimage.php
1.9 KB
Del
OK
bookmarks_page.php
6.11 KB
Del
OK
boxes
-
Del
OK
class
-
Del
OK
commonfieldsinexport.inc.php
2.01 KB
Del
OK
customreports.php
33.5 KB
Del
OK
data
-
Del
OK
datepicker.php
9.51 KB
Del
OK
db
-
Del
OK
doxygen.php
1.71 KB
Del
OK
extrafieldsinexport.inc.php
2.87 KB
Del
OK
filemanagerdol
-
Del
OK
get_info.php
8.05 KB
Del
OK
get_menudiv.php
7.67 KB
Del
OK
js
-
Del
OK
lib
-
Del
OK
login
-
Del
OK
menus
-
Del
OK
modules
-
Del
OK
multicompany_page.php
5.23 KB
Del
OK
photos_resize.php
22.83 KB
Del
OK
search.php
4.95 KB
Del
OK
search_page.php
4.93 KB
Del
OK
tools.php
1.56 KB
Del
OK
tpl
-
Del
OK
triggers
-
Del
OK
website.inc.php
5.11 KB
Del
OK
Edit: actions_setmoduleoptions.inc.php
<?php /* Copyright (C) 2014-2017 Laurent Destailleur <eldy@users.sourceforge.net> * * 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 <https://www.gnu.org/licenses/>. * or see https://www.gnu.org/ */ /** * \file htdocs/core/actions_setmoduleoptions.inc.php * \brief Code for actions on setting notes of object page */ // $error must have been initialized to 0 // $action must be defined // $arrayofparameters must be set for action 'update' // $nomessageinupdate can be set to 1 // $nomessageinsetmoduleoptions can be set to 1 // $formSetup may be defined if ($action == 'update' && !empty($formSetup) && is_object($formSetup) && !empty($user->admin)) { $formSetup->saveConfFromPost(); return; } if ($action == 'update' && is_array($arrayofparameters) && !empty($user->admin)) { $db->begin(); foreach ($arrayofparameters as $key => $val) { // Modify constant only if key was posted (avoid resetting key to the null value) if (GETPOSTISSET($key)) { if (preg_match('/category:/', $val['type'])) { if (GETPOST($key, 'int') == '-1') { $val_const = ''; } else { $val_const = GETPOST($key, 'int'); } } else { $val_const = GETPOST($key, 'alpha'); } $result = dolibarr_set_const($db, $key, $val_const, 'chaine', 0, '', $conf->entity); if ($result < 0) { $error++; break; } } } if (!$error) { $db->commit(); if (empty($nomessageinupdate)) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } } else { $db->rollback(); if (empty($nomessageinupdate)) { setEventMessages($langs->trans("SetupNotSaved"), null, 'errors'); } } } if ($action == 'deletefile' && $modulepart == 'doctemplates' && !empty($user->admin)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $keyforuploaddir = GETPOST('keyforuploaddir', 'aZ09'); $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString($keyforuploaddir)))); foreach ($listofdir as $key => $tmpdir) { $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT if (!$tmpdir) { unset($listofdir[$key]); continue; } $tmpdir = DOL_DATA_ROOT.'/'.$tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set if (!is_dir($tmpdir)) { if (empty($nomessageinsetmoduleoptions)) { setEventMessages($langs->trans("ErrorDirNotFound", $tmpdir), null, 'warnings'); } } else { $upload_dir = $tmpdir; break; // So we take the first directory found into setup $conf->global->$keyforuploaddir } } $filetodelete = $tmpdir.'/'.GETPOST('file'); $result = dol_delete_file($filetodelete); if ($result > 0) { setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs'); } } // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) if ($action == 'setModuleOptions' && !empty($user->admin)) { $db->begin(); // Process common param fields if (is_array($_POST)) { foreach ($_POST as $key => $val) { $reg = array(); if (preg_match('/^param(\d*)$/', $key, $reg)) { // Works for POST['param'], POST['param1'], POST['param2'], ... $param = GETPOST("param".$reg[1], 'alpha'); $value = GETPOST("value".$reg[1], 'alpha'); if ($param) { $res = dolibarr_set_const($db, $param, $value, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } } } } } // Process upload fields if (GETPOST('upload', 'alpha') && GETPOST('keyforuploaddir', 'aZ09')) { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $keyforuploaddir = GETPOST('keyforuploaddir', 'aZ09'); $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString($keyforuploaddir)))); foreach ($listofdir as $key => $tmpdir) { $tmpdir = trim($tmpdir); $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT if (!$tmpdir) { unset($listofdir[$key]); continue; } $tmpdir = DOL_DATA_ROOT.'/'.$tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set if (!is_dir($tmpdir)) { if (empty($nomessageinsetmoduleoptions)) { setEventMessages($langs->trans("ErrorDirNotFound", $tmpdir), null, 'warnings'); } } else { $upload_dir = $tmpdir; break; // So we take the first directory found into setup $conf->global->$keyforuploaddir } } if ($upload_dir) { $result = dol_add_file_process($upload_dir, 1, 1, 'uploadfile', ''); if ($result <= 0) { $error++; } } } if (!$error) { $db->commit(); if (empty($nomessageinsetmoduleoptions)) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } } else { $db->rollback(); if (empty($nomessageinsetmoduleoptions)) { setEventMessages($langs->trans("SetupNotSaved"), null, 'errors'); } } }
Save