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']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
55while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
59if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/main.inc.php")) {
60 $res = @include substr($tmp, 0, ($i + 1)).
"/main.inc.php";
62if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php")) {
63 $res = @include dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php";
66if (!$res && file_exists(
"../main.inc.php")) {
67 $res = @include
"../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";
76 die(
"Include of main fails");
83$langs->loadLangs(array(
"mymodule@mymodule",
"companies"));
88$action =
GETPOST(
'action',
'aZ09');
89$cancel =
GETPOST(
'cancel',
'aZ09');
90$backtopage =
GETPOST(
'backtopage',
'alpha');
95$diroutputmassaction = $conf->mymodule->dir_output.
'/temp/massgeneration/'.$user->id;
96$hookmanager->initHooks(array(
$object->element.
'note',
'globalcard'));
98$extrafields->fetch_name_optionals_label(
$object->table_element);
101include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
102if ($id > 0 || !empty($ref)) {
103 $upload_dir = $conf->mymodule->multidir_output[empty(
$object->entity) ? $conf->entity :
$object->entity].
"/".
$object->id;
109$enablepermissioncheck = 0;
110if ($enablepermissioncheck) {
111 $permissiontoread = $user->hasRight(
'mymodule',
'myobject',
'read');
112 $permissiontoadd = $user->hasRight(
'mymodule',
'myobject',
'write');
113 $permissionnote = $user->hasRight(
'mymodule',
'myobject',
'write');
115 $permissiontoread = 1;
116 $permissiontoadd = 1;
125if (!isModEnabled(
"mymodule")) {
128if (!$permissiontoread) {
137$parameters = array();
138$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
142if (empty($reshook)) {
143 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
151$form =
new Form($db);
153$title = $langs->trans(
'MyObject').
' - '.$langs->trans(
"Notes");
158llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-mymodule page-card_notes');
160if ($id > 0 || !empty($ref)) {
169 $linkback =
'<a href="'.dol_buildpath(
'/mymodule/myobject_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
171 $morehtmlref =
'<div class="refidno">';
208 $morehtmlref .=
'</div>';
211 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
214 print
'<div class="fichecenter">';
215 print
'<div class="underbanner clearboth"></div>';
218 $cssclass =
"titlefield";
219 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()
Empty header.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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.