Go to the documentation of this file.
49 if (!$res && !empty($_SERVER[
"CONTEXT_DOCUMENT_ROOT"])) {
50 $res = @include $_SERVER[
"CONTEXT_DOCUMENT_ROOT"].
"/main.inc.php";
53 $tmp = empty($_SERVER[
'SCRIPT_FILENAME']) ?
'' : $_SERVER[
'SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
54 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
57 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/main.inc.php")) {
58 $res = @include substr($tmp, 0, ($i + 1)).
"/main.inc.php";
60 if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php")) {
61 $res = @include dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php";
64 if (!$res && file_exists(
"../main.inc.php")) {
65 $res = @include
"../main.inc.php";
67 if (!$res && file_exists(
"../../main.inc.php")) {
68 $res = @include
"../../main.inc.php";
70 if (!$res && file_exists(
"../../../main.inc.php")) {
71 $res = @include
"../../../main.inc.php";
74 die(
"Include of main fails");
81 $langs->loadLangs(array(
"mymodule@mymodule",
"companies"));
86 $action =
GETPOST(
'action',
'aZ09');
87 $cancel =
GETPOST(
'cancel',
'aZ09');
88 $backtopage =
GETPOST(
'backtopage',
'alpha');
93 $diroutputmassaction = $conf->mymodule->dir_output.
'/temp/massgeneration/'.$user->id;
94 $hookmanager->initHooks(array(
'myobjectnote',
'globalcard'));
96 $extrafields->fetch_name_optionals_label($object->table_element);
99 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
100 if ($id > 0 || !empty($ref)) {
101 $upload_dir = $conf->mymodule->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity].
"/".$object->id;
107 $enablepermissioncheck = 0;
108 if ($enablepermissioncheck) {
109 $permissiontoread = $user->rights->mymodule->myobject->read;
110 $permissiontoadd = $user->rights->mymodule->myobject->write;
111 $permissionnote = $user->rights->mymodule->myobject->write;
113 $permissiontoread = 1;
114 $permissiontoadd = 1;
131 $parameters = array();
132 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
136 if (empty($reshook)) {
137 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
149 $title = $langs->trans(
'MyObject').
' - '.$langs->trans(
"Notes");
152 if ($id > 0 || !empty($ref)) {
153 $object->fetch_thirdparty();
157 print
dol_get_fiche_head($head,
'note', $langs->trans(
"MyObject"), -1, $object->picto);
161 $linkback =
'<a href="'.dol_buildpath(
'/mymodule/myobject_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
163 $morehtmlref =
'<div class="refidno">';
201 $morehtmlref .=
'</div>';
204 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
207 print
'<div class="fichecenter">';
208 print
'<div class="underbanner clearboth"></div>';
211 $cssclass =
"titlefield";
212 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
myobjectPrepareHead($object)
Prepare array of tabs for MyObject.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.