26require
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/ecm.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
31require_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');
65$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
66if (empty($page) || $page == -1) {
69$offset = $limit * $page;
80if (!empty($section)) {
81 $result = $ecmdir->fetch($section);
88$permissiontoread = $user->rights->ecm->read;
90if (!$permissiontoread) {
109$form =
new Form($db);
111$userstatic =
new User($db);
116$sectionauto = array();
117if (isModEnabled(
"product") || isModEnabled(
"service")) {
118 $langs->load(
"products"); $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'product',
'test'=>(isModEnabled(
"product") || isModEnabled(
"service")),
'label'=>$langs->trans(
"ProductsAndServices"),
'desc'=>$langs->trans(
"ECMDocsByProducts"));
120if (isModEnabled(
"societe")) {
121 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'company',
'test'=>isModEnabled(
'societe'),
'label'=>$langs->trans(
"ThirdParties"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"ThirdParties")));
123if (isModEnabled(
"propal")) {
124 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'propal',
'test'=>isModEnabled(
'propal'),
'label'=>$langs->trans(
"Proposals"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Proposals")));
126if (isModEnabled(
'contrat')) {
127 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'contract',
'test'=>isModEnabled(
'contrat'),
'label'=>$langs->trans(
"Contracts"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Contracts")));
129if (isModEnabled(
'commande')) {
130 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'order',
'test'=>isModEnabled(
'commande'),
'label'=>$langs->trans(
"CustomersOrders"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Orders")));
132if (isModEnabled(
'facture')) {
133 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'invoice',
'test'=>isModEnabled(
'facture'),
'label'=>$langs->trans(
"CustomersInvoices"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Invoices")));
135if (isModEnabled(
'supplier_proposal')) {
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")));
138if (isModEnabled(
"supplier_order")) {
139 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'order_supplier',
'test'=>isModEnabled(
"supplier_order"),
'label'=>$langs->trans(
"SuppliersOrders"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"PurchaseOrders")));
141if (isModEnabled(
"supplier_invoice")) {
142 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'invoice_supplier',
'test'=>isModEnabled(
"supplier_invoice"),
'label'=>$langs->trans(
"SuppliersInvoices"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"SupplierInvoices")));
144if (isModEnabled(
'tax')) {
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")));
147if (isModEnabled(
'project')) {
148 $rowspan++; $sectionauto[] = array(
'level'=>1,
'module'=>
'project',
'test'=>isModEnabled(
'project'),
'label'=>$langs->trans(
"Projects"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Projects")));
150if (isModEnabled(
'ficheinter')) {
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")));
153if (isModEnabled(
'expensereport')) {
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")));
156if (isModEnabled(
'holiday')) {
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")));
159if (isModEnabled(
"banque")) {
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")));
162if (isModEnabled(
'mrp')) {
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")));
165if (isModEnabled(
'recruitment')) {
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")));
173print
load_fiche_titre($langs->trans(
"ECMArea").
' - '.$langs->trans(
"Search"));
175print $langs->trans(
"FeatureNotYetAvailable").
'.<br><br>';
182print
'<table class="border centpercent"><tr><td width="40%" valign="top">';
189print
'<form method="post" action="'.DOL_URL_ROOT.
'/ecm/search.php">';
190print
'<input type="hidden" name="token" value="'.newToken().
'">';
191print
'<table class="nobordernopadding" width="100%">';
192print
"<tr class=\"liste_titre\">";
193print
'<td colspan="2">'.$langs->trans(
"ECMSearchByKeywords").
'</td></tr>';
194print
'<tr class="impair"><td>'.$langs->trans(
"Ref").
':</td><td class="right"><input type="text" name="search_ref" class="flat" size="10"></td></tr>';
195print
'<tr class="impair"><td>'.$langs->trans(
"Title").
':</td><td class="right"><input type="text" name="search_title" class="flat" size="10"></td></tr>';
196print
'<tr class="impair"><td>'.$langs->trans(
"Keyword").
':</td><td class="right"><input type="text" name="search_keyword" class="flat" size="10"></td></tr>';
197print
'<tr class="impair"><td colspan="2" class="center"><input type="submit" class="button" value="'.$langs->trans(
"Search").
'"></td></tr>';
198print
"</table></form>";
203print
'<form method="post" action="'.DOL_URL_ROOT.
'/ecm/search.php">';
204print
'<input type="hidden" name="token" value="'.newToken().
'">';
205print
'<table class="nobordernopadding" width="100%">';
206print
"<tr class=\"liste_titre\">";
207print
'<td colspan="4">'.$langs->trans(
"ECMSearchByEntity").
'</td></tr>';
209$buthtml =
'<td rowspan="'.$rowspan.
'"><input type="submit" value="'.$langs->trans(
"Search").
'" class="button"></td>';
211foreach ($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">';
226print
'<tr '.$bc[
false].
'><td colspan="4" class="center"><input type="submit" class="button" value="'.$langs->trans(
"Search").
'"></td></tr>';
227print
"</table></form>";
232print
'</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.
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.
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.