Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop
Conflicts: ChangeLog
This commit is contained in:
commit
5e63f16d32
11
ChangeLog
11
ChangeLog
@ -35,6 +35,7 @@ For users:
|
||||
Use accesskey on form search.
|
||||
- New: Intervention documents are now available in ECM module
|
||||
- New: Add attachments on user card + in ECM module
|
||||
- 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
|
||||
@ -189,9 +190,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.
|
||||
|
||||
@ -565,6 +565,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
$replyto = $_POST ['replytoname'] . ' <' . $_POST ['replytomail'] . '>';
|
||||
$message = $_POST ['message'];
|
||||
$sendtocc = $_POST ['sendtocc'];
|
||||
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
|
||||
$deliveryreceipt = $_POST ['deliveryreceipt'];
|
||||
|
||||
if (dol_strlen($_POST ['subject']))
|
||||
@ -591,7 +592,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
|
||||
// Envoi de la propal
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1);
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
@ -2288,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, '/'));
|
||||
@ -2340,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;
|
||||
@ -2351,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__'] = '';
|
||||
|
||||
@ -2361,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);
|
||||
|
||||
@ -617,7 +617,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if price ht is forced (ie: calculated by margin rate and cost price)
|
||||
if (! empty($price_ht)) {
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
@ -1192,6 +1192,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
$replyto = GETPOST('replytoname') . ' <' . GETPOST('replytomail') . '>';
|
||||
$message = GETPOST('message');
|
||||
$sendtocc = GETPOST('sendtocc');
|
||||
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO);
|
||||
$deliveryreceipt = GETPOST('deliveryreceipt');
|
||||
|
||||
if ($action == 'send') {
|
||||
@ -1220,7 +1221,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
|
||||
// Send mail
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1);
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
@ -2430,11 +2431,13 @@ 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, '/'));
|
||||
$file = $fileparams ['fullname'];
|
||||
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
@ -2482,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;
|
||||
@ -2492,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__'] = '';
|
||||
|
||||
@ -2501,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);
|
||||
|
||||
@ -1152,7 +1152,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
|
||||
$pu_ttc = $prod->price_ttc;
|
||||
$price_min = $prod->price_min;
|
||||
$price_base_type = $prod->price_base_type;
|
||||
|
||||
|
||||
// We define price for product
|
||||
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
|
||||
{
|
||||
@ -1181,7 +1181,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if price ht is forced (ie: calculated by margin rate and cost price)
|
||||
if (! empty($price_ht)) {
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
@ -1559,6 +1559,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>';
|
||||
$message = $_POST['message'];
|
||||
$sendtocc = $_POST['sendtocc'];
|
||||
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
||||
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||
|
||||
if ($action == 'send') {
|
||||
@ -1601,7 +1602,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
|
||||
// Send mail
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1);
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
@ -3637,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';
|
||||
@ -3709,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;
|
||||
@ -3719,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__'] = '';
|
||||
|
||||
@ -3729,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';
|
||||
|
||||
|
||||
@ -121,6 +121,7 @@ if ($action == 'presend' && GETPOST('sendmail'))
|
||||
$subject = GETPOST('subject');
|
||||
$message = GETPOST('message');
|
||||
$sendtocc = GETPOST('sentocc');
|
||||
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
||||
|
||||
$substitutionarray=array(
|
||||
'__ID__' => $object->id,
|
||||
@ -151,7 +152,7 @@ if ($action == 'presend' && GETPOST('sendmail'))
|
||||
|
||||
// Send mail
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1);
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$resultmasssend.='<div class="error">'.$mailfile->error.'</div>';
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -26,7 +26,8 @@
|
||||
|
||||
// $id must be defined
|
||||
// $actiontypecode must be defined
|
||||
|
||||
// $paramname must be defined
|
||||
// $mode must be defined
|
||||
|
||||
/*
|
||||
* Add file in email form
|
||||
@ -115,6 +116,11 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
|
||||
$message = $_POST['message'];
|
||||
$sendtocc = $_POST['sendtocc'];
|
||||
$sendtobcc='';
|
||||
if ($mode == 'emailfromproposal') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
|
||||
if ($mode == 'emailfromorder') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO);
|
||||
if ($mode == 'emailfrominvoice') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
||||
|
||||
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||
|
||||
if ($action == 'send' || $action == 'relance')
|
||||
@ -141,7 +147,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
|
||||
// Send mail
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1);
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$mesgs[]='<div class="error">'.$mailfile->error.'</div>';
|
||||
|
||||
@ -170,7 +170,7 @@ class CMailFile
|
||||
}
|
||||
}
|
||||
|
||||
// Add autocopy to
|
||||
// Add autocopy to (Note: Adding bcc for specific modules are also done from pages)
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) $addr_bcc.=($addr_bcc?', ':'').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
|
||||
// Action according to choosed sending method
|
||||
|
||||
@ -439,7 +439,7 @@ class FormMail
|
||||
}
|
||||
$out.= "</td></tr>\n";
|
||||
}
|
||||
|
||||
|
||||
// CCC
|
||||
if (! empty($this->withtoccc) || is_array($this->withtoccc))
|
||||
{
|
||||
@ -459,7 +459,12 @@ class FormMail
|
||||
$out.= $form->selectarray("receiverccc", $this->withtoccc, GETPOST("receiverccc"), 1);
|
||||
}
|
||||
}
|
||||
//if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print ' '.info_admin("+ ".$conf->global->MAIN_MAIL_AUTOCOPY_TO,1);
|
||||
|
||||
$showinfobcc='';
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO;
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO;
|
||||
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO;
|
||||
if ($showinfobcc) $out.=' + '.$showinfobcc;
|
||||
$out.= "</td></tr>\n";
|
||||
}
|
||||
|
||||
@ -475,9 +480,9 @@ class FormMail
|
||||
else
|
||||
{
|
||||
$defaultvaluefordeliveryreceipt=0;
|
||||
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1;
|
||||
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'commande_send') $defaultvaluefordeliveryreceipt=1;
|
||||
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1;
|
||||
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $defaultvaluefordeliveryreceipt=1;
|
||||
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1;
|
||||
$out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1);
|
||||
}
|
||||
|
||||
|
||||
@ -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>';
|
||||
|
||||
@ -925,24 +925,37 @@ DROP TABLE llx_texts;
|
||||
|
||||
|
||||
DROP TABLE llx_c_email_templates;
|
||||
CREATE table llx_c_email_templates
|
||||
create table llx_c_email_templates
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
module varchar(32), -- Nom du module en rapport avec le modele
|
||||
module varchar(32), -- Nom du module en rapport avec le modele
|
||||
type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...)
|
||||
sortorder smallint, -- Ordre affichage
|
||||
|
||||
private smallint DEFAULT 0 NOT NULL, -- Template public or private
|
||||
fk_user integer, -- Id utilisateur si modele prive, sinon null
|
||||
private smallint DEFAULT 0 NOT NULL, -- Template public or private
|
||||
fk_user integer, -- Id utilisateur si modele prive, sinon null
|
||||
datec datetime,
|
||||
tms timestamp,
|
||||
|
||||
label varchar(255),
|
||||
content text
|
||||
label varchar(255), -- Label of predefined email
|
||||
position smallint, -- Position
|
||||
topic text, -- Predefined topic
|
||||
content text -- Predefined text
|
||||
)ENGINE=innodb;
|
||||
|
||||
|
||||
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
|
||||
);
|
||||
|
||||
@ -21,15 +21,14 @@ create table llx_c_email_templates
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
module varchar(32), -- Nom du module en rapport avec le modele
|
||||
module varchar(32), -- Nom du module en rapport avec le modele
|
||||
type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...)
|
||||
sortorder smallint, -- Ordre affichage
|
||||
|
||||
private smallint DEFAULT 0 NOT NULL, -- Template public or private
|
||||
fk_user integer, -- Id utilisateur si modele prive, sinon null
|
||||
private smallint DEFAULT 0 NOT NULL, -- Template public or private
|
||||
fk_user integer, -- Id utilisateur si modele prive, sinon null
|
||||
datec datetime,
|
||||
tms timestamp,
|
||||
|
||||
label varchar(255),
|
||||
content text
|
||||
label varchar(255), -- Label of predefined email
|
||||
position smallint, -- Position
|
||||
topic text, -- Predefined topic
|
||||
content text -- Predefined text
|
||||
)ENGINE=innodb;
|
||||
|
||||
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
|
||||
);
|
||||
@ -257,6 +257,9 @@ MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into
|
||||
MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: <b>%s</b>)
|
||||
MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent
|
||||
MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to
|
||||
MAIN_MAIL_AUTOCOPY_PROPOSAL_TO= Send systematically a hidden carbon-copy of proposals sent by email to
|
||||
MAIN_MAIL_AUTOCOPY_ORDER_TO= Send systematically a hidden carbon-copy of orders sent by email to
|
||||
MAIN_MAIL_AUTOCOPY_INVOICE_TO= Send systematically a hidden carbon-copy of invoice sent by emails to
|
||||
MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos)
|
||||
MAIN_MAIL_SENDMODE=Method to use to send EMails
|
||||
MAIN_MAIL_SMTPS_ID=SMTP ID if authentication required
|
||||
|
||||
@ -513,6 +513,7 @@ if (empty($reshook))
|
||||
$id=$socid;
|
||||
$actiontypecode='AC_OTH_AUTO';
|
||||
$paramname='socid';
|
||||
$mode='emailfromthirdparty';
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
||||
|
||||
@ -1107,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')
|
||||
@ -1148,7 +1148,9 @@ else
|
||||
{
|
||||
$prefixSupplierIsUsed = $modCodeFournisseur->verif_prefixIsUsed();
|
||||
}
|
||||
|
||||
|
||||
$object->oldcopy=dol_clone($object);
|
||||
|
||||
if (GETPOST('nom'))
|
||||
{
|
||||
// We overwrite with values if posted
|
||||
@ -1180,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');
|
||||
@ -1267,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
|
||||
@ -1305,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">';
|
||||
}
|
||||
@ -1337,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 */
|
||||
/* ============================================================================== */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user