Skip to content

Commit

Permalink
Add mass action set paid
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 1, 2025
1 parent 26b6809 commit e4eb5d7
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions htdocs/alumni/survey_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,29 @@
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';

// You can add more action here
// if ($action == 'xxx' && $permissiontoxxx) ...
if ($massaction == 'settopaid' && $permissiontoadd) {
foreach ($toselect as $toselectid) {
$tmpobject = new Survey($db);
$tmpobject->fetch($toselectid);

$tmpobject->array_options = array('options_a_paye' => 1);

$result = $tmpobject->updateExtraField('a_paye', null, $user);
}
}
if ($massaction == 'settounpaid' && $permissiontoadd) {
foreach ($toselect as $toselectid) {
$tmpobject = new Survey($db);
$tmpobject->fetch($toselectid);

$tmpobject->array_options = array('options_a_paye' => 0);

$result = $tmpobject->updateExtraField('a_paye', null, $user);
}
}
}



/*
* View
*/
Expand Down Expand Up @@ -495,6 +513,8 @@
);
if (!empty($permissiontodelete)) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
$arrayofmassactions['settopaid'] = img_picto('', 'currency', 'class="pictofixedwidth"').$langs->trans("SetToPaid");
$arrayofmassactions['setunpaid'] = img_picto('', 'circle', 'class="pictofixedwidth"').$langs->trans("SetToUnPaid");
}
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
$arrayofmassactions = array();
Expand Down

0 comments on commit e4eb5d7

Please sign in to comment.