'."\n";
if ($object->rappro == 0)
{
diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php
index 3ef6531e6fd..135e2f53080 100644
--- a/htdocs/salaries/list.php
+++ b/htdocs/salaries/list.php
@@ -31,7 +31,42 @@ if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/account
// Load translation files required by the page
$langs->loadLangs(array("compta", "salaries", "bills", "hrm"));
+$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
+$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
+$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
+$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
+$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
+$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomlist'; // To manage different context of search
+$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
+$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
+
+// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$sortfield = GETPOST('sortfield', 'aZ09comma');
+$sortorder = GETPOST('sortorder', 'aZ09comma');
+$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
+if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+if (!$sortfield) $sortfield = "s.datep,s.rowid";
+if (!$sortorder) $sortorder = "DESC,DESC";
+
+// Initialize technical objects
+$object = new PaymentSalary($db);
+$extrafields = new ExtraFields($db);
+$diroutputmassaction = $conf->user->dir_output.'/temp/massgeneration/'.$user->id;
+$hookmanager->initHooks(array('salarieslist')); // Note that conf->hooks_modules contains array
+
+// Fetch optionals attributes and labels
+$extrafields->fetch_name_optionals_label($object->table_element);
+
+$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
+
+if (!$sortfield) $sortfield = "s.datep,s.rowid";
+if (!$sortorder) $sortorder = "DESC,DESC";
+
$search_ref = GETPOST('search_ref', 'int');
$search_user = GETPOST('search_user', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
@@ -40,30 +75,19 @@ $search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int')
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'int');
-$sortfield = GETPOST("sortfield", 'alpha');
-$sortorder = GETPOST("sortorder", 'alpha');
-$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
-if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $limit * $page;
-$pageprev = $page - 1;
-$pagenext = $page + 1;
-if (!$sortfield) $sortfield = "s.datep,s.rowid";
-if (!$sortorder) $sortorder = "DESC,DESC";
-$optioncss = GETPOST('optioncss', 'alpha');
-
$filtre = GETPOST("filtre", 'restricthtml');
-if (!GETPOST('typeid', 'int'))
+if (!GETPOST('search_type_id', 'int'))
{
$newfiltre = str_replace('filtre=', '', $filtre);
$filterarray = explode('-', $newfiltre);
foreach ($filterarray as $val)
{
$part = explode(':', $val);
- if ($part[0] == 's.fk_typepayment') $typeid = $part[1];
+ if ($part[0] == 's.fk_typepayment') $search_type_id = $part[1];
}
} else {
- $typeid = GETPOST('typeid', 'int');
+ $search_type_id = GETPOST('search_type_id', 'int');
}
$childids = $user->getAllChildIds(1);
@@ -73,36 +97,92 @@ $socid = GETPOST("socid", "int");
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'salaries', '', '', '');
+// Initialize array of search criterias
+$search_all = GETPOST("search_all", 'alpha');
+$search = array();
+foreach ($object->fields as $key => $val)
+{
+ if (GETPOST('search_'.$key, 'alpha') !== '') $search[$key] = GETPOST('search_'.$key, 'alpha');
+}
+
+// List of fields to search into when doing a "search in all"
+$fieldstosearchall = array();
+foreach ($object->fields as $key => $val)
+{
+ if ($val['searchall']) $fieldstosearchall['t.'.$key] = $val['label'];
+}
+
+$permissiontoread = $user->rights->salaries->read;
+$permissiontoadd = $user->rights->salaries->write;
+$permissiontodelete = $user->rights->salaries->delete;
/*
* Actions
*/
-if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
-{
- $search_ref = "";
- $search_user = "";
- $search_label = "";
- $search_date_start = '';
- $search_date_end = '';
- $search_amount = "";
- $search_account = '';
- $typeid = "";
-}
+if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
+if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
+$parameters = array();
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+
+if (empty($reshook))
+{
+ // Selection of new fields
+ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
+
+ // Purge search criteria
+ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
+ {
+ $search_ref = "";
+ $search_user = "";
+ $search_label = "";
+ $search_date_start = '';
+ $search_date_end = '';
+ $search_amount = "";
+ $search_account = '';
+ $search_type_id = "";
+ }
+ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
+ || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha'))
+ {
+ $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
+ }
+
+ // Mass actions
+ $objectclass = 'PaymentSalary';
+ $objectlabel = 'SalariesPayments';
+ $permissiontoread = $user->rights->salaries->read;
+ $permissiontodelete = $user->rights->salaries->delete;
+ $uploaddir = $conf->bom->dir_output;
+ include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
+
+ // Validate records
+ if (!$error && $massaction == 'buildsepa' && $permissiontoadd)
+ {
+ $objecttmp = new $objectclass($db);
+
+ // TODO
+ }
+}
/*
* View
*/
-llxHeader('', $langs->trans("Salaries"));
-
$form = new Form($db);
$salstatic = new PaymentSalary($db);
$userstatic = new User($db);
$accountstatic = new Account($db);
+$now = dol_now();
+
+//$help_url="EN:Module_BillOfMaterials|FR:Module_BillOfMaterials_FR|ES:Módulo_BillOfMaterials";
+$help_url = '';
+$title = $langs->trans('SalariesPayments');
+
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,";
$sql .= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel,";
@@ -113,210 +193,319 @@ $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;
}
-if ($typeid) {
- $sql .= " AND s.fk_typepayment=".$typeid;
+if ($search_type_id) {
+ $sql .= " AND s.fk_typepayment=".$search_type_id;
}
$sql .= $db->order($sortfield, $sortorder);
-//$sql.= " GROUP BY u.rowid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev, s.fk_typepayment, s.num_payment, pst.code";
-$totalnboflines = 0;
-$result = $db->query($sql);
-if ($result)
+// Count total nb of records
+$nbtotalofrecords = '';
+if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
- $totalnboflines = $db->num_rows($result);
+ $resql = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($resql);
+ if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
-$sql .= $db->plimit($limit + 1, $offset);
-
-
-$result = $db->query($sql);
-if ($result)
+// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
+if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit)))
{
- $num = $db->num_rows($result);
- $i = 0;
- $total = 0;
+ $num = $nbtotalofrecords;
+} else {
+ if ($limit) $sql .= $db->plimit($limit + 1, $offset);
- $param = '';
- if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
- if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
- if ($typeid) $param .= '&typeid='.$typeid;
- if ($optioncss != '') $param .= '&optioncss='.$optioncss;
+ $resql = $db->query($sql);
+ if (!$resql)
+ {
+ dol_print_error($db);
+ exit;
+ }
- $url = DOL_URL_ROOT.'/salaries/card.php?action=create';
- if (!empty($socid)) $url .= '&socid='.$socid;
- $newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write);
+ $num = $db->num_rows($resql);
+}
- print '
'."\n";
+
+
+
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 38c6479d0f2..73c41aeb782 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -3241,7 +3241,7 @@ class Societe extends CommonObject
// si son index (position dans la chaîne en commence à 0 au premier caractère) est impair
// on double sa valeur et si cette dernière est supérieure à 9, on lui retranche 9
// on ajoute cette valeur à la somme totale
-
+ $sum = 0;
for ($index = 0; $index < 9; $index++)
{
$number = (int) $chaine[$index];
@@ -3266,7 +3266,7 @@ class Societe extends CommonObject
// si son index (position dans la chaîne en commence à 0 au premier caractère) est pair
// on double sa valeur et si cette dernière est supérieure à 9, on lui retranche 9
// on ajoute cette valeur à la somme totale
-
+ $sum = 0;
for ($index = 0; $index < 14; $index++)
{
$number = (int) $chaine[$index];
@@ -3343,10 +3343,6 @@ class Societe extends CommonObject
$string = trim($this->idprof1);
$string = preg_replace('/(\s)/', '', $string);
- for ($i = 0; $i < 9; $i++) {
- $num[$i] = substr($string, $i, 1);
- }
-
//Check NIF
if (preg_match('/(^[0-9]{9}$)/', $string)) {
return 1;
diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php
index b14e5b718ba..be68e1f68ee 100644
--- a/htdocs/ticket/agenda.php
+++ b/htdocs/ticket/agenda.php
@@ -41,8 +41,8 @@ $socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
-$sortfield = GETPOST("sortfield", "alpha");
-$sortorder = GETPOST("sortorder", 'alpha');
+$sortfield = GETPOST("sortfield", "aZ09comma");
+$sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;
diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php
index af6f78fe98c..49f15412965 100644
--- a/htdocs/ticket/messaging.php
+++ b/htdocs/ticket/messaging.php
@@ -41,8 +41,8 @@ $socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
-$sortfield = GETPOST("sortfield", "alpha");
-$sortorder = GETPOST("sortorder", 'alpha');
+$sortfield = GETPOST("sortfield", "aZ09comma");
+$sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 7a40af26ac0..3288571d2a7 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -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),
);
diff --git a/htdocs/user/list.php b/htdocs/user/list.php
index 126bfd0bac1..ef2ad8c1ed6 100644
--- a/htdocs/user/list.php
+++ b/htdocs/user/list.php
@@ -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 '';
}
+// Supervisor
+if (!empty($arrayfields['u.fk_user']['checked']))
+{
+ print '
';
+ print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, array(), 0, '', 0, 0, 0, 0, '', 0, '', 'maxwidth200');
+ print ' ';
+}
if (!empty($arrayfields['u.accountancy_code']['checked']))
{
print '
';
@@ -561,12 +558,9 @@ if (!empty($arrayfields['u.entity']['checked']))
{
print '
';
}
-// Supervisor
-if (!empty($arrayfields['u.fk_user']['checked']))
+if (!empty($arrayfields['u.salary']['checked']))
{
- print '
';
- print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, array(), 0, '', 0, 0, 0, 0, '', 0, '', 'maxwidth200');
- print ' ';
+ print '
';
}
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 '
'.yn($obj->employee).' ';
if (!$i) $totalarray['nbfield']++;
}
+
+ // Supervisor
+ if (!empty($arrayfields['u.fk_user']['checked']))
+ {
+ // Resp
+ print '
';
+ 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 ' ';
+ if (!$i) $totalarray['nbfield']++;
+ }
+
if (!empty($arrayfields['u.accountancy_code']['checked']))
{
print '
'.$obj->accountancy_code.' ';
@@ -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 '
';
- 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 ' ';
- if (!$i) $totalarray['nbfield']++;
+ print '
'.($obj->salary ? price($obj->salary) : '').' ';
+ if (!$i) $totalarray['nbfield']++;
}
// Date last login
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index f2734483acb..3a8e8bda794 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -3009,7 +3009,7 @@ if ($action == 'editcss')
print dol_get_fiche_head();
- print ''."\n";
+ print ''."\n";
print '
';
// Website
@@ -3039,8 +3039,8 @@ if ($action == 'editcss')
// Other languages
print '';
- $htmltext = '';
- print $form->textwithpicto($langs->trans('OtherLanguages'), $htmltext, 1, 'help', '', 0, 2, 'WEBSITE_OTHERLANG');
+ $htmltext = $langs->trans("Example").': fr,de,sv,it,pt';
+ print $form->textwithpicto($langs->trans('OtherLanguages'), $htmltext, 1, 'help', '', 0, 2);
print ' ';
print ' ';
print ' ';
@@ -3049,10 +3049,11 @@ if ($action == 'editcss')
// VirtualHost
print '';
- $htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/'.$websitekey.' ');
+ $htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/{s1}'.$websitekey.'{s2}');
+ $htmltext = str_replace(array('{s1}', '{s2}'), array('', ' '), $htmltext);
$htmltext .= ' ';
- $htmltext .= ' '.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
- $htmltext .= ' '.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website '.DOL_DATA_ROOT.'/medias');
+ $htmltext .= ' '.$langs->transnoentitiesnoconv("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
+ $htmltext .= ' '.$langs->transnoentitiesnoconv("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website '.DOL_DATA_ROOT.'/medias');
print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'virtualhosttooltip');
print ' ';
diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php
index 8e6d3fa725f..5d5a9c84eda 100644
--- a/htdocs/zapier/class/hook.class.php
+++ b/htdocs/zapier/class/hook.class.php
@@ -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