phpScheduleIt
May 22, 2013, 07:53:50 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Multi remove and edit 1.12  (Read 688 times)
ikeigenwijs
Jr. Member
**

Karma: 0
Posts: 63


« on: February 14, 2011, 06:22:44 AM »

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.0

than 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>&nbsp;</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 "&nbsp;";
   $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);

}
« Last Edit: March 04, 2011, 07:21:22 AM by ikeigenwijs » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!