diff --git a/build/doxygen/doxygen_header.html b/build/doxygen/doxygen_header.html index 235797bb6c9..f60f4829d76 100644 --- a/build/doxygen/doxygen_header.html +++ b/build/doxygen/doxygen_header.html @@ -2,7 +2,7 @@ -$title +Dolibarr source code documentation '; if (empty($obj->reconcilable)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } @@ -548,11 +548,11 @@ if ($resql) { if (!empty($arrayfields['aa.active']['checked'])) { print ''; if (empty($obj->active)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index ac8a8c6354d..4338d7ad803 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -91,8 +91,10 @@ $form = new Form($db); $fiscalyearstatic = new Fiscalyear($db); $title = $langs->trans('AccountingPeriods'); -$helpurl = ""; -llxHeader('', $title, $helpurl); + +$help_url = "EN:Module_Double_Entry_Accounting"; + +llxHeader('', $title, $help_url); $sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f"; diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 7fdd7c19e32..410807144f5 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -149,8 +149,10 @@ if ($action == 'confirm_delete' && $confirm == "yes") { $form = new Form($db); $title = $langs->trans("Fiscalyear")." - ".$langs->trans("Card"); -$helpurl = ""; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Double_Entry_Accounting"; + +llxHeader('', $title, $help_url); if ($action == 'create') { print load_fiche_titre($langs->trans("NewFiscalYear")); diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index 6fc5ac3cad8..d472350fab7 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -39,10 +39,14 @@ if (!$user->rights->accounting->fiscalyear->write) { $id = GETPOST('id', 'int'); + // View + $title = $langs->trans("Fiscalyear")." - ".$langs->trans("Info"); -$helpurl = ""; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Double_Entry_Accounting"; + +llxHeader('', $title, $help_url); if ($id) { $object = new Fiscalyear($db); diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 341fddf113c..ad1804048c3 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -419,11 +419,11 @@ if ($resql) { if (!empty($arrayfields['reconcilable']['checked'])) { print ''; if (empty($obj->reconcilable)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 60645353976..e3cac139c08 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -543,11 +543,11 @@ if ($action == 'create') { print '' . $langs->trans("Status") . ''; print ''; if (empty($object->validated)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index 0465b7eee4f..ec3b3824db7 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -89,12 +89,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '

'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +97,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '

'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index c33ee5a4739..34175da465f 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -92,12 +92,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -105,11 +100,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index edb2e9ba4dc..3f7114380f3 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -122,8 +122,10 @@ if ($object->id > 0) { $langs->load("companies"); $title = $langs->trans("Member")." - ".$langs->trans("Agenda"); - $helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; - llxHeader("", $title, $helpurl); + + $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + + llxHeader("", $title, $help_url); if (!empty($conf->notification->enabled)) { $langs->load("mails"); diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 9d403d88320..8d9ed70a925 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -50,6 +50,9 @@ $extrafields = new ExtraFields($db); // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +// Security check +$result = restrictedArea($user, 'adherent'); + /* * Actions @@ -259,7 +262,7 @@ dol_htmloutput_errors($mesg); print '
'; -print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", (!empty($conf->global->ADHERENT_CARD_TYPE) ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; print '
'; print ''; print ''; @@ -272,13 +275,13 @@ foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : $conf->global->ADHERENT_CARD_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ? GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'; print '
'; print '

'; -print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", (!empty($conf->global->ADHERENT_CARD_TYPE) ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; print '
'; print ''; print ''; @@ -290,14 +293,14 @@ foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : $conf->global->ADHERENT_CARD_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'.$langs->trans("Login").': '; print '
'; print '
'; print '

'; -print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForLabels", (empty($conf->global->ADHERENT_ETIQUETTE_TYPE) ? '' : $conf->global->ADHERENT_ETIQUETTE_TYPE)).' '; print '
'; print ''; print ''; @@ -309,7 +312,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel') ?GETPOST('modellabel') : $conf->global->ADHERENT_ETIQUETTE_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel') ? GETPOST('modellabel') : (empty($conf->global->ADHERENT_ETIQUETTE_TYPE) ? '' : $conf->global->ADHERENT_ETIQUETTE_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'; print '
'; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 787f0190e8c..6c7dddecaa6 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -482,6 +482,9 @@ class AdherentType extends CommonObject if (!empty($conf->global->MAIN_MULTILANGS)) { $this->getMultiLangs(); } + + // fetch optionals attributes and labels + $this->fetch_optionals(); } return 1; diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 349cf5e7b75..88e31ebffb6 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -89,8 +89,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); $title = $langs->trans("Member")." - ".$langs->trans("Documents"); -$helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader("", $title, $help_url); if ($id > 0) { $result = $membert->fetch($object->typeid); diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 4ec9bd6624f..c0599561df0 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -197,12 +197,12 @@ if ($conf->use_javascript_ajax) { $boxgraph .=''.$langs->trans("Statistics").''; $boxgraph .=''; - $SommeA = 0; - $SommeB = 0; + $SumToValidate = 0; + $SumValidated = 0; + $SumUpToDate = 0; + $SumResiliated = 0; + $SumExcluded = 0; - $SommeC = 0; - $SommeD = 0; - $SommeE = 0; $total = 0; $dataval = array(); @@ -213,20 +213,21 @@ if ($conf->use_javascript_ajax) { $dataval['uptodate'][] = array($i, isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0); $dataval['resiliated'][] = array($i, isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0); $dataval['excluded'][] = array($i, isset($MembersExcluded[$key]) ? $MembersExcluded[$key] : 0); - $SommeA += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; - $SommeB += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; - $SommeC += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; - $SommeD += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; - $SommeE += isset($MembersExcluded[$key]) ? $MembersExcluded [$key] : 0; + + $SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; + $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; + $SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; + $SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; + $SumExcluded += isset($MembersExcluded[$key]) ? $MembersExcluded [$key] : 0; $i++; } - $total = $SommeA + $SommeB + $SommeC + $SommeD + $SommeE; + $total = $SumToValidate + $SumValidated + $SumUpToDate + $SumResiliated + $SumExcluded; $dataseries = array(); - $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SommeB)); - $dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), round($SommeC)); - $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusExcluded"), round($SommeE)); - $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), round($SommeD)); - $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), round($SommeA)); + $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SumValidated)); + $dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), round($SumUpToDate)); + $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusExcluded"), round($SumExcluded)); + $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), round($SumResiliated)); + $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), round($SumToValidate)); include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; @@ -243,7 +244,8 @@ if ($conf->use_javascript_ajax) { $boxgraph .= ''; $boxgraph .= ''.$langs->trans("Total").''; - $boxgraph .= $SommeA + $SommeB + $SommeC + $SommeD + $SommeE; + + $boxgraph .= $SumToValidate + $SumValidated + $SumUpToDate + $SumResiliated + $SumExcluded; $boxgraph .= ''; $boxgraph .= ''; $boxgraph .= ''; @@ -495,11 +497,11 @@ foreach ($AdherentType as $key => $adhtype) { } print ''; print ''.$langs->trans("Total").''; -print ''.$SommeA.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''; -print ''.$SommeB.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''; -print ''.$SommeC.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''; -print ''.$SommeD.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).''; -print ''.$SommeE.' '.$staticmember->LibStatut(-2, $adhtype->subscription, 0, 3).''; +print ''.$SumToValidate.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''; +print ''.$SumValidated.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''; +print ''.$SumUpToDate.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''; +print ''.$SumResiliated.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).''; +print ''.$SumExcluded.' '.$staticmember->LibStatut(-2, $adhtype->subscription, 0, 3).''; print ''; print "\n"; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 595a2a9ea48..a52d551d83e 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -41,9 +41,6 @@ $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search -// Security check -$result = restrictedArea($user, 'adherent'); - $search = GETPOST("search", 'alpha'); $search_ref = GETPOST("search_ref", 'alpha'); $search_lastname = GETPOST("search_lastname", 'alpha'); @@ -162,6 +159,9 @@ $arrayfields = array( // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; +// Security check +$result = restrictedArea($user, 'adherent'); + /* * Actions diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 437a8c0c577..26fec04a5e6 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -57,9 +57,12 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, /* * View */ + $title = $langs->trans("Member")." - ".$langs->trans("Note"); -$helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader("", $title, $help_url); $form = new Form($db); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 8fa87cbb6a6..8e1b9093e77 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -121,6 +121,7 @@ $paymentdate = -1; * Actions */ +$parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -428,8 +429,10 @@ $form = new Form($db); $now = dol_now(); $title = $langs->trans("Member")." - ".$langs->trans("Subscriptions"); -$helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader("", $title, $help_url); $param = ''; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 195c2a194ba..25c44baa7db 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -43,12 +43,13 @@ $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $search_lastname = GETPOST('search_lastname', 'alpha'); -$search_login = GETPOST('search_login', 'alpha'); -$search_email = GETPOST('search_email', 'alpha'); +$search_login = GETPOST('search_login', 'alpha'); +$search_email = GETPOST('search_email', 'alpha'); $type = GETPOST('type', 'intcomma'); -$status = GETPOST('status', 'alpha'); +$status = GETPOST('status', 'alpha'); +$optioncss = GETPOST('optioncss', 'alpha'); -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 0ce4b2314b4..a99f1f990ad 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -142,13 +142,16 @@ $result = $object->fetch($id); */ $title = $langs->trans('MemberTypeCard'); -$helpurl = ''; + +$help_url = ''; + $shortlabel = dol_trunc($object->label, 16); $title = $langs->trans('MemberType')." ".$shortlabel." - ".$langs->trans('Translation'); -$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; -llxHeader('', $title, $helpurl); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url); $form = new Form($db); $formadmin = new FormAdmin($db); diff --git a/htdocs/adherents/vcard.php b/htdocs/adherents/vcard.php index dbdbbc687ea..a53cacd2212 100644 --- a/htdocs/adherents/vcard.php +++ b/htdocs/adherents/vcard.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2020 Frédéric France + * Copyright (C) 2020-2021 Frédéric France * * 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 @@ -20,9 +20,9 @@ */ /** - * \file htdocs/adherent/vcard.php + * \file htdocs/adherents/vcard.php * \ingroup societe - * \brief Onglet vcard d'un adherent + * \brief Vcard tab of a member */ require '../main.inc.php'; diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index f140b207aaf..50e4a3e92c7 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -94,12 +94,8 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +103,8 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ + +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 6fb4430d88e..89363a9027b 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -9,6 +9,7 @@ * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2016 Philippe Grand * Copyright (C) 2013 Florian Henry + * Copyright (C) 2021 Frédéric France * * 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 @@ -642,7 +643,7 @@ print ''; // Shippable Icon in List /* Kept as hidden feature for the moment, result seems bugged. -Whet is definition of "shippable" according to all different STOCK_CALCULATE_... options ? +Where is definition of "shippable" according to all different STOCK_CALCULATE_... options ? print ''; print ''.$langs->trans("ShippableOrderIconInList").''; @@ -657,65 +658,46 @@ if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { } print ''; print ''; +*/ /* // Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. // Ask for payment bank during order -if ($conf->banque->enabled) -{ +if ($conf->banque->enabled) { print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) - { + if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); - } - else - { - if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) - { + } else { + if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; - } - else - { + } else { print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print ''; -} -else -{ +} else { print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '.$langs->trans('NotAvailable').''; } // Ask for warehouse during order -if ($conf->stock->enabled) -{ - +if ($conf->stock->enabled) { print ''; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) - { + if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); - } - else - { - if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) - { + } else { + if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; - } - else - { + } else { print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print ''; -} -else -{ - +} else { print ''; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '.$langs->trans('NotAvailable').''; } diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index 1acad0506c0..d0c7c85463e 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -99,12 +99,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -112,11 +107,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index fbf347a45a9..b218a245c99 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -110,11 +110,11 @@ print ''; print $langs->trans("Required"); /*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; }*/ print ""; print ''; @@ -130,9 +130,9 @@ print ''; print ''; if (empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print ""; diff --git a/htdocs/admin/delivery_extrafields.php b/htdocs/admin/delivery_extrafields.php index 7222880ae47..cf712bc6ecf 100644 --- a/htdocs/admin/delivery_extrafields.php +++ b/htdocs/admin/delivery_extrafields.php @@ -96,12 +96,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -109,11 +104,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/deliverydet_extrafields.php b/htdocs/admin/deliverydet_extrafields.php index 45068a252b3..c74f5235d42 100644 --- a/htdocs/admin/deliverydet_extrafields.php +++ b/htdocs/admin/deliverydet_extrafields.php @@ -97,12 +97,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -110,11 +105,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/ecm_directories_extrafields.php b/htdocs/admin/ecm_directories_extrafields.php index 99cedac9f3f..d913826b245 100644 --- a/htdocs/admin/ecm_directories_extrafields.php +++ b/htdocs/admin/ecm_directories_extrafields.php @@ -96,23 +96,14 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/ecm_files_extrafields.php b/htdocs/admin/ecm_files_extrafields.php index d7d9f809534..b260eff55fa 100644 --- a/htdocs/admin/ecm_files_extrafields.php +++ b/htdocs/admin/ecm_files_extrafields.php @@ -96,23 +96,14 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index 70a9629e1d6..b76ee35b76c 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -95,13 +95,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -109,11 +103,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index 7df27d0d84b..4f807ee9da3 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -97,12 +97,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -110,11 +105,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 716ba5d1a03..25771ef63d0 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -90,12 +90,8 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -103,11 +99,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 0671783615c..65029a9246a 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -89,7 +89,7 @@ $picto = array( */ foreach ($modules as $const => $desc) { - if ($action == 'activate_'.strtolower($const)) { + if ($action == 'enable_'.strtolower($const)) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity); // If fckeditor is active in the product/service description, it is activated in the forms if ($const == 'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM)) { @@ -166,9 +166,9 @@ if (empty($conf->use_javascript_ajax)) { $constante = 'FCKEDITOR_ENABLE_'.$const; $value = (isset($conf->global->$constante) ? $conf->global->$constante : 0); if ($value == 0) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } elseif ($value == 1) { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print ""; diff --git a/htdocs/admin/holiday_extrafields.php b/htdocs/admin/holiday_extrafields.php index 732eb0997d7..609187058e3 100644 --- a/htdocs/admin/holiday_extrafields.php +++ b/htdocs/admin/holiday_extrafields.php @@ -90,12 +90,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -103,11 +98,8 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ + +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 1c59d1bb26d..72d16569b25 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -562,9 +562,9 @@ if ($action == 'edit') { if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { // Force e-mail recipient - print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.$conf->global->MAIN_MAIL_FORCE_SENDTO; - if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) { - if (!isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) { + print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); + if (!empty(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { + if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { print img_warning($langs->trans("ErrorBadEMail")); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); @@ -677,17 +677,17 @@ if ($action == 'edit') { // Domain print ''.$langs->trans("MAIN_MAIL_EMAIL_DKIM_DOMAIN").''; - print ''.$conf->global->MAIN_MAIL_EMAIL_DKIM_DOMAIN; + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_DOMAIN'); print ''; // Selector print ''.$langs->trans("MAIN_MAIL_EMAIL_DKIM_SELECTOR").''; - print ''.$conf->global->MAIN_MAIL_EMAIL_DKIM_SELECTOR; + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_SELECTOR'); print ''; // PRIVATE KEY print ''.$langs->trans("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").''; - print ''.$conf->global->MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY; + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY'); print ''; } diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 34da40010b5..cb5df373645 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -446,12 +446,12 @@ if ($action == 'edit') { // SMTPS ID if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { - print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID_EMAILING.''; + print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''.getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING').''; } // SMTPS PW if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { - print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING).''; + print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW_EMAILING')).''; } // TLS @@ -484,7 +484,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING); + print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING')); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -503,11 +503,9 @@ if ($action == 'edit') { print '
'; /* // Warning 1 - if ($linuxlike) - { + if ($linuxlike) { $sendmailoption=ini_get('mail.force_extra_parameters'); - if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption)) - { + if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption)) { print info_admin($langs->trans("SendmailOptionNotComplete")); } }*/ diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 9f766d76266..8f781318995 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -76,14 +76,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Security check -$socid = 0; -if ($user->socid > 0) { // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'mymodule', $id, ''); - // Initialize array of search criterias $search_all = GETPOST("search_all", 'alpha'); $search = array(); @@ -133,6 +125,19 @@ if ($id > 0) { $object->fetch($id); } +// Security check +$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +// A non admin user can see profiles but limited to its own user +if (!$user->admin) { + if ($object->id > 0 && $object->private != $user->id) { + accessforbidden(); + } +} + /* * Actions @@ -261,6 +266,10 @@ foreach ($search as $key => $val) { if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } +// If non admin, restrict list to itself +if (empty($user->admin)) { + $sql .= " AND private = ".((int) $user->id); +} //$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -315,32 +324,10 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit $num = $db->num_rows($resql); } -// Direct jump if only one record found -if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { - $obj = $db->fetch_object($resql); - $id = $obj->rowid; - header("Location: ".DOL_URL_ROOT.'/monmodule/emailsenderprofile_card.php?id='.$id); - exit; -} // Output page // -------------------------------------------------------------------- -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index 1d3faf71f1b..14960db11d7 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -32,10 +32,6 @@ $langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'err $action = GETPOST('action', 'aZ09'); -if (!$user->admin) { - accessforbidden(); -} - $usersignature = $user->signature; // For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html. if ($action == 'test' || $action == 'send') { @@ -53,6 +49,10 @@ $substitutionarrayfortest = array( ); complete_substitutions_array($substitutionarrayfortest, $langs); +// Security check +if (!$user->admin) { + accessforbidden(); +} /* diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 701156303bb..e11ac077cc6 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -93,12 +93,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -106,11 +101,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php index 6869d7897b3..c89ff3e3655 100644 --- a/htdocs/admin/orderdet_extrafields.php +++ b/htdocs/admin/orderdet_extrafields.php @@ -94,12 +94,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +102,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/reception_extrafields.php b/htdocs/admin/reception_extrafields.php index 9dea1bf8fd7..ab7d18b1331 100644 --- a/htdocs/admin/reception_extrafields.php +++ b/htdocs/admin/reception_extrafields.php @@ -99,12 +99,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -112,11 +107,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/resource_extrafields.php b/htdocs/admin/resource_extrafields.php index ff13b5f4573..c4967f75313 100644 --- a/htdocs/admin/resource_extrafields.php +++ b/htdocs/admin/resource_extrafields.php @@ -92,13 +92,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -106,11 +100,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 011b28e7421..98b6c996181 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -406,7 +406,7 @@ if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) { if ($allow_disable_encryption) { //On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes //Do not allow "disable encryption" as passwords cannot be decrypted - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; } else { print '-'; } @@ -432,10 +432,10 @@ if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) { print img_warning($langs->trans("WarningPassIsEmpty")); } else { if (empty($dolibarr_main_db_encrypted_pass)) { - print ''.$langs->trans("Activate").''; + print ''.$langs->trans("Activate").''; } if (!empty($dolibarr_main_db_encrypted_pass)) { - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; } } print ""; @@ -455,12 +455,12 @@ if (!empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { print ''; if (empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { print ''; - print ''.$langs->trans("Activate").''; + print ''.$langs->trans("Activate").''; print ""; } if (!empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { print ''; - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; print ""; } print ""; diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 59e0e857161..4121073dec2 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -93,13 +93,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +101,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index 61a14a34844..0156eed5072 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -95,13 +95,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -109,11 +103,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 5e0cfb38d4c..5a49c8f5bfd 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -93,13 +93,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +101,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php index 25689c7b9f5..07f223d59c8 100644 --- a/htdocs/admin/supplierorderdet_extrafields.php +++ b/htdocs/admin/supplierorderdet_extrafields.php @@ -94,13 +94,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -108,11 +102,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index 4a50beaa32e..0a4a851dae2 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -84,12 +84,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -97,11 +92,7 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/asset/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php index 6d2799e0228..165361f7f57 100644 --- a/htdocs/asset/admin/assets_type_extrafields.php +++ b/htdocs/asset/admin/assets_type_extrafields.php @@ -82,13 +82,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -96,11 +90,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index e5db1465fb6..ce8adad8e34 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -82,8 +82,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; */ $title = $langs->trans('Assets')." - ".$langs->trans('Documents'); -$helpurl = ''; -llxHeader('', $title, $helpurl); + +$help_url = ''; + +llxHeader('', $title, $help_url); $form = new Form($db); diff --git a/htdocs/asset/info.php b/htdocs/asset/info.php index f6d34454ad4..7a8f4c20ce2 100644 --- a/htdocs/asset/info.php +++ b/htdocs/asset/info.php @@ -57,8 +57,10 @@ $object->fetch($id); $form = new Form($db); $title = $langs->trans('Asset')." - ".$langs->trans('Info'); -$helpurl = ""; -llxHeader('', $title, $helpurl); + +$help_url = ""; + +llxHeader('', $title, $help_url); $object->info($id); diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 9d7e848b6d3..6103b963e21 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -196,8 +196,9 @@ if ($action == 'confirm_delete' && $user->rights->asset->write) { $form = new Form($db); -$helpurl = ''; -llxHeader('', $langs->trans("AssetsTypeSetup"), $helpurl); +$help_url = ''; + +llxHeader('', $langs->trans("AssetsTypeSetup"), $help_url); // List of asset type diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index a8033cf1c7a..ff57587d1b4 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -286,7 +286,7 @@ print '
'; // Sheet format print '
'; -print '
'; +print '
'; print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").'   '; print '
'; // List of possible labels (defined into $_Avery_Labels variable set into core/lib/format_cards.lib.php) @@ -302,7 +302,7 @@ print '
'; // Number of stickers to print print '
'; -print '
'; +print '
'; print $langs->trans("NumberOfStickers").'   '; print '
'; print ''; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 6d2047d3f49..fa2ef014d17 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -656,11 +656,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($object->status == 1) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } } */ diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index eb1852699c0..62fb6002760 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -76,18 +76,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Security check -if (empty($conf->bom->enabled)) { - accessforbidden('Module not enabled'); -} -$socid = 0; -if ($user->socid > 0) { - // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'bom', $id, ''); - // Initialize array of search criterias $search_all = GETPOST("search_all", 'alpha'); $search = array(); @@ -133,6 +121,13 @@ $permissiontoread = $user->rights->bom->read; $permissiontoadd = $user->rights->bom->write; $permissiontodelete = $user->rights->bom->delete; +// Security check +if ($user->socid > 0) { + // Protection if external user + accessforbidden(); +} +$result = restrictedArea($user, 'bom'); + /* * Actions diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 0d691995c29..02cd6e2a784 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -86,13 +86,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -100,11 +94,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 9f275033b01..734f2e89506 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -208,8 +208,9 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr $form = new Form($db); $formother = new FormOther($db); -$helpurl = 'EN:Module_Categories|FR:Module_Catégories'; -llxHeader("", $langs->trans("Categories"), $helpurl); +$help_url = 'EN:Module_Categories|FR:Module_Catégories|DE:Modul_Kategorien'; + +llxHeader("", $langs->trans("Categories"), $help_url); if ($user->rights->categorie->creer) { // Create or add diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index dedb368202d..817c750a571 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -207,8 +207,10 @@ $formother = new FormOther($db); $arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofcss = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); -$helpurl = ''; -llxHeader("", $langs->trans("Categories"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss); + +$help_url = ''; + +llxHeader("", $langs->trans("Categories"), $help_url, '', 0, 0, $arrayofjs, $arrayofcss); $title = Categorie::$MAP_TYPE_TITLE_AREA[$type]; diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index e314d0b3e66..bfa62eba7fc 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -86,13 +86,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -100,11 +94,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 4cbe35b31c5..834722f2afd 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -94,13 +94,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -108,11 +102,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 2b27d7ee451..c8c94e7e95a 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -300,6 +300,7 @@ if (empty($reshook)) { } } elseif ($action == 'setecheance' && $usercancreate) { $result = $object->set_echeance($user, dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); + $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { dol_print_error($db, $object->error); } diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 596abdf0e97..fed0e025f4c 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -34,6 +34,7 @@ if ((array_key_exists('action', $_GET) && $_GET['action'] == 'dl') || (array_key require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; @@ -56,13 +57,12 @@ $date_start = GETPOST('date_start', 'alpha'); $date_startDay = GETPOST('date_startday', 'int'); $date_startMonth = GETPOST('date_startmonth', 'int'); $date_startYear = GETPOST('date_startyear', 'int'); -$date_start = ($date_startDay) ?dol_mktime(0, 0, 0, $date_startMonth, $date_startDay, $date_startYear) : strtotime($date_start); +$date_start = ($date_startDay ? dol_mktime(0, 0, 0, $date_startMonth, $date_startDay, $date_startYear, 'tzuserrel') : dol_stringtotime($date_start)); $date_stop = GETPOST('date_stop', 'alpha'); $date_stopDay = GETPOST('date_stopday', 'int'); $date_stopMonth = GETPOST('date_stopmonth', 'int'); $date_stopYear = GETPOST('date_stopyear', 'int'); -//FIXME doldate -$date_stop = ($date_stopDay) ?dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear) : strtotime($date_stop); +$date_stop = ($date_stopDay ? dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear, 'tzuserrel') : dol_stringtotime($date_stop)); $action = GETPOST('action', 'aZ09'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context @@ -126,6 +126,17 @@ if (empty($entity)) { $error = 0; +$listofchoices = array( + 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => !empty($conf->facture->enabled), 'perms' => !empty($user->rights->facture->lire)), + 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled), 'perms' => !empty($user->rights->fournisseur->facture->lire)), + 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)), + 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)), + 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled), 'perms' => !empty($user->rights->tax->charges->lire)), + 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled), 'perms' => !empty($user->rights->salaries->read)), + 'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => !empty($conf->banque->enabled), 'perms' => !empty($user->rights->banque->lire)), + 'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled), 'perms' => !empty($user->rights->loan->read)), +); + /* @@ -155,7 +166,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $wheretail = " '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'"; // Customer invoices - if (GETPOST('selectinvoices')) { + if (GETPOST('selectinvoices') && !empty($listofchoices['selectinvoices']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -166,7 +177,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".Facture::STATUS_DRAFT; } // Vendor invoices - if (GETPOST('selectsupplierinvoices')) { + if (GETPOST('selectsupplierinvoices') && !empty($listofchoices['selectsupplierinvoices']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -177,7 +188,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".FactureFournisseur::STATUS_DRAFT; } // Expense reports - if (GETPOST('selectexpensereports')) { + if (GETPOST('selectexpensereports') && !empty($listofchoices['selectexpensereports']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -188,7 +199,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".ExpenseReport::STATUS_DRAFT; } // Donations - if (GETPOST('selectdonations')) { + if (GETPOST('selectdonations') && !empty($listofchoices['selectdonations']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -199,7 +210,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".Don::STATUS_DRAFT; } // Payments of salaries - if (GETPOST('selectpaymentsofsalaries')) { + if (GETPOST('selectpaymentsofsalaries') && !empty($listofchoices['selectpaymentsofsalaries']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -210,7 +221,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { //$sql.=" AND fk_statut <> ".PaymentSalary::STATUS_DRAFT; } // Social contributions - if (GETPOST('selectsocialcontributions')) { + if (GETPOST('selectsocialcontributions') && !empty($listofchoices['selectsocialcontributions']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -221,7 +232,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; } // Various payments - if (GETPOST('selectvariouspayment')) { + if (GETPOST('selectvariouspayment') && !empty($listofchoices['selectvariouspayment']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -231,7 +242,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; } // Loan payments - if (GETPOST('selectloanspayment')) { + if (GETPOST('selectloanspayment') && !empty($listofchoices['selectloanspayment']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -539,8 +550,11 @@ print ''; print ''.$langs->trans("ExportAccountingSourceDocHelp", $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Journals")).'
'; print '
'; -print $langs->trans("ReportPeriod").': '.$form->selectDate($date_start, 'date_start', 0, 0, 0, "", 1, 1, 0); -print ' - '.$form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0)."\n"; +print $langs->trans("ReportPeriod").': '; +print $form->selectDate($date_start, 'date_start', 0, 0, 0, "", 1, 1, 0, '', '', '', '', 1, '', '', 'tzuserrel'); +print ' - '; +print $form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0, '', '', '', '', 1, '', '', 'tzuserrel'); +print "\n"; // Export is for current company only if (!empty($conf->multicompany->enabled) && is_object($mc)) { @@ -558,22 +572,16 @@ if (!empty($conf->multicompany->enabled) && is_object($mc)) { print '
'; -$listofchoices = array( - 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => !empty($conf->facture->enabled)), - 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled)), - 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled)), - 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled)), - 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled)), - 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled)), - 'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => !empty($conf->banque->enabled)), - 'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled)), -); foreach ($listofchoices as $choice => $val) { if (empty($val['enabled'])) { continue; // list not qualified } + $disabled = ''; + if (empty($val['perms'])) { + $disabled = ' disabled'; + } $checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : ''); - print '
'; + print '
'; } print ''; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index b621ad9752f..37ef8a5da76 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -898,18 +898,21 @@ if ($resql) { print '
'; } - /// ajax to adjust value date with plus and less picto + // Code to adjust value date with plus and less picto using an Ajax call instead of a full reload of page + $urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?token='.currentToken(); print ' + '; + */ print '
'; print dol_get_fiche_end(); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 53d43583a9c..be91d475d4d 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -454,11 +454,14 @@ if (empty($numref)) { // Date de valeur print ''; - print dol_print_date($db->jdate($objp->dv), "day").' '; - print ''; + print ''.dol_print_date($db->jdate($objp->dv), "day").''; + print ' '; + print ''; + print ''; print img_edit_remove()." "; - print ''; + print ''; print img_edit_add().""; + print ''; print "\n"; // Type and num @@ -656,6 +659,29 @@ if (empty($numref)) { print "\n"; print ""; + // Code to adjust value date with plus and less picto using an Ajax call instead of a full reload of page + $urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?token='.currentToken(); + print ' + + '; + print "
"; print "\n"; diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index 82520c02fac..05aa47737be 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -91,7 +91,7 @@ if ($action != 'create' && $action != 'edit') { /* * - * Creation d'un champ optionnel + * Creation of an optional field * */ @@ -104,7 +104,7 @@ if ($action == 'create') { /* * - * Edition d'un champ optionnel + * Edition of an optional field * */ if ($action == 'edit' && !empty($attrname)) { diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php index 5264ee5472c..6ebdfae6277 100644 --- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php @@ -91,7 +91,7 @@ if ($action != 'create' && $action != 'edit') { /* * - * Creation d'un champ optionnel + * Creation of an optional field * */ @@ -104,7 +104,7 @@ if ($action == 'create') { /* * - * Edition d'un champ optionnel + * Edition of an optional field * */ if ($action == 'edit' && !empty($attrname)) { diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 167e9e4a577..4f0148a05a1 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1658,15 +1658,15 @@ if ($action == 'create') { if ($user->rights->facture->creer) { if (empty($object->suspended)) { - print ''; + print ''; } else { - print ''; + print ''; } } //if ($object->statut == Facture::STATUS_DRAFT && $user->rights->facture->supprimer) if ($user->rights->facture->supprimer) { - print ''; + print ''; } print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index cd1905f528f..925885e4e7a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2815,9 +2815,10 @@ if (!empty($conf->projet->enabled)) { $now = dol_now(); $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Card'); -$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; -llxHeader('', $title, $helpurl); +$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; + +llxHeader('', $title, $help_url); // Mode creation diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index c16d79d2574..ad44dbe6637 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2020 Thibault FOUCART * * 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 diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 4c0544e3810..f4937679504 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -91,8 +91,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; */ $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents'); -$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; -llxHeader('', $title, $helpurl); + +$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; + +llxHeader('', $title, $help_url); $form = new Form($db); diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index 141db21b73e..bf91d8b4d6a 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/compta/stats/supplier_ca.php + * \file htdocs/compta/stats/supplier_turnover.php * \brief Page reporting purchase turnover */ diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index 0530d58ee87..4b64b2e5942 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/compta/stats/supplier_ca_by_thirdparty.php + * \file htdocs/compta/stats/supplier_turnover_by_thirdparty.php * \brief Page reporting purchase turnover by thirdparty */ diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index bae45672257..421b88ea6b8 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1470,11 +1470,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Activer if ($object->statut == 0 && $user->rights->societe->contact->creer) { - print ''.$langs->trans("Reactivate").''; + print ''.$langs->trans("Reactivate").''; } // Desactiver if ($object->statut == 1 && $user->rights->societe->contact->creer) { - print ''.$langs->trans("DisableUser").''; + print ''.$langs->trans("DisableUser").''; } // Delete diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 6118553914d..cbe1d1a6194 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -1,7 +1,7 @@ - * Copyright (C) 2015 Frederic France - * Copyright (C) 2017 Regis Houssin +/* Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2015-2021 Frederic France + * Copyright (C) 2017 Regis Houssin * * 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 @@ -107,7 +107,7 @@ if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/', $c $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $helpurl); +llxHeader('', $title, $help_url); if ($object->id) { $head = contact_prepare_head($object); diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 5c7356fae00..8d2969a1370 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * 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 @@ -119,7 +119,7 @@ if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/', $c $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $helpurl); +llxHeader('', $title, $help_url); $form = new Form($db); diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index dc361a1f0b6..b725ef6f3f4 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '

'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php index 6e83f0a4c1b..70d3193c12f 100644 --- a/htdocs/contrat/admin/contractdet_extrafields.php +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel - /* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 1977cfac6e4..9a0a11f04d4 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -58,8 +58,8 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call if ($selecteddir != '/') { $selecteddir = preg_replace('/\/$/', '', $selecteddir); // We removed last '/' except if it is '/' } -} else // For no ajax call -{ +} else { + // For no ajax call //if (GETPOST('preopened')) { $_GET['dir'] = $_POST['dir'] = GETPOST('preopened'); } $openeddir = GETPOST('openeddir'); @@ -76,6 +76,9 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call } } +$websitekey = GETPOST('websitekey', 'alpha'); +$pageid = GETPOST('pageid', 'int'); + // Load translation files required by the page $langs->load("ecm"); diff --git a/htdocs/core/ajax/bankconciliate.php b/htdocs/core/ajax/bankconciliate.php index adcd1290fed..351903ea1f7 100644 --- a/htdocs/core/ajax/bankconciliate.php +++ b/htdocs/core/ajax/bankconciliate.php @@ -48,10 +48,6 @@ $action = GETPOST('action', 'aZ09'); * View */ -// Ajout directives pour resoudre bug IE -//header('Cache-Control: Public, must-revalidate'); -//header('Pragma: public'); - //top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header. top_httphead(); @@ -63,7 +59,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ $al->datev_next(GETPOST('rowid', 'int')); $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->datev), "day").''; + print ''.dol_print_date($db->jdate($al->datev), "day").''; exit; } @@ -74,7 +70,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ $al->datev_previous(GETPOST('rowid', 'int')); $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->datev), "day").''; + print ''.dol_print_date($db->jdate($al->datev), "day").''; exit; } @@ -85,7 +81,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ $al->dateo_next(GETPOST('rowid', 'int')); $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->dateo), "day").''; + print ''.dol_print_date($db->jdate($al->dateo), "day").''; exit; } @@ -96,7 +92,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ $al->dateo_previous(GETPOST('rowid', 'int')); $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->dateo), "day").''; + print ''.dol_print_date($db->jdate($al->dateo), "day").''; exit; } diff --git a/htdocs/core/ajax/pingresult.php b/htdocs/core/ajax/pingresult.php index 4398a3e8d4c..c1b75fb92d2 100644 --- a/htdocs/core/ajax/pingresult.php +++ b/htdocs/core/ajax/pingresult.php @@ -67,14 +67,14 @@ print ''."\n"; + print "\n".''."\n"; print "\n\n"; $url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING); // Try to guess the distrib used @@ -3150,8 +3168,8 @@ if (!function_exists("llxFooter")) { $now = dol_now(); print "\n\n"; include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt')); - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled'); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', $conf->entity); } } } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index e99acc0b913..8e40c1071e2 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -514,16 +514,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea /* if ($permissiontoadd) { if ($object->status == $object::STATUS_ENABLED) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } } if ($permissiontoadd) { if ($object->status == $object::STATUS_VALIDATED) { - print ''.$langs->trans("Cancel").''."\n"; + print ''.$langs->trans("Cancel").''."\n"; } else { - print ''.$langs->trans("Re-Open").''."\n"; + print ''.$langs->trans("Re-Open").''."\n"; } } */ diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index aa616709a7d..47afaa55b55 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -187,7 +187,7 @@ if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden(); } -//$result = restrictedArea($user, 'mymodule', $id, ''); +//$result = restrictedArea($user, 'mymodule'); //if (!$permissiontoread) accessforbidden(); diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 841dba3ea20..30fe3e8d9fa 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -82,18 +82,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Security check -if (empty($conf->mrp->enabled)) { - accessforbidden('Module not enabled'); -} -$socid = 0; -if ($user->socid > 0) { // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'mrp', $id, ''); - - // Initialize array of search criterias $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search = array(); @@ -139,6 +127,13 @@ $permissiontoread = $user->rights->mrp->read; $permissiontoadd = $user->rights->mrp->write; $permissiontodelete = $user->rights->mrp->delete; +// Security check +if ($user->socid > 0) { + // Protection if external user + accessforbidden(); +} +$result = restrictedArea($user, 'mrp'); + /* * Actions diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 75147a3c3f9..fb1c1c0c1ee 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2017 Charlie Benke + * Copyright (C) 2017 Charlie Benke * * 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 diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index 5c79be62197..2b86efa507c 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -33,10 +33,6 @@ use OAuth\Common\Storage\DoliStorage; // Load translation files required by the page $langs->loadLangs(array('admin', 'printing', 'oauth')); -if (!$user->admin) { - accessforbidden(); -} - $action = GETPOST('action', 'aZ09'); $mode = GETPOST('mode', 'alpha'); $value = GETPOST('value', 'alpha', 0, null, null, 1); // The value may be __google__docs so we force disable of replace @@ -53,6 +49,10 @@ if (!$mode) { $OAUTH_SERVICENAME_GOOGLE = 'Google'; +if (!$user->admin) { + accessforbidden(); +} + /* * Action diff --git a/htdocs/printing/index.php b/htdocs/printing/index.php index e0dcaf86e44..84132c784f4 100644 --- a/htdocs/printing/index.php +++ b/htdocs/printing/index.php @@ -28,6 +28,10 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php'; // Load translation files required by the page $langs->load("printing"); +if (!$user->admin) { + accessforbidden(); +} + /* * Actions diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 0962d1ddf44..aea75f78aa8 100644 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -99,12 +99,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -112,11 +107,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/product/admin/product_lot_extrafields.php b/htdocs/product/admin/product_lot_extrafields.php index 91e19ee1fa7..fc14b4c142c 100644 --- a/htdocs/product/admin/product_lot_extrafields.php +++ b/htdocs/product/admin/product_lot_extrafields.php @@ -91,13 +91,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -105,11 +99,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/product/admin/product_supplier_extrafields.php b/htdocs/product/admin/product_supplier_extrafields.php index 8c3a10a4b74..daafa2f668d 100644 --- a/htdocs/product/admin/product_supplier_extrafields.php +++ b/htdocs/product/admin/product_supplier_extrafields.php @@ -99,13 +99,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -113,11 +107,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/product/admin/stock_extrafields.php b/htdocs/product/admin/stock_extrafields.php index 3f860564b48..e72c9f1b1bf 100644 --- a/htdocs/product/admin/stock_extrafields.php +++ b/htdocs/product/admin/stock_extrafields.php @@ -86,13 +86,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -100,11 +94,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index b10e3aadcc8..32d36d2d6f6 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -59,6 +59,7 @@ $toselect = GETPOST('toselect', 'array'); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_ref = GETPOST("search_ref", 'alpha'); +$search_ref_supplier = GETPOST("search_ref_supplier", 'alpha'); $search_barcode = GETPOST("search_barcode", 'alpha'); $search_label = GETPOST("search_label", 'alpha'); $search_type = GETPOST("search_type", 'int'); @@ -146,15 +147,6 @@ if (!empty($canvas)) { $objcanvas->getCanvas('product', 'list', $canvas); } -// Security check -if ($search_type == '0') { - $result = restrictedArea($user, 'produit', '', '', '', '', '', 0); -} elseif ($search_type == '1') { - $result = restrictedArea($user, 'service', '', '', '', '', '', 0); -} else { - $result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0); -} - // Define virtualdiffersfromphysical $virtualdiffersfromphysical = 0; if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) @@ -267,6 +259,14 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Security check +if ($search_type == '0') { + $result = restrictedArea($user, 'produit', '', '', '', '', '', 0); +} elseif ($search_type == '1') { + $result = restrictedArea($user, 'service', '', '', '', '', '', 0); +} else { + $result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0); +} /* @@ -299,6 +299,7 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $sall = ""; $search_ref = ""; + $search_ref_supplier = ""; $search_label = ""; $search_barcode = ""; $searchCategoryProductOperator = 0; @@ -567,6 +568,7 @@ if ($resql) { } } + $paramsCat = ''; foreach ($searchCategoryProductList as $searchCategoryProduct) { $paramsCat .= "&search_category_product_list[]=".urlencode($searchCategoryProduct); } @@ -1644,7 +1646,7 @@ if ($resql) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - print price2num($product_static->stock_reel, 'MS'); + print price(price2num($product_static->stock_reel, 'MS')); } print ''; if (!$i) { @@ -1658,7 +1660,7 @@ if ($resql) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - print price2num($product_static->stock_theorique, 'MS'); + print price(price2num($product_static->stock_theorique, 'MS')); } print ''; if (!$i) { diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 015b061119b..ee86d43c09f 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -942,10 +942,10 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ } print ''; - print '('.$langs->trans("DisablePriceByQty").')'; + print '('.$langs->trans("DisablePriceByQty").')'; } else { print $langs->trans("No"); - print '  ('.$langs->trans("Activate").')'; + print '  ('.$langs->trans("Activate").')'; } print ''; } diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 94ecdc8e13a..646f3d322d7 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -92,14 +92,6 @@ if ($id || $ref) { $object->ref = $object->batch; // For document management ( it use $object->ref) } -// Protection if external user -if ($user->socid > 0) { - //accessforbidden(); -} -//$result = restrictedArea($user, 'mymodule', $id); - - - // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('productlotcard', 'globalcard')); @@ -114,7 +106,21 @@ $usercandelete = $user->rights->produit->supprimer; $upload_dir = $conf->productbatch->multidir_output[$conf->entity]; +$permissiontoread = $usercanread; $permissiontoadd = $usercancreate; +//$permissiontodelete = $usercandelete; + +// Security check +if (empty($conf->productbatch->enabled)) { + accessforbidden('Module not enabled'); +} +$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +//$result = restrictedArea($user, 'productbatch'); +if (!$permissiontoread) accessforbidden(); /* diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 81f68487cf6..97eaace9ee4 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -90,6 +90,28 @@ if ($id || $ref) { } } +$usercanread = $user->rights->produit->lire; +$usercancreate = $user->rights->produit->creer; +$usercandelete = $user->rights->produit->supprimer; + +$upload_dir = $conf->productbatch->multidir_output[$conf->entity]; + +$permissiontoread = $usercanread; +$permissiontoadd = $usercancreate; +//$permissiontodelete = $usercandelete; + +// Security check +if (empty($conf->productbatch->enabled)) { + accessforbidden('Module not enabled'); +} +$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +//$result = restrictedArea($user, 'productbatch'); +if (!$permissiontoread) accessforbidden(); + /* * Actions diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index e04b3f2e59b..e467aa80d95 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -129,10 +129,27 @@ 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->stock->lire; -$permissiontoadd = $user->rights->stock->mouvement->creer; -//$permissiontodelete = $user->rights->stock->supprimer; +$usercanread = $user->rights->produit->lire; +$usercancreate = $user->rights->produit->creer; +$usercandelete = $user->rights->produit->supprimer; +$upload_dir = $conf->productbatch->multidir_output[$conf->entity]; + +$permissiontoread = $usercanread; +$permissiontoadd = $usercancreate; +//$permissiontodelete = $usercandelete; + +// Security check +if (empty($conf->productbatch->enabled)) { + accessforbidden('Module not enabled'); +} +$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +//$result = restrictedArea($user, 'productbatch'); +if (!$permissiontoread) accessforbidden(); /* diff --git a/htdocs/projet/admin/project_extrafields.php b/htdocs/projet/admin/project_extrafields.php index e011b1a02c3..c4a4caa47fb 100644 --- a/htdocs/projet/admin/project_extrafields.php +++ b/htdocs/projet/admin/project_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/projet/admin/project_task_extrafields.php b/htdocs/projet/admin/project_task_extrafields.php index 5222706d7d0..da79010076a 100644 --- a/htdocs/projet/admin/project_task_extrafields.php +++ b/htdocs/projet/admin/project_task_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c1cff4ce944..5d0f197568c 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -521,50 +521,50 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''.$langs->trans("ProjectLabel").''; // Usage (opp, task, bill time, ...) - print ''; - print $langs->trans("Usage"); - print ''; - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ' '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print ''; - print ''; - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print ''; + print $langs->trans("Usage"); + print ''; + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print ' '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print ''; + print ''; + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print ' '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print ''; + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print ' '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print ''; + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print ' '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print ' '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print ''; - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print ' '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print ''; - print '
'; - } - - if (!empty($conf->eventorganization->enabled)) { - print ' '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); - } - - print ''; - print ''; // Thirdparty if ($conf->societe->enabled) { @@ -805,45 +805,48 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; // Usage - print ''; - print $langs->trans("Usage"); - print ''; - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print ''; - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - if (!empty($conf->eventorganization->enabled)) { - print ' '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + if (jQuery("#usage_opportunity").prop("checked")) { + console.log("Show opportunities fields"); + jQuery(".classuseopportunity").show(); + } else { + console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked")); + jQuery(".classuseopportunity").hide(); + } + }); + });'; + print ''; + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print ' '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print ''; } print ''; @@ -980,7 +983,6 @@ if ($action == 'create' && $user->rights->projet->creer) { dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print '
'; print '
'; print '
'; @@ -988,35 +990,37 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; // Usage - print ''; - print ''; + print ''; } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } - if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 7f6c6c4f009..8fc018ab8ab 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -313,34 +313,36 @@ if ($id > 0 || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index ac8ed3879cd..f72b1eba7d2 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -235,34 +235,36 @@ print '
'; print ''; // Usage -print ''; -print ''; + print ''; } -if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; -} -if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; -} -if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); -} -print ''; // Visibility print '
'; -print $langs->trans("Usage"); -print ''; -if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; +if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index eb5b0ae7b0a..07724753f2d 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -462,34 +462,36 @@ if ($id > 0 || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 9829e079da6..8ce97133493 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -147,29 +147,36 @@ if ($id > 0 || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print ''; - // Usage + // Opportunities if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && !empty($object->usage_opportunity)) { // Opportunity status print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; @@ -180,7 +187,7 @@ if ($id > 0 || !empty($ref)) { } print '
'.$langs->trans("OpportunityStatus").''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 854e57bbd1f..7916c236fb3 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -209,29 +209,36 @@ if ($id > 0 || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 9e2ea202601..afa63f7eee4 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -166,29 +166,36 @@ if ($object->id > 0) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index e23b5e3d70b..2452cc71d86 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -141,29 +141,36 @@ if ($object->id > 0) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 77b015d5819..828b32c599f 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -252,29 +252,36 @@ if ($id > 0 || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 0beacab18a0..eb1c394d8cf 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -612,34 +612,36 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/public/cron/cron_run_jobs_by_url.php b/htdocs/public/cron/cron_run_jobs_by_url.php index aaf7e38cac8..133c5d1b18a 100644 --- a/htdocs/public/cron/cron_run_jobs_by_url.php +++ b/htdocs/public/cron/cron_run_jobs_by_url.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/public/cron/cron_run_jobs.php + * \file htdocs/public/cron/cron_run_jobs_by_url.php * \ingroup cron * \brief Execute pendings jobs */ diff --git a/htdocs/public/project/index.html b/htdocs/public/project/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/public/project/index.html @@ -0,0 +1 @@ + diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 51b8dbf9aa1..f25843f69e4 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -4,7 +4,7 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ */ /** - * \file htdocs/public/lead/new.php + * \file htdocs/public/project/new.php * \ingroup project * \brief Example of form to add a new lead */ diff --git a/htdocs/recruitment/admin/candidature_extrafields.php b/htdocs/recruitment/admin/candidature_extrafields.php index 984d92ce913..1f0ac538d0b 100644 --- a/htdocs/recruitment/admin/candidature_extrafields.php +++ b/htdocs/recruitment/admin/candidature_extrafields.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/recruitement/admin/candidature_extrafields.php + * \file htdocs/recruitment/admin/candidature_extrafields.php * \ingroup recruitment * \brief Page to setup extra fields of Candidature */ diff --git a/htdocs/recruitment/admin/jobposition_extrafields.php b/htdocs/recruitment/admin/jobposition_extrafields.php index 7df03c0c543..3b17322d5eb 100644 --- a/htdocs/recruitment/admin/jobposition_extrafields.php +++ b/htdocs/recruitment/admin/jobposition_extrafields.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/recruitement/admin/jobposition_extrafields.php + * \file htdocs/recruitment/admin/jobposition_extrafields.php * \ingroup recruitment * \brief Page to setup extra fields of Candidature */ diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 26d1578b24c..2b832b3b467 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -548,9 +548,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea /* if ($permissiontoadd) { if ($object->status == $object::STATUS_ENABLED) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } }*/ if ($permissiontoadd) { diff --git a/htdocs/salaries/admin/salaries_extrafields.php b/htdocs/salaries/admin/salaries_extrafields.php index 59074e582d2..38303518ac4 100644 --- a/htdocs/salaries/admin/salaries_extrafields.php +++ b/htdocs/salaries/admin/salaries_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '

'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '

'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/societe/admin/contact_extrafields.php b/htdocs/societe/admin/contact_extrafields.php index 3841a7c66ea..6607efa554d 100644 --- a/htdocs/societe/admin/contact_extrafields.php +++ b/htdocs/societe/admin/contact_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index d1ffffd6b87..a785b95c892 100644 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel - /* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '
'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 6f9ee362a82..e7d40037155 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -80,7 +80,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); -if ($user->socid && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) { +if ($user->socid) { $socid = $user->socid; } if (empty($socid) && $action == 'view') { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 47d714e08db..c141290d9e9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Philippe Grand * Copyright (C) 2019-2020 Josep Lluís Amador - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * Copyright (C) 2020 Open-Dsi * * This program is free software; you can redistribute it and/or modify @@ -4247,7 +4247,7 @@ class Societe extends CommonObject $table = 'supplier_proposal'; } - $sql = "SELECT rowid, total_ht, total as total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f"; + $sql = "SELECT rowid, total_ht, total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f"; $sql .= " WHERE fk_soc = ".$this->id; if ($mode == 'supplier') { $sql .= " AND entity IN (".getEntity('supplier_proposal').")"; diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php index 035be6ff86d..66bcf2c61e4 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php @@ -82,13 +82,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -96,11 +90,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php index f4b63f25cd7..5a061101fab 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 136841a8683..c9cdb681267 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2020 Thibault FOUCART * * 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 @@ -21,10 +21,6 @@ * \brief Ajax search component for TakePos. It search products of a category. */ -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (!defined('NOCSRFCHECK')) { define('NOCSRFCHECK', '1'); } diff --git a/htdocs/user/admin/group_extrafields.php b/htdocs/user/admin/group_extrafields.php index 627af1c3b9d..b258f991a47 100644 --- a/htdocs/user/admin/group_extrafields.php +++ b/htdocs/user/admin/group_extrafields.php @@ -89,13 +89,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -103,11 +97,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index 25141ed4fcd..7e22a1c7122 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Editing an optional field */ -/* */ -/* ************************************************************************** */ +// Editing an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index a72dde04fb1..d4373812f61 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1821,12 +1821,12 @@ if ($action == 'create' || $action == 'adduserldap') { // Enable user if ($user->id <> $id && $candisableuser && $object->statut == 0 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print ''; + print ''; } // Disable user if ($user->id <> $id && $candisableuser && $object->statut == 1 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print ''; + print ''; } else { if ($user->id == $id) { print ''; @@ -1836,7 +1836,7 @@ if ($action == 'create' || $action == 'adduserldap') { if ($user->id <> $id && $candisableuser && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { if ($user->admin || !$object->admin) { // If user edited is admin, delete is possible on for an admin - print ''; + print ''; } else { print ''; } diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index d50fec76353..9415366061d 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2020 Thibault FOUCART * * 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 diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 05945c02855..0d6d413ba0f 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -57,14 +57,6 @@ $backtopage = GETPOST('backtopage', 'alpha'); $userid = GETPOST('user', 'int'); -// Security check -$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', $feature2); - -// Users/Groups management only in master entity if transverse mode -if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { - accessforbidden(); -} - $object = new Usergroup($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels @@ -77,6 +69,13 @@ $object->getrights(); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('groupcard', 'globalcard')); +// Security check +$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', $feature2); + +// Users/Groups management only in master entity if transverse mode +if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { + accessforbidden(); +} /** diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index dcefbf4a413..aee79688aee 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -33,16 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; // Load translation files required by page $langs->loadLangs(array('companies', 'ldap', 'users', 'admin')); -// Users/Groups management only in master entity if transverse mode -if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { - accessforbidden(); -} - -$canreadperms = true; -if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $canreadperms = ($user->admin || $user->rights->user->group_advance->read); -} - $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); @@ -55,6 +45,16 @@ $object = new Usergroup($db); $object->fetch($id); $object->getrights(); +// Users/Groups management only in master entity if transverse mode +if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { + accessforbidden(); +} + +$canreadperms = true; +if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + $canreadperms = ($user->admin || $user->rights->user->group_advance->read); +} + /* * Actions diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 7281bc93639..edd34dfe9b8 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -28,17 +28,6 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; -if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - if (!$user->rights->user->group_advance->read && !$user->admin) { - accessforbidden(); - } -} - -// Users/Groups management only in master entity if transverse mode -if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { - accessforbidden(); -} - // Load translation files required by page $langs->load("users"); @@ -78,6 +67,21 @@ $fieldstosearchall = array( 'g.note'=>"Note" ); +if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + if (!$user->rights->user->group_advance->read && !$user->admin) { + accessforbidden(); + } +} + +// Users/Groups management only in master entity if transverse mode +if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { + accessforbidden(); +} + +if (!$user->rights->user->user->lire && !$user->admin) { + accessforbidden(); +} + /* * Actions diff --git a/htdocs/user/list.php b/htdocs/user/list.php index f9703116d62..aef0d3e31c9 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -31,10 +31,6 @@ if (!empty($conf->categorie->enabled)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } -if (!$user->rights->user->user->lire && !$user->admin) { - accessforbidden(); -} - // Load translation files required by page $langs->loadLangs(array('users', 'companies', 'hrm', 'salaries')); @@ -185,6 +181,10 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $error = 0; +if (!$user->rights->user->user->lire && !$user->admin) { + accessforbidden(); +} + $childids = $user->getAllChildIds(1); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index e63c3cb8fef..957173335c0 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -332,17 +332,17 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($object->status == 1) { - print ''."\n"; + print ''."\n"; } else { - print ''."\n"; + print ''."\n"; } } */ if ($user->rights->website->delete) { - print ''."\n"; + print ''."\n"; } } print ''."\n"; diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index c15053bad5e..61686423d4c 100755 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -469,16 +469,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoadd) { if ($object->status == $object::STATUS_ENABLED) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } } // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/zapier/hook_card.php b/htdocs/zapier/hook_card.php index 455efc95cc9..f57f8873aba 100644 --- a/htdocs/zapier/hook_card.php +++ b/htdocs/zapier/hook_card.php @@ -351,11 +351,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($object->status == 1) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } } */