Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	dev/skeletons/build_class_from_table.php
	htdocs/compta/facture.php
	htdocs/core/class/html.form.class.php
This commit is contained in:
Laurent Destailleur 2017-05-29 10:41:51 +02:00
commit e667d72547
13 changed files with 61 additions and 52 deletions

1
htdocs/.gitignore vendored
View File

@ -4,6 +4,7 @@
/dolimed* /dolimed*
/ecommerce* /ecommerce*
/extensions* /extensions*
/forceproject*
/google* /google*
/lead /lead
/multicompany* /multicompany*

View File

@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir)
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (substr($file, 0, 21) == 'mod_supplier_proposal_' && substr($file, dol_strlen($file)-3, 3) == 'php') if (substr($file, 0, 22) == 'mod_supplier_proposal_' && substr($file, dol_strlen($file)-3, 3) == 'php')
{ {
$file = substr($file, 0, dol_strlen($file)-4); $file = substr($file, 0, dol_strlen($file)-4);

View File

@ -1405,7 +1405,7 @@ if (empty($reshook))
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
$price_ht = GETPOST('price_ht'); $price_ht = GETPOST('price_ht');
$price_ht_devise = GETPOST('multicurrency_price_ht'); $price_ht_devise = GETPOST('multicurrency_price_ht');
$prod_entry_mode = GETPOST('prod_entry_mode'); $prod_entry_mode = GETPOST('prod_entry_mode','alpha');
if ($prod_entry_mode == 'free') if ($prod_entry_mode == 'free')
{ {
$idprod=0; $idprod=0;
@ -2483,7 +2483,8 @@ if ($action == 'create')
else else
{ {
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp='<input type="radio" name="type" id="radio_creditnote" value="0" disabled> '; if (empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) $tmp='<input type="radio" name="type" id="radio_creditnote" value="0" disabled> ';
else $tmp='<input type="radio" name="type" id="radio_creditnote" value="2" > ';
$text = $tmp.$langs->trans("InvoiceAvoir") . ' '; $text = $tmp.$langs->trans("InvoiceAvoir") . ' ';
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
@ -3909,12 +3910,12 @@ else if ($id > 0 || ! empty($ref))
if ($object->situation_cycle_ref && $object->statut == 0) { if ($object->situation_cycle_ref && $object->statut == 0) {
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<form name="updatealllines" id="updatealllines" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '"#updatealllines" method="POST">'; print '<form name="updatealllines" id="updatealllines" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '#updatealllines" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '" />'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '" />';
print '<input type="hidden" name="action" value="updatealllines" />'; print '<input type="hidden" name="action" value="updatealllines" />';
print '<input type="hidden" name="id" value="' . $object->id . '" />'; print '<input type="hidden" name="id" value="' . $object->id . '" />';
print '<table id="tablelines" class="noborder noshadow" width="100%">'; print '<table id="tablelines_all_progress" class="noborder noshadow" width="100%">';
print '<tr class="liste_titre nodrag nodrop">'; print '<tr class="liste_titre nodrag nodrop">';

View File

@ -141,7 +141,7 @@ if (empty($reshook))
if (GETPOST('cancel')) $action=''; if (GETPOST('cancel')) $action='';
// Set note // Set note
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once

View File

@ -397,7 +397,7 @@ abstract class CommonObject
//print "lastname=".$this->lastname." name=".$this->name." nom=".$this->nom."<br>\n"; //print "lastname=".$this->lastname." name=".$this->name." nom=".$this->nom."<br>\n";
$lastname=$this->lastname; $lastname=$this->lastname;
$firstname=$this->firstname; $firstname=$this->firstname;
if (empty($lastname)) $lastname=(isset($this->lastname)?$this->lastname:(isset($this->name)?$this->name:(isset($this->nom)?$this->nom:''))); if (empty($lastname)) $lastname=(isset($this->lastname)?$this->lastname:(isset($this->name)?$this->name:(isset($this->nom)?$this->nom:(isset($this->societe)?$this->societe:(isset($this->company)?$this->company:'')))));
$ret=''; $ret='';
if ($option && $this->civility_id) if ($option && $this->civility_id)

View File

@ -989,7 +989,7 @@ class Form
$out.= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); $out.= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
$out.='<style type="text/css"> $out.='<style type="text/css">
.ui-autocomplete { .ui-autocomplete {
z-index: 150; z-index: 250;
} }
</style>'; </style>';
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : '; if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
@ -1076,8 +1076,6 @@ class Form
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
$events = null;
if ($conf->use_javascript_ajax && ! $forcecombo) if ($conf->use_javascript_ajax && ! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
@ -5017,10 +5015,16 @@ class Form
* @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order * @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order
* @param string $morecss Add more class to css styles * @param string $morecss Add more class to css styles
* @param int $addjscombo Add js combo * @param int $addjscombo Add js combo
<<<<<<< HEAD
* @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set
* @param int $disablebademail Check if an email is found into value and if not disable and colorize entry * @param int $disablebademail Check if an email is found into value and if not disable and colorize entry
* @param int $nohtmlescape No html escaping. * @param int $nohtmlescape No html escaping.
* @return string HTML select string * @return string HTML select string
=======
* @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set.
* @param int $disablebademail Check if an email is found into value and if not disable and colorize entry.
* @return string HTML select string.
>>>>>>> branch '5.0' of git@github.com:Dolibarr/dolibarr.git
* @see multiselectarray * @see multiselectarray
*/ */
static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='',$disablebademail=0, $nohtmlescape=0) static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='',$disablebademail=0, $nohtmlescape=0)

View File

@ -1064,7 +1064,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
$sql.= " WHERE u.rowid = a.fk_user_author"; $sql.= " WHERE u.rowid = a.fk_user_action";
$sql.= " AND a.entity IN (".getEntity('agenda', 1).")"; $sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;

View File

@ -406,6 +406,9 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
case 'int': case 'int':
if (! is_numeric($out)) { $out=''; } if (! is_numeric($out)) { $out=''; }
break; break;
case 'intcomma':
if (preg_match('/[^0-9,]+/i',$out)) $out='';
break;
case 'alpha': case 'alpha':
$out=trim($out); $out=trim($out);
// '"' is dangerous because param in url can close the href= or src= and add javascript functions. // '"' is dangerous because param in url can close the href= or src= and add javascript functions.

View File

@ -91,15 +91,11 @@ if (empty($sortorder)) $sortorder="ASC";
if (empty($sortfield)) $sortfield="t.rowid"; if (empty($sortfield)) $sortfield="t.rowid";
if (empty($arch)) $arch = 0; if (empty($arch)) $arch = 0;
$page = GETPOST('page','int'); $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
if ($page == -1) { $page = GETPOST("page");
$page = 0 ;
}
$page = is_numeric($page) ? $page : 0; $page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page; $page = $page == -1 ? 0 : $page;
if (! $sortfield) $sortfield="p.ref"; $offset = $limit * $page ;
if (! $sortorder) $sortorder="ASC";
$offset = $conf->liste_limit * $page ;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -956,7 +956,7 @@ div.vmenu, td.vmenu {
} }
.side-nav { .side-nav {
position: absolute; position: absolute;
z-index: 200; z-index: 90;
display: none; display: none;
} }
div.blockvmenulogo div.blockvmenulogo
@ -4133,7 +4133,7 @@ span.noborderoncategories {
/* ============================================================================== */ /* ============================================================================== */
ul.ulselectedfields { ul.ulselectedfields {
z-index: 100; /* To have the select box appears on first plan even when near buttons are decorated by jmobile */ z-index: 95; /* To have the select box appears on first plan even when near buttons are decorated by jmobile */
} }
dl.dropdown { dl.dropdown {
margin:0px; margin:0px;

View File

@ -943,7 +943,7 @@ td.showDragHandle {
position: fixed; position: fixed;
top: 50px; top: 50px;
<?php } ?> <?php } ?>
z-index: 200; z-index: 90;
-webkit-transform: translateZ(0); -webkit-transform: translateZ(0);
-moz-transform: translateZ(0); -moz-transform: translateZ(0);
-ms-transform: translateZ(0); -ms-transform: translateZ(0);
@ -1000,7 +1000,7 @@ div.login_block {
position: auto; position: auto;
top: auto; top: auto;
z-index: 200; z-index: 90;
} }
div.login_block { div.login_block {
/* position: initial !important;*/ /* position: initial !important;*/
@ -1010,7 +1010,7 @@ div.login_block {
padding-left: 0 ! important; padding-left: 0 ! important;
} }
#id-left { #id-left {
z-index: 201; z-index: 91;
background: #FFF; background: #FFF;
border-right: 1px solid rgba(0,0,0,0.3); border-right: 1px solid rgba(0,0,0,0.3);
<?php if (in_array($conf->browser->layout, array('phone','tablet')) && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?> <?php if (in_array($conf->browser->layout, array('phone','tablet')) && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
@ -4224,7 +4224,7 @@ span.noborderoncategories {
/* ============================================================================== */ /* ============================================================================== */
ul.ulselectedfields { ul.ulselectedfields {
z-index: 100; /* To have the select box appears on first plan even when near buttons are decorated by jmobile */ z-index: 90; /* To have the select box appears on first plan even when near buttons are decorated by jmobile */
} }
dl.dropdown { dl.dropdown {
margin:0px; margin:0px;

View File

@ -69,7 +69,7 @@ class UserGroup extends CommonObject
/** /**
* Charge un objet group avec toutes ces caracteristiques (excpet ->members array) * Charge un objet group avec toutes ces caracteristiques (except ->members array)
* *
* @param int $id id du groupe a charger * @param int $id id du groupe a charger
* @param string $groupname name du groupe a charger * @param string $groupname name du groupe a charger
@ -815,7 +815,7 @@ class UserGroup extends CommonObject
$muser=new User($this->db); $muser=new User($this->db);
$muser->fetch($val->id); $muser->fetch($val->id);
$info2 = $muser->_load_ldap_info(); $info2 = $muser->_load_ldap_info();
$valueofldapfield[] = $muser->_load_ldap_dn($info2); $valueofldapfield[] = $muser->_load_ldap_dn($info2);
} }
$info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:''); $info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:'');
} }
@ -843,7 +843,11 @@ class UserGroup extends CommonObject
$this->note='This is a note'; $this->note='This is a note';
$this->datec=time(); $this->datec=time();
$this->datem=time(); $this->datem=time();
$this->members=array($user->id); // Members of this group is just me
// Members of this group is just me
$this->members=array(
$user->id => $user
);
} }
/** /**

View File

@ -119,9 +119,9 @@ $search_gender=GETPOST('search_gender','alpha');
$search_employee=GETPOST('search_employee','alpha'); $search_employee=GETPOST('search_employee','alpha');
$search_accountancy_code=GETPOST('search_accountancy_code','alpha'); $search_accountancy_code=GETPOST('search_accountancy_code','alpha');
$search_email=GETPOST('search_email','alpha'); $search_email=GETPOST('search_email','alpha');
$search_statut=GETPOST('search_statut','alpha'); $search_statut=GETPOST('search_statut','intcomma');
$search_thirdparty=GETPOST('search_thirdparty','alpha'); $search_thirdparty=GETPOST('search_thirdparty','alpha');
$search_supervisor=GETPOST('search_supervisor','alpha'); $search_supervisor=GETPOST('search_supervisor','intcomma');
$search_previousconn=GETPOST('search_previousconn','alpha'); $search_previousconn=GETPOST('search_previousconn','alpha');
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
@ -148,7 +148,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria // Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
{ {
$search_user=""; $search_user="";
$search_login=""; $search_login="";
@ -204,8 +204,8 @@ else
} }
if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid; if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid;
//if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); //if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user);
if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor; if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$db->escape($search_supervisor);
if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty); if ($search_thirdparty != '') $sql.= natural_search(array('s.nom'), $search_thirdparty);
if ($search_login != '') $sql.= natural_search("u.login", $search_login); if ($search_login != '') $sql.= natural_search("u.login", $search_login);
if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname);
if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname);
@ -214,9 +214,9 @@ if (is_numeric($search_employee) && $search_employee >= 0) {
$sql .= ' AND u.employee = '.(int) $search_employee; $sql .= ' AND u.employee = '.(int) $search_employee;
} }
if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code); if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code);
if ($search_email != '') $sql.= natural_search("u.email", $search_email); if ($search_email != '') $sql.= natural_search("u.email", $search_email);
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")"; if ($search_statut != '' && $search_statut >= 0) $sql.= " AND u.statut IN (".$db->escape($search_statut).")";
if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall); if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall);
// Add where from extra fields // Add where from extra fields
foreach ($search_array_options as $key => $val) foreach ($search_array_options as $key => $val)
{ {