';
print '';
- print $holidaystatic->getNomUrl(1);
+ print $holidaystatic->getNomUrl(1, 1);
print ' ';
print ''.dol_print_date($date,'day').' ';
print ''.$userstatic->getNomUrl(-1, 'leave').' ';
print ''.$approbatorstatic->getNomUrl(-1).' ';
print '';
- print empty($typeleaves[$infos_CP['fk_type']]['label']) ? $langs->trans("TypeWasDisabledOrRemoved",$infos_CP['fk_type']) : $typeleaves[$infos_CP['fk_type']]['label'];
+ $labeltypeleavetoshow = ($langs->trans($typeleaves[$infos_CP['fk_type']]['code'])!=$typeleaves[$infos_CP['fk_type']]['code'] ? $langs->trans($typeleaves[$infos_CP['fk_type']]['code']) : $typeleaves[$infos_CP['fk_type']]['label']);
+ print empty($typeleaves[$infos_CP['fk_type']]['label']) ? $langs->trans("TypeWasDisabledOrRemoved",$infos_CP['fk_type']) : $labeltypeleavetoshow;
print ' ';
print '';
$nbopenedday=num_open_day($infos_CP['date_debut_gmt'], $infos_CP['date_fin_gmt'], 0, 1, $infos_CP['halfday']);
diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php
new file mode 100644
index 00000000000..cc094046316
--- /dev/null
+++ b/htdocs/holiday/month_report.php
@@ -0,0 +1,198 @@
+
+ * Copyright (C) 2011 François Legastelois
+ *
+ * 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, see .
+ */
+
+/**
+ * \file month_report.php
+ * \ingroup holiday
+ * \brief Monthly report of leave requests.
+ */
+
+require('../main.inc.php');
+require_once(DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php');
+require_once(DOL_DOCUMENT_ROOT.'/user/class/user.class.php');
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
+
+$langs->loadLangs(array("holiday"));
+
+// Security check
+$socid=0;
+if ($user->societe_id > 0) // Protection if external user
+{
+ //$socid = $user->societe_id;
+ accessforbidden();
+}
+$result = restrictedArea($user, 'holiday', $id, '');
+
+
+
+/*
+ * View
+ */
+
+$holidaystatic = new Holiday($db);
+
+$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon"));
+
+
+llxHeader('', $langs->trans('CPTitreMenu'));
+
+print_fiche_titre($langs->trans('MenuReportMonth'));
+
+$html = new Form($db);
+$formother = new FormOther($db);
+
+
+// Selection filter
+print '';
+
+print '';
+
+
+$sql = "SELECT cp.rowid, cp.fk_user, cp.date_debut, cp.date_fin, ct.label, cp.description, cp.halfday";
+$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
+$sql .= " LEFT JOIN llx_user u ON cp.fk_user = u.rowid";
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid";
+$sql .= " WHERE cp.rowid > 0";
+$sql .= " AND cp.statut = 3"; // Approved
+$sql .= " AND (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
+$sql .= " ORDER BY u.lastname, cp.date_debut";
+
+$resql = $db->query($sql);
+if (empty($resql))
+{
+ dol_print_error($db);
+ exit;
+}
+
+$num = $db->num_rows($resql);
+
+print '
';
+
+
+print ' ';
+
+print '';
+print '
';
+
+print '';
+print '' . $langs->trans('Ref') . ' ';
+print '' . $langs->trans('Employee') . ' ';
+print '' . $langs->trans('Type') . ' ';
+print '' . $langs->trans('DateDebCP') . ' ';
+print '' . $langs->trans('DateFinCP') . ' ';
+print '' . $langs->trans('NbUseDaysCPShort') . ' ';
+print '' . $langs->trans('DateStartInMonth') . ' ';
+print '' . $langs->trans('DateEndInMonth') . ' ';
+print '' . $langs->trans('NbUseDaysCPShortInMonth') . ' ';
+print '' . $langs->trans('DescCP') . ' ';
+print ' ';
+
+if ($num == 0)
+{
+ print ''.$langs->trans('None').' ';
+}
+else
+{
+ while ($obj = $db->fetch_object($resql))
+ {
+ $user = new User($db);
+ $user->fetch($obj->fk_user);
+
+ $date_start = $db->jdate($obj->date_debut, true);
+ $date_end = $db->jdate($obj->date_fin, true);
+
+ $tmpstart = dol_getdate($date_start);
+ $tmpend = dol_getdate($date_end);
+
+ $starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning';
+ $endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon';
+
+ $halfdayinmonth = $obj->halfday;
+ $starthalfdayinmonth = $starthalfday;
+ $endhalfdayinmonth = $endhalfday;
+
+ //0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
+
+ // Set date_start_gmt and date_end_gmt that are date to show for the selected month
+ $date_start_inmonth = $db->jdate($obj->date_debut, true);
+ $date_end_inmonth = $db->jdate($obj->date_fin, true);
+ if ($tmpstart['year'] < $search_year || $tmpstart['mon'] < $search_month)
+ {
+ $date_start_inmonth = dol_get_first_day($search_year, $search_month, true);
+ $starthalfdayinmonth = 'morning';
+ if ($halfdayinmonth == 2) $halfdayinmonth=1;
+ if ($halfdayinmonth == -1) $halfdayinmonth=0;
+ }
+ if ($tmpend['year'] > $search_year || $tmpend['mon'] > $search_month)
+ {
+ $date_end_inmonth = dol_get_last_day($search_year, $search_month, true) - ((24 * 3600) - 1);
+ $endhalfdayinmonth = 'afternoon';
+ if ($halfdayinmonth == 2) $halfdayinmonth=-1;
+ if ($halfdayinmonth == 1) $halfdayinmonth=0;
+ }
+
+ // Leave request
+ $holidaystatic->id=$obj->rowid;
+ $holidaystatic->ref=$obj->rowid;
+
+ print '';
+ print '';
+ print $holidaystatic->getNomUrl(1, 1);
+ print ' ';
+ print '' . $user->getFullName($langs) . ' ';
+ print '' . $obj->label . ' ';
+ print '' . dol_print_date($obj->date_debut, 'day');
+ print ' ('.$langs->trans($listhalfday[$starthalfday]).') ';
+ print ' ';
+ print '' . dol_print_date($obj->date_fin, 'day');
+ print ' ('.$langs->trans($listhalfday[$endhalfday]).') ';
+ print ' ';
+ print '' . num_open_day($date_start, $date_end, 0, 1, $obj->halfday) . ' ';
+ print '' . dol_print_date($date_start_inmonth, 'day');
+ print ' ('.$langs->trans($listhalfday[$starthalfdayinmonth]).') ';
+ print ' ';
+ print '' . dol_print_date($date_end_inmonth, 'day');
+ print ' ('.$langs->trans($listhalfday[$endhalfdayinmonth]).') ';
+ print ' ';
+ print '' . num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth) . ' ';
+ print '' . dol_escape_htmltag(dolGetFirstLineOfText($obj->description)) . ' ';
+ print ' ';
+ }
+
+}
+print '
';
+print '
';
+
+// Fin de page
+$db->close();
+llxFooter();
diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php
index 69bd6b6a190..d67db73d437 100644
--- a/htdocs/holiday/view_log.php
+++ b/htdocs/holiday/view_log.php
@@ -117,7 +117,7 @@ foreach($cp->logs as $logs_CP)
print ''.$user_update->getNomUrl(-1).' ';
print ''.$logs_CP['type_action'].' ';
print '';
- $label=$alltypeleaves[$logs_CP['fk_type']]['label'];
+ $label = (($alltypeleaves[$logs_CP['fk_type']]['code'] && $langs->trans($alltypeleaves[$logs_CP['fk_type']]['code'])!=$alltypeleaves[$logs_CP['fk_type']]['code']) ? $langs->trans($alltypeleaves[$logs_CP['fk_type']]['code']) : $alltypeleaves[$logs_CP['fk_type']]['label']);
print $label?$label:$logs_CP['fk_type'];
print ' ';
print ''.price2num($logs_CP['prev_solde'],5).' '.$langs->trans('days').' ';
diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php
index f0e279bb848..2f360dce5c5 100644
--- a/htdocs/hrm/index.php
+++ b/htdocs/hrm/index.php
@@ -130,27 +130,34 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
if (! empty($conf->holiday->enabled))
{
- $user_id = $user->id;
+ if (empty($conf->global->HOLIDAY_HIDE_BALANCE))
+ {
+ $user_id = $user->id;
- print '';
- print ''.$langs->trans("Holidays").' ';
- print "";
- print '';
+ print '';
+ print ''.$langs->trans("Holidays").' ';
+ print "";
+ print '';
- $out='';
- $typeleaves=$holiday->getTypes(1,1);
- foreach($typeleaves as $key => $val)
- {
- $nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
- $nb_holiday += $nb_type;
- $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).' ';
- }
- print $langs->trans('SoldeCPUser', round($nb_holiday,5)).' ';
- print $out;
+ $out='';
+ $typeleaves=$holiday->getTypes(1,1);
+ foreach($typeleaves as $key => $val)
+ {
+ $nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
+ $nb_holiday += $nb_type;
+ $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).' ';
+ }
+ print $langs->trans('SoldeCPUser', round($nb_holiday,5)).' ';
+ print $out;
- print ' ';
- print ' ';
- print '
';
+ print ' ';
+ print ' ';
+ print '
';
+ }
+ elseif (! is_numeric($conf->global->HOLIDAY_HIDE_BALANCE))
+ {
+ print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).' ';
+ }
}
diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php
index d1f7e3eb31a..aa6e1f3e3c1 100644
--- a/htdocs/install/step5.php
+++ b/htdocs/install/step5.php
@@ -189,6 +189,8 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
else
dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities
}
+
+ dolibarr_install_syslog('step5: DATABASE_PWD_ENCRYPTED = '.$conf->global->DATABASE_PWD_ENCRYPTED.' MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO, LOG_INFO);
}
// Create user used to create the admin user
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index 28a77095084..22724acfc09 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -149,7 +149,6 @@ ACCOUNTING_SERVICE_SOLD_ACCOUNT=Accounting account by default for the sold servi
Doctype=Type of document
Docdate=Date
Docref=Reference
-Code_tiers=Thirdparty
LabelAccount=Label account
LabelOperation=Label operation
Sens=Sens
@@ -180,7 +179,7 @@ ProductAccountNotDefined=Account for product not defined
FeeAccountNotDefined=Account for fee not defined
BankAccountNotDefined=Account for bank not defined
CustomerInvoicePayment=Payment of invoice customer
-ThirdPartyAccount=Thirdparty account
+ThirdPartyAccount=Third party account
NewAccountingMvt=New transaction
NumMvts=Numero of transaction
ListeMvts=List of movements
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index b9e4c33f227..3a7e8a7d14a 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -837,11 +837,11 @@ Permission1251=Run mass imports of external data into database (data load)
Permission1321=Export customer invoices, attributes and payments
Permission1322=Reopen a paid bill
Permission1421=Export customer orders and attributes
-Permission20001=Read leave requests (yours and your subordinates)
-Permission20002=Create/modify your leave requests
+Permission20001=Read leave requests (your leaves and the one of your subordinates)
+Permission20002=Create/modify your leave requests (yours leaves and the one of your subordinates)
Permission20003=Delete leave requests
-Permission20004=Read all leave requests (even user not subordinates)
-Permission20005=Create/modify leave requests for everybody
+Permission20004=Read all leave requests (even of user not subordinates)
+Permission20005=Create/modify leave requests for everybody (even of user not subordinates)
Permission20006=Admin leave requests (setup and update balance)
Permission23001=Read Scheduled job
Permission23002=Create/update Scheduled job
@@ -1054,6 +1054,7 @@ AreaForAdminOnly=Setup parameters can be set by administrator users only.
SystemInfoDesc=System information is miscellaneous technical information you get in read only mode and visible for administrators only.
SystemAreaForAdminOnly=This area is available for administrator users only. None of the Dolibarr permissions can reduce this limit.
CompanyFundationDesc=Edit on this page all known information of the company or foundation you need to manage (For this, click on "Modify" or "Save" button at bottom of page)
+AccountantDesc=Edit on this page all known information of your accountant/auditor to manage (For this, click on "Modify" or "Save" button at bottom of page)
DisplayDesc=You can choose each parameter related to the Dolibarr look and feel here
AvailableModules=Available app/modules
ToActivateModule=To activate modules, go on setup Area (Home->Setup->Modules).
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index f195da762a8..aec9c1e1a93 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -389,8 +389,8 @@ NoDolibarrAccess=No Dolibarr access
ExportDataset_company_1=Third parties (Companies / foundations / physical people) and properties
ExportDataset_company_2=Contacts and properties
ImportDataset_company_1=Third parties (Companies / foundations / physical people) and properties
-ImportDataset_company_2=Contacts/Addresses (of thirdparties or not) and attributes
-ImportDataset_company_3=Bank accounts of thirdparties
+ImportDataset_company_2=Contacts/Addresses (of third parties or not) and attributes
+ImportDataset_company_3=Bank accounts of third parties
ImportDataset_company_4=Third parties/Sales representatives (Assign sales representatives users to companies)
PriceLevel=Price level
DeliveryAddress=Delivery address
@@ -425,9 +425,9 @@ ManagingDirectors=Manager(s) name (CEO, director, president...)
MergeOriginThirdparty=Duplicate third party (third party you want to delete)
MergeThirdparties=Merge third parties
ConfirmMergeThirdparties=Are you sure you want to merge this third party into the current one? All linked objects (invoices, orders, ...) will be moved to current third party, then the thirdparty will be deleted.
-ThirdpartiesMergeSuccess=Thirdparties have been merged
+ThirdpartiesMergeSuccess=Third parties have been merged
SaleRepresentativeLogin=Login of sales representative
SaleRepresentativeFirstname=First name of sales representative
SaleRepresentativeLastname=Last name of sales representative
-ErrorThirdpartiesMerge=There was an error when deleting the thirdparties. Please check the log. Changes have been reverted.
+ErrorThirdpartiesMerge=There was an error when deleting the third parties. Please check the log. Changes have been reverted.
NewCustomerSupplierCodeProposed=New customer or supplier code suggested on duplicate code
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index e476c951123..07a7e8a646a 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -237,3 +237,4 @@ ErrorBankAccountNotFound=Error: Bank account not found
FiscalPeriod=Accounting period
ListSocialContributionAssociatedProject=List of social contributions associated with the project
DeleteFromCat=Remove from accounting group
+AccountingAffectation=Accounting assignement
diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang
index f73bbdeee52..eca2bbdfe46 100644
--- a/htdocs/langs/en_US/holiday.lang
+++ b/htdocs/langs/en_US/holiday.lang
@@ -39,6 +39,10 @@ TypeOfLeaveId=Type of leave ID
TypeOfLeaveCode=Type of leave code
TypeOfLeaveLabel=Type of leave label
NbUseDaysCP=Number of days of vacation consumed
+NbUseDaysCPShort=Days consumed
+NbUseDaysCPShortInMonth=Days consumed in month
+DateStartInMonth=Start date in month
+DateEndInMonth=End date in month
EditCP=Edit
DeleteCP=Delete
ActionRefuseCP=Refuse
@@ -67,6 +71,7 @@ DateRefusCP=Date of refusal
DateCancelCP=Date of cancellation
DefineEventUserCP=Assign an exceptional leave for a user
addEventToUserCP=Assign leave
+NotTheAssignedApprover=You are not the assigned approver
MotifCP=Reason
UserCP=User
ErrorAddEventToUserCP=An error occurred while adding the exceptional leave.
@@ -91,7 +96,10 @@ LastHolidays=Latest %s leave requests
AllHolidays=All leave requests
HalfDay=Half day
NotTheAssignedApprover=You are not the assigned approver
-
+LEAVE_PAID=Paid vacation
+LEAVE_SICK=Sick leave
+LEAVE_OTHER=Other leave
+LEAVE_PAID_FR=Paid vacation
## Configuration du Module ##
LastUpdateCP=Latest automatic update of leaves allocation
MonthOfLastMonthlyUpdate=Month of latest automatic update of leaves allocation
diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang
index 8e2b093fdc2..3c512ca7286 100644
--- a/htdocs/langs/en_US/mails.lang
+++ b/htdocs/langs/en_US/mails.lang
@@ -135,7 +135,7 @@ NbOfTargetedContacts=Current number of targeted contact emails
UseFormatFileEmailToTarget=Imported file must have format email;name;firstname;other
UseFormatInputEmailToTarget=Enter a string with format email;name;firstname;other
MailAdvTargetRecipients=Recipients (advanced selection)
-AdvTgtTitle=Fill input fields to preselect the thirdparties or contacts/addresses to target
+AdvTgtTitle=Fill input fields to preselect the third parties or contacts/addresses to target
AdvTgtSearchTextHelp=Use %% as magic caracters. For exemple to find all item like jean, joe, jim , you can input j%% , you can also use ; as separator for value, and use ! for except this value. For exemple jean;joe;jim%%;!jimo;!jima% will target all jean, joe, start with jim but not jimo and not everythnig taht start by jima
AdvTgtSearchIntHelp=Use interval to select int or float value
AdvTgtMinVal=Minimum value
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index c1027e20466..edcdb4ef791 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -185,6 +185,7 @@ ToLink=Link
Select=Select
Choose=Choose
Resize=Resize
+ResizeOrCrop=Resize or Crop
Recenter=Recenter
Author=Author
User=User
@@ -426,6 +427,7 @@ ActionDoneShort=Finished
ActionUncomplete=Uncomplete
LatestLinkedEvents=Latest %s linked events
CompanyFoundation=Company/Organization
+Accountant=Accountant
ContactsForCompany=Contacts for this third party
ContactsAddressesForCompany=Contacts/addresses for this third party
AddressesForCompany=Addresses for this third party
@@ -904,7 +906,7 @@ Select2MoreCharacters=or more characters
Select2MoreCharactersMore=Search syntax: | OR (a|b)* Any character (a*b)^ Start with (^ab)$ End with (ab$)
Select2LoadingMoreResults=Loading more results...
Select2SearchInProgress=Search in progress...
-SearchIntoThirdparties=Thirdparties
+SearchIntoThirdparties=Third parties
SearchIntoContacts=Contacts
SearchIntoMembers=Members
SearchIntoUsers=Users
diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang
index 8633d910657..8a8a9f20788 100644
--- a/htdocs/langs/en_US/margins.lang
+++ b/htdocs/langs/en_US/margins.lang
@@ -41,4 +41,4 @@ rateMustBeNumeric=Rate must be a numeric value
markRateShouldBeLesserThan100=Mark rate should be lower than 100
ShowMarginInfos=Show margin infos
CheckMargins=Margins detail
-MarginPerSaleRepresentativeWarning=The report of margin per user use the link between thirdparties and sale representatives to calculate the margin of each salerepresentaive. Because some thirdparties may not have any ddiated sale representative and some thirdparties may be linked to several, some amounts may not be included into this report (if there is no sale representative) and some may appear on different lines (for each sale representative).
+MarginPerSaleRepresentativeWarning=The report of margin per user use the link between third parties and sale representatives to calculate the margin of each salerepresentaive. Because some thirdparties may not have any ddiated sale representative and some thirdparties may be linked to several, some amounts may not be included into this report (if there is no sale representative) and some may appear on different lines (for each sale representative).
diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang
index dcf94d4a17b..536fb3f940d 100644
--- a/htdocs/langs/en_US/stripe.lang
+++ b/htdocs/langs/en_US/stripe.lang
@@ -39,7 +39,7 @@ STRIPE_TEST_WEBHOOK_KEY=Webhook test key
STRIPE_LIVE_SECRET_KEY=Secret live key
STRIPE_LIVE_PUBLISHABLE_KEY=Publishable live key
STRIPE_LIVE_WEBHOOK_KEY=Webhook live key
-ONLINE_PAYMENT_WAREHOUSE=Stock to use for stock decrease when payment online payment is done (TODO When option to decrease stock is done on an action on invoice and the online payment generate itself the invoice ?)
+ONLINE_PAYMENT_WAREHOUSE=Stock to use for stock decrease when online payment is done (TODO When option to decrease stock is done on an action on invoice and the online payment generate itself the invoice ?)
StripeLiveEnabled=Stripe live enabled (otherwise test/sandbox mode)
StripeImportPayment=Import Stripe payments
ExampleOfTestCreditCard=Example of credit card for test: %s (valid), %s (error CVC), %s (expired), %s (charge fails)
diff --git a/htdocs/langs/en_US/ticketsup.lang b/htdocs/langs/en_US/ticketsup.lang
index 60f98a8e543..cabf1c39ec3 100644
--- a/htdocs/langs/en_US/ticketsup.lang
+++ b/htdocs/langs/en_US/ticketsup.lang
@@ -25,7 +25,7 @@ Permission56001=See tickets
Permission56002=Modify tickets
Permission56003=Delete tickets
Permission56004=Manage tickets
-Permission56005=See tickets of all thirdparties (not effective for external users, always be limited to the thirdparty they depend on)
+Permission56005=See tickets of all third parties (not effective for external users, always be limited to the thirdparty they depend on)
TicketsupDictType=Tickets type
TicketsupDictCategory=Tickets categories
diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang
index 2b254bf91e7..0f9fcac1d02 100644
--- a/htdocs/langs/en_US/trips.lang
+++ b/htdocs/langs/en_US/trips.lang
@@ -21,17 +21,17 @@ ListToApprove=Waiting for approval
ExpensesArea=Expense reports area
ClassifyRefunded=Classify 'Refunded'
ExpenseReportWaitingForApproval=A new expense report has been submitted for approval
-ExpenseReportWaitingForApprovalMessage=A new expense report has been submitted and is waiting for approval.\n - User: %s\n - Period: %s\nClick here to validate: %s
+ExpenseReportWaitingForApprovalMessage=A new expense report has been submitted and is waiting for approval. - User: %s - Period: %s Click here to validate: %s
ExpenseReportWaitingForReApproval=An expense report has been submitted for re-approval
-ExpenseReportWaitingForReApprovalMessage=An expense report has been submitted and is waiting for re-approval.\nThe %s, you refused to approve the expense report for this reason: %s.\nA new version has been proposed and waiting for your approval.\n - User: %s\n - Period: %s\nClick here to validate: %s
+ExpenseReportWaitingForReApprovalMessage=An expense report has been submitted and is waiting for re-approval. The %s, you refused to approve the expense report for this reason: %s. A new version has been proposed and waiting for your approval. - User: %s - Period: %s Click here to validate: %s
ExpenseReportApproved=An expense report was approved
-ExpenseReportApprovedMessage=The expense report %s was approved.\n - User: %s\n - Approved by: %s\nClick here to show the expense report: %s
+ExpenseReportApprovedMessage=The expense report %s was approved. - User: %s - Approved by: %s Click here to show the expense report: %s
ExpenseReportRefused=An expense report was refused
-ExpenseReportRefusedMessage=The expense report %s was refused.\n - User: %s\n - Refused by: %s\n - Motive for refusal: %s\nClick here to show the expense report: %s
+ExpenseReportRefusedMessage=The expense report %s was refused. - User: %s - Refused by: %s - Motive for refusal: %s Click here to show the expense report: %s
ExpenseReportCanceled=An expense report was canceled
-ExpenseReportCanceledMessage=The expense report %s was canceled.\n - User: %s\n - Canceled by: %s\n - Motive for cancellation: %s\nClick here to show the expense report: %s
+ExpenseReportCanceledMessage=The expense report %s was canceled. - User: %s - Canceled by: %s - Motive for cancellation: %s Click here to show the expense report: %s
ExpenseReportPaid=An expense report was paid
-ExpenseReportPaidMessage=The expense report %s was paid.\n - User: %s\n - Paid by: %s\nClick here to show the expense report: %s
+ExpenseReportPaidMessage=The expense report %s was paid. - User: %s - Paid by: %s Click here to show the expense report: %s
TripId=Id expense report
AnyOtherInThisListCanValidate=Person to inform for validation.
TripSociete=Information company
diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang
index a44463d0d1b..e1a3b46bcf1 100644
--- a/htdocs/langs/fr_FR/holiday.lang
+++ b/htdocs/langs/fr_FR/holiday.lang
@@ -31,6 +31,10 @@ InfosWorkflowCP=Informations du workflow
RequestByCP=Demandée par
TitreRequestCP=Demande de congés
NbUseDaysCP=Nombre de jours de congés consommés
+NbUseDaysCPShort=Jours consommés
+NbUseDaysCPShortInMonth=Jours consommés dans le mois
+DateStartInMonth=Start date in month
+DateEndInMonth=End date in month
EditCP=Modifier
DeleteCP=Supprimer
ActionRefuseCP=Refuser
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index c5f15db7158..c1867fb87f7 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -98,14 +98,14 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
if (! $sortorder) $sortorder="ASC";
-// Protection if external user
+// Security check
$socid=0;
-if ($user->societe_id > 0)
+if ($user->societe_id > 0) // Protection if external user
{
//$socid = $user->societe_id;
accessforbidden();
}
-//$result = restrictedArea($user, 'mymodule', $id,'');
+//$result = restrictedArea($user, 'mymodule', $id, '');
// Initialize array of search criterias
$search_all=trim(GETPOST("search_all",'alpha'));
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 28afacba39f..ba200ddcfb0 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -648,45 +648,13 @@ class Project extends CommonObject
}
}
- // Delete tasks
- if (! $error)
- {
- $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task_time";
- $sql.= " WHERE fk_task IN (SELECT rowid FROM " . MAIN_DB_PREFIX . "projet_task WHERE fk_projet=" . $this->id . ")";
+ // Fetch tasks
+ $this->getLinesArray($user);
- $resql = $this->db->query($sql);
- if (!$resql)
- {
- $this->errors[] = $this->db->lasterror();
- $error++;
- }
- }
-
- if (! $error)
- {
- $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task_extrafields";
- $sql.= " WHERE fk_object IN (SELECT rowid FROM " . MAIN_DB_PREFIX . "projet_task WHERE fk_projet=" . $this->id . ")";
-
- $resql = $this->db->query($sql);
- if (!$resql)
- {
- $this->errors[] = $this->db->lasterror();
- $error++;
- }
- }
-
- if (! $error)
- {
- $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task";
- $sql.= " WHERE fk_projet=" . $this->id;
-
- $resql = $this->db->query($sql);
- if (!$resql)
- {
- $this->errors[] = $this->db->lasterror();
- $error++;
- }
- }
+ // Delete tasks
+ foreach($this->lines as &$task) {
+ $task->delete($user);
+ }
// Delete project
if (! $error)
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 90f0fc56755..22887c5e42d 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -435,8 +435,8 @@ $arrayofmassactions = array(
// 'builddoc'=>$langs->trans("PDFMerge"),
);
//if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
-if ($user->rights->societe->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
if ($user->rights->projet->creer) $arrayofmassactions['close']=$langs->trans("Close");
+if ($user->rights->societe->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 7230170e1aa..96baf02c7d8 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -41,17 +41,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
// Security check
// No check on module enabled. Done later according to $validpaymentmethod
-$langs->load("main");
-$langs->load("other");
-$langs->load("dict");
-$langs->load("bills");
-$langs->load("companies");
-$langs->load("errors");
-$langs->load("paybox"); // File with generic data
+$langs->loadLangs(array("main","other","dict","bills","companies","errors","paybox")); // File with generic data
$action=GETPOST('action','aZ09');
@@ -273,16 +268,17 @@ if ($action == 'dopayment')
$PAYPAL_PAYMENT_TYPE='Sale';
$origfulltag=GETPOST("fulltag",'alpha');
- $shipToName=GETPOST("shipToName");
- $shipToStreet=GETPOST("shipToStreet");
- $shipToCity=GETPOST("shipToCity");
- $shipToState=GETPOST("shipToState");
- $shipToCountryCode=GETPOST("shipToCountryCode");
- $shipToZip=GETPOST("shipToZip");
- $shipToStreet2=GETPOST("shipToStreet2");
- $phoneNum=GETPOST("phoneNum");
- $email=GETPOST("email");
+ $shipToName=GETPOST("shipToName",'alpha');
+ $shipToStreet=GETPOST("shipToStreet",'alpha');
+ $shipToCity=GETPOST("shipToCity",'alpha');
+ $shipToState=GETPOST("shipToState",'alpha');
+ $shipToCountryCode=GETPOST("shipToCountryCode",'alpha');
+ $shipToZip=GETPOST("shipToZip",'alpha');
+ $shipToStreet2=GETPOST("shipToStreet2",'alpha');
+ $phoneNum=GETPOST("phoneNum",'alpha');
+ $email=GETPOST("email",'alpha');
$desc=GETPOST("desc",'alpha');
+ $thirdparty_id=GETPOST('thirdparty_id', 'int');
$mesg='';
if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE))
@@ -347,7 +343,8 @@ if ($action == 'dopayment')
if ($paymentmethod == 'paybox')
{
$PRICE=price2num(GETPOST("newamount"),'MT');
- $email=GETPOST("email");
+ $email=GETPOST("email",'alpha');
+ $thirdparty_id=GETPOST('thirdparty_id', 'int');
$origfulltag=GETPOST("fulltag",'alpha');
@@ -388,7 +385,7 @@ if ($action == 'dopayment')
// Called when choosing Stripe mode, after the 'dopayment'
-if ($action == 'charge')
+if ($action == 'charge' && ! empty($conf->stripe->enabled))
{
$amountstripe = $amount;
@@ -401,36 +398,112 @@ if ($action == 'charge')
dol_syslog("POST values: ".join(',', $_POST), LOG_DEBUG, 0, '_stripe');
$stripeToken = GETPOST("stripeToken",'alpha');
- $email = GETPOST("stripeEmail",'alpha');
+ $email = GETPOST("email",'alpha');
+ $thirdparty_id=GETPOST('thirdparty_id', 'int');
$vatnumber = GETPOST('vatnumber','alpha');
dol_syslog("stripeToken = ".$stripeToken, LOG_DEBUG, 0, '_stripe');
dol_syslog("email = ".$email, LOG_DEBUG, 0, '_stripe');
+ dol_syslog("thirdparty_id = ".$thirdparty_id, LOG_DEBUG, 0, '_stripe');
dol_syslog("vatnumber = ".$vatnumber, LOG_DEBUG, 0, '_stripe');
$error = 0;
try {
- dol_syslog("Create customer card profile", LOG_DEBUG, 0, '_stripe');
- $customer = \Stripe\Customer::create(array(
- 'email' => $email,
- 'description' => ($email?'Customer card profile for '.$email:null),
- 'metadata' => array('ipaddress'=>$_SERVER['REMOTE_ADDR']),
- 'business_vat_id' => ($vatnumber?$vatnumber:null),
- 'source' => $stripeToken // source can be a token OR array('object'=>'card', 'exp_month'=>xx, 'exp_year'=>xxxx, 'number'=>xxxxxxx, 'cvc'=>xxx, 'name'=>'Cardholder's full name', zip ?)
- ));
- // Return $customer = array('id'=>'cus_XXXX', ...)
+ $metadata = array(
+ 'dol_version'=>DOL_VERSION,
+ 'dol_entity'=>$conf->entity,
+ 'ipaddress'=>(empty($_SERVER['REMOTE_ADDR'])?'':$_SERVER['REMOTE_ADDR'])
+ );
+ if (! empty($dol_id)) $metadata["dol_id"] = $dol_id;
+ if (! empty($dol_type)) $metadata["dol_type"] = $dol_type;
+ if (! empty($thirdparty_id)) $metadata["dol_thirdparty_id"] = $thirdparty_id;
- dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe');
- $charge = \Stripe\Charge::create(array(
- 'customer' => $customer->id,
- 'amount' => price2num($amountstripe, 'MU'),
- 'currency' => $currency,
- 'description' => 'Stripe payment: '.$FULLTAG,
- 'metadata' => array("FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name),
- 'statement_descriptor' => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 6, 'right', 'UTF-8', 1).' '.$FULLTAG, 22, 'right', 'UTF-8', 1) // 22 chars that appears on bank receipt
- ));
- // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...)
+ if ($thirdparty_id > 0)
+ {
+ dol_syslog("Search existing customer profile for thirdparty_id=".$thirdparty_id, LOG_DEBUG, 0, '_stripe');
+
+ $service = 'StripeTest';
+ $servicestatus = 0;
+ if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox','alpha'))
+ {
+ $service = 'StripeLive';
+ $servicestatus = 1;
+ }
+ $stripeacc = null; // No Oauth/connect use for public pages
+
+ $thirdparty = new Societe($db);
+ $thirdparty->fetch($thirdparty_id);
+
+ include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
+ $stripe = new Stripe($db);
+ $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 1);
+
+ $card = $customer->sources->create(array("source" => $stripeToken, "metadata" => $metadata));
+
+ if (empty($card))
+ {
+ $error++;
+ dol_syslog('Failed to create card record', LOG_WARNING, 0, '_stripe');
+ setEventMessages('Failed to create card record', null, 'errors');
+ $action='';
+ }
+ else
+ {
+ dol_syslog("Create charge on card ".$card->id, LOG_DEBUG, 0, '_stripe');
+ $charge = \Stripe\Charge::create(array(
+ 'amount' => price2num($amountstripe, 'MU'),
+ 'currency' => $currency,
+ 'capture' => true, // Charge immediatly
+ 'description' => 'Stripe payment: '.$FULLTAG,
+ 'metadata' => array("FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>(empty($_SERVER['REMOTE_ADDR'])?'':$_SERVER['REMOTE_ADDR'])),
+ 'customer' => $customer->id,
+ 'source' => $card,
+ 'statement_descriptor' => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 6, 'right', 'UTF-8', 1).' '.$FULLTAG, 22, 'right', 'UTF-8', 1) // 22 chars that appears on bank receipt
+ ));
+ // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...)
+ if (empty($charge))
+ {
+ $error++;
+ dol_syslog('Failed to charge card', LOG_WARNING, 0, '_stripe');
+ setEventMessages('Failed to charge card', null, 'errors');
+ $action='';
+ }
+ }
+ }
+ else
+ {
+ dol_syslog("Create anonymous customer card profile", LOG_DEBUG, 0, '_stripe');
+ $customer = \Stripe\Customer::create(array(
+ 'email' => $email,
+ 'description' => ($email?'Anonymous customer for '.$email:'Anonymous customer'),
+ 'metadata' => $metadata,
+ 'business_vat_id' => ($vatnumber?$vatnumber:null),
+ 'source' => $stripeToken // source can be a token OR array('object'=>'card', 'exp_month'=>xx, 'exp_year'=>xxxx, 'number'=>xxxxxxx, 'cvc'=>xxx, 'name'=>'Cardholder's full name', zip ?)
+ ));
+ // Return $customer = array('id'=>'cus_XXXX', ...)
+
+ // The customer was just created with a source, so we can make a charge
+ // with no card defined, the source just used for customer creation will be used.
+ dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe');
+ $charge = \Stripe\Charge::create(array(
+ 'customer' => $customer->id,
+ 'amount' => price2num($amountstripe, 'MU'),
+ 'currency' => $currency,
+ 'capture' => true, // Charge immediatly
+ 'description' => 'Stripe payment: '.$FULLTAG,
+ 'metadata' => array("FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>(empty($_SERVER['REMOTE_ADDR'])?'':$_SERVER['REMOTE_ADDR'])),
+ 'statement_descriptor' => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 6, 'right', 'UTF-8', 1).' '.$FULLTAG, 22, 'right', 'UTF-8', 1) // 22 chars that appears on bank receipt
+ ));
+ // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...)
+ if (empty($charge))
+ {
+ $error++;
+ dol_syslog('Failed to charge card', LOG_WARNING, 0, '_stripe');
+ setEventMessages('Failed to charge card', null, 'errors');
+ $action='';
+ }
+ }
} catch(\Stripe\Error\Card $e) {
// Since it's a decline, \Stripe\Error\Card will be caught
$body = $e->getJsonBody();
@@ -444,8 +517,8 @@ if ($action == 'charge')
print('Message is:' . $err['message'] . "\n");
$error++;
- setEventMessages($e->getMessage(), null, 'errors');
dol_syslog($e->getMessage(), LOG_WARNING, 0, '_stripe');
+ setEventMessages($e->getMessage(), null, 'errors');
$action='';
} catch (\Stripe\Error\RateLimit $e) {
// Too many requests made to the API too quickly
@@ -794,8 +867,9 @@ if ($source == 'order')
{
print ''."\n";
}
+ print ' '."\n";
print ' '."\n";
- print ' '."\n";
+ print ' '."\n";
$labeldesc=$langs->trans("Order").' '.$order->ref;
if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha');
print ' '."\n";
@@ -928,8 +1002,9 @@ if ($source == 'invoice')
{
print ''."\n";
}
+ print ' '."\n";
print ' '."\n";
- print ' '."\n";
+ print ' '."\n";
$labeldesc=$langs->trans("Invoice").' '.$invoice->ref;
if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha');
print ' '."\n";
@@ -1135,8 +1210,9 @@ if ($source == 'contractline')
{
print ''."\n";
}
+ print ' '."\n";
print ' '."\n";
- print ' '."\n";
+ print ' '."\n";
$labeldesc=$langs->trans("Contract").' '.$contract->ref;
if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha');
print ' '."\n";
@@ -1438,6 +1514,8 @@ if (preg_match('/^dopayment/',$action))
print ' '."\n";
print ' '."\n";
print ' ';
+ print ' ';
+ print ' ';
print '
diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php
index fc04ef87f1a..9291b2af615 100644
--- a/htdocs/public/stripe/newpayment.php
+++ b/htdocs/public/stripe/newpayment.php
@@ -219,7 +219,7 @@ if ($action == 'charge')
dol_syslog("POST values: ".join(',', $_POST), LOG_DEBUG, 0, '_stripe');
$stripeToken = GETPOST("stripeToken",'alpha');
- $email = GETPOST("stripeEmail",'alpha');
+ $email = GETPOST("email",'alpha');
$vatnumber = GETPOST('vatnumber','alpha');
dol_syslog("stripeToken = ".$stripeToken, LOG_DEBUG, 0, '_stripe');
@@ -1149,6 +1149,8 @@ if (preg_match('/^dopayment/',$action))
print ' '."\n";
print ' '."\n";
print ' ';
+ print ' ';
+ print ' ';
print '
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index e515818cd3d..4a5f3ab87bd 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -46,11 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
-$langs->load("companies");
-$langs->load("commercial");
-$langs->load("bills");
-$langs->load("banks");
-$langs->load("users");
+$langs->loadLangs(array("companies","commercial","bills","banks","users"));
if (! empty($conf->categorie->enabled)) $langs->load("categories");
if (! empty($conf->incoterm->enabled)) $langs->load("incoterm");
if (! empty($conf->notification->enabled)) $langs->load("mails");
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 157fa85e77d..d266094b53b 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -278,7 +278,9 @@ input.select2-input {
.liste_titre input[name=month_date_when], .liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre select[name=month],
.liste_titre input[name=month_lim], .liste_titre input[name=month_start], .liste_titre input[name=month_end], .liste_titre input[name=month_create],
-.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when] {
+.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when],
+.liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end]
+{
margin-right: 4px;
}
input[type=submit] {
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 5b8d82aaa53..88ef5d5caaa 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -291,7 +291,9 @@ textarea.cke_source:focus
.liste_titre input[name=month_date_when], .liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month],
.liste_titre input[name=month_lim], .liste_titre input[name=month_start], .liste_titre input[name=month_end], .liste_titre input[name=month_create],
-.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when] {
+.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when],
+.liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end]
+{
margin-right: 4px;
}
input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select {
diff --git a/htdocs/ticketsup/document.php b/htdocs/ticketsup/document.php
index a19a972c143..94348e1054c 100644
--- a/htdocs/ticketsup/document.php
+++ b/htdocs/ticketsup/document.php
@@ -33,12 +33,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT . "/core/lib/company.lib.php";
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
-$langs->load("companies");
-$langs->load('other');
-$langs->load("ticketsup");
+$langs->loadLangs(array("companies","other","ticketsup"));
-$action = GETPOST('action');
-$confirm = GETPOST('confirm');
+$action = GETPOST('action','alpha');
+$confirm = GETPOST('confirm','alpha');
$id = GETPOST('id', 'int');
$track_id = GETPOST('track_id', 'alpha');
$ref = GETPOST('ref', 'alpha');
@@ -61,7 +59,6 @@ $pagenext = $page + 1;
if (!$sortorder) {
$sortorder = "ASC";
}
-
if (!$sortfield) {
$sortfield = "name";
}
@@ -75,22 +72,22 @@ $object->ref = $object->track_id;
if ($result < 0) {
- setEventMessage($object->error, 'errors');
+ setEventMessages($object->error, $object->errors, 'errors');
} else {
$upload_dir = $conf->ticketsup->dir_output . "/" . dol_sanitizeFileName($object->track_id);
}
+
/*
* Actions
*/
-// Included file moved into Dolibarr 4, keep it for compatibility
-$res=@include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
-if (! $res) {
- include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
-}
+
+include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
$object->ref = $old_ref;
+
+
/*
* View
*/
@@ -155,10 +152,12 @@ if ($object->id) {
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
}
+
// For compatibility we use track ID for directory
$object->ref = $object->track_id;
$modulepart = 'ticketsup';
$permission = $user->rights->ticketsup->write;
+ $permtoedit = $user->rights->ticketsup->write;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index 52de09d566d..83daf039aa2 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -460,7 +460,7 @@ else
if (! empty($user->admin))
{
print '';
- print img_delete($langs->trans("RemoveFromGroup"));
+ print img_picto($langs->trans("RemoveFromGroup"), 'unlink');
print ' ';
}
else