26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ecm.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/ecm/class/ecmdirectory.class.php';
34 $langs->loadLangs(array(
"ecm",
"companies",
"other",
"users",
"orders",
"propal",
"bills",
"contracts"));
38 $socid = $user->socid;
43 $user->getrights(
'ecm');
46 $socid =
GETPOST(
'socid',
'int');
47 $action =
GETPOST(
'action',
'aZ09');
53 $module =
GETPOST(
'module',
'alpha');
54 $website =
GETPOST(
'website',
'alpha');
55 $pageid =
GETPOST(
'pageid',
'int');
60 $upload_dir = $conf->ecm->dir_output.
'/'.$section;
62 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
63 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
64 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
66 if (empty($page) || $page == -1) {
69 $offset = $limit * $page;
70 $pageprev = $page - 1;
71 $pagenext = $page + 1;
80 if (!empty($section)) {
81 $result = $ecmdir->fetch($section);
88 $permissiontoread = $user->rights->ecm->read;
90 if (!$permissiontoread) {
111 $userstatic =
new User($db);
116 $sectionauto = array();
118 $langs->load(
"products"); $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'product',
'test'=>(
isModEnabled(
"product") ||
isModEnabled(
"service")),
'label'=>$langs->trans(
"ProductsAndServices"),
'desc'=>$langs->trans(
"ECMDocsByProducts"));
121 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'company',
'test'=>
isModEnabled(
'societe'),
'label'=>$langs->trans(
"ThirdParties"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"ThirdParties")));
124 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'propal',
'test'=>
isModEnabled(
'propal'),
'label'=>$langs->trans(
"Proposals"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Proposals")));
127 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'contract',
'test'=>
isModEnabled(
'contrat'),
'label'=>$langs->trans(
"Contracts"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Contracts")));
130 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'order',
'test'=>
isModEnabled(
'commande'),
'label'=>$langs->trans(
"CustomersOrders"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Orders")));
133 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'invoice',
'test'=>
isModEnabled(
'facture'),
'label'=>$langs->trans(
"CustomersInvoices"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Invoices")));
136 $langs->load(
"supplier_proposal"); $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'supplier_proposal',
'test'=>
isModEnabled(
'supplier_proposal'),
'label'=>$langs->trans(
"SupplierProposals"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"SupplierProposals")));
138 if ((
isModEnabled(
"fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) ||
isModEnabled(
"supplier_order")) {
139 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'order_supplier',
'test'=>((
isModEnabled(
"fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) ||
isModEnabled(
"supplier_order")),
'label'=>$langs->trans(
"SuppliersOrders"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"PurchaseOrders")));
141 if ((
isModEnabled(
"fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) ||
isModEnabled(
"supplier_invoice")) {
142 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'invoice_supplier',
'test'=>((
isModEnabled(
"fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) ||
isModEnabled(
"supplier_invoice")),
'label'=>$langs->trans(
"SuppliersInvoices"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"SupplierInvoices")));
145 $langs->load(
"compta"); $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'tax',
'test'=>
isModEnabled(
'tax'),
'label'=>$langs->trans(
"SocialContributions"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"SocialContributions")));
148 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'project',
'test'=>
isModEnabled(
'project'),
'label'=>$langs->trans(
"Projects"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Projects")));
151 $langs->load(
"interventions"); $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'fichinter',
'test'=>
isModEnabled(
'ficheinter'),
'label'=>$langs->trans(
"Interventions"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Interventions")));
154 $langs->load(
"trips"); $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'expensereport',
'test'=>
isModEnabled(
'expensereport'),
'label'=>$langs->trans(
"ExpenseReports"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"ExpenseReports")));
157 $langs->load(
"holiday"); $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'holiday',
'test'=>
isModEnabled(
'holiday'),
'label'=>$langs->trans(
"Holidays"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Holidays")));
160 $langs->load(
"banks"); $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'banque',
'test'=>
isModEnabled(
'banque'),
'label'=>$langs->trans(
"BankAccount"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"BankAccount")));
163 $langs->load(
"mrp"); $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'mrp-mo',
'test'=>
isModEnabled(
'mrp'),
'label'=>$langs->trans(
"MOs"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"ManufacturingOrders")));
166 $langs->load(
"recruitment"); $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'recruitment-recruitmentcandidature',
'test'=>
isModEnabled(
'recruitment'),
'label'=>$langs->trans(
"Candidatures"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"JobApplications")));
173 print
load_fiche_titre($langs->trans(
"ECMArea").
' - '.$langs->trans(
"Search"));
175 print $langs->trans(
"FeatureNotYetAvailable").
'.<br><br>';
182 print
'<table class="border centpercent"><tr><td width="40%" valign="top">';
189 print
'<form method="post" action="'.DOL_URL_ROOT.
'/ecm/search.php">';
190 print
'<input type="hidden" name="token" value="'.newToken().
'">';
191 print
'<table class="nobordernopadding" width="100%">';
192 print
"<tr class=\"liste_titre\">";
193 print
'<td colspan="2">'.$langs->trans(
"ECMSearchByKeywords").
'</td></tr>';
194 print
'<tr class="impair"><td>'.$langs->trans(
"Ref").
':</td><td class="right"><input type="text" name="search_ref" class="flat" size="10"></td></tr>';
195 print
'<tr class="impair"><td>'.$langs->trans(
"Title").
':</td><td class="right"><input type="text" name="search_title" class="flat" size="10"></td></tr>';
196 print
'<tr class="impair"><td>'.$langs->trans(
"Keyword").
':</td><td class="right"><input type="text" name="search_keyword" class="flat" size="10"></td></tr>';
197 print
'<tr class="impair"><td colspan="2" class="center"><input type="submit" class="button" value="'.$langs->trans(
"Search").
'"></td></tr>';
198 print
"</table></form>";
203 print
'<form method="post" action="'.DOL_URL_ROOT.
'/ecm/search.php">';
204 print
'<input type="hidden" name="token" value="'.newToken().
'">';
205 print
'<table class="nobordernopadding" width="100%">';
206 print
"<tr class=\"liste_titre\">";
207 print
'<td colspan="4">'.$langs->trans(
"ECMSearchByEntity").
'</td></tr>';
209 $buthtml =
'<td rowspan="'.$rowspan.
'"><input type="submit" value="'.$langs->trans(
"Search").
'" class="button"></td>';
211 foreach ($sectionauto as $sectioncur) {
212 if (!$sectioncur[
'test']) {
215 print
'<tr class="impair">';
216 print
"<td>".$sectioncur[
'label'].
':</td>';
218 print
' class="right"';
220 print
'<input type="text" name="search_'.$sectioncur[
'module'].
'" class="flat" size="14">';
226 print
'<tr '.$bc[
false].
'><td colspan="4" class="center"><input type="submit" class="button" value="'.$langs->trans(
"Search").
'"></td></tr>';
227 print
"</table></form>";
232 print
'</td><td class="tdtop">';
235 $relativepath = $ecmdir->getRelativePath();
236 $upload_dir = $conf->ecm->dir_output.
'/'.$relativepath;
237 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ?SORT_DESC:SORT_ASC), 1);
240 $param =
'§ion='.urlencode($section);
241 $textifempty = ($section ? $langs->trans(
"NoFileFound") : $langs->trans(
"ECMSelectASection"));
242 $formfile->list_of_documents($filearray,
'',
'ecm', $param, 1, $relativepath, $user->rights->ecm->upload, 1, $textifempty);
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage ECM directories.
Class to manage Dolibarr users.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
ecm_prepare_head_fm($object)
Prepare array with list of tabs.
dol_dir_list($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.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
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.