forked from Wavyzz/dolibarr
Merge pull request #1595 from FHenry/develop
Add showempty into combobox
This commit is contained in:
@@ -203,7 +203,7 @@ if ($action == 'add_action')
|
||||
$action = 'create';
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")).'</div>';
|
||||
}
|
||||
if (! empty($datea) && GETPOST('percentage') == 0)
|
||||
if (! empty($datep) && GETPOST('percentage') == 0)
|
||||
{
|
||||
$error++;
|
||||
$action = 'create';
|
||||
|
||||
@@ -105,7 +105,7 @@ $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||
llxHeader('',$langs->trans("ThirdParty"),$help_url);
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
|
||||
$sql.= " s.datec, s.datea, s.canvas";
|
||||
$sql.= " s.datec, s.canvas";
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; // We need this table joined to the select in order to filter by categ
|
||||
|
||||
@@ -177,7 +177,7 @@ if ($action == 'cstc')
|
||||
$formother=new FormOther($db);
|
||||
$form=new Form($db);
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.datea, s.status as status, s.code_client, s.client,";
|
||||
$sql = "SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,";
|
||||
$sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,";
|
||||
$sql.= " d.nom as departement";
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
|
||||
@@ -32,6 +32,7 @@ require '../../main.inc.php';
|
||||
$id = GETPOST('id','int');
|
||||
$action = GETPOST('action','alpha');
|
||||
$htmlname = GETPOST('htmlname','alpha');
|
||||
$showempty = GETPOST('showempty','int');
|
||||
|
||||
/*
|
||||
* View
|
||||
@@ -47,8 +48,9 @@ if (! empty($id) && ! empty($action) && ! empty($htmlname))
|
||||
$form = new Form($db);
|
||||
|
||||
$return=array();
|
||||
if (empty($showempty)) $showempty=0;
|
||||
|
||||
$return['value'] = $form->selectcontacts($id,'','contactid',0,'','',0,'',true);
|
||||
$return['value'] = $form->selectcontacts($id,'','contactid',$showempty,'','',0,'',true);
|
||||
$return['num'] = $form->num;
|
||||
$return['error'] = $form->error;
|
||||
|
||||
|
||||
@@ -742,7 +742,7 @@ class Translate
|
||||
* @param string $currency_code Get only currency. Get all if ''.
|
||||
* @return int Nb of loaded lines, 0 if already loaded, <0 if KO
|
||||
*/
|
||||
private function load_cache_currencies($currency_code)
|
||||
public function load_cache_currencies($currency_code)
|
||||
{
|
||||
global $db;
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ class DoliDBPgsql extends DoliDB
|
||||
static $versionmin=array(8,4,0); // Version min database
|
||||
//! Resultset of last query
|
||||
private $_results;
|
||||
|
||||
public $unescapeslashquot;
|
||||
public $standard_conforming_strings;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
||||
@@ -348,11 +348,13 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0)
|
||||
var method = obj.method;
|
||||
var url = obj.url;
|
||||
var htmlname = obj.htmlname;
|
||||
var showempty = obj.showempty;
|
||||
$.getJSON(url,
|
||||
{
|
||||
action: method,
|
||||
id: id,
|
||||
htmlname: htmlname
|
||||
htmlname: htmlname,
|
||||
showempty: showempty
|
||||
},
|
||||
function(response) {
|
||||
$.each(obj.params, function(key,action) {
|
||||
|
||||
@@ -227,7 +227,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
||||
// Ecrase $pu par celui du produit
|
||||
// Ecrase $desc par celui du produit
|
||||
// Ecrase $txtva par celui du produit
|
||||
if (GETPOST('prod_entry_mode') != 'free') // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or ''
|
||||
if ((GETPOST('prod_entry_mode') != 'free') && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or ''
|
||||
{
|
||||
$idprod=0;
|
||||
$productsupplier = new ProductFournisseur($db);
|
||||
@@ -285,7 +285,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
||||
setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors');
|
||||
}
|
||||
}
|
||||
else if( GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='' )
|
||||
else if((GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') && empty($error))
|
||||
{
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
$pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
|
||||
|
||||
@@ -233,7 +233,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
* List last modified supliers
|
||||
*/
|
||||
$max=10;
|
||||
$sql = "SELECT s.rowid as socid, s.nom, s.town, s.datec, s.datea, s.tms, s.prefix_comm, s.code_fournisseur, s.code_compta_fournisseur";
|
||||
$sql = "SELECT s.rowid as socid, s.nom, s.town, s.datec, s.tms, s.prefix_comm, s.code_fournisseur, s.code_compta_fournisseur";
|
||||
$sql.= ", st.libelle as stcomm";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
|
||||
|
||||
@@ -78,7 +78,7 @@ $thirdpartystatic=new Societe($db);
|
||||
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||
llxHeader('',$langs->trans("ThirdParty"),$help_url);
|
||||
|
||||
$sql = "SELECT s.rowid as socid, s.nom, s.zip, s.town, s.datec, s.datea, st.libelle as stcomm, s.prefix_comm, s.status as status, ";
|
||||
$sql = "SELECT s.rowid as socid, s.nom, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, ";
|
||||
$sql.= "code_fournisseur, code_compta_fournisseur";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -445,7 +445,7 @@ class Address
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
$sql = "SELECT s.rowid, s.nom, datec as date_creation, datea as date_modification,";
|
||||
$sql = "SELECT s.rowid, s.nom, datec as date_creation, tms as date_modification,";
|
||||
$sql.= " fk_user_creat, fk_user_modif";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " WHERE s.rowid = ".$id;
|
||||
|
||||
@@ -187,7 +187,7 @@ if ($socname)
|
||||
*/
|
||||
$title=$langs->trans("ListOfThirdParties");
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.barcode, s.town, s.datec, s.datea, s.code_client, s.code_fournisseur, ";
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.barcode, s.town, s.datec, s.code_client, s.code_fournisseur, ";
|
||||
$sql.= " st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
|
||||
$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4";
|
||||
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
|
||||
Reference in New Issue
Block a user