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_dellink.inc.php
<?php /* Copyright (C) 2015-2016 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_dellink.inc.php * \brief Code for actions on linking and deleting link between elements */ // $action must be defined // $object must be defined // $permissiondellink must be defined $dellinkid = GETPOST('dellinkid', 'int'); $addlink = GETPOST('addlink', 'alpha'); $addlinkid = GETPOST('idtolinkto', 'int'); $addlinkref = GETPOST('reftolinkto', 'alpha'); $cancellink = GETPOST('cancel', 'alpha'); // Link object to another object if ($action == 'addlink' && !empty($permissiondellink) && !$cancellink && $id > 0 && $addlinkid > 0) { $object->fetch($id); $object->fetch_thirdparty(); $result = $object->add_object_linked($addlink, $addlinkid); } // Link by reference if ($action == 'addlinkbyref' && ! empty($permissiondellink) && !$cancellink && $id > 0 && !empty($addlinkref) && !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { $element_prop = getElementProperties($addlink); if (is_array($element_prop)) { dol_include_once('/' . $element_prop['classpath'] . '/' . $element_prop['classfile'] . '.class.php'); $objecttmp = new $element_prop['classname']($db); $ret = $objecttmp->fetch(0, $addlinkref); if ($ret > 0) { $object->fetch($id); $object->fetch_thirdparty(); $result = $object->add_object_linked($addlink, $objecttmp->id); if (isset($_POST['reftolinkto'])) unset($_POST['reftolinkto']); } elseif ($ret < 0) { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); } else { $langs->load('errors'); setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors'); } } } // Delete link in table llx_element_element if ($action == 'dellink' && !empty($permissiondellink) && !$cancellink && $dellinkid > 0) { $result = $object->deleteObjectLinked(0, '', 0, '', $dellinkid); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } }
Save