Skip to content

Commit

Permalink
Merge pull request #8322 from inoveaconseil/develop
Browse files Browse the repository at this point in the history
Add research with phone number on left search
  • Loading branch information
eldy committed Mar 10, 2018
2 parents a7e0fdb + 9075ed4 commit 466f87e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
5 changes: 4 additions & 1 deletion htdocs/comm/propal/list.php
Expand Up @@ -12,6 +12,7 @@
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
Expand Down Expand Up @@ -214,6 +215,7 @@
$objectlabel='Proposals';
$permtoread = $user->rights->propal->lire;
$permtodelete = $user->rights->propal->supprimer;
$permtoclose = $user->rights->propal->cloturer;
$uploaddir = $conf->propal->multidir_output[$conf->entity];
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
Expand Down Expand Up @@ -389,7 +391,8 @@
'builddoc'=>$langs->trans("PDFMerge"),
);
if ($user->rights->propal->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
if ($user->rights->propal->cloturer) $arrayofmassactions['closed']=$langs->trans("Closed");
if (in_array($massaction, array('presend','predelete','closed'))) $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);

// Lignes des champs de filtre
Expand Down
2 changes: 2 additions & 0 deletions htdocs/contact/list.php
Expand Up @@ -7,6 +7,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
Expand Down Expand Up @@ -133,6 +134,7 @@
'p.firstname'=>'Firstname',
'p.email'=>'EMail',
's.nom'=>"ThirdParty",
'p.phone'=>"Phone",
);

// Definition of fields for list
Expand Down
37 changes: 36 additions & 1 deletion htdocs/core/actions_massactions.inc.php
@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
Expand Down Expand Up @@ -973,7 +974,41 @@
//var_dump($listofobjectthirdparties);exit;
}
}

// Closed records
if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permtoclose) {
$db->begin();

$objecttmp = new $objectclass($db);
$nbok = 0;
foreach ($toselect as $toselectid) {
$result = $objecttmp->fetch($toselectid);
if ($result > 0) {
$result = $objecttmp->cloture($user, 3);
if ($result <= 0) {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
$error++;
break;
} else
$nbok++;
}
else {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
$error++;
break;
}
}

if (!$error) {
if ($nbok > 1)
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
else
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
$db->commit();
}
else {
$db->rollback();
}
}
// Delete record from mass action (massaction = 'delete' for direct delete, action/confirm='delete'/'yes' with a confirmation step before)
if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == 'yes')) && $permtodelete)
{
Expand Down
2 changes: 2 additions & 0 deletions htdocs/societe/list.php
Expand Up @@ -9,6 +9,7 @@
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
Expand Down Expand Up @@ -137,6 +138,7 @@
's.siren'=>"ProfId1",
's.siret'=>"ProfId2",
's.ape'=>"ProfId3",
's.phone'=>"Phone",
);
if (($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') $fieldstosearchall['s.idprof4']='ProfId4';
if (($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp != "ProfId5".$mysoc->country_code && $tmp != '-') $fieldstosearchall['s.idprof5']='ProfId5';
Expand Down

0 comments on commit 466f87e

Please sign in to comment.