fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7602]


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [7602]
Date: Thu, 15 Sep 2011 08:30:19 +0000

Revision: 7602
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7602
Author:   erikhl
Date:     2011-09-15 08:30:11 +0000 (Thu, 15 Sep 2011)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.menu.inc.php
    trunk/controller/inc/class.soprocedure.inc.php

Added Paths:
-----------
    trunk/controller/templates/base/procedure.php
    trunk/controller/templates/base/procedure_list.php
    trunk/controller/templates/base/procedure_list_partial.php

Modified: trunk/controller/inc/class.menu.inc.php
===================================================================
--- trunk/controller/inc/class.menu.inc.php     2011-09-15 08:27:37 UTC (rev 
7601)
+++ trunk/controller/inc/class.menu.inc.php     2011-09-15 08:30:11 UTC (rev 
7602)
@@ -40,6 +40,12 @@
                                                                        'image' 
=> array('rental', 'x-office-spreadsheet')
                                                                )
                                                        )
+                               ),
+                               'procedure' => array
+                               (
+                                       'text'  => lang('Procedure'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uiprocedure.index') ),
+                           'image'     => array('property', 'location_1'),
                                )     
                        );
                        

Modified: trunk/controller/inc/class.soprocedure.inc.php
===================================================================
--- trunk/controller/inc/class.soprocedure.inc.php      2011-09-15 08:27:37 UTC 
(rev 7601)
+++ trunk/controller/inc/class.soprocedure.inc.php      2011-09-15 08:30:11 UTC 
(rev 7602)
@@ -59,7 +59,7 @@
                $id = intval($procedure->get_id());
                        
                $values = array(
-                       '$purpose = ' . 
$this->marshal($procedure->get_purpose(), 'string'),
+                       'purpose = ' . 
$this->marshal($procedure->get_purpose(), 'string'),
                        'responsibility = ' . 
$this->marshal($procedure->get_responsibility(), 'int'),
                        'description = ' . 
$this->marshal($procedure->get_description(), 'int'),
                        'reference = ' . 
$this->marshal($procedure->get_reference(), 'int'),
@@ -135,7 +135,7 @@
        
        function get_id_field_name($extended_info = false)
        {
-               /*
+               
                if(!$extended_info)
                {
                        $ret = 'id';
@@ -144,12 +144,12 @@
                {
                        $ret = array
                        (
-                               'table'                 => 'activity', // alias
+                               'table'                 => 'procedure', // alias
                                'field'                 => 'id',
                                'translated'    => 'id'
                        );
                }
-               */
+               
                return $ret;
        }
 

Added: trunk/controller/templates/base/procedure.php
===================================================================
--- trunk/controller/templates/base/procedure.php                               
(rev 0)
+++ trunk/controller/templates/base/procedure.php       2011-09-15 08:30:11 UTC 
(rev 7602)
@@ -0,0 +1,62 @@
+<?php  
+       //include common logic for all templates
+       include("common.php");
+?>
+
+<div class="identifier-header">
+<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/actions/go-home.png" /> <?php echo lang('Procedure') ?></h1>
+</div>
+
+<div class="yui-content">
+               <div id="details">
+                       <form action="#" method="post">
+                               <input type="hidden" name="id" value="<?php 
if(!empty($procedure)){ echo $procedure->get_id(); } else { echo '0'; }  ?>"/>
+                               <dl class="proplist-col">
+                                       <dt>
+                                               <label for="title"><?php echo 
lang('Title') ?></label>
+                                       </dt>
+                                       <dd>
+                                               <input type="text" name="title" 
id="title" value="" />
+                                       </dd>
+                                       <dt>
+                                               <label for="purpose"><?php echo 
lang('Purpose') ?></label>
+                                       </dt>
+                                       <dd>
+                                               <textarea id="purpose" rows="5" 
cols="60"></textarea>
+                                       </dd>
+                                       <dt>
+                                               <label 
for="responsibility"><?php echo lang('Responsibility') ?></label>
+                                       </dt>
+                                       <dd>
+                                               <textarea id="responsibility" 
rows="5" cols="60"></textarea>
+                                       </dd>
+                                       <dt>
+                                               <label for="description"><?php 
echo lang('Description') ?></label>
+                                       </dt>
+                                       <dd>
+                                               <textarea id="description" 
rows="5" cols="60"></textarea>
+                                       </dd>
+                                       <dt>
+                                               <label for="reference"><?php 
echo lang('Reference')?></label>
+                                       </dt>
+                                       <dd>
+                                               <input type="text" 
name="reference" id="reference" value="" />
+                                       </dd>   
+                                       <dt>
+                                       <label for="attachment"><?php echo 
lang('Attachment')?></label>
+                                       </dt>
+                                       <dd>
+                                               <input type="text" 
name="attachment" id="attachment" value="" />
+                                       </dd>                   
+                               </dl>
+                               
+                               <div class="form-buttons">
+                                       <?php
+                                               echo '<input type="submit" 
name="save_procedure" value="' . lang('save') . '"/>';
+                                       ?>
+                               </div>
+                               
+                       </form>
+                                               
+               </div>
+</div>
\ No newline at end of file

Added: trunk/controller/templates/base/procedure_list.php
===================================================================
--- trunk/controller/templates/base/procedure_list.php                          
(rev 0)
+++ trunk/controller/templates/base/procedure_list.php  2011-09-15 08:30:11 UTC 
(rev 7602)
@@ -0,0 +1,41 @@
+<?php
+       include("common.php");
+?>
+
+<script>
+
+       YAHOO.util.Event.addListener(
+       'ctrl_add_controller_procedure',
+       'click',
+       function(e)
+       {
+               YAHOO.util.Event.stopEvent(e);
+               window.location = 
'index.php?menuaction=controller.uiprocedure.add';
+       }
+);
+</script>
+
+<h1><img src="<?php echo RENTAL_TEMPLATE_PATH ?>images/32x32/go-home.png" /> 
<?php echo lang('rc') ?></h1>
+
+
+<fieldset>
+       <!-- Create new precedure -->
+       <h3><?php echo lang('t_new_procedure') ?></h3>
+       <input type="submit" name="ctrl_add_controller_procedure" 
id="ctrl_add_controller_procedure" value="<?php echo lang('f_new_procedure') 
?>" />
+</fieldset>
+
+<?php
+/* TODO: Fix column selector:
+<fieldset>
+       <!-- Select table columns -->
+       <h3><?php echo lang('t_functions') ?></h3>
+       <input type="button" id="dt-options-link" name="dt-options-link" 
value="<?php echo lang('f_select_columns') ?>" />
+</fieldset>
+*/
+?>
+<?php
+$list_form = true;
+$list_id = 'all_procedures';
+$url_add_on = '&amp;type=all_procedures';
+include('procedure_list_partial.php');
+?>
\ No newline at end of file

Added: trunk/controller/templates/base/procedure_list_partial.php
===================================================================
--- trunk/controller/templates/base/procedure_list_partial.php                  
        (rev 0)
+++ trunk/controller/templates/base/procedure_list_partial.php  2011-09-15 
08:30:11 UTC (rev 7602)
@@ -0,0 +1,135 @@
+<?php
+       $config = CreateObject('phpgwapi.config','controller');
+       $config->read();
+?>
+
+<script type="text/javascript">
+
+//Add listener resetting form: redirects browser to call index  again
+       YAHOO.util.Event.addListener(
+               'ctrl_reset_button',
+               'click',
+               function(e)
+               {
+                       YAHOO.util.Event.stopEvent(e);
+                       window.location = 
'index.php?menuaction=rental.uiprocedure.index';
+               }
+               );
+
+       // Defining columns for datatable
+       var columnDefs = [{
+                       key: "id",
+                       label: "<?php echo lang('procedure_id') ?>",
+                       sortable: false,
+                       hidden: true
+               },
+               {
+                       key: "title",
+                       label: "<?php echo lang('title') ?>",
+                       sortable: true
+               },
+               {
+                       key: "actions",
+                       hidden: true
+               },
+               {
+                       key: "labels",
+                       hidden: true
+               },
+               {
+                       key: "ajax",
+                       hidden: true
+               }];
+
+       // Initiating the data source
+       setDataSource(
+               
'index.php?menuaction=controller.uiprocedure.query&amp;phpgw_return_as=json<?php
 echo $url_add_on; ?>&amp;editable=<?php echo isset($editable) && $editable ? 
"true" : "false"; ?>',
+               columnDefs,
+               '<?php echo $list_id ?>_form',
+               ['<?php echo $list_id ?>_ctrl_search_query'],
+               '<?php echo $list_id ?>_container',
+               '<?php echo $list_id ?>_paginator',
+               '<?php echo $list_id ?>',
+               new Array(<?php
+                       if(isset($related)){
+                                       $tot_related = count($related);
+                                       $count_related = 0;
+                                       foreach($related as $r){
+                                               $count_related++;
+                                               echo "\"".$r."\"";
+                                               if($count_related < 
$tot_related){
+                                                       echo ",";
+                                               }
+                                       }
+                               }
+               ?>),
+               '<?php echo isset($editor_action) ? $editor_action : '' ?>'
+       );
+<!--
+    function composite_export(compType) {
+        var availabilityselect = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_active_rental_composites');
+        var availabilityoption = 
availabilityselect.options[availabilityselect.selectedIndex].value;
+
+        var furnished_select = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_furnished_status_rental_composites');
+        var furnished_status_id = 
furnished_select.options[furnished_select.selectedIndex].value;
+
+        var query = document.getElementById('<?php echo $list_id 
?>_ctrl_search_query').value;
+
+        var sSelect = document.getElementById('<?php echo $list_id 
?>_ctrl_search_option');
+        var sOption = sSelect.options[sSelect.selectedIndex].value;
+
+        window.location = 'index.php?menuaction=rental.uicomposite.download'+
+            '<?php echo $url_add_on ?>'+
+            '&amp;furnished_status='+furnished_status_id+
+            '&amp;is_active='+availabilityoption+
+            '&amp;type='+compType+
+            '&amp;query='+query+
+            '&amp;search_option='+sOption+
+               '&amp;export=true';
+    }
+-->
+</script>
+
+<?php
+       if($list_form)
+       {
+?>
+<form id="<?php echo $list_id ?>_form" method="GET">
+<?php
+       $populate = phpgw::get_var('populate_form');
+       //Avoid Notices
+       $q = false;
+       $s_type = false;
+       $status = false;
+       $status_contract = false;
+       if(isset($populate))
+       {
+               $q = phpgwapi_cache::session_get('controller', 
'procedure_query');
+               $s_type = phpgwapi_cache::session_get('controller', 
'procedure_search_type');
+               $status = phpgwapi_cache::session_get('controller', 
'procedure_status');
+       } 
+?>
+       <fieldset>
+               <!-- Search -->
+               <h3><?php echo lang('search_options') ?></h3>
+               <label for="ctrl_search_query"><?php echo lang('search_for') 
?></label>
+               <input id="<?php echo $list_id ?>_ctrl_search_query" 
type="text" name="query" autocomplete="off" value="<?php echo isset($q) ? $q : 
''?>"/>
+               <input type="submit" id="ctrl_search_button" value="<?php echo 
lang('search') ?>" />
+               <input type="button" id="ctrl_reset_button" value="<?php echo 
lang('reset') ?>" />
+       </fieldset>
+</form>
+<?php
+       } // end if($list_form)
+?>
+<fieldset>
+       <h3><?php echo lang('export_to') ?></h3>
+       <?php
+       $export_format = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['export_format'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['export_format'] 
? $GLOBALS['phpgw_info']['user']['preferences']['property']['export_format'] : 
'csv';
+       ?>
+       <div id="export">
+               <a href="javascript:composite_export('<?php echo $list_id ?>')" 
title="<?php echo lang('Download as %1', $export_format) ?>"><img src="<?php 
echo RENTAL_TEMPLATE_PATH 
?>images/16x16/mimetypes/x-office-spreadsheet.png"/></a>
+       </div>
+</fieldset>
+
+<div id="<?php echo $list_id ?>_paginator" class="paginator"></div>
+<div id="<?php echo $list_id ?>_container" class="datatable_container"></div>




reply via email to

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