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->loadRights(
'ecm');
47$action =
GETPOST(
'action',
'aZ09');
53$module =
GETPOST(
'module',
'alpha');
54$website =
GETPOST(
'website',
'alpha');
60$upload_dir = $conf->ecm->dir_output.
'/'.$section;
63$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
64$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
66if (empty($page) || $page == -1) {
69$offset = $limit * $page;
80if (!empty($section)) {
81 $result = $ecmdir->fetch($section);
88$permissiontoread = $user->hasRight(
'ecm',
'read');
90if (!$permissiontoread) {
107llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-ecm page-search');
109$form =
new Form($db);
111$userstatic =
new User($db);
116$sectionauto = array();
117if (isModEnabled(
"product") || isModEnabled(
"service")) {
118 $langs->load(
"products");
120 $sectionauto[] = array(
'level'=>1,
'module'=>
'product',
'test'=>(isModEnabled(
"product") || isModEnabled(
"service")),
'label'=>$langs->trans(
"ProductsAndServices"),
'desc'=>$langs->trans(
"ECMDocsByProducts"));
122if (isModEnabled(
"societe")) {
124 $sectionauto[] = array(
'level'=>1,
'module'=>
'company',
'test'=>isModEnabled(
'societe'),
'label'=>$langs->trans(
"ThirdParties"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"ThirdParties")));
126if (isModEnabled(
"propal")) {
128 $sectionauto[] = array(
'level'=>1,
'module'=>
'propal',
'test'=>isModEnabled(
'propal'),
'label'=>$langs->trans(
"Proposals"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Proposals")));
130if (isModEnabled(
'contract')) {
132 $sectionauto[] = array(
'level'=>1,
'module'=>
'contract',
'test'=>isModEnabled(
'contract'),
'label'=>$langs->trans(
"Contracts"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Contracts")));
134if (isModEnabled(
'order')) {
136 $sectionauto[] = array(
'level'=>1,
'module'=>
'order',
'test'=>isModEnabled(
'order'),
'label'=>$langs->trans(
"CustomersOrders"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Orders")));
138if (isModEnabled(
'invoice')) {
140 $sectionauto[] = array(
'level'=>1,
'module'=>
'invoice',
'test'=>isModEnabled(
'invoice'),
'label'=>$langs->trans(
"CustomersInvoices"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Invoices")));
142if (isModEnabled(
'supplier_proposal')) {
143 $langs->load(
"supplier_proposal");
145 $sectionauto[] = array(
'level'=>1,
'module'=>
'supplier_proposal',
'test'=>isModEnabled(
'supplier_proposal'),
'label'=>$langs->trans(
"SupplierProposals"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"SupplierProposals")));
147if (isModEnabled(
"supplier_order")) {
149 $sectionauto[] = array(
'level'=>1,
'module'=>
'order_supplier',
'test'=>isModEnabled(
"supplier_order"),
'label'=>$langs->trans(
"SuppliersOrders"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"PurchaseOrders")));
151if (isModEnabled(
"supplier_invoice")) {
153 $sectionauto[] = array(
'level'=>1,
'module'=>
'invoice_supplier',
'test'=>isModEnabled(
"supplier_invoice"),
'label'=>$langs->trans(
"SuppliersInvoices"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"SupplierInvoices")));
155if (isModEnabled(
'tax')) {
156 $langs->load(
"compta");
158 $sectionauto[] = array(
'level'=>1,
'module'=>
'tax',
'test'=>isModEnabled(
'tax'),
'label'=>$langs->trans(
"SocialContributions"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"SocialContributions")));
160if (isModEnabled(
'project')) {
162 $sectionauto[] = array(
'level'=>1,
'module'=>
'project',
'test'=>isModEnabled(
'project'),
'label'=>$langs->trans(
"Projects"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Projects")));
164if (isModEnabled(
'intervention')) {
165 $langs->load(
"interventions");
167 $sectionauto[] = array(
'level'=>1,
'module'=>
'fichinter',
'test'=>isModEnabled(
'intervention'),
'label'=>$langs->trans(
"Interventions"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Interventions")));
169if (isModEnabled(
'expensereport')) {
170 $langs->load(
"trips");
172 $sectionauto[] = array(
'level'=>1,
'module'=>
'expensereport',
'test'=>isModEnabled(
'expensereport'),
'label'=>$langs->trans(
"ExpenseReports"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"ExpenseReports")));
174if (isModEnabled(
'holiday')) {
175 $langs->load(
"holiday");
177 $sectionauto[] = array(
'level'=>1,
'module'=>
'holiday',
'test'=>isModEnabled(
'holiday'),
'label'=>$langs->trans(
"Holidays"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"Holidays")));
179if (isModEnabled(
"bank")) {
180 $langs->load(
"banks");
182 $sectionauto[] = array(
'level'=>1,
'module'=>
'banque',
'test'=>isModEnabled(
'bank'),
'label'=>$langs->trans(
"BankAccount"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"BankAccount")));
184if (isModEnabled(
'mrp')) {
187 $sectionauto[] = array(
'level'=>1,
'module'=>
'mrp-mo',
'test'=>isModEnabled(
'mrp'),
'label'=>$langs->trans(
"MOs"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"ManufacturingOrders")));
189if (isModEnabled(
'recruitment')) {
190 $langs->load(
"recruitment");
192 $sectionauto[] = array(
'level'=>1,
'module'=>
'recruitment-recruitmentcandidature',
'test'=>isModEnabled(
'recruitment'),
'label'=>$langs->trans(
"Candidatures"),
'desc'=>$langs->trans(
"ECMDocsBy", $langs->transnoentitiesnoconv(
"JobApplications")));
199print
load_fiche_titre($langs->trans(
"ECMArea").
' - '.$langs->trans(
"Search"));
201print $langs->trans(
"FeatureNotYetAvailable").
'.<br><br>';
208print
'<table class="border centpercent"><tr><td width="40%" valign="top">';
215print
'<form method="post" action="'.DOL_URL_ROOT.
'/ecm/search.php">';
216print
'<input type="hidden" name="token" value="'.newToken().
'">';
217print
'<table class="nobordernopadding" width="100%">';
218print
"<tr class=\"liste_titre\">";
219print
'<td colspan="2">'.$langs->trans(
"ECMSearchByKeywords").
'</td></tr>';
220print
'<tr class="impair"><td>'.$langs->trans(
"Ref").
':</td><td class="right"><input type="text" name="search_ref" class="flat" size="10"></td></tr>';
221print
'<tr class="impair"><td>'.$langs->trans(
"Title").
':</td><td class="right"><input type="text" name="search_title" class="flat" size="10"></td></tr>';
222print
'<tr class="impair"><td>'.$langs->trans(
"Keyword").
':</td><td class="right"><input type="text" name="search_keyword" class="flat" size="10"></td></tr>';
223print
'<tr class="impair"><td colspan="2" class="center"><input type="submit" class="button" value="'.$langs->trans(
"Search").
'"></td></tr>';
224print
"</table></form>";
229print
'<form method="post" action="'.DOL_URL_ROOT.
'/ecm/search.php">';
230print
'<input type="hidden" name="token" value="'.newToken().
'">';
231print
'<table class="nobordernopadding" width="100%">';
232print
"<tr class=\"liste_titre\">";
233print
'<td colspan="4">'.$langs->trans(
"ECMSearchByEntity").
'</td></tr>';
235$buthtml =
'<td rowspan="'.$rowspan.
'"><input type="submit" value="'.$langs->trans(
"Search").
'" class="button"></td>';
237foreach ($sectionauto as $sectioncur) {
238 if (!$sectioncur[
'test']) {
241 print
'<tr class="impair">';
242 print
"<td>".$sectioncur[
'label'].
':</td>';
244 print
' class="right"';
246 print
'<input type="text" name="search_'.$sectioncur[
'module'].
'" class="flat" size="14">';
252print
'<tr '.$bc[
false].
'><td colspan="4" class="center"><input type="submit" class="button" value="'.$langs->trans(
"Search").
'"></td></tr>';
253print
"</table></form>";
258print
'</td><td class="tdtop">';
261$relativepath = $ecmdir->getRelativePath();
262$upload_dir = $conf->ecm->dir_output.
'/'.$relativepath;
263$filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ? SORT_DESC : SORT_ASC), 1);
266$param =
'§ion='.urlencode($section);
267$textifempty = ($section ? $langs->trans(
"NoFileFound") : $langs->trans(
"ECMSelectASection"));
268$formfile->list_of_documents($filearray,
'',
'ecm', $param, 1, $relativepath, $user->hasRight(
'ecm',
'upload'), 1, $textifempty);
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.
Class to manage ECM directories.
Class to manage Dolibarr users.
ecm_prepare_head_fm($object)
Prepare array with list of tabs.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.