diff --git a/htdocs/core/modules/modIntracommreport.class.php b/htdocs/core/modules/modIntracommreport.class.php index 50db0307a40..1ab8b11173d 100644 --- a/htdocs/core/modules/modIntracommreport.class.php +++ b/htdocs/core/modules/modIntracommreport.class.php @@ -94,8 +94,8 @@ class modIntracommreport extends DolibarrModules $this->dictionaries=array(); // Permissions - $this->rights_class = 'intracommreport'; - $this->rights = array(); // Permission array used by this module + $this->rights = array(); + $this->rights_class = 'intracommreport'; $r = 0; $r++; @@ -112,12 +112,12 @@ class modIntracommreport extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'write'; + $r++; $this->rights[$r][0] = 68004; $this->rights[$r][1] = 'Delete intracomm report'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'delete'; - $r++; // Main menu entries $this->menu = array(); // List of menus to add diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 8145948cc0d..6c128e0c644 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -107,12 +107,8 @@ $isInEEC=isInEEC($mysoc); // Definition of fields for lists $arrayfields=array( 'i.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - //'pfi.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), 'i.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), 'i.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(! empty($conf->produit->enabled) && ! empty($conf->service->enabled))), - 'i.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), - 'i.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))), - 'i.weight'=>array('label'=>$langs->trans("Weight"), 'checked'=>0, 'enabled'=>(! empty($conf->produit->enabled))), ); /* // Extra fields @@ -152,11 +148,6 @@ if (empty($reshook)) $sall=""; $search_ref=""; $search_label=""; - $search_barcode=""; - $search_categ=0; - $search_tosell=""; - $search_tobuy=""; - $search_tobatch=''; //$search_type=''; // There is 2 types of list: a list of product and a list of services. No list with both. So when we clear search criteria, we must keep the filter on type. $show_childproducts = ''; @@ -268,18 +259,15 @@ if ($resql) llxHeader('', $title, $helpurl, ''); // Displays product removal confirmation - if (GETPOST('delprod')) { - setEventMessages($langs->trans("ProductDeleted", GETPOST('delprod')), null, 'mesgs'); + if (GETPOST('delreport')) { + setEventMessages($langs->trans("IntracommReportDeleted", GETPOST('delreport')), null, 'mesgs'); } $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($sall) $param.="&sall=".urlencode($sall); - if ($search_categ > 0) $param.="&search_categ=".urlencode($search_categ); if ($search_ref) $param="&search_ref=".urlencode($search_ref); - if ($search_ref_supplier) $param="&search_ref_supplier=".urlencode($search_ref_supplier); - if ($search_barcode) $param.=($search_barcode?"&search_barcode=".urlencode($search_barcode):""); if ($search_label) $param.="&search_label=".urlencode($search_label); // Add $param from extra fields @@ -296,13 +284,9 @@ if ($resql) $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; - $rightskey='DEB'; - if ($type == IntracommReport::TYPE_DES) $rightskey='DES'; - if ($user->rights->{$rightskey}->creer) + if ($user->rights->intracommreport->write) { - $label='NewDEB'; - if ($type == IntracommReport::TYPE_DES) $label = 'NewDES'; - $newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/intracommreport/card.php?action=create&type='.$type); + $newcardbutton.= dolGetButtonTitle($langs->trans("NewDeclaration"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/intracommreport/card.php?action=create&type='.$type); } print '