Merge origin/develop into develop
This commit is contained in:
commit
9b680ca2e1
@ -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
|
||||
@ -214,6 +215,7 @@ if (empty($reshook))
|
||||
$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';
|
||||
}
|
||||
@ -389,7 +391,8 @@ if ($resql)
|
||||
'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
|
||||
|
||||
@ -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
|
||||
@ -133,6 +134,7 @@ $fieldstosearchall = array(
|
||||
'p.firstname'=>'Firstname',
|
||||
'p.email'=>'EMail',
|
||||
's.nom'=>"ThirdParty",
|
||||
'p.phone'=>"Phone",
|
||||
);
|
||||
|
||||
// Definition of fields for list
|
||||
|
||||
@ -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
|
||||
@ -973,7 +974,41 @@ if (! $error && $massaction == 'validate' && $permtocreate)
|
||||
//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)
|
||||
{
|
||||
|
||||
@ -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
|
||||
@ -137,6 +138,7 @@ $fieldstosearchall = array(
|
||||
'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';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user