phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r5627 - in phpcompta/trunk/include: . template


From: phpcompta-dev
Subject: [Phpcompta-dev] r5627 - in phpcompta/trunk/include: . template
Date: Mon, 30 Dec 2013 15:36:56 +0100 (CET)

Author: danydb
Date: 2013-12-30 15:36:56 +0100 (Mon, 30 Dec 2013)
New Revision: 5627

Added:
   phpcompta/trunk/include/calendar.inc.php
Modified:
   phpcompta/trunk/include/class_calendar.php
   phpcompta/trunk/include/template/dashboard.php
Log:
Agenda de base
Task #957 - Agenda

Added: phpcompta/trunk/include/calendar.inc.php
===================================================================
--- phpcompta/trunk/include/calendar.inc.php                            (rev 0)
+++ phpcompta/trunk/include/calendar.inc.php    2013-12-30 14:36:56 UTC (rev 
5627)
@@ -0,0 +1,16 @@
+<?php
+/**
+ * @file
+ * @brief show the calendar
+ */
+if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
+
+require_once 'class_calendar.php';
+$cal=new Calendar();
+$cal->default_periode=(isset ($_GET['in']))?$_GET['in']:$g_user->get_periode();
+
+?>
+<div id="calendar_zoom_div">
+    
+<?php echo $cal->display('long'); ?>
+</div>
\ No newline at end of file

Modified: phpcompta/trunk/include/class_calendar.php
===================================================================
--- phpcompta/trunk/include/class_calendar.php  2013-12-29 03:30:41 UTC (rev 
5626)
+++ phpcompta/trunk/include/class_calendar.php  2013-12-30 14:36:56 UTC (rev 
5627)
@@ -147,12 +147,16 @@
         }
     }
     /*!\brief display a calendar after a call to Calendar::fill
-     *\param none
+     *\param $p_type long or short
+     * 
      *\return HTML String
      */
-    function display()
+    function display($p_type)
     {
         global $g_user;
+        if  ($p_type != 'long' && $p_type != 'short') {
+            throw new Exception("Calendar::display, unknow type");
+        }
         $exercice_user=$g_user->get_exercice();
         /* day */
         $cell=array();
@@ -164,17 +168,18 @@
         /* weekday */
         
$week=array(_('Dimanche'),_('Lundi'),_('Mardi'),_('Mercredi'),_('Jeudi'),_('Vendredi'),_('Samedi'));
 
-        $this->fill_from_action($cell,"short");
-        $this->fill_from_todo($cell,"short");
+        $this->fill_from_action($cell,$p_type);
+        $this->fill_from_todo($cell,$p_type);
         $wMonth=new ISelect('per');
         $cn=new Database(dossier::id());
         $wMonth->value=$cn->make_array("select p_id,to_char(p_start,'MM/YYYY') 
from parm_periode where p_exercice = '$exercice_user' order by p_start");
         $wMonth->selected=$this->default_periode;
         $wMonth->javascript="onchange=change_month(this)";
         $wMonth->set_attribute('gDossier',dossier::id());
+        $wMonth->set_attribute('type_display',$p_type);
         $month_year=$wMonth->input().$wMonth->get_js_attr();
         ob_start();
-        $zoom=0;
+        $zoom=($p_type=='short')?0:1;
         require_once('template/calendar.php');
 
                if (count($this->action_div) > 0)

Modified: phpcompta/trunk/include/template/dashboard.php
===================================================================
--- phpcompta/trunk/include/template/dashboard.php      2013-12-29 03:30:41 UTC 
(rev 5626)
+++ phpcompta/trunk/include/template/dashboard.php      2013-12-30 14:36:56 UTC 
(rev 5627)
@@ -259,7 +259,7 @@
 <legend><?php echo _('Calendrier')?>
 </legend>
 <?php echo HtmlInput::calendar_zoom($obj); ?>
-<?php echo $cal->display(); ?>
+<?php echo $cal->display('short'); ?>
 </fieldset>
 </div>
 <!-- Mini rapport -->



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]