Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
2891cadb20
@ -111,6 +111,71 @@ class Setup extends DolibarrApi
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of ordering origins.
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number {@min 0}
|
||||
* @param int $active Payment type is active or not {@min 0} {@max 1}
|
||||
* @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')"
|
||||
*
|
||||
* @url GET dictionary/ordering_origins
|
||||
*
|
||||
* @return array [List of ordering reasons]
|
||||
*
|
||||
* @throws RestException 400
|
||||
*/
|
||||
public function getOrderingOrigins($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->commande->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$sql = "SELECT rowid, code, label, module";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_input_reason as t";
|
||||
$sql .= " WHERE t.active = ".$active;
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
if (!DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql .= $this->db->order($sortfield, $sortorder);
|
||||
|
||||
if ($limit) {
|
||||
if ($page < 0) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
$sql .= $this->db->plimit($limit, $offset);
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
}
|
||||
} else {
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of payments types.
|
||||
*
|
||||
|
||||
@ -8,7 +8,12 @@
|
||||
-- Copyright (C) 2011-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
-- Copyright (C) 2015-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
-- Copyright (C) 2018 Abbes bahfir <dolipar@dolipar.org>
|
||||
-- Copyright (C) 2020 Udo Tamm <dev@dolibit.de>
|
||||
--
|
||||
--
|
||||
--------------------------------------------------------------------------------------
|
||||
-- License
|
||||
-- #######
|
||||
-- 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
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
@ -22,14 +27,25 @@
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
--
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
-- Comment
|
||||
-- #######
|
||||
-- (EN)
|
||||
-- Do not place a comment at the end of the line, this file is parsed at the end of the line.
|
||||
-- from the install and all '--' are removed.
|
||||
--
|
||||
-- (FR)
|
||||
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
|
||||
-- de l'install et tous les sigles '--' sont supprimés.
|
||||
--
|
||||
--------------------------------------------------------------------------------------
|
||||
-- PCG = Plan Comptable Général (FR) - General Accounting Plan (EN)
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
-- Accounting Journals
|
||||
|
||||
INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('VT', 'ACCOUNTING_SELL_JOURNAL', 2, 1, 1);
|
||||
INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('AC', 'ACCOUNTING_PURCHASE_JOURNAL', 3, 1, 1);
|
||||
INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('BQ', 'FinanceJournal', 4, 1, 1);
|
||||
@ -39,6 +55,9 @@ INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES
|
||||
INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('INV', 'InventoryJournal', 8, 1, 1);
|
||||
|
||||
|
||||
|
||||
-- Accounting Charts / Plans (Templates) for Countries
|
||||
|
||||
-- Description of chart of account FR PCG99-ABREGE
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG99-ABREGE', 'The simple accountancy french plan', 1);
|
||||
-- Description of chart of account FR PCG99-BASE
|
||||
@ -56,8 +75,9 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
|
||||
-- Description of chart of account ES PCG08-PYME
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 4, 'PCG08-PYME', 'The PYME accountancy spanish plan', 1);
|
||||
|
||||
-- Description of chart of account DE SKR03
|
||||
-- Description of chart of account DE SKR-03
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 5, 'SKR03', 'Standardkontenrahmen SKR 03', 1);
|
||||
-- Description of chart of account DE SKR-04
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 5, 'SKR04', 'Standardkontenrahmen SKR 04', 1);
|
||||
|
||||
-- Description of chart of account CH PCG_SUISSE
|
||||
@ -69,6 +89,18 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
|
||||
-- Description of chart of account TN PCT
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 10, 'PCT', 'The Tunisia plan', 1);
|
||||
|
||||
-- Description of chart of account MA PCG
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 12, 'PCG', 'The Moroccan chart of accounts', 1);
|
||||
|
||||
-- Description of chart of account DZ NSCF
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 13, 'NSCF', 'Nouveau système comptable financier', 1);
|
||||
|
||||
-- Description of chart of account NL NL-VERKORT
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 17, 'NL-VERKORT', 'Verkort rekeningschema', 1);
|
||||
|
||||
-- Description of chart of account SE BAS-K1-MINI
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 20, 'BAS-K1-MINI', 'The Swedish mini chart of accounts', 1);
|
||||
|
||||
-- Description of chart of account AT AT-BASE
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 41, 'AT-BASE', 'Plan Austria', 1);
|
||||
|
||||
@ -78,54 +110,60 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
|
||||
-- Description of chart of account DK DK-STD
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 80, 'DK-STD', 'Standardkontoplan fra SKAT', 1);
|
||||
|
||||
-- Description of chart of account EC EC-SUPERCIAS
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 84, 'EC-SUPERCIAS', 'Plan de cuentas Ecuador', 1);
|
||||
|
||||
|
||||
-- Description of chart of account LU PCN-LUXEMBURG
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (140, 'PCN-LUXEMBURG', 'Plan comptable normalisé Luxembourgeois', 1);
|
||||
|
||||
-- Description of chart of account MA PCG
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 12, 'PCG', 'The Moroccan chart of accounts', 1);
|
||||
|
||||
-- Description of chart of account SE BAS-K1-MINI
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 20, 'BAS-K1-MINI', 'The Swedish mini chart of accounts', 1);
|
||||
-- Description of chart of account RO RO-BASE
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (188, 'RO-BASE', 'Plan de conturi romanesc', 1);
|
||||
|
||||
|
||||
|
||||
|
||||
--DELETE FROM llx_accounting_system WHERE pcg_version = 'SYSCOHADA';
|
||||
|
||||
-- Plans SYSCOAHA Western Africa -- sorted alphabetical by countries abbreviations
|
||||
|
||||
-- Description of chart of account BJ SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 49,'SYSCOHADA-BJ', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account BF SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 60,'SYSCOHADA-BF', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account CM SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA-CM', 'Plan comptable Ouest-Africain', 1);
|
||||
-- Description of chart of account CD SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA-CD', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account CF SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 65,'SYSCOHADA-CF', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account KM SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA-KM', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account CG SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 72,'SYSCOHADA-CG', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account CI SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 21,'SYSCOHADA-CI', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account CM SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA-CM', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account GA SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 16,'SYSCOHADA-GA', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account GQ SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 87,'SYSCOHADA-GQ', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account KM SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA-KM', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account ML SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (147,'SYSCOHADA-ML', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account NE SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (168,'SYSCOHADA-NE', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account CD SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA-CD', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account SN SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 22,'SYSCOHADA-SN', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
@ -135,14 +173,3 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
|
||||
-- Description of chart of account TG SYSCOHADA
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA-TG', 'Plan comptable Ouest-Africain', 1);
|
||||
|
||||
-- Description of chart of account RO RO-BASE
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 188, 'RO-BASE', 'Plan de conturi romanesc', 1);
|
||||
|
||||
-- Description of chart of account DZ NSCF
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 13, 'NSCF', 'Nouveau système comptable financier', 1);
|
||||
|
||||
-- Description of chart of account NL NL-VERKORT
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 17, 'NL-VERKORT', 'Verkort rekeningschema', 1);
|
||||
|
||||
-- Description of chart of account EC EC-SUPERCIAS
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 84, 'EC-SUPERCIAS', 'Plan de cuentas Ecuador', 1);
|
||||
@ -47,17 +47,17 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_U
|
||||
-- Hidden but specific to one entity
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_OVERWRITE_TRANSLATION','1','chaine','Enable translation overwrite',0,1);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_DEFAULT_VALUES','1','chaine','Enable default value overwrite',0,1);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MONNAIE','EUR','chaine','Monnaie',0,1);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MONNAIE','EUR','chaine','Currency',0,1);
|
||||
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_SMTP_SERVER','','chaine','Host or ip address for SMTP server',0,1);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_SMTP_PORT','','chaine','Port for SMTP server',0,1);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_EMAIL_FROM','robot@domain.com','chaine','EMail emetteur pour les emails automatiques Dolibarr',0,1);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_EMAIL_FROM','robot@domain.com','chaine','email emitter for Dolibarr automatic emails',0,1);
|
||||
|
||||
--
|
||||
-- IHM
|
||||
--
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Longueur maximum des listes courtes (fiche client)',0,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Maximum length of lists',0,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Maximum length of short lists',0,0);
|
||||
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MENU_STANDARD','eldy_menu.php','chaine','Menu manager for internal users',0,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MENUFRONT_STANDARD','eldy_menu.php','chaine','Menu manager for external users',0,0);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -265,7 +265,7 @@ if ($action == 'create')
|
||||
// Date payment
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('DatePayment', 'datep', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
print $form->selectDate((empty($datep) ?-1 : $datep), "datep", '', '', '', 'add', 1, 1);
|
||||
print $form->selectDate((empty($datep) ? '' : $datep), "datep", 0, 0, 0, 'add', 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Date value for bank
|
||||
@ -305,16 +305,6 @@ if ($action == 'create')
|
||||
print '<input name="amount" id="amount" class="minwidth100" value="'.GETPOST("amount").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled))
|
||||
{
|
||||
$formproject = new FormProjets($db);
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Bank
|
||||
if (!empty($conf->banque->enabled))
|
||||
{
|
||||
@ -340,6 +330,16 @@ if ($action == 'create')
|
||||
print '<td><input name="num_payment" id="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
|
||||
}
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled))
|
||||
{
|
||||
$formproject = new FormProjets($db);
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
@ -476,9 +476,8 @@ if ($id)
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
* Action buttons
|
||||
*/
|
||||
// Action buttons
|
||||
|
||||
print '<div class="tabsAction">'."\n";
|
||||
if ($object->rappro == 0)
|
||||
{
|
||||
|
||||
@ -113,17 +113,17 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.rowid = s.fk_user";
|
||||
$sql .= " AND s.entity = ".$conf->entity;
|
||||
$sql .= " AND s.entity IN (".getEntity('payment_salaries').")";
|
||||
if (empty($user->rights->salaries->readall)) $sql .= " AND s.fk_user IN (".join(',', $childids).")";
|
||||
|
||||
// Search criteria
|
||||
if ($search_ref) $sql .= " AND s.rowid=".$search_ref;
|
||||
if ($search_ref) $sql .= " AND s.rowid=".((int) $search_ref);
|
||||
if ($search_user) $sql .= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email'), $search_user);
|
||||
if ($search_label) $sql .= natural_search(array('s.label'), $search_label);
|
||||
if ($search_date_start) $sql .= " AND s.datep >= '".$db->idate($search_date_start)."'";
|
||||
if ($search_date_end) $sql .= " AND s.datep <= '".$db->idate($search_date_end)."'";
|
||||
if ($search_amount) $sql .= natural_search("s.amount", $search_amount, 1);
|
||||
if ($search_account > 0) $sql .= " AND b.fk_account=".$search_account;
|
||||
if ($search_account > 0) $sql .= " AND b.fk_account=".((int) $search_account);
|
||||
if ($filtre) {
|
||||
$filtre = str_replace(":", "=", $filtre);
|
||||
$sql .= " AND ".$filtre;
|
||||
|
||||
@ -342,8 +342,8 @@ class User extends CommonObject
|
||||
|
||||
public $fields = array(
|
||||
'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||
'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1),
|
||||
'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -109,45 +109,32 @@ if (!empty($conf->api->enabled))
|
||||
|
||||
// Definition of fields for list
|
||||
$arrayfields = array(
|
||||
'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1),
|
||||
'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
|
||||
'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
|
||||
'u.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0),
|
||||
'u.employee'=>array('label'=>$langs->trans("Employee"), 'checked'=>($mode == 'employee' ? 1 : 0)),
|
||||
'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0),
|
||||
'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1),
|
||||
'u.api_key'=>array('label'=>$langs->trans("ApiKey"), 'checked'=>0, "enabled"=>($conf->api->enabled && $user->admin)),
|
||||
'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
|
||||
'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))),
|
||||
'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1),
|
||||
'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100),
|
||||
'u.datepreviouslogin'=>array('label'=>$langs->trans("PreviousConnexion"), 'checked'=>0, 'position'=>110),
|
||||
'u.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||
'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||
'u.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
||||
'u.login'=>array('label'=>"Login", 'checked'=>1, 'position'=>10),
|
||||
'u.lastname'=>array('label'=>"Lastname", 'checked'=>1, 'position'=>15),
|
||||
'u.firstname'=>array('label'=>"Firstname", 'checked'=>1, 'position'=>20),
|
||||
'u.entity'=>array('label'=>"Entity", 'checked'=>1, 'position'=>50, 'enabled'=>(!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))),
|
||||
'u.gender'=>array('label'=>"Gender", 'checked'=>0, 'position'=>22),
|
||||
'u.employee'=>array('label'=>"Employee", 'checked'=>($mode == 'employee' ? 1 : 0), 'position'=>25),
|
||||
'u.fk_user'=>array('label'=>"HierarchicalResponsible", 'checked'=>1, 'position'=>27),
|
||||
'u.accountancy_code'=>array('label'=>"AccountancyCode", 'checked'=>0, 'position'=>30),
|
||||
'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35),
|
||||
'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>($conf->api->enabled && $user->admin)),
|
||||
'u.fk_soc'=>array('label'=>"Company", 'checked'=>1, 'position'=>45),
|
||||
'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>($conf->salaries->enabled && !empty($user->rights->salaries->readall))),
|
||||
'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100),
|
||||
'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110),
|
||||
'u.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||
'u.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||
'u.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
);
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
|
||||
{
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val)
|
||||
{
|
||||
if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) {
|
||||
$arrayfields["ef.".$key] = array(
|
||||
'label'=>$extrafields->attributes[$object->table_element]['label'][$key],
|
||||
'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1),
|
||||
'position'=>$extrafields->attributes[$object->table_element]['pos'][$key],
|
||||
'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]),
|
||||
'langfile'=>$extrafields->attributes[$object->table_element]['langfile'][$key],
|
||||
'help'=>$extrafields->attributes[$object->table_element]['help'][$key]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
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');
|
||||
|
||||
// Init search fields
|
||||
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
||||
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
||||
$search_user = GETPOST('search_user', 'alpha');
|
||||
$search_login = GETPOST('search_login', 'alpha');
|
||||
$search_lastname = GETPOST('search_lastname', 'alpha');
|
||||
@ -183,6 +170,8 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
|
||||
$error = 0;
|
||||
|
||||
$childids = $user->getAllChildIds(1);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -308,7 +297,7 @@ if ($contextpage == 'employeelist' && $search_employee == 1) {
|
||||
$user2 = new User($db);
|
||||
|
||||
$sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.api_key, u.accountancy_code, u.gender, u.employee, u.photo,";
|
||||
$sql .= " u.datelastlogin, u.datepreviouslogin,";
|
||||
$sql .= " u.salary, u.datelastlogin, u.datepreviouslogin,";
|
||||
$sql .= " u.ldap_sid, u.statut, u.entity,";
|
||||
$sql .= " u.tms as date_update, u.datec as date_creation,";
|
||||
$sql .= " u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2, u2.admin as admin2, u2.fk_soc as fk_soc2, u2.email as email2, u2.gender as gender2, u2.photo as photo2, u2.entity as entity2, u2.statut as statut2,";
|
||||
@ -356,6 +345,7 @@ if ($catid > 0) $sql .= " AND cu.fk_categorie = ".((int) $catid);
|
||||
if ($catid == -2) $sql .= " AND cu.fk_categorie IS NULL";
|
||||
if ($search_categ > 0) $sql .= " AND cu.fk_categorie = ".$db->escape($search_categ);
|
||||
if ($search_categ == -2) $sql .= " AND cu.fk_categorie IS NULL";
|
||||
if ($mode == 'employee' && empty($user->rights->salaries->readall)) $sql .= " AND s.fk_user IN (".join(',', $childids).")";
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
// Add where from hooks
|
||||
@ -541,6 +531,13 @@ if (!empty($arrayfields['u.employee']['checked']))
|
||||
print $form->selectyesno('search_employee', $search_employee, 1, false, 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Supervisor
|
||||
if (!empty($arrayfields['u.fk_user']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, array(), 0, '', 0, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['u.accountancy_code']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_accountancy_code" class="maxwidth50" value="'.$search_accountancy_code.'"></td>';
|
||||
@ -561,12 +558,9 @@ if (!empty($arrayfields['u.entity']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"></td>';
|
||||
}
|
||||
// Supervisor
|
||||
if (!empty($arrayfields['u.fk_user']['checked']))
|
||||
if (!empty($arrayfields['u.salary']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, array(), 0, '', 0, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
}
|
||||
if (!empty($arrayfields['u.datelastlogin']['checked']))
|
||||
{
|
||||
@ -615,12 +609,13 @@ if (!empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre
|
||||
if (!empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre("FirstName", $_SERVER['PHP_SELF'], "u.firstname", $param, "", "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['u.gender']['checked'])) print_liste_field_titre("Gender", $_SERVER['PHP_SELF'], "u.gender", $param, "", "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['u.employee']['checked'])) print_liste_field_titre("Employee", $_SERVER['PHP_SELF'], "u.employee", $param, "", "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre("HierarchicalResponsible", $_SERVER['PHP_SELF'], "u.fk_user", $param, "", "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['u.accountancy_code']['checked'])) print_liste_field_titre("AccountancyCode", $_SERVER['PHP_SELF'], "u.accountancy_code", $param, "", "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['u.email']['checked'])) print_liste_field_titre("EMail", $_SERVER['PHP_SELF'], "u.email", $param, "", "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['u.api_key']['checked'])) print_liste_field_titre("ApiKey", $_SERVER['PHP_SELF'], "u.api_key", $param, "", "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "u.fk_soc", $param, "", "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['u.entity']['checked'])) print_liste_field_titre("Entity", $_SERVER['PHP_SELF'], "u.entity", $param, "", "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre("HierarchicalResponsible", $_SERVER['PHP_SELF'], "u.fk_user", $param, "", "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['u.salary']['checked'])) print_liste_field_titre("Salary", $_SERVER['PHP_SELF'], "u.salary", $param, "", "", $sortfield, $sortorder, 'right ');
|
||||
if (!empty($arrayfields['u.datelastlogin']['checked'])) print_liste_field_titre("LastConnexion", $_SERVER['PHP_SELF'], "u.datelastlogin", $param, "", '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_titre("PreviousConnexion", $_SERVER['PHP_SELF'], "u.datepreviouslogin", $param, "", '', $sortfield, $sortorder, 'center ');
|
||||
// Extra fields
|
||||
@ -713,6 +708,37 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
||||
print '<td>'.yn($obj->employee).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Supervisor
|
||||
if (!empty($arrayfields['u.fk_user']['checked']))
|
||||
{
|
||||
// Resp
|
||||
print '<td class="nowrap">';
|
||||
if ($obj->login2)
|
||||
{
|
||||
$user2->id = $obj->id2;
|
||||
$user2->login = $obj->login2;
|
||||
$user2->lastname = $obj->lastname2;
|
||||
$user2->firstname = $obj->firstname2;
|
||||
$user2->gender = $obj->gender2;
|
||||
$user2->photo = $obj->photo2;
|
||||
$user2->admin = $obj->admin2;
|
||||
$user2->email = $obj->email2;
|
||||
$user2->socid = $obj->fk_soc2;
|
||||
$user2->statut = $obj->statut2;
|
||||
print $user2->getNomUrl(-1, '', 0, 0, 24, 0, '', '', 1);
|
||||
if (!empty($conf->multicompany->enabled) && $obj->admin2 && !$obj->entity2)
|
||||
{
|
||||
print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"');
|
||||
} elseif ($obj->admin2)
|
||||
{
|
||||
print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"');
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['u.accountancy_code']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->accountancy_code.'</td>';
|
||||
@ -763,34 +789,12 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Supervisor
|
||||
if (!empty($arrayfields['u.fk_user']['checked']))
|
||||
|
||||
// Salary
|
||||
if (!empty($arrayfields['u.salary']['checked']))
|
||||
{
|
||||
// Resp
|
||||
print '<td class="nowrap">';
|
||||
if ($obj->login2)
|
||||
{
|
||||
$user2->id = $obj->id2;
|
||||
$user2->login = $obj->login2;
|
||||
$user2->lastname = $obj->lastname2;
|
||||
$user2->firstname = $obj->firstname2;
|
||||
$user2->gender = $obj->gender2;
|
||||
$user2->photo = $obj->photo2;
|
||||
$user2->admin = $obj->admin2;
|
||||
$user2->email = $obj->email2;
|
||||
$user2->socid = $obj->fk_soc2;
|
||||
$user2->statut = $obj->statut2;
|
||||
print $user2->getNomUrl(-1, '', 0, 0, 24, 0, '', '', 1);
|
||||
if (!empty($conf->multicompany->enabled) && $obj->admin2 && !$obj->entity2)
|
||||
{
|
||||
print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"');
|
||||
} elseif ($obj->admin2)
|
||||
{
|
||||
print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"');
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
print '<td class="nowraponall right">'.($obj->salary ? price($obj->salary) : '').'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Date last login
|
||||
|
||||
@ -212,9 +212,14 @@ class Hook extends CommonObject
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string amount
|
||||
* @var string url of webhook
|
||||
*/
|
||||
public $amount;
|
||||
public $url;
|
||||
|
||||
/**
|
||||
* @var int ID of user owner webhook
|
||||
*/
|
||||
public $fk_user;
|
||||
|
||||
/**
|
||||
* @var int Status
|
||||
|
||||
Loading…
Reference in New Issue
Block a user