Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts: htdocs/core/modules/commande/doc/pdf_einstein.modules.php htdocs/core/modules/facture/doc/pdf_crabe.modules.php htdocs/core/modules/propale/doc/pdf_azur.modules.php
This commit is contained in:
commit
8d54df4263
@ -65,6 +65,8 @@ class DolibarrApi
|
||||
|
||||
$this->r->setBaseUrls($urlwithouturlroot, $urlwithouturlrootautodetect);
|
||||
$this->r->setAPIVersion(1);
|
||||
//$this->r->setSupportedFormats('json');
|
||||
//$this->r->setSupportedFormats('jsonFormat');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -78,6 +78,7 @@ $search_categ_cus=trim(GETPOST("search_categ_cus",'int'));
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
$billed = GETPOST('billed','int');
|
||||
$viewstatut=GETPOST('viewstatut');
|
||||
$search_project_ref=GETPOST('search_project_ref','alpha');
|
||||
|
||||
// Security check
|
||||
$id = (GETPOST('orderid')?GETPOST('orderid','int'):GETPOST('id','int'));
|
||||
|
||||
@ -424,25 +424,25 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
if ($triggername == 'SOCIETE_SENTBYMAIL') $triggername = 'COMPANY_SENTBYEMAIL';
|
||||
if ($triggername == 'CONTRAT_SENTBYMAIL') $triggername = 'CONTRACT_SENTBYEMAIL';
|
||||
if ($triggername == 'COMMANDE_SENTBYMAIL') $triggername = 'ORDER_SENTBYEMAIL';
|
||||
if ($triggername == 'FACTURE_SENTBYMAIL') $triggername = 'BILL_SENTBYEMAIL';
|
||||
if ($triggername == 'FACTURE_SENTBYMAIL') $triggername = 'BILL_SENTBYMAIL';
|
||||
if ($triggername == 'EXPEDITION_SENTBYMAIL') $triggername = 'SHIPPING_SENTBYEMAIL';
|
||||
if ($triggername == 'COMMANDEFOURNISSEUR_SENTBYMAIL') $triggername = 'ORDER_SUPPLIER_SENTBYMAIL';
|
||||
if ($triggername == 'FACTUREFOURNISSEUR_SENTBYMAIL') $triggername = 'BILL_SUPPLIER_SENTBYEMAIL';
|
||||
if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') $triggername = 'PROPOSAL_SUPPLIER_SENTBYEMAIL';
|
||||
|
||||
if (! empty($trigger_name))
|
||||
if (! empty($triggername))
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers($trigger_name, $objectobj, $user, $langs, $conf);
|
||||
$result=$interface->run_triggers($triggername, $objectobj, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
if ($error)
|
||||
{
|
||||
setEventMessages($db->lasterror(), $errors, 'errors');
|
||||
dol_syslog("Error in trigger ".$trigger_name.' '.$db->lasterror(), LOG_ERR);
|
||||
dol_syslog("Error in trigger ".$triggername.' '.$db->lasterror(), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6883,7 +6883,7 @@ abstract class CommonObject
|
||||
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]='';
|
||||
|
||||
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
|
||||
if ($this->fields[$key]['notnull'] == 1 && ! isset($values[$key]) && is_null($val['default']))
|
||||
if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && ! isset($values[$key]) && is_null($val['default']))
|
||||
{
|
||||
$error++;
|
||||
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
|
||||
|
||||
@ -744,6 +744,7 @@ class ExtraFields
|
||||
|
||||
if ($elementtype == 'thirdparty') $elementtype='societe';
|
||||
if ($elementtype == 'contact') $elementtype='socpeople';
|
||||
if ($elementtype == 'order_supplier') $elementtype='commande_fournisseur';
|
||||
|
||||
$array_name_label=array();
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -405,7 +405,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
$tab_top -= 2;
|
||||
|
||||
$substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object);
|
||||
$substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
|
||||
@ -957,6 +957,7 @@ if ($action == 'create')
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$projectid = GETPOST('projectid','int')?GETPOST('projectid','int'):0;
|
||||
if(empty($projectid) && ! empty($object->fk_project)) $projectid = $object->fk_project;
|
||||
if ($origin == 'project') $projectid = ($originid ? $originid : 0);
|
||||
|
||||
$langs->load("projects");
|
||||
|
||||
@ -69,7 +69,6 @@ $mode=GETPOST("mode");
|
||||
|
||||
$search_all = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||
$search_label = GETPOST("search_label","alpha");
|
||||
$search_company = GETPOST("search_company","alpha");
|
||||
$search_amount_no_tax = GETPOST("search_amount_no_tax","alpha");
|
||||
$search_amount_all_tax = GETPOST("search_amount_all_tax","alpha");
|
||||
$search_product_category=GETPOST('search_product_category','int');
|
||||
@ -77,7 +76,7 @@ $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','al
|
||||
$search_refsupplier=GETPOST('search_refsupplier','alpha');
|
||||
$search_type=GETPOST('search_type','int');
|
||||
$search_project=GETPOST('search_project','alpha');
|
||||
$search_societe=GETPOST('search_societe','alpha');
|
||||
$search_company=GETPOST('search_company','alpha');
|
||||
$search_montant_ht=GETPOST('search_montant_ht','alpha');
|
||||
$search_montant_vat=GETPOST('search_montant_vat','alpha');
|
||||
$search_montant_localtax1=GETPOST('search_montant_localtax1','alpha');
|
||||
@ -203,7 +202,6 @@ if (empty($reshook))
|
||||
$search_type="";
|
||||
$search_label="";
|
||||
$search_project='';
|
||||
$search_societe="";
|
||||
$search_company="";
|
||||
$search_amount_no_tax="";
|
||||
$search_amount_all_tax="";
|
||||
@ -315,13 +313,12 @@ if ($search_type != '' && $search_type >= 0)
|
||||
//if ($search_type == '5') $sql.=" AND f.type = 5"; // situation
|
||||
}
|
||||
if ($search_project) $sql .= natural_search('p.ref', $search_project);
|
||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||
if ($search_town) $sql.= natural_search('s.town', $search_town);
|
||||
if ($search_zip) $sql.= natural_search("s.zip",$search_zip);
|
||||
if ($search_state) $sql.= natural_search("state.nom",$search_state);
|
||||
if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
|
||||
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
|
||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||
if ($search_montant_ht != '') $sql.= natural_search('f.total_ht', $search_montant_ht, 1);
|
||||
if ($search_montant_vat != '') $sql.= natural_search('f.total_tva', $search_montant_vat, 1);
|
||||
if ($search_montant_localtax1 != '') $sql.= natural_search('f.localtax1', $search_montant_localtax1, 1);
|
||||
@ -431,7 +428,7 @@ if ($resql)
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($socid);
|
||||
if (empty($search_societe)) $search_societe = $soc->name;
|
||||
if (empty($search_company)) $search_company = $soc->name;
|
||||
}
|
||||
|
||||
$param='&socid='.$socid;
|
||||
@ -665,7 +662,7 @@ if ($resql)
|
||||
// Thirpdarty
|
||||
if (! empty($arrayfields['s.nom']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_societe" value="'.$search_societe.'"></td>';
|
||||
print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'"></td>';
|
||||
}
|
||||
// Town
|
||||
if (! empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.dol_escape_htmltag($search_town).'"></td>';
|
||||
|
||||
@ -289,6 +289,9 @@ if ($type_element == 'contract')
|
||||
$thirdTypeSelect='customer';
|
||||
}
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
|
||||
if (!empty($sql_select))
|
||||
{
|
||||
$sql = $sql_select;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user