diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index d5af14f9171..8a3096ef72a 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -164,7 +164,7 @@ foreach ($files as $filetmp) { if (filetype($file)=="file") { $md5=md5_file($file); $checksumconcat[]=$md5; - fputs($fp, ' '.$md5.''."\n"); + fputs($fp, ' '.$md5.''."\n"); } } fputs($fp, ' '."\n"); @@ -207,7 +207,7 @@ foreach ($files as $filetmp) { if (filetype($file)=="file") { $md5=md5_file($file); $checksumconcat[]=$md5; - fputs($fp, ' '.$md5.''."\n"); + fputs($fp, ' '.$md5.''."\n"); } } fputs($fp, ' '."\n"); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 2969f2ff0a1..ae076a414cb 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -129,8 +129,8 @@ if (empty($reshook)) // Mass actions $objectclass='AccountingAccount'; - $permtoread = $user->rights->accounting->read; - $permtodelete = $user->rights->accounting->delete; + $permissiontoread = $user->rights->accounting->read; + $permissiontodelete = $user->rights->accounting->delete; $uploaddir = $conf->accounting->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index f0e545f7853..a1c354f010b 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -112,8 +112,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' // Mass actions $objectclass='ExpenseReport'; $objectlabel='ExpenseReport'; -$permtoread = $user->rights->expensereport->read; -$permtodelete = $user->rights->expensereport->delete; +$permissiontoread = $user->rights->expensereport->read; +$permissiontodelete = $user->rights->expensereport->delete; $uploaddir = $conf->expensereport->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 27cd97dfea3..249cb920c47 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -133,8 +133,8 @@ if (empty($reshook)) // Mass actions $objectclass='AccountingAccount'; - $permtoread = $user->rights->accounting->read; - $permtodelete = $user->rights->accounting->delete; + $permissiontoread = $user->rights->accounting->read; + $permissiontodelete = $user->rights->accounting->delete; $uploaddir = $conf->accounting->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 0bcc11bf351..a66323654d8 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -232,8 +232,8 @@ if (empty($reshook)) // Mass actions $objectclass='Adherent'; $objectlabel='Members'; - $permtoread = $user->rights->adherent->lire; - $permtodelete = $user->rights->adherent->supprimer; + $permissiontoread = $user->rights->adherent->lire; + $permissiontodelete = $user->rights->adherent->supprimer; $uploaddir = $conf->adherent->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index e8b2e280a7f..5145f5dd083 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -156,8 +156,8 @@ if (empty($reshook)) // Mass actions $objectclass='EmailCollector'; $objectlabel='EmailCollector'; - $permtoread = $user->rights->emailcollector->read; - $permtodelete = $user->rights->emailcollector->delete; + $permissiontoread = $user->rights->emailcollector->read; + $permissiontodelete = $user->rights->emailcollector->delete; $uploaddir = $conf->emailcollector->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index eb432b0dc72..139c6815072 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -148,8 +148,8 @@ if (empty($reshook)) // Mass actions $objectclass='EmailSenderProfile'; $objectlabel='EmailSenderProfile'; - $permtoread = $user->admin; - $permtodelete = $user->admin; + $permissiontoread = $user->admin; + $permissiontodelete = $user->admin; $uploaddir = $conf->admin->dir_output.'/senderprofiles'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 94864123220..3fa0905ee42 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -46,7 +46,7 @@ llxHeader(); print load_fiche_titre($langs->trans("FileCheckDolibarr"), '', 'title_setup'); -print $langs->trans("FileCheckDesc").'

'; +print ''.$langs->trans("FileCheckDesc").'

'; // Version print '
'; @@ -239,6 +239,7 @@ if (! $error && $xml) $out.=''; $out.='#'; $out.='' . $langs->trans("Filename") . ''; + $out.='' . $langs->trans("ExpectedSize") . ''; $out.='' . $langs->trans("ExpectedChecksum") . ''; $out.=''."\n"; $tmpfilelist = dol_sort_array($file_list['missing'], 'filename'); @@ -251,6 +252,9 @@ if (! $error && $xml) $out.=''; $out.=''.$i.'' . "\n"; $out.=''.$file['filename'].'' . "\n"; + $out.=''; + if (! empty($file['expectedsize'])) $out.=dol_print_size($file['expectedsize']); + $out.='' . "\n"; $out.=''.$file['expectedmd5'].'' . "\n"; $out.="\n"; } @@ -275,7 +279,8 @@ if (! $error && $xml) $out.='' . $langs->trans("Filename") . ''; $out.='' . $langs->trans("ExpectedChecksum") . ''; $out.='' . $langs->trans("CurrentChecksum") . ''; - $out.='' . $langs->trans("Size") . ''; + $out.='' . $langs->trans("ExpectedSize") . ''; + $out.='' . $langs->trans("CurrentSize") . ''; $out.='' . $langs->trans("DateModification") . ''; $out.=''."\n"; $tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename'); @@ -290,6 +295,9 @@ if (! $error && $xml) $out.=''.$file['filename'].'' . "\n"; $out.=''.$file['expectedmd5'].'' . "\n"; $out.=''.$file['md5'].'' . "\n"; + $out.=''; + if ($file['expectedsize']) $out.=dol_print_size($file['expectedsize']); + $out.='' . "\n"; $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); $totalsize += $size; $out.=''.dol_print_size($size).'' . "\n"; @@ -301,6 +309,7 @@ if (! $error && $xml) $out.=''.$langs->trans("Total").'' . "\n"; $out.='' . "\n"; $out.='' . "\n"; + $out.='' . "\n"; $out.=''.dol_print_size($totalsize).'' . "\n"; $out.='' . "\n"; $out.="\n"; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 9b6d33e5faa..a3891dc1c46 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -40,7 +40,7 @@ llxHeader(); print load_fiche_titre($langs->trans("AvailableModules"), '', 'title_setup'); -print $langs->trans("ToActivateModule").'
'; +print ''.$langs->trans("ToActivateModule").'
'; print "
\n"; $modules = array(); diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 819688ddcc1..bdc5ee5961d 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -49,7 +49,7 @@ $form = new Form($db); print load_fiche_titre($langs->trans("TriggersAvailable"), '', 'title_setup'); -print $langs->trans("TriggersDesc")."
"; +print ''.$langs->trans("TriggersDesc")."
"; print "
\n"; @@ -60,8 +60,8 @@ $param = ''; $align = ''; print '
'; print ''; print ''; -print getTitleFieldOfList($langs->trans("File"), 0, $_SERVER["PHP_SELF"], 'file', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, '', $sortfield, $sortorder, '', 1)."\n"; +print getTitleFieldOfList($langs->trans("File"), 0, $_SERVER["PHP_SELF"], 'file', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; print getTitleFieldOfList($langs->trans("Active"), 0, $_SERVER["PHP_SELF"], 'active', "", $param, 'align="center"', $sortfield, $sortorder, '', 1)."\n"; print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; print ''; @@ -69,7 +69,7 @@ print ''; foreach ($triggers as $trigger) { print ''; - print ''; + print ''; print ''; print ''; print '\n"; diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index febcba244c0..07f294479b3 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -30,7 +30,7 @@ // $objectclass and $objectlabel must be defined // $parameters, $object, $action must be defined for the hook. -// $permtoread, $permtocreate and $permtodelete may be defined +// $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined // $uploaddir may be defined (example to $conf->projet->dir_output."/";) // $toselect may be defined // $diroutputmassaction may be defined @@ -43,6 +43,11 @@ if (empty($objectclass) || empty($uploaddir)) exit; } +// For backward compatibility +if (! empty($permtoread) && empty($permissiontoread)) $permissiontoread = $permtoread; +if (! empty($permtocreate) && empty($permissiontoadd)) $permissiontoadd = $permtocreate; +if (! empty($permtodelete) && empty($permissiontodelete)) $permissiontoread = $permtodelete; + // Mass actions. Controls on number of lines checked. $maxformassaction=(empty($conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS)?1000:$conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS); @@ -924,7 +929,7 @@ if (!$error && $massaction == 'cancelorders') } -if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_search')) +if (! $error && $massaction == "builddoc" && $permissiontoread && ! GETPOST('button_search')) { if (empty($diroutputmassaction)) { @@ -1105,7 +1110,7 @@ if ($action == 'remove_file') } // Validate records -if (! $error && $massaction == 'validate' && $permtocreate) +if (! $error && $massaction == 'validate' && $permissiontoadd) { $objecttmp=new $objectclass($db); @@ -1170,8 +1175,9 @@ if (! $error && $massaction == 'validate' && $permtocreate) //var_dump($listofobjectthirdparties);exit; } } + // Closed records -if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permtoclose) { +if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permissiontoclose) { $db->begin(); $objecttmp = new $objectclass($db); @@ -1206,7 +1212,7 @@ if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permtoclo } } // Delete record from mass action (massaction = 'delete' for direct delete, action/confirm='delete'/'yes' with a confirmation step before) -if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == 'yes')) && $permtodelete) +if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == 'yes')) && $permissiontodelete) { $db->begin(); @@ -1272,7 +1278,7 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == // Generate document foreach object according to model linked to object // @TODO : propose model selection -if (! $error && $massaction == 'generate_doc' && $permtoread) +if (! $error && $massaction == 'generate_doc' && $permissiontoread) { $db->begin(); diff --git a/htdocs/core/boxes/box_accountancy_last_manual_entries.php b/htdocs/core/boxes/box_accountancy_last_manual_entries.php index 2c788b66b71..474280d17a7 100644 --- a/htdocs/core/boxes/box_accountancy_last_manual_entries.php +++ b/htdocs/core/boxes/box_accountancy_last_manual_entries.php @@ -133,7 +133,7 @@ class box_accountancy_last_manual_entries extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="nowrap right"', + 'td' => 'class="nowraponall right"', 'text' => price($amount, 0, $langs, 0, -1, -1, $conf->currency), ); diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 9609f596618..4864bcad371 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -173,7 +173,7 @@ class box_activity extends ModeleBoxes $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'class="nowrap right"', + 'td' => 'class="nowraponall right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( @@ -255,7 +255,7 @@ class box_activity extends ModeleBoxes $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'class="nowrap right"', + 'td' => 'class="nowraponall right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( @@ -339,7 +339,7 @@ class box_activity extends ModeleBoxes ); $this->info_box_contents[$line][3] = array( - 'td' => 'class="nowrap right"', + 'td' => 'class="nowraponall right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency) ); @@ -421,7 +421,7 @@ class box_activity extends ModeleBoxes ); $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'class="nowrap right"', + 'td' => 'class="nowraponall right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php index b4ac04b3051..8f27ff739e0 100644 --- a/htdocs/core/boxes/box_boms.php +++ b/htdocs/core/boxes/box_boms.php @@ -116,7 +116,7 @@ class box_boms extends ModeleBoxes $productstatic->ref = $objp->product_ref; $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="nowraponall"', 'text' => $bomstatic->getNomUrl(1), 'asis' => 1, ); diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 40d809fd6e7..c8a050ea1d4 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -135,7 +135,7 @@ class box_commandes extends ModeleBoxes $societestatic->logo = $objp->logo; $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="nowraponall"', 'text' => $commandestatic->getNomUrl(1), 'asis' => 1, ); @@ -147,7 +147,7 @@ class box_commandes extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="nowrap right"', + 'td' => 'class="nowraponall right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index c4259b6252a..00f5722076c 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -154,7 +154,7 @@ class box_comptes extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="liste_total right"', + 'td' => 'class="liste_total right nowraponall"', 'text' => price($solde, 0, $langs, 0, -1, -1, $key) ); $line++; diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 5bdb17ba0b9..9140b9b9d43 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -136,13 +136,13 @@ class box_contacts extends ModeleBoxes $societestatic->fournisseur = $objp->fournisseur; $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $contactstatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => ($objp->fk_soc > 0 ? $societestatic->getNomUrl(1) : ''), 'asis' => 1, ); @@ -164,7 +164,8 @@ class box_contacts extends ModeleBoxes if ($num==0) $this->info_box_contents[$line][0] = array( 'td' => 'class="center"', - 'text'=>$langs->trans("NoRecordedContacts"), + 'text'=> ''.$langs->trans("NoRecordedContacts").'', + 'asis'=> 1 ); $this->db->free($result); diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 37fdf45f118..36a4f5416f9 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -136,7 +136,7 @@ class box_contracts extends ModeleBoxes // if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->contrat->cloture->warning_delay)) { $late = img_warning($langs->trans("Late")); } $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="nowraponall"', 'text' => $contractstatic->getNomUrl(1), 'text2'=> $late, 'asis'=>1 diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 3c0fc6444a2..d4cb4143463 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -145,13 +145,13 @@ class box_factures_fourn_imp extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $thirdpartytmp->getNomUrl(1, '', 40), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'class="nowrap right"', + 'td' => 'class="nowraponall right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 992e1333390..bb6eb95b32f 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -150,20 +150,20 @@ class box_factures_imp extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="nowraponall"', 'text' => $facturestatic->getNomUrl(1), 'text2'=> $late, 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $societestatic->getNomUrl(1, '', 44), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'class="nowrap right"', + 'td' => 'class="nowraponall right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index b0851ed28c0..a81b0cf3b86 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -120,13 +120,13 @@ class box_ficheinter extends ModeleBoxes $companystatic->email = $objp->semail; $this->info_box_contents[$i][] = array( - 'td' => '', + 'td' => 'class="nowraponall"', 'text' => $ficheinterstatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$i][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $companystatic->getNomUrl(1), 'asis' => 1, ); diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index de2bbd79181..18c2ebfe340 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -140,7 +140,7 @@ class box_last_modified_ticket extends ModeleBoxes // Ticket $this->info_box_contents[$i][0] = array( - 'td' => 'class="left"', + 'td' => 'class="nowraponall"', 'text' => $ticket->getNomUrl(1), 'asis' => 1, ); @@ -148,7 +148,7 @@ class box_last_modified_ticket extends ModeleBoxes // Subject $this->info_box_contents[$i][$r] = array( - 'td' => 'class="left"', + 'td' => 'class="nowrap"', 'text' => $objp->subject, // Some event have no ref 'url' => DOL_URL_ROOT."/ticket/card.php?track_id=".$objp->track_id, ); @@ -156,7 +156,7 @@ class box_last_modified_ticket extends ModeleBoxes // Customer $this->info_box_contents[$i][$r] = array( - 'td' => 'class="left"', + 'td' => 'class="tdoverflowmax150 maxwidth300onsmartphone"', 'text' => $link, 'asis' => 1, ); @@ -172,7 +172,7 @@ class box_last_modified_ticket extends ModeleBoxes // Statut $this->info_box_contents[$i][$r] = array( - 'td' => 'class="right"', + 'td' => 'class="right nowraponall"', 'text' => $ticket->getLibStatut(3) ); $r++; diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 4c66c647477..4a0842139d6 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -141,7 +141,7 @@ class box_last_ticket extends ModeleBoxes // Ticket $this->info_box_contents[$i][$r] = array( - 'td' => 'class="left"', + 'td' => 'class="nowraponall"', 'text' => $ticket->getNomUrl(1), 'asis' => 1 ); @@ -149,7 +149,7 @@ class box_last_ticket extends ModeleBoxes // Subject $this->info_box_contents[$i][$r] = array( - 'td' => 'class="left"', + 'td' => '', 'text' => $objp->subject, // Some event have no ref 'url' => DOL_URL_ROOT."/ticket/card.php?track_id=" . $objp->track_id, ); @@ -157,7 +157,7 @@ class box_last_ticket extends ModeleBoxes // Customer $this->info_box_contents[$i][$r] = array( - 'td' => 'class="left"', + 'td' => '', 'text' => $link, 'asis' => 1, ); @@ -172,7 +172,7 @@ class box_last_ticket extends ModeleBoxes // Statut $this->info_box_contents[$i][$r] = array( - 'td' => 'class="right"', + 'td' => 'class="right nowraponall"', 'text' => $ticket->getLibStatut(3), ); $r++; diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php index 970619ee7ac..7a6c74e216c 100644 --- a/htdocs/core/boxes/box_lastlogin.php +++ b/htdocs/core/boxes/box_lastlogin.php @@ -78,11 +78,11 @@ class box_lastlogin extends ModeleBoxes $line=0; $this->info_box_contents[$line][0] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $langs->trans("User"), ); $this->info_box_contents[$line][1] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $user->getNomUrl(-1), 'asis' => 1 ); diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 29f37751ce9..242f26e5d60 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -124,13 +124,13 @@ class box_members extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $memberstatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $memberstatic->company, 'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid, ); diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index 32ae864fc2f..949f63776f6 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -116,7 +116,7 @@ class box_mos extends ModeleBoxes $productstatic->ref = $objp->product_ref; $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="nowraponall"', 'text' => $mostatic->getNomUrl(1), 'asis' => 1, ); diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 48a6d260e2c..edd6c89054d 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -123,7 +123,7 @@ class box_project extends ModeleBoxes ); $this->info_box_contents[$i][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"', 'text' => $objp->title, ); diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 1fe8c2a0ed8..58b97c89386 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -128,7 +128,7 @@ class box_propales extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="nowraponall"', 'text' => $propalstatic->getNomUrl(1), 'text2'=> $late, 'asis' => 1, diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 9ddfa229e55..582b5101aa1 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -133,7 +133,7 @@ class box_services_expired extends ModeleBoxes if (($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late=img_warning($langs->trans("Late")); $this->info_box_contents[$i][] = array( - 'td' => '', + 'td' => 'class="nowraponall"', 'text' => $contract->getNomUrl(1), 'asis' => 1 ); @@ -145,7 +145,7 @@ class box_services_expired extends ModeleBoxes ); $this->info_box_contents[$i][] = array( - 'td' => 'class="center"', + 'td' => 'class="center nowraponall"', 'text' => dol_print_date($dateline, 'day'), 'text2'=> $late, ); diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index a95c008688b..881e17f73ec 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -124,19 +124,19 @@ class box_supplier_orders extends ModeleBoxes $thirdpartytmp->logo = $objp->logo; $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="nowraponall"', 'text' => $supplierorderstatic->getNomUrl(1), 'asis' => 1 ); $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $thirdpartytmp->getNomUrl(1, 'supplier'), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right nowrap"', + 'td' => 'class="right nowraponall"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 326a9297ce8..416dc7f2f2a 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -130,19 +130,19 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $thirdpartytmp->logo = $objp->logo; $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="nowraponall"', 'text' => $supplierorderstatic->getNomUrl(1), 'asis' => 1 ); $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $thirdpartytmp->getNomUrl(1, 'supplier'), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right nowrap"', + 'td' => 'class="right nowraponall"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 22acff7763d..4a55fa24bb3 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -667,21 +667,27 @@ class FormFile { $submodulepart = $modulepart; - // For normalized standard modules - $file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php', 0); + // modulepart = 'nameofmodule' or 'nameofmodule:nameofsubmodule' + $tmp=explode(':', $modulepart); + if (! empty($tmp[1])) { + $modulepart=$tmp[0]; + $submodulepart=$tmp[1]; + } + + // For normalized standard modules + $file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$submodulepart.'.php', 0); if (file_exists($file)) { $res=include_once $file; } - // For normalized external modules. modulepart = 'nameofmodule' or 'nameofmodule:nameofsubmodule' + // For normalized external modules. else { - $tmp=explode(':', $modulepart); - if (! empty($tmp[2])) $submodulepart=$tmp[2]; - $file=dol_buildpath('/'.$modulepart.'/core/modules/'.$modulepart.'/modules_'.$submodulepart.'.php', 0); + $file=dol_buildpath('/'.$modulepart.'/core/modules/'.$modulepart.'/modules_'.$submodulepart.'.php', 0); $res=include_once $file; } $class='ModelePDF'.ucfirst($submodulepart); + if (class_exists($class)) { $modellist=call_user_func($class.'::liste_modeles', $this->db); @@ -1465,7 +1471,7 @@ class FormFile * @param string $param Parameters on sort links * @param int $forcedownload Force to open dialog box "Save As" when clicking on file * @param string $relativepath Relative path of docs (autodefined if not provided) - * @param int $permtodelete Permission to delete + * @param int $permissiontodelete Permission to delete * @param int $useinecm Change output for use in ecm module * @param int $textifempty Text to show if filearray is empty * @param int $maxlength Maximum length of file name shown @@ -1474,7 +1480,7 @@ class FormFile * @return int <0 if KO, nb of files shown if OK * @see list_of_documents() */ - public function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload = 0, $relativepath = '', $permtodelete = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $url = '', $addfilterfields = 0) + public function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload = 0, $relativepath = '', $permissiontodelete = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $url = '', $addfilterfields = 0) { // phpcs:enable global $user, $conf, $langs, $form; @@ -1697,7 +1703,7 @@ class FormFile //if ($forcedownload) print '&attachment=1'; //print '&file='.urlencode($relativefile).'">'; //print img_view().'   '; - //if ($permtodelete) print ''.img_delete().''; + //if ($permissiontodelete) print ''.img_delete().''; //else print ' '; print "\n"; } @@ -1752,13 +1758,13 @@ class FormFile * Show array with linked files * * @param Object $object Object - * @param int $permtodelete Deletion is allowed + * @param int $permissiontodelete Deletion is allowed * @param string $action Action * @param string $selected ??? * @param string $param More param to add into URL * @return int Number of links */ - public function listOfLinks($object, $permtodelete = 1, $action = null, $selected = null, $param = '') + public function listOfLinks($object, $permissiontodelete = 1, $action = null, $selected = null, $param = '') { global $user, $conf, $langs, $user; global $sortfield, $sortorder; @@ -1872,7 +1878,7 @@ class FormFile print ''; print ''; - print_liste_field_titre($title.' '.$num.'', $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); + print_liste_field_titre($title.''.$num.'', $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 2b894b49790..9e12e9d4229 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -60,7 +60,7 @@ function propal_prepare_head($object) $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id; $head[$h][1] = $langs->trans('ContactsAddresses'); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; } @@ -78,7 +78,7 @@ function propal_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -90,7 +90,7 @@ function propal_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; diff --git a/htdocs/core/lib/reception.lib.php b/htdocs/core/lib/reception.lib.php index 15ca4de37e0..33591b3beea 100644 --- a/htdocs/core/lib/reception.lib.php +++ b/htdocs/core/lib/reception.lib.php @@ -60,7 +60,7 @@ function reception_prepare_head(Reception $object) $nbContact = count($objectsrc->liste_contact(-1, 'internal')) + count($objectsrc->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT."/reception/contact.php?id=".$object->id; $head[$h][1] = $langs->trans("ContactsAddresses"); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; } @@ -70,7 +70,7 @@ function reception_prepare_head(Reception $object) if (!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT."/reception/note.php?id=".$object->id; $head[$h][1] = $langs->trans("Notes"); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 38358222282..63c4e9ea836 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php'; /** * Class to build documents using ODF templates generator */ -class doc_generic_bom_odt extends ModelePDFBoms +class doc_generic_bom_odt extends ModelePDFBom { /** * Issuer diff --git a/htdocs/core/modules/bom/modules_bom.php b/htdocs/core/modules/bom/modules_bom.php index f8f29fec2e6..45bca8a38b3 100644 --- a/htdocs/core/modules/bom/modules_bom.php +++ b/htdocs/core/modules/bom/modules_bom.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir /** * Parent class for boms models */ -abstract class ModelePDFBoms extends CommonDocGenerator +abstract class ModelePDFBom extends CommonDocGenerator { // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index bc85111ebd2..43908b85164 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -62,7 +62,7 @@ class modMrp extends DolibarrModules // Used only if file README.md and README-LL.md not found. $this->descriptionlong = "Module to Manage Manufacturing Orders (MO)"; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' - $this->version = 'dolibarr'; + $this->version = 'experimental'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 0447694465f..854c7c350b3 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php'; /** * Class to build documents using ODF templates generator */ -class doc_generic_mo_odt extends ModelePDFMos +class doc_generic_mo_odt extends ModelePDFMo { /** * Issuer diff --git a/htdocs/core/modules/mrp/modules_mrp.php b/htdocs/core/modules/mrp/modules_mo.php similarity index 93% rename from htdocs/core/modules/mrp/modules_mrp.php rename to htdocs/core/modules/mrp/modules_mo.php index bd83fab70b7..76d204a9826 100644 --- a/htdocs/core/modules/mrp/modules_mrp.php +++ b/htdocs/core/modules/mrp/modules_mo.php @@ -23,10 +23,10 @@ */ /** - * \file htdocs/core/modules/mrp/modules_mrp.php - * \ingroup bom - * \brief File that contains parent class for mos models - * and parent class for mos numbering models + * \file htdocs/core/modules/mrp/modules_mo.php + * \ingroup mrp + * \brief File that contains parent class for MOs models + * and parent class for MOs numbering models */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir /** * Parent class for mos models */ -abstract class ModelePDFMos extends CommonDocGenerator +abstract class ModelePDFMo extends CommonDocGenerator { // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index d83e6f4e258..f395475faf7 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -178,12 +178,12 @@ if (empty($reshook)) // Mass actions $objectclass='CronJob'; $objectlabel='CronJob'; - $permtoread = $user->rights->cron->read; - $permtocreate = $user->rights->cron->create?$user->rights->cron->create:$user->rights->cron->write; - $permtodelete = $user->rights->cron->delete; + $permissiontoread = $user->rights->cron->read; + $permissiontoadd = $user->rights->cron->create?$user->rights->cron->create:$user->rights->cron->write; + $permissiontodelete = $user->rights->cron->delete; $uploaddir = $conf->cron->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - if ($permtocreate) + if ($permissiontoadd) { $tmpcron = new Cronjob($db); foreach($toselect as $id) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 888f7037efb..eeb05e8926c 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -165,9 +165,9 @@ if (empty($reshook)) { $objectclass = 'Expedition'; $objectlabel = 'Sendings'; - $permtoread = $user->rights->expedition->lire; - $permtocreate = $user->rights->expedition->creer; - $permtodelete = $user->rights->expedition->supprimer; + $permissiontoread = $user->rights->expedition->lire; + $permissiontoadd = $user->rights->expedition->creer; + $permissiontodelete = $user->rights->expedition->supprimer; $uploaddir = $conf->expedition->dir_output . '/sending'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 6f837fb866c..73331228f2f 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -195,8 +195,8 @@ if (empty($reshook)) // Mass actions $objectclass='ExpenseReport'; $objectlabel='ExpenseReport'; - $permtoread = $user->rights->expensereport->lire; - $permtodelete = $user->rights->expensereport->supprimer; + $permissiontoread = $user->rights->expensereport->lire; + $permissiontodelete = $user->rights->expensereport->supprimer; $uploaddir = $conf->expensereport->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 9cee1ec691c..028fd3f717b 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -160,8 +160,8 @@ if (empty($reshook)) // Mass actions $objectclass='Fichinter'; $objectlabel='Interventions'; - $permtoread = $user->rights->ficheinter->lire; - $permtodelete = $user->rights->ficheinter->supprimer; + $permissiontoread = $user->rights->ficheinter->lire; + $permissiontodelete = $user->rights->ficheinter->supprimer; $uploaddir = $conf->ficheinter->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index f8325ce8b0f..f14a8d92c66 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -223,8 +223,8 @@ if (empty($reshook)) // Mass actions $objectclass='CommandeFournisseur'; $objectlabel='SupplierOrders'; - $permtoread = $user->rights->fournisseur->commande->lire; - $permtodelete = $user->rights->fournisseur->commande->supprimer; + $permissiontoread = $user->rights->fournisseur->commande->lire; + $permissiontodelete = $user->rights->fournisseur->commande->supprimer; $uploaddir = $conf->fournisseur->commande->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index b13e283ea65..c06c070d45e 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -241,9 +241,9 @@ if (empty($reshook)) // Mass actions $objectclass='FactureFournisseur'; $objectlabel='SupplierInvoices'; - $permtoread = $user->rights->fournisseur->facture->lire; - $permtocreate = $user->rights->fournisseur->facture->creer; - $permtodelete = $user->rights->fournisseur->facture->supprimer; + $permissiontoread = $user->rights->fournisseur->facture->lire; + $permissiontoadd = $user->rights->fournisseur->facture->creer; + $permissiontodelete = $user->rights->fournisseur->facture->supprimer; $uploaddir = $conf->fournisseur->facture->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 3419d663e30..586617a79d6 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -95,8 +95,8 @@ if (empty($reshook)) /* $objectclass='Skeleton'; $objectlabel='Skeleton'; - $permtoread = $user->rights->skeleton->read; - $permtodelete = $user->rights->skeleton->delete; + $permissiontoread = $user->rights->skeleton->read; + $permissiontodelete = $user->rights->skeleton->delete; $uploaddir = $conf->skeleton->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; */ diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 8b30c03a1a9..273c3cf9133 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -196,8 +196,8 @@ if (empty($reshook)) // Mass actions $objectclass='Holiday'; $objectlabel='Holiday'; - $permtoread = $user->rights->holiday->read; - $permtodelete = $user->rights->holiday->delete; + $permissiontoread = $user->rights->holiday->read; + $permissiontodelete = $user->rights->holiday->delete; $uploaddir = $conf->holiday->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 9e5f0ad0cba..813fe245cc1 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -110,8 +110,8 @@ if (empty($reshook)) // Mass actions /*$objectclass='MyObject'; $objectlabel='MyObject'; - $permtoread = $user->rights->mymodule->read; - $permtodelete = $user->rights->mymodule->delete; + $permissiontoread = $user->rights->mymodule->read; + $permissiontodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; */ diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8f052636ac9..ca1344cb88c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1796,6 +1796,8 @@ FixTZ=TimeZone fix FillFixTZOnlyIfRequired=Example: +2 (fill only if problem experienced) ExpectedChecksum=Expected Checksum CurrentChecksum=Current Checksum +ExpectedSize=Expected size +CurrentSize=Current size ForcedConstants=Required constant values MailToSendProposal=Customer proposals MailToSendOrder=Sales orders diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index bc71a65f72a..fd89d8c8e38 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -12,7 +12,7 @@ BOMsSetup=Setup of module BOM ListOfBOMs=List of bills of material - BOM ListOfManufacturingOrders=List of Manufacturing Orders NewBOM=New bill of material -ProductBOMHelp=Product to create with this BOM +ProductBOMHelp=Product to create with this BOM.
Note: Products with the property 'Nature of product' = 'Raw material' are not visible into this list. BOMsNumberingModules=BOM numbering templates BOMsModelModule=BOM document templates MOsNumberingModules=MO numbering templates diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index a1bf67cb8c5..776bec4171c 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -120,8 +120,8 @@ if (empty($reshook)) if ((string) $type == '1') { $objectlabel='Services'; } if ((string) $type == '0') { $objectlabel='Products'; } - $permtoread = $user->rights->produit->lire; - $permtodelete = $user->rights->produit->supprimer; + $permissiontoread = $user->rights->produit->lire; + $permissiontodelete = $user->rights->produit->supprimer; $uploaddir = $conf->product->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; */ diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 111e190bcf3..5179dbcf37c 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -102,14 +102,14 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu // Security check - Protection if external user //if ($user->socid > 0) access_forbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0); +//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); //$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); $permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->mymodule->myobject->write; // Used by the include of actions_dellink.inc.php $permissionedit = $user->rights->mymodule->myobject->write; // Used by the include of actions_lineupdown.inc.php $permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php -$permissiontodelete = $user->rights->mymodule->myobject->delete || ($permissiontoadd && $object->status == 0); +$permissiontodelete = $user->rights->mymodule->myobject->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); @@ -404,7 +404,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print '
'; - if (! empty($object->lines) && $object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline') + if (! empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print '
'.$trigger['picto'].''.$trigger['picto'].''.$trigger['file'].''.$trigger['status'].''; diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 8ea4f46c89d..9c9b8d12bff 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -152,8 +152,8 @@ if (empty($reshook)) // Mass actions $objectclass='Asset'; $objectlabel='Asset'; - $permtoread = $user->rights->asset->read; - $permtodelete = $user->rights->asset->delete; + $permissiontoread = $user->rights->asset->read; + $permissiontodelete = $user->rights->asset->delete; $uploaddir = $conf->asset->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 231679f7b3a..f4124b2b9db 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -72,14 +72,14 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu // Security check - Protection if external user //if ($user->socid > 0) access_forbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$isdraft = (($object->statut == BillOfMaterials::STATUS_DRAFT) ? 1 : 0); +//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); //$result = restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); $permissionnote=$user->rights->bom->write; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->bom->write; // Used by the include of actions_dellink.inc.php $permissionedit=$user->rights->bom->write; // Used by the include of actions_lineupdown.inc.php $permissiontoadd=$user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php -$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0); +$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); /* @@ -457,7 +457,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->bom->write) + if ($permissiontoadd) { if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; @@ -532,7 +532,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print '
'; - if (! empty($object->lines) || ($object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) + if (! empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print ''; } @@ -555,7 +555,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } - if (! empty($object->lines) || ($object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) + if (! empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print '
'; } @@ -565,8 +565,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } - // Buttons for actions + if ($action != 'presend' && $action != 'editline') { print '
'."\n"; $parameters=array(); @@ -584,7 +584,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Modify - if ($user->rights->bom->write) + if ($permissiontoadd) { print ''.$langs->trans("Modify").''."\n"; } @@ -619,7 +619,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - if ($user->rights->bom->write) + if ($permissiontoadd) { print '' . $langs->trans("ToClone") . ''; } @@ -638,7 +638,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } */ - if ($user->rights->bom->delete) + if ($permissiontodelete) { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 0775c2cc370..aa690b9468a 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -1,6 +1,5 @@ - * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -114,6 +113,9 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +$permissiontoread = $user->rights->bom->read; +$permissiontoadd = $user->rights->bom->write; +$permissiontodelete = $user->rights->bom->delete; /* @@ -151,13 +153,68 @@ if (empty($reshook)) // Mass actions $objectclass='BOM'; $objectlabel='BillOfMaterials'; - $permtoread = $user->rights->bom->read; - $permtodelete = $user->rights->bom->delete; + $permissiontoread = $user->rights->bom->read; + $permissiontodelete = $user->rights->bom->delete; $uploaddir = $conf->bom->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; -} + // Validate records + if (! $error && $massaction == 'disable' && $permissiontoadd) + { + $objecttmp=new $objectclass($db); + + if (! $error) + { + $db->begin(); + + $nbok = 0; + foreach($toselect as $toselectid) + { + $result=$objecttmp->fetch($toselectid); + if ($result > 0) + { + if ($objecttmp->status != $objecttmp::STATUS_VALIDATED) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorObjectMustHaveStatusValidatedToBeDisabled", $objecttmp->ref), null, 'errors'); + $error++; + break; + } + + // Can be 'cancel()' or 'close()' + $result = $objecttmp->cancel($user); + if ($result < 0) + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + else $nbok++; + } + else + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (! $error) + { + if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + $db->commit(); + } + else + { + $db->rollback(); + } + //var_dump($listofobjectthirdparties);exit; + } + } +} + /* * View @@ -303,7 +360,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + 'disable'=>$langs->trans("Disable"), ); if ($user->rights->bom->delete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions=array(); @@ -539,6 +596,7 @@ print '
'."\n"; print ''."\n"; + if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty=1; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 4a623c3f36d..65f619cb0b2 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -91,7 +91,7 @@ class BOM extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1',), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'), 'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'), 'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>1, 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'), 'duration' => array('type'=>'real', 'label'=>'EstimatedDuration', 'enabled'=>1, 'visible'=>-1, 'position'=>101, 'notnull'=>-1, 'css'=>'maxwidth50imp', 'help'=>'EstimatedDurationDesc'), diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index e78ef64b5c7..7da2c768b7f 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -90,7 +90,7 @@ function bomPrepareHead($object) if (!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -102,7 +102,7 @@ function bomPrepareHead($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index ff69bd00c0c..0e3d7a7725e 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -102,8 +102,8 @@ if (empty($reshook)) // Mass actions /*$objectclass='MyObject'; $objectlabel='MyObject'; - $permtoread = $user->rights->mymodule->read; - $permtodelete = $user->rights->mymodule->delete; + $permissiontoread = $user->rights->mymodule->read; + $permissiontodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; */ diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a83d7ee5161..0c52fea9f35 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -241,9 +241,9 @@ if (empty($reshook)) { $objectclass='Propal'; $objectlabel='Proposals'; - $permtoread = $user->rights->propal->lire; - $permtodelete = $user->rights->propal->supprimer; - $permtoclose = $user->rights->propal->cloturer; + $permissiontoread = $user->rights->propal->lire; + $permissiontodelete = $user->rights->propal->supprimer; + $permissiontoclose = $user->rights->propal->cloturer; $uploaddir = $conf->propal->multidir_output[$conf->entity]; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 5f9906b58dc..23af81ab24e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -220,8 +220,8 @@ if (empty($reshook)) // Mass actions $objectclass='Commande'; $objectlabel='Orders'; - $permtoread = $user->rights->commande->lire; - $permtodelete = $user->rights->commande->supprimer; + $permissiontoread = $user->rights->commande->lire; + $permissiontodelete = $user->rights->commande->supprimer; $uploaddir = $conf->commande->multidir_output[$conf->entity]; $trigger_name='ORDER_SENTBYMAIL'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 773ee1e9255..4a9d0947b1e 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -209,8 +209,8 @@ if (empty($reshook)) { $objectclass='Account'; $objectlabel='BankTransaction'; - $permtoread = $user->rights->banque->lire; - $permtodelete = $user->rights->banque->supprimer; + $permissiontoread = $user->rights->banque->lire; + $permissiontodelete = $user->rights->banque->supprimer; $uploaddir = $conf->bank->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index e0461d35368..45129b6ee19 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -168,8 +168,8 @@ if (empty($reshook)) // Mass actions $objectclass='CashControl'; $objectlabel='CashControl'; - $permtoread = ($user->rights->cashdesk->use || $user->rights->takepos->use); - $permtodelete = ($user->rights->cashdesk->use || $user->rights->takepos->use); + $permissiontoread = ($user->rights->cashdesk->use || $user->rights->takepos->use); + $permissiontodelete = ($user->rights->cashdesk->use || $user->rights->takepos->use); //$uploaddir = ''; //include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 10eb2ac03c8..49cb9529c71 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -146,8 +146,8 @@ if (empty($reshook)) // Mass actions /*$objectclass='MyObject'; $objectlabel='MyObject'; - $permtoread = $user->rights->mymodule->read; - $permtodelete = $user->rights->mymodule->delete; + $permissiontoread = $user->rights->mymodule->read; + $permissiontodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/ diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 09873f5ee61..941aa0723ef 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -191,8 +191,8 @@ if (empty($reshook)) // Mass actions /*$objectclass='MyObject'; $objectlabel='MyObject'; - $permtoread = $user->rights->mymodule->read; - $permtodelete = $user->rights->mymodule->delete; + $permissiontoread = $user->rights->mymodule->read; + $permissiontodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/ } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 74c27c1e467..43f8d41db10 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -265,9 +265,9 @@ if (empty($reshook)) { $objectclass='Facture'; $objectlabel='Invoices'; - $permtoread = $user->rights->facture->lire; - $permtocreate = $user->rights->facture->creer; - $permtodelete = $user->rights->facture->supprimer; + $permissiontoread = $user->rights->facture->lire; + $permissiontoadd = $user->rights->facture->creer; + $permissiontodelete = $user->rights->facture->supprimer; $uploaddir = $conf->facture->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index f8d92d19b34..d23963fde0a 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -254,8 +254,8 @@ if (empty($reshook)) // Mass actions $objectclass='Contact'; $objectlabel='Contact'; - $permtoread = $user->rights->societe->lire; - $permtodelete = $user->rights->societe->supprimer; + $permissiontoread = $user->rights->societe->lire; + $permissiontodelete = $user->rights->societe->supprimer; $uploaddir = $conf->societe->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 0b9c6768eda..7049ce77076 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1875,8 +1875,8 @@ class Contrat extends CommonObject /** * Return label of a contract status * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length - * @return string Label + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto, 7=Same than 6 with fixed length + * @return string Label */ public function getLibStatut($mode) { @@ -1888,7 +1888,7 @@ class Contrat extends CommonObject * Renvoi label of a given contrat status * * @param int $status Id status - * @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto, 7=Same than 6 with fixed length * @return string Label */ public function LibStatut($status, $mode) @@ -1921,13 +1921,13 @@ class Contrat extends CommonObject $text.=':     '; $text.=''; } - $text.=($mode == 7?'':''); + $text.=($mode == 7?'':''); $text.=($mode != 7 || $this->nbofserviceswait > 0) ? ($this->nbofserviceswait.ContratLigne::LibStatut(0, 3, -1, 'class="marginleft2"')).(($mode != 7 || $this->nbofservicesopened || $this->nbofservicesexpired || $this->nbofservicesclosed)?'   ':'') : ''; - $text.=($mode == 7?'':''); + $text.=($mode == 7?'':''); $text.=($mode != 7 || $this->nbofservicesopened > 0) ? ($this->nbofservicesopened.ContratLigne::LibStatut(4, 3, 0, 'class="marginleft2"')).(($mode != 7 || $this->nbofservicesexpired || $this->nbofservicesclosed)?'   ':'') : ''; - $text.=($mode == 7?'':''); + $text.=($mode == 7?'':''); $text.=($mode != 7 || $this->nbofservicesexpired > 0) ? ($this->nbofservicesexpired.ContratLigne::LibStatut(4, 3, 1, 'class="marginleft2"')).(($mode != 7 || $this->nbofservicesclosed)?'   ':'') : ''; - $text.=($mode == 7?'':''); + $text.=($mode == 7?'':''); $text.=($mode != 7 || $this->nbofservicesclosed > 0) ? ($this->nbofservicesclosed.ContratLigne::LibStatut(5, 3, -1, 'class="marginleft2"')) : ''; $text.=($mode == 7?'':''); return $text; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 3df193d53d2..f24105a93db 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -188,8 +188,8 @@ if (empty($reshook)) { $objectclass='Contrat'; $objectlabel='Contracts'; - $permtoread = $user->rights->contrat->lire; - $permtodelete = $user->rights->contrat->supprimer; + $permissiontoread = $user->rights->contrat->lire; + $permissiontodelete = $user->rights->contrat->supprimer; $uploaddir = $conf->contrat->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -591,10 +591,10 @@ if (! empty($arrayfields['lower_planned_end_date']['checked'])) { print_liste_field_titre($arrayfields['lower_planned_end_date']['label'], $_SERVER["PHP_SELF"], "lower_planned_end_date", "", $param, '', $sortfield, $sortorder, 'center '); } if (! empty($arrayfields['status']['checked'])) { - print_liste_field_titre($staticcontratligne->LibStatut(0, 3), '', '', '', '', 'width="16"'); - print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 0), '', '', '', '', 'width="16"'); - print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 1), '', '', '', '', 'width="16"'); - print_liste_field_titre($staticcontratligne->LibStatut(5, 3), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(0, 3, -1, 'class="nochangebackground"'), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 0, 'class="nochangebackground"'), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 1, 'class="nochangebackground"'), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(5, 3, -1, 'class="nochangebackground"'), '', '', '', '', 'width="16"'); } print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "
'; print '' . img_edit() . ''; // id= is included into $param - if ($permtodelete) { + if ($permissiontodelete) { print '   ' . img_delete() . ''; // id= is included into $param } else { print ' '; diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 86b4bbf0673..bdcfe6bbf75 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -343,7 +343,7 @@ class Interfaces } // We set info of modules - $triggers[$j]['picto'] = $objMod->picto?img_object('', $objMod->picto):img_object('', 'generic'); + $triggers[$j]['picto'] = $objMod->picto?img_object('', $objMod->picto, 'class="valignmiddle pictomodule "'):img_object('', 'generic', 'class="valignmiddle pictomodule "'); $triggers[$j]['file'] = $files[$key]; $triggers[$j]['fullpath'] = $fullpath[$key]; $triggers[$j]['relpath'] = $relpath[$key]; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index e31f9b6d7d7..1d3f7eb65c3 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -663,7 +663,7 @@ function security_prepare_head() $head[$h][0] = DOL_URL_ROOT."/admin/perms.php"; $head[$h][1] = $langs->trans("DefaultRights"); - if ($nbPerms > 0) $head[$h][1].= ' '.$nbPerms.''; + if ($nbPerms > 0) $head[$h][1].= ''.$nbPerms.''; $head[$h][2] = 'default'; $h++; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index af859ccca7f..ad17cd259bd 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -473,7 +473,7 @@ function actions_prepare_head($object) $listofresourcelinked = $resource->getElementResources($object->element, $object->id); $nbResources=(is_array($listofresourcelinked)?count($listofresourcelinked):0); $head[$h][1] = $langs->trans("Resources"); - if ($nbResources > 0) $head[$h][1].= ' '.($nbResources).''; + if ($nbResources > 0) $head[$h][1].= ''.($nbResources).''; $head[$h][2] = 'resources'; $h++; } diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index 3b59dfda73d..5c6bac579f2 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -102,7 +102,7 @@ function asset_prepare_head(Asset $object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; @@ -111,7 +111,7 @@ function asset_prepare_head(Asset $object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/asset/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Notes"); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 91e0b719734..c4849d59adc 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -84,7 +84,7 @@ function bank_prepare_head(Account $object) $head[$h][0] = DOL_URL_ROOT."/compta/bank/releve.php?account=".$object->id; $head[$h][1] = $langs->trans("AccountStatements"); - if (($nbReceipts) > 0) $head[$h][1].= ' '.($nbReceipts).''; + if (($nbReceipts) > 0) $head[$h][1].= ''.($nbReceipts).''; $head[$h][2] = 'statement'; $h++; } @@ -97,7 +97,7 @@ function bank_prepare_head(Account $object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT . "/compta/bank/document.php?account=" . $object->id; $head[$h][1] = $langs->trans("Documents"); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; @@ -186,7 +186,7 @@ function various_payment_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 9f4f1021b4c..8cb023237d4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -69,7 +69,7 @@ function societe_prepare_head(Societe $object) $head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id; $head[$h][1] = $langs->trans('ContactsAddresses'); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; } @@ -79,7 +79,7 @@ function societe_prepare_head(Societe $object) $head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id; $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][1] = $langs->trans("ContactsAddresses"); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; } @@ -136,7 +136,7 @@ function societe_prepare_head(Societe $object) else { dol_print_error($db); } - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'project'; $h++; } @@ -229,7 +229,7 @@ function societe_prepare_head(Societe $object) $head[$h][0] = DOL_URL_ROOT .'/societe/paymentmodes.php?socid='.$object->id; $head[$h][1] = $title; if ($foundonexternalonlinesystem) $head[$h][1].= ' ...'; - elseif ($nbBankAccount > 0) $head[$h][1].= ' '.$nbBankAccount.''; + elseif ($nbBankAccount > 0) $head[$h][1].= ''.$nbBankAccount.''; $head[$h][2] = 'rib'; $h++; } @@ -257,7 +257,7 @@ function societe_prepare_head(Societe $object) else { dol_print_error($db); } - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'website'; $h++; } @@ -295,7 +295,7 @@ function societe_prepare_head(Societe $object) $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id; $head[$h][1] = $langs->trans("Notifications"); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'notify'; $h++; } @@ -306,7 +306,7 @@ function societe_prepare_head(Societe $object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Notes"); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; @@ -319,7 +319,7 @@ function societe_prepare_head(Societe $object) $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; $head[$h][1] = $langs->trans("Documents"); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; } diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 7e5096bb8c5..0082947d0c1 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -78,7 +78,7 @@ function contact_prepare_head(Contact $object) $nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1); $head[$tab][0] = DOL_URL_ROOT.'/contact/note.php?id='.$object->id; $head[$tab][1] = $langs->trans("Note"); - if($nbNote > 0) $head[$tab][1].= ' '.$nbNote.''; + if($nbNote > 0) $head[$tab][1].= ''.$nbNote.''; $head[$tab][2] = 'note'; $tab++; } @@ -90,7 +90,7 @@ function contact_prepare_head(Contact $object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$tab][0] = DOL_URL_ROOT.'/contact/document.php?id='.$object->id; $head[$tab][1] = $langs->trans("Documents"); - if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ''.($nbFiles+$nbLinks).''; $head[$tab][2] = 'documents'; $tab++; diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index 73cd8e1748e..ec91a2dcc70 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -45,7 +45,7 @@ function contract_prepare_head(Contrat $object) $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id; $head[$h][1] = $langs->trans("ContactsAddresses"); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; } @@ -63,7 +63,7 @@ function contract_prepare_head(Contrat $object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Notes"); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -75,7 +75,7 @@ function contract_prepare_head(Contrat $object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id; $head[$h][1] = $langs->trans("Documents"); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index d430c9ebd46..16d7d3d8a97 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -85,7 +85,7 @@ function donation_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; @@ -94,7 +94,7 @@ function donation_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/don/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Notes"); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; diff --git a/htdocs/core/lib/emailing.lib.php b/htdocs/core/lib/emailing.lib.php index 82c4d5c1ae4..59bb080d93e 100644 --- a/htdocs/core/lib/emailing.lib.php +++ b/htdocs/core/lib/emailing.lib.php @@ -43,7 +43,7 @@ function emailing_prepare_head(Mailing $object) { $head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$object->id; $head[$h][1] = $langs->trans("MailRecipients"); - if ($object->nbemail > 0) $head[$h][1].= ' '.$object->nbemail.''; + if ($object->nbemail > 0) $head[$h][1].= ''.$object->nbemail.''; $head[$h][2] = 'targets'; $h++; } diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 02b736dd0cb..caef261b277 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -52,7 +52,7 @@ function expensereport_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/expensereport/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; @@ -63,7 +63,7 @@ function expensereport_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/expensereport/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 6997cd5c028..d707063bbe8 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -51,7 +51,7 @@ function fichinter_prepare_head($object) $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$object->id; $head[$h][1] = $langs->trans('InterventionContact'); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; } @@ -83,7 +83,7 @@ function fichinter_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id; $head[$h][1] = $langs->trans("Resources"); - if ($nbResource > 0) $head[$h][1].= ' '.$nbResource.''; + if ($nbResource > 0) $head[$h][1].= ''.$nbResource.''; $head[$h][2] = 'resource'; $h++; } @@ -95,7 +95,7 @@ function fichinter_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/fichinter/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -107,7 +107,7 @@ function fichinter_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/fichinter/document.php?id='.$object->id; $head[$h][1] = $langs->trans("Documents"); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 711e65edaaa..90c673e9e25 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -3072,13 +3072,14 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathre { $filename = $path.$file['name']; $file_list['insignature'][] = $filename; + $expectedsize = (empty($file['size']) ? '' : $file['size']); $expectedmd5 = (string) $file; //if (preg_match('#'.$exclude.'#', $filename)) continue; if (!file_exists($pathref.'/'.$filename)) { - $file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>$expectedmd5); + $file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>$expectedmd5, 'expectedsize'=>$expectedsize); } else { @@ -3090,7 +3091,7 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathre } else { - if ($md5_local != $expectedmd5) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>$expectedmd5, 'md5'=>(string) $md5_local); + if ($md5_local != $expectedmd5) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>$expectedmd5, 'expectedsize'=>$expectedsize, 'md5'=>(string) $md5_local); $checksumconcat[] = $md5_local; } } diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index f11fb417769..9336d9b221f 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -48,7 +48,7 @@ function facturefourn_prepare_head($object) $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/contact.php?facid='.$object->id; $head[$h][1] = $langs->trans('ContactsAddresses'); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; } @@ -66,7 +66,7 @@ function facturefourn_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -78,7 +78,7 @@ function facturefourn_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; @@ -116,7 +116,7 @@ function ordersupplier_prepare_head($object) $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/contact.php?id='.$object->id; $head[$h][1] = $langs->trans('ContactsAddresses'); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; } @@ -143,7 +143,7 @@ function ordersupplier_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Notes"); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -155,7 +155,7 @@ function ordersupplier_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php index cb4e1331837..f1b18df11b2 100644 --- a/htdocs/core/lib/holiday.lib.php +++ b/htdocs/core/lib/holiday.lib.php @@ -47,7 +47,7 @@ function holiday_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/holiday/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 7dfee37666a..f2818f72872 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -50,7 +50,7 @@ function facture_prepare_head($object) $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id; $head[$h][1] = $langs->trans('ContactsAddresses'); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; } @@ -71,7 +71,7 @@ function facture_prepare_head($object) else dol_print_error($db); $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id; $head[$h][1] = $langs->trans('StandingOrders'); - if ($nbStandingOrders > 0) $head[$h][1].= ' '.$nbStandingOrders.''; + if ($nbStandingOrders > 0) $head[$h][1].= ''.$nbStandingOrders.''; $head[$h][2] = 'standingorders'; $h++; } @@ -89,7 +89,7 @@ function facture_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -101,7 +101,7 @@ function facture_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index 4d47c79e6da..e751dfd68c8 100644 --- a/htdocs/core/lib/loan.lib.php +++ b/htdocs/core/lib/loan.lib.php @@ -59,7 +59,7 @@ function loan_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$tab][0] = DOL_URL_ROOT.'/loan/document.php?id='.$object->id; $head[$tab][1] = $langs->trans("Documents"); - if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ''.($nbFiles+$nbLinks).''; $head[$tab][2] = 'documents'; $tab++; @@ -68,7 +68,7 @@ function loan_prepare_head($object) $nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1); $head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id; $head[$tab][1] = $langs->trans("Notes"); - if($nbNote > 0) $head[$tab][1].= ' '.$nbNote.''; + if($nbNote > 0) $head[$tab][1].= ''.$nbNote.''; $head[$tab][2] = 'note'; $tab++; } diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 6068246341e..1f643dd8a48 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -59,7 +59,7 @@ function member_prepare_head(Adherent $object) $head[$h][0] = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$object->id; $head[$h][1] = $langs->trans("Subscriptions"); $head[$h][2] = 'subscription'; - if ($nbSubscription > 0) $head[$h][1].= ' '.$nbSubscription.''; + if ($nbSubscription > 0) $head[$h][1].= ''.$nbSubscription.''; $h++; } @@ -76,7 +76,7 @@ function member_prepare_head(Adherent $object) $head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Note"); $head[$h][2] = 'note'; - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $h++; // Attachments @@ -87,7 +87,7 @@ function member_prepare_head(Adherent $object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 558a3d0d035..97ab411bdfc 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -53,7 +53,7 @@ function commande_prepare_head(Commande $object) $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id; $head[$h][1] = $langs->trans('ContactsAddresses'); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; } @@ -67,7 +67,7 @@ function commande_prepare_head(Commande $object) if ($conf->expedition_bon->enabled) $text.=$langs->trans("Shipments"); if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text.='/'; if ($conf->livraison_bon->enabled) $text.=$langs->trans("Receivings"); - if ($nbShipments > 0 || $nbReceiption > 0) $text.= ' '.($nbShipments?$nbShipments:0); + if ($nbShipments > 0 || $nbReceiption > 0) $text.= ''.($nbShipments?$nbShipments:0); if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text.='/'; if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text.= ($nbReceiption?$nbReceiption:0); if ($nbShipments > 0 || $nbReceiption > 0) $text.= ''; @@ -89,7 +89,7 @@ function commande_prepare_head(Commande $object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/commande/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -101,7 +101,7 @@ function commande_prepare_head(Commande $object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 11c5d50592a..bdeb9181d3b 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -82,7 +82,7 @@ function product_prepare_head($object) $head[$h][1] = $langs->trans('AssociatedProducts'); $nbFatherAndChild = $object->hasFatherOrChild(); - if ($nbFatherAndChild > 0) $head[$h][1].= ' '.$nbFatherAndChild.''; + if ($nbFatherAndChild > 0) $head[$h][1].= ''.$nbFatherAndChild.''; $head[$h][2] = 'subproduct'; $h++; } @@ -110,7 +110,7 @@ function product_prepare_head($object) $head[$h][1] = $langs->trans('ProductCombinations'); $head[$h][2] = 'combinations'; $nbVariant = $prodcomb->countNbOfCombinationForFkProductParent($object->id); - if ($nbVariant > 0) $head[$h][1].= ' '.$nbVariant.''; + if ($nbVariant > 0) $head[$h][1].= ''.$nbVariant.''; } $h++; @@ -160,7 +160,7 @@ function product_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/product/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -179,7 +179,7 @@ function product_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; @@ -228,7 +228,7 @@ function productlot_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT."/product/stock/productlot_document.php?id=".$object->id; $head[$h][1] = $langs->trans("Documents"); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 825142d1385..8ceca03b0b2 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -48,7 +48,7 @@ function project_prepare_head($object) $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT.'/projet/contact.php?id='.$object->id; $head[$h][1] = $langs->trans("ProjectContact"); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'contact'; $h++; @@ -61,7 +61,7 @@ function project_prepare_head($object) require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; $taskstatic=new Task($db); $nbTasks=count($taskstatic->getTasksArray(0, 0, $object->id, 0, 0)); - if ($nbTasks > 0) $head[$h][1].= ' '.($nbTasks).''; + if ($nbTasks > 0) $head[$h][1].= ''.($nbTasks).''; $head[$h][2] = 'tasks'; $h++; @@ -82,7 +82,7 @@ function project_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.$object->id; $head[$h][1] = $langs->trans("TimeSpent"); - if ($nbTimeSpent > 0) $head[$h][1].= ' ...'; + if ($nbTimeSpent > 0) $head[$h][1].= '...'; $head[$h][2] = 'timespent'; $h++; } @@ -123,7 +123,7 @@ function project_prepare_head($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; @@ -133,7 +133,7 @@ function project_prepare_head($object) $nbComments = $object->getNbComments(); $head[$h][0] = DOL_URL_ROOT.'/projet/comment.php?id='.$object->id; $head[$h][1] = $langs->trans("CommentLink"); - if ($nbComments > 0) $head[$h][1].= ' '.$nbComments.''; + if ($nbComments > 0) $head[$h][1].= ''.$nbComments.''; $head[$h][2] = 'project_comment'; $h++; } @@ -174,7 +174,7 @@ function task_prepare_head($object) $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $head[$h][1] = $langs->trans("TaskRessourceLinks"); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + if ($nbContact > 0) $head[$h][1].= ''.$nbContact.''; $head[$h][2] = 'task_contact'; $h++; @@ -195,7 +195,7 @@ function task_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $head[$h][1] = $langs->trans("TimeSpent"); - if ($nbTimeSpent > 0) $head[$h][1].= ' ...'; + if ($nbTimeSpent > 0) $head[$h][1].= '...'; $head[$h][2] = 'task_time'; $h++; @@ -212,7 +212,7 @@ function task_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'task_notes'; $h++; } @@ -224,7 +224,7 @@ function task_prepare_head($object) $nbFiles = count(dol_dir_list($filesdir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'task_document'; $h++; @@ -234,7 +234,7 @@ function task_prepare_head($object) $nbComments = $object->getNbComments(); $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $head[$h][1] = $langs->trans("CommentLink"); - if ($nbComments > 0) $head[$h][1].= ' '.$nbComments.''; + if ($nbComments > 0) $head[$h][1].= ''.$nbComments.''; $head[$h][2] = 'task_comment'; $h++; } @@ -1857,7 +1857,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $i = 0; print '
'; } @@ -427,7 +427,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } - if (! empty($object->lines) && $object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline') + if (! empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print '
'; } @@ -457,9 +457,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Modify - if (! empty($user->rights->mymodule->myobject->write)) + if ($permissiontoadd) { - print ''.$langs->trans("Modify").''."\n"; + print ''.$langs->trans("Modify").''."\n"; } else { @@ -467,13 +467,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - if (! empty($user->rights->mymodule->myobject->write)) + if ($permissiontoadd) { - print '' . $langs->trans("ToClone") . ''."\n"; + print '' . $langs->trans("ToClone") . ''."\n"; } /* - if ($user->rights->mymodule->myobject->write) + if ($permissiontoadd) { if ($object->status == 1) { @@ -487,7 +487,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea */ // Delete (need delete permission, or if draft, just need create/modify permission) - if (! empty($user->rights->mymodule->myobject->delete) || (! empty($object->fields['status']) && $object->status == $object::STATUS_DRAFT && ! empty($user->rights->mymodule->myobject->write))) + if ($permissiontodelete) { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 08fbcbaa98e..0224b7f12d2 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -153,9 +153,9 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -$permtoread = $user->rights->mymodule->myobject->read; -$permtowrite = $user->rights->mymodule->myobject->write; -$permtodelete = $user->rights->mymodule->myobject->delete; +$permissiontoread = $user->rights->mymodule->myobject->read; +$permissiontoadd = $user->rights->mymodule->myobject->write; +$permissiontodelete = $user->rights->mymodule->myobject->delete; /* @@ -347,7 +347,7 @@ $arrayofmassactions = array( //'builddoc'=>$langs->trans("PDFMerge"), //'presend'=>$langs->trans("SendByMail"), ); -if ($permtodelete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); +if ($permissiontodelete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); @@ -361,7 +361,7 @@ print ''; print ''; print ''; -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/mymodule/myobject_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permtowrite); +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/mymodule/myobject_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit); @@ -594,8 +594,8 @@ if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $n $urlsource.=str_replace('&', '&', $param); $filedir=$diroutputmassaction; - $genallowed=$permtoread; - $delallowed=$permtowrite; + $genallowed=$permissiontoread; + $delallowed=$permissiontoadd; print $formfile->showdocuments('massfilesarea_mymodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 07b6be426f3..43759bf0d70 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -90,14 +90,14 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu // Security check - Protection if external user //if ($user->socid > 0) access_forbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$isdraft = (($object->statut == Mo::STATUS_DRAFT) ? 1 : 0); +//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); //$result = restrictedArea($user, 'mrp', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); $permissionnote=$user->rights->mrp->write; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->mrp->write; // Used by the include of actions_dellink.inc.php $permissionedit=$user->rights->mrp->write; // Used by the include of actions_lineupdown.inc.php $permissiontoadd=$user->rights->mrp->write; // Used by the include of actions_addupdatedelete.inc.php -$permissiontodelete = $user->rights->mrp->delete || ($permissiontoadd && $object->status == 0); +$permissiontodelete = $user->rights->mrp->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); /* @@ -132,6 +132,12 @@ if (empty($reshook)) // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + // Actions to send emails + $trigger_name='MO_SENTBYMAIL'; + $autocopy='MAIN_MAIL_AUTOCOPY_MO_TO'; + $trackid='mo'.$object->id; + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; + // Action to move up and down lines of object //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once @@ -143,12 +149,6 @@ if (empty($reshook)) { $object->setProject(GETPOST('projectid', 'int')); } - - // Actions to send emails - $trigger_name='MO_SENTBYMAIL'; - $autocopy='MAIN_MAIL_AUTOCOPY_MO_TO'; - $trackid='mo'.$object->id; - include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -159,6 +159,7 @@ if (empty($reshook)) */ $form=new Form($db); +$formfile=new FormFile($db); $formproject=new FormProjets($db); llxHeader('', $langs->trans('Mo'), ''); @@ -299,6 +300,46 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); } + + // Confirmation of validation + if ($action == 'validate') + { + // We check that object has a temporary ref + $ref = substr($object->ref, 1, 4); + if ($ref == 'PROV') { + $object->fetch_product(); + $numref = $object->getNextNumRef($object->thirdparty); + } else { + $numref = $object->ref; + } + + $text = $langs->trans('ConfirmValidateMo', $numref); + /*if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
'; + $text .= $notify->confirmMessage('BOM_VALIDATE', $object->socid, $object); + }*/ + + $formquestion=array(); + if (! empty($conf->bom->enabled)) + { + $langs->load("mrp"); + require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; + $formproduct = new FormProduct($db); + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + ); + } + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Validate'), $text, 'confirm_validate', $formquestion, 0, 1, 220); + } + // Clone confirmation if ($action == 'clone') { // Create an array for form @@ -332,7 +373,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->mrp->write) + if ($permissiontoadd) { if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; @@ -366,7 +407,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print '
'; print '
'; - print ''."\n"; + print '
'."\n"; // Common attributes $keyforbreak='fk_warehouse'; @@ -407,14 +448,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print '
'; - if (! empty($object->lines) && $object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline') + if (! empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print '
'; } if (! empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/mrp/tpl'); } // Form to add new line @@ -423,14 +464,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action != 'editline') { // Add products/services form - $object->formAddObjectLine(1, $mysoc, $soc); + $object->formAddObjectLine(1, $mysoc, $soc, '/mrp/tpl'); $parameters = array(); $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook } } - if (! empty($object->lines) && $object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline') + if (! empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print '
'; } @@ -451,10 +492,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send - print '' . $langs->trans('SendMail') . ''."\n"; + //print '' . $langs->trans('SendMail') . ''."\n"; + + if ($user->rights->bom->write && $object->status == MO::STATUS_VALIDATED) + { + print '' . $langs->trans("SetToDraft") . ''; + } // Modify - if (! empty($user->rights->mrp->write)) + if ($permissiontoadd) { print ''.$langs->trans("Modify").''."\n"; } @@ -477,13 +523,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - if (! empty($user->rights->mrp->write)) + if ($permissiontoadd) { - print ''; + print '' . $langs->trans("ToClone") . ''; } // Delete (need delete permission, or if draft, just need create/modify permission) - if (! empty($user->rights->mrp->delete) || (! empty($object->fields['status']) && $object->status == $object::STATUS_DRAFT && ! empty($user->rights->mrp->write))) + if ($permissiontodelete) { print ''.$langs->trans('Delete').''."\n"; } @@ -507,14 +553,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // ancre // Documents - /*$objref = dol_sanitizeFileName($object->ref); - $relativepath = $comref . '/' . $comref . '.pdf'; + $objref = dol_sanitizeFileName($object->ref); + $relativepath = $objref . '/' . $objref . '.pdf'; $filedir = $conf->mrp->dir_output . '/' . $objref; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; $genallowed = $user->rights->mrp->read; // If you can read, you can build the PDF to read content $delallowed = $user->rights->mrp->create; // If you can create/edit, you can remove a file on card - print $formfile->showdocuments('mrp', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); - */ + print $formfile->showdocuments('mrp:mo', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $mysoc->default_lang); // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('mo')); diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index b91affe403f..7612700e4e5 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -177,8 +177,8 @@ if (empty($reshook)) // Mass actions $objectclass='Mo'; $objectlabel='Mo'; - $permtoread = $user->rights->mrp->read; - $permtodelete = $user->rights->mrp->delete; + $permissiontoread = $user->rights->mrp->read; + $permissiontodelete = $user->rights->mrp->delete; $uploaddir = $conf->mrp->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 30bdae7787c..c99525f5740 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -133,8 +133,8 @@ if (empty($reshook)) // Mass actions $objectclass='Opensurveysondage'; $objectlabel='Opensurveysondage'; - $permtoread = $user->rights->opensurvey->read; - $permtodelete = $user->rights->opensurvey->write; + $permissiontoread = $user->rights->opensurvey->read; + $permissiontodelete = $user->rights->opensurvey->write; $uploaddir = $conf->opensurvey->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 9a20f00341b..de1fa138f81 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -153,8 +153,8 @@ if (empty($reshook)) // Mass actions $objectclass='Inventory'; $objectlabel='Inventory'; - $permtoread = $user->rights->stock->lire; - $permtodelete = $user->rights->stock->supprimer; + $permissiontoread = $user->rights->stock->lire; + $permissiontodelete = $user->rights->stock->supprimer; $uploaddir = $conf->stock->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 2f13c4921a9..d9369fcb148 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -253,8 +253,8 @@ if (empty($reshook)) if ((string) $search_type == '1') { $objectlabel='Services'; } if ((string) $search_type == '0') { $objectlabel='Products'; } - $permtoread = $user->rights->produit->lire; - $permtodelete = $user->rights->produit->supprimer; + $permissiontoread = $user->rights->produit->lire; + $permissiontodelete = $user->rights->produit->supprimer; $uploaddir = $conf->product->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index b38888be9bb..a87f1a28621 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -144,8 +144,8 @@ if (empty($reshook)) // Mass actions $objectclass='Entrepot'; $objectlabel='Warehouse'; - $permtoread = $user->rights->stock->lire; - $permtodelete = $user->rights->stock->supprimer; + $permissiontoread = $user->rights->stock->lire; + $permissiontodelete = $user->rights->stock->supprimer; $uploaddir = $conf->stock->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 5f4e1b97aa6..ecffe32483e 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -421,8 +421,8 @@ if (empty($reshook) && $action != 'remove_file') { $objectclass='MouvementStock'; $objectlabel='Movements'; - $permtoread = $user->rights->stock->lire; - $permtodelete = $user->rights->stock->supprimer; + $permissiontoread = $user->rights->stock->lire; + $permissiontodelete = $user->rights->stock->supprimer; $uploaddir = $conf->stock->dir_output . "/movement/"; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 3be66f6acfe..88949818698 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -158,8 +158,8 @@ if (empty($reshook)) { $objectclass='ProductLot'; $objectlabel='LotSerial'; - $permtoread = $user->rights->stock->read; - $permtodelete = $user->rights->stock->delete; + $permissiontoread = $user->rights->stock->read; + $permissiontodelete = $user->rights->stock->delete; $uploaddir = $conf->stock->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 6cbe9d68127..b4e17377add 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -202,8 +202,8 @@ if (empty($reshook)) // Mass actions $objectclass='Project'; $objectlabel='Project'; - $permtoread = $user->rights->projet->lire; - $permtodelete = $user->rights->projet->supprimer; + $permissiontoread = $user->rights->projet->lire; + $permissiontodelete = $user->rights->projet->supprimer; $uploaddir = $conf->projet->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 0bffd50ce62..f16a9070325 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -163,8 +163,8 @@ if (empty($reshook)) // Mass actions $objectclass='Task'; $objectlabel='Tasks'; - $permtoread = $user->rights->projet->lire; - $permtodelete = $user->rights->projet->supprimer; + $permissiontoread = $user->rights->projet->lire; + $permissiontodelete = $user->rights->projet->supprimer; $uploaddir = $conf->projet->dir_output.'/tasks'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 8718806004b..326782f5a55 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -184,8 +184,8 @@ if (empty($reshook)) // Mass actions $objectclass='Task'; $objectlabel='Tasks'; - $permtoread = $user->rights->projet->lire; - $permtodelete = $user->rights->projet->supprimer; + $permissiontoread = $user->rights->projet->lire; + $permissiontodelete = $user->rights->projet->supprimer; $uploaddir = $conf->projet->dir_output.'/tasks'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 8f0d1895c1b..260c165064e 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -304,8 +304,8 @@ if (empty($reshook)) // Mass actions $objectclass='Societe'; $objectlabel='ThirdParty'; - $permtoread = $user->rights->societe->lire; - $permtodelete = $user->rights->societe->supprimer; + $permissiontoread = $user->rights->societe->lire; + $permissiontodelete = $user->rights->societe->supprimer; $uploaddir = $conf->societe->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 5e199722961..81698820eb8 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -156,8 +156,8 @@ if (empty($reshook)) // Mass actions $objectclass='WebsiteAccount'; $objectlabel='WebsiteAccount'; - $permtoread = $user->rights->societe->lire; - $permtodelete = $user->rights->societe->supprimer; + $permissiontoread = $user->rights->societe->lire; + $permissiontodelete = $user->rights->societe->supprimer; $uploaddir = $conf->societe->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index c48f3756611..e8cad1541ed 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -214,8 +214,8 @@ if (empty($reshook)) { $objectclass='SupplierProposal'; $objectlabel='SupplierProposals'; - $permtoread = $user->rights->supplier_proposal->lire; - $permtodelete = $user->rights->supplier_proposal->supprimer; + $permissiontoread = $user->rights->supplier_proposal->lire; + $permissiontodelete = $user->rights->supplier_proposal->supprimer; $uploaddir = $conf->supplier_proposal->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index 27fc142d991..75dcde0c2e4 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -44,7 +44,7 @@ a.badge:focus, a.badge:hover { text-decoration: none; } -.liste_titre .badge { +.liste_titre .badge:not(.nochangebackground) { background-color: ; color: #fff; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 6db99927fb1..37fbcbad115 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -681,6 +681,12 @@ select.flat.selectlimit { -webkit-line-clamp: 2; overflow: hidden; } +.twolinesmax { + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; +} .tablelistofcalendars { margin-top: 25px !important; @@ -2068,7 +2074,7 @@ div.login_block_other { padding-top: 0; text-align: right; margin-right: 8px; } float: right; vertical-align: top; padding: 0px 3px 0px 4px !important; - line-height: px; + line-height: px; height: px; } .atoplogin, .atoplogin:hover { diff --git a/htdocs/theme/md/badges.inc.php b/htdocs/theme/md/badges.inc.php index 11536240ee0..9f53a631ee4 100644 --- a/htdocs/theme/md/badges.inc.php +++ b/htdocs/theme/md/badges.inc.php @@ -44,7 +44,7 @@ a.badge:focus, a.badge:hover { text-decoration: none; } -.liste_titre .badge { +.liste_titre .badge:not(.nochangebackground) { background-color: ; color: #fff; } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 494d6b351b8..589067934d5 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -181,13 +181,13 @@ class Ticket extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'notnull'=>1, 'index'=>1), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>''), 'track_id' => array('type'=>'varchar(255)', 'label'=>'TicketTrackId', 'visible'=>-2, 'enabled'=>1, 'position'=>11, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text"), - 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1, 'css'=>'nowraponall'), + 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1, 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>-2, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth75'), 'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth100'), 'category_code' => array('type'=>'varchar(32)', 'label'=>'TicketGroup', 'visible'=>-1, 'enabled'=>1, 'position'=>21, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), 'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty"), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-1, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"), 'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'help'=>""), diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 7c6f525a0c4..4ca9140145b 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -3,6 +3,7 @@ * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2018 Regis Houssin * Copyright (C) 2019 Juanjo Menent + * Copyright (C) 2019 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -175,8 +176,8 @@ if (empty($reshook)) // Mass actions $objectclass='Ticket'; $objectlabel='Ticket'; - $permtoread = $user->rights->ticket->read; - $permtodelete = $user->rights->ticket->delete; + $permissiontoread = $user->rights->ticket->read; + $permissiontodelete = $user->rights->ticket->delete; $uploaddir = $conf->ticket->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/zapier/hook_list.php b/htdocs/zapier/hook_list.php index e622ce8bcff..2132cd5da25 100644 --- a/htdocs/zapier/hook_list.php +++ b/htdocs/zapier/hook_list.php @@ -191,8 +191,8 @@ if (empty($reshook)) { // Mass actions $objectclass='Hook'; $objectlabel='Hook'; - $permtoread = $user->rights->mymodule->read; - $permtodelete = $user->rights->mymodule->delete; + $permissiontoread = $user->rights->mymodule->read; + $permissiontodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; }