Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0_bug
This commit is contained in:
commit
70a65b89eb
@ -277,7 +277,9 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Jquery plugin tableDnd updated. You now need to use decodeURI on the return value of tableDnDSerialize()
|
||||
and add 'td.' to the beginning of the dragHandle match string.
|
||||
* IE8 and earlier and Firefox 12 and earlier (< 2012) are no more supported.
|
||||
|
||||
* The module ExpenseReport use numbering rules that you can setup (like other modules do). If you need to
|
||||
keep the hard coded numbering rule of expenses report used in 6.0, just add constant
|
||||
EXPENSEREPORT_USE_OLD_NUMBERING_RULE to 1.
|
||||
* If you use the external module "multicompany", you must also upgrade the module. Multicompany module for
|
||||
Dolibarr v7 is required because with Dolibarr v7, payment modes and payment conditions are management as data
|
||||
that are dedicated to each company. If you keep your old version of multicompany module, mode and
|
||||
|
||||
@ -10,7 +10,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__;
|
||||
--
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__);
|
||||
|
||||
@ -108,8 +108,8 @@ class pdf_standard extends ModeleExpenseReport
|
||||
$this->posxdate=88;
|
||||
$this->posxtype=107;
|
||||
$this->posxprojet=120;
|
||||
$this->posxtva=136;
|
||||
$this->posxup=152;
|
||||
$this->posxtva=138;
|
||||
$this->posxup=154;
|
||||
$this->posxqty=168;
|
||||
$this->postotalttc=178;
|
||||
if (empty($conf->projet->enabled)) {
|
||||
@ -328,7 +328,7 @@ class pdf_standard extends ModeleExpenseReport
|
||||
$nextColumnPosX = $this->posxprojet;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, dol_trunc($outputlangs->transnoentities($object->lines[$i]->type_fees_code), 12), 0, 'C');
|
||||
$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, dol_trunc($outputlangs->transnoentities($object->lines[$i]->type_fees_code), 10), 0, 'C');
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
|
||||
@ -101,6 +101,59 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
|
||||
{
|
||||
global $db,$conf;
|
||||
|
||||
// For backward compatibility and restore old behavior to get ref of expense report
|
||||
if ($conf->global->EXPENSEREPORT_USE_OLD_NUMBERING_RULE)
|
||||
{
|
||||
$fuser = null;
|
||||
if ($object->fk_user_author > 0)
|
||||
{
|
||||
$fuser=new User($db);
|
||||
$fuser->fetch($object->fk_user_author);
|
||||
}
|
||||
|
||||
$expld_car = (empty($conf->global->NDF_EXPLODE_CHAR))?"-":$conf->global->NDF_EXPLODE_CHAR;
|
||||
$num_car = (empty($conf->global->NDF_NUM_CAR_REF))?"5":$conf->global->NDF_NUM_CAR_REF;
|
||||
|
||||
$sql = 'SELECT MAX(de.ref_number_int) as max';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport de';
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if($db->num_rows($result) > 0):
|
||||
$objp = $db->fetch_object($result);
|
||||
$newref = $objp->max;
|
||||
$newref++;
|
||||
while(strlen($newref) < $num_car):
|
||||
$newref = "0".$newref;
|
||||
endwhile;
|
||||
else:
|
||||
$newref = 1;
|
||||
while(strlen($newref) < $num_car):
|
||||
$newref = "0".$newref;
|
||||
endwhile;
|
||||
endif;
|
||||
|
||||
$ref_number_int = ($newref+1)-1;
|
||||
$update_number_int = true;
|
||||
|
||||
$user_author_infos = dolGetFirstLastname($fuser->firstname, $fuser->lastname);
|
||||
|
||||
$prefix="ER";
|
||||
if (! empty($conf->global->EXPENSE_REPORT_PREFIX)) $prefix=$conf->global->EXPENSE_REPORT_PREFIX;
|
||||
$newref = str_replace(' ','_', $user_author_infos).$expld_car.$prefix.$newref.$expld_car.dol_print_date($object->date_debut,'%y%m%d');
|
||||
|
||||
$sqlbis = 'UPDATE '.MAIN_DB_PREFIX.'expensereport SET ref_number_int = '.$ref_number_int.' WHERE rowid = '.$object->id;
|
||||
$resqlbis = $db->query($sqlbis);
|
||||
if (! $resqlbis)
|
||||
{
|
||||
dol_print_error($resqlbis);
|
||||
exit;
|
||||
}
|
||||
|
||||
dol_syslog("mod_expensereport_jade::getNextValue return ".$newref);
|
||||
return $newref;
|
||||
}
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
|
||||
@ -315,11 +315,16 @@ if (empty($reshook))
|
||||
|
||||
if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
$object = new ExpenseReport($db);
|
||||
$object->fetch($id);
|
||||
|
||||
$result = $object->setValidate($user);
|
||||
|
||||
if ($result > 0)
|
||||
if ($result >= 0)
|
||||
{
|
||||
// Define output language
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
@ -338,8 +343,13 @@ if (empty($reshook))
|
||||
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($result > 0 && $object->fk_user_validator > 0)
|
||||
if (! $error && $result > 0 && $object->fk_user_validator > 0)
|
||||
{
|
||||
$langs->load("mails");
|
||||
|
||||
@ -387,8 +397,6 @@ if (empty($reshook))
|
||||
{
|
||||
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($emailFrom,2),$mailfile->getValidAddress($emailTo,2));
|
||||
setEventMessages($mesg, null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -418,10 +426,17 @@ if (empty($reshook))
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer)
|
||||
@ -1955,7 +1970,7 @@ else
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="fk_expensereport" value="'.$object->id.'" />';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelines" class="noborder" width="100%">';
|
||||
|
||||
if (!empty($object->lines))
|
||||
@ -2014,7 +2029,10 @@ else
|
||||
print '</td>';
|
||||
}
|
||||
// print '<td style="text-align:center;">'.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).'</td>';
|
||||
print '<td style="text-align:center;">'.($langs->trans(($line->type_fees_code)) == $line->type_fees_code ? $line->type_fees_libelle : $langs->trans(($line->type_fees_code))).'</td>';
|
||||
print '<td style="text-align:center;">';
|
||||
$labeltype = ($langs->trans(($line->type_fees_code)) == $line->type_fees_code ? $line->type_fees_libelle : $langs->trans($line->type_fees_code));
|
||||
print $labeltype;
|
||||
print '</td>';
|
||||
print '<td style="text-align:left;">'.$line->comments.'</td>';
|
||||
print '<td style="text-align:right;">'.vatrate($line->vatrate,true).'</td>';
|
||||
print '<td style="text-align:right;">'.price($line->value_unit).'</td>';
|
||||
|
||||
@ -1091,7 +1091,7 @@ class ExpenseReport extends CommonObject
|
||||
{
|
||||
$num = $this->ref;
|
||||
}
|
||||
if (empty($num)) return -1;
|
||||
if (empty($num) || $num < 0) return -1;
|
||||
|
||||
$this->newref = $num;
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ ProductAccountancySellExportCode=Accounting code (sale export)
|
||||
ProductOrService=Product or Service
|
||||
ProductsAndServices=Products and Services
|
||||
ProductsOrServices=Products or Services
|
||||
ProductsPipeServices=Products | Services
|
||||
ProductsOnSaleOnly=Products for sale only
|
||||
ProductsOnPurchaseOnly=Products for purchase only
|
||||
ProductsNotOnSell=Products not for sale and not for purchase
|
||||
|
||||
@ -74,6 +74,7 @@ EX_CAM_VP=PV maintenance and repair
|
||||
DefaultCategoryCar=Default transportation mode
|
||||
DefaultRangeNumber=Default range number
|
||||
|
||||
Error_EXPENSEREPORT_ADDON_NotDefined=Error, the rule for expense report numbering ref was not defined into setup of module 'Expense Report'
|
||||
ErrorDoubleDeclaration=You have declared another expense report into a similar date range.
|
||||
AucuneLigne=There is no expense report declared yet
|
||||
|
||||
|
||||
@ -403,7 +403,7 @@ dol_fiche_end();
|
||||
|
||||
print '<div class="floatright right'.($conf->dol_optimize_smallscreen?' centpercent':'').'">'.$nav.'</div>'; // We move this before the assign to components so, the default submit button is not the assign to.
|
||||
|
||||
print '<div class="float valignmiddle">';
|
||||
print '<div class="colorback float valignmiddle">';
|
||||
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
|
||||
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
|
||||
print '<div class="taskiddiv inline-block">';
|
||||
@ -431,7 +431,7 @@ $moreforfilter='';
|
||||
|
||||
// If the user can view user other than himself
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('User'). ': ';
|
||||
$moreforfilter.='<div class="inline-block hideonsmartphone">'.$langs->trans('User'). ' </div>';
|
||||
$includeonly='hierachyme';
|
||||
if (empty($user->rights->user->user->lire)) $includeonly=array($user->id);
|
||||
$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
|
||||
@ -403,7 +403,7 @@ dol_fiche_end();
|
||||
|
||||
print '<div class="floatright right'.($conf->dol_optimize_smallscreen?' centpercent':'').'">'.$nav.'</div>'; // We move this before the assign to components so, the default submit button is not the assign to.
|
||||
|
||||
print '<div class="float valignmiddle">';
|
||||
print '<div class="colorback float valignmiddle">';
|
||||
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
|
||||
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
|
||||
print '<div class="taskiddiv inline-block">';
|
||||
@ -432,7 +432,7 @@ if (! empty($conf->categorie->enabled))
|
||||
|
||||
// If the user can view user other than himself
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('User'). ': ';
|
||||
$moreforfilter.='<div class="inline-block hideonsmartphone">'.$langs->trans('User'). ' </div>';
|
||||
$includeonly='hierachyme';
|
||||
if (empty($user->rights->user->user->lire)) $includeonly=array($user->id);
|
||||
$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
|
||||
@ -2792,6 +2792,12 @@ tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, tabl
|
||||
{
|
||||
height: 26px !important;
|
||||
}
|
||||
div.colorback
|
||||
{
|
||||
background: rgb(<?php echo $colorbacktitle1; ?>);
|
||||
padding: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr
|
||||
{
|
||||
background: rgb(<?php echo $colorbacktitle1; ?>);
|
||||
|
||||
@ -2483,6 +2483,12 @@ td.border, div.tagtable div div.border {
|
||||
.ficheaddleft table.noborder {
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
div.colorback
|
||||
{
|
||||
background: rgb(<?php echo $colorbacktitle1; ?>);
|
||||
padding: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.liste_titre_bydiv {
|
||||
border-right: 1px solid #ccc;
|
||||
border-left: 1px solid #ccc;
|
||||
|
||||
@ -1231,7 +1231,7 @@ else
|
||||
if ($mode == 'employee') // For HRM module development
|
||||
{
|
||||
$title = $langs->trans("Employee");
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/employee/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/employee/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1239,7 +1239,7 @@ else
|
||||
$linkback = '';
|
||||
|
||||
if ($user->rights->user->user->lire || $user->admin) {
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/user/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/user/index.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -796,7 +796,6 @@ class UserGroup extends CommonObject
|
||||
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small)
|
||||
* @param string $option On what the link point to ('nolink', )
|
||||
* @param integer $notooltip 1=Disable tooltip on picto and name
|
||||
* @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login
|
||||
* @param string $morecss Add more css on link
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
|
||||
@ -330,7 +330,9 @@ else
|
||||
{
|
||||
dol_fiche_head($head, 'group', $title, -1, 'group');
|
||||
|
||||
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/user/group/index.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
@ -105,7 +105,9 @@ $head = group_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'ldap', $langs->trans("Group"), -1, 'group');
|
||||
|
||||
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/user/group/index.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object,'id',$linback,$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
@ -191,8 +191,9 @@ if ($object->id > 0)
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/user/group/index.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
@ -435,7 +435,7 @@ while ($i < min($num,$limit))
|
||||
$userstatic->employee=$obj->employee;
|
||||
$userstatic->photo=$obj->photo;
|
||||
|
||||
$li=$userstatic->getNomUrl(-1,'',0,0,24,1,'login');
|
||||
$li=$userstatic->getNomUrl(-1,'',0,0,24,1,'login','',1);
|
||||
|
||||
print "<tr>";
|
||||
if (! empty($arrayfields['u.login']['checked']))
|
||||
@ -541,7 +541,7 @@ while ($i < min($num,$limit))
|
||||
$user2->admin=$obj->admin2;
|
||||
$user2->email=$obj->email2;
|
||||
$user2->socid=$obj->fk_soc2;
|
||||
print $user2->getNomUrl(-1,'',0,0,24,0,'');
|
||||
print $user2->getNomUrl(-1,'',0,0,24,0,'','',1);
|
||||
if (! empty($conf->multicompany->enabled) && $obj->admin2 && ! $obj->entity2)
|
||||
{
|
||||
print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user