card.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <?php
  2. /* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/product/inventory/card.php
  19. * \ingroup inventory
  20. * \brief Inventory card
  21. */
  22. // Load Dolibarr environment
  23. require '../../main.inc.php';
  24. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
  27. require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/product/inventory/lib/inventory.lib.php';
  29. // Load translation files required by the page
  30. $langs->loadLangs(array("stocks", "other"));
  31. // Get parameters
  32. $id = GETPOST('id', 'int');
  33. $ref = GETPOST('ref', 'alpha');
  34. $action = GETPOST('action', 'aZ09');
  35. $confirm = GETPOST('confirm', 'alpha');
  36. $cancel = GETPOST('cancel', 'aZ09');
  37. $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'inventorycard'; // To manage different context of search
  38. $backtopage = GETPOST('backtopage', 'alpha');
  39. $include_sub_warehouse = !empty(GETPOST('include_sub_warehouse')) ? GETPOST('include_sub_warehouse') : 0;
  40. if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
  41. $result = restrictedArea($user, 'stock', $id);
  42. } else {
  43. $result = restrictedArea($user, 'stock', $id, '', 'inventory_advance');
  44. }
  45. // Initialize technical objects
  46. $object = new Inventory($db);
  47. $extrafields = new ExtraFields($db);
  48. // no inventory docs yet
  49. $includedocgeneration = false;
  50. $diroutputmassaction = null;
  51. // $diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id;
  52. $hookmanager->initHooks(array('inventorycard', 'globalcard')); // Note that conf->hooks_modules contains array
  53. // Fetch optionals attributes and labels
  54. $extrafields->fetch_name_optionals_label($object->table_element);
  55. $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
  56. // Initialize array of search criterias
  57. $search_all = GETPOST("search_all", 'alpha');
  58. $search = array();
  59. foreach ($object->fields as $key => $val) {
  60. if (GETPOST('search_'.$key, 'alpha')) {
  61. $search[$key] = GETPOST('search_'.$key, 'alpha');
  62. }
  63. }
  64. if (empty($action) && empty($id) && empty($ref)) {
  65. $action = 'view';
  66. }
  67. // Load object
  68. include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
  69. // Security check - Protection if external user
  70. //if ($user->socid > 0) accessforbidden();
  71. //if ($user->socid > 0) $socid = $user->socid;
  72. //$result = restrictedArea($user, 'mymodule', $id);
  73. if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
  74. $permissiontoread = $user->rights->stock->lire;
  75. $permissiontoadd = $user->rights->stock->creer;
  76. $permissiontodelete = $user->rights->stock->supprimer;
  77. $permissionnote = $user->rights->stock->creer; // Used by the include of actions_setnotes.inc.php
  78. $permissiondellink = $user->rights->stock->creer; // Used by the include of actions_dellink.inc.php
  79. $upload_dir = $conf->stock->multidir_output[isset($object->entity) ? $object->entity : 1];
  80. } else {
  81. $permissiontoread = $user->rights->stock->inventory_advance->read;
  82. $permissiontoadd = $user->rights->stock->inventory_advance->write;
  83. $permissiontodelete = $user->rights->stock->inventory_advance->delete;
  84. $permissionnote = $user->rights->stock->inventory_advance->write; // Used by the include of actions_setnotes.inc.php
  85. $permissiondellink = $user->rights->stock->inventory_advance->write; // Used by the include of actions_dellink.inc.php
  86. $upload_dir = $conf->stock->multidir_output[isset($object->entity) ? $object->entity : 1];
  87. }
  88. /*
  89. * Actions
  90. */
  91. $parameters = array();
  92. $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
  93. if ($reshook < 0) {
  94. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  95. }
  96. if (empty($reshook)) {
  97. $savaction = $action;
  98. $error = 0;
  99. $backurlforlist = DOL_URL_ROOT.'/product/inventory/list.php';
  100. if (empty($backtopage) || ($cancel && empty($id))) {
  101. if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
  102. if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
  103. $backtopage = $backurlforlist;
  104. } else {
  105. $backtopage = dol_buildpath('/product/inventory/card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
  106. }
  107. }
  108. }
  109. $triggermodname = 'STOCK_INVENTORY_MODIFY'; // Name of trigger action code to execute when we modify record
  110. // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
  111. include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
  112. // Actions when linking object each other
  113. include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
  114. // Actions when printing a doc from card
  115. include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
  116. // Action to move up and down lines of object
  117. //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
  118. // Action to build doc
  119. include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
  120. /*if ($action == 'set_thirdparty' && $permissiontoadd)
  121. {
  122. $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MYOBJECT_MODIFY');
  123. }*/
  124. if ($action == 'classin' && $permissiontoadd) {
  125. $object->setProject(GETPOST('projectid', 'int'));
  126. }
  127. // Actions to send emails
  128. $triggersendname = 'INVENTORY_SENTBYMAIL';
  129. $autocopy = 'MAIN_MAIL_AUTOCOPY_INVENTORY_TO';
  130. $trackid = 'stockinv'.$object->id;
  131. include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
  132. if (!$error && $savaction == 'confirm_validate' && $action == '' && $object->id > 0) {
  133. // Switch to the tab inventory
  134. header("Location: ".DOL_URL_ROOT.'/product/inventory/inventory.php?id='.$object->id);
  135. exit;
  136. }
  137. }
  138. /*
  139. * View
  140. */
  141. $form = new Form($db);
  142. $formfile = new FormFile($db);
  143. $formproject = new FormProjets($db);
  144. $title = $langs->trans("Inventory");
  145. $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks|DE:Modul_Bestände';
  146. llxHeader('', $title, $help_url);
  147. // Part to create
  148. if ($action == 'create') {
  149. print load_fiche_titre($langs->trans("NewInventory"), '', 'product');
  150. print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
  151. print '<input type="hidden" name="token" value="'.newToken().'">';
  152. print '<input type="hidden" name="action" value="add">';
  153. if ($backtopage) {
  154. print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
  155. }
  156. if (!empty($backtopageforcancel)) {
  157. print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
  158. }
  159. print dol_get_fiche_head(array(), '');
  160. print '<table class="border centpercent tableforfieldcreate">'."\n";
  161. // Common attributes
  162. include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
  163. // Other attributes
  164. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
  165. //print '<tr><td class="titlefield fieldname_invcode">'.$langs->trans("InventoryCode").'</td><td>INV'.$object->id.'</td></tr>';
  166. print '</table>'."\n";
  167. print dol_get_fiche_end();
  168. print $form->buttonsSaveCancel("Create");
  169. print '</form>';
  170. dol_set_focus('input[name="ref"]');
  171. }
  172. // Part to edit record
  173. if (($id || $ref) && $action == 'edit') {
  174. print load_fiche_titre($langs->trans("Inventory"), '', 'product');
  175. print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
  176. print '<input type="hidden" name="token" value="'.newToken().'">';
  177. print '<input type="hidden" name="action" value="update">';
  178. print '<input type="hidden" name="id" value="'.$object->id.'">';
  179. if ($backtopage) {
  180. print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
  181. }
  182. if ($backtopageforcancel) {
  183. print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
  184. }
  185. print dol_get_fiche_head();
  186. print '<table class="border centpercent tableforfieldedit">'."\n";
  187. // Common attributes
  188. include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
  189. // Other attributes
  190. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
  191. print '</table>';
  192. print dol_get_fiche_end();
  193. print $form->buttonsSaveCancel();
  194. print '</form>';
  195. }
  196. // Part to show record
  197. if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
  198. $res = $object->fetch_optionals();
  199. $head = inventoryPrepareHead($object);
  200. print dol_get_fiche_head($head, 'card', $langs->trans("Inventory"), -1, 'stock');
  201. $formconfirm = '';
  202. // Confirmation of action xxxx
  203. if ($action == 'setdraft') {
  204. $text = $langs->trans('ConfirmSetToDraftInventory', $object->ref);
  205. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetToDraft'), $text, 'confirm_setdraft', '', 0, 1, 220);
  206. }
  207. // Confirmation to delete
  208. if ($action == 'delete') {
  209. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
  210. }
  211. // Clone confirmation
  212. if ($action == 'clone') {
  213. // Create an array for form
  214. $formquestion = array();
  215. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
  216. }
  217. // Confirmation of action xxxx
  218. if ($action == 'xxx') {
  219. $formquestion = array();
  220. /*
  221. $forcecombo=0;
  222. if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
  223. $formquestion = array(
  224. // 'text' => $langs->trans("ConfirmClone"),
  225. // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
  226. // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
  227. // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
  228. );
  229. */
  230. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
  231. }
  232. if ($action == 'validate') {
  233. $form = new Form($db);
  234. $formquestion = '';
  235. if (getDolGlobalInt('INVENTORY_INCLUDE_SUB_WAREHOUSE') && !empty($object->fk_warehouse)) {
  236. $formquestion = array(
  237. array('type' => 'checkbox', 'name' => 'include_sub_warehouse', 'label' => $langs->trans("IncludeSubWarehouse"), 'value' => 1, 'size' => '10'),
  238. );
  239. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateInventory'), $langs->trans('IncludeSubWarehouseExplanation'), 'confirm_validate', $formquestion, '', 1);
  240. }
  241. }
  242. // Call Hook formConfirm
  243. $parameters = array('formConfirm' => $formconfirm);
  244. $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  245. if (empty($reshook)) {
  246. $formconfirm .= $hookmanager->resPrint;
  247. } elseif ($reshook > 0) {
  248. $formconfirm = $hookmanager->resPrint;
  249. }
  250. // Print form confirm
  251. print $formconfirm;
  252. // Object card
  253. // ------------------------------------------------------------
  254. $linkback = '<a href="'.DOL_URL_ROOT.'/product/inventory/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
  255. $morehtmlref = '<div class="refidno">';
  256. /*
  257. // Ref bis
  258. $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->inventory->creer, 'string', '', 0, 1);
  259. $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->inventory->creer, 'string', '', null, null, '', 1);
  260. // Thirdparty
  261. $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
  262. // Project
  263. if (isModEnabled('project'))
  264. {
  265. $langs->load("projects");
  266. $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
  267. if ($permissiontoadd)
  268. {
  269. if ($action != 'classify')
  270. {
  271. $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
  272. if ($action == 'classify') {
  273. //$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 0, 1, '', 'maxwidth300');
  274. $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
  275. $morehtmlref .= '<input type="hidden" name="action" value="classin">';
  276. $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
  277. $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
  278. $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
  279. $morehtmlref .= '</form>';
  280. } else {
  281. $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
  282. }
  283. }
  284. } else {
  285. if (!empty($object->fk_project)) {
  286. $proj = new Project($db);
  287. $proj->fetch($object->fk_project);
  288. $morehtmlref .= $proj->getNomUrl();
  289. } else {
  290. $morehtmlref.='';
  291. }
  292. }
  293. }
  294. */
  295. $morehtmlref .= '</div>';
  296. dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
  297. print '<div class="fichecenter">';
  298. print '<div class="fichehalfleft">';
  299. print '<div class="underbanner clearboth"></div>';
  300. print '<table class="border centpercent tableforfield">'."\n";
  301. // Common attributes
  302. include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
  303. // Other attributes. Fields from hook formObjectOptions and Extrafields.
  304. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
  305. print '</table>';
  306. print '</div>';
  307. print '</div>';
  308. print '<div class="clearboth"></div>';
  309. print dol_get_fiche_end();
  310. // Buttons for actions
  311. if ($action != 'presend' && $action != 'editline') {
  312. print '<div class="tabsAction">'."\n";
  313. $parameters = array();
  314. $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  315. if ($reshook < 0) {
  316. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  317. }
  318. if (empty($reshook)) {
  319. // Send
  320. if (empty($user->socid)) {
  321. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
  322. }
  323. // Back to draft
  324. if ($object->status == $object::STATUS_VALIDATED) {
  325. if ($permissiontoadd) {
  326. print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=setdraft&confirm=yes&token='.newToken().'">'.$langs->trans("SetToDraft").'</a>';
  327. }
  328. }
  329. // Back to validate
  330. if ($object->status == $object::STATUS_RECORDED) {
  331. if ($permissiontoadd) {
  332. print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken().'">'.$langs->trans("ReOpen").'</a>';
  333. }
  334. }
  335. // Modify
  336. if ($object->status == $object::STATUS_DRAFT) {
  337. if ($permissiontoadd) {
  338. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
  339. } else {
  340. print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
  341. }
  342. }
  343. // Validate
  344. if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_CANCELED) {
  345. if ($permissiontoadd) {
  346. if (getDolGlobalInt('INVENTORY_INCLUDE_SUB_WAREHOUSE') && !empty($object->fk_warehouse)) {
  347. print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=validate&token='.newToken().'">'.$langs->trans("Validate").' ('.$langs->trans("ToStart").')</a>';
  348. } else {
  349. print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken().'">'.$langs->trans("Validate").' ('.$langs->trans("ToStart").')</a>';
  350. }
  351. }
  352. }
  353. // Clone
  354. if ($permissiontoadd) {
  355. //print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=inventory', 'clone', $permissiontoadd);
  356. }
  357. // Delete
  358. print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
  359. }
  360. print '</div>'."\n";
  361. }
  362. // Select mail models is same action as presend
  363. if (GETPOST('modelselected')) {
  364. $action = 'presend';
  365. }
  366. if ($action != 'presend') {
  367. print '<div class="fichecenter"><div class="fichehalfleft">';
  368. print '<a name="builddoc"></a>'; // ancre
  369. // Documents
  370. if ($includedocgeneration) {
  371. $objref = dol_sanitizeFileName($object->ref);
  372. $relativepath = $objref.'/'.$objref.'.pdf';
  373. $filedir = $conf->mymodule->dir_output.'/'.$object->element.'/'.$objref;
  374. $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
  375. $genallowed = $user->rights->mymodule->myobject->read; // If you can read, you can build the PDF to read content
  376. $delallowed = $user->rights->mymodule->myobject->write; // If you can create/edit, you can remove a file on card
  377. print $formfile->showdocuments('mymodule:MyObject', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
  378. }
  379. // Show links to link elements
  380. $linktoelem = $form->showLinkToObjectBlock($object, null, array('inventory'));
  381. $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
  382. print '</div><div class="fichehalfright">';
  383. $MAXEVENT = 10;
  384. //$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/inventory/inventory_info.php?id='.$object->id);
  385. $morehtmlcenter = '';
  386. // List of actions on element
  387. include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
  388. $formactions = new FormActions($db);
  389. $somethingshown = $formactions->showactions($object, $object->element, 0, 1, '', $MAXEVENT, '', $morehtmlcenter);
  390. print '</div></div>';
  391. }
  392. //Select mail models is same action as presend
  393. if (GETPOST('modelselected')) {
  394. $action = 'presend';
  395. }
  396. // Presend form
  397. $modelmail = 'inventory';
  398. $defaulttopic = 'InformationMessage';
  399. $diroutput = $conf->product->dir_output.'/inventory';
  400. $trackid = 'stockinv'.$object->id;
  401. include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
  402. }
  403. // End of page
  404. llxFooter();
  405. $db->close();