dolibarr 24.0.0-beta
massactions_pre.tpl.php
1<?php
2
3/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
4 * Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
5 * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
6 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
7 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2024 Ferran Marcet <fmarcet@2byte.es>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 * or see https://www.gnu.org/
23 */
24
25// Following var must be set:
26// $action
27// $massaction
28// $arrayofselected = array of id selected
29// $objecttmp = new MyObject($db);
30// $topicmail="SendSupplierProposalRef";
31// $modelmail="supplier_proposal_send";
32// $trackid='ord'.$objecttmp->id;
33//
34// Following var can be set
35// $object = Object fetched;
36// $sendto
37// $withmaindocfilemail
62'
63@phan-var-force string $string
64@phan-var-force CommonObject $objecttmp
65@phan-var-force CommonObject $object
66@phan-var-force int[] $toselect
67@phan-var-force ?string $uploaddir
68@phan-var-force int<0,1> $withmaindocfilemail
69@phan-var-force string $sendto
70@phan-var-force string $massaction
71@phan-var-force int[] $arrayofselected
72@phan-var-force string $trackid
73@phan-var-force string $modelmail
74@phan-var-force ?string $search_all
75@phan-var-force ?Task $taskstatic
76';
77
78if (!empty($sall) || !empty($search_all)) {
79 $search_all = empty($sall) ? $search_all : $sall;
80
81 print '<input type="hidden" name="search_all" value="'.$search_all.'">';
82}
83
84if ($massaction == 'predeletedraft') {
85 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDraftDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1);
86}
87
88if ($massaction == 'predelete') {
89 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1);
90}
91
92if ($massaction == 'preclonetasks') {
93 $selected = '';
94 foreach (GETPOST('toselect') as $tmpselected) {
95 $selected .= '&selected[]=' . $tmpselected;
96 }
97 $formquestion = array(
98 // TODO If list of project is long and project is not on a thirdparty, the combo may be very long.
99 // Solution: Allow only sameproject for cloning tasks ?
100 array('type' => 'other', 'name' => 'projectid', 'label' => $langs->trans('Project') .': ', 'value' => $form->selectProjects((string) $object->id, 'projectid', '', 0, 1, '', 0, array(), $object->socid, '1', 1, '', array(), 1)),
101 );
102 print $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id . $selected, $langs->trans('ConfirmMassClone'), '', 'clonetasks', $formquestion, '', 1, 300, 590);
103}
104
105if ($massaction == 'preaffecttag' && isModEnabled('category')) {
106 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
107 $categ = new Categorie($db);
108 $categ_types = array();
109 $categ_type_array = $categ->getMapList();
110 foreach ($categ_type_array as $categdef) {
111 // Test on $object (should be useless, we already check on $objecttmp just after)
112 if (isset($object) && $categdef['obj_table'] == $object->table_element) {
113 if (!array_key_exists($categdef['code'], $categ_types)) {
114 $categ_types[$categdef['code']] = array('code' => $categdef['code'], 'label' => $langs->trans($categdef['obj_class']));
115 }
116 }
117 if (isset($objecttmp) && $categdef['obj_table'] == $objecttmp->table_element) {
118 if (!array_key_exists($categdef['code'], $categ_types)) {
119 $categ_types[$categdef['code']] = array('code' => $categdef['code'], 'label' => $langs->trans($categdef['obj_class']));
120 }
121 }
122 }
123
124 $formquestion = array();
125 if (!empty($categ_types)) {
126 foreach ($categ_types as $categ_type) {
127 $categ_arbo_tmp = $form->select_all_categories($categ_type['code'], '', 'parent', 0, 0, 3);
128 $formquestion[] = array(
129 'type' => 'other',
130 'name' => 'affecttag_'.$categ_type['code'],
131 'label' => '',
132 'value' => $form->multiselectarray('contcats_'.$categ_type['code'], $categ_arbo_tmp, GETPOST('contcats_'.$categ_type['code'], 'array'), 0, 0, '', 0, '60%', '', '', $langs->transnoentitiesnoconv("SelectTheTagsToAssign"))
133 );
134 }
135 $formquestion[] = array(
136 'type' => 'other',
137 'name' => 'affecttag_type',
138 'label' => '',
139 'value' => '<input type="hidden" name="affecttag_type" id="affecttag_type" value="'.implode(",", array_keys($categ_types)).'"/>'
140 );
141 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmAffectTag"), $langs->trans("ConfirmAffectTagQuestion", count($toselect)), "affecttag", $formquestion, 1, 0, 200, 500, 1);
142 } else {
143 setEventMessage('CategTypeNotFound');
144 }
145}
146
147if ($massaction == 'preupdateprice'
148 && (
149 getDolGlobalString('PRODUCT_PRICE_UNIQ')
150 || getDolGlobalString('PRODUIT_CUSTOMER_PRICES')
151 || getDolGlobalString('PRODUIT_MULTIPRICES')
152 )) {
153 $formquestion = array();
154
155 $valuefield = '<div style="display: flex; align-items: center; justify-content: flex-end; padding-right: 150px">';
156 $valuefield .= '<input class="width50 right" type="text" name="pricerate" id="pricerate" min="-100" placeholder="0" value="" /> %';
157 $valuefield .= '</div>';
158
159 $formquestion[] = array(
160 'type' => 'other',
161 'name' => 'pricerate',
162 'label' => $langs->trans("Rate"),
163 'value' => $valuefield
164 );
165
166 $descConfirmPreUpdatePrice = $langs->trans("ConfirmUpdatePriceQuestion", count($toselect));
167 if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
168 $descConfirmPreUpdatePrice = $langs->trans("ConfirmUpdatePriceQuestion", count($toselect) * getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT') .' ('.$langs->transnoentities('PricingRule').', '.$langs->transnoentities('MultiPricesNumPrices').')');
169 }
170
171 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $descConfirmPreUpdatePrice, "updateprice", $formquestion, 1, 0, 200, 500, 1);
172}
173
174if ($massaction == 'presetsupervisor') {
175 $formquestion = array();
176
177 $valuefield = '<div style="display: flex; align-items: center; justify-content: flex-end; padding-right: 150px">';
178 $valuefield .= img_picto('', 'user').' ';
179 $valuefield .= $form->select_dolusers('', 'supervisortoset', 1, $arrayofselected, 0, '', '', (string) $object->entity, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300');
180 $valuefield .= '</div>';
181
182 $formquestion[] = array(
183 'type' => 'other',
184 'name' => 'supervisortoset',
185 'label' => $langs->trans("Supervisor"),
186 'value' => $valuefield
187 );
188
189 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmSetSupervisor"), $langs->trans("ConfirmSetSupervisorQuestion", count($toselect)), "setsupervisor", $formquestion, 1, 0, 200, 500, 1);
190}
191
192if ($massaction == 'preaffectuser') {
193 $formquestion = array();
194
195 $valuefielduser = '<div style="display: flex; align-items: center; justify-content: flex-end; padding-right: 165px; padding-bottom: 6px; gap: 5px">';
196 $valuefielduser .= img_picto('', 'user').' ';
197 $valuefielduser .= $form->select_dolusers('', 'usertoaffect', 1, $arrayofselected, 0, '', '', (string) $object->entity, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300');
198 $valuefielduser .= '</div>';
199
200 $valuefieldprojrole = '<div style="display: flex; align-items: center; justify-content: flex-end; padding-right: 150px; padding-bottom: 6px">';
201 $valuefieldprojrole .= $formcompany->selectTypeContact($object, '', 'projectrole', 'internal', 'position', 0, 'widthcentpercentminusx maxwidth300', 0);
202 $valuefieldprojrole .= '</div>';
203
204 $valuefieldtasksrole = '<div style="display: flex; align-items: center; justify-content: flex-end; padding-right: 150px">';
205 $valuefieldtasksrole .= $formcompany->selectTypeContact($taskstatic, '', 'tasksrole', 'internal', 'position', 0, 'widthcentpercentminusx maxwidth300', 0);
206 $valuefieldtasksrole .= '</div>';
207
208 $formquestion[] = array(
209 'type' => 'other',
210 'name' => 'usertoaffect',
211 'label' => $langs->trans("User"),
212 'value' => $valuefielduser
213 );
214 $formquestion[] = array(
215 'type' => 'other',
216 'name' => 'projectrole',
217 'label' => $langs->trans("ProjectRole"),
218 'value' => $valuefieldprojrole
219 );
220
221 $formquestion[] = array(
222 'type' => 'other',
223 'name' => 'tasksrole',
224 'label' => $langs->trans("TasksRole"),
225 'value' => $valuefieldtasksrole
226 );
227
228 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmAffectUser"), $langs->trans("ConfirmAffectUserQuestion", count($toselect)), "affectuser", $formquestion, 1, 0, 200, 500, 1);
229}
230
231if ($massaction == 'presend') {
232 $langs->load("mails");
233
234 $listofselectedid = array();
235 $listofselectedrecipientobjid = array();
236 $listofselectedref = array();
237
238 if (!GETPOST('cancel', 'alpha')) {
239 foreach ($arrayofselected as $toselectid) {
240 $result = $objecttmp->fetch($toselectid);
241 if ($result > 0) {
242 $listofselectedid[$toselectid] = $toselectid;
243 $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); // For proposal, order, invoice, conferenceorbooth, ...
244 if (in_array($objecttmp->element, array('societe', 'conferenceorboothattendee'))) {
245 $thirdpartyid = $objecttmp->id;
246 } elseif ($objecttmp->element == 'contact') {
247 $thirdpartyid = $objecttmp->id;
248 } elseif ($objecttmp->element == 'expensereport') {
249 $thirdpartyid = $objecttmp->fk_user_author;
250 }
251 if (empty($thirdpartyid)) {
252 $thirdpartyid = 0;
253 }
254 if ($thirdpartyid) {
255 $listofselectedrecipientobjid[$thirdpartyid] = $thirdpartyid;
256 }
257 $listofselectedref[$thirdpartyid][$toselectid] = $objecttmp->ref;
258 }
259 }
260 }
261
262 print '<input type="hidden" name="massaction" value="confirm_presend">';
263
264 print dol_get_fiche_head([], '', '');
265
266 // Create mail form
267 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
268 $formmail = new FormMail($db);
269 $formmail->withform = -1;
270 $formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE', 'user'));
271
272 if ($formmail->fromtype === 'user') {
273 $formmail->fromid = $user->id;
274 }
275 $formmail->trackid = $trackid;
276 $formmail->withfrom = 1;
277 $liste = $langs->trans("AllRecipientSelected", count($arrayofselected));
278 if (count($listofselectedrecipientobjid) == 1) { // Only 1 different recipient selected, we can suggest contacts
279 $liste = array();
280 $thirdpartyid = array_shift($listofselectedrecipientobjid);
281 if ($objecttmp->element == 'expensereport') {
282 $fuser = new User($db);
283 $fuser->fetch($thirdpartyid);
284 $liste['thirdparty'] = $fuser->getFullName($langs)." &lt;".$fuser->email."&gt;";
285 } elseif ($objecttmp->element == 'contact') {
286 $fcontact = new Contact($db);
287 $fcontact->fetch($thirdpartyid);
288 $liste['contact'] = $fcontact->getFullName($langs)." &lt;".$fcontact->email."&gt;";
289 } elseif ($objecttmp->element == 'partnership' && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') {
290 $fadherent = new Adherent($db);
291 $fadherent->fetch($objecttmp->fk_member);
292 $liste['member'] = $fadherent->getFullName($langs)." &lt;".$fadherent->email."&gt;";
293 } else {
294 $soc = new Societe($db);
295 $soc->fetch($thirdpartyid);
296 foreach ($soc->thirdparty_and_contact_email_array(1) as $key => $value) {
297 $liste[$key] = $value;
298 }
299 }
300 $formmail->withtoreadonly = 0;
301 } else {
302 $formmail->withtoreadonly = 1;
303 }
304
305
306 $formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : (GETPOSTINT('oneemailperrecipient') ? 1 : -1);
307 if (in_array($objecttmp->element, array('conferenceorboothattendee'))) {
308 $formmail->withoptiononeemailperrecipient = 0;
309 }
310
311 $formmail->withto = empty($liste) ? (GETPOST('sendto', 'alpha') ? GETPOST('sendto', 'alpha') : array()) : $liste;
312 $formmail->withtofree = empty($liste) ? 1 : 0;
313 $formmail->withtocc = 1;
314 $formmail->withtoccc = getDolGlobalString('MAIN_EMAIL_USECCC');
315 if (!empty($topicmail)) {
316 $formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__');
317 } else {
318 $formmail->withtopic = 1;
319 }
320 if ($objecttmp->element == 'contact') {
321 $formmail->withfile = 0;
322 $formmail->withmaindocfile = 0; // Add a checkbox "Attach also main document"
323 } else {
324 $formmail->withfile = 1; // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action
325 // Add a checkbox "Attach also main document"
326 if (isset($withmaindocfilemail)) {
327 $formmail->withmaindocfile = $withmaindocfilemail;
328 } else { // Do an automatic definition of $formmail->withmaindocfile
329 $formmail->withmaindocfile = 1;
330 if ($objecttmp->element != 'societe') {
331 $formmail->withfile = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("OnlyPDFattachmentSupported") . '</span>';
332 $formmail->withmaindocfile = -1; // Add a checkbox "Attach also main document" but not checked by default
333 }
334 }
335 }
336
337 $formmail->withbody = 1;
338 $formmail->withdeliveryreceipt = 1;
339 $formmail->withcancel = 1;
340
341 // Make substitution in email content
342 $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object);
343
344 $substitutionarray['__EMAIL__'] = empty($sendto) ? '__EMAIL__' : $sendto;
345 $substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag=undefined&securitykey='.dol_hash(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')."-undefined", 'md5').'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
346 $substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable';
347 $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = 'TextAndUrlToPayOnlineIfApplicable';
348 $substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__';
349 $substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__';
350
351 $parameters = array(
352 'mode' => 'formemail'
353 );
354 complete_substitutions_array($substitutionarray, $langs, $object, $parameters);
355
356 // Array of substitutions
357 $formmail->substit = $substitutionarray;
358
359 // Tableau des parameters complementaires du post
360 $formmail->param['action'] = $action;
361 $formmail->param['models'] = $modelmail; // the filter to know which kind of template emails to show. 'none' means no template suggested.
362 $formmail->param['models_id'] = GETPOSTINT('modelmailselected') ? GETPOSTINT('modelmailselected') : '';
363 $formmail->param['id'] = implode(',', $arrayofselected);
364 // $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
365 if (getDolGlobalString('MAILING_LIMIT_SENDBYWEB') && count($listofselectedrecipientobjid) > $conf->global->MAILING_LIMIT_SENDBYWEB) {
366 // Note: MAILING_LIMIT_SENDBYWEB may be forced by conf.php file and variable $dolibarr_mailing_limit_sendbyweb
367 $langs->load("errors");
368 print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', getDolGlobalString('MAILING_LIMIT_SENDBYWEB'));
369 print ' - <a href="javascript: window.history.go(-1)">'.$langs->trans("GoBack").'</a>';
370 $arrayofmassactions = array();
371 } else {
372 print $formmail->get_form();
373 }
374
375 print dol_get_fiche_end();
376}
377
378if ($massaction == 'edit_extrafields') {
379 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
380 $elementtype = $objecttmp->element;
382 $keysuffix = '';
383 $extrafields->fetch_name_optionals_label($elementtype);
384 $extrafields_list = $extrafields->attributes[$elementtype]['label'];
385
386 $formquestion = array();
387 if (!empty($extrafields_list)) {
388 $myParamExtra = $object->showOptionals($extrafields, 'create');
389
390 foreach ($extrafields_list as $extraKey => $extraLabel) {
391 $extrafields_list[$extraKey] = $langs->trans($extraLabel);
392 }
393
394 $formquestion[] = array(
395 'type' => 'other',
396 'value' => $form->selectarray('extrafield-key-to-update', $extrafields_list, GETPOST('extrafield-key-to-update'), 1)
397 );
398
399
400 $outputShowOutputFields = '<div class="extrafields-inputs">';
401
402 foreach ($extrafields_list as $extraKey => $extraLabel) {
403 $outputShowOutputFields .= '<div class="mass-action-extrafield" data-extrafield="'.$extraKey.'" style="display:none;" >';
404 $outputShowOutputFields .= '<br><span>'. $langs->trans('NewValue').'</span>';
405 $outputShowOutputFields .= $extrafields->showInputField($extraKey, '', '', $keysuffix, '', '', $objecttmp, $objecttmp->table_element);
406 $outputShowOutputFields .= '</div>';
407 }
408 $outputShowOutputFields .= '<script>
409 jQuery(function($) {
410 $("#extrafield-key-to-update").on(\'change\',function(){
411 let selectedExtrtafield = $(this).val();
412 if($(".extrafields-inputs .product_extras_"+selectedExtrtafield) != undefined){
413 $(".mass-action-extrafield").hide();
414 $(".mass-action-extrafield[data-extrafield=" + selectedExtrtafield + "]").show();
415 }
416 });
417 });
418 </script>';
419 $outputShowOutputFields .= '</div>';
420
421
422
423 $formquestion[] = array(
424 'type' => 'other',
425 'value' => $outputShowOutputFields
426 );
427
428 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmEditExtrafield"), $langs->trans("ConfirmEditExtrafieldQuestion", count($toselect)), "confirm_edit_value_extrafields", $formquestion, 1, 0, 200, 500, 1);
429 } else {
430 setEventMessage($langs->trans("noExtrafields"));
431 }
432}
433
434if ($massaction == 'preenable') {
435 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassEnabling"), $langs->trans("ConfirmMassEnablingQuestion", count($toselect)), "enable", null, 'yes', 0, 200, 500, 1);
436}
437if ($massaction == 'predisable') {
438 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDisabling"), $langs->trans("ConfirmMassDisablingQuestion", count($toselect)), "disable", null, '', 0, 200, 500, 1);
439}
440if ($massaction == 'presetcommercial') {
441 $formquestion = array();
442 $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', '0', 0, 0, 'u.statut:=:1', 0, '', '', 0, 1);
443 $formquestion[] = array('type' => 'other',
444 'name' => 'affectedcommercial',
445 'label' => $form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0),
446 'value' => $form->multiselectarray('commercial', $userlist, array(), 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0, '', '', '', 1)
447 );
448 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmAllocateCommercial"), $langs->trans("ConfirmAllocateCommercialQuestion", count($toselect)), "assignsalerepresentative", $formquestion, 1, 0, 200, 500, 1);
449}
450if ($massaction == 'unsetcommercial') {
451 $formquestion = array();
452 $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', '0', 0, 0, 'u.statut:=:1', 0, '', '', 0, 1);
453 $formquestion[] = array('type' => 'other',
454 'name' => 'unassigncommercial',
455 'label' => $form->editfieldkey('UnallocateCommercial', 'commercial_id', '', $object, 0),
456 'value' => $form->multiselectarray('commercial', $userlist, array(), 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0, '', '', '', 1)
457 );
458 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUnallocateCommercial"), $langs->trans("ConfirmUnallocateCommercialQuestion", count($toselect)), "unassigncommercial", $formquestion, 1, 0, 200, 500, 1);
459}
460
461if ($massaction == 'preapproveleave') {
462 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, 'yes', 0, 200, 500, 1);
463}
464
465if ($massaction == 'precreatecreditnote') {
466 $text = '<br>';
467 $text .= $langs->trans("ConfirmMassCreateCreditNoteQuestion", count($toselect)) . '<br>';
468
469 // Credit note validation may trigger notifications, so display them in confirmation dialog
470 if (isModEnabled('notification')) {
471 foreach ($toselect as $toselectid) {
472 $result = $objecttmp->fetch($toselectid);
473 if ($result > 0) {
474 require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
475 $notify = new Notify($db);
476 $text .= $notify->confirmMessage('BILL_VALIDATE', $objecttmp->socid, $objecttmp) . '<br>';
477 }
478 }
479 }
480 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassCreateCreditNote"), $text, "createcreditnote", null, 'yes', 0, 200, 500, 1);
481}
482
483// Allow Pre-Mass-Action hook (eg for confirmation dialog)
484if (empty($toselect)) {
485 $toselect = [];
486}
487$parameters = array(
488 'toselect' => &$toselect,
489 'uploaddir' => isset($uploaddir) ? $uploaddir : null,
490 'massaction' => $massaction
491);
492
493// @phan-suppress-next-line PhanTypeMismatchArgumentNullable
494$reshook = $hookmanager->executeHooks('doPreMassActions', $parameters, $object, $action);
495if ($reshook < 0) {
496 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
497} else {
498 print $hookmanager->resPrint;
499}
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
Class to manage members of a foundation.
Class to manage categories.
Class to manage contact/addresses.
Class to manage a HTML form to send a unitary email Usage: $formail = new FormMail($db) $formmail->pr...
Class to manage the table of subscription to notifications.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_hash($chain, $type='0', $nosalt=0, $mode=0)
Returns a hash (non reversible encryption) of a string.