Author: danydb Date: 2011-10-13 22:06:13 +0200 (Thu, 13 Oct 2011) New Revision: 4209
Added: phpcompta/branches/rel600-dynamic-menu/html/do.php phpcompta/branches/rel600-dynamic-menu/include/dashboard.inc.php phpcompta/branches/rel600-dynamic-menu/include/template/menu.php phpcompta/branches/rel600-dynamic-menu/include/template/module.php Log: Add new files Added: phpcompta/branches/rel600-dynamic-menu/html/do.php =================================================================== --- phpcompta/branches/rel600-dynamic-menu/html/do.php (rev 0) +++ phpcompta/branches/rel600-dynamic-menu/html/do.php 2011-10-13 20:06:13 UTC (rev 4209) @@ -0,0 +1,61 @@ +<?php + +/* + * This file is part of PhpCompta. + * + * PhpCompta is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpCompta is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PhpCompta; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +/* $Revision$ */ + +// Copyright Author Dany De Bontridder [email protected] + +/* !\file + * \brief Main file + */ + +require_once ('class_dossier.php'); +require_once('user_common.php'); +require_once('ac_common.php'); +require_once 'function_javascript.php'; +html_page_start(); +global $g_user; + +$cn=new Database(Dossier::id()); +$g_user=new User($cn); +// Display available menu in the right order +load_all_script(); + +$module_selected = -1; + +if (isset($_REQUEST['ac'])) +{ + $all = explode(':', $_REQUEST['ac']); + $module_selected = $all[0]; +} + +// Show module and highligt selected one +show_module($module_selected); + +// if $module_selected != -1, +if ($module_selected != - 1) +{ + // show the menu + show_menu($all); + +} +else +{ + show_default(); +} Added: phpcompta/branches/rel600-dynamic-menu/include/dashboard.inc.php =================================================================== --- phpcompta/branches/rel600-dynamic-menu/include/dashboard.inc.php (rev 0) +++ phpcompta/branches/rel600-dynamic-menu/include/dashboard.inc.php 2011-10-13 20:06:13 UTC (rev 4209) @@ -0,0 +1,39 @@ +<?php +require_once("class_idate.php"); +require_once("class_itext.php"); +require_once ('constant.php'); +require_once ('ac_common.php'); +require_once ('class_user.php'); +require_once('class_acc_report.php'); +require_once('class_periode.php'); +require_once ('user_menu.php'); +require_once ('class_dossier.php'); +require_once('class_todo_list.php'); +require_once("class_itextarea.php"); +require_once('class_calendar.php'); +require_once('class_acc_ledger.php'); +echo '<div class="content">'; +global $g_user; +/* others report */ +$cal=new Calendar(); +$cal->get_preference(); +$Ledger=new Acc_Ledger($cn,0); +$last_ledger=array(); +if ( $g_user->check_action(GESTION)==1) + { + $Operation=new Action($cn); + $last_ledger=$Ledger->get_last(10); + $last_operation=$Operation->get_last(10); + } +else + { + $last_operation=array(); + } +ob_start(); +require_once('template/dashboard.php'); +$ret=ob_get_contents(); +ob_end_clean(); +echo $ret; + +echo '</div>'; +?> Added: phpcompta/branches/rel600-dynamic-menu/include/template/menu.php =================================================================== --- phpcompta/branches/rel600-dynamic-menu/include/template/menu.php (rev 0) +++ phpcompta/branches/rel600-dynamic-menu/include/template/menu.php 2011-10-13 20:06:13 UTC (rev 4209) @@ -0,0 +1,87 @@ +<div class="topmenu"> +<table style="width:100%"> + <tr> + <?php + for($i=0;$i < count($amenu);$i++): + if ( isset($module[1]) && $module[1]==$amenu[$i]['me_id']): + $class="selectedcell"; + else: + $class="mtitle"; + endif; + ?> + <td class="<?=$class?>"> + <a class="mtitle" href="do.php?gDossier=<?=Dossier::id()?>&ac=<?=$module[0]?>:<?=$amenu[$i]['me_id']?>"> + <?=$amenu[$i]['me_menu']?> + </a> + </td> + <? + endfor; + ?> + </tr> + + +</table> +</div> +<div class="content"> +<? +// If something is selected, display the file +if ( count($module)>1): + $file_to_include=$cn->get_array("select me_file,me_submenu from menu_ref + join menu using(me_code) + where + m_code=$1 and me_id=$2",array($module[0],$module[1])); +$gDossier=dossier::id(); +?> + +<?php +// if submenu is not null then we show the submenu +if ( $file_to_include[0]['me_file'] == ''): + ?> + <div class="lmenu"> + <table> + <tr> + <?php + $submenu=$cn->get_array("select me_id,me_code,me_menu,me_file from menu + join menu_ref using(me_code) + where + me_submenu in (select me_code from + menu where me_id=$1)",array($module[1])); + for ($e=0;$e<count($submenu);$e++): + $style="mtitle"; + if (isset ($module[2]) && $module[2]==$submenu[$e]['me_id']): + $style="selectedcell"; + endif; + ?> + <td class="<?=$style?>"> + <a href="do.php?gDossier=<?=Dossier::id()?>&ac=<?=$module[0]?>:<?=$module[1]?>:<?=$submenu[$e]['me_id']?>"> + <?=$submenu[$e]['me_menu']?> + </a> + </td> + <? + endfor; + ?> + </tr> + </table> + </div> + <?php + $file=""; + if (isset ($module[2])): + $file=$cn->get_value("select me_file from menu + join menu_ref using (me_code) + where me_id=$1",array($module[2])); + endif; + else: + $file=$file_to_include[0]['me_file']; + endif; +?> + + + +<?php +// otherwise we include the file +if ($file != ''): + require_once "$file"; +endif; +endif; +?> +</div> Added: phpcompta/branches/rel600-dynamic-menu/include/template/module.php =================================================================== --- phpcompta/branches/rel600-dynamic-menu/include/template/module.php (rev 0) +++ phpcompta/branches/rel600-dynamic-menu/include/template/module.php 2011-10-13 20:06:13 UTC (rev 4209) @@ -0,0 +1,40 @@ +<div class="u_tool"> + <div class="name"> + + <H2 class="dossier"> Dossier : <?=h(dossier::name())?></h2> + <?=IButton::show_calc()?> + </div> + <div class="acces_direct"> + <table> + <tr> + <?php + foreach ($amodule as $row): + + $style="background:white"; + if ( $row['m_menu']=='new_line') + { + echo "</tr><tr>"; + continue; + } + if ($row['m_code']==$selected) + { + $style="background:red"; + } + if ( $row['m_url']!='') + { + $url=$row['m_url']; + } + else + { + $url="do.php?gDossier=".Dossier::id()."&ac=".$row['m_code']; + } + ?> + <td class="tool" style="<?=$style?>"><a class="mtitle" href="<?=$url?>"><?=$row['m_menu']?></td> + <? + endforeach; + ?> + </tr> + </table> + + </div> +</div> \ No newline at end of file _______________________________________________ Phpcompta-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/phpcompta-dev
