diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index aedd91a34eb..d3afd4035e4 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -99,6 +99,8 @@ if ($action == 'update') { $error = 0; if ($mode == 'template') { + //dolibarr_del_const($db, "MAIN_THEME", 0); // To be sure we don't have this constant set for all entities + dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 1e4c4d2e78a..b4e1f19554e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1821,8 +1821,9 @@ if ($resql) { $total_ht = 0; $total_margin = 0; + $imaxinloop = ($limit ? min($num, $limit) : $num); $last_num = min($num, $limit); - while ($i < $last_num) { + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); $notshippable = 0; @@ -2457,6 +2458,17 @@ if ($resql) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; + } + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1f64741385f..9b8fea19e5f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6148,7 +6148,7 @@ abstract class CommonObject //var_dump($this->oldcopy);exit; if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value //var_dump($this->oldcopy->array_options[$key]); var_dump($this->array_options[$key]); - if ($this->array_options[$key] == $this->oldcopy->array_options[$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update. + if (isset($this->oldcopy->array_options[$key]) && $this->array_options[$key] == $this->oldcopy->array_options[$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update. $new_array_options[$key] = $this->array_options[$key]; // Value is kept } else { // var_dump($algo); @@ -7556,11 +7556,15 @@ abstract class CommonObject if ($classname && class_exists($classname)) { $object = new $classname($this->db); if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong - $object->fetch($value, '', '', '', 0, 1, 1); + $result = $object->fetch($value, '', '', '', 0, 1, 1); } else { - $object->fetch($value); + $result = $object->fetch($value); + } + if ($result > 0) { + $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); + } else { + $value = ''; } - $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); } } else { dol_syslog('Error bad setup of extrafield', LOG_WARNING); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 45e2d51c344..45bf99577d4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3502,7 +3502,7 @@ function dolGetCountryCodeFromIp($ip) $countrycode = ''; if (!empty($conf->geoipmaxmind->enabled)) { - $datafile = $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE; + $datafile = getDolGlobalString('GEOIPMAXMIND_COUNTRY_DATAFILE'); //$ip='24.24.24.24'; //$datafile='/usr/share/GeoIP/GeoIP.dat'; Note that this must be downloaded datafile (not same than datafile provided with ubuntu packages) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php'; @@ -3529,7 +3529,7 @@ function dol_user_country() $ret = ''; if (!empty($conf->geoipmaxmind->enabled)) { $ip = getUserRemoteIP(); - $datafile = $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE; + $datafile = getDolGlobalString('GEOIPMAXMIND_COUNTRY_DATAFILE'); //$ip='24.24.24.24'; //$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat'; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php'; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 25945c4e83d..538fc299564 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -372,7 +372,12 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; } - print ''; + print ''; + + if (!empty($conf->global->MAIN_FORCETHEME)) { + $langs->load("errors"); + print $langs->trans("WarningThemeForcedTo", $conf->global->MAIN_FORCETHEME); + } print ''; print ''; + } + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); @@ -1876,8 +1892,8 @@ if ($resql) { $urlsource .= str_replace('&', '&', $param); $filedir = $diroutputmassaction; - $genallowed = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire); - $delallowed = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; print $formfile->showdocuments('massfilesarea_supplier_order', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } else { diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index c34ad5d8f58..5411e6b7aaa 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -24,6 +24,7 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; + /** * Class to manage intracomm report */ @@ -285,34 +286,34 @@ class IntracommReport extends CommonObject global $mysoc, $conf; if ($type == 'expedition' || $exporttype == 'des') { - $sql = 'SELECT f.ref as refinvoice, f.total_ht'; + $sql = "SELECT f.ref as refinvoice, f.total_ht"; $table = 'facture'; $table_extraf = 'facture_extrafields'; $tabledet = 'facturedet'; $field_link = 'fk_facture'; } else { // Introduction - $sql = 'SELECT f.ref_supplier as refinvoice, f.total_ht'; + $sql = "SELECT f.ref_supplier as refinvoice, f.total_ht"; $table = 'facture_fourn'; $table_extraf = 'facture_fourn_extrafields'; $tabledet = 'facture_fourn_det'; $field_link = 'fk_facture_fourn'; } - $sql .= ', l.fk_product, l.qty + $sql .= ", l.fk_product, l.qty , p.weight, p.rowid as id_prod, p.customcode , s.rowid as id_client, s.nom, s.zip, s.fk_pays, s.tva_intra , c.code , ext.mode_transport - FROM '.MAIN_DB_PREFIX.$tabledet.' l - INNER JOIN '.MAIN_DB_PREFIX.$table.' f ON (f.rowid = l.'.$field_link.') - LEFT JOIN '.MAIN_DB_PREFIX.$table_extraf.' ext ON (ext.fk_object = f.rowid) - INNER JOIN '.MAIN_DB_PREFIX.'product p ON (p.rowid = l.fk_product) - INNER JOIN '.MAIN_DB_PREFIX.'societe s ON (s.rowid = f.fk_soc) - LEFT JOIN '.MAIN_DB_PREFIX.'c_country c ON (c.rowid = s.fk_pays) + FROM ".MAIN_DB_PREFIX.$tabledet." l + INNER JOIN ".MAIN_DB_PREFIX.$table." f ON (f.rowid = l.".$this->db->escape($field_link).") + LEFT JOIN ".MAIN_DB_PREFIX.$table_extraf." ext ON (ext.fk_object = f.rowid) + INNER JOIN ".MAIN_DB_PREFIX."product p ON (p.rowid = l.fk_product) + INNER JOIN ".MAIN_DB_PREFIX."societe s ON (s.rowid = f.fk_soc) + LEFT JOIN ".MAIN_DB_PREFIX."c_country c ON (c.rowid = s.fk_pays) WHERE f.fk_statut > 0 - AND l.product_type = '.($exporttype == 'des' ? 1 : 0).' - AND f.entity = '.$conf->entity.' - AND (s.fk_pays <> '.$mysoc->country_id.' OR s.fk_pays IS NULL) - AND f.datef BETWEEN "'.$period_reference.'-01" AND "'.$period_reference.'-'.date('t').'"'; + AND l.product_type = ".($exporttype == "des" ? 1 : 0)." + AND f.entity = ".((int) $conf->entity)." + AND (s.fk_pays <> ".((int) $mysoc->country_id)." OR s.fk_pays IS NULL) + AND f.datef BETWEEN '".$this->db->escape($period_reference)."-01' AND '".$this->db->escape($period_reference)."-".date('t')."'"; return $sql; } @@ -398,27 +399,27 @@ class IntracommReport extends CommonObject } foreach ($TLinesFraisDePort as $res) { - $sql = 'SELECT p.customcode - FROM '.MAIN_DB_PREFIX.$tabledet.' d - INNER JOIN '.MAIN_DB_PREFIX.$table.' f ON (f.rowid = d.'.$field_link.') - INNER JOIN '.MAIN_DB_PREFIX.'product p ON (p.rowid = d.fk_product) + $sql = "SELECT p.customcode + FROM ".MAIN_DB_PREFIX.$tabledet." d + INNER JOIN ".MAIN_DB_PREFIX.$table." f ON (f.rowid = d.".$this->db->escape($field_link).") + INNER JOIN ".MAIN_DB_PREFIX."product p ON (p.rowid = d.fk_product) WHERE d.fk_product IS NOT NULL - AND f.entity = '.$conf->entity.' - AND '.$more_sql.' = "'.$res->refinvoice.'" + AND f.entity = ".((int) $conf->entity)." + AND ".$more_sql." = '".$this->db->escape($res->refinvoice)."' AND d.total_ht = ( SELECT MAX(d.total_ht) - FROM '.MAIN_DB_PREFIX.$tabledet.' d - INNER JOIN '.MAIN_DB_PREFIX.$table.' f ON (f.rowid = d.'.$field_link.') + FROM ".MAIN_DB_PREFIX.$tabledet." d + INNER JOIN ".MAIN_DB_PREFIX.$table." f ON (f.rowid = d.".$this->db->escape($field_link).") WHERE d.fk_product IS NOT NULL - AND '.$more_sql.' = "'.$res->refinvoice.'" + AND ".$more_sql." = '".$this->db->escape($res->refinvoice)."' AND d.fk_product NOT IN ( SELECT fk_product - FROM '.MAIN_DB_PREFIX.'categorie_product - WHERE fk_categorie = '.((int) $categ_fraisdeport->id).' + FROM ".MAIN_DB_PREFIX."categorie_product + WHERE fk_categorie = ".((int) $categ_fraisdeport->id)." ) - )'; + )"; $resql = $this->db->query($sql); $ress = $this->db->fetch_object($resql); @@ -436,7 +437,8 @@ class IntracommReport extends CommonObject */ public function getNextDeclarationNumber() { - $sql = 'SELECT MAX(numero_declaration) as max_declaration_number FROM '.MAIN_DB_PREFIX.$this->table_element." WHERE exporttype='".$this->db->escape($this->exporttype)."'"; + $sql = "SELECT MAX(numero_declaration) as max_declaration_number FROM ".MAIN_DB_PREFIX.$this->table_element; + $sql .= " WHERE exporttype = '".$this->db->escape($this->exporttype)."'"; $resql = $this->db->query($sql); if ($resql) { $res = $this->db->fetch_object($resql); diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 3955f0f9bb3..2857d7a3f54 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -287,6 +287,7 @@ ErrorInvoiceLoadThirdParty=Can't load third-party object for invoice "%s" ErrorInvoiceLoadThirdPartyKey=Third-party key "%s" no set for invoice "%s" ErrorDeleteLineNotAllowedByObjectStatus=Delete line is not allowed by current object status ErrorAjaxRequestFailed=Request failed +ErrorThirpdartyOrMemberidIsMandatory=Third party or Member of partnership is mandatory # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. @@ -321,7 +322,8 @@ WarningCreateSubAccounts=Warning, you can't create directly a sub account, you m WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection. WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here. WarningPaypalPaymentNotCompatibleWithStrict=The value 'Strict' makes the online payment features not working correctly. Use 'Lax' instead. - +WarningThemeForcedTo=Warning, theme has been forced to %s by hidden constant MAIN_FORCETHEME + # Validate RequireValidValue = Value not valid RequireAtLeastXString = Requires at least %s character(s) diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 126ea58076b..a14a5a93ff0 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -247,7 +247,7 @@ class Partnership extends CommonObject public function create(User $user, $notrigger = false) { if ($this->fk_soc <= 0 && $this->fk_member <= 0) { - $this->error[] = "ErrorThirpdartyOrMemberidIsManadatory"; + $this->error[] = "ErrorThirpdartyOrMemberidIsMandatory"; return -1; } @@ -555,7 +555,7 @@ class Partnership extends CommonObject public function update(User $user, $notrigger = false) { if ($this->fk_soc <= 0 && $this->fk_member <= 0) { - $this->error[] = "ErrorThirpdartyOrMemberidIsManadatory"; + $this->error[] = "ErrorThirpdartyOrMemberidIsMandatory"; return -1; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 930d28550c3..5eda12f56de 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2377,6 +2377,9 @@ img.photoref, div.photoref { width: 80px; object-fit: contain; } +img.photokanban, div.photokanban { + padding: 0; +} div.photoref .fa, div.photoref .fas, div.photoref .far { font-size: 2.5em; } @@ -5339,11 +5342,11 @@ td.cal_other_month { /* ============================================================================== */ /* CSS for treeview */ -.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 2px !important; } -.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 30px; } +.treeview ul { background-color: transparent !important; margin-top: 0 !important; /* margin-bottom: 4px !important; padding-top: 2px !important; */ } +.treeview li { background-color: transparent !important; padding: 0 0 0 20px !important; min-height: 30px; } +.treeview .hitarea { width: 20px !important; margin-left: -20px !important; margin-top: 3px; } .treeview li table { min-height: 30px; } .treeview .hover { color: var(--colortextlink) !important; text-decoration: underline !important; } -.treeview .hitarea { margin-top: 3px; } /* ============================================================================== */ diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 77270b9d818..f1f82b757c0 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -489,6 +489,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { .box-flex-container { margin: 0 0 0 0px !important; width: 100% !important; + justify-content: space-between; } .info-box-module { width: 100%; diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 8ffd6fc3f93..daf3c409397 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -193,7 +193,9 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { filter: saturate(global->THEME_SATURATE_RATIO; ?>); } + .info-box-sm .info-box-icon { + height: 80px; width: 80px; font-size: 25px; line-height: 92px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 298b8b5c46a..fdc2e9db2d7 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2399,6 +2399,11 @@ img.photoref, div.photoref { object-fit: contain; } +img.photokanban, div.photokanban { + padding: 0; + border: none; +} + div.photoref .fa, div.photoref .fas, div.photoref .far { font-size: 2.5em; } @@ -4110,7 +4115,8 @@ tr.liste_titre_topborder td { background: transparent; } tr.liste_titre:last-child th.liste_titre, tr.liste_titre:last-child th.liste_titre_sel, tr.liste_titre td.liste_titre, tr.liste_titre td.liste_titre_sel, form.liste_titre div.tagtd { /* For last line of table headers only */ - border-bottom: 1px solid var(--colortopbordertitle1); + /* border-bottom: 1px solid var(--colortopbordertitle1); */ + border-bottom: none; } div.liste_titre { @@ -5180,11 +5186,11 @@ td.gtaskname { /* ============================================================================== */ /* CSS for treeview */ -.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 8px !important; } -.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 30px; } +.treeview ul { background-color: transparent !important; margin-top: 0 !important; /* margin-bottom: 4px !important; padding-top: 2px !important; */ } +.treeview li { background-color: transparent !important; padding: 0 0 0 20px !important; min-height: 30px; } +.treeview .hitarea { width: 20px !important; margin-left: -20px !important; margin-top: 3px; } .treeview li table { min-height: 30px; } .treeview .hover { color: var(--colortextlink) !important; text-decoration: underline !important; } -.treeview .hitarea { margin-top: 3px; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 11d21f4e957..c073937b048 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2964,7 +2964,18 @@ class User extends CommonObject $return = '
'; $return .= '
'; $return .= ''; - $return .= img_picto('', $this->picto); + + $label = ''; + if (!empty($this->photo)) { + //$label .= '
'; + $label .= Form::showphoto('userphoto', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); // Force height to 60 so we total height of tooltip can be calculated and collision can be managed + //$label .= '
'; + //$label .= '
'; + $return .= $label; + } else { + $return .= img_picto('', $this->picto); + } + //$return .= ''; // Can be image $return .= '
'; $return .= '
'; @@ -2972,6 +2983,9 @@ class User extends CommonObject if (property_exists($this, 'label')) { $return .= '
'.$this->label.''; } + if ($this->email) { + $return .= '
'.img_picto('', 'email').' '.$this->email.''; + } if (method_exists($this, 'getLibStatut')) { $return .= '
'.$this->getLibStatut(5).'
'; } diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index c2ea42e6c6a..dd27bc36be8 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -341,7 +341,35 @@ if ($action == 'edit') { dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + print '
'; + print '
'; + print '
'; diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index 39103fdbb0a..1439ce73afe 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -63,9 +63,11 @@ foreach ($object->fields as $key => $val) { } print '
'; + if (!empty($val['picto'])) { print img_picto('', $val['picto'], '', false, 0, 0, '', 'pictofixedwidth'); } + if (in_array($val['type'], array('int', 'integer'))) { $value = GETPOSTISSET($key) ?GETPOST($key, 'int') : $object->$key; } elseif ($val['type'] == 'double') { @@ -78,6 +80,8 @@ foreach ($object->fields as $key => $val) { $check = 'restricthtml'; } $value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key; + } elseif (in_array($val['type'], array('date', 'datetime'))) { + $value = GETPOSTISSET($key) ? dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')) : $object->$key; } elseif ($val['type'] == 'price') { $value = GETPOSTISSET($key) ? price2num(GETPOST($key)) : price2num($object->$key); } elseif ($key == 'lang') { diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c2962836fa2..e5b7c62aae4 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -294,8 +294,9 @@ $suburi = strstr($uri, '/'); // $suburi contains url without domain:port if ($suburi == '/') { $suburi = ''; // If $suburi is /, it is now '' } -define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) - +if (!defined('DOL_URL_ROOT')) { + define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) +} //print DOL_MAIN_URL_ROOT.'-'.DOL_URL_ROOT."\n"; // Define prefix MAIN_DB_PREFIX diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index cc8bae4d907..22c4921b5b1 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -209,6 +209,12 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $error = 0; +$permissiontoread = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire); +$permissiontoadd = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontodelete = ($user->rights->fournisseur->commande->supprimer || $user->rights->supplier_order->supprimer); +$permissiontovalidate = $permissiontoadd; +$permissiontoapprove = ($user->rights->fournisseur->commande->approuver || $user->rights->supplier_order->approuver); + /* * Actions @@ -302,9 +308,6 @@ if (empty($reshook)) { // Mass actions $objectclass = 'CommandeFournisseur'; $objectlabel = 'SupplierOrders'; - $permissiontoread = $user->rights->fournisseur->commande->lire; - $permissiontodelete = $user->rights->fournisseur->commande->supprimer; - $permissiontovalidate = $user->rights->fournisseur->commande->creer; $uploaddir = $conf->fournisseur->commande->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -321,7 +324,7 @@ if (empty($reshook)) { $result = $objecttmp->valid($user); if ($result >= 0) { // If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step - if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) { + if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $permissiontoapprove && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) { $result = $objecttmp->approve($user); setEventMessages($langs->trans("SupplierOrderValidatedAndApproved"), array($objecttmp->ref)); } else { @@ -1096,7 +1099,7 @@ if ($resql) { ); if ($permissiontovalidate) { - if ($user->rights->fournisseur->commande->approuver && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) { + if ($permissiontoapprove && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) { $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove"); } else { $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"); @@ -1106,7 +1109,7 @@ if ($resql) { if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisSupplier"); } - if ($user->rights->fournisseur->commande->supprimer) { + if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'createbills'))) { @@ -1119,7 +1122,7 @@ if ($resql) { $url .= '&socid='.((int) $socid); $url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid)); } - $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)); + $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', $permissitiontoadd); // Lines of title fields print '
'; @@ -1532,7 +1535,9 @@ if ($resql) { $totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array()); $totalarray['val']['cf.total_ht'] = 0; $totalarray['val']['cf.total_ttc'] = 0; - while ($i < min($num, $limit)) { + + $imaxinloop = ($limit ? min($num, $limit) : $num); + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); $notshippable = 0; @@ -1855,6 +1860,17 @@ if ($resql) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print '
'.$langs->trans("NoRecordFound").'
'; + + // Login + print ''; + if (!empty($object->ldap_sid) && $object->statut == 0) { + print ''; + } else { + print ''; + } + print ''."\n"; + + print '
'.$langs->trans("Login").''; + print $langs->trans("LoginAccountDisableInDolibarr"); + print ''; + $addadmin = ''; + if (property_exists($object, 'admin')) { + if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) { + $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"'); + } elseif (!empty($object->admin)) { + $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"'); + } + } + print showValueWithClipboardCPButton($object->login).$addadmin; + print '
'; + + print ''; print dol_get_fiche_end(); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 55876016680..e8a4ed41a1c 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -282,7 +282,7 @@ print ''."\n"; print ''; print ''; - +print '
'; if ($user->admin) { print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));