Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/install/step5.php
	htdocs/langs/en_US/holiday.lang
	htdocs/public/payment/newpayment.php
	htdocs/public/stripe/newpayment.php
This commit is contained in:
Laurent Destailleur 2018-03-19 17:58:19 +01:00
commit 0c45760dd4
19 changed files with 193 additions and 172 deletions

View File

@ -627,8 +627,8 @@ if ($action == 'exportcsv') {
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Code_tiers") . '"' . $sep;
print '"' . utf8_decode ( dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Code_tiers") . '"' . $sep;
print '"' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . utf8_decode ( dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep;
print '"' . $journal . '"' ;
@ -694,7 +694,7 @@ if ($action == 'exportcsv') {
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Code_tiers") . '"' . $sep;
print '"' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . utf8_decode ( dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . ' NPR"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep;

View File

@ -578,8 +578,8 @@ if ($action == 'exportcsv') {
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Code_tiers") . '"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Code_tiers") . '"' . $sep;
print '"' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . $journal . '"';

View File

@ -1457,7 +1457,7 @@ class Form
* @param int $force_entity 0 or Id of environment to force
* @param int $maxlength Maximum length of string into list (0=no limit)
* @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
* @param string $morefilter Add more filters into sql request
* @param string $morefilter Add more filters into sql request (Example: 'employee = 1')
* @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list
* @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty.
* @param string $morecss More css
@ -1530,7 +1530,6 @@ class Form
$sql.= " ORDER BY u.lastname ASC";
}
dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)

View File

@ -738,6 +738,10 @@ class Ldap
*/
function serverPing($host, $port=389, $timeout=1)
{
// Replace ldaps:// by ssl://
if (preg_match('/^ldaps:\/\/([^\/]+)\/?$/',$host, $regs)) {
$host = 'ssl://'.$regs[1];
}
$op = @fsockopen($host, $port, $errno, $errstr, $timeout);
if (!$op) return false; //DC is N/A
else {

View File

@ -593,7 +593,7 @@ if (empty($reshook))
// FROM
$expediteur = new User($db);
$expediteur->fetch($object->fk_user_valid);
$expediteur->fetch($object->fk_user_approve > 0 ? $object->fk_user_approve : $object->fk_user_validator);
$emailFrom = $expediteur->email;
if ($emailFrom && $emailTo)

View File

@ -44,7 +44,6 @@ class ExpenseReport extends CommonObject
public $date_fin;
var $fk_user_validator;
var $status;
var $fk_statut; // -- 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied
var $fk_c_paiement;
@ -78,14 +77,16 @@ class ExpenseReport extends CommonObject
var $detail_cancel;
var $fk_user_cancel;
var $fk_user_validator; // User that is defined to approve
// Validation
var $date_valid;
var $date_valid; // User making validation
var $fk_user_valid;
var $user_valid_infos;
// Approve
var $date_approve;
var $fk_user_approve;
var $fk_user_approve; // User that has approved
// Paiement
var $user_paid_infos;
@ -179,6 +180,7 @@ class ExpenseReport extends CommonObject
$sql.= ",date_create";
$sql.= ",fk_user_author";
$sql.= ",fk_user_validator";
$sql.= ",fk_user_approve";
$sql.= ",fk_user_modif";
$sql.= ",fk_statut";
$sql.= ",fk_c_paiement";
@ -196,6 +198,7 @@ class ExpenseReport extends CommonObject
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ", ".$fuserid;
$sql.= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null");
$sql.= ", ".($this->fk_user_approve > 0 ? $this->fk_user_approve:"null");
$sql.= ", ".($this->fk_user_modif > 0 ? $this->fk_user_modif:"null");
$sql.= ", ".($this->fk_statut > 1 ? $this->fk_statut:0);
$sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null");
@ -386,6 +389,7 @@ class ExpenseReport extends CommonObject
}
$sql.= " , fk_user_validator = ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null");
$sql.= " , fk_user_valid = ".($this->fk_user_valid > 0 ? $this->fk_user_valid:"null");
$sql.= " , fk_user_approve = ".($this->fk_user_approve > 0 ? $this->fk_user_approve:"null");
$sql.= " , fk_user_modif = ".$user->id;
$sql.= " , fk_statut = ".($this->fk_statut >= 0 ? $this->fk_statut:'0');
$sql.= " , fk_c_paiement = ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null");
@ -495,7 +499,8 @@ class ExpenseReport extends CommonObject
$this->user_author_infos = dolGetFirstLastname($user_author->firstname, $user_author->lastname);
$user_approver = new User($this->db);
if ($this->fk_user_validator > 0) $user_approver->fetch($this->fk_user_validator);
if ($this->fk_user_approve > 0) $user_approver->fetch($this->fk_user_approve);
elseif ($this->fk_user_validator > 0) $user_approver->fetch($this->fk_user_validator); // For backward compatibility
$this->user_validator_infos = dolGetFirstLastname($user_approver->firstname, $user_approver->lastname);
$this->fk_statut = $obj->status;
@ -744,9 +749,9 @@ class ExpenseReport extends CommonObject
$this->fk_statut = 5;
$this->fk_user_author = $user->id;
$this->fk_user_validator = $user->id;
$this->fk_user_valid = $user->id;
$this->fk_user_approve = $user->id;
$this->fk_user_validator = $user->id;
$this->note_private='Private note';
$this->note_public='SPECIMEN';

View File

@ -814,21 +814,27 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" onsubmit="return valider()" name="demandeCP">'."\n";
print '<input type="hidden" name="action" value="create" />'."\n";
dol_fiche_head('', '', '', -1);
if (empty($conf->global->HOLIDAY_HIDE_BALANCE))
{
dol_fiche_head('', '', '', -1);
$out='';
$typeleaves=$object->getTypes(1,1);
foreach($typeleaves as $key => $val)
{
$nb_type = $object->getCPforUser($user->id, $val['rowid']);
$nb_holiday += $nb_type;
$out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>';
}
print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'<br>';
print $out;
dol_fiche_end();
$out='';
$typeleaves=$object->getTypes(1,1);
foreach($typeleaves as $key => $val)
{
$nb_type = $object->getCPforUser($user->id, $val['rowid']);
$nb_holiday += $nb_type;
$out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>';
}
print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'<br>';
print $out;
dol_fiche_end();
}
elseif(! is_numeric($conf->global->HOLIDAY_HIDE_BALANCE))
{
print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).'<br>';
}
dol_fiche_head();
@ -846,7 +852,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
print $form->select_dolusers($fuserid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '<input type="hidden" name="fuserid" value="'.($fuserid?$fuserid:$user->id).'">';
}
else print $form->select_dolusers(GETPOST('fuserid','int')?GETPOST('fuserid','int'):$user->id,'fuserid',0,'',0);
else print $form->select_dolusers(GETPOST('fuserid','int')?GETPOST('fuserid','int'):$user->id, 'fuserid', 0, '', 0, '', '', 0, 0, 0, 'AND employee = 1');
print '</td>';
print '</tr>';
@ -858,11 +864,11 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
$arraytypeleaves=array();
foreach($typeleaves as $key => $val)
{
$labeltoshow = $val['label'];
$labeltoshow = ($langs->trans($val['code'])!=$val['code'] ? $langs->trans($val['code']) : $val['label']);
$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')':'');
$arraytypeleaves[$val['rowid']]=$labeltoshow;
}
print $form->selectarray('type', $arraytypeleaves, (GETPOST('type')?GETPOST('type'):''), 1);
print $form->selectarray('type', $arraytypeleaves, (GETPOST('type','alpha')?GETPOST('type','alpha'):''), 1);
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
print '</td>';
print '</tr>';
@ -878,11 +884,11 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
if (! GETPOST('date_debut_')) {
$form->select_date(-1, 'date_debut_', 0, 0, 0, '', 1, 1);
} else {
$tmpdate = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'));
$tmpdate = dol_mktime(0, 0, 0, GETPOST('date_debut_month','int'), GETPOST('date_debut_day','int'), GETPOST('date_debut_year','int'));
$form->select_date($tmpdate, 'date_debut_', 0, 0, 0, '', 1, 1);
}
print ' &nbsp; &nbsp; ';
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday')?GETPOST('starthalfday'):'morning'));
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday','alpha')?GETPOST('starthalfday','alpha'):'morning'));
print '</td>';
print '</tr>';
@ -897,11 +903,11 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
if (! GETPOST('date_fin_')) {
$form->select_date(-1,'date_fin_', 0, 0, 0, '', 1, 1);
} else {
$tmpdate = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'));
$tmpdate = dol_mktime(0, 0, 0, GETPOST('date_fin_month','int'), GETPOST('date_fin_day','int'), GETPOST('date_fin_year','int'));
$form->select_date($tmpdate,'date_fin_', 0, 0, 0, '', 1, 1);
}
print ' &nbsp; &nbsp; ';
print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday')?GETPOST('endhalfday'):'afternoon'));
print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday','alpha')?GETPOST('endhalfday','alpha'):'afternoon'));
print '</td>';
print '</tr>';
@ -909,7 +915,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
print '<tr>';
print '<td class="fieldrequired">'.$langs->trans("ReviewedByCP").'</td>';
print '<td>';
print $form->select_dolusers((GETPOST('valideur')>0?GETPOST('valideur'):$user->fk_user), "valideur", 1, ($user->admin ? '' : array($user->id)), 0, '', 0, 0, 0, 0, '', 0, '', '', 1); // By default, hierarchical parent
print $form->select_dolusers((GETPOST('valideur','int')>0?GETPOST('valideur','int'):$user->fk_user), "valideur", 1, ($user->admin ? '' : array($user->id)), 0, '', 0, 0, 0, 0, '', 0, '', '', 1); // By default, hierarchical parent
print '</td>';
print '</tr>';
@ -917,7 +923,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
print '<tr>';
print '<td>'.$langs->trans("DescCP").'</td>';
print '<td class="tdtop">';
$doleditor = new DolEditor('description', GETPOST('description'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
$doleditor = new DolEditor('description', GETPOST('description','none'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
print $doleditor->Create(1);
print '</td></tr>';
@ -1076,7 +1082,8 @@ else
print '<td>'.$langs->trans("Type").'</td>';
print '<td>';
$typeleaves=$object->getTypes(1,-1);
print empty($typeleaves[$object->fk_type]['label']) ? $langs->trans("TypeWasDisabledOrRemoved",$object->fk_type) : $typeleaves[$object->fk_type]['label'];
$labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code'])!=$typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']);
print empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved",$object->fk_type) : $labeltoshow;
print '</td>';
print '</tr>';
@ -1086,7 +1093,7 @@ else
if(!$edit)
{
print '<tr>';
print '<td>'.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')</td>';
print '<td class="nowrap">'.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')</td>';
print '<td>'.dol_print_date($object->date_debut,'day');
print ' &nbsp; &nbsp; ';
print '<span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).'</span>';
@ -1096,7 +1103,7 @@ else
else
{
print '<tr>';
print '<td>'.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')</td>';
print '<td class="nowrap">'.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')</td>';
print '<td>';
$form->select_date($object->date_debut,'date_debut_');
print ' &nbsp; &nbsp; ';
@ -1108,7 +1115,7 @@ else
if (!$edit)
{
print '<tr>';
print '<td>'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')</td>';
print '<td class="nowrap">'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')</td>';
print '<td>'.dol_print_date($object->date_fin,'day');
print ' &nbsp; &nbsp; ';
print '<span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).'</span>';
@ -1118,7 +1125,7 @@ else
else
{
print '<tr>';
print '<td>'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')</td>';
print '<td class="nowrap">'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')</td>';
print '<td>';
$form->select_date($object->date_fin,'date_fin_');
print ' &nbsp; &nbsp; ';
@ -1183,11 +1190,14 @@ else
// Validator
if (!$edit) {
print '<tr>';
print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';
print '<td class="titlefield">';
if ($object->statut == 3 || $object->statut == 4) print $langs->trans('ApprovedBy');
else print $langs->trans('ReviewedByCP');
print '</td>';
print '<td>'.$valideur->getNomUrl(-1).'</td>';
print '</tr>';
} else {
print '<tr>';
print '<tr>';
print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';
print '<td>';
print $form->select_dolusers($object->fk_validator, "valideur", 1, ($user->admin ? '' : array($user->id))); // By default, hierarchical parent
@ -1199,10 +1209,10 @@ else
print '<td>'.$langs->trans('DateCreateCP').'</td>';
print '<td>'.dol_print_date($object->date_create,'dayhour').'</td>';
print '</tr>';
if ($object->statut == 3) {
if ($object->statut == 3 || $object->statut == 4) {
print '<tr>';
print '<td>'.$langs->trans('DateValidCP').'</td>';
print '<td>'.dol_print_date($object->date_valid,'dayhour').'</td>';
print '<td>'.dol_print_date($object->date_valid,'dayhour').'</td>'; // warning: date_valid is approval date on holiday module
print '</tr>';
}
if ($object->statut == 4) {

View File

@ -957,10 +957,11 @@ class Holiday extends CommonObject
/**
* Affiche un select HTML des statuts de congés payés
*
* @param int $selected int du statut séléctionné par défaut
* @return string affiche le select des statuts
* @param int $selected Id of preselected status
* @param string $select_statut Name of HTML select field
* @return string Show select of status
*/
function selectStatutCP($selected='') {
function selectStatutCP($selected='', $htmlname='select_statut') {
global $langs;
@ -969,7 +970,7 @@ class Holiday extends CommonObject
$nb = count($name)+1;
// Select HTML
$statut = '<select name="select_statut" class="flat">'."\n";
$statut = '<select name="'.$htmlname.'" class="flat">'."\n";
$statut.= '<option value="-1">&nbsp;</option>'."\n";
// Boucle des statuts

View File

@ -286,7 +286,8 @@ else
{
foreach($typeleaves as $key => $val)
{
print_liste_field_titre($val['label'], $_SERVER["PHP_SELF"], '', '', '', 'align="center"');
$labeltype = ($langs->trans($val['code'])!=$val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']);
print_liste_field_titre($labeltype, $_SERVER["PHP_SELF"], '', '', '', 'align="center"');
}
}
else

View File

@ -73,18 +73,21 @@ if (! $sortorder) $sortorder="DESC";
$id = GETPOST('id','int');
$sall = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
$search_ref = GETPOST('search_ref');
$month_create = GETPOST('month_create');
$year_create = GETPOST('year_create');
$month_start = GETPOST('month_start');
$year_start = GETPOST('year_start');
$month_end = GETPOST('month_end');
$year_end = GETPOST('year_end');
$search_employee = GETPOST('search_employee');
$search_valideur = GETPOST('search_valideur');
$search_statut = GETPOST('select_statut');
$search_type = GETPOST('search_type','int');
$sall = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
$search_ref = GETPOST('search_ref','alpha');
$search_day_create = GETPOST('search_day_create','int');
$search_month_create = GETPOST('search_month_create','int');
$search_year_create = GETPOST('search_year_create','int');
$search_day_start = GETPOST('search_day_start','int');
$search_month_start = GETPOST('search_month_start','int');
$search_year_start = GETPOST('search_year_start','int');
$search_day_end = GETPOST('search_day_end','int');
$search_month_end = GETPOST('search_month_end','int');
$search_year_end = GETPOST('search_year_end','int');
$search_employee = GETPOST('search_employee','int');
$search_valideur = GETPOST('search_valideur','int');
$search_statut = GETPOST('search_statut','int');
$search_type = GETPOST('search_type','int');
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
@ -115,12 +118,12 @@ if (empty($reshook))
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_ref="";
$month_create="";
$year_create="";
$month_start="";
$year_start="";
$month_end="";
$year_end="";
$search_month_create="";
$search_year_create="";
$search_month_start="";
$search_year_start="";
$search_month_end="";
$search_year_end="";
$search_employee="";
$search_valideur="";
$search_statut="";
@ -178,47 +181,47 @@ if(!empty($search_ref))
}
// Start date
if($year_start > 0) {
if($month_start > 0) {
$filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($year_start,$month_start,1))."' AND '".$db->idate(dol_get_last_day($year_start,$month_start,1))."')";
//$filter.= " AND date_format(cp.date_debut, '%Y-%m') = '$year_start-$month_start'";
if($search_year_start > 0) {
if($search_month_start > 0) {
$filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($search_year_start,$search_month_start,1))."' AND '".$db->idate(dol_get_last_day($search_year_start,$search_month_start,1))."')";
//$filter.= " AND date_format(cp.date_debut, '%Y-%m') = '$search_year_start-$search_month_start'";
} else {
$filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($year_start,1,1))."' AND '".$db->idate(dol_get_last_day($year_start,12,1))."')";
//$filter.= " AND date_format(cp.date_debut, '%Y') = '$year_start'";
$filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($search_year_start,1,1))."' AND '".$db->idate(dol_get_last_day($search_year_start,12,1))."')";
//$filter.= " AND date_format(cp.date_debut, '%Y') = '$search_year_start'";
}
} else {
if($month_start > 0) {
$filter.= " AND date_format(cp.date_debut, '%m') = '".$db->escape($month_start)."'";
if($search_month_start > 0) {
$filter.= " AND date_format(cp.date_debut, '%m') = '".$db->escape($search_month_start)."'";
}
}
// End date
if($year_end > 0) {
if($month_end > 0) {
$filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($year_end,$month_end,1))."' AND '".$db->idate(dol_get_last_day($year_end,$month_end,1))."')";
//$filter.= " AND date_format(cp.date_fin, '%Y-%m') = '$year_end-$month_end'";
if($search_year_end > 0) {
if($search_month_end > 0) {
$filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($search_year_end,$search_month_end,1))."' AND '".$db->idate(dol_get_last_day($search_year_end,$search_month_end,1))."')";
//$filter.= " AND date_format(cp.date_fin, '%Y-%m') = '$search_year_end-$search_month_end'";
} else {
$filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($year_end,1,1))."' AND '".$db->idate(dol_get_last_day($year_end,12,1))."')";
//$filter.= " AND date_format(cp.date_fin, '%Y') = '$year_end'";
$filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($search_year_end,1,1))."' AND '".$db->idate(dol_get_last_day($search_year_end,12,1))."')";
//$filter.= " AND date_format(cp.date_fin, '%Y') = '$search_year_end'";
}
} else {
if($month_end > 0) {
$filter.= " AND date_format(cp.date_fin, '%m') = '".$db->escape($month_end)."'";
if($search_month_end > 0) {
$filter.= " AND date_format(cp.date_fin, '%m') = '".$db->escape($search_month_end)."'";
}
}
// Create date
if($year_create > 0) {
if($month_create > 0) {
$filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($year_create,$month_create,1))."' AND '".$db->idate(dol_get_last_day($year_create,$month_create,1))."')";
//$filter.= " AND date_format(cp.date_create, '%Y-%m') = '$year_create-$month_create'";
if($search_year_create > 0) {
if($search_month_create > 0) {
$filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($search_year_create,$search_month_create,1))."' AND '".$db->idate(dol_get_last_day($search_year_create,$search_month_create,1))."')";
//$filter.= " AND date_format(cp.date_create, '%Y-%m') = '$search_year_create-$search_month_create'";
} else {
$filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($year_create,1,1))."' AND '".$db->idate(dol_get_last_day($year_create,12,1))."')";
//$filter.= " AND date_format(cp.date_create, '%Y') = '$year_create'";
$filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($search_year_create,1,1))."' AND '".$db->idate(dol_get_last_day($search_year_create,12,1))."')";
//$filter.= " AND date_format(cp.date_create, '%Y') = '$search_year_create'";
}
} else {
if($month_create > 0) {
$filter.= " AND date_format(cp.date_create, '%m') = '".$db->escape($month_create)."'";
if($search_month_create > 0) {
$filter.= " AND date_format(cp.date_create, '%m') = '".$db->escape($search_month_create)."'";
}
}
@ -289,9 +292,23 @@ $num = count($holiday->holiday);
$arrayofselected=is_array($toselect)?$toselect:array();
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_day_create) $param.='&search_day_create='.urlencode($search_day_create);
if ($search_month_create) $param.='&search_month_create='.urlencode($search_month_create);
if ($search_year_create) $param.='&search_year_create='.urlencode($search_year_create);
if ($search_search_day_start) $param.='&search_day_start='.urlencode($search_day_start);
if ($search_month_start) $param.='&search_month_start='.urlencode($search_month_start);
if ($search_year_start) $param.='&search_year_start='.urlencode($search_year_start);
if ($day_end) $param.='&day_end='.urlencode($day_end);
if ($search_month_end) $param.='&search_month_end='.urlencode($search_month_end);
if ($search_year_end) $param.='&search_year_end='.urlencode($search_year_end);
if ($search_employee > 0) $param.='&search_employee='.urlencode($search_employee);
if ($search_valideur > 0) $param.='&search_valideur='.urlencode($search_valideur);
if ($search_type > 0) $param.='&search_type='.urlencode($search_type);
if ($search_statut > 0) $param.='&search_statut='.urlencode($search_statut);
// List of mass actions available
$arrayofmassactions = array(
@ -380,8 +397,8 @@ print '</td>';
// Create date
print '<td class="liste_titre" align="center">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_create" value="'.dol_escape_htmltag($month_create).'">';
$formother->select_year($year_create,'year_create',1, $min_year, 0);
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month_create" value="'.dol_escape_htmltag($search_month_create).'">';
$formother->select_year($search_year_create,'search_year_create',1, $min_year, 0);
print '</td>';
// User
@ -423,7 +440,7 @@ $typeleaves=$holidaystatic->getTypes(1,-1);
$arraytypeleaves=array();
foreach($typeleaves as $key => $val)
{
$labeltoshow = $val['label'];
$labeltoshow = ($langs->trans($val['code'])!=$val['code'] ? $langs->trans($val['code']) : $val['label']);
//$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')':'');
$arraytypeleaves[$val['rowid']]=$labeltoshow;
}
@ -435,19 +452,19 @@ print '<td class="liste_titre">&nbsp;</td>';
// Start date
print '<td class="liste_titre" align="center">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_start" value="'.dol_escape_htmltag($month_start).'">';
$formother->select_year($year_start,'year_start',1, $min_year, $max_year);
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month_start" value="'.dol_escape_htmltag($search_month_start).'">';
$formother->select_year($search_year_start,'search_year_start',1, $min_year, $max_year);
print '</td>';
// End date
print '<td class="liste_titre" align="center">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.dol_escape_htmltag($month_end).'">';
$formother->select_year($year_end,'year_end',1, $min_year, $max_year);
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month_end" value="'.dol_escape_htmltag($search_month_end).'">';
$formother->select_year($search_year_end,'search_year_end',1, $min_year, $max_year);
print '</td>';
// Status
print '<td class="liste_titre maxwidthonsmartphone maxwidth200" align="right">';
$holiday->selectStatutCP($search_statut);
$holiday->selectStatutCP($search_statut, 'search_statut');
print '</td>';
// Actions
@ -468,7 +485,7 @@ print_liste_field_titre("Duration",$_SERVER["PHP_SELF"],'','',$pram,'align="righ
print_liste_field_titre("DateDebCP",$_SERVER["PHP_SELF"],"cp.date_debut","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("DateFinCP",$_SERVER["PHP_SELF"],"cp.date_fin","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"cp.statut","",$param,'align="right"',$sortfield,$sortorder);
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'',$param,'align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
print "</tr>\n";
$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon"));
@ -516,7 +533,8 @@ if (! empty($holiday->holiday))
print '<td>'.$userstatic->getNomUrl(-1, 'leave').'</td>';
print '<td>'.$approbatorstatic->getNomUrl(-1).'</td>';
print '<td>';
print empty($typeleaves[$infos_CP['fk_type']]['label']) ? $langs->trans("TypeWasDisabledOrRemoved",$infos_CP['fk_type']) : $typeleaves[$infos_CP['fk_type']]['label'];
$labeltypeleavetoshow = ($langs->trans($typeleaves[$infos_CP['fk_type']]['code'])!=$typeleaves[$infos_CP['fk_type']]['code'] ? $langs->trans($typeleaves[$infos_CP['fk_type']]['code']) : $typeleaves[$infos_CP['fk_type']]['label']);
print empty($typeleaves[$infos_CP['fk_type']]['label']) ? $langs->trans("TypeWasDisabledOrRemoved",$infos_CP['fk_type']) : $labeltypeleavetoshow;
print '</td>';
print '<td align="right">';
$nbopenedday=num_open_day($infos_CP['date_debut_gmt'], $infos_CP['date_fin_gmt'], 0, 1, $infos_CP['halfday']);

View File

@ -117,7 +117,7 @@ foreach($cp->logs as $logs_CP)
print '<td>'.$user_update->getNomUrl(-1).'</td>';
print '<td>'.$logs_CP['type_action'].'</td>';
print '<td>';
$label=$alltypeleaves[$logs_CP['fk_type']]['label'];
$label = (($alltypeleaves[$logs_CP['fk_type']]['code'] && $langs->trans($alltypeleaves[$logs_CP['fk_type']]['code'])!=$alltypeleaves[$logs_CP['fk_type']]['code']) ? $langs->trans($alltypeleaves[$logs_CP['fk_type']]['code']) : $alltypeleaves[$logs_CP['fk_type']]['label']);
print $label?$label:$logs_CP['fk_type'];
print '</td>';
print '<td style="text-align: right;">'.price2num($logs_CP['prev_solde'],5).' '.$langs->trans('days').'</td>';

View File

@ -130,27 +130,34 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
if (! empty($conf->holiday->enabled))
{
$user_id = $user->id;
if (empty($conf->global->HOLIDAY_HIDE_BALANCE))
{
$user_id = $user->id;
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("Holidays").'</th></tr>';
print "<tr ".$bc[0].">";
print '<td colspan="3">';
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("Holidays").'</th></tr>';
print "<tr ".$bc[0].">";
print '<td colspan="3">';
$out='';
$typeleaves=$holiday->getTypes(1,1);
foreach($typeleaves as $key => $val)
{
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
$nb_holiday += $nb_type;
$out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>';
}
print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'<br>';
print $out;
$out='';
$typeleaves=$holiday->getTypes(1,1);
foreach($typeleaves as $key => $val)
{
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
$nb_holiday += $nb_type;
$out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>';
}
print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'<br>';
print $out;
print '</td>';
print '</tr>';
print '</table><br>';
print '</td>';
print '</tr>';
print '</table><br>';
}
elseif (! is_numeric($conf->global->HOLIDAY_HIDE_BALANCE))
{
print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).'<br>';
}
}

View File

@ -189,6 +189,8 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
else
dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities
}
dolibarr_install_syslog('step5: DATABASE_PWD_ENCRYPTED = '.$conf->global->DATABASE_PWD_ENCRYPTED.' MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO, LOG_INFO);
}
// Create user used to create the admin user

View File

@ -149,7 +149,6 @@ ACCOUNTING_SERVICE_SOLD_ACCOUNT=Accounting account by default for the sold servi
Doctype=Type of document
Docdate=Date
Docref=Reference
Code_tiers=Thirdparty
LabelAccount=Label account
LabelOperation=Label operation
Sens=Sens
@ -180,7 +179,7 @@ ProductAccountNotDefined=Account for product not defined
FeeAccountNotDefined=Account for fee not defined
BankAccountNotDefined=Account for bank not defined
CustomerInvoicePayment=Payment of invoice customer
ThirdPartyAccount=Thirdparty account
ThirdPartyAccount=Third party account
NewAccountingMvt=New transaction
NumMvts=Numero of transaction
ListeMvts=List of movements

View File

@ -91,7 +91,10 @@ LastHolidays=Latest %s leave requests
AllHolidays=All leave requests
HalfDay=Half day
NotTheAssignedApprover=You are not the assigned approver
LEAVE_PAID=Paid vacation
LEAVE_SICK=Sick leave
LEAVE_OTHER=Other leave
LEAVE_PAID_FR=Paid vacation
## Configuration du Module ##
LastUpdateCP=Latest automatic update of leaves allocation
MonthOfLastMonthlyUpdate=Month of latest automatic update of leaves allocation

View File

@ -21,17 +21,17 @@ ListToApprove=Waiting for approval
ExpensesArea=Expense reports area
ClassifyRefunded=Classify 'Refunded'
ExpenseReportWaitingForApproval=A new expense report has been submitted for approval
ExpenseReportWaitingForApprovalMessage=A new expense report has been submitted and is waiting for approval.\n - User: %s\n - Period: %s\nClick here to validate: %s
ExpenseReportWaitingForApprovalMessage=A new expense report has been submitted and is waiting for approval.<br> - User: %s<br> - Period: %s<br>Click here to validate: %s
ExpenseReportWaitingForReApproval=An expense report has been submitted for re-approval
ExpenseReportWaitingForReApprovalMessage=An expense report has been submitted and is waiting for re-approval.\nThe %s, you refused to approve the expense report for this reason: %s.\nA new version has been proposed and waiting for your approval.\n - User: %s\n - Period: %s\nClick here to validate: %s
ExpenseReportWaitingForReApprovalMessage=An expense report has been submitted and is waiting for re-approval.<br>The %s, you refused to approve the expense report for this reason: %s.<br>A new version has been proposed and waiting for your approval.<br> - User: %s<br> - Period: %s<br>Click here to validate: %s
ExpenseReportApproved=An expense report was approved
ExpenseReportApprovedMessage=The expense report %s was approved.\n - User: %s\n - Approved by: %s\nClick here to show the expense report: %s
ExpenseReportApprovedMessage=The expense report %s was approved.<br> - User: %s<br> - Approved by: %s<br>Click here to show the expense report: %s
ExpenseReportRefused=An expense report was refused
ExpenseReportRefusedMessage=The expense report %s was refused.\n - User: %s\n - Refused by: %s\n - Motive for refusal: %s\nClick here to show the expense report: %s
ExpenseReportRefusedMessage=The expense report %s was refused.<br> - User: %s<br> - Refused by: %s<br> - Motive for refusal: %s<br>Click here to show the expense report: %s
ExpenseReportCanceled=An expense report was canceled
ExpenseReportCanceledMessage=The expense report %s was canceled.\n - User: %s\n - Canceled by: %s\n - Motive for cancellation: %s\nClick here to show the expense report: %s
ExpenseReportCanceledMessage=The expense report %s was canceled.<br> - User: %s<br> - Canceled by: %s<br> - Motive for cancellation: %s<br>Click here to show the expense report: %s
ExpenseReportPaid=An expense report was paid
ExpenseReportPaidMessage=The expense report %s was paid.\n - User: %s\n - Paid by: %s\nClick here to show the expense report: %s
ExpenseReportPaidMessage=The expense report %s was paid.<br> - User: %s<br> - Paid by: %s<br>Click here to show the expense report: %s
TripId=Id expense report
AnyOtherInThisListCanValidate=Person to inform for validation.
TripSociete=Information company

View File

@ -648,45 +648,13 @@ class Project extends CommonObject
}
}
// Delete tasks
if (! $error)
{
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task_time";
$sql.= " WHERE fk_task IN (SELECT rowid FROM " . MAIN_DB_PREFIX . "projet_task WHERE fk_projet=" . $this->id . ")";
// Fetch tasks
$this->getLinesArray($user);
$resql = $this->db->query($sql);
if (!$resql)
{
$this->errors[] = $this->db->lasterror();
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task_extrafields";
$sql.= " WHERE fk_object IN (SELECT rowid FROM " . MAIN_DB_PREFIX . "projet_task WHERE fk_projet=" . $this->id . ")";
$resql = $this->db->query($sql);
if (!$resql)
{
$this->errors[] = $this->db->lasterror();
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task";
$sql.= " WHERE fk_projet=" . $this->id;
$resql = $this->db->query($sql);
if (!$resql)
{
$this->errors[] = $this->db->lasterror();
$error++;
}
}
// Delete tasks
foreach($this->lines as &$task) {
$task->delete($user);
}
// Delete project
if (! $error)

View File

@ -278,7 +278,9 @@ input.select2-input {
.liste_titre input[name=month_date_when], .liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre select[name=month],
.liste_titre input[name=month_lim], .liste_titre input[name=month_start], .liste_titre input[name=month_end], .liste_titre input[name=month_create],
.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when] {
.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when],
.liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end]
{
margin-right: 4px;
}
input[type=submit] {

View File

@ -291,7 +291,9 @@ textarea.cke_source:focus
.liste_titre input[name=month_date_when], .liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month],
.liste_titre input[name=month_lim], .liste_titre input[name=month_start], .liste_titre input[name=month_end], .liste_titre input[name=month_create],
.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when] {
.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when],
.liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end]
{
margin-right: 4px;
}
input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select {