Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarcet committed Sep 4, 2018
2 parents b658626 + 23f4e7c commit ba68a63
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 58 deletions.
35 changes: 24 additions & 11 deletions htdocs/adherents/list.php
Expand Up @@ -48,6 +48,7 @@
$search_ref=GETPOST("search_ref",'alpha');
$search_lastname=GETPOST("search_lastname",'alpha');
$search_firstname=GETPOST("search_firstname",'alpha');
$search_civility=GETPOST("search_civility",'alpha');
$search_login=GETPOST("search_login",'alpha');
$search_address=GETPOST("search_address",'alpha');
$search_zip=GETPOST("search_zip",'alpha');
Expand Down Expand Up @@ -105,6 +106,7 @@
if($db->type == 'pgsql') unset($fieldstosearchall['d.rowid']);
$arrayfields=array(
'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'd.civility'=>array('label'=>$langs->trans("Civility"), 'checked'=>0),
'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
Expand All @@ -121,7 +123,7 @@
'state.nom'=>array('label'=>$langs->trans("State"), 'checked'=>0),
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
/*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0),
'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/
'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/
'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>500),
'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
Expand Down Expand Up @@ -160,6 +162,7 @@
$search_ref="";
$search_lastname="";
$search_firstname="";
$search_civility="";
$search_login="";
$search_company="";
$search_type="";
Expand Down Expand Up @@ -203,7 +206,7 @@
$now=dol_now();

$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc,";
$sql.= " d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
$sql.= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
$sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,";
$sql.= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
$sql.= " t.libelle as type, t.subscription,";
Expand Down Expand Up @@ -234,6 +237,7 @@
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")";
else $sql.=" AND 1 = 2"; // Always wrong
}
if ($search_civility) $sql.= natural_search("d.civility", $search_civility);
if ($search_firstname) $sql.= natural_search("d.firstname", $search_firstname);
if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname);
if ($search_login) $sql.= natural_search("d.login", $search_login);
Expand Down Expand Up @@ -322,6 +326,7 @@
if ($statut != "") $param.="&statut=".urlencode($statut);
if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
if ($search_nom) $param.="&search_nom=".urlencode($search_nom);
if ($search_civility) $param.="&search_civility=".urlencode($search_civility);
if ($search_firstname) $param.="&search_firstname=".urlencode($search_firstname);
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
if ($search_login) $param.="&search_login=".urlencode($search_login);
Expand Down Expand Up @@ -427,37 +432,36 @@
print '<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>';
}

if (! empty($arrayfields['d.civility']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth25" type="text" name="search_civility" value="'.dol_escape_htmltag($search_civility).'"></td>';
}
if (! empty($arrayfields['d.firstname']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth50" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'"></td>';
}

if (! empty($arrayfields['d.lastname']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth50" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
}

if (! empty($arrayfields['d.company']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
}

if (! empty($arrayfields['d.login']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth50" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
}

if (! empty($arrayfields['d.morphy']['checked']))
{
print '<td class="liste_titre" align="left">';
print '</td>';
}

if (! empty($arrayfields['t.libelle']['checked']))
{
print '<td class="liste_titre">';
Expand Down Expand Up @@ -568,6 +572,7 @@
print '<tr class="liste_titre">';
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titre("ID",$_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'],$_SERVER["PHP_SELF"],'d.rowid','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'],$_SERVER["PHP_SELF"],'d.civility','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'],$_SERVER["PHP_SELF"],'d.firstname','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'],$_SERVER["PHP_SELF"],'d.lastname','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'],$_SERVER["PHP_SELF"],'d.societe','',$param,'',$sortfield,$sortorder);
Expand Down Expand Up @@ -605,6 +610,7 @@
$datefin=$db->jdate($obj->datefin);
$memberstatic->id=$obj->rowid;
$memberstatic->ref=$obj->rowid;
$memberstatic->civility_id=$obj->civility;
$memberstatic->lastname=$obj->lastname;
$memberstatic->firstname=$obj->firstname;
$memberstatic->statut=$obj->statut;
Expand All @@ -630,10 +636,17 @@
// Ref
if (! empty($arrayfields['d.ref']['checked']))
{
print "<td>";
print "<td>";
print $memberstatic->getNomUrl(-1, 0, 'card', 'ref');
print "</td>\n";
}
// Civility
if (! empty($arrayfields['d.civility']['checked']))
{
print "<td>";
print $obj->civility;
print "</td>\n";
}
// Firstname
if (! empty($arrayfields['d.firstname']['checked']))
{
Expand All @@ -658,12 +671,12 @@
// Login
if (! empty($arrayfields['d.login']['checked']))
{
print "<td>".$obj->login."</td>\n";
print "<td>".$obj->login."</td>\n";
}
// Moral/Physique
if (! empty($arrayfields['d.morphy']['checked']))
{
print "<td>".$memberstatic->getmorphylib($obj->morphy)."</td>\n";
print "<td>".$memberstatic->getmorphylib($obj->morphy)."</td>\n";
}
// Type label
if (! empty($arrayfields['t.libelle']['checked']))
Expand Down
86 changes: 43 additions & 43 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -3456,60 +3456,60 @@ function getNomUrl($withpicto=0, $option='', $max=0, $short=0, $notooltip=0, $sa
if (!$user->rights->commande->lire)
$option = 'nolink';

if ($option !== 'nolink')
{
// Add param to save lastsearch_values or not
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
}
if ($option !== 'nolink')
{
// Add param to save lastsearch_values or not
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
}

if ($short) return $url;
if ($short) return $url;

$label = '';
$label = '';

if ($user->rights->commande->lire) {
$label = '<u>'.$langs->trans("ShowOrder").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->total_tva)) {
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
}
if ($user->rights->commande->lire) {
$label = '<u>'.$langs->trans("ShowOrder").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->total_tva)) {
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
}
}

$linkclose='';
if (empty($notooltip) && $user->rights->commande->lire)
$linkclose='';
if (empty($notooltip) && $user->rights->commande->lire)
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowOrder");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.=' class="classfortooltip"';
$label=$langs->trans("ShowOrder");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.=' class="classfortooltip"';
}

$linkstart = '<a href="'.$url.'"';
$linkstart.=$linkclose.'>';
$linkend='</a>';
$linkstart = '<a href="'.$url.'"';
$linkstart.=$linkclose.'>';
$linkend='</a>';

if ($option === 'nolink') {
$linkstart = '';
$linkend = '';
}
if ($option === 'nolink') {
$linkstart = '';
$linkend = '';
}

$result .= $linkstart;
if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
if ($withpicto != 2) $result.= $this->ref;
$result .= $linkend;
$result .= $linkstart;
if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
if ($withpicto != 2) $result.= $this->ref;
$result .= $linkend;

return $result;
return $result;
}


Expand Down
8 changes: 5 additions & 3 deletions htdocs/compta/facture/class/facture.class.php
Expand Up @@ -57,12 +57,12 @@ class Facture extends CommonInvoice
* @var string ID to identify managed object
*/
public $element='facture';

/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='facture';

public $table_element_line = 'facturedet';
public $fk_element = 'fk_facture';
public $picto='bill';
Expand Down Expand Up @@ -1178,6 +1178,8 @@ function getNomUrl($withpicto=0, $option='', $max=0, $short=0, $moretitle='', $n
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
}

if ($short) return $url;

$picto='bill';
if ($this->type == self::TYPE_REPLACEMENT) $picto.='r'; // Replacement invoice
if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note
Expand Down Expand Up @@ -4262,7 +4264,7 @@ class FactureLigne extends CommonInvoiceLine
* @var string ID to identify managed object
*/
public $element='facturedet';

/**
* @var string Name of table without prefix where object is stored
*/
Expand Down
3 changes: 3 additions & 0 deletions htdocs/install/mysql/migration/8.0.0-9.0.0.sql
Expand Up @@ -67,3 +67,6 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',204);

ALTER TABLE llx_payment_salary ADD COLUMN fk_projet integer DEFAULT NULL after amount;

ALTER TABLE llx_categorie ADD COLUMN ref_ext varchar(255);

3 changes: 2 additions & 1 deletion htdocs/install/mysql/tables/llx_categorie.sql
Expand Up @@ -24,7 +24,8 @@ create table llx_categorie
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_parent integer DEFAULT 0 NOT NULL,
label varchar(180) NOT NULL, -- category name
label varchar(180) NOT NULL, -- category ref/name
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
type tinyint DEFAULT 1 NOT NULL, -- category type (product, supplier, customer, member)
description text, -- description of the category
color varchar(8), -- color
Expand Down

0 comments on commit ba68a63

Please sign in to comment.