Index: /trunk/expressoCalendar/index.php
===================================================================
--- /trunk/expressoCalendar/index.php	(revision 6801)
+++ /trunk/expressoCalendar/index.php	(revision 7642)
@@ -13,11 +13,8 @@
         
         $_SESSION['flags']['currentapp'] = 'expressoCalendar';
-
+ 
 	define( 'MODULESURL' , '../prototype/modules/calendar' );
 	define( 'PLUGINSURL' , '../prototype/plugins' );
-        
-        include ROOTPATH.'/modules/calendar/templates/index.ejs';
-    
-        
-        
+  include ROOTPATH.'/modules/calendar/templates/index.ejs';
+  echo '<script type="text/javascript" src="../prototype/modules/calendar/assetic.php"></script>';      
 ?>
Index: /trunk/prototype/modules/calendar/assetic.php
===================================================================
--- /trunk/prototype/modules/calendar/assetic.php	(revision 7642)
+++ /trunk/prototype/modules/calendar/assetic.php	(revision 7642)
@@ -0,0 +1,96 @@
+<?php
+use Assetic\Asset\AssetCache;
+use Assetic\Asset\AssetCollection;
+use Assetic\Asset\FileAsset;
+use Assetic\Asset\GlobAsset;
+use Assetic\Filter\Yui;
+use Assetic\FilterManager;
+use Assetic\Filter;
+use Assetic\Cache\FilesystemCache;
+
+spl_autoload_register(
+    function($className)
+    {
+        $className = str_replace("_", "\\", $className);
+        $className = ltrim($className, '\\');
+        $fileName = '';
+        $namespace = '';
+        if ($lastNsPos = strripos($className, '\\'))
+        {
+            $namespace = substr($className, 0, $lastNsPos);
+            $className = substr($className, $lastNsPos + 1);
+            $fileName = '../../library/' . str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
+        }
+        $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
+        require $fileName;
+    }
+);
+
+define( 'MODULESURL' , '../../modules/calendar' );
+define( 'PLUGINSURL' , '../../plugins' );
+$javaVersion = shell_exec("java -version 2>&1");
+$filterManager = new FilterManager();
+
+$js = new AssetCollection(array(    
+        new FileAsset(MODULESURL.'/js/debug.js'),
+        //new FileAsset(PLUGINSURL.'/datejs/date-pt-BR.js'),    
+        new FileAsset(PLUGINSURL.'/icalendar/jquery.icalendar.js'),
+        new FileAsset(PLUGINSURL.'/jquery/jquery-ui.custom.min.js'),
+        new FileAsset(PLUGINSURL.'/jquery/i18n/jquery.ui.datepicker-pt-BR.js'),
+        new FileAsset(PLUGINSURL.'/timepicker/jquery-ui-timepicker-addon.js'),
+        new FileAsset(PLUGINSURL.'/timepicker/localization/jquery-ui-timepicker-pt-BR.js'),       
+        new FileAsset(PLUGINSURL.'/json2/json2.js'),
+        new FileAsset(PLUGINSURL.'/store/jquery.store.js'),
+        new FileAsset(PLUGINSURL.'/fileupload/jquery.fileupload.js'),
+        new FileAsset(PLUGINSURL.'/fileupload/jquery.iframe-transport.js'),
+        new FileAsset(PLUGINSURL.'/jquery.pagination/jquery.pagination.js'),
+        //new FileAsset(PLUGINSURL.'/mask/jquery.maskedinput.js'),
+        new FileAsset(PLUGINSURL.'/alphanumeric/jquery.alphanumeric.js'),
+        new FileAsset(PLUGINSURL.'/watermark/jquery.watermarkinput.js'),
+        new FileAsset(PLUGINSURL.'/encoder/encoder.js'),      
+        //new FileAsset(PLUGINSURL.'/datejs/sugarpak.js'),
+        //new FileAsset(PLUGINSURL.'/datejs/parser.js'),
+        new FileAsset(PLUGINSURL.'/dateFormat/dateFormat.js'),
+        new FileAsset(PLUGINSURL.'/fullcalendar/fullcalendar.js'),
+        new FileAsset(PLUGINSURL.'/fullcalendar/gcal.js'),
+        new FileAsset(PLUGINSURL.'/jquery.dateFormat/jquery.dateFormat.js'),  
+        new FileAsset(PLUGINSURL.'/zebradialog/javascript/zebra_dialog.js'),
+        new FileAsset(PLUGINSURL.'/scrollto/jquery.scrollTo.js'),
+        new FileAsset(PLUGINSURL.'/ejs/ejs.js'),
+        new FileAsset(PLUGINSURL.'/fgmenu/fg.menu.js'),
+        new FileAsset(PLUGINSURL.'/qtip/jquery.qtip-1.0.0-rc3.min.js'),
+        //new FileAsset(PLUGINSURL.'/contextmenu/jquery.contextMenu.js'),
+        new FileAsset(PLUGINSURL.'/jquery.spinner/jquery.spinner.min.js'),
+        //new FileAsset(PLUGINSURL.'/jpicker/jpicker-1.1.6.min.js'),
+        //new FileAsset(PLUGINSURL.'/farbtastic/farbtastic.js'),
+        new FileAsset(MODULESURL.'/js/base64.js'),
+        new FileAsset(MODULESURL.'/js/map.disponibility.js'),
+        //new FileAsset(MODULESURL.'/js/calendar.date.js'),
+        new FileAsset(MODULESURL.'/js/activity.helpers.js'),
+        new FileAsset(MODULESURL.'/js/task.helpers.js'),
+        new FileAsset(MODULESURL.'/js/helpers.js'),
+        new FileAsset(MODULESURL.'/js/calendar.shared.js'),
+        new FileAsset(MODULESURL.'/js/timezone.js'),
+        new FileAsset(MODULESURL.'/js/calendar.codecs.js'),
+        new FileAsset(MODULESURL.'/js/load.js'),
+        new FileAsset(MODULESURL.'/js/calendar.alarms.js'),
+        new FileAsset(MODULESURL.'/js/I18n.js'),
+        new FileAsset(MODULESURL.'/js/calendar.contentMenu.js'),
+        new FileAsset(MODULESURL.'/js/init.js'),
+        new FileAsset(MODULESURL.'/js/drag_area.js'),
+        new FileAsset(MODULESURL.'/js/desktop.notification.js')
+    )
+);
+
+$compressor = new Yui\JsCompressorFilter('../../library/yuicompressor/yuicompressor.jar');
+$compressor->setCharset("ISO-8859-1");
+
+if (strpos($javaVersion,"java version") !== false){
+    $filterManager->set('yui_js', $compressor);    
+    $js->ensureFilter($filterManager->get('yui_js'));    
+}
+
+$jsCache = new AssetCache($js,new FilesystemCache('/tmp'));
+echo $jsCache->dump();
+
+?>
Index: /trunk/prototype/modules/calendar/templates/index.ejs
===================================================================
--- /trunk/prototype/modules/calendar/templates/index.ejs	(revision 7023)
+++ /trunk/prototype/modules/calendar/templates/index.ejs	(revision 7642)
@@ -6,10 +6,11 @@
 
 <!--<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />-->
-<script type='text/javascript' src='<?= MODULESURL ?>/js/debug.js'></script>
+<!-- assetic -->
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/debug.js'></script>-->
+<!-- fim de assetic -->
 <link rel="stylesheet" type="text/css" href="<?= MODULESURL ?>/css/reset.css" />
 
 <link rel='stylesheet' type='text/css' href='<?= PLUGINSURL ?>/fullcalendar/fullcalendar.css' />
 <link rel='stylesheet' type='text/css' href='<?= PLUGINSURL ?>/fullcalendar/fullcalendar.print.css' media='print' />
-
 <link rel='stylesheet' type='text/css' href='<?= PLUGINSURL ?>/jquery/jquery-ui.css'/>
 <link rel='stylesheet' type='text/css' href='<?= PLUGINSURL ?>/icalendar/jquery.icalendar.css'/>
@@ -32,23 +33,29 @@
 <link rel="stylesheet" type="text/css" href="<?= MODULESURL ?>/css/style.css" />
 
+<!-- assetic -->
 <script type='text/javascript' src='<?= PLUGINSURL ?>/datejs/date-pt-BR.js'></script>
 <script type='text/javascript' src='<?= PLUGINSURL ?>/jquery/jquery.min.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/icalendar/jquery.icalendar.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/jquery/jquery-ui.custom.min.js'></script>
-<script type='text/javascript' src="<?= PLUGINSURL ?>/jquery/i18n/jquery.ui.datepicker-pt-BR.js"></script>
-<script type='text/javascript' src="<?= PLUGINSURL ?>/timepicker/jquery-ui-timepicker-addon.js"></script>
-<script type='text/javascript' src="<?= PLUGINSURL ?>/timepicker/localization/jquery-ui-timepicker-pt-BR.js"></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/json2/json2.js'></script>
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/icalendar/jquery.icalendar.js'></script>-->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/jquery/jquery-ui.custom.min.js'></script>-->
+<!--<script type='text/javascript' src="<?= PLUGINSURL ?>/jquery/i18n/jquery.ui.datepicker-pt-BR.js"></script>-->
+<!--<script type='text/javascript' src="<?= PLUGINSURL ?>/timepicker/jquery-ui-timepicker-addon.js"></script>-->
+<!--<script type='text/javascript' src="<?= PLUGINSURL ?>/timepicker/localization/jquery-ui-timepicker-pt-BR.js"></script>-->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/json2/json2.js'></script>-->
 <script type='text/javascript' src='<?= PLUGINSURL ?>/store/jquery.store.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/fileupload/jquery.fileupload.js'></script>
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/fileupload/jquery.fileupload.js'></script>-->
+<!-- fim de assetic -->
+
 <!--<script type='text/javascript' src='<?= PLUGINSURL ?>/fileupload/jquery.fileupload-ui.js'></script>-->
-<script type='text/javascript' src='<?= PLUGINSURL ?>/fileupload/jquery.iframe-transport.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/store/jquery.store.js'></script>
-<script type="text/javascript" src="<?= PLUGINSURL ?>/jquery.pagination/jquery.pagination.js"></script>
+
+<!-- assetic -->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/fileupload/jquery.iframe-transport.js'></script>-->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/store/jquery.store.js'></script>-->
+<!--<script type="text/javascript" src="<?= PLUGINSURL ?>/jquery.pagination/jquery.pagination.js"></script>-->
 <script type='text/javascript' src='<?= PLUGINSURL ?>/mask/jquery.maskedinput.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/alphanumeric/jquery.alphanumeric.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/watermark/jquery.watermarkinput.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/encoder/encoder.js'></script>
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/alphanumeric/jquery.alphanumeric.js'></script>-->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/watermark/jquery.watermarkinput.js'></script>-->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/encoder/encoder.js'></script>-->
 <script type='text/javascript' src='<?= PLUGINSURL ?>/../api/datalayer.js'></script>
+<!-- fim de assetic -->
 
 <!-- Datejs -->    
@@ -56,53 +63,59 @@
 <!-- <script type='text/javascript' src='<?= PLUGINSURL ?>/datejs/date-pt-BR.js'></script>-->
 <!-- <script type='text/javascript' src='<?= PLUGINSURL ?>/datejs/globalization/pt-BR.js'></script> -->
+<!-- assetic -->
 <script type='text/javascript' src='<?= PLUGINSURL ?>/datejs/sugarpak.js'></script>
 <script type='text/javascript' src='<?= PLUGINSURL ?>/datejs/parser.js'></script>
+<!-- fim de assetic -->
+<!--  <script type='text/javascript' src='<?= ROOTPATH ?>datejs/time.js'></script>  -->
+<!-- assetic -->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/dateFormat/dateFormat.js'></script>-->
+<!-- fim de assetic -->
+<!--<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>-->
 
-<!--  <script type='text/javascript' src='<?= ROOTPATH ?>datejs/time.js'></script>  -->
-<script type='text/javascript' src='<?= PLUGINSURL ?>/dateFormat/dateFormat.js'></script>
-<!--<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>-->
-<script type='text/javascript' src='<?= PLUGINSURL ?>/fullcalendar/fullcalendar.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/fullcalendar/gcal.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/jquery.dateFormat/jquery.dateFormat.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/zebradialog/javascript/zebra_dialog.js'></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/scrollto/jquery.scrollTo.js'></script>
+<!-- assetic -->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/fullcalendar/fullcalendar.js'></script>-->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/fullcalendar/gcal.js'></script>-->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/jquery.dateFormat/jquery.dateFormat.js'></script>-->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/zebradialog/javascript/zebra_dialog.js'></script>-->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/scrollto/jquery.scrollTo.js'></script>-->
+<!-- fim de assetic -->
+
 <!-- <script type='text/javascript' src='<?= PLUGINSURL ?>/view/jquerymx-1.0.custom.min.js'></script> -->
-<script type='text/javascript' src='<?= PLUGINSURL ?>/ejs/ejs.js'></script>
-<script type="text/javascript" src="<?= PLUGINSURL ?>/fgmenu/fg.menu.js"></script>
-<script type="text/javascript" src="<?= PLUGINSURL ?>/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>
+<!-- assetic -->
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/ejs/ejs.js'></script>-->
+<!--<script type="text/javascript" src="<?= PLUGINSURL ?>/fgmenu/fg.menu.js"></script>-->
+<!--<script type="text/javascript" src="<?= PLUGINSURL ?>/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>-->
 <script type="text/javascript" src="<?= PLUGINSURL ?>/contextmenu/jquery.contextMenu.js"></script>
-<script type='text/javascript' src='<?= PLUGINSURL ?>/jquery.spinner/jquery.spinner.min.js'></script>
+<!--<script type='text/javascript' src='<?= PLUGINSURL ?>/jquery.spinner/jquery.spinner.min.js'></script>-->
 
 <!-- JPicker -->
-<script type="text/javascript" src="<?= PLUGINSURL ?>/jpicker/jpicker-1.1.6.min.js"></script>
+<!--<script type="text/javascript" src="<?= PLUGINSURL ?>/jpicker/jpicker-1.1.6.min.js"></script>-->
 <script type="text/javascript" src="<?= PLUGINSURL ?>/farbtastic/farbtastic.js"></script>
 
 <script type="text/javascript">
-
-DataLayer.dispatchPath = '<?= PLUGINSURL ?>/../';
-DataLayer.templatePath = '<?= MODULESURL ?>/';
-
+	DataLayer.dispatchPath = '<?= PLUGINSURL ?>/../';
+	DataLayer.templatePath = '<?= MODULESURL ?>/';
 </script>
-
-<script type='text/javascript' src='<?= MODULESURL ?>/js/base64.js'></script>
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/base64.js'></script>-->
 <script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.date.js'></script>
 
-<script type='text/javascript' src='<?= MODULESURL ?>/js/map.disponibility.js'></script>
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/map.disponibility.js'></script>-->
 
-<script type='text/javascript' src='<?= MODULESURL ?>/js/activity.helpers.js'></script>
-<script type='text/javascript' src='<?= MODULESURL ?>/js/task.helpers.js'></script>
-<script type='text/javascript' src='<?= MODULESURL ?>/js/helpers.js'></script>
-<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.shared.js'></script>
-<script type='text/javascript' src='<?= MODULESURL ?>/js/timezone.js'></script>
-<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.codecs.js'></script>
-<script type='text/javascript' src='<?= MODULESURL ?>/js/load.js'></script>	
-<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.alarms.js'></script>	
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/activity.helpers.js'></script>-->
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/task.helpers.js'></script>-->
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/helpers.js'></script>-->
 
-<script type='text/javascript' src='<?= MODULESURL ?>/js/I18n.js'></script>
-<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.contentMenu.js'></script>
-<script type="text/javascript" src="<?= MODULESURL ?>/js/init.js"></script>
-<script type="text/javascript" src="<?= MODULESURL ?>/js/drag_area.js"></script>
-<script type="text/javascript" src="<?= MODULESURL ?>/js/desktop.notification.js"></script>
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.shared.js'></script>-->
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/timezone.js'></script>-->
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.codecs.js'></script>-->
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/load.js'></script>	-->
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.alarms.js'></script>-->
 
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/I18n.js'></script>-->
+<!--<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.contentMenu.js'></script>-->
+<!--<script type="text/javascript" src="<?= MODULESURL ?>/js/init.js"></script>-->
+<!--<script type="text/javascript" src="<?= MODULESURL ?>/js/drag_area.js"></script>-->
+<!--<script type="text/javascript" src="<?= MODULESURL ?>/js/desktop.notification.js"></script>-->
+<!-- fim de assetic -->
 </head>
 
