Merge branch 'develop' of github.com:Dolibarr/dolibarr into dev_fix_sale_top_menu_supplieronly

This commit is contained in:
Florian HENRY 2021-05-17 09:22:51 +02:00
commit 6ffbc2744e
65 changed files with 396 additions and 318 deletions

View File

@ -10,6 +10,11 @@ To run phpcs:
> cd dolibarrgitrepo > cd dolibarrgitrepo
> phpcs --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 . > phpcs --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 .
To fix with phpcbf:
> cd dolibarrgitrepo
> phpcbf --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 .
Note with Eclipse: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with: Note with Eclipse: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with:
* tab value to 4 * tab value to 4
* path of code sniffer standard to dev/codesniffer * path of code sniffer standard to dev/codesniffer

View File

@ -366,7 +366,7 @@ class AdherentType extends CommonObject
$sql .= "libelle = '".$this->db->escape($this->label)."',"; $sql .= "libelle = '".$this->db->escape($this->label)."',";
$sql .= "morphy = '".$this->db->escape($this->morphy)."',"; $sql .= "morphy = '".$this->db->escape($this->morphy)."',";
$sql .= "subscription = '".$this->db->escape($this->subscription)."',"; $sql .= "subscription = '".$this->db->escape($this->subscription)."',";
$sql .= "amount = '".$this->db->escape($this->amount)."',"; $sql .= "amount = ".((empty($this->amount) && $this->amount == '') ? 'null' : ((float) $this->amount)).",";
$sql .= "duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."',"; $sql .= "duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."',";
$sql .= "note = '".$this->db->escape($this->note)."',"; $sql .= "note = '".$this->db->escape($this->note)."',";
$sql .= "vote = ".(integer) $this->db->escape($this->vote).","; $sql .= "vote = ".(integer) $this->db->escape($this->vote).",";

View File

@ -198,8 +198,8 @@ foreach ($data as $val) {
//print '</a>'; //print '</a>';
print '</td>'; print '</td>';
print '<td class="right">'.$val['nb'].'</td>'; print '<td class="right">'.$val['nb'].'</td>';
print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>'; print '<td class="right"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>'; print '<td class="right"><span class="amount">'.price(price2num($val['avg'], 'MT'), 1).'</span></td>';
print '</tr>'; print '</tr>';
$oldyear = $year; $oldyear = $year;
} }

View File

@ -71,7 +71,7 @@ $label = GETPOST("label", "alpha");
$morphy = GETPOST("morphy", "alpha"); $morphy = GETPOST("morphy", "alpha");
$status = GETPOST("status", "int"); $status = GETPOST("status", "int");
$subscription = GETPOST("subscription", "int"); $subscription = GETPOST("subscription", "int");
$amount = price2num(GETPOST('amount', 'alpha'), 'MT'); $amount = GETPOST('amount', 'alpha');
$duration_value = GETPOST('duration_value', 'int'); $duration_value = GETPOST('duration_value', 'int');
$duration_unit = GETPOST('duration_unit', 'alpha'); $duration_unit = GETPOST('duration_unit', 'alpha');
$vote = GETPOST("vote", "int"); $vote = GETPOST("vote", "int");
@ -119,7 +119,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
$object->morphy = trim($morphy); $object->morphy = trim($morphy);
$object->status = (int) $status; $object->status = (int) $status;
$object->subscription = (int) $subscription; $object->subscription = (int) $subscription;
$object->amount = $amount; $object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
$object->duration_value = $duration_value; $object->duration_value = $duration_value;
$object->duration_unit = $duration_unit; $object->duration_unit = $duration_unit;
$object->note = trim($comment); $object->note = trim($comment);
@ -166,12 +166,11 @@ if ($action == 'update' && $user->rights->adherent->configurer) {
$object->fetch($rowid); $object->fetch($rowid);
$object->oldcopy = clone $object; $object->oldcopy = clone $object;
$object->label= trim($label); $object->label= trim($label);
$object->morphy = trim($morphy); $object->morphy = trim($morphy);
$object->status = (int) $status; $object->status = (int) $status;
$object->subscription = (int) $subscription; $object->subscription = (int) $subscription;
$object->amount = $amount; $object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));;
$object->duration_value = $duration_value; $object->duration_value = $duration_value;
$object->duration_unit = $duration_unit; $object->duration_unit = $duration_unit;
$object->note = trim($comment); $object->note = trim($comment);
@ -306,7 +305,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
} }
print '</td>'; print '</td>';
print '<td class="center">'.yn($objp->subscription).'</td>'; print '<td class="center">'.yn($objp->subscription).'</td>';
print '<td class="center">'.price($objp->amount).'</td>'; print '<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).'</span></td>';
print '<td class="center">'.yn($objp->vote).'</td>'; print '<td class="center">'.yn($objp->vote).'</td>';
print '<td class="center">'.$membertype->getLibStatut(5).'</td>'; print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
if ($user->rights->adherent->configurer) { if ($user->rights->adherent->configurer) {
@ -446,7 +445,7 @@ if ($rowid > 0) {
print '</tr>'; print '</tr>';
print '<tr><td class="titlefield">'.$langs->trans("Amount").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("Amount").'</td><td>';
print price($object->amount); print ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
print '</tr>'; print '</tr>';
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>'; print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
@ -594,24 +593,24 @@ if ($rowid > 0) {
$titre .= " (".$membertype->label.")"; $titre .= " (".$membertype->label.")";
} }
$param = "&rowid=".$object->id; $param = "&rowid=".urlencode($object->id);
if (!empty($status)) { if (!empty($status)) {
$param .= "&status=".$status; $param .= "&status=".urlencode($status);
} }
if (!empty($search_lastname)) { if (!empty($search_lastname)) {
$param .= "&search_lastname=".$search_lastname; $param .= "&search_lastname=".urlencode($search_lastname);
} }
if (!empty($search_firstname)) { if (!empty($search_firstname)) {
$param .= "&search_firstname=".$search_firstname; $param .= "&search_firstname=".urlencode($search_firstname);
} }
if (!empty($search_login)) { if (!empty($search_login)) {
$param .= "&search_login=".$search_login; $param .= "&search_login=".urlencode($search_login);
} }
if (!empty($search_email)) { if (!empty($search_email)) {
$param .= "&search_email=".$search_email; $param .= "&search_email=".urlencode($search_email);
} }
if (!empty($filter)) { if (!empty($filter)) {
$param .= "&filter=".$filter; $param .= "&filter=".urlencode($filter);
} }
if ($sall) { if ($sall) {
@ -797,7 +796,9 @@ if ($rowid > 0) {
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td>'; print '<tr><td>'.$langs->trans("Amount").'</td><td>';
print '<input name="amount" size="5" value="'.price($object->amount).'">'; print '<input name="amount" size="5" value="';
print ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
print '">';
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>'; print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';

View File

@ -66,7 +66,7 @@ if ($action == 'updateform') {
} elseif ($action == 'delete') { } elseif ($action == 'delete') {
// Delete file // Delete file
$langs->load("other"); $langs->load("other");
$file = $conf->admin->dir_temp.'/'.GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $file = $conf->admin->dir_temp.'/'.GETPOST('urlfile', 'alpha');
$ret = dol_delete_file($file); $ret = dol_delete_file($file);
if ($ret) { if ($ret) {
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs'); setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs');

View File

@ -40,6 +40,8 @@ if (GETPOST('action', 'aZ09') == 'donothing') {
exit; exit;
} }
$execmethod = empty($conf->global->MAIN_EXEC_USE_POPEN) ? 1 : $conf->global->MAIN_EXEC_USE_POPEN;
/* /*
* View * View
@ -74,7 +76,13 @@ print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include')
print "<strong>PHP disable_functions</strong> = "; print "<strong>PHP disable_functions</strong> = ";
$arrayoffunctionsdisabled = explode(',', ini_get('disable_functions')); $arrayoffunctionsdisabled = explode(',', ini_get('disable_functions'));
$arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals'); $arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals');
$arrayoffunctionstodisable2 = explode(',', 'exec,passthru,shell_exec,system,proc_open,popen'); if ($execmethod == 1) {
$arrayoffunctionstodisable2 = explode(',', 'passthru,shell_exec,system,proc_open,popen');
$functiontokeep = 'exec';
} else {
$arrayoffunctionstodisable2 = explode(',', 'exec,passthru,shell_exec,system,proc_open');
$functiontokeep = 'popen';
}
$i = 0; $i = 0;
foreach ($arrayoffunctionsdisabled as $functionkey) { foreach ($arrayoffunctionsdisabled as $functionkey) {
if ($i > 0) { if ($i > 0) {
@ -115,6 +123,13 @@ if ($todisabletext) {
print '<br>'; print '<br>';
} }
print $langs->trans("PHPFunctionsRequiredForCLI").': ';
if (in_array($functiontokeep, $arrayoffunctionsdisabled)) {
print img_picto($langs->trans("PHPFunctionsRequiredForCLI"), 'warning');
}
print '<span class="opacitymedium">'.$functiontokeep.'</span>';
print '<br>';
print '<br>'; print '<br>';
// XDebug // XDebug
@ -245,6 +260,22 @@ print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.(empty($conf->glob
print '<br>'; print '<br>';
print '<strong>MAIN_EXEC_USE_POPEN</strong> = ';
if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span> &nbsp; ';
} else {
print $conf->global->MAIN_EXEC_USE_POPEN.' &nbsp; ';
}
if ($execmethod == 1) {
print ' --> "exec" PHP method will be used for shell commands.';
}
if ($execmethod == 2) {
print ' --> "popen" PHP method will be used for shell commands.';
}
print "<br>";
print '<br>';
print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: '; print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' '; print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' ';
print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0); print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0);

View File

@ -347,7 +347,7 @@ if (empty($reshook)) {
$duration = GETPOST('duree_validite', 'int'); $duration = GETPOST('duree_validite', 'int');
if (empty($datep)) { if (empty($datep)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePropal")), null, 'errors');
$action = 'create'; $action = 'create';
$error++; $error++;
} }
@ -1622,7 +1622,7 @@ if ($action == 'create') {
} }
// Date // Date
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans('DatePropal').'</td><td>';
print $form->selectDate('', '', '', '', '', "addprop", 1, 1); print $form->selectDate('', '', '', '', '', "addprop", 1, 1);
print '</td></tr>'; print '</td></tr>';
@ -2063,7 +2063,7 @@ if ($action == 'create') {
print '<tr>'; print '<tr>';
print '<td>'; print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Date'); print $langs->trans('DatePropal');
print '</td>'; print '</td>';
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>'; print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';

View File

@ -10,7 +10,7 @@
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2016-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com> * Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
@ -182,7 +182,7 @@ $arrayfields = array(
'state.nom'=>array('label'=>"StateShort", 'checked'=>0), 'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
'country.code_iso'=>array('label'=>"Country", 'checked'=>0), 'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers), 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
'p.date'=>array('label'=>"Date", 'checked'=>1), 'p.date'=>array('label'=>"DatePropal", 'checked'=>1),
'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1), 'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0), 'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0), 'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
@ -711,24 +711,12 @@ if ($resql) {
if ($sall) { if ($sall) {
$param .= '&sall='.urlencode($sall); $param .= '&sall='.urlencode($sall);
} }
if ($search_date_start) { if ($search_date_start) $param .= '&search_date_startday='.urlencode(dol_print_date($search_date_start, '%d')).'&search_date_startmonth='.urlencode(dol_print_date($search_date_start, '%m')).'&search_date_startyear='.urlencode(dol_print_date($search_date_start, '%Y'));
$param .= '&search_date_start='.urlencode($search_date_start); if ($search_date_end) $param .= '&search_date_endday='.urlencode(dol_print_date($search_date_end, '%d')).'&search_date_endmonth='.urlencode(dol_print_date($search_date_end, '%m')).'&search_date_endyear='.urlencode(dol_print_date($search_date_end, '%Y'));
} if ($search_dateend_start) $param .= '&search_dateend_startday='.urlencode(dol_print_date($search_dateend_start, '%d')).'&search_dateend_startmonth='.urlencode(dol_print_date($search_dateend_start, '%m')).'&search_dateend_startyear='.urlencode(dol_print_date($search_dateend_start, '%Y'));
if ($search_date_end) { if ($search_dateend_end) $param .= '&search_dateend_endday='.urlencode(dol_print_date($search_dateend_end, '%d')).'&search_dateend_endmonth='.urlencode(dol_print_date($search_dateend_end, '%m')).'&search_dateend_endyear='.urlencode(dol_print_date($search_dateend_end, '%Y'));
$param .= '&search_date_end='.urlencode($search_date_end); if ($search_datedelivery_start) $param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y'));
} if ($search_datedelivery_end) $param .= '&search_datedelivery_endday='.urlencode(dol_print_date($search_datedelivery_end, '%d')).'&search_datedelivery_endmonth='.urlencode(dol_print_date($search_datedelivery_end, '%m')).'&search_datedelivery_endyear='.urlencode(dol_print_date($search_datedelivery_end, '%Y'));
if ($search_dateend_start) {
$param .= '&search_dateend_start='.urlencode($search_dateend_start);
}
if ($search_dateend_end) {
$param .= '&search_dateend_end='.urlencode($search_dateend_end);
}
if ($search_datedelivery_start) {
$param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start);
}
if ($search_datedelivery_end) {
$param .= '&search_datedelivery_end='.urlencode($search_datedelivery_end);
}
if ($search_ref) { if ($search_ref) {
$param .= '&search_ref='.urlencode($search_ref); $param .= '&search_ref='.urlencode($search_ref);
} }
@ -787,37 +775,37 @@ if ($resql) {
$param .= '&search_categ_cus='.urlencode($search_categ_cus); $param .= '&search_categ_cus='.urlencode($search_categ_cus);
} }
if ($search_product_category != '') { if ($search_product_category != '') {
$param .= '&search_product_category='.$search_product_category; $param .= '&search_product_category='.urlencode($search_product_category);
} }
if ($search_fk_cond_reglement > 0) { if ($search_fk_cond_reglement > 0) {
$param .= '&search_fk_cond_reglement='.$search_fk_cond_reglement; $param .= '&search_fk_cond_reglement='.urlencode($search_fk_cond_reglement);
} }
if ($search_fk_shipping_method > 0) { if ($search_fk_shipping_method > 0) {
$param .= '&search_fk_shipping_method='.$search_fk_shipping_method; $param .= '&search_fk_shipping_method='.urlencode($search_fk_shipping_method);
} }
if ($search_fk_input_reason > 0) { if ($search_fk_input_reason > 0) {
$param .= '&search_fk_input_reason='.$search_fk_input_reason; $param .= '&search_fk_input_reason='.urlencode($search_fk_input_reason);
} }
if ($search_fk_mode_reglement > 0) { if ($search_fk_mode_reglement > 0) {
$param .= '&search_fk_mode_reglement='.$search_fk_mode_reglement; $param .= '&search_fk_mode_reglement='.urlencode($search_fk_mode_reglement);
} }
if ($search_type_thirdparty > 0) { if ($search_type_thirdparty > 0) {
$param .= '&search_type_thirdparty='.$search_type_thirdparty; $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
} }
if ($search_town) { if ($search_town) {
$param .= '&search_town='.$search_town; $param .= '&search_town='.urlencode($search_town);
} }
if ($search_zip) { if ($search_zip) {
$param .= '&search_zip='.$search_zip; $param .= '&search_zip='.urlencode($search_zip);
} }
if ($search_state) { if ($search_state) {
$param .= '&search_state='.$search_state; $param .= '&search_state='.urlencode($search_state);
} }
if ($search_town) { if ($search_town) {
$param .= '&search_town='.$search_town; $param .= '&search_town='.urlencode($search_town);
} }
if ($search_country) { if ($search_country) {
$param .= '&search_country='.$search_country; $param .= '&search_country='.urlencode($search_country);
} }
// Add $param from extra fields // Add $param from extra fields
@ -825,23 +813,22 @@ if ($resql) {
// List of mass actions available // List of mass actions available
$arrayofmassactions = array( $arrayofmassactions = array(
'generate_doc'=>img_picto('', 'pdf').'&ensp;'.$langs->trans("ReGeneratePDF"), 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
'builddoc'=>img_picto('', 'pdf').'&ensp;'.$langs->trans("PDFMerge"), 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
); );
if ($permissiontosendbymail) { if ($permissiontosendbymail) {
$arrayofmassactions['presend']=img_picto('', 'email').'&ensp;'.$langs->trans("SendByMail"); $arrayofmassactions['presend']=img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail");
} }
if ($permissiontovalidate) { if ($permissiontovalidate) {
$arrayofmassactions['prevalidate']=img_picto('', 'check').'&ensp;'.$langs->trans("Validate"); $arrayofmassactions['prevalidate']=img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate");
} }
if ($permissiontoclose) { if ($permissiontoclose) {
$arrayofmassactions['presign']=img_picto('', 'propal').'&ensp;'.$langs->trans("Sign"); $arrayofmassactions['presign']=img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans("Sign");
$arrayofmassactions['nopresign']=img_picto('', 'propal').'&ensp;'.$langs->trans("NoSign"); $arrayofmassactions['nopresign']=img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans("NoSign");
$arrayofmassactions['setbilled'] =img_picto('', 'bill').'&ensp;'.$langs->trans("ClassifyBilled"); $arrayofmassactions['setbilled'] =img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("ClassifyBilled");
} }
if ($permissiontodelete) { if ($permissiontodelete) {
$arrayofmassactions['predelete'] = img_picto('', 'delete').'&ensp;'.$langs->trans("Delete"); $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
} }
if (in_array($massaction, array('presend', 'predelete', 'closed'))) { if (in_array($massaction, array('presend', 'predelete', 'closed'))) {

View File

@ -9,7 +9,7 @@
* Copyright (C) 2015-2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2015-2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2016-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com> * Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.fr> * Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.fr>
* *
@ -706,10 +706,10 @@ if ($resql) {
$param .= '&search_status='.urlencode($search_status); $param .= '&search_status='.urlencode($search_status);
} }
if ($search_datecloture_start) { if ($search_datecloture_start) {
$param .= '&search_datecloture_start='.urlencode($search_datecloture_start); $param .= '&search_datecloture_startday='.dol_print_date($search_datecloture_start, '%d').'&search_datecloture_startmonth='.dol_print_date($search_datecloture_start, '%m').'&search_datecloture_startyear='.dol_print_date($search_datecloture_start, '%Y');
} }
if ($search_datecloture_end) { if ($search_datecloture_end) {
$param .= '&search_datecloture_end='.urlencode($search_datecloture_end); $param .= '&search_datecloture_endday='.dol_print_date($search_datecloture_end, '%d').'&search_datecloture_endmonth='.dol_print_date($search_datecloture_end, '%m').'&search_datecloture_endyear='.dol_print_date($search_datecloture_end, '%Y');
} }
if ($search_dateorder_start) { if ($search_dateorder_start) {
$param .= '&search_dateorder_start_day='.dol_print_date($search_dateorder_start, '%d').'&search_dateorder_start_month='.dol_print_date($search_dateorder_start, '%m').'&search_dateorder_start_year='.dol_print_date($search_dateorder_start, '%Y'); $param .= '&search_dateorder_start_day='.dol_print_date($search_dateorder_start, '%d').'&search_dateorder_start_month='.dol_print_date($search_dateorder_start, '%m').'&search_dateorder_start_year='.dol_print_date($search_dateorder_start, '%Y');
@ -805,16 +805,16 @@ if ($resql) {
$param .= '&search_billed='.urlencode($search_billed); $param .= '&search_billed='.urlencode($search_billed);
} }
if ($search_fk_cond_reglement > 0) { if ($search_fk_cond_reglement > 0) {
$param .= '&search_fk_cond_reglement='.$search_fk_cond_reglement; $param .= '&search_fk_cond_reglement='.urlencode($search_fk_cond_reglement);
} }
if ($search_fk_shipping_method > 0) { if ($search_fk_shipping_method > 0) {
$param .= '&search_fk_shipping_method='.$search_fk_shipping_method; $param .= '&search_fk_shipping_method='.urlencode($search_fk_shipping_method);
} }
if ($search_fk_mode_reglement > 0) { if ($search_fk_mode_reglement > 0) {
$param .= '&search_fk_mode_reglement='.$search_fk_mode_reglement; $param .= '&search_fk_mode_reglement='.urlencode($search_fk_mode_reglement);
} }
if ($search_fk_input_reason > 0) { if ($search_fk_input_reason > 0) {
$param .= '&search_fk_input_reason='.$search_fk_input_reason; $param .= '&search_fk_input_reason='.urlencode($search_fk_input_reason);
} }
// Add $param from extra fields // Add $param from extra fields
@ -887,7 +887,6 @@ if ($resql) {
} }
if ($massaction == 'createbills') { if ($massaction == 'createbills') {
//var_dump($_REQUEST);
print '<input type="hidden" name="massaction" value="confirm_createbills">'; print '<input type="hidden" name="massaction" value="confirm_createbills">';
print '<table class="noborder" width="100%" >'; print '<table class="noborder" width="100%" >';

View File

@ -829,7 +829,7 @@ if ($action == 'create') {
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post" name="formsoc">'; print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post" name="formsoc">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$_REQUEST["id"].'">'."\n\n"; print '<input type="hidden" name="id" value="'.GETPOST("id", 'int').'">'."\n\n";
print dol_get_fiche_head(array(), 0, '', 0); print dol_get_fiche_head(array(), 0, '', 0);

View File

@ -338,14 +338,13 @@ if ($result) {
if ($search_accountancy_subledger > 0) { if ($search_accountancy_subledger > 0) {
$param .= '&search_accountancy_subledger='.urlencode($search_accountancy_subledger); $param .= '&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
} }
if ($optioncss != '') { if ($optioncss != '') {
$param .= '&amp;optioncss='.urlencode($optioncss); $param .= '&optioncss='.urlencode($optioncss);
} }
$url = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create'; $url = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create';
if (!empty($socid)) { if (!empty($socid)) {
$url .= '&socid='.$socid; $url .= '&socid='.urlencode($socid);
} }
$newcardbutton = dolGetButtonTitle($langs->trans('MenuNewVariousPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->banque->modifier); $newcardbutton = dolGetButtonTitle($langs->trans('MenuNewVariousPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->banque->modifier);
@ -423,7 +422,7 @@ if ($result) {
// Payment type // Payment type
if ($arrayfields['type']['checked']) { if ($arrayfields['type']['checked']) {
print '<td class="liste_titre left">'; print '<td class="liste_titre center">';
$form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16, 1, 'maxwidth100'); $form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16, 1, 'maxwidth100');
print '</td>'; print '</td>';
} }
@ -498,7 +497,7 @@ if ($result) {
print_liste_field_titre($arrayfields['ref']['label'], $_SERVER["PHP_SELF"], 'v.rowid', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($arrayfields['ref']['label'], $_SERVER["PHP_SELF"], 'v.rowid', '', $param, '', $sortfield, $sortorder);
} }
if ($arrayfields['label']['checked']) { if ($arrayfields['label']['checked']) {
print_liste_field_titre($arrayfields['label']['label'], $_SERVER["PHP_SELF"], 'v.label', '', $param, '', $sortfield, $sortorder, 'left '); print_liste_field_titre($arrayfields['label']['label'], $_SERVER["PHP_SELF"], 'v.label', '', $param, '', $sortfield, $sortorder);
} }
if ($arrayfields['datep']['checked']) { if ($arrayfields['datep']['checked']) {
print_liste_field_titre($arrayfields['datep']['label'], $_SERVER["PHP_SELF"], 'v.datep,v.rowid', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre($arrayfields['datep']['label'], $_SERVER["PHP_SELF"], 'v.datep,v.rowid', '', $param, '', $sortfield, $sortorder, 'center ');
@ -507,7 +506,7 @@ if ($result) {
print_liste_field_titre($arrayfields['datev']['label'], $_SERVER["PHP_SELF"], 'v.datev,v.rowid', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre($arrayfields['datev']['label'], $_SERVER["PHP_SELF"], 'v.datev,v.rowid', '', $param, '', $sortfield, $sortorder, 'center ');
} }
if ($arrayfields['type']['checked']) { if ($arrayfields['type']['checked']) {
print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], 'type', '', $param, '', $sortfield, $sortorder, 'left '); print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], 'type', '', $param, '', $sortfield, $sortorder, 'center ');
} }
if ($arrayfields['project']['checked']) { if ($arrayfields['project']['checked']) {
print_liste_field_titre($arrayfields['project']['label'], $_SERVER["PHP_SELF"], 'fk_project', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($arrayfields['project']['label'], $_SERVER["PHP_SELF"], 'fk_project', '', $param, '', $sortfield, $sortorder);
@ -590,7 +589,7 @@ if ($result) {
// Type // Type
if ($arrayfields['type']['checked']) { if ($arrayfields['type']['checked']) {
print '<td>'; print '<td class="center">';
if ($obj->payment_code) { if ($obj->payment_code) {
print $langs->trans("PaymentTypeShort".$obj->payment_code); print $langs->trans("PaymentTypeShort".$obj->payment_code);
print ' '; print ' ';

View File

@ -1093,6 +1093,19 @@ if (empty($reshook)) {
} }
} }
$id = $object->create($user); $id = $object->create($user);
if ($id < 0) {
$error++;
} else {
// copy internal contacts
if ($object->copy_linked_contact($facture_source, 'internal') < 0) {
$error++;
} elseif ($facture_source->socid == $object->socid) {
// copy external contacts if same company
if ($object->copy_linked_contact($facture_source, 'external') < 0) {
$error++;
}
}
}
// NOTE: Pb with situation invoice // NOTE: Pb with situation invoice
// NOTE: fields total on situation invoice are stored as cumulative values on total of lines (bad) but delta on invoice total // NOTE: fields total on situation invoice are stored as cumulative values on total of lines (bad) but delta on invoice total

View File

@ -10,7 +10,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2015-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat> * Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com> * Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2019-2021 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2019-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>

View File

@ -126,8 +126,8 @@ if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->rights->ban
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; //if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
@ -177,8 +177,8 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->banque-
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; //if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
@ -219,8 +219,8 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; //if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -60,13 +60,6 @@ class box_dolibarr_state_board extends ModeleBoxes
global $conf, $user; global $conf, $user;
$this->db = $db; $this->db = $db;
// disable box for such cases
if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
$this->enabled = 0; // disabled by this option
}
$this->hidden = !(!empty($user->rights->societe->lire) && empty($user->socid));
} }
/** /**

View File

@ -7692,8 +7692,12 @@ class Form
'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'), 'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'),
'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'),
'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'),
'contrat'=>array('enabled'=>$conf->contrat->enabled, 'perms'=>1, 'label'=>'LinkToContract', 'contrat'=>array(
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').')'), 'enabled'=>$conf->contrat->enabled,
'perms'=>1,
'label'=>'LinkToContract',
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier'
),
'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'),
'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'),
'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'),

View File

@ -88,8 +88,8 @@ class FormOther
*/ */
$out .= '<br>'; $out .= '<br>';
$out .= '<center>'; $out .= '<center>';
$out .= '<input type="submit" class="button paddingleftonly paddingrightonly" name="addscan" value="'.$langs->trans("Add").'">'; $out .= '<input type="submit" class="button marginleftonly marginrightonly" name="addscan" value="'.$langs->trans("Add").'">';
$out .= '<input type="submit" class="button paddingleftonly paddingrightonly" name="cancel" value="'.$langs->trans("Cancel").'">'; $out .= '<input type="submit" class="button marginleftonly marginrightonly" name="cancel" value="'.$langs->trans("Cancel").'">';
$out .= '<br>'; $out .= '<br>';
$out .= '<span class="opacitymedium">'.$langs->trans("FeatureNotYetAvailable").'</span>'; $out .= '<span class="opacitymedium">'.$langs->trans("FeatureNotYetAvailable").'</span>';

View File

@ -103,11 +103,13 @@ class FormTicket
*/ */
public function __construct($db) public function __construct($db)
{ {
global $conf;
$this->db = $db; $this->db = $db;
$this->action = 'add'; $this->action = 'add';
$this->withcompany = 1; $this->withcompany = $conf->societe->enabled ? 1 : 0;
$this->withfromsocid = 0; $this->withfromsocid = 0;
$this->withfromcontactid = 0; $this->withfromcontactid = 0;
//$this->withthreadid=0; //$this->withthreadid=0;

View File

@ -1,19 +1,19 @@
<?php <?php
/* Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/** /**
* \file htdocs/core/class/rssparser.class.php * \file htdocs/core/class/rssparser.class.php
@ -538,22 +538,18 @@ class RssParser
if ($el == 'channel') { if ($el == 'channel') {
$this->inchannel = true; $this->inchannel = true;
} elseif ($el == 'item' or $el == 'entry') { } elseif ($el == 'item' || $el == 'entry') {
$this->initem = true; $this->initem = true;
if (isset($attrs['rdf:about'])) { if (isset($attrs['rdf:about'])) {
$this->current_item['about'] = $attrs['rdf:about']; $this->current_item['about'] = $attrs['rdf:about'];
} }
} elseif ($this->_format == 'rss' and } elseif ($this->_format == 'rss' && $this->current_namespace == '' && $el == 'textinput') {
$this->current_namespace == '' and
$el == 'textinput') {
// if we're in the default namespace of an RSS feed, // if we're in the default namespace of an RSS feed,
// record textinput or image fields // record textinput or image fields
$this->intextinput = true; $this->intextinput = true;
} elseif ($this->_format == 'rss' and } elseif ($this->_format == 'rss' && $this->current_namespace == '' && $el == 'image') {
$this->current_namespace == '' and
$el == 'image') {
$this->inimage = true; $this->inimage = true;
} elseif ($this->_format == 'atom' and in_array($el, $this->_CONTENT_CONSTRUCTS)) { } elseif ($this->_format == 'atom' && in_array($el, $this->_CONTENT_CONSTRUCTS)) {
// handle atom content constructs // handle atom content constructs
// avoid clashing w/ RSS mod_content // avoid clashing w/ RSS mod_content
if ($el == 'content') { if ($el == 'content') {
@ -561,7 +557,7 @@ class RssParser
} }
$this->incontent = $el; $this->incontent = $el;
} elseif ($this->_format == 'atom' and $this->incontent) { } elseif ($this->_format == 'atom' && $this->incontent) {
// if inside an Atom content construct (e.g. content or summary) field treat tags as text // if inside an Atom content construct (e.g. content or summary) field treat tags as text
// if tags are inlined, then flatten // if tags are inlined, then flatten
$attrs_str = join(' ', array_map('map_attrs', array_keys($attrs), array_values($attrs))); $attrs_str = join(' ', array_map('map_attrs', array_keys($attrs), array_values($attrs)));
@ -569,7 +565,7 @@ class RssParser
$this->append_content("<$element $attrs_str>"); $this->append_content("<$element $attrs_str>");
array_unshift($this->stack, $el); array_unshift($this->stack, $el);
} elseif ($this->_format == 'atom' and $el == 'link') { } elseif ($this->_format == 'atom' && $el == 'link') {
// Atom support many links per containging element. // Atom support many links per containging element.
// Magpie treats link elements of type rel='alternate' // Magpie treats link elements of type rel='alternate'
// as being equivalent to RSS's simple link element. // as being equivalent to RSS's simple link element.

View File

@ -354,7 +354,7 @@ class Utils
$execmethod = 1; $execmethod = 1;
} }
dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_DEBUG); dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_INFO);
// TODO Replace with executeCLI function // TODO Replace with executeCLI function
if ($execmethod == 1) { if ($execmethod == 1) {

View File

@ -316,8 +316,8 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && !empty($_REQUEST['lang_id'])) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
if (empty($newlang)) { if (empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;

View File

@ -84,7 +84,7 @@ function ticket_prepare_head($object)
$head[$h][2] = 'tabTicket'; $head[$h][2] = 'tabTicket';
$h++; $h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && empty($user->socid)) { if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && empty($user->socid) && $conf->societe->enabled) {
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = DOL_URL_ROOT.'/ticket/contact.php?track_id='.$object->track_id; $head[$h][0] = DOL_URL_ROOT.'/ticket/contact.php?track_id='.$object->track_id;
$head[$h][1] = $langs->trans('ContactsAddresses'); $head[$h][1] = $langs->trans('ContactsAddresses');
@ -157,7 +157,8 @@ function showDirectPublicLink($object)
$out = ''; $out = '';
if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
$out .= '<span class="opacitymedium">'.$langs->trans("PublicInterfaceNotEnabled").'</span>'; $langs->load('errors');
$out .= '<span class="opacitymedium">'.$langs->trans("ErrorPublicInterfaceNotEnabled").'</span>';
} else { } else {
$out .= img_picto('', 'object_globe.png').' <span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span><br>'; $out .= img_picto('', 'object_globe.png').' <span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span><br>';
if ($url) { if ($url) {

View File

@ -502,7 +502,7 @@ function includeContainer($containerref)
} }
$includehtmlcontentopened++; $includehtmlcontentopened++;
if ($includehtmlcontentopened > $MAXLEVEL) { if ($includehtmlcontentopened > $MAXLEVEL) {
print 'ERROR: RECURSIVE CONTENT LEVEL. Depth of recursive call is more than the limit of '.$MAXLEVEL.".\n"; print 'ERROR: RECURSIVE CONTENT LEVEL. Depth of recursive call is more than the limit of '.((int) $MAXLEVEL).".\n";
return; return;
} }
@ -549,20 +549,20 @@ function getStructuredData($type, $data = array())
"@type": "SoftwareApplication", "@type": "SoftwareApplication",
"name": "'.dol_escape_json($data['name']).'", "name": "'.dol_escape_json($data['name']).'",
"operatingSystem": "'.dol_escape_json($data['os']).'", "operatingSystem": "'.dol_escape_json($data['os']).'",
"applicationCategory": "https://schema.org/'.$data['applicationCategory'].'",'; "applicationCategory": "https://schema.org/'.dol_escape_json($data['applicationCategory']).'",';
if (!empty($data['ratingcount'])) { if (!empty($data['ratingcount'])) {
$ret .= ' $ret .= '
"aggregateRating": { "aggregateRating": {
"@type": "AggregateRating", "@type": "AggregateRating",
"ratingValue": "'.$data['ratingvalue'].'", "ratingValue": "'.dol_escape_json($data['ratingvalue']).'",
"ratingCount": "'.$data['ratingcount'].'" "ratingCount": "'.dol_escape_json($data['ratingcount']).'"
},'; },';
} }
$ret .= ' $ret .= '
"offers": { "offers": {
"@type": "Offer", "@type": "Offer",
"price": "'.$data['price'].'", "price": "'.dol_escape_json($data['price']).'",
"priceCurrency": "'.($data['currency'] ? $data['currency'] : $conf->currency).'" "priceCurrency": "'.dol_escape_json($data['currency'] ? $data['currency'] : $conf->currency).'"
} }
}'."\n"; }'."\n";
$ret .= '</script>'."\n"; $ret .= '</script>'."\n";
@ -618,7 +618,7 @@ function getStructuredData($type, $data = array())
$pageurl = str_replace('__WEBSITE_KEY__', $website->ref, $pageurl); $pageurl = str_replace('__WEBSITE_KEY__', $website->ref, $pageurl);
$title = str_replace('__WEBSITE_KEY__', $website->ref, $title); $title = str_replace('__WEBSITE_KEY__', $website->ref, $title);
$image = '/medias/'.str_replace('__WEBSITE_KEY__', $website->ref, $image); $image = '/medias'.(preg_match('/^\//', $image) ? '' : '/').str_replace('__WEBSITE_KEY__', $website->ref, $image);
$companyname = str_replace('__WEBSITE_KEY__', $website->ref, $companyname); $companyname = str_replace('__WEBSITE_KEY__', $website->ref, $companyname);
$description = str_replace('__WEBSITE_KEY__', $website->ref, $description); $description = str_replace('__WEBSITE_KEY__', $website->ref, $description);
@ -666,6 +666,8 @@ function getStructuredData($type, $data = array())
$ret .= '"description": "'.dol_escape_json($description).'"'; $ret .= '"description": "'.dol_escape_json($description).'"';
$ret .= "\n".'}'."\n"; $ret .= "\n".'}'."\n";
$ret .= '</script>'."\n"; $ret .= '</script>'."\n";
} else {
$ret .= '<!-- no structured data inserted inline inside blogpost because no author_alias defined -->'."\n";
} }
} elseif ($type == 'product') { } elseif ($type == 'product') {
$ret = '<!-- Add structured data for product -->'."\n"; $ret = '<!-- Add structured data for product -->'."\n";
@ -691,8 +693,8 @@ function getStructuredData($type, $data = array())
"offers": { "offers": {
"@type": "Offer", "@type": "Offer",
"url": "https://example.com/anvil", "url": "https://example.com/anvil",
"priceCurrency": "'.($data['currency'] ? $data['currency'] : $conf->currency).'", "priceCurrency": "'.dol_escape_json($data['currency'] ? $data['currency'] : $conf->currency).'",
"price": "'.$data['price'].'", "price": "'.dol_escape_json($data['price']).'",
"itemCondition": "https://schema.org/UsedCondition", "itemCondition": "https://schema.org/UsedCondition",
"availability": "https://schema.org/InStock", "availability": "https://schema.org/InStock",
"seller": { "seller": {

View File

@ -1516,7 +1516,7 @@ class pdf_azur extends ModelePDFPropales
$posy += 4; $posy += 4;
$pdf->SetXY($posx, $posy); $pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60); $pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DatePropal")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
$posy += 4; $posy += 4;
$pdf->SetXY($posx, $posy); $pdf->SetXY($posx, $posy);

View File

@ -115,12 +115,14 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel
} }
print '</td>'; print '</td>';
} }
print '<td class="right nowraponall"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&attrname='.$key.'#formeditextrafield">'.img_edit().'</a>'; print '<td class="right nowraponall">';
print '&nbsp; <a class="paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&attrname='.$key.'">'.img_delete().'</a></td>'."\n"; print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&attrname='.$key.'#formeditextrafield">'.img_edit().'</a>';
print '&nbsp; <a class="paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&attrname='.$key.'">'.img_delete().'</a>';
print '</td>'."\n";
print "</tr>"; print "</tr>";
} }
} else { } else {
$colspan = 13; $colspan = 14;
if (!empty($conf->multicompany->enabled)) { if (!empty($conf->multicompany->enabled)) {
$colspan++; $colspan++;
} }

View File

@ -58,8 +58,8 @@ if ($action == 'presend') {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;

View File

@ -26,6 +26,10 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
if ($crit != '' && in_array($typ, array('date', 'datetime', 'timestamp'))) { if ($crit != '' && in_array($typ, array('date', 'datetime', 'timestamp'))) {
if (is_numeric($crit)) { if (is_numeric($crit)) {
if ($typ == 'date'){
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$crit = dol_get_first_hour($crit);
}
$sql .= " AND ".$extrafieldsobjectprefix.$tmpkey." = '".$db->idate($crit)."'"; $sql .= " AND ".$extrafieldsobjectprefix.$tmpkey." = '".$db->idate($crit)."'";
} elseif (is_array($crit)) { } elseif (is_array($crit)) {
if ($crit['start'] !== '' && $crit['end'] !== '') { if ($crit['start'] !== '' && $crit['end'] !== '') {

View File

@ -183,7 +183,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$this->error = "ErrorLDAP ".$ldap->error; $this->error = "ErrorLDAP ".$ldap->error;
} }
} }
} elseif ($action == 'USER_SETINGROUP') { /*} elseif ($action == 'USER_SETINGROUP') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (!empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE === 'dolibarr2ldap') { if (!empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE === 'dolibarr2ldap') {
$ldap = new Ldap(); $ldap = new Ldap();
@ -250,7 +250,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
if ($result < 0) { if ($result < 0) {
$this->error = "ErrorLDAP ".$ldap->error; $this->error = "ErrorLDAP ".$ldap->error;
} }
} } */
} elseif ($action == 'USERGROUP_CREATE') { } elseif ($action == 'USERGROUP_CREATE') {
// Groupes // Groupes
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
@ -262,8 +262,8 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info = $object->_load_ldap_info(); $info = $object->_load_ldap_info();
$dn = $object->_load_ldap_dn($info); $dn = $object->_load_ldap_dn($info);
// Get a gid number for objectclass PosixGroup // Get a gid number for objectclass PosixGroup if none was provided
if (in_array('posixGroup', $info['objectclass'])) { if (empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID]) && in_array('posixGroup', $info['objectclass'])) {
$info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS'); $info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS');
} }

View File

@ -111,13 +111,9 @@ class InterfaceZapierTriggers extends DolibarrTriggers
//case 'USER_NEW_PASSWORD': //case 'USER_NEW_PASSWORD':
//case 'USER_ENABLEDISABLE': //case 'USER_ENABLEDISABLE':
//case 'USER_DELETE': //case 'USER_DELETE':
//case 'USER_SETINGROUP': //case 'USER_LOGIN':
//case 'USER_REMOVEFROMGROUP': //case 'USER_LOGIN_FAILED':
// case 'USER_LOGIN': //case 'USER_LOGOUT':
// case 'USER_LOGIN_FAILED':
// case 'USER_LOGOUT':
// Warning: To increase performances, this action is triggered only if constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
// // case 'USER_UPDATE_SESSION':
// Actions // Actions
case 'ACTION_MODIFY': case 'ACTION_MODIFY':

View File

@ -542,8 +542,8 @@ if ($action == 'create') { // Create. Seems to no be used
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && !empty($_REQUEST['lang_id'])) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
if (empty($newlang)) { if (empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2016-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net> * Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
* *
@ -434,20 +434,18 @@ if ($search_zip) {
if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
$param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
} }
if ($search_datedelivery_start) {
if ($search_datedelivery_start) { $param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y'));
$param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start);
} }
if ($search_datedelivery_end) { if ($search_datedelivery_end) {
$param .= '&search_datedelivery_end='.urlencode($search_datedelivery_end); $param .= '&search_datedelivery_endday='.urlencode(dol_print_date($search_datedelivery_end, '%d')).'&search_datedelivery_endmonth='.urlencode(dol_print_date($search_datedelivery_end, '%m')).'&search_datedelivery_endyear='.urlencode(dol_print_date($search_datedelivery_end, '%Y'));
} }
if ($search_datereceipt_start) { if ($search_datereceipt_start) {
$param .= '&search_datereceipt_start='.urlencode($search_datereceipt_start); $param .= '&search_datereceipt_startday='.urlencode(dol_print_date($search_datereceipt_start, '%d')).'&search_datereceipt_startmonth='.urlencode(dol_print_date($search_datereceipt_start, '%m')).'&search_datereceipt_startyear='.urlencode(dol_print_date($search_datereceipt_start, '%Y'));
} }
if ($search_datereceipt_end) { if ($search_datereceipt_end) {
$param .= '&search_datereceipt_end='.urlencode($search_datereceipt_end); $param .= '&search_datereceipt_endday='.urlencode(dol_print_date($search_datereceipt_end, '%d')).'&search_datereceipt_endmonth='.urlencode(dol_print_date($search_datereceipt_end, '%m')).'&search_datereceipt_endyear='.urlencode(dol_print_date($search_datereceipt_end, '%Y'));
} }
if ($search_product_category != '') { if ($search_product_category != '') {
$param .= '&search_product_category='.urlencode($search_product_category); $param .= '&search_product_category='.urlencode($search_product_category);
} }
@ -863,10 +861,6 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['e.date_delivery']['checked'])) { if (!empty($arrayfields['e.date_delivery']['checked'])) {
print '<td class="center">'; print '<td class="center">';
print dol_print_date($db->jdate($obj->delivery_date), "dayhour"); print dol_print_date($db->jdate($obj->delivery_date), "dayhour");
/*$now = time();
if ( ($now - $db->jdate($obj->date_expedition)) > $conf->warnings->lim && $obj->statutid == 1 )
{
}*/
print "</td>\n"; print "</td>\n";
} }
// Tracking number // Tracking number

View File

@ -687,8 +687,8 @@ if ($id > 0 || !empty($ref)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && !empty($_REQUEST['lang_id'])) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
if (empty($newlang)) { if (empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;

View File

@ -55,6 +55,7 @@ $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha'); $cancel = GETPOST('cancel', 'alpha');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');
$date_start = dol_mktime(0, 0, 0, GETPOST('date_debutmonth', 'int'), GETPOST('date_debutday', 'int'), GETPOST('date_debutyear', 'int')); $date_start = dol_mktime(0, 0, 0, GETPOST('date_debutmonth', 'int'), GETPOST('date_debutday', 'int'), GETPOST('date_debutyear', 'int'));
$date_end = dol_mktime(0, 0, 0, GETPOST('date_finmonth', 'int'), GETPOST('date_finday', 'int'), GETPOST('date_finyear', 'int')); $date_end = dol_mktime(0, 0, 0, GETPOST('date_finmonth', 'int'), GETPOST('date_finday', 'int'), GETPOST('date_finyear', 'int'));
$date = dol_mktime(0, 0, 0, GETPOST('datemonth', 'int'), GETPOST('dateday', 'int'), GETPOST('dateyear', 'int')); $date = dol_mktime(0, 0, 0, GETPOST('datemonth', 'int'), GETPOST('dateday', 'int'), GETPOST('dateyear', 'int'));
@ -120,7 +121,6 @@ if ($object->id > 0) {
} }
// Security check // Security check
$id = GETPOST("id", 'int');
if ($user->socid) { if ($user->socid) {
$socid = $user->socid; $socid = $user->socid;
} }

View File

@ -171,9 +171,6 @@ $langs->load("boxes");
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.statut as user_status, u.photo, u.email, u.admin,"; $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.statut as user_status, u.photo, u.email, u.admin,";
$sql .= " d.rowid, d.ref, d.date_debut as dated, d.date_fin as datef, d.date_create as dm, d.total_ht, d.total_ttc, d.fk_statut as status"; $sql .= " d.rowid, d.ref, d.date_debut as dated, d.date_fin as datef, d.date_create as dm, d.total_ht, d.total_ttc, d.fk_statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."user as u"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."user as u";
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE u.rowid = d.fk_user_author"; $sql .= " WHERE u.rowid = d.fk_user_author";
// RESTRICT RIGHTS // RESTRICT RIGHTS
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous) if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
@ -183,12 +180,6 @@ if (empty($user->rights->expensereport->readall) && empty($user->rights->expense
$sql .= " AND d.fk_user_author IN (".$db->sanitize(join(',', $childids)).")\n"; $sql .= " AND d.fk_user_author IN (".$db->sanitize(join(',', $childids)).")\n";
} }
$sql .= ' AND d.entity IN ('.getEntity('expensereport').')'; $sql .= ' AND d.entity IN ('.getEntity('expensereport').')';
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " AND d.fk_user_author = s.rowid AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND d.fk_user_author = ".$socid;
}
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($max, 0); $sql .= $db->plimit($max, 0);

View File

@ -138,8 +138,8 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
$fieldstosearchall = array( $fieldstosearchall = array(
'd.ref'=>'Ref', 'd.ref'=>'Ref',
'd.note_public'=>"NotePublic", 'd.note_public'=>"NotePublic",
'u.lastname'=>'Lastname', 'u.lastname'=>'EmployeeLastname',
'u.firstname'=>"Firstname", 'u.firstname'=>"EmployeeFirstname",
'u.login'=>"Login", 'u.login'=>"Login",
); );
if (empty($user->socid)) { if (empty($user->socid)) {

View File

@ -40,8 +40,13 @@ if ($conf->deplacement->enabled) {
if ($conf->expensereport->enabled) { if ($conf->expensereport->enabled) {
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
} }
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; if ($conf->recruitment->enabled) {
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
}
if ($conf->holiday->enabled) {
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
}
$hookmanager = new HookManager($db); $hookmanager = new HookManager($db);
$hookmanager->initHooks('hrmindex'); $hookmanager->initHooks('hrmindex');
@ -60,10 +65,6 @@ if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INF
$setupcompanynotcomplete = 1; $setupcompanynotcomplete = 1;
} }
$holiday = new Holiday($db);
$holidaystatic = new Holiday($db);
$staticrecruitmentcandidature = new RecruitmentCandidature($db);
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
@ -73,7 +74,8 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
// Update sold // Update sold
if (!empty($conf->holiday->enabled) && !empty($setupcompanynotcomplete)) { if (!empty($conf->holiday->enabled) && !empty($setupcompanynotcomplete)) {
$result = $holiday->updateBalance(); $holidaystatic = new Holiday($db);
$result = $holidaystatic->updateBalance();
} }
@ -144,6 +146,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel
if (!empty($conf->holiday->enabled)) { if (!empty($conf->holiday->enabled)) {
if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) { if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) {
$holidaystatic = new Holiday($db);
$user_id = $user->id; $user_id = $user->id;
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
@ -154,9 +157,9 @@ if (!empty($conf->holiday->enabled)) {
$out = ''; $out = '';
$nb_holiday = 0; $nb_holiday = 0;
$typeleaves = $holiday->getTypes(1, 1); $typeleaves = $holidaystatic->getTypes(1, 1);
foreach ($typeleaves as $key => $val) { foreach ($typeleaves as $key => $val) {
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']); $nb_type = $holidaystatic->getCPforUser($user->id, $val['rowid']);
$nb_holiday += $nb_type; $nb_holiday += $nb_type;
$out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': <strong>'.($nb_type ? price2num($nb_type) : 0).'</strong><br>'; $out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': <strong>'.($nb_type ? price2num($nb_type) : 0).'</strong><br>';
} }
@ -179,7 +182,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
// Latest leave requests // Latest leave requests
if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) { if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) {
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut as user_status,"; $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut as user_status,";
$sql .= " x.rowid, x.rowid as ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status"; $sql .= " x.rowid, x.ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = x.fk_user"; $sql .= " WHERE u.rowid = x.fk_user";
$sql .= " AND x.entity = ".$conf->entity; $sql .= " AND x.entity = ".$conf->entity;
@ -330,20 +333,23 @@ if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire)
// Last modified job position // Last modified job position
if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read) { if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read) {
$sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status"; $staticrecruitmentcandidature = new RecruitmentCandidature($db);
$staticrecruitmentjobposition = new RecruitmentJobPosition($db);
$sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status,";
$sql.= " rp.rowid as jobid, rp.ref as jobref, rp.label";
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as rp ON rc.fk_recruitmentjobposition = rp.rowid";
if (!$user->rights->societe->client->voir && !$socid) { if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
} }
$sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")"; $sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentcandidature->element).")";
if (!$user->rights->societe->client->voir && !$socid) { if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; $sql .= " AND rp.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
} }
if ($socid) { if ($socid) {
$sql .= " AND s.fk_soc = $socid"; $sql .= " AND rp.fk_soc = $socid";
} }
$sql .= " ORDER BY rc.tms DESC"; $sql .= $db->order("rc.tms", "DESC");
$sql .= $db->plimit($max, 0); $sql .= $db->plimit($max, 0);
$resql = $db->query($sql); $resql = $db->query($sql);
@ -354,8 +360,8 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th colspan="2">'; print '<th colspan="3">';
print $langs->trans("BoxTitleLatestModifiedCandidatures", $max); print $langs->trans("BoxTitleLatestModifiedCandidatures", min($max, $num));
print '</th>'; print '</th>';
print '<th class="right" colspan="2"><a href="'.DOL_URL_ROOT.'/recruitment/recruitmentcandidature_list.php?sortfield=t.tms&sortorder=DESC">'.$langs->trans("FullList").'</th>'; print '<th class="right" colspan="2"><a href="'.DOL_URL_ROOT.'/recruitment/recruitmentcandidature_list.php?sortfield=t.tms&sortorder=DESC">'.$langs->trans("FullList").'</th>';
print '</tr>'; print '</tr>';
@ -370,11 +376,15 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme
$staticrecruitmentcandidature->firstname = $objp->firstname; $staticrecruitmentcandidature->firstname = $objp->firstname;
$staticrecruitmentcandidature->lastname = $objp->lastname; $staticrecruitmentcandidature->lastname = $objp->lastname;
$staticrecruitmentjobposition->id = $objp->jobid;
$staticrecruitmentjobposition->ref = $objp->jobref;
$staticrecruitmentjobposition->label = $objp->label;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap">'.$staticrecruitmentcandidature->getNomUrl(1, '').'</td>'; print '<td class="nowrap">'.$staticrecruitmentcandidature->getNomUrl(1, '').'</td>';
print '<td class="right nowrap">'; print '<td class="tdoverflowmax150">'.$staticrecruitmentcandidature->getFullName($langs).'</td>';
print "</td>"; print '<td class="nowrap">'.$staticrecruitmentjobposition->getNomUrl(1).'</td>';
print '<td class="right nowrap">'.dol_print_date($db->jdate($objp->tms), 'day')."</td>"; print '<td class="right nowrap">'.dol_print_date($db->jdate($objp->tms), 'day').'</td>';
print '<td class="right nowrap" width="16">'; print '<td class="right nowrap" width="16">';
print $staticrecruitmentcandidature->getLibStatut(3); print $staticrecruitmentcandidature->getLibStatut(3);
print "</td>"; print "</td>";

View File

@ -33,7 +33,7 @@ global $langs;
$err = 0; $err = 0;
$setuplang = GETPOST("selectlang", '', 3) ? GETPOST("selectlang", '', 3) : (GETPOST('lang', 'alpha', 1) ? GETPOST('lang', 'alpha', 1) : 'auto'); $setuplang = GETPOST("selectlang", 'alpha', 3) ? GETPOST("selectlang", 'alpha', 3) : (GETPOST('lang', 'alpha', 1) ? GETPOST('lang', 'alpha', 1) : 'auto');
$langs->setDefaultLang($setuplang); $langs->setDefaultLang($setuplang);
$langs->loadLangs(array("install", "errors")); $langs->loadLangs(array("install", "errors"));

View File

@ -64,6 +64,10 @@ ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64);
-- For v14 -- For v14
ALTER TABLE llx_product_lot ADD COLUMN eol_date datetime NULL;
ALTER TABLE llx_product_lot ADD COLUMN manufacturing_date datetime NULL;
ALTER TABLE llx_product_lot ADD COLUMN scrapping_date datetime NULL;
create table llx_accounting_groups_account create table llx_accounting_groups_account
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
@ -488,10 +492,14 @@ CREATE TABLE llx_knowledgemanagement_knowledgerecord(
model_pdf varchar(255), model_pdf varchar(255),
question text NOT NULL, question text NOT NULL,
answer text, answer text,
fk_ticket integer,
status integer NOT NULL status integer NOT NULL
-- END MODULEBUILDER FIELDS -- END MODULEBUILDER FIELDS
) ENGINE=innodb; ) ENGINE=innodb;
ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN fk_ticket integer;
create table llx_knowledgemanagement_knowledgerecord_extrafields create table llx_knowledgemanagement_knowledgerecord_extrafields
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,

View File

@ -15,7 +15,7 @@
-- along with this program. If not, see <https://www.gnu.org/licenses/>. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
-- --
-- Table with the categories of a ticket -- Table with the custom category tree for the category of a ticket
-- --
create table llx_c_ticket_category create table llx_c_ticket_category

View File

@ -13,7 +13,7 @@
-- You should have received a copy of the GNU General Public License -- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
-- --
-- -- Type of ticket. For example: COM, ISSUE, REQUEST, PROJECT, OTHER, ...
create table llx_c_ticket_type create table llx_c_ticket_type
( (

View File

@ -28,6 +28,7 @@ CREATE TABLE llx_knowledgemanagement_knowledgerecord(
model_pdf varchar(255), model_pdf varchar(255),
question text NOT NULL, question text NOT NULL,
answer text, answer text,
fk_ticket integer,
status integer NOT NULL status integer NOT NULL
-- END MODULEBUILDER FIELDS -- END MODULEBUILDER FIELDS
) ENGINE=innodb; ) ENGINE=innodb;

View File

@ -24,6 +24,9 @@ CREATE TABLE llx_product_lot (
batch varchar(128) DEFAULT NULL, -- Lot or serial number batch varchar(128) DEFAULT NULL, -- Lot or serial number
eatby date DEFAULT NULL, -- Eatby date eatby date DEFAULT NULL, -- Eatby date
sellby date DEFAULT NULL, -- Sellby date sellby date DEFAULT NULL, -- Sellby date
eol_date datetime NULL,
manufacturing_date datetime NULL,
scrapping_date datetime NULL,
datec datetime, datec datetime,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer, fk_user_creat integer,

View File

@ -110,8 +110,8 @@ class KnowledgeRecord extends CommonObject
'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>'1', 'position'=>512, 'notnull'=>0, 'visible'=>-2,), 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>'1', 'position'=>512, 'notnull'=>0, 'visible'=>-2,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1,), 'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflow300'),
'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>-1,), 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflow300'),
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Valid'),), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Valid'),),
); );
public $rowid; public $rowid;

View File

@ -2127,7 +2127,8 @@ ConfFileIsReadableOrWritableByAnyUsers=The conf file is readable or writable by
MailToSendEventOrganization=Event Organization MailToSendEventOrganization=Event Organization
AGENDA_EVENT_DEFAULT_STATUS=Default event status when creating a event from the form AGENDA_EVENT_DEFAULT_STATUS=Default event status when creating a event from the form
YouShouldDisablePHPFunctions=You should disable PHP functions YouShouldDisablePHPFunctions=You should disable PHP functions
IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands (for the module Scheduled job, or to run the external command line Anti-virus for example), you shoud disable PHP functions IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands in custom code, you shoud disable PHP functions
PHPFunctionsRequiredForCLI=For shell purpose (like scheduled job backup or running an anitivurs program), you must keep PHP functions
NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good) NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good)
RecommendedValueIs=Recommended: %s RecommendedValueIs=Recommended: %s
NotRecommended=Not recommanded NotRecommended=Not recommanded
@ -2137,3 +2138,4 @@ CheckForModuleUpdateHelp=This action will connect to editors of external modules
ModuleUpdateAvailable=An update is available ModuleUpdateAvailable=An update is available
NoExternalModuleWithUpdate=No updates found for external modules NoExternalModuleWithUpdate=No updates found for external modules
SwaggerDescriptionFile=Swagger API description file (for use with redoc for example) SwaggerDescriptionFile=Swagger API description file (for use with redoc for example)
YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead.

View File

@ -117,7 +117,7 @@ ErrorCantReadFile=Failed to read file '%s'
ErrorCantReadDir=Failed to read directory '%s' ErrorCantReadDir=Failed to read directory '%s'
ErrorBadLoginPassword=Bad value for login or password ErrorBadLoginPassword=Bad value for login or password
ErrorLoginDisabled=Your account has been disabled ErrorLoginDisabled=Your account has been disabled
ErrorFailedToRunExternalCommand=Failed to run external command. Check it is available and runnable by your PHP server. If PHP <b>Safe Mode</b> is enabled, check that command is inside a directory defined by parameter <b>safe_mode_exec_dir</b>. ErrorFailedToRunExternalCommand=Failed to run external command. Check it is available and runnable by your PHP server user. Check also the command is not protected on shell level by a security layer like apparmor.
ErrorFailedToChangePassword=Failed to change password ErrorFailedToChangePassword=Failed to change password
ErrorLoginDoesNotExists=User with login <b>%s</b> could not be found. ErrorLoginDoesNotExists=User with login <b>%s</b> could not be found.
ErrorLoginHasNoEmail=This user has no email address. Process aborted. ErrorLoginHasNoEmail=This user has no email address. Process aborted.

View File

@ -249,7 +249,7 @@ SelectAStockMovementFileToImport=select a stock movement file to import
InfoTemplateImport=Uploaded file needs to have this format (* are mandatory fields):<br>Source Warehouse* | Target Warehouse* | Product* | Quantity* | Lot/serial number<br>CSV character separator must be "<b>%s</b>" InfoTemplateImport=Uploaded file needs to have this format (* are mandatory fields):<br>Source Warehouse* | Target Warehouse* | Product* | Quantity* | Lot/serial number<br>CSV character separator must be "<b>%s</b>"
LabelOfInventoryMovemement=Inventory %s LabelOfInventoryMovemement=Inventory %s
ReOpen=Reopen ReOpen=Reopen
ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock. ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock to the real qty you entered into the inventory.
ObjectNotFound=%s not found ObjectNotFound=%s not found
MakeMovementsAndClose=Generate movements and close MakeMovementsAndClose=Generate movements and close
AutofillWithExpected=Fill real quantity with expected quantity AutofillWithExpected=Fill real quantity with expected quantity

View File

@ -2201,6 +2201,7 @@ function top_menu_quickadd()
{ {
global $langs, $conf, $db, $hookmanager, $user; global $langs, $conf, $db, $hookmanager, $user;
global $menumanager; global $menumanager;
$html = ''; $html = '';
// Define $dropDownQuickAddHtml // Define $dropDownQuickAddHtml
$dropDownQuickAddHtml = '<div class="dropdown-header bookmark-header center">'; $dropDownQuickAddHtml = '<div class="dropdown-header bookmark-header center">';
@ -2215,9 +2216,7 @@ function top_menu_quickadd()
<!-- Thirdparty link --> <!-- Thirdparty link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/societe/card.php?action=create" title="'.$langs->trans("MenuNewThirdParty").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/societe/card.php?action=create" title="'.$langs->trans("MenuNewThirdParty").'">
<i class="fa fa-building"></i><br> '. img_picto('', 'object_company') .'<br>'. $langs->trans("ThirdParty") .'</a>
'.$langs->trans("ThirdParty").'
</a>
</div> </div>
'; ';
} }
@ -2228,9 +2227,7 @@ function top_menu_quickadd()
<!-- Contact link --> <!-- Contact link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/contact/card.php?action=create" title="'.$langs->trans("NewContactAddress").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/contact/card.php?action=create" title="'.$langs->trans("NewContactAddress").'">
<i class="fa fa-address-book"></i><br> '. img_picto('', 'object_contact') .'<br>'. $langs->trans("Contact") .'</a>
'.$langs->trans("Contact").'
</a>
</div> </div>
'; ';
} }
@ -2241,9 +2238,7 @@ function top_menu_quickadd()
<!-- Propal link --> <!-- Propal link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/comm/propal/card.php?action=create" title="'.$langs->trans("NewPropal").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/comm/propal/card.php?action=create" title="'.$langs->trans("NewPropal").'">
<i class="fa fa-suitcase"></i><br> '. img_picto('', 'object_propal') .'<br>'. $langs->trans("Proposal") .'</a>
'.$langs->trans("Proposal").'
</a>
</div> </div>
'; ';
} }
@ -2254,9 +2249,7 @@ function top_menu_quickadd()
<!-- Order link --> <!-- Order link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'">
<i class="fa fa-file-alt"></i><br> '. img_picto('', 'object_order') .'<br>'. $langs->trans("Order") .'</a>
'.$langs->trans("Order").'
</a>
</div> </div>
'; ';
} }
@ -2267,9 +2260,7 @@ function top_menu_quickadd()
<!-- Invoice link --> <!-- Invoice link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewBill").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewBill").'">
<i class="fa fa-coins"></i><br> '. img_picto('', 'object_bill') .'<br>'. $langs->trans("Bill") .'</a>
'.$langs->trans("Bill").'
</a>
</div> </div>
'; ';
} }
@ -2280,9 +2271,7 @@ function top_menu_quickadd()
<!-- Contract link --> <!-- Contract link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewContractSubscription").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewContractSubscription").'">
<i class="fa fa-file-contract"></i><br> '. img_picto('', 'object_contract') .'<br>'. $langs->trans("Contract") .'</a>
'.$langs->trans("Contract").'
</a>
</div> </div>
'; ';
} }
@ -2293,9 +2282,7 @@ function top_menu_quickadd()
<!-- Supplier proposal link --> <!-- Supplier proposal link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create" title="'.$langs->trans("NewAskPrice").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create" title="'.$langs->trans("NewAskPrice").'">
<i class="fa fa-suitcase"></i><br> '. img_picto('', 'object_propal') .'<br>'. $langs->trans("AskPrice") .'</a>
'.$langs->trans("AskPrice").'
</a>
</div> </div>
'; ';
} }
@ -2306,9 +2293,7 @@ function top_menu_quickadd()
<!-- Supplier order link --> <!-- Supplier order link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'">
<i class="fa fa-file-alt"></i><br> '. img_picto('', 'object_order') .'<br>'. $langs->trans("SupplierOrder") .'</a>
'.$langs->trans("SupplierOrder").'
</a>
</div> </div>
'; ';
} }
@ -2319,9 +2304,7 @@ function top_menu_quickadd()
<!-- Supplier invoice link --> <!-- Supplier invoice link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create" title="'.$langs->trans("NewBill").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create" title="'.$langs->trans("NewBill").'">
<i class="fa fa-coins"></i><br> '. img_picto('', 'object_bill') .'<br>'. $langs->trans("SupplierBill") .'</a>
'.$langs->trans("SupplierBill").'
</a>
</div> </div>
'; ';
} }
@ -2332,9 +2315,7 @@ function top_menu_quickadd()
<!-- Product link --> <!-- Product link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&amp;type=0" title="'.$langs->trans("NewProduct").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&amp;type=0" title="'.$langs->trans("NewProduct").'">
<i class="fa fa-cube"></i><br> '. img_picto('', 'object_product') .'<br>'. $langs->trans("Product") .'</a>
'.$langs->trans("Product").'
</a>
</div> </div>
'; ';
} }
@ -2345,9 +2326,29 @@ function top_menu_quickadd()
<!-- Service link --> <!-- Service link -->
<div class="quickaddblock center"> <div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&amp;type=1" title="'.$langs->trans("NewService").'"> <a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&amp;type=1" title="'.$langs->trans("NewService").'">
<i class="fa fa-concierge-bell"></i><br> '. img_picto('', 'object_service') .'<br>'. $langs->trans("Service") .'</a>
'.$langs->trans("Service").' </div>
</a> ';
}
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) {
$langs->load("trips");
$dropDownQuickAddHtml .= '
<!-- Expense report link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/expensereport/card.php?action=create&fk_user_author='.$user->id.'" title="'.$langs->trans("AddTrip").'">
'. img_picto('', 'object_trip') .'<br>'. $langs->trans("ExpenseReport") .'</a>
</div>
';
}
if (!empty($conf->holiday->enabled) && $user->rights->holiday->write) {
$langs->load("holiday");
$dropDownQuickAddHtml .= '
<!-- Holiday link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/holiday/card.php?action=create&fuserid='.$user->id.'" title="'.$langs->trans("AddCP").'">
'. img_picto('', 'object_holiday') .'<br>'. $langs->trans("Holidays") .'</a>
</div> </div>
'; ';
} }

View File

@ -119,8 +119,6 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
//case 'USER_NEW_PASSWORD': //case 'USER_NEW_PASSWORD':
//case 'USER_ENABLEDISABLE': //case 'USER_ENABLEDISABLE':
//case 'USER_DELETE': //case 'USER_DELETE':
//case 'USER_SETINGROUP':
//case 'USER_REMOVEFROMGROUP':
// Actions // Actions
//case 'ACTION_MODIFY': //case 'ACTION_MODIFY':

View File

@ -66,13 +66,13 @@ class FormProduct
* 'warehouseclosed' = select products from closed warehouses, * 'warehouseclosed' = select products from closed warehouses,
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only * 'warehouseinternal' = select products from warehouses for internal correct/transfer only
* @param boolean $sumStock sum total stock of a warehouse, default true * @param boolean $sumStock sum total stock of a warehouse, default true
* @param string $exclude warehouses ids to exclude * @param array $exclude warehouses ids to exclude
* @param bool|int $stockMin [=false] Value of minimum stock to filter or false not not filter by minimum stock * @param bool|int $stockMin [=false] Value of minimum stock to filter or false not not filter by minimum stock
* @param string $orderBy [='e.ref'] Order by * @param string $orderBy [='e.ref'] Order by
* @return int Nb of loaded lines, 0 if already loaded, <0 if KO * @return int Nb of loaded lines, 0 if already loaded, <0 if KO
* @throws Exception * @throws Exception
*/ */
public function loadWarehouses($fk_product = 0, $batch = '', $status = '', $sumStock = true, $exclude = '', $stockMin = false, $orderBy = 'e.ref') public function loadWarehouses($fk_product = 0, $batch = '', $status = '', $sumStock = true, $exclude = array(), $stockMin = false, $orderBy = 'e.ref')
{ {
global $conf, $langs; global $conf, $langs;
@ -80,10 +80,6 @@ class FormProduct
return 0; // Cache already loaded and we do not want a list with information specific to a product return 0; // Cache already loaded and we do not want a list with information specific to a product
} }
if (is_array($exclude)) {
$excludeGroups = implode("','", $exclude);
}
$warehouseStatus = array(); $warehouseStatus = array();
if (preg_match('/warehouseclosed/', $status)) { if (preg_match('/warehouseclosed/', $status)) {
@ -121,7 +117,7 @@ class FormProduct
$sql .= " AND e.statut = 1"; $sql .= " AND e.statut = 1";
} }
if (!empty($exclude)) { if (is_array($exclude) && !empty($exclude)) {
$sql .= ' AND e.rowid NOT IN('.$this->db->sanitize(implode(',', $exclude)).')'; $sql .= ' AND e.rowid NOT IN('.$this->db->sanitize(implode(',', $exclude)).')';
} }
@ -220,7 +216,7 @@ class FormProduct
* @param int $forcecombo 1=Force combo iso ajax select2 * @param int $forcecombo 1=Force combo iso ajax select2
* @param array $events Events to add to select2 * @param array $events Events to add to select2
* @param string $morecss Add more css classes to HTML select * @param string $morecss Add more css classes to HTML select
* @param string $exclude Warehouses ids to exclude * @param array $exclude Warehouses ids to exclude
* @param int $showfullpath 1=Show full path of name (parent ref into label), 0=Show only ref of current warehouse * @param int $showfullpath 1=Show full path of name (parent ref into label), 0=Show only ref of current warehouse
* @param bool|int $stockMin [=false] Value of minimum stock to filter or false not not filter by minimum stock * @param bool|int $stockMin [=false] Value of minimum stock to filter or false not not filter by minimum stock
* @param string $orderBy [='e.ref'] Order by * @param string $orderBy [='e.ref'] Order by
@ -228,7 +224,7 @@ class FormProduct
* *
* @throws Exception * @throws Exception
*/ */
public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = '', $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref') public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = array(), $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref')
{ {
global $conf, $langs, $user, $hookmanager; global $conf, $langs, $user, $hookmanager;

View File

@ -190,6 +190,10 @@ class Product extends CommonObject
public $localtax1_type; public $localtax1_type;
public $localtax2_type; public $localtax2_type;
public $lifetime;
public $qc_frequency;
/** /**
* Stock real * Stock real
* *

View File

@ -586,7 +586,8 @@ if ($resql) {
$paramsCat .= "&search_category_product_list[]=".urlencode($searchCategoryProduct); $paramsCat .= "&search_category_product_list[]=".urlencode($searchCategoryProduct);
} }
llxHeader('', $title, $helpurl, '', 0, 0, array(), array(), $paramsCat, 'classforhorizontalscrolloftabs'); //llxHeader('', $title, $helpurl, '', 0, 0, array(), array(), $paramsCat, 'classforhorizontalscrolloftabs');
llxHeader('', $title, $helpurl, '', 0, 0, array(), array(), $paramsCat, '');
// Displays product removal confirmation // Displays product removal confirmation
if (GETPOST('delprod')) { if (GETPOST('delprod')) {

View File

@ -91,11 +91,11 @@ class Productlot extends CommonObject
'batch' => array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'comment'=>'Batch', 'searchall'=>1), 'batch' => array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'comment'=>'Batch', 'searchall'=>1),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
'sellby' => array('type'=>'date', 'label'=>'SellByDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_SELLBY)?1:0', 'visible'=>5, 'position'=>60), 'sellby' => array('type'=>'date', 'label'=>'SellByDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_SELLBY)?1:0', 'visible'=>5, 'position'=>60),
'eol_date' => array('type'=>'date', 'label'=>'EndOfLife', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_TRACEABILITY)?1:0', 'visible'=>5, 'position'=>70), 'eol_date' => array('type'=>'date', 'label'=>'EndOfLife', 'enabled'=>'empty($conf->global->PRODUCT_ENABLE_TRACEABILITY)?0:1', 'visible'=>5, 'position'=>70),
'manufacturing_date' => array('type'=>'date', 'label'=>'ManufacturingDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_TRACEABILITY)?1:0', 'visible'=>5, 'position'=>80), 'manufacturing_date' => array('type'=>'date', 'label'=>'ManufacturingDate', 'enabled'=>'empty($conf->global->PRODUCT_ENABLE_TRACEABILITY)?0:1', 'visible'=>5, 'position'=>80),
'scrapping_date' => array('type'=>'date', 'label'=>'DestructionDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_TRACEABILITY)?1:0', 'visible'=>5, 'position'=>90), 'scrapping_date' => array('type'=>'date', 'label'=>'DestructionDate', 'enabled'=>'empty($conf->global->PRODUCT_ENABLE_TRACEABILITY)?0:1', 'visible'=>5, 'position'=>90),
'commissionning_date' => array('type'=>'date', 'label'=>'FirstUseDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_TRACEABILITY)?1:0', 'visible'=>5, 'position'=>100), //'commissionning_date' => array('type'=>'date', 'label'=>'FirstUseDate', 'enabled'=>'empty($conf->global->PRODUCT_ENABLE_TRACEABILITY)?0:1', 'visible'=>5, 'position'=>100),
'qc_frequency' => array('type'=>'varchar(6)', 'label'=>'QCFrequency', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_TRACEABILITY)?1:0', 'visible'=>5, 'position'=>110), //'qc_frequency' => array('type'=>'varchar(6)', 'label'=>'QCFrequency', 'enabled'=>'empty($conf->global->PRODUCT_ENABLE_QUALITYCONTROL)?1:0', 'visible'=>5, 'position'=>110),
'eatby' => array('type'=>'date', 'label'=>'EatByDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_EATBY)?1:0', 'visible'=>5, 'position'=>62), 'eatby' => array('type'=>'date', 'label'=>'EatByDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_EATBY)?1:0', 'visible'=>5, 'position'=>62),
'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500), 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
@ -120,8 +120,8 @@ class Productlot extends CommonObject
public $eol_date = ''; public $eol_date = '';
public $manufacturing_date = ''; public $manufacturing_date = '';
public $scrapping_date = ''; public $scrapping_date = '';
public $commissionning_date = ''; //public $commissionning_date = '';
public $qc_frequency = ''; //public $qc_frequency = '';
public $datec = ''; public $datec = '';
public $tms = ''; public $tms = '';
@ -184,8 +184,6 @@ class Productlot extends CommonObject
$this->import_key = trim($this->import_key); $this->import_key = trim($this->import_key);
} }
// Check parameters // Check parameters
// Put here code to add control on parameters values // Put here code to add control on parameters values
@ -199,8 +197,8 @@ class Productlot extends CommonObject
$sql .= 'eol_date,'; $sql .= 'eol_date,';
$sql .= 'manufacturing_date,'; $sql .= 'manufacturing_date,';
$sql .= 'scrapping_date,'; $sql .= 'scrapping_date,';
$sql .= 'commissionning_date,'; //$sql .= 'commissionning_date,';
$sql .= 'qc_frequency,'; //$sql .= 'qc_frequency,';
$sql .= 'datec,'; $sql .= 'datec,';
$sql .= 'fk_user_creat,'; $sql .= 'fk_user_creat,';
$sql .= 'fk_user_modif,'; $sql .= 'fk_user_modif,';
@ -214,9 +212,8 @@ class Productlot extends CommonObject
$sql .= ' '.(!isset($this->eol_date) || dol_strlen($this->eol_date) == 0 ? 'NULL' : "'".$this->db->idate($this->eol_date)."'").','; $sql .= ' '.(!isset($this->eol_date) || dol_strlen($this->eol_date) == 0 ? 'NULL' : "'".$this->db->idate($this->eol_date)."'").',';
$sql .= ' '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) == 0 ? 'NULL' : "'".$this->db->idate($this->manufacturing_date)."'").','; $sql .= ' '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) == 0 ? 'NULL' : "'".$this->db->idate($this->manufacturing_date)."'").',';
$sql .= ' '.(!isset($this->scrapping_date) || dol_strlen($this->scrapping_date) == 0 ? 'NULL' : "'".$this->db->idate($this->scrapping_date)."'").','; $sql .= ' '.(!isset($this->scrapping_date) || dol_strlen($this->scrapping_date) == 0 ? 'NULL' : "'".$this->db->idate($this->scrapping_date)."'").',';
$sql .= ' '.(!isset($this->commissionning_date) || dol_strlen($this->commissionning_date) == 0 ? 'NULL' : "'".$this->db->idate($this->commissionning_date)."'").','; //$sql .= ' '.(!isset($this->commissionning_date) || dol_strlen($this->commissionning_date) == 0 ? 'NULL' : "'".$this->db->idate($this->commissionning_date)."'").',';
$sql .= ' '.(!isset($this->qc_frequency) ? 'NULL' : $this->qc_frequency).','; //$sql .= ' '.(!isset($this->qc_frequency) ? 'NULL' : $this->qc_frequency).',';
$sql .= ' '."'".$this->db->idate(dol_now())."'".','; $sql .= ' '."'".$this->db->idate(dol_now())."'".',';
$sql .= ' '.(!isset($this->fk_user_creat) ? 'NULL' : $this->fk_user_creat).','; $sql .= ' '.(!isset($this->fk_user_creat) ? 'NULL' : $this->fk_user_creat).',';
$sql .= ' '.(!isset($this->fk_user_modif) ? 'NULL' : $this->fk_user_modif).','; $sql .= ' '.(!isset($this->fk_user_modif) ? 'NULL' : $this->fk_user_modif).',';
@ -292,8 +289,8 @@ class Productlot extends CommonObject
$sql .= " t.eol_date,"; $sql .= " t.eol_date,";
$sql .= " t.manufacturing_date,"; $sql .= " t.manufacturing_date,";
$sql .= " t.scrapping_date,"; $sql .= " t.scrapping_date,";
$sql .= " t.commissionning_date,"; //$sql .= " t.commissionning_date,";
$sql .= " t.qc_frequency,"; //$sql .= " t.qc_frequency,";
$sql .= " t.datec,"; $sql .= " t.datec,";
$sql .= " t.tms,"; $sql .= " t.tms,";
$sql .= " t.fk_user_creat,"; $sql .= " t.fk_user_creat,";
@ -322,11 +319,10 @@ class Productlot extends CommonObject
$this->eatby = $this->db->jdate($obj->eatby); $this->eatby = $this->db->jdate($obj->eatby);
$this->sellby = $this->db->jdate($obj->sellby); $this->sellby = $this->db->jdate($obj->sellby);
$this->eol_date = $this->db->jdate($obj->eol_date); $this->eol_date = $this->db->jdate($obj->eol_date);
$this->manufacturing_date = $this->db->jdate($obj->manufacturing_date); $this->manufacturing_date = $this->db->jdate($obj->manufacturing_date);
$this->scrapping_date = $this->db->jdate($obj->scrapping_date); $this->scrapping_date = $this->db->jdate($obj->scrapping_date);
$this->commissionning_date = $this->db->jdate($obj->commissionning_date); //$this->commissionning_date = $this->db->jdate($obj->commissionning_date);
$this->qc_frequency = $obj->qc_frequency; //$this->qc_frequency = $obj->qc_frequency;
$this->datec = $this->db->jdate($obj->datec); $this->datec = $this->db->jdate($obj->datec);
$this->tms = $this->db->jdate($obj->tms); $this->tms = $this->db->jdate($obj->tms);
@ -407,8 +403,8 @@ class Productlot extends CommonObject
$sql .= ' eol_date = '.(!isset($this->eol_date) || dol_strlen($this->eol_date) != 0 ? "'".$this->db->idate($this->eol_date)."'" : 'null').','; $sql .= ' eol_date = '.(!isset($this->eol_date) || dol_strlen($this->eol_date) != 0 ? "'".$this->db->idate($this->eol_date)."'" : 'null').',';
$sql .= ' manufacturing_date = '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) != 0 ? "'".$this->db->idate($this->manufacturing_date)."'" : 'null').','; $sql .= ' manufacturing_date = '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) != 0 ? "'".$this->db->idate($this->manufacturing_date)."'" : 'null').',';
$sql .= ' scrapping_date = '.(!isset($this->destruction_date) || dol_strlen($this->destruction_date) != 0 ? "'".$this->db->idate($this->destruction_date)."'" : 'null').','; $sql .= ' scrapping_date = '.(!isset($this->destruction_date) || dol_strlen($this->destruction_date) != 0 ? "'".$this->db->idate($this->destruction_date)."'" : 'null').',';
$sql .= ' commissionning_date = '.(!isset($this->first_use_date) || dol_strlen($this->first_use_date) != 0 ? "'".$this->db->idate($this->first_use_date)."'" : 'null').','; //$sql .= ' commissionning_date = '.(!isset($this->first_use_date) || dol_strlen($this->first_use_date) != 0 ? "'".$this->db->idate($this->first_use_date)."'" : 'null').',';
$sql .= ' qc_frequency = '.(!isset($this->qc_frequency) || dol_strlen($this->qc_frequency) != 0 ? "'".$this->db->escape($this->qc_frequency)."'" : 'null').','; //$sql .= ' qc_frequency = '.(!isset($this->qc_frequency) || dol_strlen($this->qc_frequency) != 0 ? "'".$this->db->escape($this->qc_frequency)."'" : 'null').',';
$sql .= ' datec = '.(!isset($this->datec) || dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').','; $sql .= ' datec = '.(!isset($this->datec) || dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').',';
$sql .= ' tms = '.(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : "'".$this->db->idate(dol_now())."'").','; $sql .= ' tms = '.(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : "'".$this->db->idate(dol_now())."'").',';
$sql .= ' fk_user_creat = '.(isset($this->fk_user_creat) ? $this->fk_user_creat : "null").','; $sql .= ' fk_user_creat = '.(isset($this->fk_user_creat) ? $this->fk_user_creat : "null").',';

View File

@ -363,7 +363,7 @@ print $form->select_produits($productid, 'productid', '', 0, 0, -1, 2, '', 0, ar
print ' <span class="clearbothonsmartphone marginleftonly paddingleftonly marginrightonly paddingrightonly">&nbsp;</span> '; print ' <span class="clearbothonsmartphone marginleftonly paddingleftonly marginrightonly paddingrightonly">&nbsp;</span> ';
print img_picto('', 'stock').' '; print img_picto('', 'stock').' ';
print $langs->trans('Warehouse').'</span> '; print $langs->trans('Warehouse').'</span> ';
print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifone'), 'fk_warehouse', '', 1, 0, 0, '', 0, 0, null, '', '', 1, false, 'e.ref'); print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifone'), 'fk_warehouse', '', 1, 0, 0, '', 0, 0, null, '', null, 1, false, 'e.ref');
print '</div>'; print '</div>';
$parameters = array(); $parameters = array();

View File

@ -331,18 +331,18 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status, COUNT(rc.rowid) as nbapplications"; $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status, COUNT(rc.rowid) as nbapplications";
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = s.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) { if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
} }
$sql .= " WHERE s.entity IN (".getEntity($staticrecruitmentjobposition->element).")"; $sql .= " WHERE s.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
if (!$user->rights->societe->client->voir && !$socid) { if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; $sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
} }
if ($socid) { if ($socid) {
$sql .= " AND s.fk_soc = $socid"; $sql .= " AND s.fk_soc = $socid";
} }
$sql .= " GROUP BY s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status"; $sql .= " GROUP BY s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status";
$sql .= " ORDER BY s.tms DESC"; $sql .= $db->order('s.tms', 'DESC');
$sql .= $db->plimit($max, 0); $sql .= $db->plimit($max, 0);
$resql = $db->query($sql); $resql = $db->query($sql);
@ -402,17 +402,17 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme
$sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status"; $sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status";
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) { if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
} }
$sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")"; $sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
if (!$user->rights->societe->client->voir && !$socid) { if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; $sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
} }
if ($socid) { if ($socid) {
$sql .= " AND s.fk_soc = $socid"; $sql .= " AND s.fk_soc = $socid";
} }
$sql .= " ORDER BY rc.tms DESC"; $sql .= $db->order('rc.tms', 'DESC');
$sql .= $db->plimit($max, 0); $sql .= $db->plimit($max, 0);
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -238,16 +238,16 @@ foreach ($data as $val) {
print '<tr class="oddeven" height="24">'; print '<tr class="oddeven" height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'">'.$oldyear.'</a></td>'; print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'">'.$oldyear.'</a></td>';
print '<td class="right">0</td>'; print '<td class="right">0</td>';
print '<td class="right">0</td>'; print '<td class="right"><span class="amount">0</span></td>';
print '<td class="right">0</td>'; print '<td class="right"><span class="amount">0</span></td>';
print '</tr>'; print '</tr>';
} }
print '<tr class="oddeven" height="24">'; print '<tr class="oddeven" height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'">'.$year.'</a></td>'; print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'">'.$year.'</a></td>';
print '<td class="right">'.$val['nb'].'</td>'; print '<td class="right">'.$val['nb'].'</td>';
print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>'; print '<td class="right"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>'; print '<td class="right"><span class="amount">'.price(price2num($val['avg'], 'MT'), 1).'</span></td>';
print '</tr>'; print '</tr>';
$oldyear = $year; $oldyear = $year;
} }

View File

@ -480,6 +480,7 @@ class Societe extends CommonObject
public $remise_percent; public $remise_percent;
public $remise_supplier_percent; public $remise_supplier_percent;
public $mode_reglement_supplier_id; public $mode_reglement_supplier_id;
public $cond_reglement_supplier_id; public $cond_reglement_supplier_id;
public $transport_mode_supplier_id; public $transport_mode_supplier_id;
@ -1636,14 +1637,14 @@ class Societe extends CommonObject
$sql .= ', s.fk_typent as typent_id'; $sql .= ', s.fk_typent as typent_id';
$sql .= ', s.fk_effectif as effectif_id'; $sql .= ', s.fk_effectif as effectif_id';
$sql .= ', s.fk_forme_juridique as forme_juridique_code'; $sql .= ', s.fk_forme_juridique as forme_juridique_code';
$sql .= ', s.webservices_url, s.webservices_key'; $sql .= ', s.webservices_url, s.webservices_key, s.model_pdf';
if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
$sql .= ', s.accountancy_code_buy, s.accountancy_code_sell'; $sql .= ', s.accountancy_code_buy, s.accountancy_code_sell';
} else { } else {
$sql .= ', spe.accountancy_code_buy, spe.accountancy_code_sell'; $sql .= ', spe.accountancy_code_buy, spe.accountancy_code_sell';
} }
$sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode';
$sql .= ', s.fk_departement as state_id, s.fk_pays as country_id, s.fk_stcomm, s.remise_supplier, s.mode_reglement, s.cond_reglement, s.transport_mode'; $sql .= ', s.fk_departement as state_id, s.fk_pays as country_id, s.fk_stcomm, s.mode_reglement, s.cond_reglement, s.transport_mode';
$sql .= ', s.fk_account, s.tva_assuj'; $sql .= ', s.fk_account, s.tva_assuj';
$sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.transport_mode_supplier'; $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.transport_mode_supplier';
$sql .= ', s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo, s.logo_squarred'; $sql .= ', s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo, s.logo_squarred';
@ -1659,7 +1660,11 @@ class Societe extends CommonObject
$sql .= ', st.libelle as stcomm, st.picto as stcomm_picto'; $sql .= ', st.libelle as stcomm, st.picto as stcomm_picto';
$sql .= ', te.code as typent_code'; $sql .= ', te.code as typent_code';
$sql .= ', i.libelle as label_incoterms'; $sql .= ', i.libelle as label_incoterms';
$sql .= ', sr.remise_client, model_pdf'; if (empty($conf->multicompany->enabled)) {
$sql .= ', s.remise_client, s.remise_supplier';
} else {
$sql .= ', sr.remise_client, sr2.remise_supplier';
}
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
@ -1672,8 +1677,12 @@ class Societe extends CommonObject
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_regions as r ON d.fk_region = r.code_region '; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_regions as r ON d.fk_region = r.code_region ';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON s.fk_incoterms = i.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON s.fk_incoterms = i.rowid';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_remise as sr ON sr.rowid = (SELECT MAX(rowid) FROM '.MAIN_DB_PREFIX.'societe_remise WHERE fk_soc = s.rowid AND entity IN ('.getEntity('discount').'))'; // With default setup, llx_societe_remise is a history table in default setup and current value is in llx_societe.
// We use it for real value when multicompany is on. A better place would be into llx_societe_perentity.
if (!empty($conf->multicompany->enabled)) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_remise as sr ON sr.rowid = (SELECT MAX(rowid) FROM '.MAIN_DB_PREFIX.'societe_remise WHERE fk_soc = s.rowid AND entity IN ('.getEntity('discount').'))';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_remise_supplier as sr2 ON sr2.rowid = (SELECT MAX(rowid) FROM '.MAIN_DB_PREFIX.'societe_remise_supplier WHERE fk_soc = s.rowid AND entity IN ('.getEntity('discount').'))';
}
$sql .= ' WHERE s.entity IN ('.getEntity($this->element).')'; $sql .= ' WHERE s.entity IN ('.getEntity($this->element).')';
if ($rowid) { if ($rowid) {
$sql .= ' AND s.rowid = '.((int) $rowid); $sql .= ' AND s.rowid = '.((int) $rowid);
@ -1809,6 +1818,7 @@ class Societe extends CommonObject
$this->remise_percent = $obj->remise_client ? price2num($obj->remise_client) : 0; // 0.000000 must be 0 $this->remise_percent = $obj->remise_client ? price2num($obj->remise_client) : 0; // 0.000000 must be 0
$this->remise_supplier_percent = $obj->remise_supplier; $this->remise_supplier_percent = $obj->remise_supplier;
$this->mode_reglement_id = $obj->mode_reglement; $this->mode_reglement_id = $obj->mode_reglement;
$this->cond_reglement_id = $obj->cond_reglement; $this->cond_reglement_id = $obj->cond_reglement;
$this->transport_mode_id = $obj->transport_mode; $this->transport_mode_id = $obj->transport_mode;

View File

@ -6767,9 +6767,9 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
/* ============================================================================== */ /* ============================================================================== */
span.clipboardCPValue.hidewithsize { span.clipboardCPValue.hidewithsize {
width: 0 !important; width: 0 !important;
display: inline-block; display: inline-block;
color: transparent; color: transparent;
} }
.clipboardCPShowOnHover .clipboardCPButton { .clipboardCPShowOnHover .clipboardCPButton {

View File

@ -369,7 +369,7 @@ select.vmenusearchselectcombo {
background-color: unset; background-color: unset;
} }
textarea:focus, button:focus { textarea:focus {
/* v6 box-shadow: 0 0 4px #8091BF; */ /* v6 box-shadow: 0 0 4px #8091BF; */
border: 1px solid #aaa !important; border: 1px solid #aaa !important;
} }
@ -738,6 +738,9 @@ div.floatright
.largenumber { .largenumber {
font-size: 1.4em; font-size: 1.4em;
} }
button:focus {
outline: none;
}
th .button { th .button {
-webkit-box-shadow: none !important; -webkit-box-shadow: none !important;
@ -790,10 +793,19 @@ textarea.centpercent {
color: #777; color: #777;
} }
.flip {
transform: scaleX(-1) translate(2px, 0);
}
.rotate90 {
transform: rotate(90deg) translate(0, 2px);
}
.center { .center {
text-align: center; text-align: center;
margin: 0px auto; margin: 0px auto;
} }
.alignstart {
text-align: start;
}
.left { .left {
text-align: <?php print $left; ?>; text-align: <?php print $left; ?>;
} }
@ -3833,7 +3845,7 @@ tr.liste_titre_sel th, th.liste_titre_sel, tr.liste_titre_sel td, td.liste_titre
font-family: <?php print $fontlist ?>; font-family: <?php print $fontlist ?>;
font-weight: normal; font-weight: normal;
border-bottom: 1px solid #FDFFFF; border-bottom: 1px solid #FDFFFF;
text-decoration: underline; /* text-decoration: underline; */
} }
input.liste_titre { input.liste_titre {
background: transparent; background: transparent;
@ -4278,10 +4290,10 @@ div.divphotoref > a > .photowithmargin { /* Margin right for photo not inside a
.photowithborder { .photowithborder {
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
} }
.photointoolitp { .photointooltip {
margin-top: 8px; margin-top: 8px;
margin-bottom: 6px; margin-bottom: 6px;
text-align: center; text-align: center !important;
} }
.photodelete { .photodelete {
margin-top: 6px !important; margin-top: 6px !important;
@ -6611,9 +6623,9 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
/* ============================================================================== */ /* ============================================================================== */
span.clipboardCPValue.hidewithsize { span.clipboardCPValue.hidewithsize {
width: 0 !important; width: 0 !important;
display: inline-block; display: inline-block;
color: transparent; color: transparent;
} }
.clipboardCPShowOnHover .clipboardCPButton { .clipboardCPShowOnHover .clipboardCPButton {

View File

@ -1364,8 +1364,8 @@ if ($action == 'create' || $action == 'presend') {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
$newlang = $object->default_lang; $newlang = $object->default_lang;

View File

@ -2917,7 +2917,7 @@ class Ticket extends CommonObject
$sql = "SELECT p.rowid, p.ref, p.datec as datec"; $sql = "SELECT p.rowid, p.ref, p.datec as datec";
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p";
if (!$user->rights->societe->client->voir && !$user->socid) { if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$user->socid) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc";
$sql .= " WHERE sc.fk_user = ".$user->id; $sql .= " WHERE sc.fk_user = ".$user->id;
$clause = " AND"; $clause = " AND";

View File

@ -2795,10 +2795,10 @@ class User extends CommonObject
if (!empty($conf->global->LDAP_FIELD_USERID)) { if (!empty($conf->global->LDAP_FIELD_USERID)) {
$info[$conf->global->LDAP_FIELD_USERID] = $this->id; $info[$conf->global->LDAP_FIELD_USERID] = $this->id;
} }
if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) { if (!empty($conf->global->LDAP_FIELD_GROUPID)) {
$usergroup = new UserGroup($this->db); $usergroup = new UserGroup($this->db);
$groupslist = $usergroup->listGroupsForUser($this->id); $groupslist = $usergroup->listGroupsForUser($this->id);
$info[$conf->global->LDAP_FIELD_GROUPID] = '1'; $info[$conf->global->LDAP_FIELD_GROUPID] = '65534';
if (!empty($groupslist)) { if (!empty($groupslist)) {
foreach ($groupslist as $groupforuser) { foreach ($groupslist as $groupforuser) {
$info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list
@ -2806,8 +2806,8 @@ class User extends CommonObject
} }
} }
} }
if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) { if (!empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) {
$info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->login";
} }
return $info; return $info;

View File

@ -855,10 +855,10 @@ class UserGroup extends CommonObject
$valueofldapfield[] = $muser->_load_ldap_dn($info2); $valueofldapfield[] = $muser->_load_ldap_dn($info2);
} }
$info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield) ? $valueofldapfield : ''); $info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield) ? $valueofldapfield : '');
} }
if (!empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID])) { if (!empty($conf->global->LDAP_GROUP_FIELD_GROUPID)) {
$info[$conf->global->LDAP_GROUP_FIELD_GROUPID] = $this->id; $info[$conf->global->LDAP_GROUP_FIELD_GROUPID] = $this->id;
} }
return $info; return $info;
} }

View File

@ -138,7 +138,11 @@ if (empty($reshook)) {
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$object->entity = 0; $object->entity = 0;
} else { } else {
$object->entity = GETPOST("entity"); if ($conf->entity == 1 && $user->admin && !$user->entity) { // Same permissions test than the one used to show the combo of entities into the form
$object->entity = GETPOSTISSET("entity") ? GETPOST("entity") : $conf->entity;
} else {
$object->entity = $conf->entity;
}
} }
$db->begin(); $db->begin();

View File

@ -67,8 +67,8 @@ if ($action == 'dolibarr2ldap') {
if ($result > 0) { if ($result > 0) {
$info = $object->_load_ldap_info(); $info = $object->_load_ldap_info();
// Get a gid number for objectclass PosixGroup // Get a gid number for objectclass PosixGroup if none was provided
if (in_array('posixGroup', $info['objectclass'])) { if (empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID]) && in_array('posixGroup', $info['objectclass'])) {
$info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS'); $info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS');
} }

View File

@ -2390,6 +2390,18 @@ if ($action == 'generatesitemaps' && $usercanedit) {
} }
} }
// Now add sitempas extension for news
// TODO When adding and when not ?
/*<news:news>
<news:publication>
<news:name>The Example Times</news:name>
<news:language>en</news:language>
</news:publication>
<news:publication_date>2008-12-23</news:publication_date>
<news:title>Companies A, B in Merger Talks</news:title>
</news:news>
*/
$root->appendChild($url); $root->appendChild($url);
$i++; $i++;
} }