Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
Conflicts: htdocs/compta/facture/list.php htdocs/holiday/card.php
This commit is contained in:
commit
b7af0cca63
@ -206,7 +206,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOS
|
|||||||
$search_state="";
|
$search_state="";
|
||||||
$search_type='';
|
$search_type='';
|
||||||
$search_country='';
|
$search_country='';
|
||||||
$search_type_thirdparty='';
|
$search_type_thirdparty='';
|
||||||
$day='';
|
$day='';
|
||||||
$year='';
|
$year='';
|
||||||
$month='';
|
$month='';
|
||||||
@ -229,7 +229,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -255,7 +255,7 @@ $sql.= " typent.code as typent_code,";
|
|||||||
$sql.= " state.code_departement as state_code, state.nom as state_name";
|
$sql.= " state.code_departement as state_code, state.nom as state_name";
|
||||||
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
|
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
|
||||||
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
|
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
|
||||||
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
|
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
@ -462,7 +462,7 @@ if ($resql)
|
|||||||
'presend'=>$langs->trans("SendByMail"),
|
'presend'=>$langs->trans("SendByMail"),
|
||||||
'builddoc'=>$langs->trans("PDFMerge")
|
'builddoc'=>$langs->trans("PDFMerge")
|
||||||
);
|
);
|
||||||
if ($user->rights->facture->supprimer)
|
if ($user->rights->facture->supprimer)
|
||||||
{
|
{
|
||||||
//if (! empty($conf->global->STOCK_CALCULATE_ON_BILL) || empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED))
|
//if (! empty($conf->global->STOCK_CALCULATE_ON_BILL) || empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED))
|
||||||
if (empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED))
|
if (empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED))
|
||||||
@ -479,6 +479,7 @@ if ($resql)
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
|
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
@ -492,8 +493,8 @@ if ($resql)
|
|||||||
if ($massaction == 'presend')
|
if ($massaction == 'presend')
|
||||||
{
|
{
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
|
|
||||||
if (! GETPOST('cancel'))
|
if (! GETPOST('cancel'))
|
||||||
{
|
{
|
||||||
$objecttmp=new Facture($db);
|
$objecttmp=new Facture($db);
|
||||||
$listofselectedid=array();
|
$listofselectedid=array();
|
||||||
@ -502,7 +503,7 @@ if ($resql)
|
|||||||
foreach($arrayofselected as $toselectid)
|
foreach($arrayofselected as $toselectid)
|
||||||
{
|
{
|
||||||
$result=$objecttmp->fetch($toselectid);
|
$result=$objecttmp->fetch($toselectid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$listofselectedid[$toselectid]=$toselectid;
|
$listofselectedid[$toselectid]=$toselectid;
|
||||||
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
||||||
@ -513,10 +514,10 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="hidden" name="massaction" value="confirm_presend">';
|
print '<input type="hidden" name="massaction" value="confirm_presend">';
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
|
|
||||||
dol_fiche_head(null, '', '');
|
dol_fiche_head(null, '', '');
|
||||||
|
|
||||||
$topicmail="SendBillRef";
|
$topicmail="SendBillRef";
|
||||||
@ -584,16 +585,16 @@ if ($resql)
|
|||||||
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||||
|
|
||||||
print $formmail->get_form();
|
print $formmail->get_form();
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the user can view prospects other than his'
|
// If the user can view prospects other than his'
|
||||||
$moreforfilter='';
|
$moreforfilter='';
|
||||||
if ($user->rights->societe->client->voir || $socid)
|
if ($user->rights->societe->client->voir || $socid)
|
||||||
@ -683,14 +684,14 @@ if ($resql)
|
|||||||
// Filters lines
|
// Filters lines
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
// Ref
|
// Ref
|
||||||
if (! empty($arrayfields['f.facnumber']['checked']))
|
if (! empty($arrayfields['f.facnumber']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Ref customer
|
// Ref customer
|
||||||
if (! empty($arrayfields['f.ref_client']['checked']))
|
if (! empty($arrayfields['f.ref_client']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" size="6" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
|
print '<input class="flat" size="6" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
|
||||||
@ -711,7 +712,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date invoice
|
// Date invoice
|
||||||
if (! empty($arrayfields['f.date']['checked']))
|
if (! empty($arrayfields['f.date']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
|
||||||
@ -720,7 +721,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date due
|
// Date due
|
||||||
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day_lim" value="'.$day_lim.'">';
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day_lim" value="'.$day_lim.'">';
|
||||||
@ -730,7 +731,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Thirpdarty
|
// Thirpdarty
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="6" name="search_societe" value="'.$search_societe.'"></td>';
|
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="6" name="search_societe" value="'.$search_societe.'"></td>';
|
||||||
}
|
}
|
||||||
@ -760,7 +761,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Payment mode
|
// Payment mode
|
||||||
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10);
|
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10);
|
||||||
@ -875,19 +876,19 @@ if ($resql)
|
|||||||
$totaldeposits = $facturestatic->getSumDepositsUsed();
|
$totaldeposits = $facturestatic->getSumDepositsUsed();
|
||||||
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
|
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
|
||||||
$remaintopay = $obj->total_ttc - $totalpay;
|
$remaintopay = $obj->total_ttc - $totalpay;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
if (! empty($arrayfields['f.facnumber']['checked']))
|
if (! empty($arrayfields['f.facnumber']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
|
|
||||||
print '<td class="nobordernopadding nowrap">';
|
print '<td class="nobordernopadding nowrap">';
|
||||||
print $facturestatic->getNomUrl(1,'',200,0,'',0,1);
|
print $facturestatic->getNomUrl(1,'',200,0,'',0,1);
|
||||||
print $obj->increment;
|
print $obj->increment;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||||
$filename=dol_sanitizeFileName($obj->facnumber);
|
$filename=dol_sanitizeFileName($obj->facnumber);
|
||||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
||||||
@ -896,7 +897,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1085,12 +1086,12 @@ if ($resql)
|
|||||||
// Status
|
// Status
|
||||||
if (! empty($arrayfields['f.fk_statut']['checked']))
|
if (! empty($arrayfields['f.fk_statut']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="right" class="nowrap">';
|
print '<td align="right" class="nowrap">';
|
||||||
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type);
|
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="nowrap" align="center">';
|
print '<td class="nowrap" align="center">';
|
||||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
@ -1101,7 +1102,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
print '</td>' ;
|
print '</td>' ;
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@ -1128,21 +1129,21 @@ if ($resql)
|
|||||||
else print '<td></td>';
|
else print '<td></td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -1150,11 +1151,11 @@ if ($resql)
|
|||||||
*/
|
*/
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||||
$urlsource.=str_replace('&','&',$param);
|
$urlsource.=str_replace('&','&',$param);
|
||||||
|
|
||||||
$filedir=$diroutputmassaction;
|
$filedir=$diroutputmassaction;
|
||||||
$genallowed=$user->rights->facture->lire;
|
$genallowed=$user->rights->facture->lire;
|
||||||
$delallowed=$user->rights->facture->lire;
|
$delallowed=$user->rights->facture->lire;
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
* Copyright (C) 2012-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2012-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
|
||||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2014-2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -41,7 +41,6 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
|||||||
$myparam = GETPOST("myparam");
|
$myparam = GETPOST("myparam");
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$id=GETPOST('id', 'int');
|
$id=GETPOST('id', 'int');
|
||||||
$userid = GETPOST('userid')?GETPOST('userid'):$user->id;
|
|
||||||
|
|
||||||
// Protection if external user
|
// Protection if external user
|
||||||
if ($user->societe_id > 0) accessforbidden();
|
if ($user->societe_id > 0) accessforbidden();
|
||||||
@ -61,7 +60,8 @@ if ($action == 'create')
|
|||||||
$object = new Holiday($db);
|
$object = new Holiday($db);
|
||||||
|
|
||||||
// If no right to create a request
|
// If no right to create a request
|
||||||
if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all)))
|
$fuserid = GETPOST('fuserid');
|
||||||
|
if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all)))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans('CantCreateCP'), null, 'errors');
|
setEventMessages($langs->trans('CantCreateCP'), null, 'errors');
|
||||||
@ -86,7 +86,6 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$valideur = GETPOST('valideur');
|
$valideur = GETPOST('valideur');
|
||||||
$description = trim(GETPOST('description'));
|
$description = trim(GETPOST('description'));
|
||||||
$userID = GETPOST('userID');
|
|
||||||
|
|
||||||
// If no type
|
// If no type
|
||||||
if ($type <= 0)
|
if ($type <= 0)
|
||||||
@ -576,27 +575,27 @@ if ($action == 'confirm_draft' && GETPOST('confirm') == 'yes')
|
|||||||
{
|
{
|
||||||
$object = new Holiday($db);
|
$object = new Holiday($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
$oldstatus = $object->statut;
|
$oldstatus = $object->statut;
|
||||||
$object->statut = 1;
|
$object->statut = 1;
|
||||||
|
|
||||||
$result = $object->update($user);
|
$result = $object->update($user);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error = $langs->trans('ErrorBackToDraft');
|
$error = $langs->trans('ErrorBackToDraft');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si Validation de la demande
|
// Si Validation de la demande
|
||||||
@ -722,7 +721,7 @@ llxHeader('', $langs->trans('CPTitreMenu'));
|
|||||||
if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create')
|
if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create')
|
||||||
{
|
{
|
||||||
// Si l'utilisateur n'a pas le droit de faire une demande
|
// Si l'utilisateur n'a pas le droit de faire une demande
|
||||||
if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all)))
|
if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all)))
|
||||||
{
|
{
|
||||||
$errors[]=$langs->trans('CantCreateCP');
|
$errors[]=$langs->trans('CantCreateCP');
|
||||||
}
|
}
|
||||||
@ -802,7 +801,6 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
|||||||
// Formulaire de demande
|
// Formulaire de demande
|
||||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" onsubmit="return valider()" name="demandeCP">'."\n";
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" onsubmit="return valider()" name="demandeCP">'."\n";
|
||||||
print '<input type="hidden" name="action" value="create" />'."\n";
|
print '<input type="hidden" name="action" value="create" />'."\n";
|
||||||
print '<input type="hidden" name="userID" value="'.$userid.'" />'."\n";
|
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
@ -833,10 +831,10 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
if (empty($user->rights->holiday->write_all))
|
if (empty($user->rights->holiday->write_all))
|
||||||
{
|
{
|
||||||
print $form->select_dolusers($userid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
print $form->select_dolusers($fuserid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||||
print '<input type="hidden" name="userid" value="'.$userid.'">';
|
print '<input type="hidden" name="fuserid" value="'.($fuserid?$fuserid:$user->id).'">';
|
||||||
}
|
}
|
||||||
else print $form->select_dolusers(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0);
|
else print $form->select_dolusers(GETPOST('fuserid')?GETPOST('fuserid'):$user->id,'fuserid',0,'',0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -1023,7 +1021,7 @@ else
|
|||||||
{
|
{
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("TitleSetToDraft"),$langs->trans("ConfirmSetToDraft"),"confirm_draft", '', 1, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("TitleSetToDraft"),$langs->trans("ConfirmSetToDraft"),"confirm_draft", '', 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$head=holiday_prepare_head($object);
|
$head=holiday_prepare_head($object);
|
||||||
|
|
||||||
|
|
||||||
@ -1038,14 +1036,14 @@ else
|
|||||||
dol_fiche_head($head,'card',$langs->trans("CPTitreMenu"),0,'holiday');
|
dol_fiche_head($head,'card',$langs->trans("CPTitreMenu"),0,'holiday');
|
||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/holiday/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback='<a href="'.DOL_URL_ROOT.'/holiday/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref');
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
|
|
||||||
@ -1147,9 +1145,9 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="fichehalfright">';
|
print '<div class="fichehalfright">';
|
||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
// Info workflow
|
// Info workflow
|
||||||
print '<table class="border centpercent">'."\n";
|
print '<table class="border centpercent">'."\n";
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
@ -1206,12 +1204,12 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="clearboth"></div>';
|
print '<div class="clearboth"></div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'edit' && $object->statut == 1)
|
if ($action == 'edit' && $object->statut == 1)
|
||||||
{
|
{
|
||||||
print '<div align="center">';
|
print '<div align="center">';
|
||||||
@ -1267,7 +1265,7 @@ else
|
|||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=backtodraft" class="butAction">'.$langs->trans("SetToDraft").'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=backtodraft" class="butAction">'.$langs->trans("SetToDraft").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,7 @@ ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
|||||||
ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL;
|
ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00';
|
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00';
|
||||||
|
|
||||||
-- Clean corrupted values for tms
|
-- Clean corrupted values for tms
|
||||||
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
|
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
|
||||||
@ -74,7 +74,7 @@ ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-
|
|||||||
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
|
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
|
||||||
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
|
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
|
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
||||||
@ -204,9 +204,14 @@ CREATE TABLE llx_payment_salary (
|
|||||||
fk_user_modif integer
|
fk_user_modif integer
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
|
||||||
|
DELETE FROM llx_product_batch where fk_product_stock NOT IN (SELECT rowid from llx_product_stock);
|
||||||
|
|
||||||
ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock);
|
ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock);
|
||||||
ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid);
|
ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid);
|
||||||
|
|
||||||
|
DELETE FROM llx_expeditiondet_batch where fk_expeditiondet NOT IN (SELECT rowid from llx_expeditiondet);
|
||||||
|
|
||||||
ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet);
|
ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet);
|
||||||
ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid);
|
ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid);
|
||||||
|
|
||||||
|
|||||||
@ -144,7 +144,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
elseif ($user->rights->facture->lire)
|
elseif ($user->rights->facture->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
|
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
|
||||||
$sql.= " f.facnumber, f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,";
|
$sql.= " f.facnumber, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,";
|
||||||
$sql.= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used
|
$sql.= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
@ -236,23 +236,24 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$var=True;
|
$var=True;
|
||||||
while ($i < min($num,$conf->liste_limit))
|
while ($i < min($num,$conf->liste_limit))
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$invoicestatic->id=$objp->facid;
|
||||||
|
$invoicestatic->ref=$objp->facnumber;
|
||||||
|
$societestatic->fetch($objp->socid);
|
||||||
|
$paiement = $invoicestatic->getSommePaiement();
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$invoicestatic->id=$objp->facid;
|
|
||||||
$invoicestatic->ref=$objp->facnumber;
|
|
||||||
print $invoicestatic->getNomUrl(1);
|
print $invoicestatic->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
$societestatic->fetch($objp->socid);
|
|
||||||
print '<td>'.$societestatic->getNomUrl(1).'</td>';
|
print '<td>'.$societestatic->getNomUrl(1).'</td>';
|
||||||
print "<td>".$objp->code_client."</td>\n";
|
print "<td>".$objp->code_client."</td>\n";
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($db->jdate($objp->datef),'day')."</td>";
|
print dol_print_date($db->jdate($objp->datef),'day')."</td>";
|
||||||
print '<td align="center">'.$objp->qty."</td>\n";
|
print '<td align="center">'.$objp->qty."</td>\n";
|
||||||
print '<td align="right">'.price($objp->total_ht)."</td>\n";
|
print '<td align="right">'.price($objp->total_ht)."</td>\n";
|
||||||
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5,$paiement,$objp->type).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user