myobject_card.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. <?php
  2. /* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) ---Put here your own copyright and developer email---
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \file htdocs/modulebuilder/template/myobject_card.php
  20. * \ingroup mymodule
  21. * \brief Page to create/edit/view myobject
  22. */
  23. //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
  24. //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Do not load object $user
  25. //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // Do not load object $mysoc
  26. //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Do not load object $langs
  27. //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check injection attack on GET parameters
  28. //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check injection attack on POST parameters
  29. //if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
  30. //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
  31. //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
  32. //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
  33. //if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
  34. //if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library
  35. //if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
  36. //if (! defined('NOIPCHECK')) define('NOIPCHECK','1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
  37. //if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT','auto'); // Force lang to a particular value
  38. //if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); // Force authentication handler
  39. //if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
  40. //if (! defined("FORCECSP")) define('FORCECSP','none'); // Disable all Content Security Policies
  41. // Load Dolibarr environment
  42. $res=0;
  43. // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
  44. if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
  45. // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
  46. $tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
  47. while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
  48. if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
  49. if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
  50. // Try main.inc.php using relative path
  51. if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
  52. if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
  53. if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
  54. if (! $res) die("Include of main fails");
  55. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
  56. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
  57. dol_include_once('/mymodule/class/myobject.class.php');
  58. dol_include_once('/mymodule/lib/mymodule_myobject.lib.php');
  59. // Load translation files required by the page
  60. $langs->loadLangs(array("mymodule@mymodule","other"));
  61. // Get parameters
  62. $id = GETPOST('id', 'int');
  63. $ref = GETPOST('ref', 'alpha');
  64. $action = GETPOST('action', 'alpha');
  65. $confirm = GETPOST('confirm', 'alpha');
  66. $cancel = GETPOST('cancel', 'aZ09');
  67. $contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectcard'; // To manage different context of search
  68. $backtopage = GETPOST('backtopage', 'alpha');
  69. // Initialize technical objects
  70. $object=new MyObject($db);
  71. $extrafields = new ExtraFields($db);
  72. $diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id;
  73. $hookmanager->initHooks(array('myobjectcard','globalcard')); // Note that conf->hooks_modules contains array
  74. // Fetch optionals attributes and labels
  75. $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
  76. $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
  77. // Initialize array of search criterias
  78. $search_all=trim(GETPOST("search_all",'alpha'));
  79. $search=array();
  80. foreach($object->fields as $key => $val)
  81. {
  82. if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
  83. }
  84. if (empty($action) && empty($id) && empty($ref)) $action='view';
  85. // Load object
  86. include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
  87. // Security check - Protection if external user
  88. //if ($user->societe_id > 0) access_forbidden();
  89. //if ($user->societe_id > 0) $socid = $user->societe_id;
  90. //$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0);
  91. //$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
  92. /*
  93. * Actions
  94. *
  95. * Put here all code to do according to value of "action" parameter
  96. */
  97. $parameters=array();
  98. $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
  99. if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  100. if (empty($reshook))
  101. {
  102. $error=0;
  103. $permissiontoadd = $user->rights->mymodule->write;
  104. $permissiontodelete = $user->rights->mymodule->delete;
  105. if (empty($backtopage)) $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).'?id='.($id > 0 ? $id : '__ID__');
  106. $backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1);
  107. $triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record
  108. // Actions cancel, add, update, delete or clone
  109. include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
  110. // Actions when linking object each other
  111. include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
  112. // Actions when printing a doc from card
  113. include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
  114. // Actions to send emails
  115. $trigger_name='MYOBJECT_SENTBYMAIL';
  116. $autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
  117. $trackid='myobject'.$object->id;
  118. include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
  119. }
  120. /*
  121. * View
  122. *
  123. * Put here all code to build page
  124. */
  125. $form=new Form($db);
  126. $formfile=new FormFile($db);
  127. llxHeader('','MyObject','');
  128. // Example : Adding jquery code
  129. print '<script type="text/javascript" language="javascript">
  130. jQuery(document).ready(function() {
  131. function init_myfunc()
  132. {
  133. jQuery("#myid").removeAttr(\'disabled\');
  134. jQuery("#myid").attr(\'disabled\',\'disabled\');
  135. }
  136. init_myfunc();
  137. jQuery("#mybutton").click(function() {
  138. init_myfunc();
  139. });
  140. });
  141. </script>';
  142. // Part to create
  143. if ($action == 'create')
  144. {
  145. print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("MyObject")));
  146. print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
  147. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  148. print '<input type="hidden" name="action" value="add">';
  149. print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
  150. dol_fiche_head(array(), '');
  151. print '<table class="border centpercent">'."\n";
  152. // Common attributes
  153. include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
  154. // Other attributes
  155. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
  156. print '</table>'."\n";
  157. dol_fiche_end();
  158. print '<div class="center">';
  159. print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
  160. print '&nbsp; ';
  161. print '<input type="'.($backtopage?"submit":"button").'" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage?'':' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
  162. print '</div>';
  163. print '</form>';
  164. }
  165. // Part to edit record
  166. if (($id || $ref) && $action == 'edit')
  167. {
  168. print load_fiche_titre($langs->trans("MyObject"));
  169. print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
  170. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  171. print '<input type="hidden" name="action" value="update">';
  172. print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
  173. print '<input type="hidden" name="id" value="'.$object->id.'">';
  174. dol_fiche_head();
  175. print '<table class="border centpercent">'."\n";
  176. // Common attributes
  177. include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
  178. // Other attributes
  179. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
  180. print '</table>';
  181. dol_fiche_end();
  182. print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
  183. print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
  184. print '</div>';
  185. print '</form>';
  186. }
  187. // Part to show record
  188. if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
  189. {
  190. $res = $object->fetch_optionals();
  191. $head = myobjectPrepareHead($object);
  192. dol_fiche_head($head, 'card', $langs->trans("MyObject"), -1, 'myobject@mymodule');
  193. $formconfirm = '';
  194. // Confirmation to delete
  195. if ($action == 'delete')
  196. {
  197. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1);
  198. }
  199. // Clone confirmation
  200. if ($action == 'clone') {
  201. // Create an array for form
  202. $formquestion = array();
  203. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneMyObject'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
  204. }
  205. // Confirmation of action xxxx
  206. if ($action == 'xxx')
  207. {
  208. $formquestion=array();
  209. /*
  210. $forcecombo=0;
  211. if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
  212. $formquestion = array(
  213. // 'text' => $langs->trans("ConfirmClone"),
  214. // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
  215. // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
  216. // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
  217. );
  218. */
  219. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
  220. }
  221. // Call Hook formConfirm
  222. $parameters = array('lineid' => $lineid);
  223. $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  224. if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
  225. elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
  226. // Print form confirm
  227. print $formconfirm;
  228. // Object card
  229. // ------------------------------------------------------------
  230. $linkback = '<a href="' .dol_buildpath('/mymodule/myobject_list.php',1) . '?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
  231. $morehtmlref='<div class="refidno">';
  232. /*
  233. // Ref bis
  234. $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->creer, 'string', '', 0, 1);
  235. $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->creer, 'string', '', null, null, '', 1);
  236. // Thirdparty
  237. $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
  238. // Project
  239. if (! empty($conf->projet->enabled))
  240. {
  241. $langs->load("projects");
  242. $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
  243. if ($user->rights->mymodule->write)
  244. {
  245. if ($action != 'classify')
  246. $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
  247. if ($action == 'classify') {
  248. //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
  249. $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
  250. $morehtmlref.='<input type="hidden" name="action" value="classin">';
  251. $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  252. $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1);
  253. $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
  254. $morehtmlref.='</form>';
  255. } else {
  256. $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
  257. }
  258. } else {
  259. if (! empty($object->fk_project)) {
  260. $proj = new Project($db);
  261. $proj->fetch($object->fk_project);
  262. $morehtmlref.=$proj->getNomUrl();
  263. } else {
  264. $morehtmlref.='';
  265. }
  266. }
  267. }
  268. */
  269. $morehtmlref.='</div>';
  270. dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
  271. print '<div class="fichecenter">';
  272. print '<div class="fichehalfleft">';
  273. print '<div class="underbanner clearboth"></div>';
  274. print '<table class="border centpercent">'."\n";
  275. // Common attributes
  276. //$keyforbreak='fieldkeytoswithonsecondcolumn';
  277. include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
  278. // Other attributes
  279. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
  280. print '</table>';
  281. print '</div>';
  282. print '</div>';
  283. print '</div>';
  284. print '<div class="clearboth"></div><br>';
  285. dol_fiche_end();
  286. // Buttons for actions
  287. if ($action != 'presend' && $action != 'editline') {
  288. print '<div class="tabsAction">'."\n";
  289. $parameters=array();
  290. $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
  291. if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  292. if (empty($reshook))
  293. {
  294. // Send
  295. print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
  296. // Modify
  297. if ($user->rights->mymodule->write)
  298. {
  299. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a>'."\n";
  300. }
  301. else
  302. {
  303. print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
  304. }
  305. // Clone
  306. if ($user->rights->mymodule->write)
  307. {
  308. print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&amp;socid=' . $object->socid . '&amp;action=clone&amp;object=order">' . $langs->trans("ToClone") . '</a></div>';
  309. }
  310. /*
  311. if ($user->rights->mymodule->write)
  312. {
  313. if ($object->status == 1)
  314. {
  315. print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=disable">'.$langs->trans("Disable").'</a>'."\n";
  316. }
  317. else
  318. {
  319. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=enable">'.$langs->trans("Enable").'</a>'."\n";
  320. }
  321. }
  322. */
  323. if ($user->rights->mymodule->delete)
  324. {
  325. print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>'."\n";
  326. }
  327. else
  328. {
  329. print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
  330. }
  331. }
  332. print '</div>'."\n";
  333. }
  334. // Select mail models is same action as presend
  335. if (GETPOST('modelselected')) {
  336. $action = 'presend';
  337. }
  338. if ($action != 'presend')
  339. {
  340. print '<div class="fichecenter"><div class="fichehalfleft">';
  341. print '<a name="builddoc"></a>'; // ancre
  342. // Documents
  343. /*$objref = dol_sanitizeFileName($object->ref);
  344. $relativepath = $comref . '/' . $comref . '.pdf';
  345. $filedir = $conf->mymodule->dir_output . '/' . $objref;
  346. $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
  347. $genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content
  348. $delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card
  349. print $formfile->showdocuments('mymodule', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
  350. */
  351. // Show links to link elements
  352. $linktoelem = $form->showLinkToObjectBlock($object, null, array('myobject'));
  353. $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
  354. print '</div><div class="fichehalfright"><div class="ficheaddleft">';
  355. $MAXEVENT = 10;
  356. $morehtmlright = '<a href="'.dol_buildpath('/mymodule/myobject_info.php', 1).'?id='.$object->id.'">';
  357. $morehtmlright.= $langs->trans("SeeAll");
  358. $morehtmlright.= '</a>';
  359. // List of actions on element
  360. include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
  361. $formactions = new FormActions($db);
  362. $somethingshown = $formactions->showactions($object, 'myobject', $socid, 1, '', $MAXEVENT, '', $morehtmlright);
  363. print '</div></div></div>';
  364. }
  365. //Select mail models is same action as presend
  366. /*
  367. if (GETPOST('modelselected')) $action = 'presend';
  368. // Presend form
  369. $modelmail='inventory';
  370. $defaulttopic='InformationMessage';
  371. $diroutput = $conf->product->dir_output.'/inventory';
  372. $trackid = 'stockinv'.$object->id;
  373. include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
  374. */
  375. }
  376. // End of page
  377. llxFooter();
  378. $db->close();