Merge pull request #6902 from aspangaro/6.0-salary
NEW : Move employee in dol_banner in salaries
This commit is contained in:
commit
478349174c
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
/* Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
|
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
|
||||||
@ -332,22 +332,23 @@ if ($id)
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
$morehtmlref='<div class="refidno">';
|
||||||
|
|
||||||
|
$userstatic=new User($db);
|
||||||
|
$userstatic->fetch($object->fk_user);
|
||||||
|
|
||||||
|
$morehtmlref.=$langs->trans('Employee') . ' : ' . $userstatic->getNomUrl(1);
|
||||||
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', '');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Employee
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Employee").'</td><td>';
|
|
||||||
$usersal=new User($db);
|
|
||||||
$usersal->fetch($object->fk_user);
|
|
||||||
print $usersal->getNomUrl(1);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td>'.$langs->trans("DateStartPeriod").'</td><td colspan="3">';
|
print '<td>'.$langs->trans("DateStartPeriod").'</td><td colspan="3">';
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -36,7 +36,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
|
||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
$langs->load("users");
|
||||||
$langs->load("salaries");
|
$langs->load("salaries");
|
||||||
|
$langs->load('hrm');
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
@ -83,7 +85,6 @@ $form = new Form($db);
|
|||||||
|
|
||||||
llxHeader("",$langs->trans("SalaryPayment"));
|
llxHeader("",$langs->trans("SalaryPayment"));
|
||||||
|
|
||||||
|
|
||||||
if ($object->id)
|
if ($object->id)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
@ -92,7 +93,6 @@ if ($object->id)
|
|||||||
|
|
||||||
dol_fiche_head($head, 'documents', $langs->trans("SalaryPayment"), 0, 'payment');
|
dol_fiche_head($head, 'documents', $langs->trans("SalaryPayment"), 0, 'payment');
|
||||||
|
|
||||||
|
|
||||||
// Construit liste des fichiers
|
// Construit liste des fichiers
|
||||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||||
$totalsize=0;
|
$totalsize=0;
|
||||||
@ -101,29 +101,34 @@ if ($object->id)
|
|||||||
$totalsize+=$file['size'];
|
$totalsize+=$file['size'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
$morehtmlref='<div class="refidno">';
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
$userstatic=new User($db);
|
||||||
|
$userstatic->fetch($object->fk_user);
|
||||||
|
|
||||||
// Ref
|
$morehtmlref.=$langs->trans('Employee') . ' : ' . $userstatic->getNomUrl(1);
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
$morehtmlref.='</div>';
|
||||||
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Societe
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', '');
|
||||||
//print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>";
|
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
print '<div class="fichecenter">';
|
||||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
print '</div>';
|
print '<table class="border" width="100%">';
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||||
|
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
$modulepart = 'salaries';
|
print '</div>';
|
||||||
$permission = $user->rights->salaries->write;
|
|
||||||
$param = '&id=' . $object->id;
|
dol_fiche_end();
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
|
||||||
|
$modulepart = 'salaries';
|
||||||
|
$permission = $user->rights->salaries->write;
|
||||||
|
$param = '&id=' . $object->id;
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2015 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>
|
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
|
||||||
|
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -29,7 +30,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|||||||
|
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
$langs->load("users");
|
||||||
$langs->load("salaries");
|
$langs->load("salaries");
|
||||||
|
$langs->load('hrm');
|
||||||
|
|
||||||
$id=GETPOST('id','int');
|
$id=GETPOST('id','int');
|
||||||
$action=GETPOST('action','aZ09');
|
$action=GETPOST('action','aZ09');
|
||||||
@ -46,21 +49,37 @@ $result = restrictedArea($user, 'salaries', '', '', '');
|
|||||||
|
|
||||||
llxHeader("",$langs->trans("SalaryPayment"));
|
llxHeader("",$langs->trans("SalaryPayment"));
|
||||||
|
|
||||||
$salpayment = new PaymentSalary($db);
|
$object = new PaymentSalary($db);
|
||||||
$result = $salpayment->fetch($id);
|
$object->fetch($id);
|
||||||
$salpayment->info($id);
|
$object->info($id);
|
||||||
|
|
||||||
$head = salaries_prepare_head($salpayment);
|
$head = salaries_prepare_head($object);
|
||||||
|
|
||||||
dol_fiche_head($head, 'info', $langs->trans("SalaryPayment"), 0, 'payment');
|
dol_fiche_head($head, 'info', $langs->trans("SalaryPayment"), 0, 'payment');
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$morehtmlref='<div class="refidno">';
|
||||||
|
|
||||||
|
$userstatic=new User($db);
|
||||||
|
$userstatic->fetch($object->fk_user);
|
||||||
|
|
||||||
|
$morehtmlref.=$langs->trans('Employee') . ' : ' . $userstatic->getNomUrl(1);
|
||||||
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', '');
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
print '<table width="100%"><tr><td>';
|
||||||
dol_print_object_info($salpayment);
|
dol_print_object_info($object);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user