25require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/product/inventory/class/inventory.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/product/inventory/lib/inventory.lib.php';
41$langs->loadLangs(array(
"stocks",
"other",
"mails"));
43$action =
GETPOST(
'action',
'aZ09');
50$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
51$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
53if (empty($page) || $page == -1) {
56$offset = $limit * $page;
68$hookmanager->initHooks(array(
'inventorydocument',
'globalcard'));
71$extrafields->fetch_name_optionals_label(
$object->table_element);
74include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
77if ($id > 0 || !empty($ref)) {
82if ($user->socid > 0) {
87$permissiontoadd = $user->hasRight(
'stock',
'creer');
94include DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
103$title = $langs->trans(
"Inventory").
' - '.$langs->trans(
"Files");
104$help_url =
'EN:Module_Stocks_En|FR:Module_Stock|DE:Modul_Lager';
106llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-product page-inventory_document');
108if (
$object->id && $upload_dir !==
null) {
117 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ? SORT_DESC : SORT_ASC), 1);
119 foreach ($filearray as $key => $file) {
120 $totalsize += $file[
'size'];
125 $linkback =
'<a href="'.dol_buildpath(
'/product/inventory/list.php', 1).
'?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
127 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref');
129 print
'<div class="fichecenter">';
131 print
'<div class="underbanner clearboth"></div>';
132 print
'<table class="border centpercent tableforfield">';
135 print
'<tr><td class="titlefield">'.$langs->trans(
"NbOfAttachedFiles").
'</td><td colspan="3">'.count($filearray).
'</td></tr>';
138 print
'<tr><td>'.$langs->trans(
"TotalSizeOfAttachedFiles").
'</td><td colspan="3">'.$totalsize.
' '.$langs->trans(
"bytes").
'</td></tr>';
146 $modulepart =
'inventory';
147 $permtoedit = $user->hasRight(
'stock',
'creer');
148 $param =
'&id='.$object->id;
152 include DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=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, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
inventoryPrepareHead(&$inventory, $title='Inventory', $get='')
Define head array for tabs of inventory tools setup pages.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.