Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
5191a419d3
@ -7312,7 +7312,7 @@ abstract class CommonObject
|
|||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('showOptionals', $parameters, $this, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('showOptionals', $parameters, $this, $action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) {
|
if (key_exists('label', $extrafields->attributes[$this->table_element]) && is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) {
|
||||||
$out .= "\n";
|
$out .= "\n";
|
||||||
$out .= '<!-- showOptionals --> ';
|
$out .= '<!-- showOptionals --> ';
|
||||||
$out .= "\n";
|
$out .= "\n";
|
||||||
|
|||||||
@ -47,7 +47,7 @@ if (empty($reshook)) {
|
|||||||
if (isset($tpl_context)) {
|
if (isset($tpl_context)) {
|
||||||
$params['tpl_context'] = $tpl_context;
|
$params['tpl_context'] = $tpl_context;
|
||||||
}
|
}
|
||||||
$params['cols'] = $parameters['colspanvalue'];
|
$params['cols'] = key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : '';
|
||||||
print $object->showOptionals($extrafields, 'create', $params);
|
print $object->showOptionals($extrafields, 'create', $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ if (empty($extrafieldsobjectkey) && is_object($object)) {
|
|||||||
|
|
||||||
// Loop to show all columns of extrafields from $obj, $extrafields and $db
|
// Loop to show all columns of extrafields from $obj, $extrafields and $db
|
||||||
if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
|
if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
|
||||||
if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) {
|
if (key_exists('label', $extrafields->attributes[$extrafieldsobjectkey]) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) {
|
||||||
if (empty($extrafieldsobjectprefix)) {
|
if (empty($extrafieldsobjectprefix)) {
|
||||||
$extrafieldsobjectprefix = 'ef.';
|
$extrafieldsobjectprefix = 'ef.';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1955,7 +1955,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$this->line->remise_percent = $remise_percent;
|
$this->line->remise_percent = $remise_percent;
|
||||||
$this->line->date_start = $date_start;
|
$this->line->date_start = $date_start;
|
||||||
$this->line->date_end = $date_end;
|
$this->line->date_end = $date_end;
|
||||||
$this->line->ventil = $ventil;
|
$this->line->fk_code_ventilation = $ventil;
|
||||||
$this->line->rang = $rang;
|
$this->line->rang = $rang;
|
||||||
$this->line->info_bits = $info_bits;
|
$this->line->info_bits = $info_bits;
|
||||||
$this->line->fk_remise_except = $fk_remise_except;
|
$this->line->fk_remise_except = $fk_remise_except;
|
||||||
|
|||||||
@ -48,13 +48,13 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
|||||||
if (!empty($conf->adherent->enabled)) {
|
if (!empty($conf->adherent->enabled)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
}
|
}
|
||||||
if (! empty($conf->accounting->enabled)) {
|
if (!empty($conf->accounting->enabled)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
}
|
}
|
||||||
if (! empty($conf->accounting->enabled)) {
|
if (!empty($conf->accounting->enabled)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
}
|
}
|
||||||
if (! empty($conf->accounting->enabled)) {
|
if (!empty($conf->accounting->enabled)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -610,7 +610,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logo/Photo save
|
// Logo/Photo save
|
||||||
$dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/";
|
$dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/";
|
||||||
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
||||||
if ($file_OK) {
|
if ($file_OK) {
|
||||||
if (image_format_supported($_FILES['photo']['name'])) {
|
if (image_format_supported($_FILES['photo']['name'])) {
|
||||||
@ -892,7 +892,7 @@ $form = new Form($db);
|
|||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
$formadmin = new FormAdmin($db);
|
$formadmin = new FormAdmin($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
if (! empty($conf->accounting->enabled)) {
|
if (!empty($conf->accounting->enabled)) {
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1110,7 +1110,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Accountancy code
|
// Accountancy code
|
||||||
if ($conf->accounting->enabled) {
|
if (!empty($conf->accounting->enabled)) {
|
||||||
print '<tr><td>'.$langs->trans("AccountancyCode").'</td>';
|
print '<tr><td>'.$langs->trans("AccountancyCode").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" name="accountancy_code" value="'.dol_escape_htmltag(GETPOST('accountancy_code', 'alphanohtml')).'">';
|
print '<input type="text" name="accountancy_code" value="'.dol_escape_htmltag(GETPOST('accountancy_code', 'alphanohtml')).'">';
|
||||||
@ -1163,7 +1163,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|||||||
print $langs->trans("Note");
|
print $langs->trans("Note");
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor = new DolEditor('note', GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : '', '', 120, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%');
|
$doleditor = new DolEditor('note', GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : '', '', 120, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ $pagenext = $page + 1;
|
|||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$object = new User($db);
|
$object = new User($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
|
$diroutputmassaction = $conf->user->dir_output.'/temp/massgeneration/'.$user->id;
|
||||||
$hookmanager->initHooks(array('userlist'));
|
$hookmanager->initHooks(array('userlist'));
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
@ -124,9 +124,9 @@ $arrayfields = array(
|
|||||||
'u.office_phone'=>array('label'=>"PhonePro", 'checked'=>1, 'position'=>31),
|
'u.office_phone'=>array('label'=>"PhonePro", 'checked'=>1, 'position'=>31),
|
||||||
'u.user_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1, 'position'=>32),
|
'u.user_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1, 'position'=>32),
|
||||||
'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35),
|
'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.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>(!empty($conf->api->enabled) && $user->admin)),
|
||||||
'u.fk_soc'=>array('label'=>"Company", 'checked'=>($contextpage == 'employeelist' ? 0 : 1), 'position'=>45),
|
'u.fk_soc'=>array('label'=>"Company", 'checked'=>($contextpage == 'employeelist' ? 0 : 1), 'position'=>45),
|
||||||
'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>($conf->salaries->enabled && !empty($user->rights->salaries->readall))),
|
'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>(!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall))),
|
||||||
'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100),
|
'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100),
|
||||||
'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110),
|
'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110),
|
||||||
'u.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
'u.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||||
@ -345,7 +345,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N
|
|||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (key_exists('label', $extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (u.rowid = ef.fk_object)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (u.rowid = ef.fk_object)";
|
||||||
}
|
}
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid";
|
||||||
@ -571,13 +571,13 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
|||||||
|
|
||||||
$url = DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu=';
|
$url = DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu=';
|
||||||
if (!empty($socid)) {
|
if (!empty($socid)) {
|
||||||
$url .= '&socid='.$socid;
|
$url .= '&socid='.urlencode($socid);
|
||||||
}
|
}
|
||||||
|
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
|
$newcardbutton = dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
|
||||||
|
|
||||||
$moreparam = array('morecss'=>'btnTitleSelected');
|
$moreparam = array('morecss'=>'btnTitleSelected');
|
||||||
$morehtmlright .= dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam);
|
$morehtmlright = dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam);
|
||||||
$moreparam = array('morecss'=>'marginleftonly');
|
$moreparam = array('morecss'=>'marginleftonly');
|
||||||
$morehtmlright .= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam);
|
$morehtmlright .= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam);
|
||||||
|
|
||||||
@ -808,7 +808,7 @@ print '</tr>'."\n";
|
|||||||
|
|
||||||
// Detect if we need a fetch on each output line
|
// Detect if we need a fetch on each output line
|
||||||
$needToFetchEachLine = 0;
|
$needToFetchEachLine = 0;
|
||||||
if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
if (key_exists('computed', $extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
|
||||||
if (preg_match('/\$object/', $val)) {
|
if (preg_match('/\$object/', $val)) {
|
||||||
$needToFetchEachLine++; // There is at least one compute field that use $object
|
$needToFetchEachLine++; // There is at least one compute field that use $object
|
||||||
@ -821,6 +821,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co
|
|||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
while ($i < ($limit ? min($num, $limit) : $num)) {
|
while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
@ -828,12 +829,14 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
break; // Should not happen
|
break; // Should not happen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($obj->country_code)) $obj->country_code = ''; // TODO Add join in select with country table to get country_code
|
||||||
|
|
||||||
// Store properties in $object
|
// Store properties in $object
|
||||||
$object->setVarsFromFetchObj($obj);
|
$object->setVarsFromFetchObj($obj);
|
||||||
|
|
||||||
$userstatic->id = $obj->rowid;
|
$userstatic->id = $obj->rowid;
|
||||||
$userstatic->admin = $obj->admin;
|
$userstatic->admin = $obj->admin;
|
||||||
$userstatic->ref = $obj->label;
|
$userstatic->ref = $obj->rowid;
|
||||||
$userstatic->login = $obj->login;
|
$userstatic->login = $obj->login;
|
||||||
$userstatic->statut = $obj->statut;
|
$userstatic->statut = $obj->statut;
|
||||||
$userstatic->office_phone = $obj->office_phone;
|
$userstatic->office_phone = $obj->office_phone;
|
||||||
@ -928,6 +931,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayfields['u.office_phone']['checked'])) {
|
if (!empty($arrayfields['u.office_phone']['checked'])) {
|
||||||
print "<td>".dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."</td>\n";
|
print "<td>".dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
@ -941,7 +945,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['u.email']['checked'])) {
|
if (!empty($arrayfields['u.email']['checked'])) {
|
||||||
print '<td class="tdoverflowmax150">'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 0, 0, 1)."</td>\n";
|
print '<td class="tdoverflowmax150">'.dol_print_email($obj->email, $obj->rowid, $obj->fk_soc, 'AC_EMAIL', 0, 0, 1)."</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user