Revision: 6426 http://care2002.svn.sourceforge.net/care2002/?rev=6426&view=rev Author: mizuko Date: 2010-06-30 08:36:28 +0000 (Wed, 30 Jun 2010)
Log Message: ----------- see #54 Added Paths: ----------- care2x/branches/gettext/modules/doctors/doctors-roster-plan.php care2x/branches/gettext/modules/doctors/doctors-roster-poppersonselect.php Removed Paths: ------------- care2x/branches/gettext/modules/doctors/doctors-dienstplan-planen.php care2x/branches/gettext/modules/doctors/doctors-dienstplan-poppersonselect.php Deleted: care2x/branches/gettext/modules/doctors/doctors-dienstplan-planen.php =================================================================== --- care2x/branches/gettext/modules/doctors/doctors-dienstplan-planen.php 2010-06-30 08:32:21 UTC (rev 6425) +++ care2x/branches/gettext/modules/doctors/doctors-dienstplan-planen.php 2010-06-30 08:36:28 UTC (rev 6426) @@ -1,338 +0,0 @@ -<?php -error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR); -require('./roots.php'); -require($root_path.'include/helpers/inc_environment_global.php'); -/** -* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02 -* GNU General Public License -* Copyright 2002,2003,2004,2005 Elpidio Latorilla -* elpi...@care2x.org, -* -* See the file "copy_notice.txt" for the licence notice -*/ -$lang_tables[]='departments.php'; -define('LANG_FILE','doctors.php'); -$local_user='ck_doctors_dienstplan_user'; -require_once($root_path.'include/helpers/inc_front_chain_lang.php'); - -if(!isset($dept_nr)||!$dept_nr){ - header('Location:doctors-select-dept.php'.URL_REDIRECT_APPEND.'&retpath='.$retpath); - exit; -} - -//$db->debug=1; - -$thisfile=basename(__FILE__); -$breakfile="doctors-rosterplan.php".URL_APPEND."&dept_nr=$dept_nr&pmonth=$pmonth&pyear=$pyear&retpath=$retpath"; - -require_once($root_path.'modules/dept_admin/model/class_department.php'); -$dept_obj=new Department; -$dept_obj->preloadDept($dept_nr); - -require_once($root_path.'modules/personell_admin/model/class_personell.php'); -$pers_obj=new Personell; -$pers_obj->useDutyplanTable(); - -if ($pmonth=='') $pmonth=date('n'); -if ($pyear=='') $pyear=date('Y'); - -/* Establish db connection */ -if(!isset($db)||!$db) include($root_path.'include/helpers/inc_db_makelink.php'); -if($dblink_ok) - { - if($mode=='save') - { - - $arr_1_txt=array(); - $arr_2_txt=array(); - $arr_1_pnr=array(); - $arr_2_pnr=array(); - - for($i=0;$i<$maxelement;$i++) - { - $tdx="ha".$i; - $ddx="hr".$i; - $ax="a".$i; - $rx="r".$i; - - if(!empty($$ax)) $arr_1_txt[$ax]=$$ax; - if(!empty($$rx)) $arr_2_txt[$rx]=$$rx; - if(!empty($$tdx)) $arr_1_pnr[$tdx]=$$tdx; - if(!empty($$ddx)) $arr_2_pnr[$ddx]=$$ddx; - - } - - $ref_buffer=array(); - // Serialize the data - $ref_buffer['duty_1_txt']=serialize($arr_1_txt); - $ref_buffer['duty_2_txt']=serialize($arr_2_txt); - $ref_buffer['duty_1_pnr']=serialize($arr_1_pnr); - $ref_buffer['duty_2_pnr']=serialize($arr_2_pnr); - - $ref_buffer['dept_nr']=$dept_nr; - $ref_buffer['role_nr']=15; - $ref_buffer['year']=$pyear; - $ref_buffer['month']=$pmonth; - $ref_buffer['modify_id']=$_SESSION['sess_user_name']; - - if($dpoc_nr=$pers_obj->DOCDutyplanExists($dept_nr,$pyear,$pmonth)){ - $ref_buffer['history']=$pers_obj->ConcatHistory("Update: ".date('Y-m-d H:i:s')." = ".$_SESSION['sess_user_name']."\n"); - $ref_buffer['modify_time']=date('YmdHis'); - // Point to the internal data array - $pers_obj->setDataArray($ref_buffer); - - if($pers_obj->updateDataFromInternalArray($dpoc_nr)){ - - # Remove the cache plan - if(date('Yn')=="$pyear$pmonth"){ - $pers_obj->deleteDBCache('DOCS_'.date('Y-m-d')); - } - header("location:$thisfile?sid=$sid&lang=$lang&saved=1&dept_nr=$dept_nr&pyear=$pyear&pmonth=$pmonth&retpath=$retpath"); - exit; - }else echo "<p>".$pers_obj->getLastQuery."<p>$LDDbNoSave"; - } // else create new entry - else - { - $ref_buffer['history']="Create: ".date('Y-m-d H:i:s')." = ".$_SESSION['sess_user_name']."\n"; - $ref_buffer['create_id']=$_SESSION['sess_user_name']; - $ref_buffer['create_time']=date('YmdHis'); - // Point to the internal data array - $pers_obj->setDataArray($ref_buffer); - - //echo "create"; - - if($pers_obj->insertDataFromInternalArray()){ - # Remove the cache plan - if(date('Yn')=="$pyear$pmonth"){ - $pers_obj->deleteDBCache('DOCS_'.date('Y-m-d')); - } - header("location:$thisfile?sid=$sid&lang=$lang&saved=1&dept_nr=$dept_nr&pyear=$pyear&pmonth=$pmonth&retpath=$retpath"); - exit; - }else{ - echo "<p>".$pers_obj->getLastQuery."<p>$LDDbNoSave"; - } - }//end of else - - }// end of if(mode==save) - else - { - if($dutyplan=&$pers_obj->getDOCDutyplan($dept_nr,$pyear,$pmonth)){ - - $aelems=unserialize($dutyplan['duty_1_txt']); - $relems=unserialize($dutyplan['duty_2_txt']); - $a_pnr=unserialize($dutyplan['duty_1_pnr']); - $r_pnr=unserialize($dutyplan['duty_2_pnr']); - } - } -} - else { echo "$LDDbNoLink<br>"; } - - -$maxdays=date("t",mktime(0,0,0,$pmonth,1,$pyear)); - -$firstday=date("w",mktime(0,0,0,$pmonth,1,$pyear)); - -function makefwdpath($path,$dpt,$mo,$yr,$saved) -{ - if ($path==1) - { - $fwdpath='doctors-rosterplan.php?'; - if($saved!="1") - { - if ($mo==1) {$mo=12; $yr--;} - else $mo--; - } - return $fwdpath.'dept='.$dpt.'&pmonth='.$mo.'&pyear='.$yr; - } - else return "doctors-rosterplan-checkpoint.php"; -} - -# Prepare page title - $sTitle = "$LDMakeDutyPlan :: "; - $LDvar=$dept_obj->LDvar(); - if(isset($$LDvar)&&$$LDvar) $sTitle = $sTitle.$$LDvar; - else $sTitle = $sTitle.$dept_obj->FormalName(); - -# Start Smarty templating here - /** - * LOAD Smarty - */ - - # Note: it is advisable to load this after the inc_front_chain_lang.php so - # that the smarty script can use the user configured template theme - - require_once($root_path.'gui/smarty_template/smarty_care.class.php'); - $smarty = new smarty_care('common'); - -# Title in toolbar - $smarty->assign('sToolbarTitle',$sTitle); - - # href for help button - $smarty->assign('pbHelp',"javascript:gethelp('docs_dutyplan_edit.php','$mode','$rows')"); - -# href for return button - $smarty->assign('pbBack','javascript:history.back();killchild();'); - - # href for close button - $smarty->assign('breakfile',$breakfile); - - # Body onLoad javascript - //$smarty->assign('sOnLoadJs','onUnload="killchild()"'); - - # Window bar title - $smarty->assign('sWindowTitle',$sTitle); - - # Collect extra javascript - - ob_start(); -?> - -<script language="javascript"> - - var urlholder; - var infowinflag=0; - -function popselect(elem,mode) -{ - w=window.screen.width; - h=window.screen.height; - ww=300; - wh=500; - var tmonth=document.dienstplan.month.value; - var tyear=document.dienstplan.jahr.value; - urlholder="doctors-rosterplan-poppersonselect.php?elemid="+elem + "&dept_nr=<?php echo $dept_nr ?>&month="+tmonth+"&year="+tyear+ "&mode=" + mode + "&retpath=<?php echo $retpath ?>&user=<?php echo $ck_doctors_dienstplan_user."&lang=$lang&sid=$sid"; ?>"; - - popselectwin=window.open(urlholder,"pop","width=" + ww + ",height=" + wh + ",menubar=no,resizable=yes,scrollbars=yes,dependent=yes"); - window.popselectwin.moveTo((w/2)+80,(h/2)-(wh/2)); -} - -function killchild() -{ - if (window.popselectwin) if(!window.popselectwin.closed) window.popselectwin.close(); -} - -function cal_update() -{ - var filename="doctors-roster-plan.php?<?php echo "sid=$sid&lang=$lang" ?>&retpath=<?php echo $retpath ?>&dept_nr=<?php echo $dept_nr; ?>&pmonth="+document.dienstplan.month.value+"&pyear="+document.dienstplan.jahr.value; - window.location.replace(filename); -} -</script> -<?php - - $sTemp=ob_get_contents(); - ob_end_clean(); - $smarty->append('JavaScript',$sTemp); - - $smarty->assign('LDStandbyPerson',$LDDoc1); - $smarty->assign('LDOnCall',$LDDoc2); - -# Prepare the date selectors -$smarty->assign('LDMonth',$LDMonth); -$sBuffer = '<select name="month" size="1" onChange="cal_update()">'; - -for ($i=1;$i<13;$i++){ - $sBuffer = $sBuffer.'<option value="'.$i.'" '; - if (($pmonth)==$i) $sBuffer = $sBuffer.'selected'; - $sBuffer = $sBuffer.'>'.$monat[$i].'</option>'; - $sBuffer = $sBuffer."\n"; -} -$sBuffer = $sBuffer.'</select>'; -$smarty->assign('sMonthSelect',$sBuffer); - -$smarty->assign('LDYear',$LDYear); -$sBuffer = '<select name="jahr" size="1" onChange="cal_update()">'; - -for ($i=2000;$i<2016;$i++){ - $sBuffer = $sBuffer.'<option value="'.$i.'" '; - if ($pyear==$i) $sBuffer = $sBuffer.'selected'; - $sBuffer = $sBuffer.'>'.$i.'</option>'; - $sBuffer = $sBuffer."\n"; -} -$sBuffer = $sBuffer.'</select>'; -$smarty->assign('sYearSelect',$sBuffer); - -$smarty->assign('sFormAction','action="doctors-roster-plan.php"'); - - # collect hidden inputs - - ob_start(); -?> - -<input type="hidden" name="mode" value="save"> -<input type="hidden" name="dept" value="<?php echo $dept_obj->ID(); ?>"> -<input type="hidden" name="dept_nr" value="<?php echo $dept_nr; ?>"> -<input type="hidden" name="pmonth" value="<?php echo $pmonth; ?>"> -<input type="hidden" name="pyear" value="<?php echo $pyear; ?>"> -<input type="hidden" name="planid" value="<?php echo $ck_plan; ?>"> -<input type="hidden" name="maxelement" value="<?php echo $maxdays; ?>"> -<input type="hidden" name="encoder" value="<?php echo $ck_doctors_dienstplan_user; ?>"> -<input type="hidden" name="retpath" value="<?php echo $retpath; ?>"> -<input type="hidden" name="lang" value="<?php echo $lang; ?>"> -<input type="hidden" name="sid" value="<?php echo $sid; ?>"> - -<?php - - $sTemp=ob_get_contents(); - ob_end_clean(); - $smarty->assign('sHiddenInputs',$sTemp); - - if($saved) $sBuffer = createLDImgSrc($root_path,'close2.gif','0'); - else $sBuffer = createLDImgSrc($root_path,'cancel.gif','0'); - - # Assign control links -$smarty->assign('sSave','<input type="image" '.createLDImgSrc($root_path,'savedisc.gif','0').'"></a>'); -$smarty->assign('sClose',"<a href=\"$breakfile\" onUnload=\"killchild()\"><img ".$sBuffer." alt=\"$LDClosePlan\"></a>"); - -$sTemp=''; - -for ($i=1,$n=0,$wd=$firstday;$i<=$maxdays;$i++,$n++,$wd++) -{ - switch ($wd){ - //case 6: $backcolor="bgcolor=#ffffcc";break; - //case 0: $backcolor="bgcolor=#ffff00";break; - //default: $backcolor="bgcolor=white"; - case 6: $smarty->assign('sRowClass','class="saturday"');break; - case 0: $smarty->assign('sRowClass','class="sunday"');break; - default: $smarty->assign('sRowClass','class="weekday"'); - } - - $smarty->assign('iDayNr',$i); - $smarty->assign('LDShortDay',$LDShortDay[$wd]); - - if ($aelems['a'.$n]=="") $smarty->assign('sIcon1','<img '.createComIcon($root_path,'warn.gif','0').'>'); - else $smarty->assign('sIcon1','<img '.createComIcon($root_path,'mans-gr.gif','0').'>'); - $smarty->assign('sInput1','<input type="hidden" name="ha'.$n.'" value="'.$a_pnr['ha'.$n].'"> - <input type="text" name="a'.$n.'" size="15" onFocus=this.select() value="'.$aelems['a'.$n].'">'); - - $smarty->assign('sPopWin1','<a href="javascript:popselect(\''.$n.'\',\'a\')"> - <button onclick="javascript:popselect(\''.$n.'\',\'a\')"><img '.createComIcon($root_path,'patdata.gif','0').' alt="'.$LDClk2Plan.'"></button></a>'); - - if ($relems['r'.$n]=="") $smarty->assign('sIcon2','<img '.createComIcon($root_path,'warn.gif','0').'>'); - else $smarty->assign('sIcon2','<img '.createComIcon($root_path,'mans-red.gif','0').'>'); - $smarty->assign('sInput2','<input type="hidden" name="hr'.$n.'" value="'.$r_pnr['hr'.$n].'"> - <input type="text" size="15" name="r'.$n.'" onFocus=this.select() value="'.$relems['r'.$n].'">'); - - $smarty->assign('sPopWin2','<a href="javascript:popselect(\''.$n.'\',\'r\')"> - <button onclick="javascript:popselect(\''.$n.'\',\'r\')"><img '.createComIcon($root_path,'patdata.gif','0').' alt="'.$LDClk2Plan.'"></button></a>'); - if($wd==6) $wd=-1; - - # Buffer each row and collect to a string - - ob_start(); - $smarty->display('common/duty_plan_entry_row.tpl'); - $sTemp = $sTemp.ob_get_contents(); - ob_end_clean(); -} - -# Assign the duty entry rows to the subframe template - - $smarty->assign('sDutyRows',$sTemp); - - -$smarty->assign('sMainBlockIncludeFile','common/duty_plan_entry_frame.tpl'); - /** - * show Template - */ - $smarty->display('common/mainframe.tpl'); - -?> Deleted: care2x/branches/gettext/modules/doctors/doctors-dienstplan-poppersonselect.php =================================================================== --- care2x/branches/gettext/modules/doctors/doctors-dienstplan-poppersonselect.php 2010-06-30 08:32:21 UTC (rev 6425) +++ care2x/branches/gettext/modules/doctors/doctors-dienstplan-poppersonselect.php 2010-06-30 08:36:28 UTC (rev 6426) @@ -1,126 +0,0 @@ -<?php -error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR); -require('./roots.php'); -require($root_path.'include/helpers/inc_environment_global.php'); -/** -* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02 -* GNU General Public License -* Copyright 2002,2003,2004,2005 Elpidio Latorilla -* elpi...@care2x.org, -* -* See the file "copy_notice.txt" for the licence notice -*/ -define('LANG_FILE','doctors.php'); -define('NO_2LEVEL_CHK',1); -require_once($root_path.'include/helpers/inc_front_chain_lang.php'); - -require_once($root_path.'include/helpers/inc_date_format_functions.php'); - -require_once($root_path.'modules/personell_admin/model/class_personell.php'); -$pers_obj=new Personell; -$doctors=&$pers_obj->getDoctorsOfDept($dept_nr); - -$wkday=date("w",mktime(0,0,0,$month,$elemid+1,$year)); -?> - -<?php html_rtl($lang); ?> -<HEAD> -<?php echo setCharSet(); ?> -<TITLE><?php echo $LDInfo4Duty ?></TITLE> - -<script language="javascript"> - -function closethis() -{ - window.opener.focus(); - window.close(); -} - - -function addelem(elem,hid,last,first,b,nr) -{ - - eval("window.opener.document.forms[0].elements[elem].value=last+','+first;"); - eval("window.opener.document.forms[0].elements[hid].value=nr;"); - -} - - - -<?php - -function weekday($daynum,$mon,$yr){ - $jd=gregoriantojd($mon,$daynum,$yr); - switch(JDDayOfWeek($jd,0)) - { - case 0: return "<font color=red>Sonntag</font>"; - case 1: return "Montag"; - case 2: return "Dienstag"; - case 3: return "Mittwoch"; - case 4: return "Donnerstag"; - case 5: return "Freitag"; - case 6: return "Samstag"; - } - } - -?> - -</script> - -<STYLE type=text/css> -div.box { border: double; border-width: thin; width: 100%; border-color: black; } -</style> - -</HEAD> -<BODY LINK="navy" VLINK="navy" onLoad="if (window.focus) window.focus()" > - -<font face=verdana,arial size=4 color=maroon> -<b> -<?php echo $LDDutyPlan ?><br> -<?php if ($mode=="a") echo '<font color="#006666">'.$LDDoc1.'</font>'; else echo $LDDoc2; -echo ' '.$LDOn.'<br>'; - - echo '<font color=navy>'; -/* if($month<10) echo '0'.$month; else echo $month; -*/ - echo formatDate2Local($year.'-'.$month.'-'.($elemid+1),$date_format); - - echo '</font> '.$LDFullDay[$wkday]; -?> -</b> -</font> -<p> - -<?php -if($pers_obj->record_count) -{ - echo '<ul> - <font face="verdana,arial" size=2>'; - - while($row=$doctors->FetchRow()) - { - echo ' - <a href="#" onClick="addelem(\''.$mode.$elemid.'\',\'h'.$mode.$elemid.'\',\''.ucfirst($row['name_last']).'\',\''.ucfirst($row['name_first']).'\',\''.$row['date_birth'].'\',\''.$row['personell_nr'].'\')"> - <img '; - if ($mode=="a") echo createComIcon($root_path,'mans-gr.gif','0') ; else echo createComIcon($root_path,'mans-red.gif','0'); - echo '> '.ucfirst($row['name_last']).', '.ucfirst($row['name_first']).'</a> - <br>'; - } - echo ' - </font></ul>'; -} -else -{ - echo '<form><font face="verdana,arial" size=2> - <img '.createMascot($root_path,'mascot1_r.gif','0','left').' > '.$LDNoPersonList.' - <p> - <input type="button" value="'.$LDCreatePersonList.'" onClick="window.opener.location.href=\'doctors-roster-personal-list.php?sid='.$sid.'&lang='.$lang.'&dept_nr='.$dept_nr.'&pmonth='.$month.'&pyear='.$year.'&retpath='.$retpath.'&ipath=plan\';window.opener.focus();window.close();"> - </form>'; -} -?> -<p><br> -<a href="javascript:closethis()"><img <?php echo createLDImgSrc($root_path,'close2.gif','0') ?> alt="<?php echo $LDCloseWindow ?>"></a> - -</BODY> - -</HTML> Copied: care2x/branches/gettext/modules/doctors/doctors-roster-plan.php (from rev 6425, care2x/branches/gettext/modules/doctors/doctors-dienstplan-planen.php) =================================================================== --- care2x/branches/gettext/modules/doctors/doctors-roster-plan.php (rev 0) +++ care2x/branches/gettext/modules/doctors/doctors-roster-plan.php 2010-06-30 08:36:28 UTC (rev 6426) @@ -0,0 +1,338 @@ +<?php +error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR); +require('./roots.php'); +require($root_path.'include/helpers/inc_environment_global.php'); +/** +* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02 +* GNU General Public License +* Copyright 2002,2003,2004,2005 Elpidio Latorilla +* elpi...@care2x.org, +* +* See the file "copy_notice.txt" for the licence notice +*/ +$lang_tables[]='departments.php'; +define('LANG_FILE','doctors.php'); +$local_user='ck_doctors_dienstplan_user'; +require_once($root_path.'include/helpers/inc_front_chain_lang.php'); + +if(!isset($dept_nr)||!$dept_nr){ + header('Location:doctors-select-dept.php'.URL_REDIRECT_APPEND.'&retpath='.$retpath); + exit; +} + +//$db->debug=1; + +$thisfile=basename(__FILE__); +$breakfile="doctors-rosterplan.php".URL_APPEND."&dept_nr=$dept_nr&pmonth=$pmonth&pyear=$pyear&retpath=$retpath"; + +require_once($root_path.'modules/dept_admin/model/class_department.php'); +$dept_obj=new Department; +$dept_obj->preloadDept($dept_nr); + +require_once($root_path.'modules/personell_admin/model/class_personell.php'); +$pers_obj=new Personell; +$pers_obj->useDutyplanTable(); + +if ($pmonth=='') $pmonth=date('n'); +if ($pyear=='') $pyear=date('Y'); + +/* Establish db connection */ +if(!isset($db)||!$db) include($root_path.'include/helpers/inc_db_makelink.php'); +if($dblink_ok) + { + if($mode=='save') + { + + $arr_1_txt=array(); + $arr_2_txt=array(); + $arr_1_pnr=array(); + $arr_2_pnr=array(); + + for($i=0;$i<$maxelement;$i++) + { + $tdx="ha".$i; + $ddx="hr".$i; + $ax="a".$i; + $rx="r".$i; + + if(!empty($$ax)) $arr_1_txt[$ax]=$$ax; + if(!empty($$rx)) $arr_2_txt[$rx]=$$rx; + if(!empty($$tdx)) $arr_1_pnr[$tdx]=$$tdx; + if(!empty($$ddx)) $arr_2_pnr[$ddx]=$$ddx; + + } + + $ref_buffer=array(); + // Serialize the data + $ref_buffer['duty_1_txt']=serialize($arr_1_txt); + $ref_buffer['duty_2_txt']=serialize($arr_2_txt); + $ref_buffer['duty_1_pnr']=serialize($arr_1_pnr); + $ref_buffer['duty_2_pnr']=serialize($arr_2_pnr); + + $ref_buffer['dept_nr']=$dept_nr; + $ref_buffer['role_nr']=15; + $ref_buffer['year']=$pyear; + $ref_buffer['month']=$pmonth; + $ref_buffer['modify_id']=$_SESSION['sess_user_name']; + + if($dpoc_nr=$pers_obj->DOCDutyplanExists($dept_nr,$pyear,$pmonth)){ + $ref_buffer['history']=$pers_obj->ConcatHistory("Update: ".date('Y-m-d H:i:s')." = ".$_SESSION['sess_user_name']."\n"); + $ref_buffer['modify_time']=date('YmdHis'); + // Point to the internal data array + $pers_obj->setDataArray($ref_buffer); + + if($pers_obj->updateDataFromInternalArray($dpoc_nr)){ + + # Remove the cache plan + if(date('Yn')=="$pyear$pmonth"){ + $pers_obj->deleteDBCache('DOCS_'.date('Y-m-d')); + } + header("location:$thisfile?sid=$sid&lang=$lang&saved=1&dept_nr=$dept_nr&pyear=$pyear&pmonth=$pmonth&retpath=$retpath"); + exit; + }else echo "<p>".$pers_obj->getLastQuery."<p>$LDDbNoSave"; + } // else create new entry + else + { + $ref_buffer['history']="Create: ".date('Y-m-d H:i:s')." = ".$_SESSION['sess_user_name']."\n"; + $ref_buffer['create_id']=$_SESSION['sess_user_name']; + $ref_buffer['create_time']=date('YmdHis'); + // Point to the internal data array + $pers_obj->setDataArray($ref_buffer); + + //echo "create"; + + if($pers_obj->insertDataFromInternalArray()){ + # Remove the cache plan + if(date('Yn')=="$pyear$pmonth"){ + $pers_obj->deleteDBCache('DOCS_'.date('Y-m-d')); + } + header("location:$thisfile?sid=$sid&lang=$lang&saved=1&dept_nr=$dept_nr&pyear=$pyear&pmonth=$pmonth&retpath=$retpath"); + exit; + }else{ + echo "<p>".$pers_obj->getLastQuery."<p>$LDDbNoSave"; + } + }//end of else + + }// end of if(mode==save) + else + { + if($dutyplan=&$pers_obj->getDOCDutyplan($dept_nr,$pyear,$pmonth)){ + + $aelems=unserialize($dutyplan['duty_1_txt']); + $relems=unserialize($dutyplan['duty_2_txt']); + $a_pnr=unserialize($dutyplan['duty_1_pnr']); + $r_pnr=unserialize($dutyplan['duty_2_pnr']); + } + } +} + else { echo "$LDDbNoLink<br>"; } + + +$maxdays=date("t",mktime(0,0,0,$pmonth,1,$pyear)); + +$firstday=date("w",mktime(0,0,0,$pmonth,1,$pyear)); + +function makefwdpath($path,$dpt,$mo,$yr,$saved) +{ + if ($path==1) + { + $fwdpath='doctors-rosterplan.php?'; + if($saved!="1") + { + if ($mo==1) {$mo=12; $yr--;} + else $mo--; + } + return $fwdpath.'dept='.$dpt.'&pmonth='.$mo.'&pyear='.$yr; + } + else return "doctors-rosterplan-checkpoint.php"; +} + +# Prepare page title + $sTitle = "$LDMakeDutyPlan :: "; + $LDvar=$dept_obj->LDvar(); + if(isset($$LDvar)&&$$LDvar) $sTitle = $sTitle.$$LDvar; + else $sTitle = $sTitle.$dept_obj->FormalName(); + +# Start Smarty templating here + /** + * LOAD Smarty + */ + + # Note: it is advisable to load this after the inc_front_chain_lang.php so + # that the smarty script can use the user configured template theme + + require_once($root_path.'gui/smarty_template/smarty_care.class.php'); + $smarty = new smarty_care('common'); + +# Title in toolbar + $smarty->assign('sToolbarTitle',$sTitle); + + # href for help button + $smarty->assign('pbHelp',"javascript:gethelp('docs_dutyplan_edit.php','$mode','$rows')"); + +# href for return button + $smarty->assign('pbBack','javascript:history.back();killchild();'); + + # href for close button + $smarty->assign('breakfile',$breakfile); + + # Body onLoad javascript + //$smarty->assign('sOnLoadJs','onUnload="killchild()"'); + + # Window bar title + $smarty->assign('sWindowTitle',$sTitle); + + # Collect extra javascript + + ob_start(); +?> + +<script language="javascript"> + + var urlholder; + var infowinflag=0; + +function popselect(elem,mode) +{ + w=window.screen.width; + h=window.screen.height; + ww=300; + wh=500; + var tmonth=document.dienstplan.month.value; + var tyear=document.dienstplan.jahr.value; + urlholder="doctors-roster-poppersonselect.php?elemid="+elem + "&dept_nr=<?php echo $dept_nr ?>&month="+tmonth+"&year="+tyear+ "&mode=" + mode + "&retpath=<?php echo $retpath ?>&user=<?php echo $ck_doctors_dienstplan_user."&lang=$lang&sid=$sid"; ?>"; + + popselectwin=window.open(urlholder,"pop","width=" + ww + ",height=" + wh + ",menubar=no,resizable=yes,scrollbars=yes,dependent=yes"); + window.popselectwin.moveTo((w/2)+80,(h/2)-(wh/2)); +} + +function killchild() +{ + if (window.popselectwin) if(!window.popselectwin.closed) window.popselectwin.close(); +} + +function cal_update() +{ + var filename="doctors-roster-plan.php?<?php echo "sid=$sid&lang=$lang" ?>&retpath=<?php echo $retpath ?>&dept_nr=<?php echo $dept_nr; ?>&pmonth="+document.dienstplan.month.value+"&pyear="+document.dienstplan.jahr.value; + window.location.replace(filename); +} +</script> +<?php + + $sTemp=ob_get_contents(); + ob_end_clean(); + $smarty->append('JavaScript',$sTemp); + + $smarty->assign('LDStandbyPerson',$LDDoc1); + $smarty->assign('LDOnCall',$LDDoc2); + +# Prepare the date selectors +$smarty->assign('LDMonth',$LDMonth); +$sBuffer = '<select name="month" size="1" onChange="cal_update()">'; + +for ($i=1;$i<13;$i++){ + $sBuffer = $sBuffer.'<option value="'.$i.'" '; + if (($pmonth)==$i) $sBuffer = $sBuffer.'selected'; + $sBuffer = $sBuffer.'>'.$monat[$i].'</option>'; + $sBuffer = $sBuffer."\n"; +} +$sBuffer = $sBuffer.'</select>'; +$smarty->assign('sMonthSelect',$sBuffer); + +$smarty->assign('LDYear',$LDYear); +$sBuffer = '<select name="jahr" size="1" onChange="cal_update()">'; + +for ($i=2000;$i<2016;$i++){ + $sBuffer = $sBuffer.'<option value="'.$i.'" '; + if ($pyear==$i) $sBuffer = $sBuffer.'selected'; + $sBuffer = $sBuffer.'>'.$i.'</option>'; + $sBuffer = $sBuffer."\n"; +} +$sBuffer = $sBuffer.'</select>'; +$smarty->assign('sYearSelect',$sBuffer); + +$smarty->assign('sFormAction','action="doctors-roster-plan.php"'); + + # collect hidden inputs + + ob_start(); +?> + +<input type="hidden" name="mode" value="save"> +<input type="hidden" name="dept" value="<?php echo $dept_obj->ID(); ?>"> +<input type="hidden" name="dept_nr" value="<?php echo $dept_nr; ?>"> +<input type="hidden" name="pmonth" value="<?php echo $pmonth; ?>"> +<input type="hidden" name="pyear" value="<?php echo $pyear; ?>"> +<input type="hidden" name="planid" value="<?php echo $ck_plan; ?>"> +<input type="hidden" name="maxelement" value="<?php echo $maxdays; ?>"> +<input type="hidden" name="encoder" value="<?php echo $ck_doctors_dienstplan_user; ?>"> +<input type="hidden" name="retpath" value="<?php echo $retpath; ?>"> +<input type="hidden" name="lang" value="<?php echo $lang; ?>"> +<input type="hidden" name="sid" value="<?php echo $sid; ?>"> + +<?php + + $sTemp=ob_get_contents(); + ob_end_clean(); + $smarty->assign('sHiddenInputs',$sTemp); + + if($saved) $sBuffer = createLDImgSrc($root_path,'close2.gif','0'); + else $sBuffer = createLDImgSrc($root_path,'cancel.gif','0'); + + # Assign control links +$smarty->assign('sSave','<input type="image" '.createLDImgSrc($root_path,'savedisc.gif','0').'"></a>'); +$smarty->assign('sClose',"<a href=\"$breakfile\" onUnload=\"killchild()\"><img ".$sBuffer." alt=\"$LDClosePlan\"></a>"); + +$sTemp=''; + +for ($i=1,$n=0,$wd=$firstday;$i<=$maxdays;$i++,$n++,$wd++) +{ + switch ($wd){ + //case 6: $backcolor="bgcolor=#ffffcc";break; + //case 0: $backcolor="bgcolor=#ffff00";break; + //default: $backcolor="bgcolor=white"; + case 6: $smarty->assign('sRowClass','class="saturday"');break; + case 0: $smarty->assign('sRowClass','class="sunday"');break; + default: $smarty->assign('sRowClass','class="weekday"'); + } + + $smarty->assign('iDayNr',$i); + $smarty->assign('LDShortDay',$LDShortDay[$wd]); + + if ($aelems['a'.$n]=="") $smarty->assign('sIcon1','<img '.createComIcon($root_path,'warn.gif','0').'>'); + else $smarty->assign('sIcon1','<img '.createComIcon($root_path,'mans-gr.gif','0').'>'); + $smarty->assign('sInput1','<input type="hidden" name="ha'.$n.'" value="'.$a_pnr['ha'.$n].'"> + <input type="text" name="a'.$n.'" size="15" onFocus=this.select() value="'.$aelems['a'.$n].'">'); + + $smarty->assign('sPopWin1','<a href="javascript:popselect(\''.$n.'\',\'a\')"> + <button onclick="javascript:popselect(\''.$n.'\',\'a\')"><img '.createComIcon($root_path,'patdata.gif','0').' alt="'.$LDClk2Plan.'"></button></a>'); + + if ($relems['r'.$n]=="") $smarty->assign('sIcon2','<img '.createComIcon($root_path,'warn.gif','0').'>'); + else $smarty->assign('sIcon2','<img '.createComIcon($root_path,'mans-red.gif','0').'>'); + $smarty->assign('sInput2','<input type="hidden" name="hr'.$n.'" value="'.$r_pnr['hr'.$n].'"> + <input type="text" size="15" name="r'.$n.'" onFocus=this.select() value="'.$relems['r'.$n].'">'); + + $smarty->assign('sPopWin2','<a href="javascript:popselect(\''.$n.'\',\'r\')"> + <button onclick="javascript:popselect(\''.$n.'\',\'r\')"><img '.createComIcon($root_path,'patdata.gif','0').' alt="'.$LDClk2Plan.'"></button></a>'); + if($wd==6) $wd=-1; + + # Buffer each row and collect to a string + + ob_start(); + $smarty->display('common/duty_plan_entry_row.tpl'); + $sTemp = $sTemp.ob_get_contents(); + ob_end_clean(); +} + +# Assign the duty entry rows to the subframe template + + $smarty->assign('sDutyRows',$sTemp); + + +$smarty->assign('sMainBlockIncludeFile','common/duty_plan_entry_frame.tpl'); + /** + * show Template + */ + $smarty->display('common/mainframe.tpl'); + +?> Copied: care2x/branches/gettext/modules/doctors/doctors-roster-poppersonselect.php (from rev 6424, care2x/branches/gettext/modules/doctors/doctors-dienstplan-poppersonselect.php) =================================================================== --- care2x/branches/gettext/modules/doctors/doctors-roster-poppersonselect.php (rev 0) +++ care2x/branches/gettext/modules/doctors/doctors-roster-poppersonselect.php 2010-06-30 08:36:28 UTC (rev 6426) @@ -0,0 +1,126 @@ +<?php +error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR); +require('./roots.php'); +require($root_path.'include/helpers/inc_environment_global.php'); +/** +* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02 +* GNU General Public License +* Copyright 2002,2003,2004,2005 Elpidio Latorilla +* elpi...@care2x.org, +* +* See the file "copy_notice.txt" for the licence notice +*/ +define('LANG_FILE','doctors.php'); +define('NO_2LEVEL_CHK',1); +require_once($root_path.'include/helpers/inc_front_chain_lang.php'); + +require_once($root_path.'include/helpers/inc_date_format_functions.php'); + +require_once($root_path.'modules/personell_admin/model/class_personell.php'); +$pers_obj=new Personell; +$doctors=&$pers_obj->getDoctorsOfDept($dept_nr); + +$wkday=date("w",mktime(0,0,0,$month,$elemid+1,$year)); +?> + +<?php html_rtl($lang); ?> +<HEAD> +<?php echo setCharSet(); ?> +<TITLE><?php echo $LDInfo4Duty ?></TITLE> + +<script language="javascript"> + +function closethis() +{ + window.opener.focus(); + window.close(); +} + + +function addelem(elem,hid,last,first,b,nr) +{ + + eval("window.opener.document.forms[0].elements[elem].value=last+','+first;"); + eval("window.opener.document.forms[0].elements[hid].value=nr;"); + +} + + + +<?php + +function weekday($daynum,$mon,$yr){ + $jd=gregoriantojd($mon,$daynum,$yr); + switch(JDDayOfWeek($jd,0)) + { + case 0: return "<font color=red>Sonntag</font>"; + case 1: return "Montag"; + case 2: return "Dienstag"; + case 3: return "Mittwoch"; + case 4: return "Donnerstag"; + case 5: return "Freitag"; + case 6: return "Samstag"; + } + } + +?> + +</script> + +<STYLE type=text/css> +div.box { border: double; border-width: thin; width: 100%; border-color: black; } +</style> + +</HEAD> +<BODY LINK="navy" VLINK="navy" onLoad="if (window.focus) window.focus()" > + +<font face=verdana,arial size=4 color=maroon> +<b> +<?php echo $LDDutyPlan ?><br> +<?php if ($mode=="a") echo '<font color="#006666">'.$LDDoc1.'</font>'; else echo $LDDoc2; +echo ' '.$LDOn.'<br>'; + + echo '<font color=navy>'; +/* if($month<10) echo '0'.$month; else echo $month; +*/ + echo formatDate2Local($year.'-'.$month.'-'.($elemid+1),$date_format); + + echo '</font> '.$LDFullDay[$wkday]; +?> +</b> +</font> +<p> + +<?php +if($pers_obj->record_count) +{ + echo '<ul> + <font face="verdana,arial" size=2>'; + + while($row=$doctors->FetchRow()) + { + echo ' + <a href="#" onClick="addelem(\''.$mode.$elemid.'\',\'h'.$mode.$elemid.'\',\''.ucfirst($row['name_last']).'\',\''.ucfirst($row['name_first']).'\',\''.$row['date_birth'].'\',\''.$row['personell_nr'].'\')"> + <img '; + if ($mode=="a") echo createComIcon($root_path,'mans-gr.gif','0') ; else echo createComIcon($root_path,'mans-red.gif','0'); + echo '> '.ucfirst($row['name_last']).', '.ucfirst($row['name_first']).'</a> + <br>'; + } + echo ' + </font></ul>'; +} +else +{ + echo '<form><font face="verdana,arial" size=2> + <img '.createMascot($root_path,'mascot1_r.gif','0','left').' > '.$LDNoPersonList.' + <p> + <input type="button" value="'.$LDCreatePersonList.'" onClick="window.opener.location.href=\'doctors-roster-personal-list.php?sid='.$sid.'&lang='.$lang.'&dept_nr='.$dept_nr.'&pmonth='.$month.'&pyear='.$year.'&retpath='.$retpath.'&ipath=plan\';window.opener.focus();window.close();"> + </form>'; +} +?> +<p><br> +<a href="javascript:closethis()"><img <?php echo createLDImgSrc($root_path,'close2.gif','0') ?> alt="<?php echo $LDCloseWindow ?>"></a> + +</BODY> + +</HTML> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Care2002-developers mailing list Care2002-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/care2002-developers