50if (!$res && !empty($_SERVER[
"CONTEXT_DOCUMENT_ROOT"])) {
51 $res = @include $_SERVER[
"CONTEXT_DOCUMENT_ROOT"].
"/main.inc.php";
54$tmp = empty($_SERVER[
'SCRIPT_FILENAME']) ?
'' : $_SERVER[
'SCRIPT_FILENAME'];
55$tmp2 = realpath(__FILE__);
57$j = strlen($tmp2) - 1;
58while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
62if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/main.inc.php")) {
63 $res = @include substr($tmp, 0, ($i + 1)).
"/main.inc.php";
65if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php")) {
66 $res = @include dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php";
69if (!$res && file_exists(
"../main.inc.php")) {
70 $res = @include
"../main.inc.php";
72if (!$res && file_exists(
"../../main.inc.php")) {
73 $res = @include
"../../main.inc.php";
75if (!$res && file_exists(
"../../../main.inc.php")) {
76 $res = @include
"../../../main.inc.php";
79 die(
"Include of main fails");
86$langs->loadLangs(array(
"mymodule@mymodule",
"companies"));
91$action =
GETPOST(
'action',
'aZ09');
92$cancel =
GETPOST(
'cancel',
'aZ09');
93$backtopage =
GETPOST(
'backtopage',
'alpha');
98$diroutputmassaction = $conf->mymodule->dir_output.
'/temp/massgeneration/'.$user->id;
99$hookmanager->initHooks(array(
$object->element.
'note',
'globalcard'));
101$extrafields->fetch_name_optionals_label(
$object->table_element);
104include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
105if ($id > 0 || !empty($ref)) {
106 $upload_dir = $conf->mymodule->multidir_output[empty(
$object->entity) ? $conf->entity :
$object->entity].
"/".
$object->id;
112$enablepermissioncheck = 0;
113if ($enablepermissioncheck) {
114 $permissiontoread = $user->hasRight(
'mymodule',
'myobject',
'read');
115 $permissiontoadd = $user->hasRight(
'mymodule',
'myobject',
'write');
116 $permissionnote = $user->hasRight(
'mymodule',
'myobject',
'write');
118 $permissiontoread = 1;
119 $permissiontoadd = 1;
128if (!isModEnabled(
"mymodule")) {
131if (!$permissiontoread) {
140$parameters = array();
141$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
145if (empty($reshook)) {
146 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
154$form =
new Form($db);
156$title = $langs->trans(
'MyObject').
' - '.$langs->trans(
"Notes");
161llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-mymodule page-card_notes');
163if ($id > 0 || !empty($ref)) {
172 $linkback =
'<a href="'.dol_buildpath(
'/mymodule/myobject_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
174 $morehtmlref =
'<div class="refidno">';
211 $morehtmlref .=
'</div>';
214 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
217 print
'<div class="fichecenter">';
218 print
'<div class="underbanner clearboth"></div>';
221 $cssclass =
"titlefield";
222 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
myobjectPrepareHead($object)
Prepare array of tabs for MyObject.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.