Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/filefunc.inc.php
This commit is contained in:
commit
fb88eaf2a4
@ -1,17 +1,23 @@
|
||||
README
|
||||
------
|
||||
|
||||
*** Demo
|
||||
Scripts in this directory can be used to reload or save a demo database.
|
||||
Install of package "dialog" is required.
|
||||
|
||||
Scripts in this directory can be used to reinit a demo database.
|
||||
WARNING: This will erase current database with data into initdemo.sql.
|
||||
|
||||
*** Init demo
|
||||
|
||||
The script initdemo.sh will erase current database with data into mysqldump_dolibarr_x.y.z.sql and copy files into documents_demo into officiel document directory.
|
||||
|
||||
Do a chmod 700 initdemo.sh
|
||||
then run ./initdemo.sh to launch Graphic User Interface.
|
||||
|
||||
Install of package "dialog" is required.
|
||||
|
||||
*** Save demo
|
||||
|
||||
The script savedemo.sh will save current database into a database dump file.
|
||||
|
||||
|
||||
*** Other
|
||||
*** Update demo
|
||||
|
||||
Other scripts into initdata can be used to load data test.
|
||||
The goal of script updatedemo.php is to update dates into the demo data so samples are up to date.
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -862,8 +862,10 @@ if ($id > 0)
|
||||
$result4=$object->fetch_userassigned();
|
||||
$result5=$object->fetch_optionals($id,$extralabels);
|
||||
|
||||
if ($listUserAssignedUpdated || $donotclearsession) {
|
||||
|
||||
if ($listUserAssignedUpdated || $donotclearsession)
|
||||
{
|
||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
|
||||
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||
|
||||
@ -1038,7 +1040,7 @@ if ($id > 0)
|
||||
|
||||
// Status
|
||||
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
|
||||
$percent=GETPOST("percentage")?GETPOST("percentage"):$object->percentage;
|
||||
$percent = GETPOST("percentage") ? GETPOST("percentage"): $object->percentage;
|
||||
$formactions->form_select_status_action('formaction',$percent,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -1166,14 +1166,9 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
$clonedObj->id=0;
|
||||
$clonedObj->ref='';
|
||||
$clonedObj->statut=self::STATUS_DRAFT;
|
||||
|
||||
if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
|
||||
{
|
||||
$this->error='ErrorSetupNotComplete';
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Clear fields
|
||||
$clonedObj->user_author = $user->id;
|
||||
$clonedObj->user_valid = '';
|
||||
@ -1182,12 +1177,6 @@ class Propal extends CommonObject
|
||||
$clonedObj->fin_validite = $clonedObj->date + ($clonedObj->duree_validite * 24 * 3600);
|
||||
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
|
||||
|
||||
// Set ref
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.'.php';
|
||||
$obj = $conf->global->PROPALE_ADDON;
|
||||
$modPropale = new $obj;
|
||||
$clonedObj->ref = $modPropale->getNextValue($objsoc,$clonedObj);
|
||||
|
||||
// Create clone
|
||||
|
||||
$result=$clonedObj->create($user);
|
||||
|
||||
@ -45,16 +45,25 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
// Get supervariables
|
||||
$action = GETPOST('action','alpha');
|
||||
$id = GETPOST('id','int');
|
||||
|
||||
$socid = GETPOST('socid','int');
|
||||
$page = GETPOST('page','int');
|
||||
$sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha');
|
||||
$sortfield = ((GETPOST('sortfield','alpha')=="")) ? "pl.fk_soc" : GETPOST('sortfield','alpha');
|
||||
|
||||
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='pl.fk_soc';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ( $action == 'confirm_delete' )
|
||||
{
|
||||
$bon = new BonPrelevement($db,"");
|
||||
@ -73,10 +82,12 @@ if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes')
|
||||
$bon = new BonPrelevement($db,"");
|
||||
$bon->fetch($id);
|
||||
|
||||
$bon->set_credite();
|
||||
|
||||
header("Location: card.php?id=".$id);
|
||||
exit;
|
||||
$res=$bon->set_credite();
|
||||
if ($res >= 0)
|
||||
{
|
||||
header("Location: card.php?id=".$id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
|
||||
@ -162,12 +173,12 @@ if ($id > 0)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -176,16 +187,16 @@ if ($id > 0)
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -194,7 +205,7 @@ if ($id > 0)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td width="20%">';
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
@ -204,7 +215,6 @@ if ($id > 0)
|
||||
|
||||
|
||||
|
||||
|
||||
if (empty($bon->date_trans) && $user->rights->prelevement->bons->send && $action=='settransmitted')
|
||||
{
|
||||
print '<form method="post" name="userfile" action="card.php?id='.$bon->id.'" enctype="multipart/form-data">';
|
||||
@ -236,7 +246,7 @@ if ($id > 0)
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
|
||||
print '<tr '.$bc[false].'><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
|
||||
print '<tr '.$bc[false].'><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print $form->select_date('','','','','',"infocredit",1,1);
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
@ -269,17 +279,11 @@ if ($id > 0)
|
||||
|
||||
$ligne=new LignePrelevement($db,$user);
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
/*
|
||||
* Lines into withdraw request
|
||||
*/
|
||||
$sql = "SELECT pl.rowid, pl.statut, pl.amount";
|
||||
$sql.= ", s.rowid as socid, s.nom as name";
|
||||
$sql = "SELECT pl.rowid, pl.statut, pl.amount,";
|
||||
$sql.= " s.rowid as socid, s.nom as name";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
@ -306,7 +310,7 @@ if ($id > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Lines"),$_SERVER["PHP_SELF"],"pl.rowid",'',$urladd);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","",$urladd,'align="center"');
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","",$urladd,'align="right"');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -320,13 +324,12 @@ if ($id > 0)
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
// Status of line
|
||||
print "<td>";
|
||||
|
||||
print $ligne->LibStatut($obj->statut,2);
|
||||
print " ";
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
|
||||
print substr('000000'.$obj->rowid, -6);
|
||||
print sprintf("%06s",$obj->rowid);
|
||||
print '</a></td>';
|
||||
|
||||
$thirdparty=new Societe($db);
|
||||
@ -335,7 +338,7 @@ if ($id > 0)
|
||||
print $thirdparty->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td align="center">'.price($obj->amount)."</td>\n";
|
||||
print '<td align="right">'.price($obj->amount)."</td>\n";
|
||||
|
||||
print '<td>';
|
||||
|
||||
@ -350,23 +353,18 @@ if ($id > 0)
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
$total += $obj->total_ttc;
|
||||
$total += $obj->amount;
|
||||
$var=!$var;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if($socid)
|
||||
if ($num > 0)
|
||||
{
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
|
||||
print '<td align="center">'.price($total)."</td>\n";
|
||||
|
||||
print '<td> </td>';
|
||||
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td> </td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -323,7 +323,7 @@ class BonPrelevement extends CommonObject
|
||||
/**
|
||||
* Set credite and set status of linked invoices
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function set_credite()
|
||||
{
|
||||
|
||||
@ -136,24 +136,22 @@ class LignePrelevement
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
|
||||
if ($mode == 1)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); // Waiting
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); // Credited
|
||||
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); // Refused
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut4');
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
||||
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8');
|
||||
}
|
||||
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||
if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut4');
|
||||
if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
||||
if ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut8');
|
||||
}
|
||||
}
|
||||
|
||||
@ -239,6 +239,7 @@ else
|
||||
/*
|
||||
* List of latest withdraws
|
||||
*/
|
||||
/*
|
||||
$limit=5;
|
||||
|
||||
print load_fiche_titre($langs->trans("LastWithdrawalReceipts",$limit),'','');
|
||||
@ -291,6 +292,7 @@ else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
*/
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -110,10 +110,10 @@ if ($resql)
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Bill"));
|
||||
print_liste_field_titre($langs->trans("Company"));
|
||||
print_liste_field_titre($langs->trans("Amount"));
|
||||
print_liste_field_titre($langs->trans("DateRequest"));
|
||||
print_liste_field_titre($langs->trans("Bill"), $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "", "", $param, 'align="right"');
|
||||
print_liste_field_titre($langs->trans("DateRequest"), $_SERVER["PHP_SELF"], "", "", $param, 'align="center"');
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
|
||||
@ -154,7 +154,7 @@ if ($resql)
|
||||
|
||||
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->date_demande),'day').'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_demande),'day').'</td>';
|
||||
|
||||
print '<td align="right"></td>';
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
@ -43,9 +43,25 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
// Get supervariables
|
||||
$prev_id = GETPOST('id','int');
|
||||
$socid = GETPOST('socid','int');
|
||||
$page = GETPOST('page','int');
|
||||
$sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha');
|
||||
$sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.ref" : GETPOST('sortfield','alpha');
|
||||
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='p.ref';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$invoicetmp = new Facture($db);
|
||||
$thirdpartytmp = new Societe($db);
|
||||
|
||||
llxHeader('',$langs->trans("WithdrawalsReceipts"));
|
||||
|
||||
@ -60,30 +76,27 @@ if ($prev_id)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
// Status
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
print '<tr><td>'.$langs->trans('Status').'</td><td>'.$bon->getLibStatut(1).'</td></tr>';
|
||||
|
||||
if($bon->date_trans <> 0)
|
||||
{
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -92,7 +105,7 @@ if ($prev_id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td width="20%">';
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
@ -107,11 +120,8 @@ if ($prev_id)
|
||||
}
|
||||
}
|
||||
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
|
||||
/*
|
||||
* Liste des factures
|
||||
*/
|
||||
// List of invoices
|
||||
$sql = "SELECT pf.rowid";
|
||||
$sql.= ",f.rowid as facid, f.facnumber as ref, f.total_ttc";
|
||||
$sql.= ", s.rowid as socid, s.nom as name, pl.statut";
|
||||
@ -127,27 +137,49 @@ $sql.= " AND pf.fk_facture = f.rowid";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($prev_id) $sql.= " AND p.rowid=".$prev_id;
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
$urladd = "&id=".$prev_id;
|
||||
$param = "&id=".$prev_id;
|
||||
|
||||
print_barre_liste("", $page, "factures.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
// Lines of title fields
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
|
||||
$massactionbutton='';
|
||||
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Bill"),$_SERVER["PHP_SELF"],"p.ref",'',$urladd,'class="liste_titre"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd,'class="liste_titre"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"f.total_ttc","",$urladd,'class="liste_titre" align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre($langs->trans("Bill"),$_SERVER["PHP_SELF"],"p.ref",'',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("StatusDebitCredit"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -155,24 +187,31 @@ if ($result)
|
||||
|
||||
$total = 0;
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">';
|
||||
print img_object($langs->trans("ShowBill"),"bill");
|
||||
print '</a> ';
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">';
|
||||
print img_object($langs->trans("ShowCompany"),"company"). ' '.$obj->name."</a></td>\n";
|
||||
|
||||
print '<td align="center">'.price($obj->total_ttc)."</td>\n";
|
||||
$invoicetmp->id = $obj->facid;
|
||||
$invoicetmp->ref = $obj->ref;
|
||||
|
||||
$thirdpartytmp->id = $obj->socid;
|
||||
$thirdpartytmp->name = $obj->name;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
print "<td>";
|
||||
print $invoicetmp->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td>';
|
||||
print $thirdpartytmp->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
// Amount
|
||||
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
|
||||
|
||||
// Status of requests
|
||||
print '<td align="center">';
|
||||
|
||||
if ($obj->statut == 0)
|
||||
{
|
||||
@ -187,23 +226,25 @@ if ($result)
|
||||
print '<b>'.$langs->trans("StatusRefused").'</b>';
|
||||
}
|
||||
|
||||
print "</td></tr>\n";
|
||||
print "</td>";
|
||||
|
||||
print "<td></td>";
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$total += $obj->total_ttc;
|
||||
$var=!$var;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if($socid)
|
||||
if ($num > 0)
|
||||
{
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
|
||||
print '<td align="center">'.price($total)."</td>\n";
|
||||
|
||||
print '<td> </td>';
|
||||
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -59,12 +59,12 @@ if ($prev_id)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -73,16 +73,16 @@ if ($prev_id)
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -91,7 +91,7 @@ if ($prev_id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td width="20%">';
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
@ -130,8 +130,7 @@ $sql.= " ORDER BY pl.amount DESC";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
@ -142,35 +141,47 @@ if ($resql)
|
||||
$var=True;
|
||||
$total = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
|
||||
print img_picto('', 'statut'.$obj->statut).' ';
|
||||
print substr('000000'.$obj->rowid, -6);
|
||||
print '</a></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->name."</a></td>\n";
|
||||
|
||||
print '<td align="right">'.price($obj->amount)."</td>\n";
|
||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||
|
||||
print '<td align="center">'.yn($obj->afacturer).'</td>';
|
||||
print '<td align="center">'.$obj->fk_facture.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$total += $obj->amount;
|
||||
$var=!$var;
|
||||
$i++;
|
||||
if ($num > 0)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
|
||||
print img_picto('', 'statut'.$obj->statut).' ';
|
||||
print substr('000000'.$obj->rowid, -6);
|
||||
print '</a></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->name."</a></td>\n";
|
||||
|
||||
print '<td align="right">'.price($obj->amount)."</td>\n";
|
||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||
|
||||
print '<td align="center">'.yn($obj->afacturer).'</td>';
|
||||
print '<td align="center">'.$obj->fk_facture.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$total += $obj->amount;
|
||||
$var=!$var;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td> </td>';
|
||||
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td colspan="3"> </td>';
|
||||
print "</tr>\n</table>\n";
|
||||
else
|
||||
{
|
||||
print '<tr><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
print '<tr class="liste_total"><td> </td>';
|
||||
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td colspan="3"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
|
||||
@ -57,12 +57,12 @@ if ($prev_id)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -71,16 +71,16 @@ if ($prev_id)
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -89,7 +89,7 @@ if ($prev_id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td width="20%">';
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
|
||||
@ -125,9 +125,9 @@ class Contact extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||
{
|
||||
$sql.= " OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
|
||||
$sql.= " OUTER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||
$sql.= " WHERE sc.fk_user = " .$user->id;
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE sp.fk_soc = s.rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$clause = "AND";
|
||||
}
|
||||
$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')';
|
||||
|
||||
@ -70,15 +70,12 @@ class box_services_contracts extends ModeleBoxes
|
||||
$sql.= " cd.rowid as cdid, cd.tms as datem, cd.statut, cd.label, cd.description, cd.product_type as type,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."contrat as c ON s.rowid = c.fk_soc";
|
||||
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= "INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$sql.= ")";
|
||||
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||
$sql.= " AND s.rowid = c.fk_soc";
|
||||
$sql.= " AND c.rowid = cd.fk_contrat";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= $db->order("c.tms","DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
@ -1464,7 +1464,13 @@ class Form
|
||||
if ($includeUsers) $sql.= " AND u.rowid IN (".$includeUsers.")";
|
||||
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $noactive) $sql.= " AND u.statut <> 0";
|
||||
if (! empty($morefilter)) $sql.=" ".$morefilter;
|
||||
$sql.= " ORDER BY u.lastname ASC";
|
||||
|
||||
if(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)){
|
||||
$sql.= " ORDER BY u.firstname ASC";
|
||||
}else{
|
||||
$sql.= " ORDER BY u.lastname ASC";
|
||||
}
|
||||
|
||||
|
||||
dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -1515,7 +1521,12 @@ class Form
|
||||
$out.= '>';
|
||||
}
|
||||
|
||||
$out.= $userstatic->getFullName($langs, 0, -1, $maxlength);
|
||||
$fullNameMode = 0; //Lastname + firstname
|
||||
if(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)){
|
||||
$fullNameMode = 1; //firstname + lastname
|
||||
}
|
||||
$out.= $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength);
|
||||
|
||||
// Complete name with more info
|
||||
$moreinfo=0;
|
||||
if (! empty($conf->global->MAIN_SHOW_LOGIN))
|
||||
@ -5417,7 +5428,7 @@ class Form
|
||||
{
|
||||
$nbofdifferenttypes = count($object->linkedObjects);
|
||||
|
||||
print '<br>';
|
||||
print '<br><!-- showLinkedObjectBlock -->';
|
||||
print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, '');
|
||||
|
||||
print '<table class="noborder allwidth">';
|
||||
@ -5509,7 +5520,7 @@ class Form
|
||||
|
||||
if (! $nboftypesoutput)
|
||||
{
|
||||
print '<tr><td class="opacitymedium" colspan="7">'.$langs->trans("None").'</td></tr>';
|
||||
print '<tr><td class="impair opacitymedium" colspan="7">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -271,8 +271,13 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
|
||||
}
|
||||
elseif ($reg[1] == 'YEAR')
|
||||
{
|
||||
$tmp=dol_getdate(dol_now(), true);
|
||||
$out = $tmp['year'];
|
||||
$tmp=dol_getdate(dol_now(), true);
|
||||
$out = $tmp['year'];
|
||||
}
|
||||
elseif ($reg[1] == 'MYCOUNTRYID')
|
||||
{
|
||||
global $mysoc;
|
||||
$out = $mysoc->country_id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,7 +34,8 @@ function propal_prepare_head($object)
|
||||
global $db, $langs, $conf, $user;
|
||||
$langs->load("propal");
|
||||
$langs->load("compta");
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ function tree_showpad(&$fulltree,$key,$silent=0)
|
||||
// ------------------------------- Used by menu editor, category view, ... -----------------
|
||||
|
||||
/**
|
||||
* Recursive function to output menu tree. <ul id="iddivjstree"><li>...</li></ul>
|
||||
* Recursive function to output a tree. <ul id="iddivjstree"><li>...</li></ul>
|
||||
* It is also used for the tree of categories.
|
||||
* Note: To have this function working, check you have loaded the js and css for treeview.
|
||||
* $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
|
||||
@ -106,7 +106,7 @@ function tree_showpad(&$fulltree,$key,$silent=0)
|
||||
* TODO Replace with jstree plugin instead of treeview plugin.
|
||||
*
|
||||
* @param array $tab Array of all elements
|
||||
* @param int $pere Array with parent ids ('rowid'=>,'mainmenu'=>,'leftmenu'=>,'fk_mainmenu=>,'fk_leftmenu=>)
|
||||
* @param array $pere Array with parent ids ('rowid'=>,'mainmenu'=>,'leftmenu'=>,'fk_mainmenu=>,'fk_leftmenu=>)
|
||||
* @param int $rang Level of element
|
||||
* @param string $iddivjstree Id to use for parent ul element
|
||||
* @param int $donoresetalreadyloaded Do not reset global array $donoresetalreadyloaded used to avoid to go down on an aleady processed record
|
||||
@ -139,7 +139,10 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetal
|
||||
print '<ul id="'.$iddivjstree.'">';
|
||||
}
|
||||
|
||||
if ($rang > 50) return; // Protect against infinite loop. Max 50 depth
|
||||
if ($rang > 50)
|
||||
{
|
||||
return; // Protect against infinite loop. Max 50 depth
|
||||
}
|
||||
|
||||
//ballayage du tableau
|
||||
$sizeoftab=count($tab);
|
||||
|
||||
@ -59,7 +59,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 309__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/purge.php?leftmenu=admintools', 'Purge', 1, 'admin', '', '', 2, 12, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 311__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?leftmenu=admintools', 'ExternalResources', 1, 'admin', '', '', 2, 14, __ENTITY__);
|
||||
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 320__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools', 'ProductVatMassChange', 1, 'products', '', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 320__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools', 'ProductVatMassChange', 1, 'products', '', '', 2, 15, __ENTITY__);
|
||||
-- Home - Menu users and groups
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/index.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__);
|
||||
@ -215,8 +215,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2456__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Chartofaccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 20, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 22, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2458__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_default', 2451__+MAX_llx_menu__, '/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuDefaultAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 30, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 40, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 40, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__);
|
||||
-- Binding
|
||||
@ -245,7 +245,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__);
|
||||
-- Accounting period
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 115__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 100__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=setup', 'FiscalPeriod', 1, 'admin', '', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2400__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=setup', 'FiscalPeriod', 1, 'admin', '', '', 2, 4, __ENTITY__);
|
||||
-- Rapports compta simple
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
|
||||
|
||||
@ -323,7 +323,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
||||
|
||||
if (! empty($conf->accounting->enabled) && !empty($user->rights->accounting->mouvements->lire) && $mainmenu == 'accountancy') // Entry in accountancy journal for each bank account
|
||||
{
|
||||
$newmenu->add('',$langs->trans("Journaux"),0,$user->rights->accounting->comptarapport->lire,'','accountancy','accounting');
|
||||
$newmenu->add('',$langs->trans("Journalization"),0,$user->rights->accounting->comptarapport->lire,'','accountancy','accountancy');
|
||||
|
||||
$sql = "SELECT rowid, label, accountancy_journal";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
@ -341,7 +341,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$newmenu->add('/accountancy/journal/bankjournal.php?id_account='.$objp->rowid,$langs->trans("Journal").' - '.$objp->label,1,$user->rights->accounting->comptarapport->lire,'','accountancy','accounting');
|
||||
$newmenu->add('/accountancy/journal/bankjournal.php?id_account='.$objp->rowid, $langs->trans("Journal").' - '.$objp->label, 1, $user->rights->accounting->comptarapport->lire,'','accountancy','accountancy_journal');
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@ -349,9 +349,9 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
||||
$db->free($resql);
|
||||
|
||||
// Add other journal
|
||||
$newmenu->add("/accountancy/journal/sellsjournal.php?leftmenu=journal",$langs->trans("SellsJournal"),1,$user->rights->accounting->comptarapport->lire);
|
||||
$newmenu->add("/accountancy/journal/purchasesjournal.php?leftmenu=journal",$langs->trans("PurchasesJournal"),1,$user->rights->accounting->comptarapport->lire);
|
||||
$newmenu->add("/accountancy/journal/expensereportsjournal.php?leftmenu=journal",$langs->trans("ExpenseReportsJournal"),1,$user->rights->accounting->comptarapport->lire);
|
||||
$newmenu->add("/accountancy/journal/sellsjournal.php?leftmenu=journal",$langs->trans("SellsJournal"),1,$user->rights->accounting->comptarapport->lire,'','accountancy','accountancy_journal');
|
||||
$newmenu->add("/accountancy/journal/purchasesjournal.php?leftmenu=journal",$langs->trans("PurchasesJournal"),1,$user->rights->accounting->comptarapport->lire,'','accountancy','accountancy_journal');
|
||||
$newmenu->add("/accountancy/journal/expensereportsjournal.php?leftmenu=journal",$langs->trans("ExpenseReportsJournal"),1,$user->rights->accounting->comptarapport->lire,'','accountancy','accountancy_journal');
|
||||
}
|
||||
|
||||
if ($conf->ftp->enabled && $mainmenu == 'ftp') // Entry for FTP
|
||||
|
||||
@ -113,7 +113,7 @@ class modBarcode extends DolibarrModules
|
||||
'url'=>'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools',
|
||||
'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>300,
|
||||
'enabled'=>'$conf->barcode->enabled && $leftmenu=="admintools"', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled'=>'$conf->barcode->enabled && ($leftmenu=="admintools" || $leftmenu=="admintools_info")', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->creer_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
||||
@ -138,7 +138,7 @@ class modCron extends DolibarrModules
|
||||
'url'=>'/cron/list.php?status=-2&leftmenu=admintools',
|
||||
'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>200,
|
||||
'enabled'=>'$leftmenu==\'admintools\'', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled'=>'($leftmenu==\'admintools\' || $leftmenu==\'admintools_info\')', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
||||
@ -111,7 +111,7 @@ class modPrinting extends DolibarrModules
|
||||
'url'=>'/printing/index.php?mainmenu=home&leftmenu=admintools',
|
||||
'langs'=>'printing', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>300,
|
||||
'enabled'=>'$conf->printing->enabled && $leftmenu==\'admintools\'',
|
||||
'enabled'=>'$conf->printing->enabled && ($leftmenu==\'admintools\' || $leftmenu==\'admintools_info\')',
|
||||
'perms'=>'$user->rights->printing->read', // Use 'perms'=>'1' if you want your menu with no permission rules
|
||||
'target'=>'',
|
||||
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
||||
@ -136,7 +136,7 @@ class modProduct extends DolibarrModules
|
||||
'url'=>'/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools',
|
||||
'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>300,
|
||||
'enabled'=>'$conf->product->enabled && $leftmenu=="admintools"', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled'=>'$conf->product->enabled && ($leftmenu=="admintools" || $leftmenu=="admintools_info")', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
||||
@ -1892,7 +1892,7 @@ else
|
||||
$sql.= ' WHERE fde.fk_expensereport = '.$object->id;
|
||||
$sql.= ' ORDER BY fde.date ASC';
|
||||
|
||||
print '<div style="clear: both;">';
|
||||
print '<div style="clear: both;"></div>';
|
||||
|
||||
$actiontouse='updateligne';
|
||||
if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline') $actiontouse='addline';
|
||||
@ -1902,7 +1902,10 @@ else
|
||||
print '<input type="hidden" name="action" value="'.$actiontouse.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="fk_expensereport" value="'.$object->id.'" />';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table id="tablelines" class="noborder" width="100%">';
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@ -2131,11 +2134,9 @@ else
|
||||
} // Fin si c'est payé/validé
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -191,7 +191,25 @@ if (empty($reshook))
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($object->error,$object->errors,'errors');
|
||||
}
|
||||
}else{
|
||||
// Define output language
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
||||
if (! empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$model=$object->modelpdf;
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
|
||||
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result < 0) dol_print_error($db,$result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -76,4 +76,4 @@ UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Admin tools - Scheduled job
|
||||
JobDisabled=Job disabled
|
||||
MakeLocalDatabaseDumpShort=Local database backup
|
||||
MakeLocalDatabaseDump=Create a local database dump
|
||||
WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of active jobs, your jobs may be delayed to a maximum of %s hours before being run.
|
||||
WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of active jobs, your jobs may be delayed to a maximum of %s hours, before being run.
|
||||
|
||||
@ -41,6 +41,7 @@ RefusedReason=Reason for rejection
|
||||
RefusedInvoicing=Billing the rejection
|
||||
NoInvoiceRefused=Do not charge the rejection
|
||||
InvoiceRefused=Invoice refused (Charge the rejection to customer)
|
||||
StatusDebitCredit=Status debit/credit
|
||||
StatusWaiting=Waiting
|
||||
StatusTrans=Sent
|
||||
StatusCredited=Credited
|
||||
|
||||
@ -242,7 +242,7 @@ if ($action == 'convert')
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
$title = $langs->trans('ModulesSystemTools');
|
||||
$title = $langs->trans('ProductVatMassChange');
|
||||
|
||||
llxHeader('',$title);
|
||||
|
||||
|
||||
@ -151,7 +151,7 @@ if (! $action)
|
||||
print $langs->trans('ResourceFormLabel_'.$field);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="'.$field.'" value="'.$$field.'" />';
|
||||
print '<input class="flat maxwidthonsmartphone" type="text" name="'.$field.'" value="'.$$field.'" />';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@ class FormResource
|
||||
if ($filtertype != '' && $filtertype != '-1') $filterarray=explode(',',$filtertype);
|
||||
|
||||
$resourcestat->load_cache_code_type_resource();
|
||||
print '<select id="select'.$htmlname.'" class="flat select_'.$htmlname.'" name="'.$htmlname.'">';
|
||||
print '<select id="select'.$htmlname.'" class="flat maxwidthonsmartphone select_'.$htmlname.'" name="'.$htmlname.'">';
|
||||
if ($empty) print '<option value=""> </option>';
|
||||
if (is_array($resourcestat->cache_code_type_resource) && count($resourcestat->cache_code_type_resource))
|
||||
{
|
||||
|
||||
@ -716,7 +716,9 @@ div.fiche>form>div.div-table-responsive {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.fiche {
|
||||
margin-top: <?php print ($dol_hide_topmenu?'12':'6'); ?>px !important;
|
||||
}
|
||||
div.titre {
|
||||
line-height: 2em;
|
||||
}
|
||||
@ -781,6 +783,9 @@ div.fiche>form>div.div-table-responsive {
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
div.statusref {
|
||||
padding-right: 10px;
|
||||
}
|
||||
}
|
||||
.linkobject { cursor: pointer; }
|
||||
<?php if (GETPOST("optioncss") == 'print') { ?>
|
||||
|
||||
@ -694,7 +694,9 @@ div.fiche>form>div.div-table-responsive {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.fiche {
|
||||
margin-top: <?php print ($dol_hide_topmenu?'12':'6'); ?>px !important;
|
||||
}
|
||||
div.titre {
|
||||
line-height: 2em;
|
||||
}
|
||||
@ -758,6 +760,10 @@ div.fiche>form>div.div-table-responsive {
|
||||
width: 20px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
div.statusref {
|
||||
padding-right: 10px;
|
||||
}
|
||||
}
|
||||
.linkobject { cursor: pointer; }
|
||||
<?php if (GETPOST("optioncss") == 'print') { ?>
|
||||
|
||||
@ -1827,14 +1827,6 @@ else
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Photo
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Photo").'</td>';
|
||||
print '<td>';
|
||||
print $form->showphoto('userphoto',$object,60,0,$caneditfield,'photowithmargin','small');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Employee
|
||||
print '<tr>';
|
||||
print '<td>'.fieldLabel('Employee','employee',0).'</td><td>';
|
||||
@ -2237,6 +2229,14 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Photo
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Photo").'</td>';
|
||||
print '<td>';
|
||||
print $form->showphoto('userphoto',$object,60,0,$caneditfield,'photowithmargin','small');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Categories
|
||||
if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
|
||||
{
|
||||
|
||||
@ -1667,7 +1667,6 @@ class User extends CommonObject
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
if (! $changelater)
|
||||
{
|
||||
@ -2008,8 +2007,8 @@ class User extends CommonObject
|
||||
$label.= '<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
|
||||
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $label.= '<br><b>'.$langs->trans("ConnectedOnMultiCompany").':</b> '.$conf->entity.' (user entity '.$this->entity.')';
|
||||
$label.= '<br><b>'.$langs->trans("AuthenticationMode").':</b> '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)');
|
||||
$label.= '<br><b>'.$langs->trans("ConnectedSince").':</b> '.dol_print_date($this->datelastlogin,"dayhour");
|
||||
$label.= '<br><b>'.$langs->trans("PreviousConnexion").':</b> '.dol_print_date($this->datepreviouslogin,"dayhour");
|
||||
$label.= '<br><b>'.$langs->trans("ConnectedSince").':</b> '.dol_print_date($this->datelastlogin,"dayhour",'tzuser');
|
||||
$label.= '<br><b>'.$langs->trans("PreviousConnexion").':</b> '.dol_print_date($this->datepreviouslogin,"dayhour",'tzuser');
|
||||
$label.= '<br><b>'.$langs->trans("CurrentTheme").':</b> '.$conf->theme;
|
||||
$label.= '<br><b>'.$langs->trans("CurrentMenuManager").':</b> '.$menumanager->name;
|
||||
$s=picto_from_langcode($langs->getDefaultLang());
|
||||
@ -2570,7 +2569,12 @@ class User extends CommonObject
|
||||
dol_syslog(get_class($this)."::get_full_tree call to build_path_from_id_user", LOG_DEBUG);
|
||||
foreach($this->users as $key => $val)
|
||||
{
|
||||
$this->build_path_from_id_user($key,0); // Process a branch from the root user key (this user has no parent)
|
||||
$result = $this->build_path_from_id_user($key,0); // Process a branch from the root user key (this user has no parent)
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error='ErrorLoopInHierarchy';
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Exclude leaf including $deleteafterid from tree
|
||||
@ -2641,10 +2645,10 @@ class User extends CommonObject
|
||||
* Function called by get_full_tree().
|
||||
*
|
||||
* @param int $id_user id_user entry to update
|
||||
* @param int $protection Deep counter to avoid infinite loop
|
||||
* @return void
|
||||
* @param int $protection Deep counter to avoid infinite loop (no more required, a protection is added with array useridfound)
|
||||
* @return int < 0 if KO (infinit loop), >= 0 if OK
|
||||
*/
|
||||
function build_path_from_id_user($id_user,$protection=1000)
|
||||
function build_path_from_id_user($id_user,$protection=0)
|
||||
{
|
||||
dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG);
|
||||
|
||||
@ -2652,7 +2656,7 @@ class User extends CommonObject
|
||||
{
|
||||
// Already defined
|
||||
dol_syslog(get_class($this)."::build_path_from_id_user fullpath and fullname already defined", LOG_WARNING);
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Define fullpath and fullname
|
||||
@ -2660,9 +2664,16 @@ class User extends CommonObject
|
||||
$this->users[$id_user]['fullname'] = $this->users[$id_user]['lastname'];
|
||||
$i=0; $cursor_user=$id_user;
|
||||
|
||||
while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user]))
|
||||
$useridfound=array($id_user);
|
||||
while (! empty($this->parentof[$cursor_user]))
|
||||
{
|
||||
$this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath'];
|
||||
if (in_array($this->parentof[$cursor_user], $useridfound))
|
||||
{
|
||||
dol_syslog("The hierarchy of user has a recursive loop", LOG_WARNING);
|
||||
return -1; // Should not happen. Protection against looping hierarchy
|
||||
}
|
||||
$useridfound[]=$this->parentof[$cursor_user];
|
||||
$this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath'];
|
||||
$this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'].' >> '.$this->users[$id_user]['fullname'];
|
||||
$i++; $cursor_user=$this->parentof[$cursor_user];
|
||||
}
|
||||
@ -2670,7 +2681,7 @@ class User extends CommonObject
|
||||
// We count number of _ to have level
|
||||
$this->users[$id_user]['level']=dol_strlen(preg_replace('/[^_]/i','',$this->users[$id_user]['fullpath']));
|
||||
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -71,9 +71,15 @@ print load_fiche_titre($langs->trans("ListOfUsers"). ' ('.$langs->trans("Hierarc
|
||||
// Load hierarchy of users
|
||||
$user_arbo = $userstatic->get_full_tree(0, ($search_statut != '' && $search_statut >= 0) ? "statut = ".$search_statut : '');
|
||||
|
||||
if (! is_array($user_arbo) && $user_arbo < 0)
|
||||
{
|
||||
setEventMessages($userstatic->error, $userstatic->errors, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
// Define fulltree array
|
||||
$fulltree=$user_arbo;
|
||||
|
||||
//var_dump($fulltree);
|
||||
// Define data (format for treeview)
|
||||
$data=array();
|
||||
$data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>'');
|
||||
@ -131,6 +137,7 @@ foreach($fulltree as $key => $val)
|
||||
);
|
||||
}
|
||||
|
||||
//var_dump($data);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
@ -185,6 +192,7 @@ else
|
||||
|
||||
print "</table>";
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
//
|
||||
/*print '<script type="text/javascript" language="javascript">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user