Merge pull request #5 from Dolibarr/develop

update
This commit is contained in:
mattsidnell 2020-04-20 22:29:09 +01:00 committed by GitHub
commit 1b3085fbcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
255 changed files with 9916 additions and 9206 deletions

View File

@ -41,7 +41,7 @@ Ace 1.4.8 BSD Yes
ChartJS 2.9.3 MIT License Yes JS library for graph ChartJS 2.9.3 MIT License Yes JS library for graph
jQuery 3.4.1 MIT License Yes JS library jQuery 3.4.1 MIT License Yes JS library
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors
jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images) jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images)

View File

@ -13,7 +13,7 @@ For Developers or integrators:
- replace $page = GETPOST('page', 'int') with $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); - replace $page = GETPOST('page', 'int') with $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
- remove input field in form '<input type="hidden" name="page" value="'.$page.'">';' - remove input field in form '<input type="hidden" name="page" value="'.$page.'">';'
- add parameter $pagenavastextinput to value 1 when calling print_barre_liste - add parameter $pagenavastextinput to value 1 when calling print_barre_liste
* UserGroup class has been refactored with new architecture. Triggers of class UserGroup are now USERGROUP_CREATE, USERGROUP_MODIFY, USERGROUP_DELETE
WARNING: WARNING:

View File

@ -104,6 +104,27 @@ with
//return false; //return false;
} }
* Replace in tcpdf.php
if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
with
// @CHANGE LDR Add support for src="file://..." links
if (strpos($imgsrc, 'file://') === 0) {
$imgsrc = str_replace('file://', '/', $imgsrc);
$imgsrc = urldecode($imgsrc);
$testscrtype = @parse_url($imgsrc);
if (empty($testscrtype['query'])) {
// convert URL to server path
$imgsrc = str_replace(K_PATH_URL, K_PATH_MAIN, $imgsrc);
} elseif (preg_match('|^https?://|', $imgsrc) !== 1) {
// convert URL to server path
$imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc);
}
}
elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
* In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace * In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace
@ -277,3 +298,15 @@ JEDITABLE.JS
* <button type="submit" /> => <button class="button" type="submit" /> * <button type="submit" /> => <button class="button" type="submit" />
* <button type="cancel" /> => <button class="button" type="cancel" /> * <button type="cancel" /> => <button class="button" type="cancel" />
SELECT2
-------
Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug: https://github.com/select2/select2/issues/5832
.select2-hidden-accessible {
margin: -1px !important; /* line to restore */
}

File diff suppressed because one or more lines are too long

View File

@ -373,7 +373,7 @@ if ($result) {
print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>'; print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>';
// Ref product // Ref product
print '<td>'; print '<td class="tdoverflowmax100">';
if ($product_static->id > 0) print $product_static->getNomUrl(1); if ($product_static->id > 0) print $product_static->getNomUrl(1);
if ($product_static->id > 0 && $objp->product_label) print '<br>'; if ($product_static->id > 0 && $objp->product_label) print '<br>';
if ($objp->product_label) print $objp->product_label; if ($objp->product_label) print $objp->product_label;

View File

@ -462,7 +462,7 @@ if ($result) {
} }
} elseif ($objp->type_l == 0) { } elseif ($objp->type_l == 0) {
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
$objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); $objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : '');
$suggestedaccountingaccountbydefaultfor = ''; $suggestedaccountingaccountbydefaultfor = '';
} else { } else {
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale

View File

@ -86,13 +86,14 @@ class Members extends DolibarrApi
* @param int $limit Limit for list * @param int $limit Limit for list
* @param int $page Page number * @param int $page Page number
* @param string $typeid ID of the type of member * @param string $typeid ID of the type of member
* @param int $category Use this param to filter list by category
* @param string $sqlfilters Other criteria to filter answers separated by a comma. * @param string $sqlfilters Other criteria to filter answers separated by a comma.
* Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))" * Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))"
* @return array Array of member objects * @return array Array of member objects
* *
* @throws RestException * @throws RestException
*/ */
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '') public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $category = 0, $sqlfilters = '')
{ {
global $db, $conf; global $db, $conf;
@ -104,11 +105,19 @@ class Members extends DolibarrApi
$sql = "SELECT t.rowid"; $sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as t"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as t";
if ($category > 0) {
$sql .= ", ".MAIN_DB_PREFIX."categorie_member as c";
}
$sql .= ' WHERE t.entity IN ('.getEntity('adherent').')'; $sql .= ' WHERE t.entity IN ('.getEntity('adherent').')';
if (!empty($typeid)) if (!empty($typeid))
{ {
$sql .= ' AND t.fk_adherent_type='.$typeid; $sql .= ' AND t.fk_adherent_type='.$typeid;
} }
// Select members of given category
if ($category > 0) {
$sql .= " AND c.fk_categorie = ".$db->escape($category);
$sql .= " AND c.fk_member = t.rowid ";
}
// Add sql filters // Add sql filters
if ($sqlfilters) if ($sqlfilters)
{ {

View File

@ -45,11 +45,12 @@ $confirm = GETPOST('confirm', 'alpha');
$result = restrictedArea($user, 'adherent', $id); $result = restrictedArea($user, 'adherent', $id);
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -259,10 +259,9 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information"; $topicmail = "Information";
$modelmail = "subscription"; $modelmail = "subscription";

View File

@ -239,6 +239,8 @@ if (!$rowid && $action != 'create' && $action != 'edit')
$i = 0; $i = 0;
$param = ''; $param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->adherent->configurer) if ($user->rights->adherent->configurer)
@ -252,10 +254,9 @@ if (!$rowid && $action != 'create' && $action != 'edit')
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit); print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
$moreforfilter = ''; $moreforfilter = '';

View File

@ -192,7 +192,8 @@ elseif ($action == 'set_ORDER_FREE_TEXT')
{ {
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} elseif ($action == "setshippableiconinlist") { }
elseif ($action == "setshippableiconinlist") {
// Activate Set Shippable Icon In List // Activate Set Shippable Icon In List
$setshippableiconinlist = GETPOST('value', 'int'); $setshippableiconinlist = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity); $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
@ -203,6 +204,25 @@ elseif ($action == 'set_ORDER_FREE_TEXT')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
elseif ($action == 'setribchq')
{
$rib = GETPOST('rib', 'alpha');
$chq = GETPOST('chq', 'alpha');
$res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if (!$error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
// Activate ask for payment bank // Activate ask for payment bank
elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
@ -517,7 +537,122 @@ foreach ($dirmodels as $reldir)
} }
print '</table>'; print '</table>';
print "<br>";
/*
* Payment mode
*/
print '<br>';
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInOrder"), '', '');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>';
print '<input type="hidden" name="action" value="setribchq">';
print $langs->trans("PaymentMode").'</td>';
print '<td align="right">';
if (empty($conf->facture->enabled)) {
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
}
print '</td>';
print "</tr>\n";
print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
print "<td>";
if (empty($conf->facture->enabled))
{
if (!empty($conf->banque->enabled))
{
$sql = "SELECT rowid, label";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql .= " WHERE clos = 0";
$sql .= " AND courant = 1";
$sql .= " AND entity IN (".getEntity('bank_account').")";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
if ($num > 0)
{
print '<select name="rib" class="flat" id="rib">';
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
while ($i < $num)
{
$row = $db->fetch_row($resql);
print '<option value="'.$row[0].'"';
print $conf->global->FACTURE_RIB_NUMBER == $row[0] ? ' selected' : '';
print '>'.$row[1].'</option>';
$i++;
}
print "</select>";
}
else
{
print "<i>".$langs->trans("NoActiveBankAccountDefined")."</i>";
}
}
}
else
{
print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>';
}
}
else {
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
}
print "</td></tr>";
print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>";
print "<td>";
if (empty($conf->facture->enabled))
{
print '<select class="flat" name="chq" id="chq">';
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>';
$sql = "SELECT rowid, label";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql .= " WHERE clos = 0";
$sql .= " AND courant = 1";
$sql .= " AND entity IN (".getEntity('bank_account').")";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$row = $db->fetch_row($resql);
print '<option value="'.$row[0].'"';
print $conf->global->FACTURE_CHQ_NUMBER == $row[0] ? ' selected' : '';
print '>'.$langs->trans("OwnerOfBankAccount", $row[1]).'</option>';
$i++;
}
}
print "</select>";
}
else {
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
}
print "</td></tr>";
print "</table>";
print "</form>";
print '<br>';
/* /*
* Other options * Other options

View File

@ -208,7 +208,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity)
{ {
print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
} }
print getTitleFieldOfList("Action", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); print getTitleFieldOfList("", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
print "</tr>\n"; print "</tr>\n";

View File

@ -643,7 +643,7 @@ if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf
} }
/* /*
* Modes de reglement * Payment modes
*/ */
print '<br>'; print '<br>';
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"), '', ''); print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"), '', '');

View File

@ -96,7 +96,26 @@ print "</tr>\n";
_printOnOff('INVOICE_USE_SITUATION', $langs->trans('UseSituationInvoices')); _printOnOff('INVOICE_USE_SITUATION', $langs->trans('UseSituationInvoices'));
_printOnOff('INVOICE_USE_SITUATION_CREDIT_NOTE', $langs->trans('UseSituationInvoicesCreditNote')); _printOnOff('INVOICE_USE_SITUATION_CREDIT_NOTE', $langs->trans('UseSituationInvoicesCreditNote'));
_printOnOff('INVOICE_USE_SITUATION_RETAINED_WARRANTY', $langs->trans('Retainedwarranty')); //_printOnOff('INVOICE_USE_RETAINED_WARRANTY', $langs->trans('Retainedwarranty'));
$confkey = 'INVOICE_USE_RETAINED_WARRANTY';
$arrayAvailableType = array(
Facture::TYPE_SITUATION => $langs->trans("InvoiceSituation"),
Facture::TYPE_STANDARD.'+'.Facture::TYPE_SITUATION => $langs->trans("InvoiceSituation").' + '.$langs->trans("InvoiceStandard"),
);
$selected = array();
$implodeglue = '+';
if(!empty($conf->global->{$confkey}) && !is_array($conf->global->{$confkey})){
$selected = explode('+', $conf->global->{$confkey});
}
$curentInput = (empty($inputCount)?1:($inputCount+1));
$formSelectInvoiceType = $form->selectarray('value'. $curentInput, $arrayAvailableType, $selected, 1);
_printInputFormPart($confkey, $langs->trans('AllowedInvoiceForRetainedWarranty'), '', array(), $formSelectInvoiceType);
//_printOnOff('INVOICE_RETAINED_WARRANTY_LIMITED_TO_SITUATION', $langs->trans('RetainedwarrantyOnlyForSituation'));
_printOnOff('INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION', $langs->trans('RetainedwarrantyOnlyForSituationFinal'));
$metas = array( $metas = array(
'type' => 'number', 'type' => 'number',
@ -227,8 +246,12 @@ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = arra
print '<input type="hidden" name="action" value="setModuleOptions">'; print '<input type="hidden" name="action" value="setModuleOptions">';
if ($type=='textarea') { if ($type=='textarea') {
print '<textarea '.$metascompil.' >'.dol_htmlentities($conf->global->{$confkey}).'</textarea>'; print '<textarea '.$metascompil.' >'.dol_htmlentities($conf->global->{$confkey}).'</textarea>';
} else { }elseif($type=='input'){
print '<input '.$metascompil.' />'; print '<input '.$metascompil.' />';
}
else{
// custom
print $type;
} }
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -23,7 +23,7 @@
/** /**
* \file htdocs/admin/ldap.php * \file htdocs/admin/ldap.php
* \ingroup ldap * \ingroup ldap
* \brief Page d'administration/configuration du module Ldap * \brief Page to setup module LDAP
*/ */
require '../main.inc.php'; require '../main.inc.php';
@ -57,19 +57,20 @@ if (empty($reshook))
$error = 0; $error = 0;
$db->begin(); $db->begin();
if (!dolibarr_set_const($db, 'LDAP_SERVER_TYPE', GETPOST("type"), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION', GETPOST("LDAP_SERVER_PROTOCOLVERSION"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_TYPE', GETPOST("type", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_SERVER_HOST', GETPOST("host"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION', GETPOST("LDAP_SERVER_PROTOCOLVERSION", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_SERVER_HOST_SLAVE', GETPOST("slave"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_HOST', GETPOST("host", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_SERVER_PORT', GETPOST("port"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_HOST_SLAVE', GETPOST("slave", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_SERVER_DN', GETPOST("dn"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_PORT', GETPOST("port", 'int'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_ADMIN_DN', GETPOST("admin"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_DN', GETPOST("dn", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_ADMIN_PASS', GETPOST("pass"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_ADMIN_DN', GETPOST("admin", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_SERVER_USE_TLS', GETPOST("usetls"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_ADMIN_PASS', GETPOST("pass", 'none'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_SYNCHRO_ACTIVE', GETPOST("activesynchro"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SERVER_USE_TLS', GETPOST("usetls", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE', GETPOST("activecontact"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_SYNCHRO_ACTIVE', GETPOST("activesynchro", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE', GETPOST("activemembers"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE', GETPOST("activecontact", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_ACTIVE', GETPOST("activememberstypes"), 'chaine', 0, '', $conf->entity)) $error++; if (!dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE', GETPOST("activemembers", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (!dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_ACTIVE', GETPOST("activememberstypes", 'aZ09'), 'chaine', 0, '', $conf->entity)) $error++;
if (!$error) if (!$error)
{ {

View File

@ -754,9 +754,9 @@ if ($resql)
print '<td class="center">'; print '<td class="center">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">'; print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button buttongen" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>'; print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button buttongen" name="actioncancel" value="'.$langs->trans("Cancel").'">';
print '</td>'; print '</td>';
$fieldsforcontent = array('topic', 'joinfiles', 'content'); $fieldsforcontent = array('topic', 'joinfiles', 'content');
@ -902,10 +902,10 @@ if ($resql)
// Modify link / Delete link // Modify link / Delete link
print '<td class="center nowraponall" width="64">'; print '<td class="center nowraponall" width="64">';
if ($canbemodified) print '<a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a>'; if ($canbemodified) print '<a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a>';
if ($iserasable) if ($iserasable)
{ {
print ' &nbsp; <a href="'.$url.'action=delete">'.img_delete().'</a>'; print '<a class="marginleftonly" href="'.$url.'action=delete">'.img_delete().'</a>';
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin //else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
} }
print '</td>'; print '</td>';

View File

@ -515,11 +515,11 @@ foreach ($dirmodels as $reldir)
print '</table>'; print '</table>';
/* /*
* Payment mode * Payment mode
*/ */
if (empty($conf->facture->enabled))
{
print '<br>'; print '<br>';
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInProposal"), '', ''); print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInProposal"), '', '');
@ -532,12 +532,18 @@ if (empty($conf->facture->enabled))
print '<td>'; print '<td>';
print '<input type="hidden" name="action" value="setribchq">'; print '<input type="hidden" name="action" value="setribchq">';
print $langs->trans("PaymentMode").'</td>'; print $langs->trans("PaymentMode").'</td>';
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td align="right">';
if (empty($conf->facture->enabled)) {
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
}
print '</td>';
print "</tr>\n"; print "</tr>\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>"; print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
print "<td>"; print "<td>";
if (empty($conf->facture->enabled))
{
if (!empty($conf->banque->enabled)) if (!empty($conf->banque->enabled))
{ {
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
@ -574,13 +580,19 @@ if (empty($conf->facture->enabled))
} }
else else
{ {
print $langs->trans("BankModuleNotActive"); print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>';
}
}
else {
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
} }
print "</td></tr>"; print "</td></tr>";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>"; print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>";
print "<td>"; print "<td>";
if (empty($conf->facture->enabled))
{
print '<select class="flat" name="chq" id="chq">'; print '<select class="flat" name="chq" id="chq">';
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>'; print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>'; print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>';
@ -608,10 +620,14 @@ if (empty($conf->facture->enabled))
} }
} }
print "</select>"; print "</select>";
}
else {
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
}
print "</td></tr>"; print "</td></tr>";
print "</table>"; print "</table>";
print "</form>"; print "</form>";
}
print '<br>'; print '<br>';

View File

@ -41,11 +41,12 @@ if ($user->socid > 0)
$socid = $user->socid; $socid = $user->socid;
} }
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "DESC"; if (!$sortorder) $sortorder = "DESC";

View File

@ -45,11 +45,12 @@ $ref = GETPOST('ref', 'alpha');
//$result = restrictedArea($user, 'asset', $id); //$result = restrictedArea($user, 'asset', $id);
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -46,11 +46,12 @@ $ref = GETPOST('ref', 'alpha');
//$result = restrictedArea($user, 'bom', $id); //$result = restrictedArea($user, 'bom', $id);
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -172,7 +172,7 @@ if ($action == 'create')
// Owner // Owner
print '<tr><td>'.$langs->trans("Owner").'</td><td>'; print '<tr><td>'.$langs->trans("Owner").'</td><td>';
print $form->select_dolusers(isset($_POST['userid']) ? $_POST['userid'] : $user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print img_picto('', 'user').' '.$form->select_dolusers(isset($_POST['userid']) ? $_POST['userid'] : $user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td><td class="hideonsmartphone">&nbsp;</td></tr>'; print '</td><td class="hideonsmartphone">&nbsp;</td></tr>';
// Position // Position
@ -276,11 +276,11 @@ if ($id > 0 && !preg_match('/^add/i', $action))
print '<tr><td>'.$langs->trans("Owner").'</td><td>'; print '<tr><td>'.$langs->trans("Owner").'</td><td>';
if ($action == 'edit' && $user->admin) if ($action == 'edit' && $user->admin)
{ {
print $form->select_dolusers(isset($_POST['userid']) ? $_POST['userid'] : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print img_picto('', 'user').' '.$form->select_dolusers(isset($_POST['userid']) ? $_POST['userid'] : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
} }
else else
{ {
if ($object->fk_user) if ($object->fk_user > 0)
{ {
$fuser = new User($db); $fuser = new User($db);
$fuser->fetch($object->fk_user); $fuser->fetch($object->fk_user);

View File

@ -155,13 +155,12 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = ''; $newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer)); $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer));
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
@ -178,6 +177,8 @@ print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $par
print_liste_field_titre(''); print_liste_field_titre('');
print "</tr>\n"; print "</tr>\n";
$cacheOfUsers = array();
$i = 0; $i = 0;
while ($i < min($num, $limit)) while ($i < min($num, $limit))
{ {
@ -222,9 +223,13 @@ while ($i < min($num, $limit))
print '<td class="center">'; print '<td class="center">';
if ($obj->fk_user) if ($obj->fk_user)
{ {
$userstatic->id = $obj->fk_user; if (empty($cacheOfUsers[$obj->fk_user])) {
$userstatic->lastname = $obj->login; $tmpuser = new User($db);
print $userstatic->getNomUrl(1); $tmpuser->fetch($obj->fk_user);
$cacheOfUsers[$obj->fk_user] = $tmpuser;
}
$tmpuser = $cacheOfUsers[$obj->fk_user];
print $tmpuser->getNomUrl(1);
} }
else else
{ {
@ -242,11 +247,11 @@ while ($i < min($num, $limit))
print '<td class="nowrap right">'; print '<td class="nowrap right">';
if ($user->rights->bookmark->creer) if ($user->rights->bookmark->creer)
{ {
print '<a href="'.DOL_URL_ROOT."/bookmarks/card.php?action=edit&id=".$obj->rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>"; print '<a class="editfielda" href="'.DOL_URL_ROOT."/bookmarks/card.php?action=edit&id=".$obj->rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
} }
if ($user->rights->bookmark->supprimer) if ($user->rights->bookmark->supprimer)
{ {
print "<a href=\"".$_SERVER["PHP_SELF"]."?action=delete&id=$obj->rowid\">".img_delete()."</a>"; print '<a class="marginleftonly" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$obj->rowid.'">'.img_delete().'</a>';
} }
else else
{ {

View File

@ -62,11 +62,12 @@ if ($id > 0)
} }
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -65,11 +65,12 @@ $result = restrictedArea($user, 'societe', $id, '&societe');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$mode = GETPOST("mode"); $mode = GETPOST("mode");
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -171,7 +171,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th colspan="3">'.$langs->trans("ProposalsDraft").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=0"><span class="badge">'.$num.'</span></a></th></tr>'; print '<th colspan="3">'.$langs->trans("ProposalsDraft").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?search_status=0"><span class="badge">'.$num.'</span></a></th></tr>';
if ($num > 0) if ($num > 0)
{ {
@ -755,7 +755,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></th></tr>'; print '<tr class="liste_titre"><th colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?search_status=1"><span class="badge">'.$num.'</span></th></tr>';
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop) while ($i < $nbofloop)
@ -863,7 +863,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th class="liste_titre" colspan="5">'.$langs->trans("OrdersOpened").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></th></tr>'; print '<tr class="liste_titre"><th class="liste_titre" colspan="5">'.$langs->trans("OrdersOpened").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status=1"><span class="badge">'.$num.'</span></th></tr>';
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop) while ($i < $nbofloop)

View File

@ -3403,8 +3403,8 @@ class Propal extends CommonObject
$response->warning_delay = $delay_warning / 60 / 60 / 24; $response->warning_delay = $delay_warning / 60 / 60 / 24;
$response->label = $label; $response->label = $label;
$response->labelShort = $labelShort; $response->labelShort = $labelShort;
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$status.'&mainmenu=commercial&leftmenu=propals'; $response->url = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals';
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$status.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc'; $response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
$response->img = img_object('', "propal"); $response->img = img_object('', "propal");
// This assignment in condition is not a bug. It allows walking the results. // This assignment in condition is not a bug. It allows walking the results.
@ -3658,7 +3658,7 @@ class Propal extends CommonObject
if ($user->rights->propal->lire) if ($user->rights->propal->lire)
{ {
$label = '<u>'.$langs->trans("ShowPropal").'</u>'; $label = '<u>'.$langs->trans("Proposal").'</u>';
if (!empty($this->ref)) if (!empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->ref_client)) if (!empty($this->ref_client))
@ -3669,6 +3669,11 @@ class Propal extends CommonObject
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (!empty($this->total_ttc)) if (!empty($this->total_ttc))
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
if (isset($this->statut)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5);
}
if ($option == '') { if ($option == '') {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params; $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params;
} }
@ -3696,7 +3701,7 @@ class Propal extends CommonObject
{ {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{ {
$label = $langs->trans("ShowPropal"); $label = $langs->trans("Proposal");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
} }
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';

View File

@ -53,11 +53,12 @@ if (!empty($user->socid))
$result = restrictedArea($user, 'propal', $id); $result = restrictedArea($user, 'propal', $id);
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -195,7 +195,7 @@ if (!empty($conf->propal->enabled))
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
$langs->load("propal"); $langs->load("propal");
print '<td colspan="2">'.$langs->trans("DraftPropals").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=0"><span class="badge">'.$num.'</span></a></td></tr>'; print '<td colspan="2">'.$langs->trans("DraftPropals").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?search_status=0"><span class="badge">'.$num.'</span></a></td></tr>';
$i = 0; $i = 0;
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
@ -345,7 +345,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>'; print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?search_status=1"><span class="badge">'.$num.'</span></a></td></tr>';
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop) while ($i < $nbofloop)
@ -434,7 +434,7 @@ if (! empty($conf->propal->enabled))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("ProposalsToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>'; print '<td colspan="3">'.$langs->trans("ProposalsToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status=1"><span class="badge">'.$num.'</span></a></td></tr>';
if ($num) if ($num)
{ {
@ -507,7 +507,7 @@ if (! empty($conf->propal->enabled))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=2"><span class="badge">'.$num.'</span></a></td></tr>'; print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status=2"><span class="badge">'.$num.'</span></a></td></tr>';
if ($num) if ($num)
{ {

View File

@ -92,7 +92,7 @@ $search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
$search_btn = GETPOST('button_search', 'alpha'); $search_btn = GETPOST('button_search', 'alpha');
$search_remove_btn = GETPOST('button_removefilter', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha');
$viewstatut = GETPOST('viewstatut', 'alpha'); $search_status = GETPOST('search_status', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha');
$object_statut = GETPOST('search_statut', 'alpha'); $object_statut = GETPOST('search_statut', 'alpha');
@ -243,13 +243,13 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_datedelivery_start = ''; $search_datedelivery_start = '';
$search_datedelivery_end = ''; $search_datedelivery_end = '';
$search_availability = ''; $search_availability = '';
$viewstatut = ''; $search_status = '';
$object_statut = ''; $object_statut = '';
$toselect = ''; $toselect = '';
$search_array_options = array(); $search_array_options = array();
$search_categ_cus = 0; $search_categ_cus = 0;
} }
if ($object_statut != '') $viewstatut = $object_statut; if ($object_statut != '') $search_status = $object_statut;
if (empty($reshook)) if (empty($reshook))
{ {
@ -287,7 +287,7 @@ $sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.
$sql .= " typent.code as typent_code,"; $sql .= " typent.code as typent_code,";
$sql .= " ava.rowid as availability,"; $sql .= " ava.rowid as availability,";
$sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,'; $sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva as multicurrency_total_vat, p.multicurrency_total_ttc,'; $sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva as multicurrency_total_vat, p.multicurrency_total_ttc,';
$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,'; $sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
$sql .= ' p.note_public, p.note_private,'; $sql .= ' p.note_public, p.note_private,';
@ -359,9 +359,9 @@ if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
if ($search_product_category > 0) $sql .= " AND cp.fk_categorie = ".$db->escape($search_product_category); if ($search_product_category > 0) $sql .= " AND cp.fk_categorie = ".$db->escape($search_product_category);
if ($socid > 0) $sql .= ' AND s.rowid = '.$socid; if ($socid > 0) $sql .= ' AND s.rowid = '.$socid;
if ($viewstatut != '' && $viewstatut != '-1') if ($search_status != '' && $search_status != '-1')
{ {
$sql .= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')'; $sql .= ' AND p.fk_statut IN ('.$db->escape($search_status).')';
} }
if ($search_date_start) $sql .= " AND p.datep >= '".$db->idate($search_date_start)."'"; if ($search_date_start) $sql .= " AND p.datep >= '".$db->idate($search_date_start)."'";
if ($search_date_end) $sql .= " AND p.datep <= '".$db->idate($search_date_end)."'"; if ($search_date_end) $sql .= " AND p.datep <= '".$db->idate($search_date_end)."'";
@ -436,7 +436,7 @@ if ($resql)
llxHeader('', $langs->trans('Proposal'), $help_url); llxHeader('', $langs->trans('Proposal'), $help_url);
$param = '&viewstatut='.urlencode($viewstatut); $param = '&search_status='.urlencode($search_status);
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($sall) $param .= '&sall='.urlencode($sall); if ($sall) $param .= '&sall='.urlencode($sall);
@ -572,40 +572,40 @@ if ($resql)
if (!empty($arrayfields['p.ref']['checked'])) if (!empty($arrayfields['p.ref']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">'; print '<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['p.ref_client']['checked'])) if (!empty($arrayfields['p.ref_client']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_refcustomer" value="'.dol_escape_htmltag($search_refcustomer).'">'; print '<input class="flat maxwidth50" type="text" name="search_refcustomer" value="'.dol_escape_htmltag($search_refcustomer).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['pr.ref']['checked'])) if (!empty($arrayfields['pr.ref']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).'">'; print '<input class="flat maxwidth50" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['pr.title']['checked'])) if (!empty($arrayfields['pr.title']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).'">'; print '<input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['s.nom']['checked'])) if (!empty($arrayfields['s.nom']['checked']))
{ {
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="10" name="search_societe" value="'.dol_escape_htmltag($search_societe).'">'; print '<input class="flat maxwidth100" type="text" name="search_societe" value="'.dol_escape_htmltag($search_societe).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>'; if (!empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.$search_town.'"></td>';
if (!empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="4" name="search_zip" value="'.$search_zip.'"></td>'; if (!empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.$search_zip.'"></td>';
// State // State
if (!empty($arrayfields['state.nom']['checked'])) if (!empty($arrayfields['state.nom']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">'; print '<input class="flat maxwidth50" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
print '</td>'; print '</td>';
} }
// Country // Country
@ -618,7 +618,7 @@ if ($resql)
// Company type // Company type
if (!empty($arrayfields['typent.code']['checked'])) if (!empty($arrayfields['typent.code']['checked']))
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="center">'; print '<td class="liste_titre maxwidth100onsmartphone" align="center">';
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT)); print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT));
print ajax_combobox('search_type_thirdparty'); print ajax_combobox('search_type_thirdparty');
print '</td>'; print '</td>';
@ -668,7 +668,7 @@ if ($resql)
// Availability // Availability
if (!empty($arrayfields['ava.rowid']['checked'])) if (!empty($arrayfields['ava.rowid']['checked']))
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="center">'; print '<td class="liste_titre maxwidth100onsmartphone center">';
$form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1); $form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1);
print ajax_combobox('search_availability'); print ajax_combobox('search_availability');
print '</td>'; print '</td>';
@ -793,7 +793,7 @@ if ($resql)
if (!empty($arrayfields['p.fk_statut']['checked'])) if (!empty($arrayfields['p.fk_statut']['checked']))
{ {
print '<td class="liste_titre maxwidthonsmartphone right">'; print '<td class="liste_titre maxwidthonsmartphone right">';
$formpropal->selectProposalStatus($viewstatut, 1, 0, 1, 'customer', 'search_statut'); $formpropal->selectProposalStatus($search_status, 1, 0, 1, 'customer', 'search_statut');
print '</td>'; print '</td>';
} }
// Action column // Action column
@ -862,6 +862,8 @@ if ($resql)
$objectstatic->ref_client = $obj->ref_client; $objectstatic->ref_client = $obj->ref_client;
$objectstatic->note_public = $obj->note_public; $objectstatic->note_public = $obj->note_public;
$objectstatic->note_private = $obj->note_private; $objectstatic->note_private = $obj->note_private;
$objectstatic->statut = $obj->status;
$objectstatic->status = $obj->status;
$companystatic->id = $obj->socid; $companystatic->id = $obj->socid;
$companystatic->name = $obj->name; $companystatic->name = $obj->name;
@ -900,16 +902,16 @@ if ($resql)
if (!empty($arrayfields['p.ref']['checked'])) if (!empty($arrayfields['p.ref']['checked']))
{ {
print '<td class="nowrap">'; print '<td class="nowraponall">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref // Picto + Ref
print '<td class="nobordernopadding nowrap">'; print '<td class="nobordernopadding nowraponall">';
print $objectstatic->getNomUrl(1, '', '', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1)); print $objectstatic->getNomUrl(1, '', '', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1));
print '</td>'; print '</td>';
// Warning // Warning
$warnornote = ''; $warnornote = '';
if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) $warnornote .= img_warning($langs->trans("Late")); if ($obj->status == Propal::STATUS_VALIDATED && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) $warnornote .= img_warning($langs->trans("Late"));
if ($warnornote) if ($warnornote)
{ {
print '<td style="min-width: 20px" class="nobordernopadding nowrap">'; print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
@ -1232,7 +1234,7 @@ if ($resql)
// Status // Status
if (!empty($arrayfields['p.fk_statut']['checked'])) if (!empty($arrayfields['p.fk_statut']['checked']))
{ {
print '<td class="nowrap right">'.$objectstatic->LibStatut($obj->fk_statut, 5).'</td>'; print '<td class="nowrap right">'.$objectstatic->getLibStatut(5).'</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }
// Action column // Action column

View File

@ -113,7 +113,7 @@ $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
if (!empty($conf->expedition->enabled) && $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER = 1) { if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $object->warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE; if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $object->warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE;
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse; if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse;
} }
@ -1506,6 +1506,7 @@ if ($action == 'create' && $usercancreate)
if (!empty($origin) && !empty($originid)) { if (!empty($origin) && !empty($originid)) {
// Parse element/subelement (ex: project_task) // Parse element/subelement (ex: project_task)
$element = $subelement = $origin; $element = $subelement = $origin;
$regs = array();
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
$element = $regs[1]; $element = $regs[1];
$subelement = $regs[2]; $subelement = $regs[2];

View File

@ -3540,7 +3540,7 @@ class Commande extends CommonOrder
$response->warning_delay = $conf->commande->client->warning_delay / 60 / 60 / 24; $response->warning_delay = $conf->commande->client->warning_delay / 60 / 60 / 24;
$response->label = $langs->trans("OrdersToProcess"); $response->label = $langs->trans("OrdersToProcess");
$response->labelShort = $langs->trans("Opened"); $response->labelShort = $langs->trans("Opened");
$response->url = DOL_URL_ROOT.'/commande/list.php?viewstatut=-3&mainmenu=commercial&leftmenu=orders'; $response->url = DOL_URL_ROOT.'/commande/list.php?search_status=-3&mainmenu=commercial&leftmenu=orders';
$response->img = img_object('', "order"); $response->img = img_object('', "order");
$generic_commande = new Commande($this->db); $generic_commande = new Commande($this->db);
@ -3697,7 +3697,7 @@ class Commande extends CommonOrder
$label = ''; $label = '';
if ($user->rights->commande->lire) { if ($user->rights->commande->lire) {
$label = '<u>'.$langs->trans("ShowOrder").'</u>'; $label = '<u>'.$langs->trans("Order").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client); $label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
if (!empty($this->total_ht)) { if (!empty($this->total_ht)) {
@ -3709,6 +3709,9 @@ class Commande extends CommonOrder
if (!empty($this->total_ttc)) { if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
} }
if (isset($this->statut)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5);
}
} }
$linkclose = ''; $linkclose = '';
@ -3716,7 +3719,7 @@ class Commande extends CommonOrder
{ {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{ {
$label = $langs->trans("ShowOrder"); $label = $langs->trans("Order");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
} }
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';

View File

@ -52,11 +52,12 @@ if ($user->socid)
$result = restrictedArea($user, 'commande', $id, ''); $result = restrictedArea($user, 'commande', $id, '');
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -168,6 +168,7 @@ if ($resql)
print '</td></tr>'; print '</td></tr>';
} }
//if ($totalinprocess != $total) //if ($totalinprocess != $total)
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>'; print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
print "</table></div><br>"; print "</table></div><br>";
@ -353,7 +354,7 @@ if (!empty($conf->commande->enabled))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th colspan="4">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_VALIDATED.'"><span class="badge">'.$num.'</span></a></th></tr>'; print '<th colspan="4">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status='.Commande::STATUS_VALIDATED.'"><span class="badge">'.$num.'</span></a></th></tr>';
if ($num) if ($num)
{ {
@ -439,7 +440,7 @@ if (!empty($conf->commande->enabled))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th colspan="4">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_ACCEPTED.'"><span class="badge">'.$num.'</span></a></th></tr>'; print '<th colspan="4">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status='.Commande::STATUS_ACCEPTED.'"><span class="badge">'.$num.'</span></a></th></tr>';
if ($num) if ($num)
{ {

View File

@ -11,7 +11,6 @@
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com> * Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -86,7 +85,7 @@ $search_login = GETPOST('search_login', 'alpha');
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); $search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
$optioncss = GETPOST('optioncss', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha');
$billed = GETPOST('billed', 'int'); $billed = GETPOST('billed', 'int');
$viewstatut = GETPOST('viewstatut', 'int'); $search_status = GETPOST('search_status', 'int');
$search_btn = GETPOST('button_search', 'alpha'); $search_btn = GETPOST('button_search', 'alpha');
$search_remove_btn = GETPOST('button_removefilter', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha');
$search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_project_ref = GETPOST('search_project_ref', 'alpha');
@ -223,7 +222,7 @@ if (empty($reshook))
$search_datedelivery_end = ''; $search_datedelivery_end = '';
$search_project_ref = ''; $search_project_ref = '';
$search_project = ''; $search_project = '';
$viewstatut = ''; $search_status = '';
$billed = ''; $billed = '';
$toselect = ''; $toselect = '';
$search_array_options = array(); $search_array_options = array();
@ -310,23 +309,23 @@ if ($search_ref) $sql .= natural_search('c.ref', $search_ref);
if ($search_ref_customer) $sql .= natural_search('c.ref_client', $search_ref_customer); if ($search_ref_customer) $sql .= natural_search('c.ref_client', $search_ref_customer);
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
if ($billed != '' && $billed >= 0) $sql .= ' AND c.facture = '.$billed; if ($billed != '' && $billed >= 0) $sql .= ' AND c.facture = '.$billed;
if ($viewstatut <> '') if ($search_status <> '')
{ {
if ($viewstatut < 4 && $viewstatut > -3) if ($search_status < 4 && $search_status > -3)
{ {
if ($viewstatut == 1 && empty($conf->expedition->enabled)) $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated' if ($search_status == 1 && empty($conf->expedition->enabled)) $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated'
else $sql .= ' AND c.fk_statut = '.$viewstatut; // brouillon, validee, en cours, annulee else $sql .= ' AND c.fk_statut = '.$search_status; // brouillon, validee, en cours, annulee
} }
if ($viewstatut == 4) if ($search_status == 4)
{ {
$sql .= ' AND c.facture = 1'; // invoice created $sql .= ' AND c.facture = 1'; // invoice created
} }
if ($viewstatut == -2) // To process if ($search_status == -2) // To process
{ {
//$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0'; //$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0';
$sql .= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected $sql .= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
} }
if ($viewstatut == -3) // To bill if ($search_status == -3) // To bill
{ {
//$sql.= ' AND c.fk_statut in (1,2,3)'; //$sql.= ' AND c.fk_statut in (1,2,3)';
//$sql.= ' AND c.facture = 0'; // invoice not created //$sql.= ' AND c.facture = 0'; // invoice not created
@ -349,7 +348,7 @@ if ($search_user > 0) $sql .= " AND ec.fk_c_type_contact
if ($search_total_ht != '') $sql .= natural_search('c.total_ht', $search_total_ht, 1); if ($search_total_ht != '') $sql .= natural_search('c.total_ht', $search_total_ht, 1);
if ($search_total_vat != '') $sql .= natural_search('c.tva', $search_total_vat, 1); if ($search_total_vat != '') $sql .= natural_search('c.tva', $search_total_vat, 1);
if ($search_total_ttc != '') $sql .= natural_search('c.total_ttc', $search_total_ttc, 1); if ($search_total_ttc != '') $sql .= natural_search('c.total_ttc', $search_total_ttc, 1);
if ($search_warehouse != '') $sql .= natural_search('c.fk_warehouse', $search_warehouse, 1); if ($search_warehouse != '' && $search_warehouse != '-1') $sql .= natural_search('c.fk_warehouse', $search_warehouse, 1);
if ($search_multicurrency_code != '') $sql .= ' AND c.multicurrency_code = "'.$db->escape($search_multicurrency_code).'"'; if ($search_multicurrency_code != '') $sql .= ' AND c.multicurrency_code = "'.$db->escape($search_multicurrency_code).'"';
if ($search_multicurrency_tx != '') $sql .= natural_search('c.multicurrency_tx', $search_multicurrency_tx, 1); if ($search_multicurrency_tx != '') $sql .= natural_search('c.multicurrency_tx', $search_multicurrency_tx, 1);
if ($search_multicurrency_montant_ht != '') $sql .= natural_search('c.multicurrency_total_ht', $search_multicurrency_montant_ht, 1); if ($search_multicurrency_montant_ht != '') $sql .= natural_search('c.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
@ -401,21 +400,21 @@ if ($resql)
{ {
$title = $langs->trans('ListOfOrders'); $title = $langs->trans('ListOfOrders');
} }
if (strval($viewstatut) == '0') if (strval($search_status) == '0')
$title .= ' - '.$langs->trans('StatusOrderDraftShort'); $title .= ' - '.$langs->trans('StatusOrderDraftShort');
if ($viewstatut == 1) if ($search_status == 1)
$title .= ' - '.$langs->trans('StatusOrderValidatedShort'); $title .= ' - '.$langs->trans('StatusOrderValidatedShort');
if ($viewstatut == 2) if ($search_status == 2)
$title .= ' - '.$langs->trans('StatusOrderSentShort'); $title .= ' - '.$langs->trans('StatusOrderSentShort');
if ($viewstatut == 3) if ($search_status == 3)
$title .= ' - '.$langs->trans('StatusOrderToBillShort'); $title .= ' - '.$langs->trans('StatusOrderToBillShort');
if ($viewstatut == 4) if ($search_status == 4)
$title .= ' - '.$langs->trans('StatusOrderProcessedShort'); $title .= ' - '.$langs->trans('StatusOrderProcessedShort');
if ($viewstatut == -1) if ($search_status == -1)
$title .= ' - '.$langs->trans('StatusOrderCanceledShort'); $title .= ' - '.$langs->trans('StatusOrderCanceledShort');
if ($viewstatut == -2) if ($search_status == -2)
$title .= ' - '.$langs->trans('StatusOrderToProcessShort'); $title .= ' - '.$langs->trans('StatusOrderToProcessShort');
if ($viewstatut == -3) if ($search_status == -3)
$title .= ' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled) ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled) ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
@ -438,7 +437,7 @@ if ($resql)
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($sall) $param .= '&sall='.urlencode($sall); if ($sall) $param .= '&sall='.urlencode($sall);
if ($socid > 0) $param .= '&socid='.urlencode($socid); if ($socid > 0) $param .= '&socid='.urlencode($socid);
if ($viewstatut != '') $param .= '&viewstatut='.urlencode($viewstatut); if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
if ($search_dateorder_start) $param .= '&search_dateorder_start='.urlencode($search_dateorder_start); if ($search_dateorder_start) $param .= '&search_dateorder_start='.urlencode($search_dateorder_start);
if ($search_dateorder_end) $param .= '&search_dateorder_end='.urlencode($search_dateorder_end); if ($search_dateorder_end) $param .= '&search_dateorder_end='.urlencode($search_dateorder_end);
if ($search_datedelivery_start) $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start); if ($search_datedelivery_start) $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start);
@ -500,7 +499,7 @@ if ($resql)
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">'; print '<input type="hidden" name="search_status" value="'.$search_status.'">';
print '<input type="hidden" name="socid" value="'.$socid.'">'; print '<input type="hidden" name="socid" value="'.$socid.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1);
@ -604,7 +603,7 @@ if ($resql)
$moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1); $moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1);
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
if (!empty($conf->expedition->enabled) && $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER = 1) { if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
@ -814,7 +813,7 @@ if ($resql)
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"), -3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort") Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
); );
print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100'); print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
print '</td>'; print '</td>';
} }
// Status billed // Status billed
@ -902,6 +901,7 @@ if ($resql)
$generic_commande->id = $obj->rowid; $generic_commande->id = $obj->rowid;
$generic_commande->ref = $obj->ref; $generic_commande->ref = $obj->ref;
$generic_commande->statut = $obj->fk_statut; $generic_commande->statut = $obj->fk_statut;
$generic_commande->billed = $obj->billed;
$generic_commande->date = $db->jdate($obj->date_commande); $generic_commande->date = $db->jdate($obj->date_commande);
$generic_commande->date_livraison = $db->jdate($obj->date_delivery); $generic_commande->date_livraison = $db->jdate($obj->date_delivery);
$generic_commande->ref_client = $obj->ref_client; $generic_commande->ref_client = $obj->ref_client;
@ -920,11 +920,11 @@ if ($resql)
// Ref // Ref
if (!empty($arrayfields['c.ref']['checked'])) if (!empty($arrayfields['c.ref']['checked']))
{ {
print '<td class="nowrap">'; print '<td class="nowraponall">';
$generic_commande->getLinesArray(); // This set ->lines $generic_commande->getLinesArray(); // This set ->lines
print $generic_commande->getNomUrl(1, ($viewstatut != 2 ? 0 : $obj->fk_statut), 0, 0, 0, 1, 1); print $generic_commande->getNomUrl(1, ($search_status != 2 ? 0 : $obj->fk_statut), 0, 0, 0, 1, 1);
// Show shippable Icon (create subloop, so may be slow) // Show shippable Icon (create subloop, so may be slow)
if ($conf->stock->enabled) if ($conf->stock->enabled)

View File

@ -57,7 +57,7 @@ $socid = GETPOST('socid', 'int');
$selected = GETPOST('orders_to_invoice'); $selected = GETPOST('orders_to_invoice');
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$viewstatut = GETPOST('viewstatut', 'alpha'); $search_status = GETPOST('search_status', 'alpha');
$error = 0; $error = 0;

View File

@ -57,11 +57,12 @@ if ($user->socid)
$socid = $user->socid; $socid = $user->socid;
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } if (empty($page) || $page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) if (!$sortorder)

View File

@ -108,14 +108,6 @@ $pagenext = $page + 1;
if (!$sortorder) $sortorder = 'desc,desc,desc'; if (!$sortorder) $sortorder = 'desc,desc,desc';
if (!$sortfield) $sortfield = 'b.datev,b.dateo,b.rowid'; if (!$sortfield) $sortfield = 'b.datev,b.dateo,b.rowid';
$mode_balance_ok = false;
//if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid')) // TODO Manage balance when account not selected
if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid'))
{
$sortfield = 'b.datev,b.dateo,b.rowid';
if ($id > 0 || !empty($ref) || $search_account > 0) $mode_balance_ok = true;
}
$object = new Account($db); $object = new Account($db);
if ($id > 0 || !empty($ref)) if ($id > 0 || !empty($ref))
{ {
@ -130,6 +122,13 @@ if ($id > 0 || !empty($ref))
} }
} }
$mode_balance_ok = false;
//if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid')) // TODO Manage balance when account not selected
if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid'))
{
$sortfield = 'b.datev,b.dateo,b.rowid';
if ($id > 0 || !empty($ref) || $search_account > 0) $mode_balance_ok = true;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('banktransactionlist', $contextpage)); $hookmanager->initHooks(array('banktransactionlist', $contextpage));
@ -574,6 +573,7 @@ if ($page >= $nbtotalofpages)
if ($page < 0) $page = 0; if ($page < 0) $page = 0;
} }
// If not account defined $mode_balance_ok=false // If not account defined $mode_balance_ok=false
if (empty($search_account)) $mode_balance_ok = false; if (empty($search_account)) $mode_balance_ok = false;
// If a search is done $mode_balance_ok=false // If a search is done $mode_balance_ok=false
@ -583,7 +583,7 @@ if (!empty($search_type)) $mode_balance_ok = false;
if (!empty($search_debit)) $mode_balance_ok = false; if (!empty($search_debit)) $mode_balance_ok = false;
if (!empty($search_credit)) $mode_balance_ok = false; if (!empty($search_credit)) $mode_balance_ok = false;
if (!empty($search_thirdparty)) $mode_balance_ok = false; if (!empty($search_thirdparty)) $mode_balance_ok = false;
if ($search_conciliated != '') $mode_balance_ok = false; if ($search_conciliated != '' && $search_conciliated != '-1') $mode_balance_ok = false;
if (!empty($search_num_releve)) $mode_balance_ok = false; if (!empty($search_num_releve)) $mode_balance_ok = false;
$sql .= $db->plimit($limit + 1, $offset); $sql .= $db->plimit($limit + 1, $offset);
@ -751,8 +751,8 @@ if ($resql)
print '</td>'; print '</td>';
}*/ }*/
print '<td class="center">'; print '<td class="center">';
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Add").'"><br>'; print '<input type="submit" name="save" class="button buttongen marginbottomonly" value="'.$langs->trans("Add").'"><br>';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" name="cancel" class="button buttongen marginbottomonly" value="'.$langs->trans("Cancel").'">';
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
@ -815,7 +815,7 @@ if ($resql)
$morehtml .= $buttonreconcile; $morehtml .= $buttonreconcile;
} }
$morehtml .= $newcardbutton; $morehtml .= '<!-- Add New button -->'.$newcardbutton;
$picto = 'bank_account'; $picto = 'bank_account';
if ($id > 0 || !empty($ref)) $picto = ''; if ($id > 0 || !empty($ref)) $picto = '';

View File

@ -1390,8 +1390,8 @@ class Account extends CommonObject
global $conf, $langs, $user; global $conf, $langs, $user;
$result = ''; $result = '';
$label = '<u>'.$langs->trans("ShowAccount").'</u>'; $label = '<u>'.$langs->trans("BankAccount").'</u>';
$label .= '<br><b>'.$langs->trans('BankAccount').':</b> '.$this->label; $label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label;
$label .= '<br><b>'.$langs->trans('AccountNumber').':</b> '.$this->number; $label .= '<br><b>'.$langs->trans('AccountNumber').':</b> '.$this->number;
$label .= '<br><b>'.$langs->trans("AccountCurrency").':</b> '.$this->currency_code; $label .= '<br><b>'.$langs->trans("AccountCurrency").':</b> '.$this->currency_code;

View File

@ -57,12 +57,13 @@ class BankAccounts extends DolibarrApi
* @param string $sortorder Sort order * @param string $sortorder Sort order
* @param int $limit Limit for list * @param int $limit Limit for list
* @param int $page Page number * @param int $page Page number
* @param int $category Use this param to filter list by category
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')" * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')"
* @return array List of account objects * @return array List of account objects
* *
* @throws RestException * @throws RestException
*/ */
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '')
{ {
$list = array(); $list = array();
@ -71,7 +72,14 @@ class BankAccounts extends DolibarrApi
} }
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account as t"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account as t";
if ($category > 0) {
$sql .= ", ".MAIN_DB_PREFIX."categorie_account as c";
}
$sql .= ' WHERE t.entity IN ('.getEntity('bank_account').')'; $sql .= ' WHERE t.entity IN ('.getEntity('bank_account').')';
// Select accounts of given category
if ($category > 0) {
$sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_account = t.rowid ";
}
// Add sql filters // Add sql filters
if ($sqlfilters) if ($sqlfilters)
{ {

View File

@ -54,11 +54,12 @@ if ($user->socid)
$socid = $user->socid; $socid = $user->socid;
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } if (empty($page) || $page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) if (!$sortorder)

View File

@ -264,7 +264,7 @@ print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">'; print '<input type="hidden" name="search_status" value="'.$search_status.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit, 1);
@ -538,7 +538,11 @@ foreach ($accounts as $key=>$type)
if ($result < 0) { if ($result < 0) {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
} else { } else {
print '<span class="badge badge-info classfortooltip" title="'.dol_htmlentities($langs->trans("TransactionsToConciliate")).'">'.$result->nbtodo.'</span>'; print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$objecttmp->id.'&search_conciliated=0">';
print '<span class="badge badge-info classfortooltip" title="'.dol_htmlentities($langs->trans("TransactionsToConciliate")).'">';
print $result->nbtodo;
print '</span>';
print '</a>';
if ($result->nbtodolate) { if ($result->nbtodolate) {
print '<span title="'.dol_htmlentities($langs->trans("Late")).'" class="classfortooltip badge badge-danger marginleftonlyshort">'; print '<span title="'.dol_htmlentities($langs->trans("Late")).'" class="classfortooltip badge badge-danger marginleftonlyshort">';
print '<i class="fa fa-exclamation-triangle"></i> '.$result->nbtodolate; print '<i class="fa fa-exclamation-triangle"></i> '.$result->nbtodolate;

View File

@ -51,8 +51,8 @@ if ($action == 'add')
$dateo = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $dateo = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$label = GETPOST('label', 'alpha'); $label = GETPOST('label', 'alpha');
$amount = GETPOST('amount', 'alpha'); $amount = price2num(GETPOST('amount', 'alpha'), 'MT');
$amountto = GETPOST('amountto', 'alpha'); $amountto = price2num(GETPOST('amountto', 'alpha'), 'MT');
if (!$label) if (!$label)
{ {
@ -115,9 +115,9 @@ if ($action == 'add')
$typeto = 'LIQ'; $typeto = 'LIQ';
} }
if (!$error) $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1 * price2num($amount), '', '', $user); if (!$error) $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, price2num(-1 * $amount), '', '', $user);
if (!($bank_line_id_from > 0)) $error++; if (!($bank_line_id_from > 0)) $error++;
if (!$error) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, price2num($amountto), '', '', $user); if (!$error) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, $amountto, '', '', $user);
if (!($bank_line_id_to > 0)) $error++; if (!($bank_line_id_to > 0)) $error++;
if (!$error) $result = $accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert'); if (!$error) $result = $accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
@ -246,7 +246,6 @@ print '<td>'.$langs->trans("TransferFrom").'</td><td>'.$langs->trans("TransferTo
print '<td style="display:none" class="multicurrency">'.$langs->trans("AmountToOthercurrency").'</td>'; print '<td style="display:none" class="multicurrency">'.$langs->trans("AmountToOthercurrency").'</td>';
print '</tr>'; print '</tr>';
$var = false;
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
$form->select_comptes($account_from, 'account_from', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1); $form->select_comptes($account_from, 'account_from', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1);
print "</td>"; print "</td>";

View File

@ -277,7 +277,7 @@ if ($action == 'create')
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print load_fiche_titre($langs->trans("NewVariousPayment"), '', 'invoicing'); print load_fiche_titre($langs->trans("NewVariousPayment"), '', 'object_payment');
dol_fiche_head('', ''); dol_fiche_head('', '');

View File

@ -43,11 +43,12 @@ if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'banque', '', '', ''); $result = restrictedArea($user, 'banque', '', '', '');
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -58,7 +58,7 @@ $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortfield) $sortfield = "v.datep,v.rowid"; if (!$sortfield) $sortfield = "v.datep,v.rowid";
@ -95,6 +95,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$typeid = ""; $typeid = "";
} }
/* /*
* View * View
*/ */
@ -178,9 +179,8 @@ if ($result)
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit); print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1);
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";

View File

@ -102,11 +102,11 @@ print '<input type="hidden" name="mode" value="'.$mode.'">';
if ($mode != 'sconly') if ($mode != 'sconly')
{ {
$center = ($year ? '<a href="index.php?year='.($year - 1).$param.'">'.img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a> ".$langs->trans("Year").' '.$year.' <a href="index.php?year='.($year + 1).$param.'">'.img_next($langs->trans("Next"), 'class="valignbottom"')."</a>" : ""); $center = ($year ? '<a href="index.php?year='.($year - 1).$param.'">'.img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a> ".$langs->trans("Year").' '.$year.' <a href="index.php?year='.($year + 1).$param.'">'.img_next($langs->trans("Next"), 'class="valignbottom"')."</a>" : "");
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 1);
} }
else else
{ {
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 0);
} }
if ($year) $param .= '&year='.$year; if ($year) $param .= '&year='.$year;

View File

@ -44,11 +44,12 @@ $langs->load("companies");
$mode = GETPOST("mode"); $mode = GETPOST("mode");
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -48,11 +48,12 @@ $result = restrictedArea($user, 'deplacement', $id, '');
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -35,11 +35,12 @@ $socid = GETPOST('socid', 'int');
if ($user->socid) $socid = $user->socid; if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'deplacement', '', ''); $result = restrictedArea($user, 'deplacement', '', '');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "DESC"; if (!$sortorder) $sortorder = "DESC";

View File

@ -139,6 +139,11 @@ if ($user->socid) $socid = $user->socid;
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft); $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
// retained warranty invoice available type
$retainedWarrantyInvoiceAvailableType=array();
if(!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) {
$retainedWarrantyInvoiceAvailableType = explode('+', $conf->global->INVOICE_USE_RETAINED_WARRANTY);
}
/* /*
@ -1355,17 +1360,22 @@ if (empty($reshook))
$object->situation_counter = 1; $object->situation_counter = 1;
$object->situation_final = 0; $object->situation_final = 0;
$object->situation_cycle_ref = $object->newCycle(); $object->situation_cycle_ref = $object->newCycle();
}
if(in_array($object->type, $retainedWarrantyInvoiceAvailableType)){
$object->retained_warranty = GETPOST('retained_warranty', 'int'); $object->retained_warranty = GETPOST('retained_warranty', 'int');
$object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); $object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
}
else{
$object->retained_warranty = 0;
$object->retained_warranty_fk_cond_reglement = 0;
}
$retained_warranty_date_limit = GETPOST('retained_warranty_date_limit'); $retained_warranty_date_limit = GETPOST('retained_warranty_date_limit');
if (!empty($retained_warranty_date_limit) && $db->jdate($retained_warranty_date_limit)) { if (!empty($retained_warranty_date_limit) && $db->jdate($retained_warranty_date_limit)) {
$object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit); $object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit);
} }
$object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement);
}
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -1756,20 +1766,31 @@ if (empty($reshook))
$object->fk_facture_source = $_POST['situations']; $object->fk_facture_source = $_POST['situations'];
$object->type = Facture::TYPE_SITUATION; $object->type = Facture::TYPE_SITUATION;
if (!empty($origin) && !empty($originid))
{
$object->origin = $origin;
$object->origin_id = $originid;
$object->retained_warranty = GETPOST('retained_warranty', 'int'); // retained warranty
if(!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY))
{
$retained_warranty = GETPOST('retained_warranty', 'int');
if(price2num($retained_warranty) > 0)
{
$object->retained_warranty = price2num($retained_warranty);
}
if(GETPOST('retained_warranty_fk_cond_reglement', 'int') > 0)
{
$object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); $object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
}
$retained_warranty_date_limit = GETPOST('retained_warranty_date_limit'); $retained_warranty_date_limit = GETPOST('retained_warranty_date_limit');
if (!empty($retained_warranty_date_limit) && $db->jdate($retained_warranty_date_limit)) { if (!empty($retained_warranty_date_limit) && $db->jdate($retained_warranty_date_limit)) {
$object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit); $object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit);
} }
$object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement);
}
if (!empty($origin) && !empty($originid))
{
$object->origin = $origin;
$object->origin_id = $originid;
foreach ($object->lines as $i => &$line) foreach ($object->lines as $i => &$line)
{ {
@ -3371,11 +3392,10 @@ if ($action == 'create')
$form->select_conditions_paiements(GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $cond_reglement_id, 'cond_reglement_id'); $form->select_conditions_paiements(GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $cond_reglement_id, 'cond_reglement_id');
print '</td></tr>'; print '</td></tr>';
if (!empty($conf->global->INVOICE_USE_SITUATION))
{ if($conf->global->INVOICE_USE_RETAINED_WARRANTY){
if ($conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY) {
$rwStyle = 'display:none;'; $rwStyle = 'display:none;';
if (GETPOST('type', 'int') == Facture::TYPE_SITUATION) { if(in_array(GETPOST('type', 'int'), $retainedWarrantyInvoiceAvailableType)){
$rwStyle = ''; $rwStyle = '';
} }
@ -3383,10 +3403,9 @@ if ($action == 'create')
if(empty($retained_warranty)){ if(empty($retained_warranty)){
if(!empty($objectsrc->retained_warranty)){ // use previous situation value if(!empty($objectsrc->retained_warranty)){ // use previous situation value
$retained_warranty = $objectsrc->retained_warranty; $retained_warranty = $objectsrc->retained_warranty;
} else {
$retained_warranty = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
} }
} }
$retained_warranty_js_default = !empty($retained_warranty)?$retained_warranty:$conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('RetainedWarranty').'</td><td colspan="2">'; print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('RetainedWarranty').'</td><td colspan="2">';
print '<input id="new-situation-invoice-retained-warranty" name="retained_warranty" type="number" value="'.$retained_warranty.'" step="0.01" min="0" max="100" />%'; print '<input id="new-situation-invoice-retained-warranty" name="retained_warranty" type="number" value="'.$retained_warranty.'" step="0.01" min="0" max="100" />%';
@ -3407,19 +3426,22 @@ if ($action == 'create')
print '<script type="text/javascript" language="javascript"> print '<script type="text/javascript" language="javascript">
$(document).ready(function() { $(document).ready(function() {
$("[name=\'type\'").change(function() { $("[name=\'type\']").change(function() {
if($( this ).prop("checked") && $( this ).val() == '.Facture::TYPE_SITUATION.') if($( this ).prop("checked") && $.inArray($( this ).val(), '.json_encode($retainedWarrantyInvoiceAvailableType).' ) !== -1)
{ {
$(".retained-warranty-line").show(); $(".retained-warranty-line").show();
$("#new-situation-invoice-retained-warranty").val("'.doubleval($retained_warranty_js_default).'");
} }
else{ else{
$(".retained-warranty-line").hide(); $(".retained-warranty-line").hide();
$("#new-situation-invoice-retained-warranty").val("");
} }
}); });
$("[name=\'type\']").trigger("change");
}); });
</script>'; </script>';
} }
}
// Payment mode // Payment mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">'; print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
@ -4333,22 +4355,15 @@ elseif ($id > 0 || !empty($ref))
print '</td></tr>'; print '</td></tr>';
} }
$displayWarranty = false;
if (($object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty) || !empty($conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY))))
{ if (!empty($object->retained_warranty) || !empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) {
// Check if this situation invoice is 100% for real
if (!empty($object->situation_final) && !empty($object->lines)) {
$displayWarranty = true; $displayWarranty = true;
foreach ($object->lines as $i => $line) { if (!in_array($object->type, $retainedWarrantyInvoiceAvailableType) && empty($object->retained_warranty)) {
if ($line->product_type < 2 && $line->situation_percent < 100) {
$displayWarranty = false; $displayWarranty = false;
break;
}
}
} }
if($displayWarranty) {
// Retained Warranty // Retained Warranty
print '<tr class="retained-warranty-lines" ><td>'; print '<tr class="retained-warranty-lines" ><td>';
print '<table id="retained-warranty-table" class="nobordernopadding" width="100%"><tr><td>'; print '<table id="retained-warranty-table" class="nobordernopadding" width="100%"><tr><td>';
@ -4413,9 +4428,6 @@ elseif ($id > 0 || !empty($ref))
} }
print '</td></tr>'; print '</td></tr>';
if ($displayWarranty)
{
// Retained Warranty payment date limit // Retained Warranty payment date limit
print '<tr class="retained-warranty-lines" ><td>'; print '<tr class="retained-warranty-lines" ><td>';
print '<table id="retained-warranty-date-limit-table" class="nobordernopadding" width="100%"><tr><td>'; print '<table id="retained-warranty-date-limit-table" class="nobordernopadding" width="100%"><tr><td>';

View File

@ -502,8 +502,7 @@ class Invoices extends DolibarrApi
} }
$result = $this->invoice->delete_contact($rowid); $result = $this->invoice->delete_contact($rowid);
if ($result < 0) {
if (!$result) {
throw new RestException(500, 'Error when deleted the contact'); throw new RestException(500, 'Error when deleted the contact');
} }
@ -617,7 +616,8 @@ class Invoices extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
if ($this->invoice->delete($id) < 0) $result = $this->invoice->delete(DolibarrApiAccess::$user);
if ($result < 0)
{ {
throw new RestException(500); throw new RestException(500);
} }

View File

@ -302,9 +302,9 @@ class Facture extends CommonInvoice
'situation_cycle_ref' =>array('type'=>'smallint(6)', 'label'=>'Situation cycle ref', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION', 'visible'=>-1, 'position'=>230), 'situation_cycle_ref' =>array('type'=>'smallint(6)', 'label'=>'Situation cycle ref', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION', 'visible'=>-1, 'position'=>230),
'situation_counter' =>array('type'=>'smallint(6)', 'label'=>'Situation counter', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION', 'visible'=>-1, 'position'=>235), 'situation_counter' =>array('type'=>'smallint(6)', 'label'=>'Situation counter', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION', 'visible'=>-1, 'position'=>235),
'situation_final' =>array('type'=>'smallint(6)', 'label'=>'Situation final', 'enabled'=>'empty($conf->global->INVOICE_USE_SITUATION) ? 0 : 1', 'visible'=>-1, 'position'=>240), 'situation_final' =>array('type'=>'smallint(6)', 'label'=>'Situation final', 'enabled'=>'empty($conf->global->INVOICE_USE_SITUATION) ? 0 : 1', 'visible'=>-1, 'position'=>240),
'retained_warranty' =>array('type'=>'double', 'label'=>'Retained warranty', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>245), 'retained_warranty' =>array('type'=>'double', 'label'=>'Retained warranty', 'enabled'=>'$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>245),
'retained_warranty_date_limit' =>array('type'=>'date', 'label'=>'Retained warranty date limit', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>250), 'retained_warranty_date_limit' =>array('type'=>'date', 'label'=>'Retained warranty date limit', 'enabled'=>'$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>250),
'retained_warranty_fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Retained warranty fk cond reglement', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>255), 'retained_warranty_fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Retained warranty fk cond reglement', 'enabled'=>'$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>255),
'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>260), 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>260),
'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>265), 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>265),
'date_pointoftax' =>array('type'=>'date', 'label'=>'DatePointOfTax', 'enabled'=>'$conf->global->INVOICE_POINTOFTAX_DATE', 'visible'=>-1, 'position'=>270), 'date_pointoftax' =>array('type'=>'date', 'label'=>'DatePointOfTax', 'enabled'=>'$conf->global->INVOICE_POINTOFTAX_DATE', 'visible'=>-1, 'position'=>270),
@ -4742,6 +4742,43 @@ class Facture extends CommonInvoice
return $hasDelay; return $hasDelay;
} }
/**
* Currently used for documents generation : to know if retained warranty need to be displayed
* @return bool
*/
public function displayRetainedWarranty()
{
global $conf;
// TODO : add a flag on invoices to store this conf : INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION
// note : we dont need to test INVOICE_USE_RETAINED_WARRANTY because if $this->retained_warranty is not empty it's because it was set when this conf was active
$displayWarranty = false;
if(!empty($this->retained_warranty)) {
$displayWarranty = true;
if ($this->type == Facture::TYPE_SITUATION && !empty($conf->global->INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION)) {
// Check if this situation invoice is 100% for real
$displayWarranty = false;
if (!empty($this->situation_final)) {
$displayWarranty = true;
} elseif (!empty($this->lines) && $this->status == Facture::STATUS_DRAFT) {
// $object->situation_final need validation to be done so this test is need for draft
$displayWarranty = true;
foreach ($this->lines as $i => $line) {
if ($line->product_type < 2 && $line->situation_percent < 100) {
$displayWarranty = false;
break;
}
}
}
}
}
return $displayWarranty;
}
/** /**
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT) * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT)
@ -4757,7 +4794,7 @@ class Facture extends CommonInvoice
$retainedWarrantyAmount = 0; $retainedWarrantyAmount = 0;
// Billed - retained warranty // Billed - retained warranty
if ($this->type == Facture::TYPE_SITUATION) if($this->type == Facture::TYPE_SITUATION && !empty($conf->global->INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION))
{ {
$displayWarranty = true; $displayWarranty = true;
// Check if this situation invoice is 100% for real // Check if this situation invoice is 100% for real
@ -4795,7 +4832,10 @@ class Facture extends CommonInvoice
if ($rounding < 0) { if ($rounding < 0) {
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT);
return round($retainedWarrantyAmount, 2); }
if($rounding>0){
return round($retainedWarrantyAmount, $rounding);
} }
return $retainedWarrantyAmount; return $retainedWarrantyAmount;

View File

@ -56,11 +56,12 @@ if ($user->socid)
$result = restrictedArea($user, 'facture', $id, ''); $result = restrictedArea($user, 'facture', $id, '');
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -328,13 +328,12 @@ if ($resql)
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">'; print '<input type="hidden" name="search_status" value="'.$search_status.'">';
$title = $langs->trans("RepeatableInvoices"); $title = $langs->trans("RepeatableInvoices");
print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit); print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit, 0, 0, 1);
print '<span class="opacitymedium">'.$langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'</span><br><br>'; print '<span class="opacitymedium">'.$langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'</span><br><br>';

View File

@ -208,7 +208,7 @@ $arrayfields = array(
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
); );
if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY) if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_WARRANTY)
{ {
$arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86); $arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86);
} }
@ -688,7 +688,7 @@ if ($resql)
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">'; print '<input type="hidden" name="search_status" value="'.$search_status.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($langs->trans('BillsCustomers').' '.($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1); print_barre_liste($langs->trans('BillsCustomers').' '.($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1);
@ -1137,7 +1137,7 @@ if ($resql)
$facturestatic->note_public = $obj->note_public; $facturestatic->note_public = $obj->note_public;
$facturestatic->note_private = $obj->note_private; $facturestatic->note_private = $obj->note_private;
if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY) if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_WARRANTY)
{ {
$facturestatic->retained_warranty = $obj->retained_warranty; $facturestatic->retained_warranty = $obj->retained_warranty;
$facturestatic->retained_warranty_date_limit = $obj->retained_warranty_date_limit; $facturestatic->retained_warranty_date_limit = $obj->retained_warranty_date_limit;

View File

@ -745,7 +745,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<th colspan="2">'.$langs->trans("OrdersDeliveredToBill").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=3&amp;billed=0"><span class="badge">'.$num.'</span></a></th>'; print '<th colspan="2">'.$langs->trans("OrdersDeliveredToBill").' <a href="'.DOL_URL_ROOT.'/commande/list.php?search_status=3&amp;billed=0"><span class="badge">'.$num.'</span></a></th>';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th class="right">'.$langs->trans("AmountHT").'</th>'; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th class="right">'.$langs->trans("AmountHT").'</th>';
print '<th class="right">'.$langs->trans("AmountTTC").'</th>'; print '<th class="right">'.$langs->trans("AmountTTC").'</th>';
print '<th class="right">'.$langs->trans("ToBill").'</th>'; print '<th class="right">'.$langs->trans("ToBill").'</th>';

View File

@ -215,10 +215,9 @@ if ($resql)
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="search_status" value="'.$search_status.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit); print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit, 0, 0, 1);
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";

View File

@ -193,7 +193,7 @@ if ($result)
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">'; print '<input type="hidden" name="search_status" value="'.$search_status.'">';
$massactionbutton = ''; $massactionbutton = '';

View File

@ -43,9 +43,22 @@ $action = GETPOST('action', 'alpha');
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$socid = GETPOST('socid', 'int'); $socid = GETPOST('socid', 'int');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if ($page == -1 || $page == null) { $page = 0; }
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($sortorder == "") $sortorder = "DESC";
if ($sortfield == "") $sortfield = "pl.fk_soc";
/*
* Actions
*/
if ($action == 'confirm_rejet') if ($action == 'confirm_rejet')
{ {
@ -246,17 +259,6 @@ if ($id)
print "</div>"; print "</div>";
if ($page == -1 || $page == null) { $page = 0; }
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($sortorder == "") $sortorder = "DESC";
if ($sortfield == "") $sortfield = "pl.fk_soc";
/* /*
* List of invoices * List of invoices
*/ */

View File

@ -39,20 +39,19 @@ if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'prelevement', '', '', 'bons'); $result = restrictedArea($user, 'prelevement', '', '', 'bons');
// Get supervariables // Get supervariables
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
/* /*
* View * View
*/ */
llxHeader('', $langs->trans("WithdrawsRefused")); llxHeader('', $langs->trans("WithdrawsRefused"));
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($sortorder == "") $sortorder = "DESC"; if ($sortorder == "") $sortorder = "DESC";
if ($sortfield == "") $sortfield = "p.datec"; if ($sortfield == "") $sortfield = "p.datec";

View File

@ -52,13 +52,14 @@ $result = restrictedArea($user, 'tax', $id, 'chargesociales', 'charges');
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { if (empty($page) || $page == -1) {
$page = 0; $page = 0;
} }
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -191,19 +191,16 @@ if ($resql)
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="search_status" value="'.$search_status.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
$center = '';
if ($year) if ($year)
{ {
$center = ($year ? "<a href='list.php?year=".($year - 1)."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='list.php?year=".($year + 1)."'>".img_next()."</a>" : ""); $center = ($year ? "<a href='list.php?year=".($year - 1)."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='list.php?year=".($year + 1)."'>".img_next()."</a>" : "");
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit);
}
else
{
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit);
} }
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1);
if (empty($mysoc->country_id) && empty($mysoc->country_code)) if (empty($mysoc->country_id) && empty($mysoc->country_code))
{ {
print '<div class="error">'; print '<div class="error">';

View File

@ -209,7 +209,7 @@ if ($id)
} }
} }
// Formulaire saisie tva // Form to enter VAT
if ($action == 'create') if ($action == 'create')
{ {
print load_fiche_titre($langs->trans("VAT").' - '.$langs->trans("New")); print load_fiche_titre($langs->trans("VAT").' - '.$langs->trans("New"));
@ -262,7 +262,7 @@ if ($action == 'create')
print '</td></tr>'; print '</td></tr>';
print '<tr><td class="fieldrequired">'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).'</td><td>'; print '<tr><td class="fieldrequired">'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).'</td><td>';
print $form->selectDate($datev, "datev", '', '', '', 'add', 1, 1); print $form->selectDate((GETPOST("datevmonth", 'int') ? $datev : -1), "datev", '', '', '', 'add', 1, 1);
print '</td></tr>'; print '</td></tr>';
// Label // Label

View File

@ -53,14 +53,14 @@ $result = restrictedArea($user, 'tax', '', 'vat', 'charges');
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { if (empty($page) || $page == -1) {
$page = 0; $page = 0;
} }
$offset = $limit * $page;
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
@ -160,9 +160,8 @@ if ($result)
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($langs->trans("VATPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy', 0, $newcardbutton, '', $limit); print_barre_liste($langs->trans("VATPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";

View File

@ -55,11 +55,12 @@ if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -79,7 +79,7 @@ if ($company->id)
if (!$contact->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE"); if (!$contact->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE");
if (!$contact->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX"); if (!$contact->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX");
if (!$contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country, "TYPE=WORK;POSTAL"); if (!$contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country, "TYPE=WORK;POSTAL");
if ($company->email != $contact->email) $v->setEmail($company->email, 'TYPE=PREF,INTERNET'); if (empty($contact->email)) $v->setEmail($company->email, 'TYPE=PREF,INTERNET');
// Si contact lie a un tiers non de type "particulier" // Si contact lie a un tiers non de type "particulier"
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name); if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name);
} }

View File

@ -55,11 +55,12 @@ if ($user->socid > 0)
$result = restrictedArea($user, 'contrat', $id); $result = restrictedArea($user, 'contrat', $id);
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";

View File

@ -52,15 +52,16 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC))
{ {
// Define if we have to generate thumbs or not // Define if we have to generate thumbs or not
$generatethumbs = 1; $generatethumbs = 1;
if (GETPOST('section_dir')) $generatethumbs = 0; if (GETPOST('section_dir', 'alpha')) $generatethumbs = 0;
$allowoverwrite = (GETPOST('overwritefile', 'int') ? 1 : 0);
if (!empty($upload_dirold) && !empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) if (!empty($upload_dirold) && !empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
{ {
$result = dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs); $result = dol_add_file_process($upload_dirold, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs);
} }
elseif (!empty($upload_dir)) elseif (!empty($upload_dir))
{ {
$result = dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs); $result = dol_add_file_process($upload_dir, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs);
} }
} }
} }
@ -150,7 +151,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
} }
else else
{ {
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(GETPOST('section_dir', 'alpha') ? '&section_dir='.urlencode(GETPOST('section_dir', 'alpha')) : '').(!empty($withproject) ? '&withproject=1' : '')); $tmpurl = $_SERVER["PHP_SELF"].'?id='.$object->id.(GETPOST('section_dir', 'alpha') ? '&section_dir='.urlencode(GETPOST('section_dir', 'alpha')) : '').(!empty($withproject) ? '&withproject=1' : '');
header('Location: '.$tmpurl);
exit; exit;
} }
} }

View File

@ -859,7 +859,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($sall) $param .= '&sall='.urlencode($sall); if ($sall) $param .= '&sall='.urlencode($sall);
if ($socid > 0) $param .= '&socid='.urlencode($socid); if ($socid > 0) $param .= '&socid='.urlencode($socid);
if ($viewstatut != '') $param .= '&viewstatut='.urlencode($viewstatut); if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
if ($search_orderday) $param .= '&search_orderday='.urlencode($search_orderday); if ($search_orderday) $param .= '&search_orderday='.urlencode($search_orderday);
if ($search_ordermonth) $param .= '&search_ordermonth='.urlencode($search_ordermonth); if ($search_ordermonth) $param .= '&search_ordermonth='.urlencode($search_ordermonth);
if ($search_orderyear) $param .= '&search_orderyear='.urlencode($search_orderyear); if ($search_orderyear) $param .= '&search_orderyear='.urlencode($search_orderyear);

View File

@ -46,11 +46,12 @@ if (!isset($mode) || $mode != 'noajax') // For ajax call
$urlsource = GETPOST("urlsource", 'alpha'); $urlsource = GETPOST("urlsource", 'alpha');
$search_doc_ref = GETPOST('search_doc_ref', 'alpha'); $search_doc_ref = GETPOST('search_doc_ref', 'alpha');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC"; if (!$sortorder) $sortorder = "ASC";
@ -356,10 +357,12 @@ if ($useajax || $action == 'delete')
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$useglobalvars = 1; $useglobalvars = 1;
$form = new Form($db); $form = new Form($db);
$formquestion['urlfile'] = array('type'=>'hidden', 'value'=>$urlfile, 'name'=>'urlfile'); // We must always put field, even if empty because it is fille by javascript later $formquestion['urlfile'] = array('type'=>'hidden', 'value'=>$urlfile, 'name'=>'urlfile'); // We must always put field, even if empty because it is filled by javascript later
$formquestion['section'] = array('type'=>'hidden', 'value'=>$section, 'name'=>'section'); // We must always put field, even if empty because it is fille by javascript later $formquestion['section'] = array('type'=>'hidden', 'value'=>$section, 'name'=>'section'); // We must always put field, even if empty because it is filled by javascript later
$formquestion['section_id'] = array('type'=>'hidden', 'value'=>$section_id, 'name'=>'section_id'); // We must always put field, even if empty because it is fille by javascript later $formquestion['section_id'] = array('type'=>'hidden', 'value'=>$section_id, 'name'=>'section_id'); // We must always put field, even if empty because it is filled by javascript later
$formquestion['section_dir'] = array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir'); // We must always put field, even if empty because it is fille by javascript later $formquestion['section_dir'] = array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir'); // We must always put field, even if empty because it is filled by javascript later
$formquestion['sortfield'] = array('type'=>'hidden', 'value'=>$sortfield, 'name'=>'sortfield'); // We must always put field, even if empty because it is filled by javascript later
$formquestion['sortorder'] = array('type'=>'hidden', 'value'=>$sortorder, 'name'=>'sortorder'); // We must always put field, even if empty because it is filled by javascript later
if (!empty($action) && $action == 'file_manager') $formquestion['file_manager'] = array('type'=>'hidden', 'value'=>1, 'name'=>'file_manager'); if (!empty($action) && $action == 'file_manager') $formquestion['file_manager'] = array('type'=>'hidden', 'value'=>1, 'name'=>'file_manager');
if (!empty($websitekey)) $formquestion['website'] = array('type'=>'hidden', 'value'=>$websitekey, 'name'=>'website'); if (!empty($websitekey)) $formquestion['website'] = array('type'=>'hidden', 'value'=>$websitekey, 'name'=>'website');
if (!empty($pageid) && $pageid > 0) $formquestion['pageid'] = array('type'=>'hidden', 'value'=>$pageid, 'name'=>'pageid'); if (!empty($pageid) && $pageid > 0) $formquestion['pageid'] = array('type'=>'hidden', 'value'=>$pageid, 'name'=>'pageid');

View File

@ -154,7 +154,7 @@ class box_activity extends ModeleBoxes
{ {
$this->info_box_contents[$line][0] = array( $this->info_box_contents[$line][0] = array(
'td' => 'class="left" width="16"', 'td' => 'class="left" width="16"',
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=".$data[$j]->fk_statut, 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;search_status=".$data[$j]->fk_statut,
'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut, 0), 'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut, 0),
'logo' => 'object_propal' 'logo' => 'object_propal'
); );
@ -168,7 +168,7 @@ class box_activity extends ModeleBoxes
'td' => 'class="right"', 'td' => 'class="right"',
'text' => $data[$j]->nb, 'text' => $data[$j]->nb,
'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut, 0), 'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut, 0),
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=".$data[$j]->fk_statut, 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;search_status=".$data[$j]->fk_statut,
); );
$totalnb += $data[$j]->nb; $totalnb += $data[$j]->nb;
@ -236,7 +236,7 @@ class box_activity extends ModeleBoxes
while ($j < count($data)) { while ($j < count($data)) {
$this->info_box_contents[$line][0] = array( $this->info_box_contents[$line][0] = array(
'td' => 'class="left" width="16"', 'td' => 'class="left" width="16"',
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=".$data[$j]->fk_statut, 'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=".$data[$j]->fk_statut,
'tooltip' => $langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut, 0, 0), 'tooltip' => $langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut, 0, 0),
'logo' => 'object_order', 'logo' => 'object_order',
); );
@ -250,7 +250,7 @@ class box_activity extends ModeleBoxes
'td' => 'class="right"', 'td' => 'class="right"',
'text' => $data[$j]->nb, 'text' => $data[$j]->nb,
'tooltip' => $langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut, 0, 0), 'tooltip' => $langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut, 0, 0),
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=".$data[$j]->fk_statut, 'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=".$data[$j]->fk_statut,
); );
$totalnb += $data[$j]->nb; $totalnb += $data[$j]->nb;

View File

@ -89,7 +89,7 @@ class box_birthdays extends ModeleBoxes
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth"; $sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.entity IN (".getEntity('user').")"; $sql .= " WHERE u.entity IN (".getEntity('user').")";
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], $tmparray['year']); $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
$sql .= " ORDER BY u.birth ASC"; $sql .= " ORDER BY u.birth ASC";
$sql .= $this->db->plimit($max, 0); $sql .= $this->db->plimit($max, 0);

View File

@ -90,7 +90,7 @@ class box_birthdays_members extends ModeleBoxes
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as u"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as u";
$sql .= " WHERE u.entity IN (".getEntity('adherent').")"; $sql .= " WHERE u.entity IN (".getEntity('adherent').")";
$sql .= " AND u.statut = 1"; $sql .= " AND u.statut = 1";
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], $tmparray['year']); $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
$sql .= " ORDER BY u.birth ASC"; $sql .= " ORDER BY u.birth ASC";
$sql .= $this->db->plimit($max, 0); $sql .= $this->db->plimit($max, 0);

View File

@ -6,6 +6,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com> * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -386,6 +387,12 @@ abstract class CommonDocGenerator
$sumcreditnote = $object->getSumCreditNotesUsed(); $sumcreditnote = $object->getSumCreditNotesUsed();
$already_payed_all = $sumpayed + $sumdeposit + $sumcreditnote; $already_payed_all = $sumpayed + $sumdeposit + $sumcreditnote;
$remain_to_pay = $sumpayed - $sumdeposit - $sumcreditnote; $remain_to_pay = $sumpayed - $sumdeposit - $sumcreditnote;
if ($object->fk_account > 0) {
require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php';
$bank_account = new Account($this->db);
$bank_account->fetch($object->fk_account);
}
} }
$date = ($object->element == 'contrat' ? $object->date_contrat : $object->date); $date = ($object->element == 'contrat' ? $object->date_contrat : $object->date);
@ -414,6 +421,9 @@ abstract class CommonDocGenerator
$array_key.'_payment_term_code'=>$object->cond_reglement_code, $array_key.'_payment_term_code'=>$object->cond_reglement_code,
$array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)), $array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)),
$array_key.'_bank_iban'=>$bank_account->iban,
$array_key.'_bank_bic'=>$bank_account->bic,
$array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs), $array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs),
$array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), $array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),
$array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs), $array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs),

View File

@ -575,7 +575,7 @@ abstract class CommonObject
{ {
$return = '<div class="box-flex-item">'; $return = '<div class="box-flex-item">';
$return .= '<div class="info-box info-box-sm">'; $return .= '<div class="info-box info-box-sm">';
$return .= '<span class="info-box-icon bg-infoxbox-action">'; $return .= '<span class="info-box-icon bg-infobox-action">';
$return .= '<i class="fa fa-dol-action"></i>'; // Can be image $return .= '<i class="fa fa-dol-action"></i>'; // Can be image
$return .= '</span>'; $return .= '</span>';
$return .= '<div class="info-box-content">'; $return .= '<div class="info-box-content">';
@ -7876,6 +7876,7 @@ abstract class CommonObject
public function createCommon(User $user, $notrigger = false) public function createCommon(User $user, $notrigger = false)
{ {
global $langs; global $langs;
dol_syslog(get_class($this)."::createCommon create", LOG_DEBUG);
$error = 0; $error = 0;
@ -8114,6 +8115,7 @@ abstract class CommonObject
public function updateCommon(User $user, $notrigger = false) public function updateCommon(User $user, $notrigger = false)
{ {
global $conf, $langs; global $conf, $langs;
dol_syslog(get_class($this)."::updateCommon update", LOG_DEBUG);
$error = 0; $error = 0;
@ -8203,6 +8205,8 @@ abstract class CommonObject
*/ */
public function deleteCommon(User $user, $notrigger = false, $forcechilddeletion = 0) public function deleteCommon(User $user, $notrigger = false, $forcechilddeletion = 0)
{ {
dol_syslog(get_class($this)."::deleteCommon delete", LOG_DEBUG);
$error = 0; $error = 0;
$this->db->begin(); $this->db->begin();
@ -8262,15 +8266,8 @@ abstract class CommonObject
if (!$error && !empty($this->isextrafieldmanaged)) if (!$error && !empty($this->isextrafieldmanaged))
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields"; $result = $this->deleteExtraFields();
$sql .= " WHERE fk_object=".$this->id; if ($result < 0) { $error++; }
$resql = $this->db->query($sql);
if (!$resql)
{
$this->errors[] = $this->db->lasterror();
$error++;
}
} }
if (!$error) if (!$error)

View File

@ -100,9 +100,9 @@ class Events // extends CommonObject
array('id'=>'USER_NEW_PASSWORD', 'test'=>1), array('id'=>'USER_NEW_PASSWORD', 'test'=>1),
array('id'=>'USER_ENABLEDISABLE', 'test'=>1), array('id'=>'USER_ENABLEDISABLE', 'test'=>1),
array('id'=>'USER_DELETE', 'test'=>1), array('id'=>'USER_DELETE', 'test'=>1),
array('id'=>'GROUP_CREATE', 'test'=>1), array('id'=>'USERGROUP_CREATE', 'test'=>1),
array('id'=>'GROUP_MODIFY', 'test'=>1), array('id'=>'USERGROUP_MODIFY', 'test'=>1),
array('id'=>'GROUP_DELETE', 'test'=>1), array('id'=>'USERGROUP_DELETE', 'test'=>1),
); );

View File

@ -4386,7 +4386,7 @@ class Form
buttons: { buttons: {
"'.dol_escape_js($langs->transnoentities("Yes")).'": function() { "'.dol_escape_js($langs->transnoentities("Yes")).'": function() {
var options = "&token='.urlencode(newToken()).'"; var options = "&token='.urlencode(newToken()).'";
var inputok = '.json_encode($inputok).'; var inputok = '.json_encode($inputok).'; /* List of fields into form */
var pageyes = "'.dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; var pageyes = "'.dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
if (inputok.length>0) { if (inputok.length>0) {
$.each(inputok, function(i, inputname) { $.each(inputok, function(i, inputname) {
@ -4405,7 +4405,7 @@ class Form
}, },
"'.dol_escape_js($langs->transnoentities("No")).'": function() { "'.dol_escape_js($langs->transnoentities("No")).'": function() {
var options = "&token='.urlencode(newToken()).'"; var options = "&token='.urlencode(newToken()).'";
var inputko = '.json_encode($inputko).'; var inputko = '.json_encode($inputko).'; /* List of fields into form */
var pageno="'.dol_escape_js(!empty($pageno) ? $pageno : '').'"; var pageno="'.dol_escape_js(!empty($pageno) ? $pageno : '').'";
if (inputko.length>0) { if (inputko.length>0) {
$.each(inputko, function(i, inputname) { $.each(inputko, function(i, inputname) {

View File

@ -203,7 +203,7 @@ class FormActions
if ($typeelement == 'project') $projectid = $object->id; if ($typeelement == 'project') $projectid = $object->id;
$newcardbutton = ''; $newcardbutton = '';
if (!empty($conf->agenda->enabled)) if (!empty($conf->agenda->enabled) && ! empty($user->rights->agenda->myactions->create))
{ {
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage)); $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage));
} }

View File

@ -58,11 +58,11 @@ class FormAdmin
* @param int $showcode 1=Add language code into label at begining, 2=Add language code into label at end * @param int $showcode 1=Add language code into label at begining, 2=Add language code into label at end
* @param int $forcecombo Force to use combo box (so no ajax beautify effect) * @param int $forcecombo Force to use combo box (so no ajax beautify effect)
* @param int $multiselect Make the combo a multiselect * @param int $multiselect Make the combo a multiselect
* @param array $onlykeys Show only the following keys (opposite of $filter) * @param array $onlykeys Show only the following keys (opposite of $filter). Example array('fr', 'es', ...)
* @param int $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...) * @param int $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...)
* @return string Return HTML select string with list of languages * @return string Return HTML select string with list of languages
*/ */
public function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = null, $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0, $multiselect = 0, $onlykeys = array(), $mainlangonly = 0) public function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = null, $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0, $multiselect = 0, $onlykeys = null, $mainlangonly = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf, $langs; global $conf, $langs;

View File

@ -76,7 +76,7 @@ class FormFile
* @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files * @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files
* @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM) * @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM)
* @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*') * @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*')
* @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be) * @param string $sectiondir If upload must be done inside a particular directory (if sectiondir defined, sectionid must not be)
* @param int $usewithoutform 0=Default, 1=Disable <form> and style to use in existing area * @param int $usewithoutform 0=Default, 1=Disable <form> and style to use in existing area
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@ -108,8 +108,6 @@ class FormFile
return 1; return 1;
} }
$maxlength = $size;
$out = "\n\n".'<!-- Start form attach new file --><div class="formattachnewfile">'."\n"; $out = "\n\n".'<!-- Start form attach new file --><div class="formattachnewfile">'."\n";
if (empty($title)) $title = $langs->trans("AttachANewFile"); if (empty($title)) $title = $langs->trans("AttachANewFile");
@ -174,6 +172,10 @@ class FormFile
$out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""'); $out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""');
$out .= '>'; $out .= '>';
$out .= ' '; $out .= ' ';
if ($sectionid) { // Show overwrite if exists for ECM module only
$langs->load('link');
$out .= '<input style="margin-right: 2px;" type="checkbox" id="overwritefile" name="overwritefile" value="1"><label for="overwritefile">'.$langs->trans("OverwriteIfExists").'</label>';
}
$out .= '<input type="submit" class="button reposition" name="sendit" value="'.$langs->trans("Upload").'"'; $out .= '<input type="submit" class="button reposition" name="sendit" value="'.$langs->trans("Upload").'"';
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : ''); $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : '');
$out .= '>'; $out .= '>';
@ -731,7 +733,9 @@ class FormFile
$arraykeys = array_keys($modellist); $arraykeys = array_keys($modellist);
$modelselected = $arraykeys[0]; $modelselected = $arraykeys[0];
} }
$out .= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth100'); $morecss = 'maxwidth200';
if ($conf->browser->layout == 'phone') $morecss = 'maxwidth100';
$out .= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss);
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
$out .= ajax_combobox('model'); $out .= ajax_combobox('model');
@ -869,7 +873,7 @@ class FormFile
if ($printer) if ($printer)
{ {
//$out.= '<td class="right">'; //$out.= '<td class="right">';
$out .= '<a class="paddingleft" href="'.$urlsource.(strpos($urlsource, '?') ? '&amp;' : '?').'action=print_file&amp;printer='.$modulepart.'&amp;file='.urlencode($relativepath); $out .= '<a class="marginleftonly" href="'.$urlsource.(strpos($urlsource, '?') ? '&amp;' : '?').'action=print_file&amp;printer='.$modulepart.'&amp;file='.urlencode($relativepath);
$out .= ($param ? '&amp;'.$param : ''); $out .= ($param ? '&amp;'.$param : '');
$out .= '">'.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').'</a>'; $out .= '">'.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').'</a>';
} }
@ -990,7 +994,7 @@ class FormFile
{ {
$out = '<dl class="dropdown inline-block"> $out = '<dl class="dropdown inline-block">
<dt><a data-ajax="false" href="#" onClick="return false;">'.img_picto('', 'listlight', '', 0, 0, 0, '', 'valignmiddle').'</a></dt> <dt><a data-ajax="false" href="#" onClick="return false;">'.img_picto('', 'listlight', '', 0, 0, 0, '', 'valignmiddle').'</a></dt>
<dd><div class="multichoicedoc" style="position:absolute;left:100px;" ><ul class="ulselectedfields" style="display: none;">'; <dd><div class="multichoicedoc" style="position:absolute;left:100px;" ><ul class="ulselectedfields">';
$tmpout = ''; $tmpout = '';
// Loop on each file found // Loop on each file found
@ -1297,7 +1301,7 @@ class FormFile
{ {
$fileinfo = pathinfo($file['name']); $fileinfo = pathinfo($file['name']);
print '<td class="center">'; print '<td class="center">';
if (image_format_supported($file['name']) > 0) if (image_format_supported($file['name']) >= 0)
{ {
if ($useinecm == 5 || $useinecm == 6) if ($useinecm == 5 || $useinecm == 6)
{ {

View File

@ -318,7 +318,7 @@ class FormProjets
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids. * @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
* @param string $showproject 'all' = Show project info, ''=Hide project info * @param string $showproject 'all' = Show project info, ''=Hide project info
* @param User $usertofilter User object to use for filtering * @param User $usertofilter User object to use for filtering
* @return int Nbr of project if OK, <0 if KO * @return int Nbr of tasks if OK, <0 if KO
*/ */
public function selectTasks($socid = -1, $selected = '', $htmlname = 'taskid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null) public function selectTasks($socid = -1, $selected = '', $htmlname = 'taskid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null)
{ {

View File

@ -34,7 +34,6 @@ if (!class_exists('FormCompany')) {
* Classe permettant la generation du formulaire d'un nouveau ticket. * Classe permettant la generation du formulaire d'un nouveau ticket.
* *
* @package Ticket * @package Ticket
* \remarks Utilisation: $formticket = new FormTicket($db) * \remarks Utilisation: $formticket = new FormTicket($db)
* \remarks $formticket->proprietes=1 ou chaine ou tableau de valeurs * \remarks $formticket->proprietes=1 ou chaine ou tableau de valeurs
* \remarks $formticket->show_form() affiche le formulaire * \remarks $formticket->show_form() affiche le formulaire

View File

@ -363,6 +363,8 @@ class RssParser
if (!empty($rss->channel['link'])) $this->_link = (string) $rss->channel['link']; if (!empty($rss->channel['link'])) $this->_link = (string) $rss->channel['link'];
if (!empty($rss->channel['title'])) $this->_title = (string) $rss->channel['title']; if (!empty($rss->channel['title'])) $this->_title = (string) $rss->channel['title'];
//if (!empty($rss->channel['rss_description'])) $this->_description = (string) $rss->channel['rss_description']; //if (!empty($rss->channel['rss_description'])) $this->_description = (string) $rss->channel['rss_description'];
$this->_imageurl = $this->getAtomImageUrl($rss->channel);
} }
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) { if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
$tmprss = xml2php($rss); $items = $tmprss['entry']; $tmprss = xml2php($rss); $items = $tmprss['entry'];
@ -414,18 +416,18 @@ class RssParser
{ {
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML))
{ {
$itemLink = (isset($item['link']['href']) ? (string) $item['link']['href'] : ''); $itemLink = (isset($item['link']) ? (string) $item['link'] : '');
$itemTitle = (string) $item['title']; $itemTitle = (string) $item['title'];
$itemDescription = (string) $item['summary']; $itemDescription = $this->getAtomItemDescription($item);
$itemPubDate = (string) $item['created']; $itemPubDate = (string) $item['created'];
$itemId = (string) $item['id']; $itemId = (string) $item['id'];
$itemAuthor = (string) ($item['author'] ? $item['author'] : $item['author_name']); $itemAuthor = (string) ($item['author'] ? $item['author'] : $item['author_name']);
} }
else else
{ {
$itemLink = (isset($item['link']['href']) ? (string) $item['link']['href'] : ''); $itemLink = (isset($item['link']) ? (string) $item['link'] : '');
$itemTitle = (string) $item['title']; $itemTitle = (string) $item['title'];
$itemDescription = (string) $item['summary']; $itemDescription = $this->getAtomItemDescription($item);
$itemPubDate = (string) $item['created']; $itemPubDate = (string) $item['created'];
$itemId = (string) $item['id']; $itemId = (string) $item['id'];
$itemAuthor = (string) ($item['author'] ? $item['author'] : $item['author_name']); $itemAuthor = (string) ($item['author'] ? $item['author'] : $item['author_name']);
@ -568,7 +570,12 @@ class RssParser
{ {
$link_el = 'link'; $link_el = 'link';
} }
else { elseif (!isset($attrs['rel']))
{
$link_el = 'link';
}
else
{
$link_el = 'link_'.$attrs['rel']; $link_el = 'link_'.$attrs['rel'];
} }
@ -734,6 +741,77 @@ class RssParser
} }
} }
} }
/**
* Return a description/summary for one item from a ATOM feed
*
* @param array $item A parsed item of a ATOM feed
* @param int $maxlength (optional) The maximum length for the description
* @return string A summary description
*/
private function getAtomItemDescription(array $item, $maxlength = 500)
{
$result = "";
if (isset($item['summary']))
{
$result = $item['summary'];
}
elseif (isset($item['atom_content']))
{
$result = $item['atom_content'];
}
// remove all HTML elements that can possible break the maximum size of a tooltip,
// like headings, image, video etc. and allow only simple style elements
$result = strip_tags($result, "<br><p><ul><ol><li>");
$result = str_replace("\n", "", $result);
if (strlen($result) > $maxlength)
{
$result = substr($result, 0, $maxlength);
$result .= "...";
}
return $result;
}
/**
* Return a URL to a image of the given ATOM feed
*
* @param array $feed The ATOM feed that possible contain a link to a logo or icon
* @return string A URL to a image from a ATOM feed when found, otherwise a empty string
*/
private function getAtomImageUrl(array $feed)
{
if (isset($feed['icon']))
{
return $feed['logo'];
}
if (isset($feed['icon']))
{
return $feed['logo'];
}
if (isset($feed['webfeeds:logo']))
{
return $feed['webfeeds:logo'];
}
if (isset($feed['webfeeds:icon']))
{
return $feed['webfeeds:icon'];
}
if (isset($feed['webfeeds:wordmark']))
{
return $feed['webfeeds:wordmark'];
}
return "";
}
} }

View File

@ -301,7 +301,7 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $exclu
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date)); $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date));
$sqldate .= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date))."'"; $sqldate .= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date))."'";
} else } else
$sqldate .= ($excludefirstand ? "" : " AND ")." date_format( ".$datefield.", '%m') = '".$db->escape($month_date)."'"; $sqldate .= ($excludefirstand ? "" : " AND ")." date_format( ".$datefield.", '%c') = '".$db->escape($month_date)."'";
} elseif ($year_date > 0) { } elseif ($year_date > 0) {
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, false)); $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, false));
$sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, 12, false))."'"; $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, 12, false))."'";

View File

@ -1598,15 +1598,20 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
$formmail->add_attached_files($destfull, $destfile, $TFile['type'][$i]); $formmail->add_attached_files($destfull, $destfile, $TFile['type'][$i]);
} }
// Update table of files // Update index table of files (llx_ecm_files)
if ($donotupdatesession == 1) if ($donotupdatesession == 1)
{ {
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile), $TFile['name'][$i], 'uploaded', 0); $result = addFileIntoDatabaseIndex($upload_dir, basename($destfile), $TFile['name'][$i], 'uploaded', 0);
if ($result < 0) if ($result < 0)
{ {
if ($allowoverwrite) {
// Do not show error message. We can have an error due to DB_ERROR_RECORD_ALREADY_EXISTS
}
else {
setEventMessages('FailedToAddFileIntoDatabaseIndex', '', 'warnings'); setEventMessages('FailedToAddFileIntoDatabaseIndex', '', 'warnings');
} }
} }
}
$nbok++; $nbok++;
} }
@ -1760,7 +1765,6 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
return $result; return $result;
} }
/** /**
* Delete files into database index using search criterias. * Delete files into database index using search criterias.
* *

View File

@ -3142,20 +3142,24 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (empty($srconly) && in_array($pictowithouttext, array( if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'bom', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes', 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'bom', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes',
'delete', 'dolly', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt', 'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'lot', 'mrp', 'note', 'stock', 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'lot',
'money-bill-alt', 'mrp', 'note', 'stock',
'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bom', 'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bom',
'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'object_category', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_dynamicprice', 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_dynamicprice',
'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', 'object_holiday', 'object_hrm', 'object_intervention', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
'object_lot', 'object_mrp', 'object_product', 'object_service', 'object_stock', 'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal', 'object_supplier_proposal', 'object_service', 'object_stock',
'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other',
'object_phoning', 'object_phoning_fax', 'object_email', 'object_phoning', 'object_phoning_fax', 'object_email',
'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'product', 'resize', 'service', 'stats', 'trip', 'off', 'on',
'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'resize', 'service', 'stats', 'trip',
'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe',
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top',
'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'preview', 'project', 'hrm', 'members', 'ticket', 'generic', 'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'preview', 'project', 'projectpub', 'hrm', 'members', 'ticket', 'generic',
'error', 'warning', 'error', 'warning',
'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda' 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda'
) )
@ -3176,22 +3180,25 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', 'bom'=>'cubes', 'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', 'bom'=>'cubes',
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'dynamicprice'=>'hand-holding-usd', 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'dynamicprice'=>'hand-holding-usd',
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt',
'accounting'=>'chart-line', 'category'=>'tag', 'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
'email'=>'at', 'email'=>'at',
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle', 'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle',
'generic'=>'file', 'holiday'=>'umbrella-beach', 'member'=>'users', 'mrp'=>'cubes', 'trip'=>'wallet', 'group'=>'users', 'generic'=>'file', 'holiday'=>'umbrella-beach', 'member'=>'users', 'mrp'=>'cubes', 'trip'=>'wallet', 'group'=>'users',
'sign-out'=>'sign-out-alt', 'sign-out'=>'sign-out-alt',
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star', 'stats' => 'chart-bar', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter', 'split'=>'code-branch', 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
'multicurrency'=>'dollar-sign', 'other'=>'square', 'resource'=>'laptop-house', 'intervention'=>'ambulance', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', 'other'=>'square',
'stock'=>'box-open', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
'resize'=>'crop', 'supplier_proposal'=>'file-signature',
'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
'resource'=>'laptop-house',
'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
'title_agenda'=>'calendar-alt', 'title_agenda'=>'calendar-alt',
'playdisabled'=>'play', 'preview'=>'binoculars', 'project'=>'sitemap', 'resize'=>'crop',
'uparrow'=>'mail-forward', 'uparrow'=>'mail-forward',
'jabber'=>'comment-o' 'jabber'=>'comment-o'
); );
@ -3241,15 +3248,18 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
// Add CSS // Add CSS
$arrayconvpictotomorcess = array( $arrayconvpictotomorcess = array(
'action'=>'bg-infoxbox-action', 'account'=>'bg-infoxbox-bank_account', 'bank_account'=>'bg-infoxbox-bank_account', 'cash-register'=>'bg-infoxbox-bank_account', 'action'=>'bg-infobox-action', 'account'=>'bg-infobox-bank_account', 'bank_account'=>'bg-infobox-bank_account', 'cash-register'=>'bg-infobox-bank_account',
'contract'=>'bg-infoxbox-contrat', 'contract'=>'bg-infobox-contrat', 'check'=>'font-status4', 'dollyrevert'=>'flip', 'folder'=>'bg-infobox-action',
'multicurrency'=>'bg-infoxbox-bank_account', 'hrm'=>'bg-infobox-adherent', 'group'=>'bg-infobox-adherent', 'intervention'=>'bg-infobox-contrat',
'check'=>'font-status4', 'multicurrency'=>'bg-infobox-bank_account',
'hrm'=>'bg-infoxbox-adherent', 'group'=>'bg-infoxbox-adherent', 'members'=>'bg-infobox-adherent', 'member'=>'bg-infobox-adherent', 'money-bill-alt'=>'bg-infobox-bank_account',
'members'=>'bg-infoxbox-adherent', 'member'=>'bg-infoxbox-adherent', 'user'=>'bg-infoxbox-adherent', 'users'=>'bg-infoxbox-adherent', 'order'=>'bg-infobox-commande',
'user'=>'bg-infobox-adherent', 'users'=>'bg-infobox-adherent',
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
'holiday'=>'bg-infoxbox-holiday', 'payment'=>'bg-infoxbox-bank_account', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', 'holiday'=>'bg-infobox-holiday',
'ticket'=>'bg-infoxbox-contrat', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', 'title_agenda'=>'bg-infoxbox-action', 'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal',
'resource'=>'bg-infobox-action', 'supplier_proposal'=>'bg-infobox-supplier_proposal',
'ticket'=>'bg-infobox-contrat', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action',
'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode'
); );
if (!empty($arrayconvpictotomorcess[$pictowithouttext])) { if (!empty($arrayconvpictotomorcess[$pictowithouttext])) {
@ -3261,9 +3271,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'address'=>'#37a', 'building'=>'#37a', 'bom'=>'#a69944', 'address'=>'#37a', 'building'=>'#37a', 'bom'=>'#a69944',
'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'dynamicprice'=>'#a69944', 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'dynamicprice'=>'#a69944',
'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999',
'lot'=>'#a69944', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944',
'other'=>'#ddd', 'other'=>'#ddd',
'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444', 'rss'=>'#cba', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba',
'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'warning'=>'' 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'warning'=>''
); );
if (isset($arrayconvpictotocolor[$pictowithouttext])) { if (isset($arrayconvpictotocolor[$pictowithouttext])) {
@ -3349,11 +3359,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
* @param int $srconly Return only content of the src attribute of img. * @param int $srconly Return only content of the src attribute of img.
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip. * @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
* @return string Return img tag * @return string Return img tag
* @see #img_picto, #img_picto_common * @see img_picto(), img_picto_common()
*/ */
function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly = 0, $notitle = 0) function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly = 0, $notitle = 0)
{ {
return img_picto($titlealt, 'object_'.$picto, $moreatt, $pictoisfullpath, $srconly, $notitle); if (strpos($picto, '^') === 0) return img_picto($titlealt, str_replace('^', '', $picto), $moreatt, $pictoisfullpath, $srconly, $notitle);
else return img_picto($titlealt, 'object_'.$picto, $moreatt, $pictoisfullpath, $srconly, $notitle);
} }
/** /**
@ -3365,7 +3376,7 @@ function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false,
* @param int $pictoisfullpath If 1, image path is a full path * @param int $pictoisfullpath If 1, image path is a full path
* @param string $morecss More CSS * @param string $morecss More CSS
* @return string Return img tag * @return string Return img tag
* @see #img_object, #img_picto * @see img_object(), img_picto()
*/ */
function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $morecss = '') function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $morecss = '')
{ {
@ -3392,7 +3403,7 @@ function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $mo
* @param string $moreatt Add more attribute on img tag * @param string $moreatt Add more attribute on img tag
* @param int $pictoisfullpath If 1, image path is a full path * @param int $pictoisfullpath If 1, image path is a full path
* @return string Return img tag * @return string Return img tag
* @see #img_object, #img_picto * @see img_object(), img_picto()
*/ */
function img_picto_common($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0) function img_picto_common($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0)
{ {

View File

@ -23,8 +23,8 @@
*/ */
// Define size of logo small and mini // Define size of logo small and mini
$maxwidthsmall = 270; $maxheightsmall = 150; $maxwidthsmall = 350; $maxheightsmall = 200; // Near 16/9eme
$maxwidthmini = 128; $maxheightmini = 72; $maxwidthmini = 128; $maxheightmini = 72; // 16/9eme
$quality = 80; $quality = 80;

View File

@ -914,7 +914,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
// <img alt="" src="/dolibarr_dev/htdocs/viewimage.php?modulepart=medias&amp;entity=1&amp;file=image/ldestailleur_166x166.jpg" style="height:166px; width:166px" /> // <img alt="" src="/dolibarr_dev/htdocs/viewimage.php?modulepart=medias&amp;entity=1&amp;file=image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
// become // become
// <img alt="" src="'.DOL_DATA_ROOT.'/medias/image/ldestailleur_166x166.jpg" style="height:166px; width:166px" /> // <img alt="" src="'.DOL_DATA_ROOT.'/medias/image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
$newfreetext = preg_replace('/(<img.*src=")[^\"]*viewimage\.php[^\"]*modulepart=medias[^\"]*file=([^\"]*)("[^\/]*\/>)/', '\1'.DOL_DATA_ROOT.'/medias/\2\3', $newfreetext); $newfreetext = preg_replace('/(<img.*src=")[^\"]*viewimage\.php[^\"]*modulepart=medias[^\"]*file=([^\"]*)("[^\/]*\/>)/', '\1'.'file:/'.DOL_DATA_ROOT.'/medias/\2\3', $newfreetext);
$line .= $outputlangs->convToOutputCharset($newfreetext); $line .= $outputlangs->convToOutputCharset($newfreetext);
} }

View File

@ -220,6 +220,8 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '')
global $db, $langs, $conf, $user; global $db, $langs, $conf, $user;
global $dolibarr_main_url_root, $dolibarr_main_data_root; global $dolibarr_main_url_root, $dolibarr_main_data_root;
$nbrep = 0;
dol_syslog("dolWebsiteOutput start (contenttype=".$contenttype." containerid=".$containerid." USEDOLIBARREDITOR=".(defined('USEDOLIBARREDITOR') ? '1' : '')." USEDOLIBARRSERVER=".(defined('USEDOLIBARRSERVER') ? '1' : '').')'); dol_syslog("dolWebsiteOutput start (contenttype=".$contenttype." containerid=".$containerid." USEDOLIBARREDITOR=".(defined('USEDOLIBARREDITOR') ? '1' : '')." USEDOLIBARRSERVER=".(defined('USEDOLIBARRSERVER') ? '1' : '').')');
// Define $urlwithroot // Define $urlwithroot
@ -300,7 +302,6 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '')
// <img alt="" src="/dolibarr_dev/htdocs/viewimage.php?modulepart=medias&amp;entity=1&amp;file=image/ldestailleur_166x166.jpg" style="height:166px; width:166px" /> // <img alt="" src="/dolibarr_dev/htdocs/viewimage.php?modulepart=medias&amp;entity=1&amp;file=image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
// become // become
// <img alt="" src="'.$urlwithroot.'/medias/image/ldestailleur_166x166.jpg" style="height:166px; width:166px" /> // <img alt="" src="'.$urlwithroot.'/medias/image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
$nbrep = 0;
if (!$symlinktomediaexists) if (!$symlinktomediaexists)
{ {
// <img src="image.png... => <img src="medias/image.png... // <img src="image.png... => <img src="medias/image.png...
@ -349,7 +350,11 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '')
} }
} }
$content = preg_replace('/ contenteditable="true"/', ' contenteditable="false"', $content, -1, $nbrep); $content = str_replace(' contenteditable="true"', ' contenteditable="false"', $content);
if (! empty($conf->global->WEBSITE_ADD_CSS_TO_BODY)) {
$content = str_replace('<body id="bodywebsite" class="bodywebsite', '<body id="bodywebsite" class="bodywebsite '.$conf->global->WEBSITE_ADD_CSS_TO_BODY, $content);
}
dol_syslog("dolWebsiteOutput end"); dol_syslog("dolWebsiteOutput end");

View File

@ -141,22 +141,22 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&amp;leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&amp;leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propale->lire', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propale->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&amp;leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&amp;leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
-- Commercial - Customer's orders -- Commercial - Customer's orders
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&amp;leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&amp;leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1202__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders', 'List', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1202__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders', 'List', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1203__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1203__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1204__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->commande->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1204__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->commande->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1205__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=2', 'StatusOrderOnProcessShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1205__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=2', 'StatusOrderOnProcessShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1206__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=3', 'StatusOrderToBill', 1, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1206__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=3', 'StatusOrderToBill', 1, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=4', 'StatusOrderProcessed', 1, 'orders', '$user->rights->commande->lire', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=4', 'StatusOrderProcessed', 1, 'orders', '$user->rights->commande->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 7, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&amp;leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&amp;leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__);
-- Commercial - Supplier's proposals -- Commercial - Supplier's proposals
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 4, __ENTITY__);
@ -214,7 +214,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&amp;leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&amp;leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&amp;leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&amp;leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__);
-- Billing - Orders to bill -- Billing - Orders to bill
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&amp;leftmenu=orders&amp;viewstatut=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&amp;leftmenu=orders&amp;search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__);
-- Donations -- Donations
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&amp;leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&amp;leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/card.php?mainmenu=billing&amp;leftmenu=donations&amp;action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/card.php?mainmenu=billing&amp;leftmenu=donations&amp;action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__);

View File

@ -908,12 +908,12 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/comm/propal/card.php?action=create&amp;leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer); $newmenu->add("/comm/propal/card.php?action=create&amp;leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer);
$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire); $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire);
if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") { if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") {
$newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire); $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire);
$newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire); $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire);
$newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2", $langs->trans("PropalStatusSigned"), 2, $user->rights->propale->lire); $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->rights->propale->lire);
$newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire); $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire);
$newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire); $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire);
//$newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->rights->propale->lire); //$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->rights->propale->lire);
} }
$newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->rights->propale->lire); $newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->rights->propale->lire);
} }
@ -926,12 +926,12 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/commande/card.php?action=create&amp;leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); $newmenu->add("/commande/card.php?action=create&amp;leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
$newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); $newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire);
if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") { if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") {
$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);
if (!empty($conf->expedition->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire); if (!empty($conf->expedition->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire);
$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire); $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire);
//$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); //$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire);
$newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire);
} }
$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire); $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire);
} }
@ -1059,7 +1059,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (!empty($conf->commande->enabled)) if (!empty($conf->commande->enabled))
{ {
$langs->load("orders"); $langs->load("orders");
if (!empty($conf->facture->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&amp;viewstatut=-3&amp;billed=0&amp;contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); if (!empty($conf->facture->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&amp;search_status=-3&amp;billed=0&amp;contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
} }
@ -1627,9 +1627,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/expedition/card.php?action=create2&amp;leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer); $newmenu->add("/expedition/card.php?action=create2&amp;leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer);
$newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire); $newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire);
if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") { if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") {
$newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=0", $langs->trans("StatusSendingDraftShort"), 2, $user->rights->expedition->lire); $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans("StatusSendingDraftShort"), 2, $user->rights->expedition->lire);
$newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->rights->expedition->lire); $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->rights->expedition->lire);
$newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire); $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire);
} }
$newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire); $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire);
} }
@ -1641,9 +1641,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions'); $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions');
$newmenu->add("/reception/card.php?action=create2&amp;leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer); $newmenu->add("/reception/card.php?action=create2&amp;leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer);
$newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->rights->reception->lire); $newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->rights->reception->lire);
if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") $newmenu->add("/reception/list.php?leftmenu=receptions&viewstatut=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->rights->reception->lire); if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->rights->reception->lire);
if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") $newmenu->add("/reception/list.php?leftmenu=receptions&viewstatut=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->rights->reception->lire); if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->rights->reception->lire);
if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") $newmenu->add("/reception/list.php?leftmenu=receptions&viewstatut=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->rights->reception->lire); if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->rights->reception->lire);
$newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->rights->reception->lire); $newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->rights->reception->lire);
} }
} }

View File

@ -746,7 +746,7 @@ class pdf_standard extends ModeleExpenseReport
$pdf->SetXY($posx, $posy); $pdf->SetXY($posx, $posy);
$pdf->SetFont('', 'B', $default_font_size + 2); $pdf->SetFont('', 'B', $default_font_size + 2);
$pdf->SetTextColor(111, 81, 124); $pdf->SetTextColor(111, 81, 124);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 3, $object->getLibStatut(0), '', 'R'); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 3, $outputlangs->transnoentities($object->statuts_short[$object->status]), '', 'R');
if ($showaddress) { if ($showaddress) {
// Sender properties // Sender properties

View File

@ -1393,26 +1393,12 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1);
// Retained warranty // Retained warranty
if (!empty($object->situation_final) && ($object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty)))) if ($object->displayRetainedWarranty())
{ {
$displayWarranty = false;
// Check if this situation invoice is 100% for real
if (!empty($object->lines)) {
$displayWarranty = true;
foreach ($object->lines as $i => $line) {
if ($line->product_type < 2 && $line->situation_percent < 100) {
$displayWarranty = false;
break;
}
}
}
if ($displayWarranty) {
$pdf->SetTextColor(40, 40, 40); $pdf->SetTextColor(40, 40, 40);
$pdf->SetFillColor(255, 255, 255); $pdf->SetFillColor(255, 255, 255);
$retainedWarranty = $object->total_ttc * $object->retained_warranty / 100; $retainedWarranty = $object->getRetainedWarrantyAmount();
$billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty; $billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty;
// Billed - retained warranty // Billed - retained warranty
@ -1436,7 +1422,6 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
} }
}
$pdf->SetTextColor(0, 0, 0); $pdf->SetTextColor(0, 0, 0);
$creditnoteamount = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received $creditnoteamount = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received

View File

@ -1685,51 +1685,21 @@ class pdf_sponge extends ModelePDFFactures
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1);
/*if($object->type == Facture::TYPE_SITUATION)
{
// reste à payer total
$index++;
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFillColor(255,255,255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities('SituationTotalRayToRest'), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_a_payer_ttc-$deja_regle, 0, $outputlangs), 0, 'R', 1);
}*/
// Retained warranty // Retained warranty
if (!empty($object->situation_final) && ($object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty)))) if ($object->displayRetainedWarranty())
{ {
$displayWarranty = false;
// Check if this situation invoice is 100% for real
if (!empty($object->situation_final)) {
$displayWarranty = true;
}
elseif (!empty($object->lines) && $object->status == Facture::STATUS_DRAFT) {
// $object->situation_final need validation to be done so this test is need for draft
$displayWarranty = true;
foreach ($object->lines as $i => $line) {
if ($line->product_type < 2 && $line->situation_percent < 100) {
$displayWarranty = false;
break;
}
}
}
if ($displayWarranty) {
$pdf->SetTextColor(40, 40, 40); $pdf->SetTextColor(40, 40, 40);
$pdf->SetFillColor(255, 255, 255); $pdf->SetFillColor(255, 255, 255);
$retainedWarranty = $total_a_payer_ttc * $object->retained_warranty / 100; $retainedWarranty = $object->getRetainedWarrantyAmount();
$billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty; $billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty;
// Billed - retained warranty // Billed - retained warranty
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("PDFEVOLToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1);
@ -1738,8 +1708,8 @@ class pdf_sponge extends ModelePDFFactures
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$retainedWarrantyToPayOn = $outputlangs->transnoentities("PDFEVOLRetainedWarranty").' ('.$object->retained_warranty.'%)'; $retainedWarrantyToPayOn = $outputlangs->transnoentities("RetainedWarranty").' ('.$object->retained_warranty.'%)';
$retainedWarrantyToPayOn .= !empty($object->retained_warranty_date_limit) ? ' '.$outputlangs->transnoentities("PDFEVOLtoPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : ''; $retainedWarrantyToPayOn .= !empty($object->retained_warranty_date_limit) ? ' '.$outputlangs->transnoentities("toPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : '';
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -1747,7 +1717,6 @@ class pdf_sponge extends ModelePDFFactures
} }
} }
} }
}
$pdf->SetTextColor(0, 0, 0); $pdf->SetTextColor(0, 0, 0);

View File

@ -58,7 +58,7 @@ class modECM extends DolibarrModules
// Key used in llx_const table to save module status enabled/disabled (XXX is id value) // Key used in llx_const table to save module status enabled/disabled (XXX is id value)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of png file (without png) used for this module // Name of png file (without png) used for this module
$this->picto = 'dir'; $this->picto = 'folder';
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array("/ecm/temp"); $this->dirs = array("/ecm/temp");

View File

@ -57,7 +57,7 @@ class modExpedition extends DolibarrModules
$this->version = 'dolibarr'; $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->picto = "sending"; $this->picto = "dolly";
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array("/expedition/temp", $this->dirs = array("/expedition/temp",

View File

@ -56,7 +56,7 @@ class modGeoIPMaxmind extends DolibarrModules
// Name of image file used for this module. // Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png' // If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png'
$this->picto = 'globe'; $this->picto = 'geoip';
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array("/geoipmaxmind"); $this->dirs = array("/geoipmaxmind");

View File

@ -54,7 +54,7 @@ class modLoan extends DolibarrModules
$this->version = 'dolibarr'; $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->picto = 'bill'; $this->picto = 'money-bill-alt';
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array("/loan/temp"); $this->dirs = array("/loan/temp");

View File

@ -64,7 +64,7 @@ class modOpenSurvey extends DolibarrModules
// Name of image file used for this module. // Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
$this->picto = 'opensurvey.png@opensurvey'; $this->picto = '^date@opensurvey';
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();

Some files were not shown because too many files have changed in this diff Show More