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

develop

Conflicts:
	htdocs/compta/bank/annuel.php
This commit is contained in:
Laurent Destailleur 2015-05-16 02:53:36 +02:00
commit 1b03e348d3
54 changed files with 382 additions and 358 deletions

View File

@ -70,7 +70,7 @@ print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
$head = member_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("Members"), 0, 'title_user');
dol_fiche_head($head, 'attributes', $langs->trans("Members"), 0, 'user');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -68,7 +68,7 @@ llxHeader('',$langs->trans("MembersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup_title');
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
$head = member_admin_prepare_head();

View File

@ -1,9 +1,8 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -85,6 +84,11 @@ print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
$head = member_admin_prepare_head();
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="update">';
dol_fiche_head($head, 'public', $langs->trans("Members"), 0, 'user');
if ($conf->use_javascript_ajax)
@ -130,8 +134,6 @@ if ($conf->use_javascript_ajax)
print $langs->trans("BlankSubscriptionFormDesc").'<br><br>';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">';
@ -198,19 +200,20 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
print '<tr '.$bc[$var].' id="tremail"><td>';
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';;
print "</td></tr>\n";
}
print '</table>';
print '<br><div class="center">';
dol_fiche_end();
print '<center>';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</div>';
print '</center>';
print '</form>';
dol_fiche_end();
print '<br>';

View File

@ -51,8 +51,8 @@ print '</ul>';
print $langs->trans("Developpers").':';
print '<ul>';
print '<li>'.$langs->trans("SourcesRepository").': <a href="http://www.github.com/Dolibarr/dolibarr" target="_blank" rel="external">http://www.github.com/Dolibarr/dolibarr</a></li>';
print '<li>'.$langs->trans("SeeWikiForAllTeam").': <a href="http://wiki.dolibarr.org/index.php/Dolibarr_Project" target="_blank" rel="external">http://wiki.dolibarr.org/index.php/Dolibarr_Project</a></li>';
print '<li>'.$langs->trans("DoliForge").': <a href="http://www.doliforge.org" target="_blank" rel="external">http://wwww.doliforge.org</a></li>';
print '</ul>';
//print "<br>\n";

View File

@ -11,7 +11,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -1315,6 +1315,8 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<input type="hidden" name="origin" value="' . $origin . '">';
print '<input type="hidden" name="originid" value="' . $originid . '">';
dol_fiche_head('');
print '<table class="border" width="100%">';
// Reference
@ -1545,8 +1547,10 @@ if ($action == 'create' && $user->rights->commande->creer)
print '</table>';
dol_fiche_end();
// Button "Create Draft"
print '<br><div class="center"><input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '"></div>';
print '<div class="center"><input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '"></div>';
print '</form>';

View File

@ -324,8 +324,54 @@ if ($id > 0 || ! empty($ref))
print '</table>';
print '<br>';
dol_fiche_end();
/*
* Boutons actions
*/
if ($action != 'delete')
{
print '<div class="tabsAction">';
if ($object->type != 2 && $object->rappro) // If not cash account and can be reconciliate
{
if ($user->rights->banque->consolidate)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>';
}
else
{
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}
if ($action != 'addline')
{
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
{
if ($user->rights->banque->modifier)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=addline&amp;id='.$object->id.'&amp;page='.$page.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("AddBankRecord").'</a>';
}
else
{
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
}
else
{
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
}
print '</div>';
}
print '<br>';
/**
* Search form
*/
@ -364,15 +410,15 @@ if ($id > 0 || ! empty($ref))
}
$navig.='</div>';
//var_dump($navig);
print '<table class="notopnoleftnoright" width="100%">';
// Show title
if ($action != 'addline' && $action != 'delete')
{
print '<tr><td colspan="10" align="right">'.$navig.'</td></tr>';
print '<div class="floatright">'.$navig.'</div>';
}
print '<table class="noborder" width="100%">';
// Form to add a transaction with no invoice
if ($user->rights->banque->modifier && $action == 'addline')
@ -859,51 +905,6 @@ if ($id > 0 || ! empty($ref))
print "</form>\n";
dol_fiche_end();
/*
* Boutons actions
*/
if ($action != 'delete')
{
print '<div class="tabsAction">';
if ($object->type != 2 && $object->rappro) // If not cash account and can be reconciliate
{
if ($user->rights->banque->consolidate)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>';
}
else
{
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}
if ($action != 'addline')
{
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
{
if ($user->rights->banque->modifier)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=addline&amp;id='.$object->id.'&amp;page='.$page.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("AddBankRecord").'</a>';
}
else
{
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
}
else
{
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
}
print '</div>';
}
print '<br>';
}
else

View File

@ -186,12 +186,14 @@ print '</td></tr>';
print '</table>';
print '<br>';
dol_fiche_end();
// Affiche tableau
print '<table class="notopnoleftnoright" width="100%">';
print '<div class="floatright">'.$link.'</div>';
print '<tr><td colspan="'.(1+($year_end-$year_start+1)*2).'" align="right">'.$link.'</td></tr>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
@ -245,16 +247,13 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
}
print "</tr>\n";
// Ligne vierge
print '<tr><td>&nbsp;</td>';
$nbcol=0;
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
$nbcol+=2;
}
print "</tr>\n";
print "</table>";
// Solde actuel
print '<br>';
// Current balance
$balance=0;
$sql = "SELECT SUM(b.amount) as total";
@ -274,6 +273,9 @@ if ($resql)
else {
dol_print_error($db);
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_total"><td><b>'.$langs->trans("CurrentBalance")."</b></td>";
print '<td colspan="'.($nbcol).'" align="right">'.price($balance).'</td>';
print "</tr>\n";

View File

@ -813,6 +813,9 @@ print '</td></tr>';
print '</table>';
dol_fiche_end();
print '<table class="notopnoleftnoright" width="100%">';
// Navigation links
@ -876,8 +879,6 @@ if ($mode == 'showalltime')
print '</table>';
print "\n</div>\n";
llxFooter();

View File

@ -139,11 +139,10 @@ if (empty($num))
print '</table>';
print '<br>';
dol_fiche_end();
print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&amp;account=".$acct->id, $sortfield, $sortorder,'',$numrows);
print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$acct->id, $sortfield, $sortorder,'',$numrows);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@ -85,10 +85,6 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
}
/*
*
*
*/
// Onglets
$head=bank_prepare_head($acct);
dol_fiche_head($head,'cash',$langs->trans("FinancialAccount"),0,'account');
@ -109,14 +105,15 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
print '</table>';
print '<br>';
dol_fiche_end();
$solde = $acct->solde(0);
/*
* Affiche tableau des echeances a venir
*/
print '<table class="notopnoleftnoright" width="100% border="1">';
print '<table class="noborder centpercent">';
// Ligne de titre tableau des ecritures
print '<tr class="liste_titre">';

View File

@ -94,15 +94,14 @@ if ($conf->salaries->enabled)
print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
$sql = "SELECT s.rowid, s.amount, s.label, s.datev as dm, s.salary, u.salary as current_salary";
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE s.entity IN (".getEntity('user',1).")";
$sql.= " AND u.rowid = s.fk_user";
if ($year > 0)
{
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
$sql.= " AND s.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
$sql.= " AND (s.datesp between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
$sql.= " OR s.dateep between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."')";
}
if (preg_match('/^s\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder);
@ -114,11 +113,11 @@ if ($conf->salaries->enabled)
$total = 0 ;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.datev","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datev","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
$var=1;
@ -130,7 +129,8 @@ if ($conf->salaries->enabled)
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td align="left">'.dol_print_date($db->jdate($obj->dm),'day').'</td>'."\n";
print '<td align="left">'.dol_print_date($db->jdate($obj->dateep),'day').'</td>'."\n";
print "<td>".$obj->label."</td>\n";
@ -141,7 +141,7 @@ if ($conf->salaries->enabled)
$sal_static->ref=$obj->rowid;
print '<td align="left">'.$sal_static->getNomUrl(1)."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->dm),'day')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
print '<td align="right">'.price($obj->amount)."</td>";
print "</tr>\n";

View File

@ -1969,6 +1969,8 @@ if ($action == 'create')
print '<input type="hidden" name="origin" value="' . $origin . '">';
print '<input type="hidden" name="originid" value="' . $originid . '">';
dol_fiche_head('');
print '<table class="border" width="100%">';
// Ref
@ -2472,8 +2474,10 @@ if ($action == 'create')
print "</table>\n";
dol_fiche_end();
// Button "Create Draft"
print '<br><div class="center">';
print '<div class="center">';
print '<input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '">';
print '&nbsp; &nbsp; &nbsp;';
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';

View File

@ -300,7 +300,7 @@ if ($resql)
print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Company'),$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountVAT'),$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountTTC'),$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);

View File

@ -646,7 +646,7 @@ if ($resql)
print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"f.fk_reglement_mode","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
@ -683,7 +683,7 @@ if ($resql)
print '</td>';
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="10" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
print '<td class="liste_titre" align="left">';
$form->select_types_paiements($search_paymentmode, 'search_paymentmode');
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1);
print '</td>';
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="8" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
@ -799,7 +799,7 @@ if ($resql)
print '</td>';
// Remain to receive
print '<td align="right">'.((! empty($objp->am) || ! empty($cn) || ! empty($dep))?price($objp->total_ttc-$objp->am-$cn-$dep):'&nbsp;').'</td>';
print '<td align="right">'.(((! empty($objp->total_ttc) || ! empty($objp->am) || ! empty($cn) || ! empty($dep)) && ($objp->total_ttc - $objp->am - $cn - $dep)) ? price($objp->total_ttc - $objp->am - $cn - $dep):'&nbsp;').'</td>';
// Status of invoice
print '<td align="right" class="nowrap">';

View File

@ -1,57 +0,0 @@
<?php
/* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/resultat/bilan.php
* \ingroup compta
* \brief Fichier page bilan compta
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
// Security check
$socid = GETPOST('socid','int');
if ($user->societe_id > 0) $socid = $user->societe_id;
if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
/*
* Views
*/
llxHeader();
$year=$_GET["year"];
$month=$_GET["month"];
if (! $year) { $year = strftime("%Y", time()); }
/* Le compte de r<>sultat est un document officiel requis par l'administration selon le status ou activit<69> */
print_titre("Bilan".($year?" annee $year":""));
print '<br>';
print $langs->trans("FeatureNotYetAvailable");
llxFooter();
$db->close();

View File

@ -144,6 +144,9 @@ else {
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
}
$hselected = 'report';
report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode);
// Show report array

View File

@ -1,52 +0,0 @@
<?php
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
// Security check
$socid = GETPOST('socid','int');
if ($user->societe_id > 0) $socid = $user->societe_id;
if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
/*
* Views
*/
llxHeader();
$year=$_GET["year"];
$month=$_GET["month"];
if (! $year) { $year = strftime("%Y", time()); }
/* Le compte de resultat est un document officiel requis par l'administration selon le status ou activite */
print_titre("Compte de resultat".($year?" annee $year":""));
print '<br>';
print $langs->trans("FeatureNotYetAvailable");
llxFooter();
$db->close();

View File

@ -88,6 +88,9 @@ else {
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
}
$hselected='report';
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode);

View File

@ -45,7 +45,7 @@ $socid = GETPOST("socid","int");
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'salaries', '', '', '');
$sal = new PaymentSalary($db);
$object = new PaymentSalary($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('salarycard','globalcard'));
@ -66,55 +66,61 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
{
$error=0;
$datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
$datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
$datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
$datesp=dol_mktime(12,0,0, $_POST["datespmonth"], $_POST["datespday"], $_POST["datespyear"]);
$dateep=dol_mktime(12,0,0, $_POST["dateepmonth"], $_POST["dateepday"], $_POST["dateepyear"]);
$sal->accountid=GETPOST("accountid","int");
$sal->fk_user=GETPOST("fk_user","int");
$sal->datev=$datev;
$sal->datep=$datep;
$sal->amount=price2num(GETPOST("amount"));
$sal->label=GETPOST("label");
$sal->datesp=$datesp;
$sal->dateep=$dateep;
$sal->note=GETPOST("note");
$sal->type_payment=GETPOST("paymenttype");
$sal->num_payment=GETPOST("num_payment");
$sal->fk_user_creat=$user->id;
if (empty($datev)) $datev=$datep;
$object->accountid=GETPOST("accountid","int");
$object->fk_user=GETPOST("fk_user","int");
$object->datev=$datev;
$object->datep=$datep;
$object->amount=price2num(GETPOST("amount"));
$object->label=GETPOST("label");
$object->datesp=$datesp;
$object->dateep=$dateep;
$object->note=GETPOST("note");
$object->type_payment=GETPOST("paymenttype");
$object->num_payment=GETPOST("num_payment");
$object->fk_user_creat=$user->id;
// Set user current salary as ref salaray for the payment
$fuser=new User($db);
$fuser->fetch(GETPOST("fk_user","int"));
$sal->salary=$fuser->salary;
$object->salary=$fuser->salary;
if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
$error++;
}
if (empty($sal->fk_user) || $sal->fk_user < 0)
if (empty($object->fk_user) || $object->fk_user < 0)
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Employee")),'errors');
$error++;
}
if (empty($sal->type_payment) || $sal->type_payment < 0)
if (empty($object->type_payment) || $object->type_payment < 0)
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentMode")),'errors');
$error++;
}
if (empty($sal->amount))
if (empty($object->amount))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")),'errors');
$error++;
}
if (! empty($conf->banque->enabled) && ! $object->accountid > 0)
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Account")),'errors');
$error++;
}
if (! $error)
{
$db->begin();
$ret=$sal->create($user);
$ret=$object->create($user);
if ($ret > 0)
{
$db->commit();
@ -124,7 +130,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
else
{
$db->rollback();
setEventMessage($sal->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
$action="create";
}
}
@ -134,19 +140,19 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
if ($action == 'delete')
{
$result=$sal->fetch($id);
$result=$object->fetch($id);
if ($sal->rappro == 0)
if ($object->rappro == 0)
{
$db->begin();
$ret=$sal->delete($user);
$ret=$object->delete($user);
if ($ret > 0)
{
if ($sal->fk_bank)
if ($object->fk_bank)
{
$accountline=new AccountLine($db);
$result=$accountline->fetch($sal->fk_bank);
$result=$accountline->fetch($object->fk_bank);
if ($result > 0) $result=$accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
}
@ -158,15 +164,15 @@ if ($action == 'delete')
}
else
{
$sal->error=$accountline->error;
$object->error=$accountline->error;
$db->rollback();
setEventMessage($sal->error,'errors');
setEventMessage($object->error,'errors');
}
}
else
{
$db->rollback();
setEventMessage($sal->error,'errors');
setEventMessage($object->error,'errors');
}
}
else
@ -186,8 +192,8 @@ $form = new Form($db);
if ($id)
{
$salpayment = new PaymentSalary($db);
$result = $salpayment->fetch($id);
$object = new PaymentSalary($db);
$result = $object->fetch($id);
if ($result <= 0)
{
dol_print_error($db);
@ -221,6 +227,8 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewSalaryPayment"),'', 'title_accountancy.png');
dol_fiche_head('', '');
print '<table class="border" width="100%">';
print "<tr>";
@ -228,7 +236,7 @@ if ($action == 'create')
print $form->select_date((empty($datep)?-1:$datep),"datep",'','','','add',1,1);
print '</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("DateValue").'</td><td>';
print '<tr><td>'.$langs->trans("DateValue").'</td><td>';
print $form->select_date((empty($datev)?-1:$datev),"datev",'','','','add',1,1);
print '</td></tr>';
@ -281,7 +289,7 @@ if ($action == 'create')
print '</table>';
print "<br>";
dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
@ -311,45 +319,45 @@ if ($id)
print "<tr>";
print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $salpayment->ref;
print $object->ref;
print '</td></tr>';
// Person
print '<tr><td>'.$langs->trans("Person").'</td><td>';
$usersal=new User($db);
$usersal->fetch($salpayment->fk_user);
$usersal->fetch($object->fk_user);
print $usersal->getNomUrl(1);
print '</td></tr>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$salpayment->label.'</td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
print "<tr>";
print '<td>'.$langs->trans("DateStartPeriod").'</td><td colspan="3">';
print dol_print_date($salpayment->datesp,'day');
print dol_print_date($object->datesp,'day');
print '</td></tr>';
print '<tr><td>'.$langs->trans("DateEndPeriod").'</td><td colspan="3">';
print dol_print_date($salpayment->dateep,'day');
print dol_print_date($object->dateep,'day');
print '</td></tr>';
print "<tr>";
print '<td>'.$langs->trans("DatePayment").'</td><td colspan="3">';
print dol_print_date($salpayment->datep,'day');
print dol_print_date($object->datep,'day');
print '</td></tr>';
print '<tr><td>'.$langs->trans("DateValue").'</td><td colspan="3">';
print dol_print_date($salpayment->datev,'day');
print dol_print_date($object->datev,'day');
print '</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($salpayment->amount,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($object->amount,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
if (! empty($conf->banque->enabled))
{
if ($salpayment->fk_account > 0)
if ($object->fk_account > 0)
{
$bankline=new AccountLine($db);
$bankline->fetch($salpayment->fk_bank);
$bankline->fetch($object->fk_bank);
print '<tr>';
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
@ -362,21 +370,22 @@ if ($id)
// Other attributes
$parameters=array('colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$salpayment,$action); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print '</table>';
print '</div>';
dol_fiche_end();
/*
* Boutons d'actions
*/
print "<div class=\"tabsAction\">\n";
if ($salpayment->rappro == 0)
* Action buttons
*/
print '<div class="tabsAction">'."\n";
if ($object->rappro == 0)
{
if (! empty($user->rights->salaries->delete))
{
print '<a class="butActionDelete" href="card.php?id='.$salpayment->id.'&action=delete">'.$langs->trans("Delete").'</a>';
print '<a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
}
else
{

View File

@ -36,6 +36,7 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'salaries', '', '', '');
$search_ref = GETPOST('search_ref','int');
$search_user = GETPOST('search_user','alpha');
$search_label = GETPOST('search_label','alpha');
$search_amount = GETPOST('search_amount','alpha');
$sortfield = GETPOST("sortfield",'alpha');
@ -46,7 +47,7 @@ $offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$limit = $conf->liste_limit;
if (! $sortfield) $sortfield="s.datev";
if (! $sortfield) $sortfield="s.datep";
if (! $sortorder) $sortorder="DESC";
$filtre=$_GET["filtre"];
@ -85,7 +86,7 @@ $salstatic = new PaymentSalary($db);
$userstatic = new User($db);
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc,";
$sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datev as dm, s.fk_typepayment as type, s.num_payment,";
$sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment,";
$sql.= " pst.code as payment_code";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id,";
@ -95,7 +96,8 @@ $sql.= " AND s.entity = ".$conf->entity;
// Search criteria
if ($search_ref) $sql.=" AND s.rowid=".$search_ref;
if ($search_label) $sql.=" AND s.label LIKE '%".$db->escape($search_label)."%'";
if ($search_user) $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $search_user);
if ($search_label) $sql.=natural_search(array('s.label'), $search_label);
if ($search_amount) $sql.=natural_search("s.amount", $search_amount, 1);
if ($filtre) {
$filtre=str_replace(":","=",$filtre);
@ -129,7 +131,7 @@ if ($result)
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.salary","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datev","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("");
@ -141,11 +143,14 @@ if ($result)
print '<input class="flat" type="text" size="3" name="search_ref" value="'.$search_ref.'">';
print '</td>';
// People
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">';
print '<input class="flat" type="text" size="6" name="search_user" value="'.$search_user.'">';
print '</td>';
// Current salary
print '<td class="liste_titre">&nbsp;</td>';
// Label
print '<td class="liste_titre"><input type="text" class="flat" size="14" name="search_label" value="'.$search_label.'"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.$search_label.'"></td>';
// Date
print '<td class="liste_titre">&nbsp;</td>';
// Type
print '<td class="liste_titre" align="left">';
@ -170,6 +175,7 @@ if ($result)
$userstatic->login=$obj->login;
$userstatic->email=$obj->email;
$userstatic->societe_id=$obj->fk_soc;
$salstatic->id=$obj->rowid;
$salstatic->ref=$obj->rowid;
// Ref
@ -180,7 +186,8 @@ if ($result)
print "<td>".($obj->salary?price($obj->salary):'')."</td>\n";
// Label payment
print "<td>".dol_trunc($obj->label,40)."</td>\n";
print '<td align="left">'.dol_print_date($db->jdate($obj->dm),'day')."</td>\n";
// Date payment
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
// Type
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
// Amount

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
@ -23,7 +23,7 @@
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View File

@ -25,8 +25,8 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
/** \class PaymentSocialContribution
* \brief Class to manage payments of social contributions
/**
* Class to manage payments of social contributions
*/
class PaymentSocialContribution extends CommonObject
{

View File

@ -41,6 +41,8 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
{
global $langs, $hselected;
if (empty($hselected)) $hselected='report';
print "\n\n<!-- debut cartouche rapport -->\n";
$h=0;

View File

@ -33,7 +33,7 @@ function salaries_prepare_head($object) {
$head[$h][0] = DOL_URL_ROOT.'/compta/salaries/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'salaries';
$head[$h][2] = 'card';
$h++;
// Show more tabs from modules
@ -42,11 +42,13 @@ function salaries_prepare_head($object) {
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'salaries');
/*
$head[$h][0] = DOL_URL_ROOT.'/compta/salaries/info.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
*/
complete_head_from_modules($conf,$langs,$object,$head,$h,'salaries', 'remove');
return $head;

View File

@ -102,21 +102,21 @@ function dol_hash($chain,$type=0)
* @param User $user User to check
* @param string $features Features to check (it must be module name. Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...)
* @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional).
* @param string $dbtablename 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity. Not used if objectid is null (optional)
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity. Not used if objectid is null (optional)
* @param string $feature2 Feature to check, second level of permission (optional). Can be or check with 'level1|level2'.
* @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
* @param Canvas $objcanvas Object canvas
* @return int Always 1, die process if not allowed
*/
function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $objcanvas=null)
function restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $objcanvas=null)
{
global $db, $conf;
//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename,$feature2,$dbt_socfield,$dbt_select");
//print "user_id=".$user->id.", features=".$features.", feature2=".$feature2.", objectid=".$objectid;
//print ", dbtablename=".$dbtablename.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
//print ", perm: ".$features."->".$feature2."=".$user->rights->$features->$feature2->lire."<br>";
//print ", perm: ".$features."->".$feature2."=".($user->rights->$features->$feature2->lire)."<br>";
// If we use canvas, we try to use function that overlod restrictarea if provided with canvas
if (is_object($objcanvas))
@ -135,7 +135,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
if (! empty($feature2)) $feature2 = explode("|", $feature2);
// More parameters
$params = explode('&', $dbtablename);
$params = explode('&', $tableandshare);
$dbtablename=(! empty($params[0]) ? $params[0] : '');
$sharedelement=(! empty($params[1]) ? $params[1] : $dbtablename);
@ -331,7 +331,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
// is linked to a company allowed to $user.
if (! empty($objectid) && $objectid > 0)
{
$ok = checkUserAccessToObject($user, $featuresarray,$objectid,$dbtablename,$feature2,$dbt_keyfield,$dbt_select);
$ok = checkUserAccessToObject($user, $featuresarray, $objectid, $tableandshare, $feature2, $dbt_keyfield, $dbt_select);
return $ok ? 1 : accessforbidden();
}
@ -344,19 +344,19 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
* @param User $user User to check
* @param array $featuresarray Features/modules to check
* @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional).
* @param string $dbtablename 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity. Not used if objectid is null (optional)
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity. Not used if objectid is null (optional)
* @param string $feature2 Feature to check, second level of permission (optional). Can be or check with 'level1|level2'.
* @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
*
* @return bool True if user has access, False otherwise
*/
function checkUserAccessToObject($user, $featuresarray, $objectid=0, $dbtablename='', $feature2='', $dbt_keyfield='', $dbt_select='')
function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='', $dbt_select='')
{
global $db, $conf;
// More parameters
$params = explode('&', $dbtablename);
$params = explode('&', $tableandshare);
$dbtablename=(! empty($params[0]) ? $params[0] : '');
$sharedelement=(! empty($params[1]) ? $params[1] : $dbtablename);

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -65,8 +65,21 @@ class ExportExcel extends ModeleExports
$this->version='1.30'; // Driver version
// If driver use an external library, put its name here
$this->label_lib='PhpExcel';
$this->version_lib='1.7.8';
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php';
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php';
require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php';
$this->label_lib='PhpWriteExcel';
$this->version_lib='unknown';
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel.php';
require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
$this->label_lib='PhpExcel';
$this->version_lib='1.8.0'; // No way to get info from library
}
$this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)

View File

@ -64,10 +64,23 @@ class ExportExcel2007 extends ExportExcel
$this->picto='mime/xls'; // Picto
$this->version='1.30'; // Driver version
// If driver use an external library, put its name here
$this->label_lib='PhpExcel';
$this->version_lib='1.7.8';
// If driver use an external library, put its name here
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php';
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php';
require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php';
$this->label_lib='PhpWriteExcel';
$this->version_lib='unknown';
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel.php';
require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
$this->label_lib='PhpExcel';
$this->version_lib='1.8.0'; // No way to get info from library
}
$this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
$this->row=0;

View File

@ -133,6 +133,19 @@ class modSalaries extends DolibarrModules
//--------
$r=0;
$r++;
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Salaries and payments';
$this->export_permission[$r]=array(array("salary","export"));
$this->export_fields_array[$r]=array('u.firstname'=>"Firstname",'u.lastname'=>"Lastname",'u.login'=>"Login",'u.salary'=>'CurrentSalary','p.rowid'=>'PaymentId','p.datep'=>'DatePayment','p.datesp'=>'DateStartPeriod','p.dateep'=>'DateEndPeriod','p.amount'=>'AmountPayment','p.num_paiement'=>'Numero','p.label'=>'Label','p.note'=>'Note');
$this->export_TypeFields_array[$r]=array('u.firstname'=>"Text",'u.lastname'=>"Text",'u.login'=>'Text','u.salary'=>"Number",'p.datep'=>'Date','p.datesp'=>'Date','p.dateep'=>'Date','p.amount'=>'Number','p.num_paiement'=>'Number','p.label'=>'Text');
$this->export_entities_array[$r]=array('u.firstname'=>'user','u.lastname'=>'user','u.login'=>'user','u.salary'=>'user','p.datep'=>'payment','p.datesp'=>'payment','p.dateep'=>'payment','p.amount'=>'payment','p.label'=>'payment','p.note'=>'payment','p.num_paiement'=>'payment');
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'user as u';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementsalary as p ON p.fk_user = u.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as cp ON p.fk_typepaiement = cp.rowid';
$this->export_sql_end[$r] .=' AND u.entity IN ('.getEntity('user',1).')';
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
@ -64,6 +64,7 @@ $hookmanager->initHooks(array('doncard','globalcard'));
/*
* Actions
*/
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -227,6 +228,7 @@ if ($action == 'set_paid')
/*
* Build doc
*/
if ($action == 'builddoc')
{
$object = new Don($db);
@ -265,21 +267,17 @@ $formfile = new FormFile($db);
$formcompany = new FormCompany($db);
/* ************************************************************************** */
/* */
/* Donation card in create mode */
/* */
/* ************************************************************************** */
if ($action == 'create')
{
print_fiche_titre($langs->trans("AddDonation"));
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">';
print '<input type="hidden" name="action" value="add">';
dol_fiche_head('');
print '<table class="border" width="100%">';
$nbrows=11;
if (! empty($conf->projet->enabled)) $nbrows++;
@ -343,7 +341,7 @@ if ($action == 'create')
$formproject=new FormProjets($db);
print "<tr><td>".$langs->trans("Project")."</td><td>";
$formproject->select_projects(-1, GETPOST("fk_projet"),'fk_projet', 0, 1, 0, 1);
$formproject->select_projects(-1, GETPOST("fk_projet"),'fk_projet', 0, 0, 1, 1);
print "</td></tr>\n";
}
@ -356,7 +354,11 @@ if ($action == 'create')
}
print "</table>\n";
print '<br><div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print "</form>\n";
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
@ -98,7 +98,7 @@ foreach ($listofstatus as $status)
if ($conf->use_javascript_ajax)
{
print '<tr><td align="center" colspan="4">';
print '<tr '.$bc[false].'><td align="center" colspan="4">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1);
print '</td></tr>';

View File

@ -546,7 +546,7 @@ if ($id > 0 || ! empty($ref))
}
print "</tr>\n";
// Show subproducts details
// Show subproducts lines
if ($objp->fk_product > 0 && ! empty($conf->global->PRODUIT_SOUSPRODUITS))
{
// Set tree of subproducts in product->sousprods
@ -560,20 +560,16 @@ if ($id > 0 || ! empty($ref))
{
foreach($prods_arbo as $key => $value)
{
print '<tr><td colspan="4">';
$img='';
if ($value['stock'] < $value['stock_alert'])
{
$img=img_warning($langs->trans("StockTooLow"));
}
print '<tr><td>&nbsp; &nbsp; &nbsp; -> <a href="'.DOL_URL_ROOT."/product/card.php?id=".$value['id'].'">'.$value['fullpath'].'</a> ('.$value['nb'].')</td>';
print '<tr '.$bc[$var].'><td>&nbsp; &nbsp; &nbsp; -> <a href="'.DOL_URL_ROOT."/product/card.php?id=".$value['id'].'">'.$value['fullpath'].'</a> ('.$value['nb'].')</td>';
print '<td align="center"> '.$value['nb_total'].'</td>';
print '<td>&nbsp</td>';
print '<td>&nbsp</td>';
print '<td align="center">'.$value['stock'].' '.$img.'</td></tr>'."\n";
print '</td></tr>'."\n";
}
}
}

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -52,7 +52,7 @@ print $langs->trans("FormatedExportDesc3").'<br>';
print '<br>';
print '<div class="fichecenter"><div class="fichethirdleft">';
print '<div class="fichecenter"><div class="fichehalfleft">';
// List export set
@ -110,7 +110,7 @@ if (count($export->array_export_code))
print '</div>';
print '<br>';
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of available export format

View File

@ -1018,6 +1018,8 @@ if ($action == 'create')
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
dol_fiche_head('');
print '<table class="border" width="100%">';
print '<input type="hidden" name="socid" value='.$soc->id.'>';
@ -1122,7 +1124,9 @@ if ($action == 'create')
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
}
print '<br><div class="center">';
dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("CreateDraftIntervention").'">';
print '</div>';
@ -1130,6 +1134,8 @@ if ($action == 'create')
}
else
{
dol_fiche_head('');
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<table class="border" width="100%">';
print '<tr><td class="fieldrequired">'.$langs->trans("ThirdParty").'</td><td>';
@ -1137,7 +1143,9 @@ if ($action == 'create')
print '</td></tr>';
print '</table>';
print '<br><div class="center">';
dol_fiche_end();
print '<div class="center">';
print '<input type="hidden" name="action" value="create">';
print '<input type="submit" class="button" value="'.$langs->trans("CreateDraftIntervention").'">';
print '</div>';

View File

@ -1478,6 +1478,8 @@ if ($action=='create')
print '<input type="hidden" name="origin" value="' . $origin . '">';
print '<input type="hidden" name="originid" value="' . $originid . '">';
dol_fiche_head('');
print '<table class="border" width="100%">';
// Ref
@ -1600,7 +1602,9 @@ if ($action=='create')
// Bouton "Create Draft"
print "</table>\n";
print '<br><div class="center"><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'"></div>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'"></div>';
print "</form>\n";

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley <marc@ocebo.fr>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
@ -1318,6 +1318,8 @@ if ($action == 'create')
$datedue=($datetmp==''?-1:$datetmp);
}
dol_fiche_head();
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
@ -1572,7 +1574,9 @@ if ($action == 'create')
// Bouton "Create Draft"
print "</table>\n";
print '<br><div class="center"><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'"></div>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'"></div>';
print "</form>\n";

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* 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

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -48,7 +48,7 @@ print $langs->trans("FormatedImportDesc2").'<br>';
print '<br>';
print '<div class="fichecenter"><div class="fichethirdleft">';
print '<div class="fichecenter"><div class="fichehalfleft">';
// List of import set
@ -101,7 +101,7 @@ print '</div>';
print '<br>';
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of available import format

View File

@ -78,6 +78,15 @@ ALTER TABLE llx_extrafields ADD COLUMN list integer DEFAULT 0 after perms;
ALTER TABLE llx_payment_salary ADD COLUMN salary real after datev;
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_ref (num_payment);
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_user (fk_user, entity);
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_datep (datep);
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_datesp (datesp);
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_dateep (dateep);
ALTER TABLE llx_payment_salary ADD CONSTRAINT fk_payment_salary_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid);
UPDATE llx_projet_task_time SET task_datehour = task_date where task_datehour IS NULL;
ALTER TABLE llx_projet_task_time ADD COLUMN task_date_withhour integer DEFAULT 0 after task_datehour;

View File

@ -0,0 +1,27 @@
-- ============================================================================
-- Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ============================================================================
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_ref (num_payment);
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_user (fk_user, entity);
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_datep (datep);
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_datesp (datesp);
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_dateep (dateep);
ALTER TABLE llx_payment_salary ADD CONSTRAINT fk_payment_salary_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid);

View File

@ -22,14 +22,14 @@ create table llx_payment_salary
tms timestamp,
fk_user integer NOT NULL,
datep date, -- date de paiement
datev date, -- date de valeur
datev date, -- date de valeur (this field should not be here, only into bank tables)
salary real, -- salary of user when payment was done
amount real NOT NULL DEFAULT 0,
fk_typepayment integer NOT NULL,
num_payment varchar(50),
num_payment varchar(50), -- ref
label varchar(255),
datesp date, -- date de début de la période
dateep date, -- date de fin de la période
datesp date, -- date start period
dateep date, -- date end period
entity integer DEFAULT 1 NOT NULL, -- multi company id
note text,
fk_bank integer,

View File

@ -492,8 +492,8 @@ Module400Name=Projects/Opportunities/Leads
Module400Desc=Management of projects, opportunities or leads. You can then assign any element (invoice, order, proposal, intervention, ...) to a project and get a transversal view from the project view.
Module410Name=Webcalendar
Module410Desc=Webcalendar integration
Module500Name=Special expenses (tax, social contributions, dividends)
Module500Desc=Management of special expenses like taxes, social contribution, dividends and salaries
Module500Name=Special expenses
Module500Desc=Management of special expenses (taxes, social contribution, dividends)
Module510Name=Salaries
Module510Desc=Management of employees salaries and payments
Module520Name=Loan

View File

@ -204,6 +204,7 @@ ClickHereToGoTo=Click here to go to %s
YouMustClickToChange=You must however first click on the following link to validate this password change
ForgetIfNothing=If you didn't request this change, just forget this email. Your credentials are kept safe.
IfAmountHigherThan=If amount higher than <strong>%s</strong>
SourcesRepository=Repository for sources
##### Calendar common #####
AddCalendarEntry=Add entry in calendar %s

View File

@ -375,10 +375,21 @@ else print $langs->trans("NewSubscriptionDesc",$conf->global->MAIN_INFO_SOCIETE_
dol_htmloutput_errors($errmsg);
print '<div align="center">';
print '<div id="divsubscribe">';
// Print form
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newmember">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" / >';
print '<input type="hidden" name="entity" value="'.$entity.'" />';
print '<input type="hidden" name="action" value="add" />';
print '<br>'.$langs->trans("FieldsWithAreMandatory",'*').'<br>';
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
dol_fiche_head('');
print '<script type="text/javascript">
jQuery(document).ready(function () {
jQuery(document).ready(function () {
@ -403,13 +414,7 @@ jQuery(document).ready(function () {
});
</script>';
// Print form
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newmember">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" / >';
print '<input type="hidden" name="entity" value="'.$entity.'" />';
print '<input type="hidden" name="action" value="add" />';
print '<div id="divsubscribe">';
print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n";
// Type
@ -591,8 +596,10 @@ if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)
}
print "</table>\n";
dol_fiche_end();
// Save
print '<br><div class="center">';
print '<div class="center">';
print '<input type="submit" value="'.$langs->trans("Save").'" id="submitsave" class="button">';
if (! empty($backtopage))
{
@ -600,10 +607,12 @@ if (! empty($backtopage))
}
print '</div>';
print "<br></div></form>\n";
print '</div>';
print
print "</form>\n";
print "<br>";
print '</div></div>';
llxFooterVierge();
$db->close();

View File

@ -1781,7 +1781,7 @@ table.nobordernopadding tr {
}
table.nobordernopadding tr td {
border: 0px;
padding: 0 3px 0 0 !important;
padding: 0 3px 0 0;
}
table.border tr td table.nobordernopadding tr td {
padding-top: 0px;

View File

@ -75,7 +75,7 @@ if ($user->societe_id > 0) $socid = $user->societe_id;
$feature2='user';
if ($user->id == $id) { $feature2=''; $canreaduser=1; } // A user can always read its own card
if (!$canreaduser) {
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
}
if ($user->id <> $id && ! $canreaduser) accessforbidden();

View File

@ -39,7 +39,7 @@ if ($user->id == $id) // A user can always read its own card
{
$feature2='';
}
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
/*

View File

@ -68,7 +68,7 @@ if ($user->societe_id > 0) $socid = $user->societe_id;
$feature2='user';
if ($user->id == $id) { $feature2=''; $canreaduser=1; } // A user can always read its own card
if (!$canreaduser) {
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
}
if ($user->id <> $id && ! $canreaduser) accessforbidden();

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
*
@ -116,7 +116,7 @@ $nbofentries=(count($data) - 1);
if ($nbofentries > 0)
{
print '<tr '.$bc[true].'><td colspan="3">';
print '<tr '.$bc[false].'><td colspan="3">';
tree_recur($data,$data[0],0);
print '</td></tr>';
}

View File

@ -45,6 +45,7 @@ $search_login=GETPOST('search_login','alpha');
$search_lastname=GETPOST('search_lastname','alpha');
$search_firstname=GETPOST('search_firstname','alpha');
$search_statut=GETPOST('search_statut','alpha');
$search_thirdparty=GETPOST('search_thirdparty','alpha');
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
@ -90,19 +91,14 @@ else
{
$sql.= " WHERE u.entity IN (".getEntity('user',1).")";
}
if (! empty($socid)) $sql.= " AND u.fk_soc = ".$socid;
if (! empty($search_user))
{
$sql.= " AND (u.login LIKE '%".$db->escape($search_user)."%' OR u.lastname LIKE '%".$db->escape($search_user)."%' OR u.firstname LIKE '%".$db->escape($search_user)."%')";
}
if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid;
if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user);
if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty);
if ($search_login != '') $sql.= natural_search("u.login", $search_login);
if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname);
if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname);
if ($search_statut != '' && $search_statut >= 0)
{
$sql.= " AND (u.statut=".$search_statut.")";
}
if ($sall) $sql.= " AND (u.login LIKE '%".$db->escape($sall)."%' OR u.lastname LIKE '%".$db->escape($sall)."%' OR u.firstname LIKE '%".$db->escape($sall)."%' OR u.email LIKE '%".$db->escape($sall)."%' OR u.note LIKE '%".$db->escape($sall)."%')";
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")";
if ($sall) $sql.= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $sall);
$sql.=$db->order($sortfield,$sortorder);
$result = $db->query($sql);
@ -133,13 +129,14 @@ if ($result)
print_liste_field_titre('');
print "</tr>\n";
// SearchBar
$colspan=4;
// Search bar
$colspan=3;
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) $colspan++;
print '<tr class="liste_titre">';
print '<td><input type="text" name="search_login" size="6" value="'.$search_login.'"></td>';
print '<td><input type="text" name="search_lastname" size="6" value="'.$search_lastname.'"></td>';
print '<td><input type="text" name="search_firstname" size="6" value="'.$search_firstname.'"></td>';
print '<td><input type="text" name="search_thirdparty" size="6" value="'.$search_thirdparty.'"></td>';
print '<td colspan="'.$colspan.'">&nbsp;</td>';
// Status

View File

@ -42,7 +42,7 @@ if ($user->id == $id) // A user can always read its own card
{
$feature2='';
}
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
// If user is not user read and no permission to read other users, we stop
if (($fuser->id != $user->id) && (! $user->rights->user->user->lire))

View File

@ -39,7 +39,7 @@ $socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id;
$feature2 = (($socid && $user->rights->user->self->creer)?'':'user');
if ($user->id == $id) $feature2=''; // A user can always read its own card
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
$fuser = new User($db);
$fuser->fetch($id);

View File

@ -46,7 +46,7 @@ $socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id;
$feature2 = (($socid && $user->rights->user->self->creer)?'':'user');
if ($user->id == $id) $feature2=''; // A user can always read its own card
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);

View File

@ -55,7 +55,7 @@ if ($user->id == $id) // A user can always read its own card
$feature2='';
$canreaduser=1;
}
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
if ($user->id <> $id && ! $canreaduser) accessforbidden();
$dirtop = "../core/menus/standard";

View File

@ -64,7 +64,7 @@ if ($user->id == $id && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user-
$canreaduser=1;
}
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
if ($user->id <> $id && ! $canreaduser) accessforbidden();