Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
c64ffb3087
12
ChangeLog
12
ChangeLog
@ -33,6 +33,7 @@ For users:
|
||||
Differentiate text and img.
|
||||
Use label into quick search form.
|
||||
Use accesskey on form search.
|
||||
- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
|
||||
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
|
||||
- Fix: [ bug #1470, #1472, #1473] User trigger problem
|
||||
- Fix: [ bug #1489, #1491 ] Intervention trigger problem
|
||||
@ -187,9 +188,19 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
|
||||
|
||||
|
||||
***** ChangeLog for 3.5.5 compared to 3.5.4 *****
|
||||
Fix: Holiday module was broken. Initializaion of amount of holidays failed.
|
||||
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
|
||||
Fix: Fusion PDF button on unpaid invoice is no more displayed
|
||||
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click)
|
||||
Fix: Pb when showing log list of holiday module with some mysql versions.
|
||||
Fix: Error with bad timezone pushed by some browsers.
|
||||
Fix: shipping list SQL request was not filtering on shipping element
|
||||
Fix: debian package provided by dolibarr team must use embedded libraries.
|
||||
Fix: [ bug #1528 ] Leopard Services numeration module description is not translated.
|
||||
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas
|
||||
Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances
|
||||
Fix: Update impayees.php
|
||||
Fix: Fix Link product, In list view and label product
|
||||
|
||||
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
|
||||
Fix: Hide title of event when agenda module disabled.
|
||||
@ -499,6 +510,7 @@ Fix: Add a limit into list to avoid browser to hang when database is too large.
|
||||
Fix: [ bug #1212 ] 'jqueryFileTree.php' directory traversal vulnerability
|
||||
Fix: Agenda and Banks module were not working with multicompany module
|
||||
Fix: [ bug #1317 ] Removing a category does not remove all child categories
|
||||
Fix: [ bug #1380 ] Customer invoices are not grouped in company results report.
|
||||
|
||||
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
|
||||
Fix: field's problem into company's page (RIB).
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2289,6 +2289,8 @@ if ($action == 'create') {
|
||||
*/
|
||||
if ($action == 'presend')
|
||||
{
|
||||
$object->fetch_projet();
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
||||
@ -2341,7 +2343,7 @@ if ($action == 'create') {
|
||||
if (empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__');
|
||||
} else if (! empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__(__REFCLIENT__)');
|
||||
$formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__ (__REFCLIENT__)');
|
||||
}
|
||||
$formmail->withfile = 2;
|
||||
$formmail->withbody = 1;
|
||||
@ -2352,6 +2354,8 @@ if ($action == 'create') {
|
||||
$formmail->substit ['__PROPREF__'] = $object->ref;
|
||||
$formmail->substit ['__SIGNATURE__'] = $user->signature;
|
||||
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
|
||||
$formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
|
||||
$formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
|
||||
$formmail->substit ['__PERSONALIZED__'] = '';
|
||||
$formmail->substit ['__CONTACTCIVNAME__'] = '';
|
||||
|
||||
@ -2362,7 +2366,7 @@ if ($action == 'create') {
|
||||
|
||||
if (is_array($contactarr) && count($contactarr) > 0) {
|
||||
foreach ($contactarr as $contact) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_propal_external_CUSTOMER')) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_propal_external_CUSTOMER')) { // TODO Use code and not label
|
||||
$contactstatic = new Contact($db);
|
||||
$contactstatic->fetch($contact ['id']);
|
||||
$custcontact = $contactstatic->getFullName($langs, 1);
|
||||
|
||||
@ -2431,6 +2431,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
*/
|
||||
if ($action == 'presend')
|
||||
{
|
||||
$object->fetch_projet();
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
||||
@ -2483,7 +2485,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
if (empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__');
|
||||
} else if (! empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__(__REFCLIENT__)');
|
||||
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__ (__REFCLIENT__)');
|
||||
}
|
||||
$formmail->withfile = 2;
|
||||
$formmail->withbody = 1;
|
||||
@ -2493,6 +2495,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
$formmail->substit ['__ORDERREF__'] = $object->ref;
|
||||
$formmail->substit ['__SIGNATURE__'] = $user->signature;
|
||||
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
|
||||
$formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
|
||||
$formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
|
||||
$formmail->substit ['__PERSONALIZED__'] = '';
|
||||
$formmail->substit ['__CONTACTCIVNAME__'] = '';
|
||||
|
||||
@ -2502,7 +2506,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
|
||||
if (is_array($contactarr) && count($contactarr) > 0) {
|
||||
foreach ($contactarr as $contact) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label
|
||||
$contactstatic = new Contact($db);
|
||||
$contactstatic->fetch($contact ['id']);
|
||||
$custcontact = $contactstatic->getFullName($langs, 1);
|
||||
|
||||
@ -3638,11 +3638,15 @@ if ($action == 'create')
|
||||
$somethingshown = $formactions->showactions($object, 'invoice', $socid);
|
||||
|
||||
print '</div></div></div>';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Affiche formulaire mail
|
||||
* Action presend (or prerelance)
|
||||
*/
|
||||
|
||||
$object->fetch_projet();
|
||||
|
||||
// By default if $action=='presend'
|
||||
$titreform = 'SendBillByMail';
|
||||
$topicmail = 'SendBillRef';
|
||||
@ -3710,8 +3714,9 @@ if ($action == 'create')
|
||||
if (empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__');
|
||||
} else if (! empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__(__REFCLIENT__)');
|
||||
$formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__ (__REFCLIENT__)');
|
||||
}
|
||||
|
||||
$formmail->withfile = 2;
|
||||
$formmail->withbody = 1;
|
||||
$formmail->withdeliveryreceipt = 1;
|
||||
@ -3720,6 +3725,8 @@ if ($action == 'create')
|
||||
$formmail->substit ['__FACREF__'] = $object->ref;
|
||||
$formmail->substit ['__SIGNATURE__'] = $user->signature;
|
||||
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
|
||||
$formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
|
||||
$formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
|
||||
$formmail->substit ['__PERSONALIZED__'] = '';
|
||||
$formmail->substit ['__CONTACTCIVNAME__'] = '';
|
||||
|
||||
@ -3730,7 +3737,7 @@ if ($action == 'create')
|
||||
|
||||
if (is_array($contactarr) && count($contactarr) > 0) {
|
||||
foreach ($contactarr as $contact) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_facture_external_BILLING')) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_facture_external_BILLING')) { // TODO Use code and not label
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
//###################
|
||||
|
||||
// dolibarr_main_url_root
|
||||
// This parameter defines the root URL of your Dolibarr index.php page.
|
||||
// It must link to the htdocs directory htdocs.
|
||||
// This parameter defines the root URL of your Dolibarr index.php page without ending "/".
|
||||
// It must link to the directory htdocs.
|
||||
// In most cases, this is autodetected but it's still required
|
||||
// * to show full url bookmarks for some services (ie: agenda rss export url, ...)
|
||||
// * or when using Apache dir aliases (autodetect fails)
|
||||
|
||||
@ -838,7 +838,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
||||
}
|
||||
|
||||
// Show page nb only on iso languages (so default Helvetica font)
|
||||
if (mb_strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica')
|
||||
if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica')
|
||||
{
|
||||
$pdf->SetXY(-20,-$posy);
|
||||
//print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
|
||||
|
||||
@ -92,7 +92,7 @@ if (! empty($dolibarr_main_prod)) ini_set('display_errors','Off');
|
||||
|
||||
// Clean parameters
|
||||
$dolibarr_main_data_root=trim($dolibarr_main_data_root);
|
||||
$dolibarr_main_url_root=trim($dolibarr_main_url_root);
|
||||
$dolibarr_main_url_root=trim(preg_replace('/\/+$/','',$dolibarr_main_url_root));
|
||||
$dolibarr_main_url_root_alt=(empty($dolibarr_main_url_root_alt)?'':trim($dolibarr_main_url_root_alt));
|
||||
$dolibarr_main_document_root=trim($dolibarr_main_document_root);
|
||||
$dolibarr_main_document_root_alt=(empty($dolibarr_main_document_root_alt)?'':trim($dolibarr_main_document_root_alt));
|
||||
|
||||
225
htdocs/holiday/admin/tomergewithholiday.php
Executable file
225
htdocs/holiday/admin/tomergewithholiday.php
Executable file
@ -0,0 +1,225 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012-2103 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Page module configuration paid holiday.
|
||||
*
|
||||
* \file holiday.php
|
||||
* \ingroup holiday
|
||||
* \brief Page module configuration paid holiday.
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT. '/core/class/html.form.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT. '/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT. '/user/class/usergroup.class.php';
|
||||
|
||||
// Si pas administrateur
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
// Vérification si module activé
|
||||
if (empty($conf->holiday->enabled)) print $langs->trans('NotActiveModCP');
|
||||
|
||||
llxheader('',$langs->trans('TitleAdminCP'));
|
||||
|
||||
print_fiche_titre($langs->trans('MenuCPTypes'));
|
||||
|
||||
echo '<div id="types">';
|
||||
|
||||
echo '<table class="noborder" style="width: 100%;">';
|
||||
echo '<tr class="liste_titre">';
|
||||
echo '<td style="width: 150px">' . $langs->trans('TypeLabel') . '</td>';
|
||||
echo '<td>' . $langs->trans('TypeDescription') . '</td>';
|
||||
echo '<td style="text-align: center; width: 100px">' . $langs->trans('TypeAffect') . '</td>';
|
||||
echo '<td style="text-align: center; width: 50px">' . $langs->trans('TypeDelay') . '</td>';
|
||||
echo '<td style="text-align: center;">' . $langs->trans('nbCongesDeductedCPMini') . '</td>';
|
||||
echo '<td style="text-align: center;">' . $langs->trans('nbCongesEveryMonthCPMini') . '</td>';
|
||||
echo '<td style="width: 40px"></td>';
|
||||
echo '</tr>';
|
||||
|
||||
$types = $db->query(
|
||||
"SELECT *
|
||||
FROM llx_congespayes_types
|
||||
WHERE deleteAt IS NULL
|
||||
ORDER BY label"
|
||||
);
|
||||
|
||||
while($type = $db->fetch_array($types))
|
||||
{
|
||||
echo'
|
||||
<tr id="row_'.$type['rowid'].'" '.$bc[$var=!$var].'>
|
||||
<td>'.$type['label'].'</td>
|
||||
<td>'.($type['description']?$type['description']:'N/A').'</td>
|
||||
<td style="font-weight: bold; text-align: center">
|
||||
'.($type['affect']?$langs->trans('TypeAffectYes'):$langs->trans('TypeAffectNo')).'
|
||||
</td>
|
||||
<td style="text-align: center">'.$type['delay'].'</td>
|
||||
<td style="text-align: center">'.$type['nbCongesDeducted'].'</td>
|
||||
<td style="text-align: center">'.$type['nbCongesEveryMonth'].'</td>
|
||||
<td>
|
||||
<img class="btn edit" data-rowid="'.$type['rowid'].'" src="../img/edit.png" title="'.$langs->trans('TypeBtnEdit').'">
|
||||
<img class="btn delete" data-rowid="'.$type['rowid'].'" src="../img/delete.png" title="'.$langs->trans('TypeBtnDelete').'">
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="form_'.$type['rowid'].'" '.$bc[$var].' style="display: none">
|
||||
<td colspan="7">
|
||||
<form>
|
||||
<input type="hidden" name="rowid" value="'.$type['rowid'].'">
|
||||
<div>
|
||||
<label>' . $langs->trans('TypeLabel') . '</label>
|
||||
<input class="text" maxlength="45" name="label" type="text" value="'.$type['label'].'">
|
||||
</div>
|
||||
<div>
|
||||
<label>' . $langs->trans('TypeDescription') . '</label>
|
||||
<textarea name="description">'.$type['description'].'</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label>' . $langs->trans('TypeDelay') . '</label>
|
||||
<input class="text" maxlength="2" name="delay" type="text" value="'.$type['delay'].'" style="width: 50px">
|
||||
</div>
|
||||
<div>
|
||||
<label>' . $langs->trans('TypeAffect') . '</label>
|
||||
<select name="affect">
|
||||
<option value="1"'.($type['affect']?' selected="selected"':'').'>
|
||||
'.$langs->trans('TypeAffectYes').'
|
||||
</option>
|
||||
<option value="0"'.($type['affect']?'':' selected="selected"').'>
|
||||
'.$langs->trans('TypeAffectNo').'
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label>' . $langs->trans('nbCongesDeductedCPMini') . '</label>
|
||||
<input class="text" maxlength="5" name="nbCongesDeducted" type="text"
|
||||
value="'.$type['nbCongesDeducted'].'" style="width: 50px">
|
||||
</div>
|
||||
<div>
|
||||
<label>' . $langs->trans('nbCongesEveryMonthCPMini') . '</label>
|
||||
<input class="text" maxlength="5" name="nbCongesEveryMonth" type="text"
|
||||
value="'.$type['nbCongesEveryMonth'].'" style="width: 50px">
|
||||
</div>
|
||||
<div style="text-align: right">
|
||||
<input class="btn btn-primary button " type="submit" value="'.$langs->trans('TypeBtnApply').'">
|
||||
<input data-rowid="'.$type['rowid'].'" class="btn cancel button" type="button" value="'.$langs->trans('TypeBtnCancel').'">
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
|
||||
echo '
|
||||
<tr id="row_new" '.$bc[!$var].'>
|
||||
<td colspan="7" style="text-align: right;">
|
||||
<img class="btn" id="new" src="../img/add.png" title="'.$langs->trans('TypeBtnAdd').'">
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="form_new" '.$bc[!$var].' style="display:none">
|
||||
<td colspan="7">
|
||||
<form>
|
||||
<div>
|
||||
<label>' . $langs->trans('TypeLabel') . '</label>
|
||||
<input class="text" maxlength="45" name="label" type="text">
|
||||
</div>
|
||||
<div>
|
||||
<label>' . $langs->trans('TypeDescription') . '</label>
|
||||
<textarea name="description"></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label>' . $langs->trans('TypeDelay') . '</label>
|
||||
<input class="text" maxlength="2" name="delay" type="text" value="0" style="width: 50px">
|
||||
</div>
|
||||
<div>
|
||||
<label>' . $langs->trans('TypeAffect') . '</label>
|
||||
<select name="affect">
|
||||
<option value="1">'.$langs->trans('TypeAffectYes').'</option>
|
||||
<option value="0">'.$langs->trans('TypeAffectNo').'</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label>' . $langs->trans('nbCongesDeductedCPMini') . '</label>
|
||||
<input class="text" maxlength="5" name="nbCongesDeducted" type="text"
|
||||
value="0" style="width: 50px">
|
||||
</div>
|
||||
<div>
|
||||
<label>' . $langs->trans('nbCongesEveryMonthCPMini') . '</label>
|
||||
<input class="text" maxlength="5" name="nbCongesEveryMonth" type="text"
|
||||
value="0" style="width: 50px">
|
||||
</div>
|
||||
<div style="text-align: right">
|
||||
<input class="btn btn-primary" type="submit" value="'.$langs->trans('TypeBtnAdd').'">
|
||||
<input class="btn cancel" type="button" value="'.$langs->trans('TypeBtnCancel').'">
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script>
|
||||
$(function(){
|
||||
$(".cancel", "#types").click(function(){
|
||||
var rowid = false;
|
||||
if(rowid = $(this).data("rowid")) {
|
||||
$("#row_"+rowid, "#types").show();
|
||||
$("#form_"+rowid, "#types").hide();
|
||||
} else {
|
||||
$("#row_new", "#types").show();
|
||||
$("#form_new", "#types").hide();
|
||||
}
|
||||
});
|
||||
$(".edit", "#types").click(function(){
|
||||
var rowid = $(this).data("rowid");
|
||||
$("#row_"+rowid, "#types").hide();
|
||||
$("#form_"+rowid, "#types").show();
|
||||
});
|
||||
$("#new", "#types").click(function(){
|
||||
$("#row_new", "#types").hide();
|
||||
$("#form_new", "#types").show();
|
||||
});
|
||||
$("form", "#types").submit(function(){
|
||||
$.post("ajax/types_editor.php", $(this).serialize(), function(response) {
|
||||
if(response.status) window.location.reload();
|
||||
else alert(response.content);
|
||||
}, "json");
|
||||
return false;
|
||||
});
|
||||
$(".delete", "#types").click(function(){
|
||||
if(confirm("'.$langs->trans('TypeBtnDeleteConfirmation').'")) {
|
||||
$.post("ajax/types_delete.php", {
|
||||
rowid: $(this).data("rowid")
|
||||
}, function(response) {
|
||||
if(response.status) window.location.reload();
|
||||
else alert(response.content);
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -79,7 +79,7 @@ class Holiday extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* updateSold
|
||||
* updateSold. Update sold and check table of users for holidays is complete. If not complete.
|
||||
*
|
||||
* @return int Return 1
|
||||
*/
|
||||
@ -889,7 +889,7 @@ class Holiday extends CommonObject
|
||||
$month = date('m',$now);
|
||||
$lastUpdate = $this->getConfCP('lastUpdate');
|
||||
$monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
|
||||
//print 'month: '.$month.' '.$lastUpdate.' '.$monthLastUpdate;
|
||||
//print 'month: '.$month.' '.$lastUpdate.' '.$monthLastUpdate;exit;
|
||||
|
||||
// Si la date du mois n'est pas la même que celle sauvegardée, on met à jour le timestamp
|
||||
if ($month != $monthLastUpdate)
|
||||
@ -986,25 +986,31 @@ class Holiday extends CommonObject
|
||||
*/
|
||||
function createCPusers($single=false,$userid='')
|
||||
{
|
||||
// Si c'est l'ensemble des utilisateurs à ajoutés
|
||||
if(!$single)
|
||||
// Si c'est l'ensemble des utilisateurs à ajouter
|
||||
if (! $single)
|
||||
{
|
||||
dol_syslog(get_class($this).'::createCPusers');
|
||||
foreach($this->fetchUsers(false,true) as $users) {
|
||||
$arrayofusers = $this->fetchUsers(false,true);
|
||||
|
||||
foreach($arrayofusers as $users)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_users";
|
||||
$sql.= " (fk_user, nb_holiday)";
|
||||
$sql.= " VALUES ('".$users['rowid']."','0')";
|
||||
|
||||
$this->db->query($sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql) dol_print_error($this->db);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_users";
|
||||
$sql.= " (fk_user, nb_holiday)";
|
||||
$sql.= " VALUES ('".$userid."','0')";
|
||||
|
||||
$this->db->query($sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql) dol_print_error($this->db);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1051,7 +1057,7 @@ class Holiday extends CommonObject
|
||||
* uniquement pour vérifier si il existe de nouveau utilisateur
|
||||
*
|
||||
* @param boolean $liste si vrai retourne une liste, si faux retourne un array
|
||||
* @param boolean $type si vrai retourne pour Dolibarr si faux retourne pour CP
|
||||
* @param boolean $type si vrai retourne pour Dolibarr, si faux retourne pour CP
|
||||
* @return string retourne un tableau de tout les utilisateurs actifs
|
||||
*/
|
||||
function fetchUsers($liste=true,$type=true)
|
||||
@ -1262,49 +1268,56 @@ class Holiday extends CommonObject
|
||||
function verifNbUsers($userDolibarrWithoutCP,$userCP) {
|
||||
|
||||
if (empty($userCP)) $userCP=0;
|
||||
dol_syslog(get_class($this).'::verifNbUsers userDolibarr='.$userDolibarr.' userCP='.$userCP);
|
||||
dol_syslog(get_class($this).'::verifNbUsers userDolibarr='.$userDolibarrWithoutCP.' userCP='.$userCP);
|
||||
|
||||
// On vérifie les users Dolibarr sans CP
|
||||
if ($userDolibarrWithoutCP > 0)
|
||||
{
|
||||
$this->updateConfCP('nbUser',$userDolibarr);
|
||||
$this->db->begin();
|
||||
|
||||
$this->updateConfCP('nbUser',$userDolibarrWithoutCP);
|
||||
|
||||
$listUsersCP = $this->fetchUsers(true,false);
|
||||
|
||||
// On séléctionne les utilisateurs qui ne sont pas déjà dans le module
|
||||
$sql = "SELECT u.rowid, u.lastname, u.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE u.rowid NOT IN(".$listUsersCP.")";
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
// Si pas d'erreur SQL
|
||||
if($result) {
|
||||
if ($listUsersCP != '') $sql.= " WHERE u.rowid NOT IN(".$listUsersCP.")";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
while($i < $num) {
|
||||
|
||||
while($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$uid = $obj->rowid;
|
||||
|
||||
// On ajoute l'utilisateur
|
||||
$this->createCPusers(true,$obj->rowid);
|
||||
//print "Add user rowid = ".$uid." into database holiday";
|
||||
|
||||
$result = $this->createCPusers(true,$uid);
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
$this->db->commit();
|
||||
} else {
|
||||
// Erreur SQL
|
||||
$this->error="Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::verifNbUsers ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
} else {
|
||||
// Si il y a moins d'utilisateur Dolibarr que dans le module CP
|
||||
$this->db->begin();
|
||||
|
||||
$this->updateConfCP('nbUser',$userDolibarr);
|
||||
// Si il y a moins d'utilisateur Dolibarr que dans le module CP
|
||||
|
||||
$this->updateConfCP('nbUser',$userDolibarrWithoutCP);
|
||||
|
||||
$listUsersDolibarr = $this->fetchUsers(true,true);
|
||||
|
||||
@ -1331,10 +1344,12 @@ class Holiday extends CommonObject
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
$this->db->commit();
|
||||
} else {
|
||||
// Erreur SQL
|
||||
$this->error="Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::verifNbUsers ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -1720,6 +1735,30 @@ class Holiday extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tous les types
|
||||
*
|
||||
* @return boolean Return array with list of types
|
||||
*/
|
||||
function getTypes()
|
||||
{
|
||||
$result = $this->db->query("SELECT rowid, type, affect FROM " . MAIN_DB_PREFIX . "holiday_types");
|
||||
$num = $this->db->num_rows($result);
|
||||
if ($num)
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($result))
|
||||
{
|
||||
$types[] = array('rowid'=> $obj->rowid, 'type'=> $obj->type, 'affect'=>$obj->affect);
|
||||
}
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialise an instance with random values.
|
||||
* Used to build previews or test instances.
|
||||
|
||||
@ -43,14 +43,17 @@ $action=GETPOST('action');
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$userstatic=new User($db);
|
||||
$holiday = new Holiday($db);
|
||||
|
||||
|
||||
llxHeader(array(),$langs->trans('CPTitreMenu'));
|
||||
|
||||
print_fiche_titre($langs->trans('MenuConfCP'));
|
||||
|
||||
$holiday = new Holiday($db);
|
||||
$holiday->updateSold(); // Create users into table holiday if they don't exists. TODO Remove if we use field into table user.
|
||||
|
||||
$listUsers = $holiday->fetchUsers(false,false);
|
||||
$userstatic=new User($db);
|
||||
|
||||
// Si il y a une action de mise à jour
|
||||
if ($action == 'update' && isset($_POST['update_cp']))
|
||||
@ -71,7 +74,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
|
||||
$comment = ((isset($_POST['note_holiday'][$userID]) && !empty($_POST['note_holiday'][$userID])) ? ' ('.$_POST['note_holiday'][$userID].')' : '');
|
||||
|
||||
// We add the modification to the log
|
||||
$holiday->addLogCP($user->id,$userID, $langs->trans('ManualUpdate').$comment,$userValue);
|
||||
$holiday->addLogCP($user->id,$userID, $langs->transnoentitiesnoconv('ManualUpdate').$comment,$userValue);
|
||||
|
||||
// Update of the days of the employee
|
||||
$holiday->updateSoldeCP($userID,$userValue);
|
||||
|
||||
@ -761,8 +761,9 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
||||
print '<input type="hidden" name="userid" value="'.$userid.'">';
|
||||
}
|
||||
else print $form->select_users(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0);
|
||||
//var_dump($cp->getConfCP('nbHolidayDeducted'));
|
||||
$nb_holiday = $cp->getCPforUser($user->id) / $cp->getConfCP('nbHolidayDeducted');
|
||||
print ' <span>'.$langs->trans('SoldeCPUser', round($nb_holiday,0)).'</span>';
|
||||
print ' <span>'.$langs->trans('SoldeCPUser', round($nb_holiday,2)).'</span>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '<tr>';
|
||||
|
||||
BIN
htdocs/holiday/img/add.png
Executable file
BIN
htdocs/holiday/img/add.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
htdocs/holiday/img/delete.png
Executable file
BIN
htdocs/holiday/img/delete.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
BIN
htdocs/holiday/img/edit.png
Executable file
BIN
htdocs/holiday/img/edit.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
125
htdocs/holiday/tomergewithdefine_holiday.php
Executable file
125
htdocs/holiday/tomergewithdefine_holiday.php
Executable file
@ -0,0 +1,125 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
||||
*
|
||||
* 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 2 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file define_congespayes.php
|
||||
* \ingroup congespayes
|
||||
* \brief File that defines the balance of paid leave of users.
|
||||
* \version $Id: define_congespayes.php,v 1.00 2011/09/15 11:00:00 dmouillard Exp $
|
||||
* \author dmouillard@teclib.com <Dimitri Mouillard>
|
||||
* \remarks File that defines the balance of paid leave of users.
|
||||
*/
|
||||
|
||||
require('../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
|
||||
// Protection if external user
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
// If the user does not have perm to read the page
|
||||
if(!$user->rights->holiday->define_holiday) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader(array(),$langs->trans('CPTitreMenu'));
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans('MenuConfCP'));
|
||||
|
||||
$congespayes = new Holidays($db);
|
||||
$listUsers = $congespayes->fetchUsers(false, true);
|
||||
|
||||
// Si il y a une action de mise à jour
|
||||
if (isset($_POST['action']) && $_POST['action'] == 'update') {
|
||||
|
||||
$fk_type = $_POST['fk_type'];
|
||||
|
||||
foreach ($_POST['nb_conges'] as $user_id => $compteur) {
|
||||
if (!empty($compteur)) {
|
||||
$userValue = str_replace(',', '.', $compteur);
|
||||
$userValue = number_format($userValue, 2, '.', '');
|
||||
} else {
|
||||
$userValue = '0.00';
|
||||
}
|
||||
$congespayes->updateSoldeCP($user_id,$userValue,$fk_type);
|
||||
}
|
||||
|
||||
print '<div class="tabBar">';
|
||||
print $langs->trans('UpdateConfCPOK');
|
||||
print '</div>';
|
||||
|
||||
}
|
||||
|
||||
$var = true;
|
||||
$i = 0;
|
||||
|
||||
foreach($congespayes->getTypes() as $type)
|
||||
{
|
||||
if($type['affect']==1)
|
||||
{
|
||||
print '<div class="tabBar" style="float:left;width:300px;margin-right:10px;">';
|
||||
|
||||
print '<h3>'.$type['label'].'</h3>';
|
||||
|
||||
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
|
||||
print '<input type="hidden" name="action" value="update" />';
|
||||
print '<input type="hidden" name="fk_type" value="'.$type['rowid'].'" />';
|
||||
|
||||
print '<table class="noborder" width="100%;">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<td width="50%">' . $langs->trans('Employee') . '</td>';
|
||||
print '<td width="30%">' . $langs->trans('Counter') . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
foreach ($listUsers as $users) {
|
||||
$var = !$var;
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td>' . $users['name'] . ' ' . $users['firstname'] . '</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" value="' .
|
||||
$congespayes->getCPforUser($users['rowid'],$type['rowid']) .
|
||||
'" name="nb_conges[' . $users['rowid'] . ']"
|
||||
size="5" style="text-align: center;"/>';
|
||||
print ' jours</td>' . "\n";
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "<tr>";
|
||||
print '<td colspan="2"><input type="submit" value="'
|
||||
. $langs->trans("UpdateEventOptionCP") .
|
||||
' ' . $type['label'] .
|
||||
'" name="bouton" class="button" style="margin: 10px;"></td>';
|
||||
echo "</tr>";
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Fin de page
|
||||
$db->close();
|
||||
llxFooter();
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2007-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -26,6 +26,7 @@
|
||||
require('../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
// Protection if external user
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
@ -33,22 +34,28 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
// Si l'utilisateur n'a pas le droit de lire cette page
|
||||
if(!$user->rights->holiday->view_log) accessforbidden();
|
||||
|
||||
$year=GETPOST('year');
|
||||
if (empty($year))
|
||||
{
|
||||
$tmpdate=dol_getdate(dol_now());
|
||||
$year=$tmpdate['year'];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
*/
|
||||
|
||||
$langs->load('users');
|
||||
|
||||
llxHeader(array(),$langs->trans('CPTitreMenu'));
|
||||
llxHeader(array(),$langs->trans('CPTitreMenu').' ('.$langs->trans("Year").' '.$year.')');
|
||||
|
||||
|
||||
$cp = new Holiday($db);
|
||||
//Recent changes are more important than old changes
|
||||
$log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC','');
|
||||
// Recent changes are more important than old changes
|
||||
$log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC', " AND date_action BETWEEN '".$db->idate(dol_get_first_day($year,1,1))."' AND '".$db->idate(dol_get_last_day($year,12,1))."'"); // Load $cp->logs
|
||||
|
||||
print_fiche_titre($langs->trans('LogCP'));
|
||||
print_fiche_titre($langs->trans('LogCP'),'<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'">'.img_previous().'</a> '.$langs->trans("Year").':'.$year.' <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'">'.img_next().'</a>');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tbody>';
|
||||
|
||||
@ -945,3 +945,17 @@ create table llx_c_email_templates
|
||||
UPDATE llx_c_regions SET rowid = 0 where rowid = 1;
|
||||
DELETE FROM llx_c_departements WHERE fk_region NOT IN (select rowid from llx_c_regions) AND fk_region IS NOT NULL AND fk_region <> 0;
|
||||
ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid);
|
||||
|
||||
|
||||
CREATE TABLE llx_holiday_types (
|
||||
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
label varchar(45) NOT NULL,
|
||||
description varchar(255) NOT NULL,
|
||||
affect int(1) NOT NULL,
|
||||
delay int(1) NOT NULL,
|
||||
insertAt DATETIME NOT NULL,
|
||||
updateAt DATETIME,
|
||||
deleteAt DATETIME,
|
||||
nbCongesDeducted varchar(255) NOT NULL,
|
||||
nbCongesEveryMonth varchar(255) NOT NULL
|
||||
);
|
||||
|
||||
30
htdocs/install/mysql/tables/llx_holiday_types.sql
Executable file
30
htdocs/install/mysql/tables/llx_holiday_types.sql
Executable file
@ -0,0 +1,30 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2014 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/>.
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
CREATE TABLE llx_holiday_types (
|
||||
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
label varchar(45) NOT NULL,
|
||||
description varchar(255) NOT NULL,
|
||||
affect integer NOT NULL,
|
||||
delay integer NOT NULL,
|
||||
insertAt DATETIME NOT NULL,
|
||||
updateAt DATETIME,
|
||||
deleteAt DATETIME,
|
||||
nbCongesDeducted varchar(255) NOT NULL,
|
||||
nbCongesEveryMonth varchar(255) NOT NULL
|
||||
);
|
||||
@ -1108,12 +1108,11 @@ else
|
||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
||||
//if ($res < 0) { dol_print_error($db); exit; }
|
||||
|
||||
|
||||
$head = societe_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company');
|
||||
|
||||
|
||||
|
||||
// Load object modCodeTiers
|
||||
$module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard');
|
||||
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php')
|
||||
@ -1149,7 +1148,9 @@ else
|
||||
{
|
||||
$prefixSupplierIsUsed = $modCodeFournisseur->verif_prefixIsUsed();
|
||||
}
|
||||
|
||||
|
||||
$object->oldcopy=dol_clone($object);
|
||||
|
||||
if (GETPOST('nom'))
|
||||
{
|
||||
// We overwrite with values if posted
|
||||
@ -1181,7 +1182,7 @@ else
|
||||
$object->barcode = GETPOST('barcode');
|
||||
$object->forme_juridique_code = GETPOST('forme_juridique_code');
|
||||
$object->default_lang = GETPOST('default_lang');
|
||||
|
||||
|
||||
$object->tva_assuj = GETPOST('assujtva_value');
|
||||
$object->tva_intra = GETPOST('tva_intra');
|
||||
$object->status = GETPOST('status');
|
||||
@ -1268,7 +1269,7 @@ else
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="socid" value="'.$object->id.'">';
|
||||
if ($modCodeClient->code_auto || $modCodeFournisseur->code_auto) print '<input type="hidden" name="code_auto" value="1">';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Name
|
||||
@ -1306,6 +1307,7 @@ else
|
||||
if ((!$object->code_client || $object->code_client == -1) && $modCodeClient->code_auto)
|
||||
{
|
||||
$tmpcode=$object->code_client;
|
||||
if (empty($tmpcode) && ! empty($object->oldcopy->code_client)) $tmpcode=$object->oldcopy->code_client; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
|
||||
if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0);
|
||||
print '<input type="text" name="code_client" id="customer_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
|
||||
}
|
||||
@ -1338,6 +1340,7 @@ else
|
||||
if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto)
|
||||
{
|
||||
$tmpcode=$object->code_fournisseur;
|
||||
if (empty($tmpcode) && ! empty($object->oldcopy->code_fournisseur)) $tmpcode=$object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
|
||||
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
|
||||
print '<input type="text" name="code_fournisseur" id="supplier_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
|
||||
}
|
||||
|
||||
@ -2564,6 +2564,41 @@ a.cke_dialog_ui_button
|
||||
}
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Holiday */
|
||||
/* ============================================================================== */
|
||||
|
||||
#types .btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#types .btn-primary {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#types form {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
#types label {
|
||||
display:inline-block;
|
||||
width:100px;
|
||||
margin-right: 20px;
|
||||
padding: 4px;
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#types input.text, #types textarea {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
#types textarea {
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* JSGantt */
|
||||
/* ============================================================================== */
|
||||
|
||||
@ -127,7 +127,7 @@ class SqlTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* testBank
|
||||
* testSql
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@ -162,4 +162,38 @@ class SqlTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* testInitData
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function testInitData()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
$filesarray = scandir(DOL_DOCUMENT_ROOT.'/../dev/initdata');
|
||||
foreach($filesarray as $key => $file)
|
||||
{
|
||||
if (! preg_match('/\.sql$/',$file)) continue;
|
||||
|
||||
print 'Check sql file '.$file."\n";
|
||||
$filecontent=file_get_contents(DOL_DOCUMENT_ROOT.'/../dev/initdata/'.$file);
|
||||
|
||||
$result=strpos($filecontent,'@gmail.com');
|
||||
print __METHOD__." Result for checking we don't have personal data = ".$result."\n";
|
||||
$this->assertTrue($result===false, 'Found a bad key into file '.$file);
|
||||
|
||||
$result=strpos($filecontent,'eldy@');
|
||||
print __METHOD__." Result for checking we don't have personal data = ".$result."\n";
|
||||
$this->assertTrue($result===false, 'Found a bad key into file '.$file);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user