Multi remove and edit
These setting are a build on the multiple reserve modification.
so do first this.
http://php.brickhost.com/forums/index.php?topic=2399.0than this for edit and remove.
in cpanel.template.php
line 110
add <form id="multiple_reservations_delete_edit" name="multiple_reservations_delete_edit">
line 165 add </form>
line 113 add <td> </td>
after . "<td><input type=\"checkbox\" name=\"res\" value=".$rs['resid']." /></td>"
line 154 add . "<td><input type=\"checkbox\" name=\"res\" value=".$rs['resid']." /></td>"
line
after </table>
line 169 add
<tr><td>
<?php
echo "<div align=\"right\">";
$link->doLink("javascript: get_check_value_remove('m','','','','');", "Multi reservering wijziging");
echo " ";
$link->doLink("javascript: get_check_value_remove('d','','','','');", "Multi reservering verwijdering");
echo "</div>";
?>
</td></tr>
</form>
in reserve.php
line 109
modify
function process_reservation($fn,$machid) {
to
function process_reservation($fn,$machid,$resid=null) {
add
line119
if(is_null($resid)){ //Door GOS nodig voor multi edit and remove
$resid=$_POST['resid'];
}
line134
modify
if (isset($_POST['resid']))
to
if (isset($resid))
line 136
modify
$res = new $Class($resid, false, $is_pending);
reserve.template.php in 525
add . '<input type="hidden" name="mach_array" value="' . $res->get_mach_array(). '" />' . "\n"
Script in multiple_reservations.js
or put it directly in reservation.php
/**
* @param String $actionflag r=resurve, d= delete
* @param int $ts timestamp for the current day
* @param string $id id of this resource
* @param string $scheduleid id of the current schedule
* @param boolean $pending is reservation pending approval
*/
function get_check_value_remove(actionflag,ts,id,scheduleid,pending)
{
var x=document.multiple_reservations_delete_edit.elements; //alle cheqboxen
var c_value = ""; //contains reservation brs
var lastreservationsnr=""; //contains last selected reservation id
for (var i=0;i<x.length;i++)
{
if (x
.checked)
{
c_value = c_value + x.value + "|";
lastreservationsnr=x.value;
}
}
reserve(actionflag,c_value,'',lastreservationsnr);
}