Skip to content

Commit

Permalink
Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	dev/skeletons/build_class_from_table.php
	htdocs/compta/facture.php
	htdocs/core/class/html.form.class.php
  • Loading branch information
eldy committed May 29, 2017
2 parents 84a3cbb + b22817c commit e667d72
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 52 deletions.
1 change: 1 addition & 0 deletions htdocs/.gitignore
Expand Up @@ -4,6 +4,7 @@
/dolimed*
/ecommerce*
/extensions*
/forceproject*
/google*
/lead
/multicompany*
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/supplier_proposal.php
Expand Up @@ -274,7 +274,7 @@

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);

Expand Down
9 changes: 5 additions & 4 deletions htdocs/compta/facture/card.php
Expand Up @@ -1405,7 +1405,7 @@
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
$price_ht = GETPOST('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')
{
$idprod=0;
Expand Down Expand Up @@ -2483,7 +2483,8 @@
else
{
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.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
Expand Down Expand Up @@ -3909,12 +3910,12 @@
if ($object->situation_cycle_ref && $object->statut == 0) {
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="action" value="updatealllines" />';
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">';

Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/fiche-rec.php
Expand Up @@ -141,7 +141,7 @@
if (GETPOST('cancel')) $action='';

// 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

Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -397,8 +397,8 @@ function getFullName($langs,$option=0,$nameorder=-1,$maxlen=0)
//print "lastname=".$this->lastname." name=".$this->name." nom=".$this->nom."<br>\n";
$lastname=$this->lastname;
$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='';
if ($option && $this->civility_id)
{
Expand Down
32 changes: 18 additions & 14 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -577,16 +577,16 @@ function initCheckForSelect()
jQuery(".massaction").hide();
}
}
jQuery(document).ready(function () {
initCheckForSelect();
jQuery(".checkforselect").click(function() {
initCheckForSelect();
});
jQuery(".massactionselect").change(function() {
var massaction = $( this ).val();
var massaction = $( this ).val();
var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
if (massaction == "builddoc")
if (massaction == "builddoc")
{
urlform = urlform + "#show_files";
}
Expand Down Expand Up @@ -989,7 +989,7 @@ function select_company($selected='', $htmlname='socid', $filter='', $showempty=
$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">
.ui-autocomplete {
z-index: 150;
z-index: 250;
}
</style>';
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
Expand Down Expand Up @@ -1034,7 +1034,7 @@ function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showe
{
global $conf,$user,$langs;

$out='';
$out='';
$num=0;
$outarray=array();

Expand Down Expand Up @@ -1076,8 +1076,6 @@ function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showe
$resql=$this->db->query($sql);
if ($resql)
{
$events = null;

if ($conf->use_javascript_ajax && ! $forcecombo)
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
Expand Down Expand Up @@ -4178,7 +4176,7 @@ function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter
}
print '</div>';
}
if ($more)
if ($more)
{
print '<div class="inline-block">';
print $more;
Expand Down Expand Up @@ -5017,10 +5015,16 @@ function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select',
* @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 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 int $disablebademail Check if an email is found into value and if not disable and colorize entry
* @param int $nohtmlescape No html escaping.
* @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
*/
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)
Expand Down Expand Up @@ -5594,7 +5598,7 @@ function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinkst
{
$listofidcompanytoscan=$object->thirdparty->id;
if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent;

$possiblelinks=array(
'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal',1).')'),
'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande',1).')'),
Expand All @@ -5606,7 +5610,7 @@ function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinkst
'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture_fourn',1).')')
);
}

global $action;

// Can complete the possiblelink array
Expand Down Expand Up @@ -5845,7 +5849,7 @@ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$f

//print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix);

$navurl = $_SERVER["PHP_SELF"];
// Special case for project/task page
if ($paramid == 'project_ref')
Expand Down Expand Up @@ -5902,11 +5906,11 @@ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$f
}
else if (in_array($object->element, array('action', 'agenda')))
{
$ret.=$object->ref.'<br>'.$object->label;
$ret.=$object->ref.'<br>'.$object->label;
}
else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref);


if ($morehtmlref)
{
$ret.=' '.$morehtmlref;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/company.lib.php
Expand Up @@ -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) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
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).")";
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;
Expand Down
3 changes: 3 additions & 0 deletions htdocs/core/lib/functions.lib.php
Expand Up @@ -406,6 +406,9 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
case 'int':
if (! is_numeric($out)) { $out=''; }
break;
case 'intcomma':
if (preg_match('/[^0-9,]+/i',$out)) $out='';
break;
case 'alpha':
$out=trim($out);
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
Expand Down
10 changes: 3 additions & 7 deletions htdocs/resource/list.php
Expand Up @@ -91,15 +91,11 @@
if (empty($sortfield)) $sortfield="t.rowid";
if (empty($arch)) $arch = 0;

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

Expand Down
4 changes: 2 additions & 2 deletions htdocs/theme/eldy/style.css.php
Expand Up @@ -956,7 +956,7 @@
}
.side-nav {
position: absolute;
z-index: 200;
z-index: 90;
display: none;
}
div.blockvmenulogo
Expand Down Expand Up @@ -4133,7 +4133,7 @@
/* ============================================================================== */

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 {
margin:0px;
Expand Down
8 changes: 4 additions & 4 deletions htdocs/theme/md/style.css.php
Expand Up @@ -943,7 +943,7 @@
position: fixed;
top: 50px;
<?php } ?>
z-index: 200;
z-index: 90;
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
Expand Down Expand Up @@ -1000,7 +1000,7 @@

position: auto;
top: auto;
z-index: 200;
z-index: 90;
}
div.login_block {
/* position: initial !important;*/
Expand All @@ -1010,7 +1010,7 @@
padding-left: 0 ! important;
}
#id-left {
z-index: 201;
z-index: 91;
background: #FFF;
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))) { ?>
Expand Down Expand Up @@ -4224,7 +4224,7 @@
/* ============================================================================== */

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 {
margin:0px;
Expand Down
20 changes: 12 additions & 8 deletions htdocs/user/class/usergroup.class.php
Expand Up @@ -69,7 +69,7 @@ function __construct($db)


/**
* 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 string $groupname name du groupe a charger
Expand Down Expand Up @@ -336,16 +336,16 @@ function addrights($rid,$allmodule='',$allperms='')
$error++;
dol_print_error($this->db);
}

if (! $error)
{
$this->context = array('audit'=>$langs->trans("PermissionsAdd"));

// Call trigger
$result=$this->call_trigger('GROUP_MODIFY',$user);
if ($result < 0) { $error++; }
// End call triggers
}
}
}

if ($error) {
Expand Down Expand Up @@ -445,11 +445,11 @@ function delrights($rid,$allmodule='',$allperms='')
$error++;
dol_print_error($this->db);
}

if (! $error)
{
$this->context = array('audit'=>$langs->trans("PermissionsDelete"));

// Call trigger
$result=$this->call_trigger('GROUP_MODIFY',$user);
if ($result < 0) { $error++; }
Expand Down Expand Up @@ -815,7 +815,7 @@ function _load_ldap_info()
$muser=new User($this->db);
$muser->fetch($val->id);
$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:'');
}
Expand Down Expand Up @@ -843,7 +843,11 @@ function initAsSpecimen()
$this->note='This is a note';
$this->datec=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
);
}

/**
Expand Down
16 changes: 8 additions & 8 deletions htdocs/user/index.php
Expand Up @@ -119,9 +119,9 @@
$search_employee=GETPOST('search_employee','alpha');
$search_accountancy_code=GETPOST('search_accountancy_code','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_supervisor=GETPOST('search_supervisor','alpha');
$search_supervisor=GETPOST('search_supervisor','intcomma');
$search_previousconn=GETPOST('search_previousconn','alpha');
$optioncss = GETPOST('optioncss','alpha');

Expand All @@ -148,7 +148,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';

// 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_login="";
Expand Down Expand Up @@ -204,8 +204,8 @@
}
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_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor;
if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty);
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_login != '') $sql.= natural_search("u.login", $search_login);
if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname);
if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname);
Expand All @@ -214,9 +214,9 @@
$sql .= ' AND u.employee = '.(int) $search_employee;
}
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_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")";
if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall);
if ($search_email != '') $sql.= natural_search("u.email", $search_email);
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND u.statut IN (".$db->escape($search_statut).")";
if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall);
// Add where from extra fields
foreach ($search_array_options as $key => $val)
{
Expand Down

0 comments on commit e667d72

Please sign in to comment.