Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0
This commit is contained in:
commit
3d1ff876ad
45 changed files with 293 additions and 191 deletions
|
|
@ -304,22 +304,15 @@ if (isset($_GET['img']))
|
|||
|
||||
|
||||
|
||||
// Definition de la langue et des textes
|
||||
// Definition of language and texts
|
||||
|
||||
if (isset ($_GET['lang']))
|
||||
{
|
||||
$langue = $_GET['lang'];
|
||||
}
|
||||
elseif (preg_match("/^fr/", $_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||
{
|
||||
if (isset ($_GET['lang'])) {
|
||||
$langue = preg_replace('/[^a-z_]/i', '', $_GET['lang']);
|
||||
} elseif (preg_match("/^fr/", $_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||
$langue = 'fr';
|
||||
}
|
||||
elseif (preg_match("/^es/", $_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||
{
|
||||
} elseif (preg_match("/^es/", $_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||
$langue = 'es';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$langue = 'en';
|
||||
}
|
||||
|
||||
|
|
@ -327,29 +320,25 @@ else
|
|||
// Read PHP extensions
|
||||
$loaded_extensions = get_loaded_extensions();
|
||||
$phpExtContents='';
|
||||
foreach ($loaded_extensions as $extension)
|
||||
foreach ($loaded_extensions as $extension) {
|
||||
$phpExtContents .= "<li>${extension}</li>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Read alias directory
|
||||
$listoffile=array();
|
||||
$aliasarray=array();
|
||||
$aliasContents='';
|
||||
if (is_dir($aliasDir))
|
||||
{
|
||||
if (is_dir($aliasDir)) {
|
||||
$handle=opendir($aliasDir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while ($file = readdir($handle))
|
||||
{
|
||||
if (is_resource($handle)) {
|
||||
while ($file = readdir($handle)) {
|
||||
$listoffiles[]=$file;
|
||||
}
|
||||
}
|
||||
sort($listoffiles);
|
||||
|
||||
foreach($listoffiles as $file)
|
||||
{
|
||||
foreach($listoffiles as $file) {
|
||||
if (is_file($aliasDir.$file) && preg_match('/\.conf/',$file))
|
||||
{
|
||||
$msg = '';
|
||||
|
|
@ -374,8 +363,7 @@ if (!isset($aliasContents))
|
|||
// Read projects in www dir
|
||||
$listoffiles=array();
|
||||
$handle=opendir(".");
|
||||
if (is_resource($handle))
|
||||
{
|
||||
if (is_resource($handle)) {
|
||||
while ($file = readdir($handle))
|
||||
{
|
||||
$listoffiles[]=$file;
|
||||
|
|
@ -383,8 +371,7 @@ if (is_resource($handle))
|
|||
closedir($handle);
|
||||
}
|
||||
|
||||
foreach($listoffiles as $file)
|
||||
{
|
||||
foreach($listoffiles as $file) {
|
||||
if (is_dir($file) && !in_array($file,$projectsListIgnore) && !in_array($file,$aliasarray))
|
||||
{
|
||||
$projectContents .= '<tr><td><ul class="projects">';
|
||||
|
|
@ -397,9 +384,9 @@ foreach($listoffiles as $file)
|
|||
}
|
||||
}
|
||||
|
||||
if (!isset($projectContents))
|
||||
if (!isset($projectContents)) {
|
||||
$projectContents = '<tr><td colspan="3">'.$langues[$langue]['txtNoProjet'].'</td></tr>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
$nameServer=getenv("COMPUTERNAME");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2013-2021 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
|
|
@ -865,10 +865,14 @@ class AccountingAccount extends CommonObject
|
|||
|
||||
// Level 3 (define $code_t): Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
if (!empty($buyer->code_compta_product)) {
|
||||
if ($type == 'customer' && !empty($buyer->code_compta_product)) {
|
||||
$code_t = $buyer->code_compta_product;
|
||||
$suggestedid = $accountingAccount['thirdparty'];
|
||||
$suggestedaccountingaccountfor = 'thirdparty';
|
||||
} elseif ($type == 'supplier' && !empty($seller->code_compta_product)) {
|
||||
$code_t = $seller->code_compta_product;
|
||||
$suggestedid = $accountingAccount['thirdparty'];
|
||||
$suggestedaccountingaccountfor = 'thirdparty';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1446,8 +1446,14 @@ if ($action == 'create') {
|
|||
$preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int');
|
||||
}
|
||||
if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int');
|
||||
// select "all" or "none" contact by default
|
||||
if (getDolGlobalInt('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT')) {
|
||||
$select_contact_default = 0; // select "all" contacts by default : avoid to use it if there is a lot of contacts
|
||||
} else {
|
||||
$select_contact_default = -1; // select "none" by default
|
||||
}
|
||||
print img_picto('', 'contact', 'class="paddingrightonly"');
|
||||
print $form->selectcontacts(empty($conf->global->MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT) ? GETPOST('socid', 'int') : 0, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid');
|
||||
print $form->selectcontacts(GETPOSTISSET('socid') ? GETPOSTINT('socid') : $select_contact_default, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -348,41 +348,41 @@ if ($search_title != '') {
|
|||
if ($search_note != '') {
|
||||
$param .= '&search_note='.urlencode($search_note);
|
||||
}
|
||||
if (GETPOST('datestartday_dtstart', 'int')) {
|
||||
$param .= '&datestartday_dtstart='.GETPOST('datestartday_dtstart', 'int');
|
||||
if (GETPOST('datestart_dtstartday', 'int')) {
|
||||
$param .= '&datestart_dtstartday='.GETPOST('datestart_dtstartday', 'int');
|
||||
}
|
||||
if (GETPOST('datestartmonth_dtstart', 'int')) {
|
||||
$param .= '&datestartmonth_dtstart='.GETPOST('datestartmonth_dtstart', 'int');
|
||||
if (GETPOST('datestart_dtstartmonth', 'int')) {
|
||||
$param .= '&datestart_dtstartmonth='.GETPOST('datestart_dtstartmonth', 'int');
|
||||
}
|
||||
if (GETPOST('datestartyear_dtstart', 'int')) {
|
||||
$param .= '&datestartyear_dtstart='.GETPOST('datestartyear_dtstart', 'int');
|
||||
if (GETPOST('datestart_dtstartyear', 'int')) {
|
||||
$param .= '&datestart_dtstartyear='.GETPOST('datestart_dtstartyear', 'int');
|
||||
}
|
||||
if (GETPOST('datestartday_dtend', 'int')) {
|
||||
$param .= '&datestartday_dtend='.GETPOST('datestartday_dtend', 'int');
|
||||
if (GETPOST('datestart_dtendday', 'int')) {
|
||||
$param .= '&datestart_dtendday='.GETPOST('datestart_dtendday', 'int');
|
||||
}
|
||||
if (GETPOST('datestartmonth_dtend', 'int')) {
|
||||
$param .= '&datestartmonth_dtend='.GETPOST('datestartmonth_dtend', 'int');
|
||||
if (GETPOST('datestart_dtendmonth', 'int')) {
|
||||
$param .= '&datestart_dtendmonth='.GETPOST('datestart_dtendmonth', 'int');
|
||||
}
|
||||
if (GETPOST('datestartyear_dtend', 'int')) {
|
||||
$param .= '&datestartyear_dtend='.GETPOST('datestartyear_dtend', 'int');
|
||||
if (GETPOST('datestart_dtendyear', 'int')) {
|
||||
$param .= '&datestart_dtendyear='.GETPOST('datestart_dtendyear', 'int');
|
||||
}
|
||||
if (GETPOST('dateendday_dtstart', 'int')) {
|
||||
$param .= '&dateendday_dtstart='.GETPOST('dateendday_dtstart', 'int');
|
||||
if (GETPOST('dateend_dtstartday', 'int')) {
|
||||
$param .= '&dateend_dtstartday='.GETPOST('dateend_dtstartday', 'int');
|
||||
}
|
||||
if (GETPOST('dateendmonth_dtstart', 'int')) {
|
||||
$param .= '&dateendmonth_dtstart='.GETPOST('dateendmonth_dtstart', 'int');
|
||||
if (GETPOST('dateend_dtstartmonth', 'int')) {
|
||||
$param .= '&dateend_dtstartmonth='.GETPOST('dateend_dtstartmonth', 'int');
|
||||
}
|
||||
if (GETPOST('dateendyear_dtstart', 'int')) {
|
||||
$param .= '&dateendyear_dtstart='.GETPOST('dateendyear_dtstart', 'int');
|
||||
if (GETPOST('dateend_dtstartyear', 'int')) {
|
||||
$param .= '&dateend_dtstartyear='.GETPOST('dateend_dtstartyear', 'int');
|
||||
}
|
||||
if (GETPOST('dateendday_dtend', 'int')) {
|
||||
$param .= '&dateendday_dtend='.GETPOST('dateendday_dtend', 'int');
|
||||
if (GETPOST('dateend_dtendday', 'int')) {
|
||||
$param .= '&dateend_dtendday='.GETPOST('dateend_dtendday', 'int');
|
||||
}
|
||||
if (GETPOST('dateendmonth_dtend', 'int')) {
|
||||
$param .= '&dateendmonth_dtend='.GETPOST('dateendmonth_dtend', 'int');
|
||||
if (GETPOST('dateend_dtendmonth', 'int')) {
|
||||
$param .= '&dateend_dtendmonth='.GETPOST('dateend_dtendmonth', 'int');
|
||||
}
|
||||
if (GETPOST('dateendyear_dtend', 'int')) {
|
||||
$param .= '&dateendyear_dtend='.GETPOST('dateendyear_dtend', 'int');
|
||||
if (GETPOST('dateend_dtendyear', 'int')) {
|
||||
$param .= '&dateend_dtendyear='.GETPOST('dateend_dtendyear', 'int');
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
|
|
|
|||
|
|
@ -780,10 +780,14 @@ if (empty($reshook)) {
|
|||
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) {
|
||||
$db->begin();
|
||||
|
||||
$result = $object->reopen($user, empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE));
|
||||
$newstatus = (getDolGlobalInt('PROPAL_SKIP_ACCEPT_REFUSE') ? Propal::STATUS_DRAFT : Propal::STATUS_VALIDATED);
|
||||
$result = $object->reopen($user, $newstatus);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
} else {
|
||||
$object->statut = $newstatus;
|
||||
$object->status = $newstatus;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
|
|
@ -1631,14 +1635,15 @@ if (empty($reshook)) {
|
|||
$result = $object->setWarehouse(GETPOST('warehouse_id', 'int'));
|
||||
} elseif ($action == 'update_extras') {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$attribute_name = GETPOST('attribute', 'restricthtml');
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, $attribute_name);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
if (!$error) {
|
||||
$result = $object->insertExtraFields('PROPAL_MODIFY');
|
||||
$result = $object->updateExtraField($attribute_name, 'PROPAL_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -559,6 +559,8 @@ class Account extends CommonObject
|
|||
*/
|
||||
public function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur = '', $banque = '', $accountancycode = '', $datev = null, $num_releve = '', $amount_main_currency = null)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
// Deprecation warning
|
||||
if (is_numeric($oper)) {
|
||||
dol_syslog(__METHOD__.": using numeric operations is deprecated", LOG_WARNING);
|
||||
|
|
@ -591,11 +593,11 @@ class Account extends CommonObject
|
|||
|
||||
// Check parameters
|
||||
if (!$oper) {
|
||||
$this->error = "oper not defined";
|
||||
$this->error = $langs->trans("OperNotDefined");
|
||||
return -1;
|
||||
}
|
||||
if (!$this->id) {
|
||||
$this->error = "this->id not defined";
|
||||
$this->error = $langs->trans("ThisIdNotDefined");
|
||||
return -2;
|
||||
}
|
||||
if ($this->courant == Account::TYPE_CASH && $oper != 'LIQ') {
|
||||
|
|
|
|||
|
|
@ -5853,7 +5853,7 @@ if ($action == 'create') {
|
|||
print dolGetButtonAction($htmltooltip, $langs->trans('Delete'), 'delete', $deleteHref, '', $enableDelete, $params);
|
||||
} else {
|
||||
$params['attr']['title'] = '';
|
||||
print dolGetButtonAction($langs->trans('Delete'), $langs->trans('Delete'), 'delete', '#', '', false);
|
||||
print dolGetButtonAction($htmltooltip, $langs->trans('Delete'), 'delete', '#', '', false);
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ class Paiement extends CommonObject
|
|||
// Add controls of input validity
|
||||
if ($value_converted === false) {
|
||||
// We failed to find the conversion for one invoice
|
||||
$this->error = 'FailedToFoundTheConversionRateForInvoice';
|
||||
$this->error = $langs->trans('FailedToFoundTheConversionRateForInvoice');
|
||||
return -1;
|
||||
}
|
||||
if (empty($currencyofpayment)) {
|
||||
|
|
@ -324,7 +324,7 @@ class Paiement extends CommonObject
|
|||
// Check parameters
|
||||
if (empty($totalamount) && empty($atleastonepaymentnotnull)) { // We accept negative amounts for withdraw reject but not empty arrays
|
||||
$this->errors[] = 'TotalAmountEmpty';
|
||||
$this->error = 'TotalAmountEmpty';
|
||||
$this->error = $langs->trans('TotalAmountEmpty');
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ $search_account = GETPOST("search_account", "int");
|
|||
$search_payment_num = GETPOST('search_payment_num', 'alpha');
|
||||
$search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x"
|
||||
$search_status = GETPOST('search_status', 'intcomma');
|
||||
$search_sale = GETPOST('search_sale', 'int');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
|
|
@ -117,6 +118,17 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||
$hookmanager->initHooks(array('paymentlist'));
|
||||
$object = new Paiement($db);
|
||||
|
||||
if (!$user->hasRight('societe', 'client', 'voir')) {
|
||||
$search_sale = $user->id;
|
||||
}
|
||||
|
||||
// Security check
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$result = restrictedArea($user, 'facture', $facid, '');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
|
@ -185,8 +197,7 @@ if (GETPOST("orphelins", "alpha")) {
|
|||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
} else {
|
||||
// DISTINCT is to avoid duplicate when there is a link to sales representatives
|
||||
$sql = "SELECT DISTINCT p.rowid, p.ref, p.datep, p.fk_bank, p.amount, p.statut, p.num_paiement";
|
||||
$sql = "SELECT p.rowid, p.ref, p.datep, p.fk_bank, p.amount, p.statut, p.num_paiement";
|
||||
$sql .= ", c.code as paiement_code";
|
||||
$sql .= ", ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.fk_accountancy_journal as accountancy_journal";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.email";
|
||||
|
|
@ -205,13 +216,7 @@ if (GETPOST("orphelins", "alpha")) {
|
|||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||
}
|
||||
$sql .= " WHERE p.entity IN (".getEntity('invoice').")";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND f.fk_soc = ".((int) $socid);
|
||||
}
|
||||
|
|
@ -248,6 +253,14 @@ if (GETPOST("orphelins", "alpha")) {
|
|||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
// Search on sale representative
|
||||
if ($search_sale && $search_sale != '-1') {
|
||||
if ($search_sale == -2) {
|
||||
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
|
||||
} elseif ($search_sale > 0) {
|
||||
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
|
||||
}
|
||||
}
|
||||
|
||||
if ($search_all) {
|
||||
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
|
|
|
|||
|
|
@ -214,12 +214,12 @@ if (isModEnabled('accounting')) {
|
|||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPING"'.($modecompta == 'BOOKKEEPING' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta1" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta1"> '.$langs->trans("CalcModeDebt");
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta1" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta1"> '.$langs->trans("CalcModeEngagement");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
$calcmode .= '<br><input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<br><input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeDebt");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,12 +189,12 @@ if (isModEnabled('accounting')) {
|
|||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPING"'.($modecompta == 'BOOKKEEPING' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta1" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta1"> '.$langs->trans("CalcModeDebt");
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta1" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta1"> '.$langs->trans("CalcModeEngagement");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
$calcmode .= '<br><input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<br><input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeDebt");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ if ($action == 'create') {
|
|||
print '<tr><td>';
|
||||
print $langs->trans('Employee');
|
||||
print '</td>';
|
||||
print '<td>'.img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($fk_user, 'userid', 1).'</td></tr>';
|
||||
print '<td>'.img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers('', 'userid', 1).'</td></tr>';
|
||||
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
|
|
|
|||
|
|
@ -1863,6 +1863,7 @@ class Contact extends CommonObject
|
|||
$sql .= " WHERE sc.fk_soc =".((int) $this->socid);
|
||||
$sql .= " AND sc.fk_c_type_contact=tc.rowid";
|
||||
$sql .= " AND tc.element = '".$this->db->escape($element)."'";
|
||||
$sql .= " AND sp.entity IN (".getEntity('contact').")";
|
||||
$sql .= " AND tc.active = 1";
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
|
|
|||
|
|
@ -6650,6 +6650,7 @@ abstract class CommonObject
|
|||
$this->array_options["options_".$key] = null;
|
||||
}
|
||||
break;
|
||||
case 'price':
|
||||
case 'double':
|
||||
$value = price2num($value);
|
||||
if (!is_numeric($value) && $value != '') {
|
||||
|
|
@ -6668,9 +6669,6 @@ abstract class CommonObject
|
|||
$this->array_options[$key] = null;
|
||||
}
|
||||
break;*/
|
||||
case 'price':
|
||||
$this->array_options["options_".$key] = price2num($this->array_options["options_".$key]);
|
||||
break;
|
||||
case 'date':
|
||||
case 'datetime':
|
||||
if (empty($this->array_options["options_".$key])) {
|
||||
|
|
|
|||
|
|
@ -582,7 +582,7 @@ class DiscountAbsolute
|
|||
$sql .= " AND f.type = ". (int) $invoice::TYPE_DEPOSIT;
|
||||
} else {
|
||||
$this->error = get_class($this)."::getSumDepositsUsed was called with a bad object as a first parameter";
|
||||
dol_print_error($this->error);
|
||||
dol_print_error($this->db, $this->error);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -623,7 +623,7 @@ class DiscountAbsolute
|
|||
$sql .= " AND f.type IN (".$this->db->sanitize($invoice::TYPE_STANDARD.", ".$invoice::TYPE_CREDIT_NOTE).")"; // Find discount coming from credit note or excess paid
|
||||
} else {
|
||||
$this->error = get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter";
|
||||
dol_print_error($this->error);
|
||||
dol_print_error($this->db, $this->error);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -661,7 +661,7 @@ class DiscountAbsolute
|
|||
$sql .= " WHERE rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_source = ".((int) $invoice->id);
|
||||
} else {
|
||||
$this->error = get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter";
|
||||
dol_print_error($this->error);
|
||||
dol_print_error($this->db, $this->error);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2349,29 +2349,29 @@ class Form
|
|||
/**
|
||||
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_list
|
||||
*
|
||||
* @param int $selected Preselected products
|
||||
* @param string $htmlname Name of HTML select field (must be unique in page).
|
||||
* @param int|string $filtertype Filter on product type (''=nofilter, 0=product, 1=service)
|
||||
* @param int $limit Limit on number of returned lines
|
||||
* @param int $price_level Level of price to show
|
||||
* @param int $status Sell status -1=Return all products, 0=Products not on sell, 1=Products on sell
|
||||
* @param int $finished 2=all, 1=finished, 0=raw material
|
||||
* @param string $selected_input_value Value of preselected input text (for use with ajax)
|
||||
* @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
|
||||
* @param array $ajaxoptions Options for ajax_autocompleter
|
||||
* @param int $socid Thirdparty Id (to get also price dedicated to this customer)
|
||||
* @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param string $morecss Add more css on select
|
||||
* @param int $hidepriceinlabel 1=Hide prices in label
|
||||
* @param string $warehouseStatus Warehouse status filter to count the quantity in stock. Following comma separated filter options can be used
|
||||
* 'warehouseopen' = count products from open warehouses,
|
||||
* 'warehouseclosed' = count products from closed warehouses,
|
||||
* 'warehouseinternal' = count products from warehouses for internal correct/transfer only
|
||||
* @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
|
||||
* @param string $nooutput No print, return the output into a string
|
||||
* @param int $status_purchase Purchase status -1=Return all products, 0=Products not on purchase, 1=Products on purchase
|
||||
* @return void|string
|
||||
* @param int $selected Preselected products
|
||||
* @param string $htmlname Name of HTML select field (must be unique in page).
|
||||
* @param int|string $filtertype Filter on product type (''=nofilter, 0=product, 1=service)
|
||||
* @param int $limit Limit on number of returned lines
|
||||
* @param int $price_level Level of price to show
|
||||
* @param int $status Sell status: -1=No filter on sell status, 0=Products not on sell, 1=Products on sell
|
||||
* @param int $finished 2=all, 1=finished, 0=raw material
|
||||
* @param string $selected_input_value Value of preselected input text (for use with ajax)
|
||||
* @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
|
||||
* @param array $ajaxoptions Options for ajax_autocompleter
|
||||
* @param int $socid Thirdparty Id (to get also price dedicated to this customer)
|
||||
* @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param string $morecss Add more css on select
|
||||
* @param int $hidepriceinlabel 1=Hide prices in label
|
||||
* @param string $warehouseStatus Warehouse status filter to count the quantity in stock. Following comma separated filter options can be used
|
||||
* 'warehouseopen' = count products from open warehouses,
|
||||
* 'warehouseclosed' = count products from closed warehouses,
|
||||
* 'warehouseinternal' = count products from warehouses for internal correct/transfer only
|
||||
* @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
|
||||
* @param string $nooutput No print, return the output into a string
|
||||
* @param int $status_purchase Purchase status: -1=No filter on purchase status, 0=Products not on purchase, 1=Products on purchase
|
||||
* @return void|string
|
||||
*/
|
||||
public function select_produits($selected = '', $htmlname = 'productid', $filtertype = '', $limit = 0, $price_level = 0, $status = 1, $finished = 2, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '', $selected_combinations = null, $nooutput = 0, $status_purchase = -1)
|
||||
{
|
||||
|
|
@ -2756,12 +2756,10 @@ class Form
|
|||
if ($finished == 0) {
|
||||
$sql .= " AND p.finished = " . ((int) $finished);
|
||||
} elseif ($finished == 1) {
|
||||
$sql .= " AND p.finished = " . ((int) $finished);
|
||||
if ($status >= 0) {
|
||||
$sql .= " AND p.tosell = " . ((int) $status);
|
||||
}
|
||||
} elseif ($status >= 0) {
|
||||
$sql .= " AND p.tosell = " . ((int) $status);
|
||||
$sql .= " AND p.finished = ".((int) $finished);
|
||||
}
|
||||
if ($status >= 0) {
|
||||
$sql .= " AND p.tosell = ".((int) $status);
|
||||
}
|
||||
if ($status_purchase >= 0) {
|
||||
$sql .= " AND p.tobuy = " . ((int) $status_purchase);
|
||||
|
|
|
|||
|
|
@ -1334,17 +1334,17 @@ jQuery(document).ready(function() {
|
|||
});
|
||||
|
||||
|
||||
<?php
|
||||
if (empty($conf->global->MAIN_DISABLE_SELECT2_FOCUS_PROTECTION) && !defined('DISABLE_SELECT2_FOCUS_PROTECTION')) {
|
||||
?>
|
||||
/*
|
||||
* Hacky fix for a bug in select2 with jQuery 3.6.0's new nested-focus "protection"
|
||||
* Hacky fix for a bug in select2 with jQuery 3.6.4's new nested-focus "protection"
|
||||
* This fix needs to click a second time when clicking into a combo with ajax (see Test4d and Test5a in test_forms.php
|
||||
* see: https://github.com/select2/select2/issues/5993
|
||||
* see: https://github.com/jquery/jquery/issues/4382
|
||||
*
|
||||
* TODO: Recheck with the select2 GH issue and remove once this is fixed on their side
|
||||
*/
|
||||
|
||||
<?php
|
||||
if (empty($conf->global->MAIN_DISABLE_SELECT2_FOCUS_PROTECTION) && !defined('DISABLE_SELECT2_FOCUS_PROTECTION')) {
|
||||
?>
|
||||
$(document).on('select2:open', (e) => {
|
||||
console.log("Execute the focus (click on combo or use space when on component");
|
||||
const target = $(e.target);
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ function societe_prepare_head(Societe $object)
|
|||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql .= " WHERE p.fk_soc = ".((int) $object->id);
|
||||
$sql .= " AND entity IN (".getEntity($object->element).")";
|
||||
// Add where from hooks
|
||||
$parameters = array('contacttab' => true);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
|
|
@ -1150,6 +1151,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
$sql .= " WHERE t.fk_soc = ".((int) $object->id);
|
||||
$sql .= " AND t.entity IN (".getEntity($object->element).")";
|
||||
$sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)";
|
||||
if ($search_rowid) {
|
||||
$sql .= natural_search('t.rowid', $search_rowid);
|
||||
|
|
|
|||
|
|
@ -973,7 +973,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
|
|||
|
||||
if (!is_object($objsoc)) {
|
||||
$valueforccc = $objsoc;
|
||||
} elseif ($table == "commande_fournisseur" || $table == "facture_fourn") {
|
||||
} elseif ($table == "commande_fournisseur" || $table == "facture_fourn" || $table == "paiementfourn") {
|
||||
$valueforccc = dol_string_unaccent($objsoc->code_fournisseur);
|
||||
} else {
|
||||
$valueforccc = dol_string_unaccent($objsoc->code_client);
|
||||
|
|
|
|||
|
|
@ -1304,14 +1304,16 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||
}
|
||||
}
|
||||
// Show page nb only on iso languages (so default Helvetica font)
|
||||
// if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') {
|
||||
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18 - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));
|
||||
// $pdf->MultiCell(18, 2, $pdf->getPageNumGroupAlias().' / '.$pdf->getPageGroupAlias(), 0, 'R', 0);
|
||||
// $pdf->MultiCell(18, 2, $pdf->PageNo().' / '.$pdf->getAliasNbPages(), 0, 'R', 0); // doesn't works with all fonts
|
||||
// $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell
|
||||
$pagination = $pdf->PageNo().' / '.$pdf->getNumPages();
|
||||
$pdf->MultiCell(18, 2, $pagination, 0, 'R', 0);
|
||||
// }
|
||||
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18 - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));
|
||||
|
||||
if (getDolGlobalString('PDF_USE_GETALIASNBPAGE_FOR_TOTAL')) {
|
||||
// $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell
|
||||
$pagination = $pdf->PageNo().' / '.$pdf->getAliasNbPages(); // seems to not works with all fonts like ru_UK
|
||||
} else {
|
||||
$pagination = $pdf->PageNo().' / '.$pdf->getNumPages(); // seems to always work even with $pdf->Cell. But some users has reported wrong nb (no way to reproduce)
|
||||
}
|
||||
|
||||
$pdf->MultiCell(18, 2, $pagination, 0, 'R', 0);
|
||||
|
||||
// Show Draft Watermark
|
||||
if (!empty($watermark)) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ function showOnlineSignatureUrl($type, $ref, $obj = null)
|
|||
$servicename = 'Online';
|
||||
|
||||
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlineSignature", $servicename).'</span><br>';
|
||||
$url = getOnlineSignatureUrl(0, $type, $ref, $obj);
|
||||
$url = getOnlineSignatureUrl(0, $type, $ref, 1, $obj);
|
||||
$out .= '<div class="urllink">';
|
||||
if ($url == $langs->trans("FeatureOnlineSignDisabled")) {
|
||||
$out .= $url;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -510,7 +511,7 @@ class modFacture extends DolibarrModules
|
|||
's.code_compta_fournisseur'=>'SupplierAccountancyCode',
|
||||
's.tva_intra'=>'VATIntra',
|
||||
't.libelle'=>"ThirdPartyType", // 'ce.code'=>"Staff", "cfj.libelle"=>"JuridicalStatus",
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.fk_facture_source'=>'SourceInvoiceId',
|
||||
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total_ht'=>"TotalHT",
|
||||
'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'none.rest'=>'Rest',
|
||||
|
|
@ -553,7 +554,7 @@ class modFacture extends DolibarrModules
|
|||
's.rowid'=>'Numeric', 's.nom'=>'Text', 'ps.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
|
||||
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
|
||||
't.libelle'=>"Text", // 'ce.code'=>"List:c_effectif:libelle:code", "cfj.libelle"=>"Text",
|
||||
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.fk_mode_reglement'=>'Numeric',
|
||||
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.fk_facture_source'=>'Numeric', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.fk_mode_reglement'=>'Numeric',
|
||||
'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric', 'f.close_code'=>'Text', 'f.close_note'=>'Text',
|
||||
'none.rest'=>"NumericCompute",
|
||||
'f.note_private'=>"Text", 'f.note_public'=>"Text",
|
||||
|
|
@ -637,7 +638,7 @@ class modFacture extends DolibarrModules
|
|||
's.phone'=>'Phone',
|
||||
's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode',
|
||||
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.fk_facture_source'=>'SourceInvoiceId',
|
||||
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total_ht'=>"TotalHT",
|
||||
'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'none.rest'=>'Rest',
|
||||
|
|
@ -662,7 +663,7 @@ class modFacture extends DolibarrModules
|
|||
$this->export_TypeFields_array[$r] = array(
|
||||
's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
|
||||
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
|
||||
'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
|
||||
'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.fk_facture_source'=>'Numeric', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
|
||||
'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status', 'f.close_code'=>'Text', 'f.close_note'=>'Text',
|
||||
'none.rest'=>'NumericCompute',
|
||||
'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text',
|
||||
|
|
|
|||
|
|
@ -187,6 +187,7 @@ class Cronjob extends CommonObject
|
|||
const STATUS_DISABLED = 0;
|
||||
const STATUS_ENABLED = 1;
|
||||
const STATUS_ARCHIVED = 2;
|
||||
const MAXIMUM_LENGTH_FOR_LASTOUTPUT_FIELD = 65535;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -1307,13 +1308,13 @@ class Cronjob extends CommonObject
|
|||
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$errmsg, LOG_ERR);
|
||||
|
||||
$this->error = $errmsg;
|
||||
$this->lastoutput = (!empty($object->output) ? $object->output."\n" : "").$errmsg;
|
||||
$this->lastoutput = dol_substr((empty($object->output) ? "" : $object->output."\n").$errmsg, 0, $this::MAXIMUM_LENGTH_FOR_LASTOUTPUT_FIELD, 'UTF-8', 1);
|
||||
$this->lastresult = is_numeric($result) ? $result : -1;
|
||||
$retval = $this->lastresult;
|
||||
$error++;
|
||||
} else {
|
||||
dol_syslog(get_class($this)."::run_jobs END");
|
||||
$this->lastoutput = (!empty($object->output) ? $object->output : "");
|
||||
$this->lastoutput = dol_substr((empty($object->output) ? "" : $object->output."\n").$errmsg, 0, $this::MAXIMUM_LENGTH_FOR_LASTOUTPUT_FIELD, 'UTF-8', 1);
|
||||
$this->lastresult = var_export($result, true);
|
||||
$retval = $this->lastresult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,6 +324,30 @@ if (empty($reshook)) {
|
|||
$object->setProject($projectid);
|
||||
}
|
||||
|
||||
if ($action == 'update_extras') {
|
||||
$object->fetch($id);
|
||||
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->insertExtraFields('DON_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$action = 'edit_extras';
|
||||
}
|
||||
}
|
||||
|
||||
// Actions to build doc
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
|
|
|||
|
|
@ -2340,10 +2340,13 @@ class ExpenseReport extends CommonObject
|
|||
*/
|
||||
public function periode_existe($fuser, $date_debut, $date_fin)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// phpcs:enable
|
||||
$sql = "SELECT rowid, date_debut, date_fin";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " WHERE fk_user_author = ".((int) $fuser->id);
|
||||
$sql .= " WHERE entity = ".((int) $conf->entity); // not shared, only for the current entity
|
||||
$sql .= " AND fk_user_author = ".((int) $fuser->id);
|
||||
|
||||
dol_syslog(get_class($this)."::periode_existe sql=".$sql);
|
||||
$result = $this->db->query($sql);
|
||||
|
|
|
|||
|
|
@ -1114,6 +1114,12 @@ if ($action == 'create') {
|
|||
$numref = $object->ref;
|
||||
}
|
||||
$text = $langs->trans('ConfirmValidateIntervention', $numref);
|
||||
if (isModEnabled('notification')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
$text .= $notify->confirmMessage('FICHINTER_VALIDATE', $object->socid, $object);
|
||||
}
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate', '', 1, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) {
|
|||
define('DOL_APPLICATION_TITLE', 'Dolibarr');
|
||||
}
|
||||
if (!defined('DOL_VERSION')) {
|
||||
define('DOL_VERSION', '18.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
define('DOL_VERSION', '18.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
}
|
||||
|
||||
if (!defined('EURO')) {
|
||||
|
|
|
|||
|
|
@ -379,15 +379,15 @@ class SupplierInvoices extends DolibarrApi
|
|||
throw new RestException(400, 'Invoice ID is mandatory');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->getListOfPayments();
|
||||
if ($result < 0) {
|
||||
throw new RestException(405, $this->invoice->error);
|
||||
|
|
@ -428,6 +428,11 @@ class SupplierInvoices extends DolibarrApi
|
|||
throw new RestException(400, 'Invoice ID is mandatory');
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
|
@ -442,12 +447,6 @@ class SupplierInvoices extends DolibarrApi
|
|||
throw new RestException(400, 'Payment mode ID is mandatory');
|
||||
}
|
||||
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
// Calculate amount to pay
|
||||
$totalpaid = $this->invoice->getSommePaiement();
|
||||
$totaldeposits = $this->invoice->getSumDepositsUsed();
|
||||
|
|
|
|||
|
|
@ -1539,8 +1539,12 @@ class CommandeFournisseur extends CommonOrder
|
|||
$line->date_end,
|
||||
$line->array_options,
|
||||
$line->fk_unit,
|
||||
$line->multicurrency_subprice, // pu_ht_devise
|
||||
$line->origin, // origin
|
||||
$line->origin_id, // origin_id
|
||||
$line->rang, // rang
|
||||
$line->special_code
|
||||
);
|
||||
);
|
||||
if ($result < 0) {
|
||||
dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); // do not use dol_print_error here as it may be a functionnal error
|
||||
$this->db->rollback();
|
||||
|
|
@ -1815,31 +1819,31 @@ class CommandeFournisseur extends CommonOrder
|
|||
/**
|
||||
* Add order line
|
||||
*
|
||||
* @param string $desc Description
|
||||
* @param float $pu_ht Unit price (used if $price_base_type is 'HT')
|
||||
* @param float $qty Quantity
|
||||
* @param float $txtva Taux tva
|
||||
* @param float $txlocaltax1 Localtax1 tax
|
||||
* @param float $txlocaltax2 Localtax2 tax
|
||||
* @param int $fk_product Id product
|
||||
* @param int $fk_prod_fourn_price Id supplier price
|
||||
* @param string $ref_supplier Supplier reference price
|
||||
* @param float $remise_percent Remise
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param float $pu_ttc Unit price TTC (used if $price_base_type is 'TTC')
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $info_bits More information
|
||||
* @param bool $notrigger Disable triggers
|
||||
* @param int $date_start Date start of service
|
||||
* @param int $date_end Date end of service
|
||||
* @param array $array_options extrafields array
|
||||
* @param string $fk_unit Code of the unit to use. Null to use the default one
|
||||
* @param string $pu_ht_devise Amount in currency
|
||||
* @param string $origin 'order', ...
|
||||
* @param int $origin_id Id of origin object
|
||||
* @param int $rang Rank
|
||||
* @param int $special_code Special code
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @param string $desc Description
|
||||
* @param float $pu_ht Unit price (used if $price_base_type is 'HT')
|
||||
* @param float $qty Quantity
|
||||
* @param float $txtva VAT Rate
|
||||
* @param float $txlocaltax1 Localtax1 tax
|
||||
* @param float $txlocaltax2 Localtax2 tax
|
||||
* @param int $fk_product Id product
|
||||
* @param int $fk_prod_fourn_price Id supplier price
|
||||
* @param string $ref_supplier Supplier reference price
|
||||
* @param float $remise_percent Remise
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param float $pu_ttc Unit price TTC (used if $price_base_type is 'TTC')
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $info_bits More information
|
||||
* @param bool $notrigger Disable triggers
|
||||
* @param int $date_start Date start of service
|
||||
* @param int $date_end Date end of service
|
||||
* @param array $array_options extrafields array
|
||||
* @param string $fk_unit Code of the unit to use. Null to use the default one
|
||||
* @param string $pu_ht_devise Amount in currency
|
||||
* @param string $origin 'order', ...
|
||||
* @param int $origin_id Id of origin object
|
||||
* @param int $rang Rank
|
||||
* @param int $special_code Special code
|
||||
* @return int Return integer <=0 if KO, >0 if OK
|
||||
*/
|
||||
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $fk_prod_fourn_price = 0, $ref_supplier = '', $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $type = 0, $info_bits = 0, $notrigger = false, $date_start = null, $date_end = null, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $origin = '', $origin_id = 0, $rang = -1, $special_code = 0)
|
||||
{
|
||||
|
|
@ -2063,7 +2067,7 @@ class CommandeFournisseur extends CommonOrder
|
|||
// Multicurrency
|
||||
$this->line->fk_multicurrency = $this->fk_multicurrency;
|
||||
$this->line->multicurrency_code = $this->multicurrency_code;
|
||||
$this->line->multicurrency_subprice = $pu_ht_devise;
|
||||
$this->line->multicurrency_subprice = $pu_ht_devise;
|
||||
$this->line->multicurrency_total_ht = $multicurrency_total_ht;
|
||||
$this->line->multicurrency_total_tva = $multicurrency_total_tva;
|
||||
$this->line->multicurrency_total_ttc = $multicurrency_total_ttc;
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ class PaiementFourn extends Paiement
|
|||
// Add controls of input validity
|
||||
if ($value_converted === false) {
|
||||
// We failed to find the conversion for one invoice
|
||||
$this->error = 'FailedToFoundTheConversionRateForInvoice';
|
||||
$this->error = $langs->trans('FailedToFoundTheConversionRateForInvoice');
|
||||
return -1;
|
||||
}
|
||||
if (empty($currencyofpayment)) {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@
|
|||
-- VMYSQL4.3 ALTER TABLE llx_hrm_skillrank CHANGE COLUMN `rank` rankorder integer;
|
||||
-- VPGSQL8.2 ALTER TABLE llx_hrm_skillrank CHANGE COLUMN rank rankorder integer;
|
||||
|
||||
ALTER TABLE llx_projet_task ADD COLUMN fk_user_modif integer after fk_user_creat;
|
||||
|
||||
ALTER TABLE llx_accounting_system CHANGE COLUMN fk_pays fk_country integer;
|
||||
|
||||
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN ref varchar(128);
|
||||
|
|
|
|||
|
|
@ -1133,13 +1133,13 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) {
|
|||
}
|
||||
if ($key == 'js') {
|
||||
$value = $obj->value;
|
||||
$valuearray = json_decode($value);
|
||||
$valuearray = (array) json_decode($value); // Force cast into array because sometimes it is a stdClass
|
||||
$reloffile = $valuearray[0];
|
||||
$reloffile = preg_replace('/^\//', '', $valuearray[0]);
|
||||
}
|
||||
if ($key == 'css') {
|
||||
$value = $obj->value;
|
||||
$valuearray = json_decode($value);
|
||||
$valuearray = (array) json_decode($value); // Force cast into array because sometimes it is a stdClass
|
||||
if ($value && (!is_array($valuearray) || count($valuearray) == 0)) {
|
||||
$valuearray = array();
|
||||
$valuearray[0] = $value; // If value was not a json array but a string
|
||||
|
|
|
|||
|
|
@ -350,6 +350,7 @@ HelpAbandonOther=This amount has been abandoned since it was an error (wrong cus
|
|||
IdSocialContribution=Social/fiscal tax payment id
|
||||
PaymentId=Payment id
|
||||
PaymentRef=Payment ref.
|
||||
SourceInvoiceId=Source invoice id
|
||||
InvoiceId=Invoice id
|
||||
InvoiceRef=Invoice ref.
|
||||
InvoiceDateCreation=Invoice creation date
|
||||
|
|
|
|||
|
|
@ -392,3 +392,7 @@ BadSetupOfField = Error bad setup of field
|
|||
BadSetupOfFieldClassNotFoundForValidation = Error bad setup of field : Class not found for validation
|
||||
BadSetupOfFieldFileNotFound = Error bad setup of field : File not found for inclusion
|
||||
BadSetupOfFieldFetchNotCallable = Error bad setup of field : Fetch not callable on class
|
||||
TotalAmountEmpty=Total Amount Empty
|
||||
FailedToFoundTheConversionRateForInvoice=Failed to found the conversion rate for invoice
|
||||
ThisIdNotDefined=$this->id not defined
|
||||
OperNotDefined=Oper not defined
|
||||
|
|
|
|||
|
|
@ -351,6 +351,7 @@ HelpAbandonOther=Ce montant a été abandonné car il s'agissait d'une erreur de
|
|||
IdSocialContribution=Id de paiement charge fiscale ou sociale
|
||||
PaymentId=Id paiement
|
||||
PaymentRef=Ref paiement
|
||||
SourceInvoiceId=Id facture source
|
||||
InvoiceId=Id facture
|
||||
InvoiceRef=Réf. facture
|
||||
InvoiceDateCreation=Date création facture
|
||||
|
|
|
|||
|
|
@ -2158,14 +2158,26 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||
$toprightmenu .= $form->textwithtooltip('', $langs->trans("ModuleBuilder"), 2, 1, $text, 'login_block_elem', 2);
|
||||
}
|
||||
|
||||
// Link to print main content area
|
||||
// Link to print main content area (optioncss=print)
|
||||
if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$qs = dol_escape_htmltag($_SERVER["QUERY_STRING"]);
|
||||
|
||||
if (isset($_POST) && is_array($_POST)) {
|
||||
foreach ($_POST as $key => $value) {
|
||||
if ($key !== 'action' && $key !== 'password' && !is_array($value)) {
|
||||
$qs .= '&'.$key.'='.urlencode($value);
|
||||
$key = preg_replace('/[^a-z0-9_\.\-\[\]]/i', '', $key);
|
||||
if (in_array($key, array('action', 'massaction', 'password'))) {
|
||||
continue;
|
||||
}
|
||||
if (!is_array($value)) {
|
||||
if ($value !== '') {
|
||||
$qs .= '&'.urlencode($key).'='.urlencode($value);
|
||||
}
|
||||
} else {
|
||||
foreach ($value as $value2) {
|
||||
if (($value2 !== '') && (!is_array($value2))) {
|
||||
$qs .= '&'.urlencode($key).'[]='.urlencode($value2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ if (!empty($search_fk_warehouse)) {
|
|||
}
|
||||
}
|
||||
if ($productid > 0) {
|
||||
$param .= '&productid='.$productid;
|
||||
$param .= '&productid='.(int) $productid;
|
||||
}
|
||||
if (GETPOST('dateday', 'int') > 0) {
|
||||
$param .= '&dateday='.GETPOST('dateday', 'int');
|
||||
|
|
|
|||
|
|
@ -499,8 +499,11 @@ if (empty($reshook)) {
|
|||
$newobject->fetch_optionals();
|
||||
$newobject->fetch_thirdparty(); // Load new object
|
||||
$object = $newobject;
|
||||
$action = 'edit';
|
||||
$action = 'view';
|
||||
$comefromclone = true;
|
||||
|
||||
setEventMessages($langs->trans("ProjectCreatedInDolibarr", $newobject->ref), "", 'mesgs');
|
||||
//var_dump($newobject); exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1261,7 +1261,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
document.formsoc.private.value=1;
|
||||
});
|
||||
|
||||
var canHaveCategoryIfNotCustomerProspectSupplier = ' . (empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT) ? '0' : '1') . ';
|
||||
var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . ';
|
||||
|
||||
init_customer_categ();
|
||||
$("#customerprospect").change(function() {
|
||||
|
|
@ -1269,7 +1269,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
});
|
||||
function init_customer_categ() {
|
||||
console.log("is customer or prospect = "+jQuery("#customerprospect").val());
|
||||
if (jQuery("#customerprospect").val() == 0 && !canHaveCategoryIfNotCustomerProspectSupplier)
|
||||
if (jQuery("#customerprospect").val() == 0 && !canHaveCustomerCategoryIfNotCustomerProspect)
|
||||
{
|
||||
jQuery(".visibleifcustomer").hide();
|
||||
}
|
||||
|
|
@ -2124,7 +2124,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
}
|
||||
});
|
||||
|
||||
var canHaveCategoryIfNotCustomerProspectSupplier = ' . (empty($conf->global->THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT) ? '0' : '1') . ';
|
||||
var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . ';
|
||||
|
||||
init_customer_categ();
|
||||
$("#customerprospect").change(function() {
|
||||
|
|
@ -2132,7 +2132,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
});
|
||||
function init_customer_categ() {
|
||||
console.log("is customer or prospect = "+jQuery("#customerprospect").val());
|
||||
if (jQuery("#customerprospect").val() == 0 && !canHaveCategoryIfNotCustomerProspectSupplier)
|
||||
if (jQuery("#customerprospect").val() == 0 && !canHaveCustomerCategoryIfNotCustomerProspect)
|
||||
{
|
||||
jQuery(".visibleifcustomer").hide();
|
||||
}
|
||||
|
|
@ -3016,7 +3016,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
// Tags / categories
|
||||
if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
|
||||
// Customer
|
||||
if ($object->prospect || $object->client || !empty($conf->global->THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT)) {
|
||||
if ($object->prospect || $object->client || getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT')) {
|
||||
print '<tr><td>'.$langs->trans("CustomersCategoriesShort").'</td>';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, Categorie::TYPE_CUSTOMER, 1);
|
||||
|
|
|
|||
|
|
@ -3061,6 +3061,7 @@ class Societe extends CommonObject
|
|||
$sql = "SELECT rowid, email, statut as status, phone_mobile, lastname, poste, firstname";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople";
|
||||
$sql .= " WHERE fk_soc = ".((int) $this->id);
|
||||
$sql .= " AND entity IN (".getEntity($this->element).")";
|
||||
$sql .= " ORDER BY lastname, firstname";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
|
|
|||
|
|
@ -1856,8 +1856,8 @@ while ($i < $imaxinloop) {
|
|||
// Parent company
|
||||
if (!empty($arrayfields['s2.nom']['checked'])) {
|
||||
print '<td class="center tdoverflowmax100">';
|
||||
if ($companystatic->fk_parent > 0) {
|
||||
$companyparent->fetch($companystatic->fk_parent);
|
||||
if ($companystatic->parent > 0) {
|
||||
$companyparent->fetch($companystatic->parent);
|
||||
print $companyparent->getNomUrl(1);
|
||||
}
|
||||
print "</td>";
|
||||
|
|
|
|||
|
|
@ -77,8 +77,16 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
|||
$manifest->short_name = $manifest->name;
|
||||
|
||||
|
||||
$manifest->theme_color = empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR) ? getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40') : $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR;
|
||||
$manifest->background_color = empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR) ? "#ffffff" : $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR;
|
||||
$manifest->theme_color = getDolGlobalString('MAIN_MANIFEST_APPLI_THEME_COLOR', getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40'));
|
||||
if (!preg_match('/#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]$/', $manifest->theme_color)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$manifest->theme_color = '#'.colorArrayToHex(colorStringToArray($manifest->theme_color));
|
||||
}
|
||||
$manifest->background_color = getDolGlobalString('MAIN_MANIFEST_APPLI_BG_COLOR', "#ffffff");
|
||||
if (!preg_match('/#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]$/', $manifest->background_color)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$manifest->background_color = '#'.colorArrayToHex(colorStringToArray($manifest->background_color));
|
||||
}
|
||||
$manifest->display = "standalone";
|
||||
$manifest->splash_pages = null;
|
||||
$manifest->icons = array();
|
||||
|
|
|
|||
|
|
@ -75,6 +75,16 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
|||
}
|
||||
$manifest->short_name = $manifest->name;
|
||||
|
||||
$manifest->theme_color = getDolGlobalString('MAIN_MANIFEST_APPLI_THEME_COLOR', getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40'));
|
||||
if (!preg_match('/#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]$/', $manifest->theme_color)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$manifest->theme_color = '#'.colorArrayToHex(colorStringToArray($manifest->theme_color));
|
||||
}
|
||||
$manifest->background_color = getDolGlobalString('MAIN_MANIFEST_APPLI_BG_COLOR', "#ffffff");
|
||||
if (!preg_match('/#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]$/', $manifest->background_color)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$manifest->background_color = '#'.colorArrayToHex(colorStringToArray($manifest->background_color));
|
||||
}
|
||||
$manifest->theme_color = empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR) ? getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40') : $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR;
|
||||
$manifest->background_color = empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR) ? "#ffffff" : $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR;
|
||||
$manifest->display = "standalone";
|
||||
|
|
|
|||
|
|
@ -175,8 +175,8 @@ if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST(
|
|||
$sanit_features[$explode[0]] = $explode[1];
|
||||
|
||||
$tmp = new ProductCombination2ValuePair($db);
|
||||
$tmp->fk_prod_attr = $explode[0];
|
||||
$tmp->fk_prod_attr_val = $explode[1];
|
||||
$tmp->fk_prod_attr = (int) $explode[0];
|
||||
$tmp->fk_prod_attr_val = (int) $explode[1];
|
||||
|
||||
$productCombination2ValuePairs1[] = $tmp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2704,6 +2704,10 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
|||
|
||||
// Add the entry Sitemap: into the robot.txt file.
|
||||
$robotcontent = @file_get_contents($filerobot);
|
||||
$result = preg_replace('/<?php \/\/ BEGIN PHP[^?]END PHP ?>\n/ims', '', $robotcontent);
|
||||
if ($result) {
|
||||
$robotcontent = $result;
|
||||
}
|
||||
$robotsitemap = "Sitemap: ".$domainname."/".$xmlname;
|
||||
$result = strpos($robotcontent, 'Sitemap: ');
|
||||
if ($result) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue