fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14566] rental: remove obsolete code


From: Sigurd Nes
Subject: [Fmsystem-commits] [14566] rental: remove obsolete code
Date: Thu, 10 Dec 2015 14:38:48 +0000

Revision: 14566
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14566
Author:   sigurdne
Date:     2015-12-10 14:38:47 +0000 (Thu, 10 Dec 2015)
Log Message:
-----------
rental: remove obsolete code

Removed Paths:
-------------
    branches/dev-syncromind/rental/templates/base/adjustment.php
    branches/dev-syncromind/rental/templates/base/adjustment_list.php
    branches/dev-syncromind/rental/templates/base/adjustment_list_partial.php
    branches/dev-syncromind/rental/templates/base/admin_price_item.php
    branches/dev-syncromind/rental/templates/base/admin_price_item_list.php
    
branches/dev-syncromind/rental/templates/base/admin_price_item_manual_adjustment.php
    branches/dev-syncromind/rental/templates/base/billing.php
    branches/dev-syncromind/rental/templates/base/billing_list_partial.php
    branches/dev-syncromind/rental/templates/base/billing_step0.php
    branches/dev-syncromind/rental/templates/base/billing_step1.php
    branches/dev-syncromind/rental/templates/base/billing_step2.php
    branches/dev-syncromind/rental/templates/base/common.php
    branches/dev-syncromind/rental/templates/base/composite.php
    branches/dev-syncromind/rental/templates/base/composite_list.php
    branches/dev-syncromind/rental/templates/base/composite_list_partial.php
    branches/dev-syncromind/rental/templates/base/contract.php
    branches/dev-syncromind/rental/templates/base/contract_list.php
    branches/dev-syncromind/rental/templates/base/contract_list_partial.php
    branches/dev-syncromind/rental/templates/base/contract_warnings_partial.php
    
branches/dev-syncromind/rental/templates/base/contracts_for_regulation_list.php
    branches/dev-syncromind/rental/templates/base/delegate_list.php
    branches/dev-syncromind/rental/templates/base/document_list_partial.php
    branches/dev-syncromind/rental/templates/base/facilit_import.php
    branches/dev-syncromind/rental/templates/base/facilit_import_adjustment.php
    branches/dev-syncromind/rental/templates/base/form_buttons.php
    branches/dev-syncromind/rental/templates/base/frontpage.php
    branches/dev-syncromind/rental/templates/base/invoice_list_partial.php
    
branches/dev-syncromind/rental/templates/base/invoice_price_item_list_partial.php
    branches/dev-syncromind/rental/templates/base/notification_list.php
    branches/dev-syncromind/rental/templates/base/party.php
    branches/dev-syncromind/rental/templates/base/party_list.php
    branches/dev-syncromind/rental/templates/base/party_list_partial.php
    branches/dev-syncromind/rental/templates/base/permission_denied.php
    branches/dev-syncromind/rental/templates/base/price_item_partial.php
    branches/dev-syncromind/rental/templates/base/property_location_partial.php
    branches/dev-syncromind/rental/templates/base/resultunit.php
    branches/dev-syncromind/rental/templates/base/resultunit_list.php
    branches/dev-syncromind/rental/templates/base/resultunit_list_partial.php
    branches/dev-syncromind/rental/templates/base/sync_party_list.php
    branches/dev-syncromind/rental/templates/base/sync_party_list_identifier.php
    branches/dev-syncromind/rental/templates/base/sync_party_list_org_id.php
    branches/dev-syncromind/rental/templates/base/sync_party_list_res_unit.php
    branches/dev-syncromind/rental/templates/base/total_price_partial.php
    branches/dev-syncromind/rental/templates/base/unit_list_partial.php

Deleted: branches/dev-syncromind/rental/templates/base/adjustment.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/adjustment.php        
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/adjustment.php        
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,138 +0,0 @@
-<?php
-       include("common.php");
-?>
-
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/mimetypes/x-office-spreadsheet.png" /> <?php echo 
lang('regulation') ?></h1>
-
-<?php echo rental_uicommon::get_page_error($error) ?>
-<?php echo rental_uicommon::get_page_message($message) ?>
-
-<form action="#" method="post">
-       <dl class="proplist">
-               <dt>
-                       <label for="name"><?php echo 
lang('field_of_responsibility') ?></label>
-               </dt>
-               <dd>
-                       <?php echo 
lang(rental_socontract::get_instance()->get_responsibility_title($adjustment->get_responsibility_id()));
 ?>
-               </dd>
-               <dt>
-                       <label for="adjustment_type"><?php echo 
lang('adjustment_type')?></label>
-               </dt>
-               <dd>
-                       <?php if ($editable) {?>
-                               <select name="adjustment_type">
-                                       <option value="adjustment_type_KPI" 
<?php echo ($adjustment->get_adjustment_type() == 
'adjustment_type_KPI')?'selected':''?>><?php echo 
lang('adjustment_type_KPI')?></option>
-                                       <option 
value="adjustment_type_deflator" <?php echo ($adjustment->get_adjustment_type() 
== 'adjustment_type_deflator')?'selected':''?>><?php echo 
lang('adjustment_type_deflator')?></option>
-                               </select>
-                       <?php }else{
-                               if($adjustment->get_adjustment_type()){
-                                       echo 
lang($adjustment->get_adjustment_type());
-                               }
-                               else{
-                                       echo lang('none');
-                               }
-                       }?>
-               </dd>
-               <dt>
-                       <label for="percent"><?php echo lang('percent') 
?></label>
-               </dt>
-               <dd>
-                       <?php
-                               if ($editable) {
-                                       echo '<input type="text" name="percent" 
id="percent" value="' . $adjustment->get_percent() . '"/> %';
-                               } else {
-                                       echo $adjustment->get_percent(). "%";
-                               }
-                       ?>
-               </dd>
-               <dt>
-                       <label for="interval"><?php echo lang('interval') 
?></label>
-               </dt>
-               <dd>
-               <?php
-                       $current_interval = $adjustment->get_interval();
-                       if ($editable)
-                       {
-                               ?>
-                               <select name="interval">
-                                       <?php
-                                               echo "<option 
".($current_interval == '1' ? 'selected="selected"' : "")." value=\"1\">1 
".lang('year')."</option>";
-                                               echo "<option 
".($current_interval == '2' ? 'selected="selected"' : "")." value=\"2\">2 
".lang('year')."</option>";
-                                               echo "<option 
".($current_interval == '10' ? 'selected="selected"' : "")." value=\"10\">10 
".lang('year')."</option>";
-                                       ?>
-                               </select>
-                               <?php
-                       ?>
-                       <?php
-                       }
-                       else // Non-editable
-                       {
-                               echo $current_interval." ".lang('year');
-                       }
-                       ?>
-               </dd>
-               <dt>
-                       <label for="adjustment_year"><?php echo lang('year') 
?></label>
-               </dt>
-               <dd>
-                       <?php
-                               
-                       if ($editable) {
-                               ?>
-                               <select name="adjustment_year" 
id="adjustment_year">
-                               <?php
-                                       $this_year = date('Y');
-                                       $adjustment_year = 
$adjustment->get_year();
-                                       $years = 
rental_contract::get_year_range();
-                                       foreach($years as $year)
-                                       {
-                                               ?>
-                                               <option value="<?php echo $year 
?>"<?php echo $adjustment_year == $year ? ' selected="selected"' : '' ?>><?php 
echo $year ?></option>
-                                               <?php
-                                       }
-                                       ?>
-                               </select>
-                               <?php
-                       }
-                       else{
-                               echo $adjustment->get_year();
-                       }
-                       ?>
-               </dd>
-               <dt>
-                       <label for="adjustment_date"><?php echo 
lang('adjustment_date') ?></label>
-               </dt>
-               <dd>
-                       <?php
-                               $adjustment_date = 
$adjustment->get_adjustment_date() ? 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$adjustment->get_adjustment_date()) : '-';
-                               $adjustment_date_yui = 
$adjustment->get_adjustment_date() ? date('Y-m-d', 
$adjustment->get_adjustment_date()) : '';
-                               if ($editable) {
-                                       echo 
$GLOBALS['phpgw']->yuical->add_listener('adjustment_date', $adjustment_date);
-                               } else {
-                                       echo $adjustment_date;
-                               }
-                       ?>
-               </dd>
-                <dt>
-                       <label for="extra_adjustment"><?php echo 
lang('extra_adjustment')?></label>
-               </dt>
-               <dd>
-                       <?php if($editable){?>
-                            <input type="checkbox" name="extra_adjustment" 
id="extra_adjustment"<?php echo $adjustment->is_extra_adjustment() ? ' 
checked="checked"' : '' ?>/>
-                       <?php }else{?>
-                            <input type="checkbox" name="extra_adjustment" 
id="extra_adjustment"<?php echo $adjustment->is_extra_adjustment() ? ' 
checked="checked"' : '' ?> disabled="disabled"/>
-                       <?php }?>
-               </dd>
-               <dt>
-                       <?php if($adjustment->is_executed()){?>
-                               <label for="is_executed"><?php echo 
lang("adjustment_is_executed")?></label>
-                       <?php }else{?>
-                               <label for="is_executed"><?php echo 
lang("adjustment_is_not_executed")?></label>
-                       <?php }?>
-               </dt>
-       </dl>
-
-       <?php
-               include("form_buttons.php");
-       ?>
-</form>
\ No newline at end of file

Deleted: branches/dev-syncromind/rental/templates/base/adjustment_list.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/adjustment_list.php   
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/adjustment_list.php   
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,63 +0,0 @@
-<?php
-       include("common.php");
-?>
-
-<script>
-       YAHOO.util.Event.addListener(
-               'ctrl_add_adjustment',
-               'click',
-               function(e)
-               {
-               YAHOO.util.Event.stopEvent(e);
-               resp_id = document.getElementById('responsibility_id').value;
-                       window.location = 
'index.php?menuaction=rental.uiadjustment.add&amp;responsibility_id=' + resp_id;
-               }
-       );
-</script>
-
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/mimetypes/x-office-spreadsheet.png" /> <?php echo 
lang('adjustment_list') ?></h1>
-<?php
-if($this->isAdministrator() || $this->isExecutiveOfficer())
-{
-?>
-<form action="#" method="GET">
-       <fieldset>
-               <!-- Create new adjustment -->
-               <h3><?php echo lang('new_adjustment') ?></h3>
-               <select name="responsibility_id" id="responsibility_id">
-                       <?php
-                       $types = 
rental_socontract::get_instance()->get_fields_of_responsibility();
-                       foreach($types as $id => $label)
-                       {
-       
-                               $names = $this->locations->get_name($id);
-                               if($names['appname'] == 
$GLOBALS['phpgw_info']['flags']['currentapp'])
-                               {
-                                       
if($this->hasPermissionOn($names['location'],PHPGW_ACL_ADD))
-                                       {
-                                       ?>
-                                               <option 
-                                                       value="<?php echo $id 
?>"
-                                               >
-                                                       <?php echo lang($label) 
?>
-                                               </option>
-                                       <?php
-                                       }
-                               }
-                       }
-                       ?>
-               </select>
-               <input type="submit" name="ctrl_add_adjustment" 
id="ctrl_add_adjustment" value="<?php echo lang('new_adjustment') ?>" />
-       </fieldset>
-</form>
-
-<?php
-}
-$list_form = true; 
-$list_id = 'non_manual_adjustments';
-$url_add_on = '&amp;type='.$list_id;
-$editable = false;
-$extra_cols = array();
-$hide_cols = array('price_item_id','new_price');
-include('adjustment_list_partial.php');
-?>
\ No newline at end of file

Deleted: 
branches/dev-syncromind/rental/templates/base/adjustment_list_partial.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/adjustment_list_partial.php   
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/adjustment_list_partial.php   
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,137 +0,0 @@
-<script type="text/javascript">
-
-       var formatPrice = function(elCell, oRecord, oColumn, oData) {
-               if (oData != undefined) {
-                       elCell.innerHTML = YAHOO.util.Number.format( oData,
-                       {
-                               suffix: " <?php echo 
isset($config->config_data['currency_suffix']) && 
$config->config_data['currency_suffix'] ? 
$config->config_data['currency_suffix'] : 'NOK'; ?>",
-                               thousandsSeparator: "<?php echo 
lang('currency_thousands_separator') ?>",
-                               decimalSeparator: "<?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] : 
','; ?>",
-                               decimalPlaces: <?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 : 2; ?>
-                   });
-               }
-       }
-
-       var formatPercent = function(elCell, oRecord, oColumn, oData) {
-               if (oData != undefined) {
-                       elCell.innerHTML = YAHOO.util.Number.format( oData,
-                       {
-                               suffix: " %",
-                               thousandsSeparator: "<?php echo 
lang('currency_thousands_separator') ?>",
-                               decimalSeparator: "<?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] : 
','; ?>",
-                               decimalPlaces: <?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 : 2; ?>
-                   });
-               }
-       }
-
-       var formatYear = function(elCell, oRecord, oColumn, oData) {
-               if (oData != undefined) {
-                       elCell.innerHTML = YAHOO.util.Number.format( oData,
-                       {
-                               suffix: " <?php echo lang('year')?>"
-                   });
-               }
-       }
-
-       // Defining columns for datatable
-       var columnDefs = [
-               {
-                       key: "year",
-                       label: "<?php echo lang('year') ?>",
-                       sortable: true
-               },
-               {
-                       key: "adjustment_date",
-                       label: "<?php echo lang('adjustment_date') ?>",
-                       sortable: true
-               },
-               {
-                       key: "price_item_id",
-                       label: "<?php echo lang('price_item') ?>",
-                       sortable: true
-               },
-               {
-                       key: "new_price",
-                       label: "<?php echo lang('new_price') ?>",
-                       sortable: true,
-                       formatter: formatPrice
-               },
-               {
-                       key: "adjustment_type",
-                       label: "<?php echo lang('adjustment_type')?>"
-               },
-               {
-                       key: "percent",
-                       label: "<?php echo lang('percent') ?>",
-                       formatter: formatPercent
-               },
-               {
-                       key: "interval",
-                       label: "<?php echo lang('interval') ?>",
-                       formatter: formatYear
-               },
-               {
-                       key: "responsibility_title",
-                       label: "<?php echo lang('responsibility') ?>",
-                       sortable: true
-               },
-                {
-                       key: "extra_adjustment",
-                       label: "<?php echo lang('extra_adjustment')?>",
-                       sortable: true
-               },
-               {
-                       key: "is_executed",
-                       label: "<?php echo lang('is_executed')?>",
-                       sortable: true
-               },
-               {
-                       key: "actions",
-                       hidden: true
-               },
-               {
-                       key: "labels",
-                       hidden: true
-               },
-               {
-                       key: "ajax",
-                       hidden: true
-               }
-               ];
-
-       <?php
-               if(isset($hide_cols)){
-                       foreach($hide_cols as $col){
-                               ?>
-                                       for(var i = 0; i < columnDefs.length; 
i++){
-                                               if(columnDefs[i].key == '<?php 
echo $col ?>'){
-                                                       columnDefs[i].hidden = 
true;
-                                               }
-                                       }
-
-                               <?php
-                       }
-               }
-       ?>
-
-       // Initiating the data source
-       setDataSource(
-               
'index.php?menuaction=rental.uiadjustment.query&amp;phpgw_return_as=json<?php 
echo $url_add_on ?>',
-               columnDefs,
-               '<?php echo $list_id ?>_list_form',
-               [],
-               '<?php echo $list_id ?>_container',
-               '<?php echo $list_id ?>_paginator',
-               '<?php echo $list_id ?>',
-               new Array(<?php
-                       if(isset($related)){
-                               foreach($related as $r){
-                                       echo "\"".$r."\"";
-                               }
-                       }
-               ?>)
-       );
-</script>
-
-<div id="<?php echo $list_id ?>_paginator" class="paginator"></div>
-<div id="<?php echo $list_id ?>_container" class="datatable_container"></div>

Deleted: branches/dev-syncromind/rental/templates/base/admin_price_item.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/admin_price_item.php  
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/admin_price_item.php  
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,135 +0,0 @@
-<?php
-       include("common.php");
-?>
-
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/mimetypes/x-office-spreadsheet.png" /> <?php echo 
lang('showing') ?></h1>
-
-<?php echo rental_uicommon::get_page_error($error) ?>
-<?php echo rental_uicommon::get_page_message($message) ?>
-
-<form action="#" method="post">
-       <dl class="proplist">
-               <dt>
-                       <label for="title"><?php echo lang('title') ?></label>
-                       <?php echo 
rental_uicommon::get_field_error($price_item, 'title') ?>
-               </dt>
-               <dd>
-                       <?php
-                               if ($editable) {
-                                       echo '<input type="text" name="title" 
id="title" value="' . $price_item->get_title() . '"/>';
-                               } else {
-                                       echo $price_item->get_title();
-                               }
-                       ?>
-               </dd>
-               <dt>
-                       <label for="name"><?php echo 
lang('field_of_responsibility') ?></label>
-               </dt>
-               <dd>
-                       <?php echo 
lang($price_item->get_responsibility_title()); ?>
-               </dd>
-               <dt>
-                       <label for="agresso_id"><?php echo lang('agresso_id') 
?></label>
-                       <?php echo 
rental_uicommon::get_field_error($price_item, 'agresso_id') ?>
-               </dt>
-               <dd>
-                       <?php
-                               if ($editable) {
-                                       echo '<input type="text" 
name="agresso_id" id="agresso_id" value="' . $price_item->get_agresso_id() . 
'"/>';
-                               } else {
-                                       echo $price_item->get_agresso_id();
-                               }
-                       ?>
-               </dd>
-
-               <dt>
-                       <label for="is_area"><?php echo lang('is_area') 
?></label>
-               </dt>
-               <dd>
-                       <input type="radio" name="is_area" value="true" 
id="is_area"<?php echo $price_item->is_area() ? ' checked="checked"' : '' ?> 
<?php echo !$editable ? ' disabled="disabled"' : '' ?>/>
-                       <label for="is_area"><?php echo 
lang('calculate_price_per_area') ?></label>
-                       <br />
-                       <input type="radio" name="is_area" value="false" 
id="is_area"<?php echo !$price_item->is_area() ? ' checked="checked"' : '' ?> 
<?php echo !$editable ? ' disabled="disabled"' : '' ?>/>
-                       <label for="is_area"><?php echo 
lang('calculate_price_apiece') ?></label>
-               </dd>
-               <dt>
-                       <label for="is_area"><?php echo lang('type') ?></label>
-               </dt>
-               <dd>
-                       <?php
-                       $current_price_type_id = 
$price_item->get_price_type_id();
-                       if ($editable)
-                       {
-                               ?>
-                               <select name="price_type_id">
-                                       <?php
-                                       foreach($price_item->get_price_types() 
as $price_type_id => $price_type_title)
-                                       {
-                                               echo "<option 
".($current_price_type_id == $price_type_id ? 'selected="selected"' : "")." 
value=\"{$price_type_id}\">".lang($price_type_title)."</option>";
-                                       }
-                                       ?>
-                               </select>
-                               <?php
-                       ?>
-                       <?php
-                       }
-                       else // Non-editable
-                       {
-                               echo 
lang($price_item->get_price_types($current_price_type_id));
-                       }
-                       ?>
-               </dd>
-
-               <dt>
-                       <label for="price"><?php echo lang('price') ?></label>
-                       <?php echo 
rental_uicommon::get_field_error($price_item, 'price') ?>
-               </dt>
-               <dd>
-                       <?php
-                               if ($editable) {
-                                       echo '<input type="text" name="price" 
id="price" value="' . $price_item->get_price() . '"/>';
-                               } else {
-                                       echo $price_item->get_price();
-                               }
-                       ?>
-               </dd>
-               <dt>
-                       <label for="is_inactive"><?php echo lang('is_inactive') 
?></label>
-               </dt>
-               <dd>
-                       <?php if($editable){?>
-                               <?php 
if(rental_soprice_item::get_instance()->has_active_contract($price_item->get_id())){?>
-                                       <input type="checkbox" 
name="is_inactive" id="is_inactive"<?php echo $price_item->is_inactive() ? ' 
checked="checked"' : '' ?> disabled="disabled"/><?php echo 
lang('price_element_in_use') ?>
-                               <?php }else{?>
-                                       <input type="checkbox" 
name="is_inactive" id="is_inactive"<?php echo $price_item->is_inactive() ? ' 
checked="checked"' : '' ?>/>
-                       <?php }
-                               }else{?>
-                               <input type="checkbox" name="is_inactive" 
id="is_inactive"<?php echo $price_item->is_inactive() ? ' checked="checked"' : 
'' ?> disabled="disabled"/>
-                       <?php }?>
-               </dd>
-               <dt>
-                       <label for="is_adjustable"><?php echo 
lang('is_adjustable') ?></label>
-               </dt>
-               <dd>
-                       <?php if($editable){?>
-                                       <input type="checkbox" 
name="is_adjustable" id="is_adjustable"<?php echo $price_item->is_adjustable() 
? ' checked="checked"' : '' ?>/>
-                       <?php }else{?>
-                               <?php echo $price_item->get_adjustable_text()?>
-                       <?php }?>
-               </dd>
-               <dt>
-                       <label for="standard"><?php echo lang('is_standard') 
?></label>
-               </dt>
-               <dd>
-                       <?php if($editable){?>
-                                       <input type="checkbox" name="standard" 
id="standard"<?php echo $price_item->is_standard() ? ' checked="checked"' : '' 
?>/>
-                       <?php }else{?>
-                               <?php echo $price_item->get_standard_text()?>
-                       <?php }?>
-               </dd>
-       </dl>
-
-       <?php
-               include("form_buttons.php");
-       ?>
-</form>
\ No newline at end of file

Deleted: branches/dev-syncromind/rental/templates/base/admin_price_item_list.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/admin_price_item_list.php     
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/admin_price_item_list.php     
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,147 +0,0 @@
-<?php
-       include("common.php");
-       $config = CreateObject('phpgwapi.config','rental');
-       $config->read();
-?>
-
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/mimetypes/x-office-spreadsheet.png" /> <?php echo 
lang('price_list') ?></h1>
-
-<form action="#" method="GET">
-       <fieldset>
-               <!-- Create new price item -->
-               <h3><?php echo lang('t_new_price_item') ?></h3>
-               <label for="ctrl_add_price_item_name"><?php echo lang('name') 
?></label>
-               <input type="text" id="ctrl_add_price_item_name" 
name="ctrl_add_price_item_name"/>
-               <select name="responsibility_id" id="responsibility_id">
-                       <?php
-                       $types = 
rental_socontract::get_instance()->get_fields_of_responsibility();
-                       foreach($types as $id => $label)
-                       {
-       
-                               $names = $this->locations->get_name($id);
-                               if($names['appname'] == 
$GLOBALS['phpgw_info']['flags']['currentapp'])
-                               {
-                                       
if($this->hasPermissionOn($names['location'],PHPGW_ACL_ADD))
-                                       {
-                                       ?>
-                                               <option 
-                                                       value="<?php echo $id 
?>"
-                                               >
-                                                       <?php echo lang($label) 
?>
-                                               </option>
-                                       <?php
-                                       }
-                               }
-                       }
-                       ?>
-               </select>
-               <input type="submit" name="ctrl_add_price_item" 
id="ctrl_add_price_item" value="<?php echo lang('f_new_price_item') ?>" />
-       </fieldset>
-</form>
-
-<div id="<?php echo $list_id ?>_paginator" class="paginator"></div>
-<div id="<?php echo $list_id ?>_container" class="datatable_container"></div>
-
-<script type="text/javascript">
-       YAHOO.util.Event.addListener(
-               'ctrl_add_price_item',
-               'click',
-               function(e)
-               {
-               YAHOO.util.Event.stopEvent(e);
-               newName = 
document.getElementById('ctrl_add_price_item_name').value;
-               resp_id = document.getElementById('responsibility_id').value;
-                       window.location = 
'index.php?menuaction=rental.uiprice_item.edit&amp;price_item_title=' + newName 
+ '&amp;responsibility_id=' + resp_id;
-               }
-       );
-
-
-       var formatPrice = function(elCell, oRecord, oColumn, oData) {
-               if (oData != undefined) {
-                       elCell.innerHTML = YAHOO.util.Number.format( oData,
-                       {
-                               suffix: " <?php echo 
isset($config->config_data['currency_suffix']) && 
$config->config_data['currency_suffix'] ? 
$config->config_data['currency_suffix'] : 'NOK'; ?>",
-                               thousandsSeparator: "<?php echo 
lang('currency_thousands_separator') ?>",
-                               decimalSeparator: "<?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] : 
','; ?>",
-                               decimalPlaces: <?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 : 2; ?>
-                   });
-               }
-       }
-
-       // Defining columns for datatable
-       var columnDefs = [
-          {
-               key: "agresso_id",
-               label: "<?php echo lang('agresso_id') ?>",
-          sortable: false
-        },
-               {
-                       key: "title",
-                       label: "<?php echo lang('name') ?>",
-                 sortable: true
-               },
-               {
-                       key: "is_area",
-                       label: "<?php echo lang('type') ?>",
-                       sortable: true
-               },
-               {
-                       key: "price",
-                       label: "<?php echo lang('price') ?>",
-                       sortable: true,
-                       formatter: formatPrice
-               },
-               {
-                       key: "is_inactive",
-                       label: "<?php echo lang('status') ?>",
-                       sortable: true
-               },
-               {
-                       key: "is_adjustable",
-                       label: "<?php echo lang('is_adjustable') ?>"
-               },
-               {
-                       key: "responsibility_title",
-                       label: "<?php echo lang('responsibility') ?>",
-                       sortable: true
-               },
-               {
-                       key: "standard",
-                       label: "<?php echo lang('is_standard') ?>"
-               },
-               {
-                       key: "price_type_title",
-                       label: "<?php echo lang('type') ?>"
-               },
-               {
-                       key: "actions",
-                       hidden: true
-               },
-               {
-                       key: "labels",
-                       hidden: true
-               },
-               {
-                       key: "ajax",
-                       hidden: true
-               }
-               ];
-
-       // Initiating the data source
-       setDataSource(
-               
'index.php?menuaction=rental.uiprice_item.query&amp;phpgw_return_as=json',
-               columnDefs,
-               '<?php echo $list_id ?>_list_form',
-               [],
-               '<?php echo $list_id ?>_container',
-               '<?php echo $list_id ?>_paginator',
-               '<?php echo $list_id ?>',
-               new Array(<?php
-                       if(isset($related)){
-                               foreach($related as $r){
-                                       echo "\"".$r."\"";
-                               }
-                       }
-               ?>)
-       );
-</script>

Deleted: 
branches/dev-syncromind/rental/templates/base/admin_price_item_manual_adjustment.php
===================================================================
--- 
branches/dev-syncromind/rental/templates/base/admin_price_item_manual_adjustment.php
        2015-12-10 14:36:15 UTC (rev 14565)
+++ 
branches/dev-syncromind/rental/templates/base/admin_price_item_manual_adjustment.php
        2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,56 +0,0 @@
-<?php
-       include("common.php");
-       $config = CreateObject('phpgwapi.config','rental');
-       $config->read();
-?>
-
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/mimetypes/x-office-spreadsheet.png" /> <?php echo 
lang('manual_adjust_price_item') ?></h1>
-
-<?php echo rental_uicommon::get_page_error($error) ?>
-<?php echo rental_uicommon::get_page_message($message) ?>
-
-<form action="#" method="GET">
-       <fieldset>
-               <!-- Adjust price item manually-->
-               <b><label for="price_item_id"><?php echo 
lang('manual_adjust_price_item_select') ?></label></b>
-               <select name="price_item_id" id="price_item_id">
-                       <option>Velg priselement</option>
-                       <?php
-                       $types = 
rental_soprice_item::get_instance()->get_manual_adjustable();
-                       foreach($types as $id => $label)
-                       {
-                       ?>
-                               <option value="<?php echo $id ?>"><?php echo 
$label ?></option>
-                       <?php
-                       }
-                       ?>
-               </select>
-               <label for="ctrl_adjust_price_item_price"><?php echo 
lang('price') ?></label>
-               <input type="text" id="ctrl_adjust_price_item_price" 
name="ctrl_adjust_price_item_price"/>
-               <input type="submit" name="ctrl_adjust_price_item" 
id="ctrl_adjust_price_item" value="<?php echo lang('adjust_price') ?>" />
-       </fieldset>
-</form>
-
-<script type="text/javascript">
-       YAHOO.util.Event.addListener(
-               'ctrl_adjust_price_item',
-               'click',
-               function(e)
-               {
-               YAHOO.util.Event.stopEvent(e);
-               price_item_id = document.getElementById('price_item_id').value;
-               new_price = 
document.getElementById('ctrl_adjust_price_item_price').value;
-               window.location = 
'index.php?menuaction=rental.uiprice_item.adjust_price&amp;price_item_id=' + 
price_item_id + '&amp;new_price=' + new_price;
-               }
-       );
-</script>
-
-<?php
-$list_form = true; 
-$list_id = 'manual_adjustments';
-$url_add_on = '&amp;type='.$list_id;
-$editable = false;
-$extra_cols = array();
-$hide_cols = array('percent','interval');
-include('adjustment_list_partial.php');
-?>
\ No newline at end of file

Deleted: branches/dev-syncromind/rental/templates/base/billing.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/billing.php   2015-12-10 
14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/billing.php   2015-12-10 
14:38:47 UTC (rev 14566)
@@ -1,164 +0,0 @@
-<?php
-include("common.php");
-$date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-?>
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/x-office-document.png" /> <?php echo lang('invoice_run') ?></h1>
-<div class="yui-content">
-<a href="<?php echo $back_link ?>"><?php echo lang('Back') ?></a>
-<form action="" method="post" >
-<?php 
-if($billing_job != null)
-{
-       ?>
-       <dl class="proplist-col">
-               <dt>
-                       <?php echo lang('contract_type') ?>
-               </dt>
-               <dd>
-                       <?php
-                               $fields = 
rental_socontract::get_instance()->get_fields_of_responsibility();
-                               foreach($fields as $id => $label)
-                               {
-                                       if($id == 
$billing_job->get_location_id())
-                                       {
-                                               echo lang($label);
-                                       }
-                               }
-                       ?>
-               </dd>
-               <dt>
-                       <?php echo lang('billing_terms') ?>
-               </dt>
-               <dd>
-                       <?php 
-                       if($billing_info_array != null)
-                       {
-                               $billing_terms = 
rental_sobilling::get_instance()->get_billing_terms();
-                               
-                               foreach($billing_info_array as $billing_info)
-                               {       
-                                       
-                                               
-                                       if($billing_info->get_term_id() == 1)
-                                       {
-                                               echo lang('month ' . 
$billing_info->get_month() . ' capitalized');
-                                       }
-                                       else
-                                       {
-                                               //echo 
lang($billing_terms[$billing_info->get_term_id()]);
-                                               echo 
$billing_info->get_term_label();
-                                       }
-                                       echo " " . $billing_info->get_year() . 
"<br/>";
-                               }
-                       }
-                       ?>
-               </dd>
-       </dl>
-       <dl class="proplist-col">
-               <dt>
-                       <?php echo lang('sum') ?>
-               </dt>
-               <dd>
-                       <?php echo number_format($billing_job->get_total_sum(), 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 : 2, 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] : 
',',lang('currency_thousands_separator')); echo ' 
'.((isset($config->config_data['currency_suffix']) && 
$config->config_data['currency_suffix']) ? 
$config->config_data['currency_suffix'] : 'NOK');?>
-               </dd>
-               <dt>
-                       <?php echo lang('last_updated') ?>
-               </dt>
-               <dd>
-                       <?php echo 
$GLOBALS['phpgw']->common->show_date($billing_job->get_timestamp_stop(),$date_format
 . ' H:i:s');?>
-               </dd>
-               
-               <dt>
-                       <?php echo lang('Commited') ?>
-               </dt>
-               <dd>
-                       <?php 
-                       $timestamp_commit = 
$billing_job->get_timestamp_commit();
-                       if($timestamp_commit == null || $timestamp_commit == '')
-                       {
-                               echo lang('No');
-                       }
-                       else
-                       {
-                               echo 
$GLOBALS['phpgw']->common->show_date($billing_job->get_timestamp_commit(),$date_format
 . ' H:i:s');
-                       }
-                       ?>
-               </dd>
-       </dl>
-       <dl class="proplist-col">
-               <dt>
-                       <?php echo lang('success') ?>
-               </dt>
-               <dd>
-                       <?php echo $billing_job->is_success() ? lang('yes') : 
lang('no') ?>
-               </dd>
-               <dt>
-                       <?php echo lang('Export format') ?>
-               </dt>
-               <dd>
-                       <?php echo lang($billing_job->get_export_format()) ?>
-               </dd>
-               <dt>
-                       <?php echo lang('export') ?>
-               </dt>
-               <dd>
-                       <?php 
-                       if($billing_job->has_generated_export())
-                       {
-                               ?>
-                               <a href="<?php echo $download_link ?>"><?php 
echo lang('Download export') ?></a><br />
-                <a href="<?php echo $download_link . 
'&amp;toExcel=true&amp;type=bk' ?>"><?php echo lang('Download Excel export') . 
' BK'?></a><br />
-                <a href="<?php echo $download_link . 
'&amp;toExcel=true&amp;type=nlsh' ?>">Last ned eksportfil i Excel-format 
NLSH</a>
-                               <?php
-                               if(!$billing_job->is_commited())
-                               {
-                                       ?>
-                                       <input type="submit" name="commit" 
value="<?php echo lang('Commit') ?>"/>
-                                       <?php
-                               }
-                       }
-                       else
-                       {
-                               ?>
-                               <input type="submit" name="generate_export" 
value="<?php echo lang('Generate export') ?>"/>
-                               <?php
-                       }       
-                       ?>
-               </dd>
-               <dt>
-                       <?php echo lang('cs15_export') ?>
-               </dt>
-               <dd>
-                       <input type="button" name="generate_cs15" value="<?php 
echo lang('Generate cs15') ?>" onClick="javascript:doExportCS15(<?php echo 
$billing_job->get_id()?>, <?php echo $billing_job->get_timestamp_stop() ?>)"/>
-               </dd>
-       </dl>
-                       
-       <?php
-}
-else // billing job == null
-{
-       ?>
-       <a href="<?php echo $back_link ?>"><?php echo lang('Back') ?></a>
-       <?php
-}      
-?>
-</form>
-<div>&amp;nbsp;</div>
-<?php echo rental_uicommon::get_page_error($errorMsgs) ?>
-<?php echo rental_uicommon::get_page_warning($warningMsgs) ?>
-<?php echo rental_uicommon::get_page_message($infoMsgs) ?>
-<div>&amp;nbsp;</div>
-</div>
-
-<div style="position: relative; clear: both; margin-left: 1em; ">
-<?php 
-       if($billing_job != null)
-       {
-               $list_form = true;
-               $list_id = 'invoices';
-               $url_add_on = 
"&amp;type={$list_id}&amp;billing_id={$billing_job->get_id()}";
-               $extra_cols = null;
-               include('invoice_list_partial.php');
-       }
-?>
-</div>
\ No newline at end of file

Deleted: branches/dev-syncromind/rental/templates/base/billing_list_partial.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/billing_list_partial.php      
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/billing_list_partial.php      
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,110 +0,0 @@
-<script type="text/javascript">
-       var formatPrice = function(elCell, oRecord, oColumn, oData) {
-               if (oData != undefined) {
-                       elCell.innerHTML = YAHOO.util.Number.format( oData,
-                       {
-                               suffix: " <?php echo 
isset($config->config_data['currency_suffix']) && 
$config->config_data['currency_suffix'] ? 
$config->config_data['currency_suffix'] : 'NOK'; ?>",
-                               thousandsSeparator: "<?php echo 
lang('currency_thousands_separator') ?>",
-                               decimalSeparator: "<?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] : 
','; ?>",
-                               decimalPlaces: <?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 : 2; ?>
-                   });
-               }
-       }
-       var columnDefs = [{
-               key: "description",
-               label: "<?php echo lang('title') ?>",
-           sortable: false
-       },
-       {
-               key: "responsibility_title",
-               label: "<?php echo lang('contract_type') ?>",
-               sortable: true
-       },
-       {
-               key: "billing_info",
-               label: "<?php echo lang('billing_terms') ?>",
-               sortable: false
-       },
-       {
-               key: "total_sum",
-               label: "<?php echo lang('sum') ?>",
-               formatter: formatPrice,
-           sortable: true
-       },
-       {
-               key: "timestamp_stop",
-               label: "<?php echo lang('last_updated') ?>",
-           sortable: true
-       },
-       {
-               key: "created_by",
-               label: "<?php echo lang('run by') ?>",
-           sortable: false
-       },
-       {
-               key: "timestamp_commit",
-               label: "<?php echo lang('Commited') ?>",
-           sortable: true
-       },
-       {
-               key: "actions",
-               hidden: true
-       },
-       {
-               key: "labels",
-               hidden: true
-       },
-       {
-               key: "ajax",
-               hidden: true
-       }];
-
-       <?php
-               if(isset($extra_cols)){
-                       foreach($extra_cols as $col){
-                               $literal = "{key: \"".$col["key"]."\",
-                                               label: \"".$col["label"]."\"}";
-                               if($col["index"]){
-                                       echo 
"columnDefs.splice(".$col["index"].", 0,".$literal.");";
-                               } else {
-                                       echo "columnDefs.push($literal);";
-                               }
-                       }
-               }
-       ?>
-
-       <?php
-               if(isset($hide_cols)){
-                       foreach($hide_cols as $col){
-                               ?>
-                                       for(var i = 0; i < columnDefs.length; 
i++){
-                                               if(columnDefs[i].key == '<?php 
echo $col ?>'){
-                                                       columnDefs[i].hidden = 
true;
-                                               }
-                                       }
-
-                               <?php
-                       }
-               }
-       ?>
-
-       // Initiating the data source
-       setDataSource(
-               
'index.php?menuaction=rental.uibilling.query&amp;phpgw_return_as=json<?php echo 
$url_add_on; ?>&amp;editable=<?php echo $editable ? "true" : "false"; ?>',
-               columnDefs,
-               '<?php echo $list_id ?>_form',
-               ['<?php echo $list_id 
?>_ctrl_toggle_active_rental_composites','<?php echo $list_id 
?>_ctrl_toggle_occupancy_of_rental_composites','<?php echo $list_id 
?>_ctrl_search_query'],
-               '<?php echo $list_id ?>_container',
-               '<?php echo $list_id ?>_paginator'
-       );
-
-    function doExport() {
-        var dl = 
window.open('index.php?menuaction=rental.uibilling.download<?php echo 
$url_add_on."&amp;export=true"; ?>');
-    }
-</script>
-<!-- <fieldset>
-       <h3><?php echo lang('export_to') ?></h3>
-       <div id="export"><a href="javascript:doExport();"><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>

Deleted: branches/dev-syncromind/rental/templates/base/billing_step0.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/billing_step0.php     
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/billing_step0.php     
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,43 +0,0 @@
-<?php
-       include("common.php");
-?>
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/x-office-document.png" /> <?php echo lang('invoice_menu') ?></h1>
-<form action="#" method="post">
-       <input type="hidden" name="step" value="0"/>
-       <div>
-               <fieldset>
-                       <h3><?php echo lang('field_of_responsibility') ?></h3>
-                       <select name="contract_type" id="contract_type">
-                               <?php 
-                               $fields = 
rental_socontract::get_instance()->get_fields_of_responsibility();
-                               foreach($fields as $id => $label)
-                               {
-                                       $names = 
$this->locations->get_name($id);
-                                               if($names['appname'] == 
$GLOBALS['phpgw_info']['flags']['currentapp'])
-                                               {
-                                                       
if($this->hasPermissionOn($names['location'],PHPGW_ACL_ADD))
-                                                       {
-                                                               ?>
-                                                               <option 
value="<?php echo $id ?>" <?php echo ($id == $contract_type ? 
'selected="selected"' : '')?>><?php echo lang($label) ?></option>
-                                                               <?php
-                                                       }
-                                               }
-                               }
-                               ?>
-                       </select>
-                       <input type="submit" name="next" value="<?php echo 
lang('create_billing') ?>"/>
-               </fieldset>
-               <div>&amp;nbsp;</div>
-               <?php echo rental_uicommon::get_page_error($errorMsgs) ?>
-               <?php echo rental_uicommon::get_page_warning($warningMsgs) ?>
-               <?php echo rental_uicommon::get_page_message($infoMsgs) ?>
-               <div>&amp;nbsp;</div>
-       </div>
-</form>
-<?php 
-       $list_form = true;
-       $list_id = 'all_billings';
-       $url_add_on = '&amp;type='.$list_id;
-       $extra_cols = null;
-       include('billing_list_partial.php');
-?>
\ No newline at end of file

Deleted: branches/dev-syncromind/rental/templates/base/billing_step1.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/billing_step1.php     
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/billing_step1.php     
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,110 +0,0 @@
-<?php
-       include("common.php");
-?>
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/x-office-document.png" /> <?php echo lang('invoice_menu') ?></h1>
-<form action="#" method="post">
-       <input type="hidden" name="step" value="1"/>
-       <div>
-               <fieldset>
-                       <h3><?php echo lang('field_of_responsibility') ?></h3>
-                               <?php 
-                               $fields = 
rental_socontract::get_instance()->get_fields_of_responsibility();
-                               foreach($fields as $id => $label)
-                               {
-                                       if($id == $contract_type){
-                                       ?>
-                                               <input type="hidden" 
name="contract_type" id="contract_type" value="<?php echo $id ?>"/>
-                                               <?php echo lang($label)?>
-                                       <?php 
-                                       }
-                               }
-                               ?>
-               </fieldset>
-               <fieldset>
-                       <h3><?php echo lang('title') ?></h3>
-                       <input type="text" name="title" id="title" value="<?php 
echo $title == null ? '' : $title ?>"/>
-                       <select name="existing_billing" id="existing_billing">
-                               <option value="new_billing"><?php echo 
lang('new_billing')?></option>
-                       <?php
-                               $result_objects = 
rental_sobilling::get_instance()->get(null, null, null, null, null, null, 
array('location_id' => $contract_type));
-                               foreach($result_objects as $billing){
-                                       if($billing->get_location_id() == 
$contract_type){
-                                               ?>
-                                                       <option value="<?php 
echo $billing->get_id()?>"<?php echo $billing->get_id() == $existing_billing ? 
' selected' : '' ?>><?php echo $billing->get_title()?></option>
-                                               <?php 
-                                       }
-                               }
-                       ?>
-                       </select>
-               </fieldset>
-               <fieldset>
-                       <h3><?php echo lang('year') ?></h3>
-                       <select name="year" id="year">
-                               <?php
-                               $this_year = date('Y');
-                               $years = rental_contract::get_year_range();
-                               foreach($years as $year)
-                               {
-                                       ?>
-                                       <option value="<?php echo $year 
?>"<?php echo $this_year == $year ? ' selected="selected"' : '' ?>><?php echo 
$year ?></option>
-                                       <?php
-                               }
-                               ?>
-                       </select>
-               </fieldset>
-               <fieldset>
-                       <h3><?php echo lang('billing_term') ?></h3>
-                       <select name="billing_term" id="billing_term">
-                               <?php
-                               $current=0;
-                               
foreach(rental_sobilling::get_instance()->get_billing_terms() as $term_id => 
$term_title)
-                               {
-                                       ?>
-                                       <optgroup label="<?php echo 
lang($term_title) ?>">
-                                       <?php if($current == 0){?>
-                                       <option value="<?php echo $term_id 
?>-1" <?php echo ($term_id."-1" == $billing_term_selection ? 
'selected="selected"' : '')?>><?php echo lang($term_title) ?></option>
-                                       <?php }
-                                       else if($current == 1){?>
-                                               <option value="<?php echo 
$term_id ?>-1" <?php echo ($term_id."-1" == $billing_term_selection ? 
'selected="selected"' : '')?>>1. halv&aring;r</option>
-                                               <option value="<?php echo 
$term_id ?>-2" <?php echo ($term_id."-1" == $billing_term_selection ? 
'selected="selected"' : '')?>>2. halv&aring;r</option>
-                                       <?php }
-                                       else if($current == 2){?>
-                                               <option value="<?php echo 
$term_id ?>-1" <?php echo ($term_id."-1" == $billing_term_selection ? 
'selected="selected"' : '')?>>1. kvartal</option>
-                                               <option value="<?php echo 
$term_id ?>-2" <?php echo ($term_id."-2" == $billing_term_selection ? 
'selected="selected"' : '')?>>2. kvartal</option>
-                                               <option value="<?php echo 
$term_id ?>-3" <?php echo ($term_id."-3" == $billing_term_selection ? 
'selected="selected"' : '')?>>3. kvartal</option>
-                                               <option value="<?php echo 
$term_id ?>-4" <?php echo ($term_id."-4" == $billing_term_selection ? 
'selected="selected"' : '')?>>4. kvartal</option>
-                                       <?php }
-                                       else if($current == 3){?>
-                                        <?php 
-                                               $this_month = date('n');
-                                               for($i = 1; $i <= 12; $i++)
-                                               {
-                                                       ?>
-                                                       <option value="<?php 
echo $term_id ?>-<?php echo $i ?>"<?php echo ($term_id."-".$i == 
$billing_term_selection ? ' selected="selected"' : '')?>><?php echo lang('month 
' . $i . ' capitalized') ?></option>
-                                                       <?php
-                                               }
-                                       }else{?>
-                                        <option value="<?php echo $term_id 
?>-1" <?php echo ($term_id."-1" == $billing_term_selection ? 
'selected="selected"' : '')?>><?php echo lang($term_title) ?></option>
-                                       <?php }
-                                       $current++;?>
-                                       </optgroup>
-                       <?php }
-                               ?>
-                       </select>
-               </fieldset>
-               <fieldset>
-                       <h3><?php echo lang('Export format') ?></h3>
-                       <input type="hidden" name="export_format" 
id="export_format" value="<?php echo $export_format?>"/>
-                       <?php echo lang($export_format)?>       
-               </fieldset>
-               <fieldset>
-                       <input type="submit" name="previous" value="<?php echo 
lang('previous') ?>"/>
-                       <input type="submit" name="next" value="<?php echo 
lang('next') ?>"/>
-               </fieldset>
-               <div>&amp;nbsp;</div>
-               <?php echo rental_uicommon::get_page_error($errorMsgs) ?>
-               <?php echo rental_uicommon::get_page_warning($warningMsgs) ?>
-               <?php echo rental_uicommon::get_page_message($infoMsgs) ?>
-               <div>&amp;nbsp;</div>
-       </div>
-</form>
\ No newline at end of file

Deleted: branches/dev-syncromind/rental/templates/base/billing_step2.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/billing_step2.php     
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/billing_step2.php     
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,454 +0,0 @@
-<h1>
-<img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/x-office-document.png" /> 
-<?php echo lang('invoice_run') ?>: 
-<?php echo $title ?>
-</h1>
-<form action="#" method="post" id="invoice_run">
-       <input type="hidden" name="step" value="2"/>
-       <input type="hidden" name="contract_type" value="<?php echo 
$contract_type ?>"/>
-       <input type="hidden" name="year" value="<?php echo $year ?>"/>
-       <input type="hidden" name="month" value="<?php echo $month ?>"/>
-       <input type="hidden" name="title" value="<?php echo $title ?>"/>
-       <input type="hidden" name="use_existing" value="<?php echo 
$use_existing ?>"/>
-       <input type="hidden" name="existing_billing" value="<?php echo 
$existing_billing ?>"/>
-       <input type="hidden" name="billing_term" value="<?php echo 
$billing_term ?>"/>
-       <input type="hidden" name="billing_term_selection" value="<?php echo 
$billing_term_selection ?>"/>
-       <input type="hidden" name="export_format" value="<?php echo 
$export_format ?>"/>                
-       
-<a name="top"></a>
-<script>
-var toggleAll = function (target_tag_name, source_tag_name)
-{
-       var source_check_box = document.getElementsByName(source_tag_name);
-       var target_check_boxes = document.getElementsByName(target_tag_name);
-       for(var i=0; i<target_check_boxes.length; i++)
-       {
-               target_check_boxes[i].checked = source_check_box[0].checked;
-       }
-       
-}
-</script>
-
-<?php 
-
-$date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-               
-$config        = CreateObject('phpgwapi.config','rental');
-$config->read();
-$area_suffix = isset($config->config_data['area_suffix'] ) ? 
$config->config_data['area_suffix'] : '' ;
-$valuta_prefix = isset($config->config_data['currency_prefix']) ? 
$config->config_data['currency_prefix'] : '';
-$valuta_suffix = isset($config->config_data['currency_suffix']) ? 
$config->config_data['currency_suffix'] : '';
-?>
-
-<div id="invoice_details">
-<h3>Fakturakjøringsdetaljer</h3>
-       <dl>
-               <dt><?php echo lang('contract_type') ?></dt>
-               <dd>
-                       <?php
-                               $fields = 
rental_socontract::get_instance()->get_fields_of_responsibility();
-                               foreach($fields as $id => $label)
-                               {
-                                       if($id == $contract_type)
-                                       {
-                                               echo lang($label);
-                                       }
-                               }
-                       ?>
-               </dd>
-               <dt><?php echo lang('billing_start') ?></dt>
-               <dd><?php echo date($date_format, $bill_from_timestamp); ?></dd>
-               <dt><?php echo lang('year') ?></dt>
-               <dd><?php echo $year ?></dd>
-               <dt><?php echo lang('Export format') ?></dt>
-                       <dd><?php echo lang($export_format); ?></dd>
-               
-               <?php if($billing_term == 1){?>
-                       <dt><?php echo lang('month') ?></dt>
-                       <dd><?php echo lang('month ' . $month . ' capitalized') 
?></dd>
-                       <dt>    
-                               <label for="billing_term"><?php echo 
lang('billing_term') ?></label>
-                       </dt>
-                       <dd>
-                               <?php
-                               
foreach(rental_sobilling::get_instance()->get_billing_terms() as $term_id => 
$term_title)
-                               {
-                                       if($term_id == $billing_term)
-                                       {
-                                               echo lang($term_title);
-                                       }
-                               }
-                               ?>
-                       </dd>
-               <?php }
-                       else{?>
-                       <dt><?php echo lang('billing_term') ?></dt>
-                       <dd><?php echo $billing_term_label ?></dd>
-                               <?php } ?>
-                       
-                       
-       </dl>
-
-       <h3>Fakturakjøringsvalg</h3>    
-
-       <input type="submit" name="previous" value="<?php echo lang('cancel') 
?>"/>
-       <input type="submit" name="next" value="<?php echo lang('bill2') ?>"/>
-</div>
-
-<div id="user_messages">
-       <h3>Meldinger</h3>
-       <?php echo rental_uicommon::get_page_error($errorMsgs) ?>
-       <?php echo rental_uicommon::get_page_warning($warningMsgs) ?>
-       <?php echo rental_uicommon::get_page_message($infoMsgs) ?>
-</div>
-
-<div id="list_navigation">
-       <h3>Kontrakter i kjøring</h3>
-       <ul>
-               <li><a href="#non_cycle"><?php echo 
lang('contracts_out_of_cycle'); ?> (<?php echo count($irregular_contracts); 
?>)</a></li>
-               <li><a href="#one_time"><?php echo 
lang('contracts_with_one_time'); ?> (<?php echo 
count($contracts_with_one_time); ?>)</a></li>
-               <li><a href="#cycle"><?php echo lang('contracts_in_cycle'); ?> 
(<?php echo count($contracts); ?>)</a></li>
-       </ul>
-       <h3>Kontraktsinformasjon</h3>
-       <ul>
-               <li><a href="#new"><?php echo 
lang('contracts_not_billed_before'); ?> (<?php echo 
count($not_billed_contracts); ?>)</a></li>
-               <li><a href="#removed"><?php echo lang('contracts_removed'); ?> 
(<?php echo count($removed_contracts); ?>)</a></li>
-       </ul>
-</div>
-
-<div id="contract_lists">
-       <a name="non_cycle" ></a>
-       <h2><?php echo lang('contracts_out_of_cycle'); ?> (<?php echo 
count($irregular_contracts); ?>)</h2>
-       <?php
-               /* 
-                * Contracts which deviate from normal billing cycle:the 
executive officer will decide if the contract should:
-                * 1. Be part of this run
-                * 2. Override the invoice period start date with billing start 
date on the contract
-                */
-               if($irregular_contracts != null && count($irregular_contracts) 
> 0)
-               {
-       ?>              
-               <table id="contractTable">
-               <thead>
-                   <tr>
-                                       <th><?php echo lang('contract') ?></th>
-                                       <th><?php echo lang('date_start') 
?></th>
-                                       <th><?php echo lang('date_end') ?></th>
-                                       <th><?php echo lang('composite_name') 
?></th>
-                                       <th><?php echo lang('party_name') 
?></th>
-                                       <th><?php echo lang('total_price') 
?></th>
-                                       <th><?php echo lang('area') ?></th>
-                                       <th><input type="checkbox" 
name="toggle_billing_start" 
onClick="toggleAll('override_start_date[]','toggle_billing_start')"/><?php echo 
lang('override') ?></th>
-                                       <th><input type="checkbox" 
name="toggle_included_contracts" 
onClick="toggleAll('contract[]','toggle_included_contracts')" /><?php echo 
lang('bill2') ?></th>
-                   </tr>
-               </thead>
-               <tbody>
-                       <?php
-                               foreach ($irregular_contracts as $contract)
-                               {
-                                       if(isset($contract))
-                                       {
-                                       ?>
-                                       <tr>
-                                               <td><?php echo 
$contract->get_old_contract_id() ?></td>
-                                               <td><?php echo 
($contract->get_contract_date()->has_start_date() ? date($date_format, 
$contract->get_contract_date()->get_start_date()) : '') ?></td>
-                                               <td><?php echo 
($contract->get_contract_date()->has_end_date() ? date($date_format, 
$contract->get_contract_date()->get_end_date()) : '') ?></td>
-                                               <td>
-                                                               <?php echo 
substr($contract->get_composite_name(),0,15); echo 
strlen($contract->get_composite_name()) > 15 ? '...' : ''; ?>
-                                               </td>
-                                               <td>
-                                                               <?php echo 
substr($contract->get_party_name(),0,15);  echo 
strlen($contract->get_party_name()) > 15 ? '...' : ''; ?>
-                                               </td>
-                                               <td>
-                                                                <?php  echo 
$valuta_prefix; ?> &nbsp; <?php echo 
number_format($contract->get_total_price(),2,',',' '); ?> &nbsp; <?php  echo 
$valuta_suffix; ?>
-                                               </td>
-                                               <td>
-                                                               <?php echo 
$contract->get_rented_area() ?>&nbsp; <?php  echo $area_suffix; ?>
-                                               </td>
-                                               <td>
-                                                               <input 
name="override_start_date[]" value="<?php echo $contract->get_id() ?>" 
type="checkbox" />
-                                                               <?php echo 
date($date_format, $contract->get_billing_start_date()); ?>
-                                               </td>
-                                               <td>
-                                                               <input 
name="contract[]" value="<?php echo $contract->get_id() ?>" type="checkbox" />
-                                               </td>
-                                               </tr>
-                                       <?php
-                               }
-                       }
-                       ?>
-               </tbody>
-       </table>
-       <?php }?>
-       
-       <a name="one_time" href="#top"><?php echo lang('to_the_top'); ?></a>
-    <h2><?php echo lang('contracts_with_one_time'); ?>  (<?php echo 
count($contracts_with_one_time); ?>)</h2>
-       <?php
-               /* 
-                * Contracts that has one-time price items. This list gives 
form input if the contract
-                * has only one-time price items on the invoice and the 
contract dates deviates from 
-                * regular billing period.
-                */ 
-               if($contracts_with_one_time != null && 
count($contracts_with_one_time) > 0)
-               {
-       ?>
-           <table id="contractTable">
-               <thead>
-                   <tr>
-                                       <th><?php echo lang('contract') ?></th>
-                                       <th><?php echo lang('date_start') 
?></th>
-                                       <th><?php echo lang('date_end') ?></th>
-                                       <th><?php echo lang('composite_name') 
?></th>
-                                       <th><?php echo lang('party_name') 
?></th>
-                                       <th><?php echo lang('only_one_time') 
?></th>
-                                       <th><?php echo lang('total_price') 
?></th>
-                   </tr>
-               </thead>
-               <tbody>
-                       <?php
-                               
-                                       ksort($contracts_with_one_time);
-                                       
-                                       // Run through all contracts selected 
for billing 
-                                       foreach ($contracts_with_one_time as 
$id => $contract)
-                                       {
-                                               if(isset($contract))
-                                               {
-                                               ?>
-                                               <tr>
-                                                       <td><?php echo 
$contract->get_old_contract_id(); ?>
-                                                       </td>
-                                                       <td><?php echo 
($contract->get_contract_date()->has_start_date() ? date($date_format, 
$contract->get_contract_date()->get_start_date()) : '') ?></td>
-                                                       <td><?php echo 
($contract->get_contract_date()->has_end_date() ? date($date_format, 
$contract->get_contract_date()->get_end_date()) : '') ?></td>
-                                                       <td title="<?php echo 
str_replace('<br/>',' ',$contract->get_composite_name());  ?>">
-                                                               <?php echo 
substr($contract->get_composite_name(),0,20); echo 
strlen($contract->get_composite_name()) > 20 ? '...' : ''; ?>
-                                                       </td>
-                                                       <td title="<?php echo 
str_replace('<br/>',' ',$contract->get_party_name());  ?>">
-                                                               <?php echo 
substr($contract->get_party_name(),0,20);  echo 
strlen($contract->get_party_name()) > 20 ? '...' : ''; ?>
-                                                       </td>
-                                                       <td>
-                                                               <?php 
if($contract->get_bill_only_one_time())
-                                                               {
-                                                                       echo 
lang('only_one_time_yes');
-                                                               ?>
-                                                                       <input 
name="bill_only_one_time[]" value="<?php echo $contract->get_id() ?>" 
type="hidden"/>
-                                                                       <input 
name="contract[]" value="<?php echo $contract->get_id() ?>" type="hidden"/>
-                                                               <?php 
-                                                               }
-                                                               else
-                                                               {
-                                                                       echo 
lang('only_one_time_no');
-                                                               }
-                                                               ?>
-                                                       </td>
-                                                       <td><?php echo 
number_format($contract->get_total_price(),2,',',' '); ?>
-                                               </tr>
-                                               <?php
-                                               }
-                                       }
-                               ?>
-               </tbody>
-               </table>
-       <?php } ?>
-       
-       <a name="cycle" href="#top"><?php echo lang('to_the_top'); ?></a>
-       <h2><?php echo lang('contracts_in_cycle'); ?>  (<?php echo 
count($contracts); ?>)</h2>
-       <?php 
-               /* Contracts which follow normal billing cycle. The executive 
officer is not allowed to remove any
-                * of the contracts from the billing or change the invoice 
start date for any contract. Hence, the list is 
-                * only for information purposes.
-                */
-               if($contracts != null && count($contracts) > 0)
-               {
-       ?>
-           <table id="contractTable">
-               <thead>
-                   <tr>
-                                       <th><?php echo lang('contract') ?></th>
-                                       <th><?php echo lang('date_start') 
?></th>
-                                       <th><?php echo lang('date_end') ?></th>
-                                       <th><?php echo lang('composite_name') 
?></th>
-                                       <th><?php echo lang('party_name') 
?></th>
-                                       <th><?php echo lang('total_price') 
?></th>
-                                       <th><?php echo lang('area') ?></th>
-                   </tr>
-               </thead>
-               <tbody>
-                                       <?php
-                                       ksort($contracts);
-                                       //var_dump($contracts);
-                                       
-                                       // Run through all contracts selected 
for billing 
-                                       //$temp_index = 1;
-                                       //$temp_index2 = 1;
-                                       foreach ($contracts as $id => $contract)
-                                       {
-                                               //echo '<br/>'.$temp_index2 . 
'-'.$id.'=>';
-                                               if(isset($contract))
-                                               {
-                                                       //echo $id . '-' . 
$temp_index.' , ';
-                                               ?>
-                                               <tr>
-                                                       <td><?php echo 
$contract->get_old_contract_id() ?>
-                                                       <input 
name="contract[]" value="<?php echo $contract->get_id() ?>" type="hidden"/></td>
-                                                       <td><?php echo 
($contract->get_contract_date()->has_start_date() ? date($date_format, 
$contract->get_contract_date()->get_start_date()) : '') ?></td>
-                                                       <td><?php echo 
($contract->get_contract_date()->has_end_date() ? date($date_format, 
$contract->get_contract_date()->get_end_date()) : '') ?></td>
-                                                       <td title="<?php echo 
str_replace('<br/>',' ',$contract->get_composite_name());  ?>">
-                                                               <?php echo 
substr($contract->get_composite_name(),0,20); echo 
strlen($contract->get_composite_name()) > 20 ? '...' : ''; ?>
-                                                       </td>
-                                                       <td title="<?php echo 
str_replace('<br/>',' ',$contract->get_party_name());  ?>">
-                                                                       <?php 
echo substr($contract->get_party_name(),0,20);  echo 
strlen($contract->get_party_name()) > 20 ? '...' : ''; ?>
-                                                       </td>
-                                                       <td>
-                                                                        <?php  
echo $valuta_prefix; ?> &nbsp; <?php echo 
number_format($contract->get_total_price(),2,',',' '); ?> &nbsp; <?php  echo 
$valuta_suffix; ?>
-                                                       </td>
-                                                       <td>
-                                                               <?php 
-                                                                       
if($contract->get_rented_area() > 0)
-                                                                       {
-                                                                               
echo $contract->get_rented_area() ?> &nbsp; <?php  echo $area_suffix; 
-                                                                       }       
        
-                                                               ?>
-                                                       </td>
-                                               </tr>
-                                               <?php
-                                               //$temp_index++;
-                                               }
-                                               //$temp_index2++;
-                                       }
-                               ?>
-               </tbody>
-           </table>
-    <?php } ?>
-    
-    <a name="new" href="#top"><?php echo lang('to_the_top'); ?></a>
-    <h2><?php echo lang('contracts_not_billed_before'); ?>  (<?php echo 
count($not_billed_contracts); ?>)</h2>
-       <?php 
-               /* 
-                * Contracts which has not been billed before. The list is a 
supplement to the irregular 
-                * contract list, i.e. the contract will also be a record in 
the first list on the page.
-                * Hence, this list is for information purposes.
-                */
-               if($not_billed_contracts != null && 
count($not_billed_contracts) > 0)
-               {
-       ?>
-           <table id="contractTable">
-               <thead>
-                   <tr>
-                                       <th><?php echo lang('contract') ?></th>
-                                       <th><?php echo lang('date_start') 
?></th>
-                                       <th><?php echo lang('date_end') ?></th>
-                                       <th><?php echo lang('composite_name') 
?></th>
-                                       <th><?php echo lang('party_name') 
?></th>
-                                       <th><?php echo lang('total_price') 
?></th>
-                                       <th><?php echo lang('area') ?></th>
-                   </tr>
-               </thead>
-               <tbody>
-                       <?php
-                               
-                                       ksort($not_billed_contracts);
-                                       
-                                       // Run through all contracts selected 
for billing 
-                                       foreach ($not_billed_contracts as $id 
=> $contract)
-                                       {
-                                               if(isset($contract))
-                                               {
-                                               ?>
-                                               <tr>
-                                                       <td><?php echo 
$contract->get_old_contract_id() ?></td>
-                                                       <td><?php echo 
($contract->get_contract_date()->has_start_date() ? date($date_format, 
$contract->get_contract_date()->get_start_date()) : '') ?></td>
-                                                       <td><?php echo 
($contract->get_contract_date()->has_end_date() ? date($date_format, 
$contract->get_contract_date()->get_end_date()) : '') ?></td>
-                                                       <td title="<?php echo 
str_replace('<br/>',' ',$contract->get_composite_name());  ?>">
-                                                               <?php echo 
substr($contract->get_composite_name(),0,20); echo 
strlen($contract->get_composite_name()) > 20 ? '...' : ''; ?>
-                                                       </td>
-                                                       <td  title="<?php echo 
str_replace('<br/>',' ',$contract->get_party_name());  ?>">
-                                                               <?php echo 
substr($contract->get_party_name(),0,20);  echo 
strlen($contract->get_party_name()) > 20 ? '...' : ''; ?>
-                                                       </td>
-                                                       <td>
-                                                               <?php  echo 
$valuta_prefix; ?> &nbsp; <?php echo 
number_format($contract->get_total_price(),2,',',' '); ?> &nbsp; <?php  echo 
$valuta_suffix; ?>
-                                                       </td>
-                                                       <td>
-                                                               <?php 
-                                                                       
if($contract->get_rented_area() > 0)
-                                                                       {
-                                                                               
echo $contract->get_rented_area() ?> &nbsp; <?php  echo $area_suffix; 
-                                                                       }       
        
-                                                               ?>
-                                                       </td>
-                                               </tr>
-                                               <?php
-                                               }
-                                       }
-                               ?>
-               </tbody>
-               </table>
-       <?php } ?>
-    
-    
-       
-       <a name="removed" href="#top"><?php echo lang('to_the_top'); ?></a>
-       <h2><?php echo lang('contracts_removed');?>  (<?php echo 
count($removed_contracts); ?>)</h2>
-       <?php 
-               /* Contracts that for some reason is removed from the billing, 
e.g. contracts which total price equals zero.
-                * A message will be given to user on the top of the page 
regarding the reason for removal.
-                */
-               if($removed_contracts != null && count($removed_contracts) > 0)
-               {
-       ?>
-           <table id="contractTable">
-               <thead>
-                   <tr>
-                                       <th><?php echo lang('contract') ?></th>
-                                       <th><?php echo lang('date_start') 
?></th>
-                                       <th><?php echo lang('date_end') ?></th>
-                                       <th><?php echo lang('composite_name') 
?></th>
-                                       <th><?php echo lang('party_name') 
?></th>
-                                       <th><?php echo lang('total_price') 
?></th>
-                                       <th><?php echo lang('area') ?></th>
-                   </tr>
-               </thead>
-               <tbody>
-                       <?php
-                               
-                                       ksort($removed_contracts);
-                                       
-                                       // Run through all contracts selected 
for billing 
-                                       foreach ($removed_contracts as $id => 
$contract)
-                                       {
-                                               if(isset($contract))
-                                               {
-                                               ?>
-                                               <tr>
-                                                       <td><?php echo 
$contract->get_old_contract_id() ?></td>
-                                                       <td><?php echo 
($contract->get_contract_date()->has_start_date() ? date($date_format, 
$contract->get_contract_date()->get_start_date()) : '') ?></td>
-                                                       <td><?php echo 
($contract->get_contract_date()->has_end_date() ? date($date_format, 
$contract->get_contract_date()->get_end_date()) : '') ?></td>
-                                                       <td title="<?php echo 
str_replace('<br/>',' ',$contract->get_composite_name());  ?>">
-                                                                       <?php 
echo substr($contract->get_composite_name(),0,20); echo 
strlen($contract->get_composite_name()) > 20 ? '...' : ''; ?>
-                                                       </td>
-                                                       <td title="<?php echo 
str_replace('<br/>',' ',$contract->get_party_name());  ?>">
-                                                                       <?php 
echo substr($contract->get_party_name(),0,20);  echo 
strlen($contract->get_party_name()) > 20 ? '...' : ''; ?>
-                                                       </td>
-                                                       <td>
-                                                                        <?php  
echo $valuta_prefix; ?> &nbsp; <?php echo 
number_format($contract->get_total_price(),2,',',' '); ?> &nbsp; <?php  echo 
$valuta_suffix; ?>
-                                                       </td>
-                                                       <td>
-                                                                       <?php 
-                                                                               
if($contract->get_rented_area() > 0)
-                                                                               
{
-                                                                               
        echo $contract->get_rented_area() ?> &nbsp; <?php  echo $area_suffix; 
-                                                                               
}               
-                                                                       ?>
-                                                       </td>
-                                               </tr>
-                                               <?php
-                                               }
-                                       }
-                               ?>
-               </tbody>
-               </table>
-       <?php 
-       }
-       ?>
-</div>
-</form>

Deleted: branches/dev-syncromind/rental/templates/base/common.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/common.php    2015-12-10 
14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/common.php    2015-12-10 
14:38:47 UTC (rev 14566)
@@ -1,978 +0,0 @@
-<script type="text/javascript">
-
-/**
- * Javascript for the rental module.  Holds datasource init functions and form 
helpers.
- *
- * Functions and objects within this file are kept in the YAHOO.rental 
namespace.
- */
-
-       // Holds data source setup funtions
-       YAHOO.rental.setupDatasource = new Array();
-
-       //Holds all data sources
-       YAHOO.rental.datatables = new Array();
-
-       counter = 0;
-       // Adds data source setup funtions
-       function setDataSource(source_url, column_defs, form_id, filter_ids, 
container_id, paginator_id, datatable_id,rel_id, editor_action, 
disable_left_click) {
-               YAHOO.rental.setupDatasource.push(
-                       function() {
-                               this.url = source_url;
-                               this.columns = column_defs;
-                               this.form = form_id;
-                               this.filters = filter_ids;
-                               this.container = container_id;
-                               this.paginator = paginator_id;
-                               this.tid = datatable_id;
-                               this.related_datatable = rel_id;
-                               this.editor_action = editor_action;
-                               if(disable_left_click) {
-                                       this.disable_left_click = true;
-                               } else {
-                                       this.disable_left_click = false;
-                               }
-                       }
-               );
-       }
-
-       YAHOO.rental.formatDate = function(elCell, oRecord, oColumn, oData) {
-               //alert("oDate: " + oData);
-               if (oData && oData != "Invalid Date" && oData != "NaN") {
-                       var my_date = Math.round(Date.parse(oData) / 1000);
-                       elCell.innerHTML = formatDate('<?php echo 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'] ?>', 
my_date);
-               } else {
-                       elCell.innerHTML = '';
-               }
-       };
-
-       // Override the built-in formatter
-       YAHOO.widget.DataTable.formatCurrency = function(elCell, oRecord, 
oColumn, oData) {
-               if (oData != undefined) {
-                       elCell.innerHTML = YAHOO.util.Number.format( oData,
-                       {
-                               prefix: "<?php echo 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'].' ' ?>",
-                               thousandsSeparator: ",",
-                               decimalPlaces: 2
-                   });
-               }
-               //if (oData != undefined) {
-               //      elCell.innerHTML = '<?php echo 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'].' ' ?>' + 
parseFloat(oData).toFixed(2);
-               //}
-       };
-
-       // Reloads all data sources that are necessary based on the selected 
related datatable
-       function reloadDataSources(selected_datatable){
-
-               //... hooks into  the regular callback function 
(onDataReturnInitializeTable) call to set empty payload array
-               var loaded =  function  ( sRequest , oResponse , oPayload ) {
-                       var payload = new Array();
-                       this.onDataReturnInitializeTable( sRequest , oResponse 
, payload );
-               }
-
-               //... refresh the selected data tables
-               
selected_datatable.getDataSource().sendRequest('',{success:loaded, 
scope:selected_datatable});
-
-               //... traverse all datatables and refresh related (to the 
selected) data tables
-               for(var i=0; i<YAHOO.rental.datatables.length; i++){
-                       var datatable = YAHOO.rental.datatables[i];
-
-                       for(var j=0;j<selected_datatable.related.length;j++){
-                               var curr_related = 
selected_datatable.related[j];
-                               if(datatable.tid == curr_related){
-                                       
datatable.getDataSource().sendRequest('',{success:loaded,scope: datatable});
-                               }
-                       }
-               }
-       }
-
-       var highlightEditableCell = function(oArgs) {
-               var elCell = oArgs.target;
-               if(YAHOO.util.Dom.hasClass(elCell, "yui-dt-editable")) {
-                       this.highlightCell(elCell);
-               }
-       };
-
-       // Wraps data sources setup logic
-       function dataSourceWrapper(source_properties,pag) {
-
-               this.properties = source_properties;
-               this.paginator = pag;
-
-               //... prepare base url
-               this.url = this.properties.url;
-               if(this.url[length-1] != '&') {
-                       this.url += '&';
-               }
-
-               //... set up a new data source
-               this.source = new YAHOO.util.DataSource(this.url);
-
-               this.source.responseType = YAHOO.util.DataSource.TYPE_JSON;
-               this.source.connXhrMode = "queueRequests";
-
-               this.source.responseSchema = {
-                       resultsList: "ResultSet.Result",
-                       fields: this.properties.columns,
-                       metaFields : {
-                               totalRecords: "ResultSet.totalRecords"
-                       }
-               };
-
-               //... set up a new data table
-               if(this.properties.tid == 'total_price')
-               {
-                       //if the datatable is display of total price on 
contract, always initialize
-                       this.table = new YAHOO.widget.DataTable(
-                               this.properties.container,
-                               this.properties.columns,
-                               this.source,
-                               {
-                                       paginator: this.paginator,
-                                       dynamicData: true,
-                                       MSG_EMPTY: '<?php echo 
lang("DATATABLE_MSG_EMPTY")?>',
-                                       MSG_ERROR: '<?php echo 
lang("DATATABLE_MSG_ERROR")?>',
-                                       MSG_LOADING: '<?php echo 
lang("DATATABLE_MSG_LOADING")?>'
-                               }
-                       );
-               }
-               else
-               {
-                       this.table = new YAHOO.widget.DataTable(
-                               this.properties.container,
-                               this.properties.columns,
-                               this.source,
-                               {
-                                       paginator: this.paginator,
-                                       dynamicData: true,
-                                       <?php
-                                               $populate = 
phpgw::get_var('populate_form'); 
-                                               echo isset($populate)? 
'initialLoad: false,':''
-                                       ?>
-                                       <?php 
-                                               $initLoad = 
phpgw::get_var('initial_load');
-                                               echo ($initLoad == 'no')? 
'initialLoad: false,':''
-                                       ?>
-                                       MSG_EMPTY: '<?php echo 
lang("DATATABLE_MSG_EMPTY")?>',
-                                       MSG_ERROR: '<?php echo 
lang("DATATABLE_MSG_ERROR")?>',
-                                       MSG_LOADING: '<?php echo 
lang("DATATABLE_MSG_LOADING")?>'
-                               }
-                       );
-               }
-
-               //... set table properties
-               this.table.related = this.properties.related_datatable;
-               this.table.tid = this.properties.tid;
-               this.table.container_id = this.properties.container;
-               this.table.editor_action = this.properties.editor_action;
-
-               //... push the data table on a stack
-               YAHOO.rental.datatables.push(this.table);
-
-               //... ?
-               this.table.handleDataReturnPayload = function(oRequest, 
oResponse, oPayload) {
-                       if(oPayload){
-                               oPayload.totalRecords = 
oResponse.meta.totalRecords;
-                               return oPayload;
-                       }
-               }
-
-               //... create context menu for each record after the table has 
loaded the data
-               this.table.doAfterLoadData = function() {
-                       onContextMenuBeforeShow = function(p_sType, p_aArgs)
-                       {
-                               var oTarget = this.contextEventTarget;
-                               if (this.getRoot() == this)
-                               {
-                                       if(oTarget.tagName != "TD")
-                                       {
-                                               oTarget = 
YAHOO.util.Dom.getAncestorByTagName(oTarget, "td");
-                                       }
-                                       oSelectedTR = 
YAHOO.util.Dom.getAncestorByTagName(oTarget, "tr");
-                                       oSelectedTR.style.backgroundColor  = 
'#AAC1D8' ;
-                                       oSelectedTR.style.color = "black";
-                                       YAHOO.util.Dom.addClass(oSelectedTR, 
prefixSelected);
-                               }
-                       }
-
-                       onContextMenuHide = function(p_sType, p_aArgs)
-                       {
-                               if (this.getRoot() == this && oSelectedTR)
-                               {
-                                       oSelectedTR.style.backgroundColor  = "" 
;
-                                       oSelectedTR.style.color = "";
-                                       YAHOO.util.Dom.removeClass(oSelectedTR, 
prefixSelected);
-                               }
-                       }
-                       
-                       var records = this.getRecordSet();
-                       var validRecords = 0;
-                       for(var i=0; i<records.getLength(); i++) {
-                               var record = records.getRecord(i);
-                               if(record == null)
-                               {
-                                       continue;
-                               }
-                               else
-                               {
-                                       validRecords++;
-                               }
-                                       
-                               // use a global counter to create unique names 
(even for the same datatable) for all context menues on the page
-                               var menuName = this.container_id + "_cm_" + 
counter;
-                               counter++;
-
-                               //... add menu items with label and handler 
function for click events
-                               var labels = record.getData().labels;
-                               //create a context menu that triggers on the 
HTML row element
-                               record.menu = new 
YAHOO.widget.ContextMenu(menuName,{trigger:this.getTrEl(validRecords -1 
),itemdata: labels, lazyload: true});
-
-                               //... subscribe handler for click events
-                               
record.menu.clickEvent.subscribe(onContextMenuClick, this);
-                               record.menu.subscribe("beforeShow", 
onContextMenuBeforeShow);
-                               record.menu.subscribe("hide", 
onContextMenuHide);
-
-                               //... render the menu on the related table row
-                               
record.menu.render(this.getTrEl(validRecords-1));
-                       }
-
-                       
-               }
-
-               //... calback methods for handling ajax calls
-               var ajaxResponseSuccess = function(o){
-                       reloadDataSources(this.args);
-               };
-
-               var ajaxResponseFailure = function(o){
-                       reloadDataSources(this.args);
-               };
-
-               //...create a handler for context menu clicks
-               var onContextMenuClick = function(eventString, args, table) {
-                       //... the argument holds the selected index number in 
the context menu
-                       var task = args[1];
-                       //... only act on a data table
-                       if(table instanceof YAHOO.widget.DataTable) {
-                               //... retrieve the record based on the selected 
table row
-                               var row = 
table.getTrEl(this.contextEventTarget);
-                               var record = table.getRecord(row);
-
-                               //... check whether this action should be an 
AJAX call
-                               if(record.getData().ajax[task.index]) {
-
-                                       var alertStatus = false;
-
-                                       // Check if confirm box should be 
displayed before request is executed
-                                       if( record.getData().alert != null )
-                                           alertStatus = 
record.getData().alert[0];
-
-                                       if( alertStatus ){
-                                               // Display confirm box with 
message
-                                               var alertMessage = 
record.getData().alert[1];
-                                               var answer = confirm( 
alertMessage );
-                                               
-                                               // Abort request if user clicks 
the abort button
-                                               if (!answer){
-                                                       return false;
-                                               }
-                                       }
-                                       
-                                       var request = 
YAHOO.util.Connect.asyncRequest(
-                                               'GET',
-                                               record.getData().actions[ 
task.index ],
-                                               {
-                                                       success: 
ajaxResponseSuccess,
-                                                       success: 
ajaxResponseFailure,
-                                                       args:table
-                                               });
-                               } else {
-                                       window.location = 
record.getData().actions[task.index];
-                               }
-                       }
-               };
-
-               // Handle mouseover and click events for inline editing
-               this.table.subscribe("cellMouseoverEvent", 
highlightEditableCell);
-               this.table.subscribe("cellMouseoutEvent", 
this.table.onEventUnhighlightCell);
-               this.table.subscribe("cellClickEvent", 
this.table.onEventShowCellEditor);
-
-               this.table.subscribe("editorSaveEvent", function(oArgs) {
-                       var field = oArgs.editor.getColumn().field;
-                       var value = oArgs.newData;
-                       var id = oArgs.editor.getRecord().getData().id;
-                       var action = oArgs.editor.getDataTable().editor_action;
-
-                       // Translate to unix time if the editor is a calendar.
-                       if (oArgs.editor._sType == 'date') {
-                               var selectedDate = 
oArgs.editor.calendar.getSelectedDates()[0];
-                               //alert("selDate1: " + selectedDate);
-                               // Make sure we're at midnight GMT
-                               selectedDate = selectedDate.toString().split(" 
");
-                               //for(var e=0;e<selectedDate.length;e++){
-                               //      alert("element " + e + ": " + 
selectedDate[e]);
-                               //}
-                               if(selectedDate[3] == "00:00:00"){
-                               //      alert("seldate skal byttes!");
-                                       selectedDate = 
selectedDate.slice(0,3).join(" ") + " " + selectedDate[5] + " 00:00:00 GMT"; 
-                               }
-                               else{
-                                       selectedDate = 
selectedDate.slice(0,4).join(" ") + " 00:00:00 GMT";
-                               }
-                               //selectedDate = 
selectedDate.toString().split(" ").slice(0, 4).join(" ") + " 00:00:00 GMT";
-                               //alert("selDate2: " + selectedDate);
-                               var value = Math.round(Date.parse(selectedDate) 
/ 1000);
-                               //alert("selDate3 value: " + value);
-                       }
-
-                       var request = YAHOO.util.Connect.asyncRequest(
-                                       'GET',
-                                       'index.php?menuaction=' + action + 
"&amp;field=" + field + "&amp;value=" + value + "&amp;id=" + id,
-                                       {
-                                               success: ajaxResponseSuccess,
-                                               failure: ajaxResponseFailure,
-                                               args:oArgs.editor.getDataTable()
-                                       }
-                               );
-               });
-
-               // Don't set the row to be left-clickable if the table is 
editable by inline editors.
-               // In that case we use cellClickEvents instead
-               var table_should_be_clickable = true;
-               for (i in this.properties.columns) {
-                       if (this.properties.columns[i].editor) {
-                               table_should_be_clickable = false;
-                       }
-               }
-
-               if (table_should_be_clickable && 
!this.properties.disable_left_click) {
-                       //... create a handler for regular clicks on a table row
-                       this.table.subscribe("rowClickEvent", function(e,obj) {
-                               YAHOO.util.Event.stopEvent(e);
-
-                               //... trigger first action on row click
-                               var row = obj.table.getTrEl(e.target);
-                               if(row) {
-                                       var record = obj.table.getRecord(row);
-
-                                       //... check whether this action should 
be an AJAX call
-                                       if(record.getData().ajax[0]) {
-                                               var request = 
YAHOO.util.Connect.asyncRequest(
-                                                       'GET',
-                                                       //... execute first 
action
-                                                       
record.getData().actions[0],
-                                                       {
-                                                               success: 
ajaxResponseSuccess,
-                                                               failure: 
ajaxResponseFailure,
-                                                               args:obj.table
-                                                       }
-                                               );
-                                       } else {
-                                               //... execute first action
-                                               window.location = 
record.getData().actions[0];
-                                       }
-                               }
-                       },this);
-
-                       //... highlight rows on mouseover.  This too only 
happens if the table is
-                       // not editable.
-                       this.table.subscribe("rowMouseoverEvent", 
this.table.onEventHighlightRow);
-                       this.table.subscribe("rowMouseoutEvent", 
this.table.onEventUnhighlightRow);
-               }
-
-
-               //... create context menues when the table renders
-               this.table.subscribe("renderEvent",this.table.doAfterLoadData);
-
-               //... listen for form submits and filter changes
-               
YAHOO.util.Event.addListener(this.properties.form,'submit',formListener,this,true);
-               YAHOO.util.Event.addListener(this.properties.filters, 
'change',formListener,this,true);
-       }
-
-
-       // Set up data sources when the document has loaded
-       YAHOO.util.Event.addListener(window, "load", function() {
-               var i = 0;
-               while(YAHOO.rental.setupDatasource.length > 0){
-                       //... create a variable name, assign set up function to 
that variable and instantiate properties
-                       variableName = "YAHOO.rental.datasource" + i;
-                       eval(variableName + " = 
YAHOO.rental.setupDatasource.shift()");
-                       var source_properties = eval("new " + variableName + 
"()");
-
-<?php
-       if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] 
> 0)
-       {
-               $user_rows_per_page = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
-       }
-       else {
-               $user_rows_per_page = 10;
-       }
-?>
-
-                       // ... create a paginator for this datasource
-                       var pag = new YAHOO.widget.Paginator({
-                               rowsPerPage: <?php echo $user_rows_per_page ?>,
-                               alwaysVisible: true,
-                               rowsPerPageOptions: [5, 10, 25, 50, 100, 200],
-                               firstPageLinkLabel: "<< <?php echo 
lang('first') ?>",
-                               previousPageLinkLabel: "< <?php echo 
lang('previous') ?>",
-                               nextPageLinkLabel: "<?php echo lang('next') ?> 
>",
-                               lastPageLinkLabel: "<?php echo lang('last') ?> 
>>",
-                               template                        : 
"{RowsPerPageDropdown}<?php echo lang('elements_pr_page') 
?>.{CurrentPageReport}<br/>  {FirstPageLink} {PreviousPageLink} {PageLinks} 
{NextPageLink} {LastPageLink}",
-                               pageReportTemplate      : "<?php echo 
lang('shows_from') ?> {startRecord} <?php echo lang('to') ?> {endRecord} <?php 
echo lang('of_total') ?> {totalRecords}.",
-                               containers: [source_properties.paginator]
-                       });
-
-                       pag.render();
-
-                       //... send data source properties and paginator to 
wrapper function
-                       this.wrapper = new dataSourceWrapper(source_properties, 
pag);
-                       i+=1;
-
-                       <?php
-                               $populate = phpgw::get_var('populate_form');
-                               if(isset($populate)){?>
-                                       var qs = 
YAHOO.rental.serializeForm(source_properties.form);
-                                   this.wrapper.source.liveData = 
this.wrapper.url + qs + '&';
-                                   this.wrapper.source.sendRequest('', 
{success: function(sRequest, oResponse, oPayload) {
-                                       
this.wrapper.table.onDataReturnInitializeTable(sRequest, oResponse, 
this.wrapper.paginator);
-                                   }, scope: this});
-                       <?php }
-                       ?>
-
-                       // XXX: Create generic column picker for all datasources
-
-                       // Shows dialog, creating one when necessary
-                       var newCols = true;
-                       var showDlg = function(e) {
-                               YAHOO.util.Event.stopEvent(e);
-
-                               if(newCols) {
-                                       // Populate Dialog
-                                       // Using a template to create elements 
for the SimpleDialog
-                                       var allColumns = 
this.wrapper.table.getColumnSet().keys;
-                                       var elPicker = 
YAHOO.util.Dom.get("dt-dlg-picker");
-                                       var elTemplateCol = 
document.createElement("div");
-                                       YAHOO.util.Dom.addClass(elTemplateCol, 
"dt-dlg-pickercol");
-                                       var elTemplateKey = 
elTemplateCol.appendChild(document.createElement("span"));
-                                       YAHOO.util.Dom.addClass(elTemplateKey, 
"dt-dlg-pickerkey");
-                                       var elTemplateBtns = 
elTemplateCol.appendChild(document.createElement("span"));
-                                       YAHOO.util.Dom.addClass(elTemplateBtns, 
"dt-dlg-pickerbtns");
-                                       var onclickObj = {fn:handleButtonClick, 
obj:this, scope:false };
-
-                                       // Create one section in the 
SimpleDialog for each Column
-                                       var elColumn, elKey, elButton, 
oButtonGrp;
-
-                                       for(var 
i=0,l=allColumns.length;i<l;i++) {
-                                               var oColumn = allColumns[i];
-                                               if(oColumn.label != 
'unselectable') { // We haven't marked the column as unselectable for the user
-                                                       // Use the template
-                                                       elColumn = 
elTemplateCol.cloneNode(true);
-
-                                                       // Write the Column key
-                                                       elKey = 
elColumn.firstChild;
-                                                       elKey.innerHTML = 
oColumn.label;
-
-                                                       // Create a ButtonGroup
-                                                       oButtonGrp = new 
YAHOO.widget.ButtonGroup({
-                                                               id: 
"buttongrp"+i,
-                                                               name: 
oColumn.getKey(),
-                                                               container: 
elKey.nextSibling
-                                                       });
-                                                       oButtonGrp.addButtons([
-                                                               { label: "Vis", 
value: "Vis", checked: ((!oColumn.hidden)), onclick: onclickObj},
-                                                               { label: 
"Skjul", value: "Skjul", checked: ((oColumn.hidden)), onclick: onclickObj}
-                                                       ]);
-
-                                                       
elPicker.appendChild(elColumn);
-                                               }
-                                       }
-
-                                       newCols = false;
-                               }
-
-                               myDlg.show();
-                       };
-
-                       var storeColumnsUrl = YAHOO.rental.storeColumnsUrl;
-                       var hideDlg = function(e) {
-                               this.hide();
-                               // After we've hidden the dialog we send a post 
call to store the columns the user has selected
-                               var postData = 'values[save]=1';
-                               var allColumns = 
wrapper.table.getColumnSet().keys;
-                               for(var i=0; i < allColumns.length; i++) {
-                                       if(!allColumns[i].hidden){
-                                               postData += 
'&values[columns][]=' + allColumns[i].getKey();
-                                       }
-                               }
-
-                               YAHOO.util.Connect.asyncRequest('POST', 
storeColumnsUrl, null, postData);
-                       };
-
-                       var handleButtonClick = function(e, oSelf) {
-                               var sKey = this.get("name");
-                               if(this.get("value") === "Skjul") {
-                                       // Hides a Column
-                                       wrapper.table.hideColumn(sKey);
-                               } else {
-                                       // Shows a Column
-                                       wrapper.table.showColumn(sKey);
-                               }
-                       };
-
-                       // Create the SimpleDialog
-                       YAHOO.util.Dom.removeClass("dt-dlg", "inprogress");
-                       var myDlg = new YAHOO.widget.SimpleDialog("dt-dlg", {
-                               width: "30em",
-                               visible: false,
-                               modal: false, // modal: true doesn't work for 
some reason - the dialog becomes unclickable
-                               buttons: [
-                                       {text:"Lukk", handler:hideDlg}
-                               ],
-                               fixedcenter: true,
-                               constrainToViewport: true
-                       });
-                       myDlg.render();
-
-                       // Nulls out myDlg to force a new one to be created
-                       wrapper.table.subscribe("columnReorderEvent", 
function(){
-                               newCols = true;
-                               YAHOO.util.Event.purgeElement("dt-dlg-picker", 
true);
-                               YAHOO.util.Dom.get("dt-dlg-picker").innerHTML = 
"";
-                       }, this, true);
-
-                       // Hook up the SimpleDialog to the link
-                       YAHOO.util.Event.addListener("dt-options-link", 
"click", showDlg, this, true);
-               }
-       });
-
-       /*
-        * Listen for events in form. Serialize all form elements. Stop
-        * the original request and send new request.
-        */
-       function formListener(event){
-               YAHOO.util.Event.stopEvent(event);
-               var qs = YAHOO.rental.serializeForm(this.properties.form);
-           this.source.liveData = this.url + qs + '&';
-           this.source.sendRequest('', {success: function(sRequest, oResponse, 
oPayload) {
-               this.table.onDataReturnInitializeTable(sRequest, oResponse, 
this.paginator);
-           }, scope: this});
-       }
-
-
-
-// TODO: All the calendar data must be removed when the 'old' calender is no 
longer used.
-
-// CALENDAR LOGIC
-
-function onClickOnInput(event)
-{
-       this.align();
-       this.show();
-}
-
-function closeCalender(event)
-{
-       YAHOO.util.Event.stopEvent(event);
-       this.hide();
-}
-
-function clearCalendar(event)
-{
-       YAHOO.util.Event.stopEvent(event);
-       this.clear();
-       document.getElementById(this.inputFieldID).value = '';
-       document.getElementById(this.hiddenField).value = '';
-}
-
-function initCalendar(inputFieldID, divContainerID, calendarBodyId, 
calendarTitle, closeButton,clearButton,hiddenField,noPostOnSelect)
-{
-       var overlay = new YAHOO.widget.Dialog(
-               divContainerID,
-               {       visible: false,
-                       close: true
-               }
-       );
-
-       var navConfig = {
-                       strings: {
-                               month:"<?php echo lang('month') ?>",
-                               year:"<?php echo lang('year') ?>",
-                               submit: "<?php echo lang('ok') ?>",
-                               cancel: "<?php echo lang('cancel') ?>",
-                               invalidYear: "<?php echo 
lang('select_date_valid_year') ?>"
-                               },
-                               initialFocus: "month"
-                       }
-       
-       var cal = new YAHOO.widget.Calendar(
-               calendarBodyId,
-               {       navigator:navConfig,
-                       title: '<?php echo lang('select_date') ?>',
-                       start_weekday:1,
-                       LOCALE_WEEKDAYS:"short"}
-       );
-
-       cal.cfg.setProperty("MONTHS_LONG",<?php echo lang('calendar_months') 
?>);
-       cal.cfg.setProperty("WEEKDAYS_SHORT",<?php echo 
lang('calendar_weekdays') ?>);
-       cal.render();
-
-       
cal.selectEvent.subscribe(onCalendarSelect,[inputFieldID,overlay,hiddenField,noPostOnSelect],false);
-       cal.inputFieldID = inputFieldID;
-       cal.hiddenField = hiddenField;
-
-       
YAHOO.util.Event.addListener(closeButton,'click',closeCalender,overlay,true);
-       
YAHOO.util.Event.addListener(clearButton,'click',clearCalendar,cal,true);
-       
YAHOO.util.Event.addListener(inputFieldID,'click',onClickOnInput,overlay,true);
-
-       return cal;
-}
-
-function onCalendarSelect(type,args,array){
-       var firstDate = args[0][0];
-       var month = firstDate[1] + "";
-       var day = firstDate[2] + "";
-       var year = firstDate[0] + "";
-       var date = month + "/" + day + "/" + year;
-       var hiddenDateField = document.getElementById(array[2]);
-       if(hiddenDateField != null)
-       {
-               if(month < 10)
-               {
-                       month = '0' + month;
-               }
-               if(day < 10)
-               {
-                       day = '0' + day;
-               }
-               hiddenDateField.value = year + '-' + month + '-' + day;
-       }
-       document.getElementById(array[0]).value = formatDate('<?php echo 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'] 
?>',Math.round(Date.parse(date)/1000));
-       array[1].hide();
-       if (cal_postOnChange || (array[3] != undefined && !array[3])) {
-               document.getElementById('ctrl_search_button').click();
-       }
-
-}
-
-/**
- * Update the selected calendar date with a date from an input field
- * Input field value must be of the format YYYY-MM-DD
- */
-function updateCalFromInput(cal, inputId) {
-       var txtDate1 = document.getElementById(inputId);
-
-       if (txtDate1.value != "") {
-
-               var date_elements = txtDate1.value.split('-');
-               var year = date_elements[0];
-               var month = date_elements[1];
-               var day = date_elements[2];
-
-               cal.select(month + "/" + day + "/" + year);
-               var selectedDates = cal.getSelectedDates();
-               if (selectedDates.length > 0) {
-                       var firstDate = selectedDates[0];
-                       cal.cfg.setProperty("pagedate", 
(firstDate.getMonth()+1) + "/" + firstDate.getFullYear());
-                       cal.render();
-               }
-
-       }
-}
-
-function formatDate ( format, timestamp ) {
-    // http://kevin.vanzonneveld.net
-    // +   original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)
-    // +      parts by: Peter-Paul Koch 
(http://www.quirksmode.org/js/beat.html)
-    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
-    // +   improved by: MeEtc (http://yass.meetcweb.com)
-    // +   improved by: Brad Touesnard
-    // +   improved by: Tim Wiel
-    // +   improved by: Bryan Elliott
-    // +   improved by: Brett Zamir (http://brett-zamir.me)
-    // +   improved by: David Randall
-    // +      input by: Brett Zamir (http://brett-zamir.me)
-    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
-    // +   improved by: Brett Zamir (http://brett-zamir.me)
-    // +   improved by: Brett Zamir (http://brett-zamir.me)
-    // +   derived from: gettimeofday
-    // %        note 1: Uses global: php_js to store the default timezone
-    // *     example 1: date('H:m:s \\m \\i\\s \\m\\o\\n\\t\\h', 1062402400);
-    // *     returns 1: '09:09:40 m is month'
-    // *     example 2: date('F j, Y, g:i a', 1062462400);
-    // *     returns 2: 'September 2, 2003, 2:26 am'
-    // *     example 3: date('Y W o', 1062462400);
-    // *     returns 3: '2003 36 2003'
-    // *     example 4: x = date('Y m d', (new Date()).getTime()/1000); // 
2009 01 09
-    // *     example 4: (x+'').length == 10
-    // *     returns 4: true
-
-    var jsdate=(
-        (typeof(timestamp) == 'undefined') ? new Date() : // Not provided
-        (typeof(timestamp) == 'number') ? new Date(timestamp*1000) : // UNIX 
timestamp
-        new Date(timestamp) // Javascript Date()
-    ); // , tal=[]
-    var pad = function(n, c){
-        if( (n = n + "").length < c ) {
-            return new Array(++c - n.length).join("0") + n;
-        } else {
-            return n;
-        }
-    };
-    var _dst = function (t) {
-        // Calculate Daylight Saving Time (derived from gettimeofday() code)
-        var dst=0;
-        var jan1 = new Date(t.getFullYear(), 0, 1, 0, 0, 0, 0);  // jan 1st
-        var june1 = new Date(t.getFullYear(), 6, 1, 0, 0, 0, 0); // june 1st
-        var temp = jan1.toUTCString();
-        var jan2 = new Date(temp.slice(0, temp.lastIndexOf(' ')-1));
-        temp = june1.toUTCString();
-        var june2 = new Date(temp.slice(0, temp.lastIndexOf(' ')-1));
-        var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
-        var daylight_time_offset = (june1 - june2) / (1000 * 60 * 60);
-
-        if (std_time_offset === daylight_time_offset) {
-            dst = 0; // daylight savings time is NOT observed
-        }
-        else {
-            // positive is southern, negative is northern hemisphere
-            var hemisphere = std_time_offset - daylight_time_offset;
-            if (hemisphere >= 0) {
-                std_time_offset = daylight_time_offset;
-            }
-            dst = 1; // daylight savings time is observed
-        }
-        return dst;
-    };
-    var ret = '';
-    var txt_weekdays = ["Sunday","Monday","Tuesday","Wednesday",
-        "Thursday","Friday","Saturday"];
-    var txt_ordin = {1:"st",2:"nd",3:"rd",21:"st",22:"nd",23:"rd",31:"st"};
-    var txt_months =  ["", "January", "February", "March", "April",
-        "May", "June", "July", "August", "September", "October", "November",
-        "December"];
-
-    var f = {
-        // Day
-            d: function(){
-                return pad(f.j(), 2);
-            },
-            D: function(){
-                var t = f.l();
-                return t.substr(0,3);
-            },
-            j: function(){
-                return jsdate.getDate();
-            },
-            l: function(){
-                return txt_weekdays[f.w()];
-            },
-            N: function(){
-                return f.w() + 1;
-            },
-            S: function(){
-                return txt_ordin[f.j()] ? txt_ordin[f.j()] : 'th';
-            },
-            w: function(){
-                return jsdate.getDay();
-            },
-            z: function(){
-                return (jsdate - new Date(jsdate.getFullYear() + "/1/1")) / 
864e5 >> 0;
-            },
-
-        // Week
-            W: function(){
-                var a = f.z(), b = 364 + f.L() - a;
-                var nd2, nd = (new Date(jsdate.getFullYear() + 
"/1/1").getDay() || 7) - 1;
-
-                if(b <= 2 && ((jsdate.getDay() || 7) - 1) <= 2 - b){
-                    return 1;
-                }
-                if(a <= 2 && nd >= 4 && a >= (6 - nd)){
-                    nd2 = new Date(jsdate.getFullYear() - 1 + "/12/31");
-                    return date("W", Math.round(nd2.getTime()/1000));
-                }
-                return (1 + (nd <= 3 ? ((a + nd) / 7) : (a - (7 - nd)) / 7) >> 
0);
-            },
-
-        // Month
-            F: function(){
-                return txt_months[f.n()];
-            },
-            m: function(){
-                return pad(f.n(), 2);
-            },
-            M: function(){
-                var t = f.F();
-                return t.substr(0,3);
-            },
-            n: function(){
-                return jsdate.getMonth() + 1;
-            },
-            t: function(){
-                var n;
-                if( (n = jsdate.getMonth() + 1) == 2 ){
-                    return 28 + f.L();
-                }
-                if( n & 1 && n < 8 || !(n & 1) && n > 7 ){
-                    return 31;
-                }
-                return 30;
-            },
-
-        // Year
-            L: function(){
-                var y = f.Y();
-                return (!(y & 3) && (y % 1e2 || !(y % 4e2))) ? 1 : 0;
-            },
-            o: function(){
-                if (f.n() === 12 && f.W() === 1) {
-                    return jsdate.getFullYear()+1;
-                }
-                if (f.n() === 1 && f.W() >= 52) {
-                    return jsdate.getFullYear()-1;
-                }
-                return jsdate.getFullYear();
-            },
-            Y: function(){
-                return jsdate.getFullYear();
-            },
-            y: function(){
-                return (jsdate.getFullYear() + "").slice(2);
-            },
-
-        // Time
-            a: function(){
-                return jsdate.getHours() > 11 ? "pm" : "am";
-            },
-            A: function(){
-                return f.a().toUpperCase();
-            },
-            B: function(){
-                // peter paul koch:
-                var off = (jsdate.getTimezoneOffset() + 60)*60;
-                var theSeconds = (jsdate.getHours() * 3600) +
-                                 (jsdate.getMinutes() * 60) +
-                                  jsdate.getSeconds() + off;
-                var beat = Math.floor(theSeconds/86.4);
-                if (beat > 1000) {
-                    beat -= 1000;
-                }
-                if (beat < 0) {
-                    beat += 1000;
-                }
-                if ((String(beat)).length == 1) {
-                    beat = "00"+beat;
-                }
-                if ((String(beat)).length == 2) {
-                    beat = "0"+beat;
-                }
-                return beat;
-            },
-            g: function(){
-                return jsdate.getHours() % 12 || 12;
-            },
-            G: function(){
-                return jsdate.getHours();
-            },
-            h: function(){
-                return pad(f.g(), 2);
-            },
-            H: function(){
-                return pad(jsdate.getHours(), 2);
-            },
-            i: function(){
-                return pad(jsdate.getMinutes(), 2);
-            },
-            s: function(){
-                return pad(jsdate.getSeconds(), 2);
-            },
-            u: function(){
-                return pad(jsdate.getMilliseconds()*1000, 6);
-            },
-
-        // Timezone
-            e: function () {
-/*                var abbr='', i=0;
-                if (this.php_js && this.php_js.default_timezone) {
-                    return this.php_js.default_timezone;
-                }
-                if (!tal.length) {
-                    tal = timezone_abbreviations_list();
-                }
-                for (abbr in tal) {
-                    for (i=0; i < tal[abbr].length; i++) {
-                        if (tal[abbr][i].offset === 
-jsdate.getTimezoneOffset()*60) {
-                            return tal[abbr][i].timezone_id;
-                        }
-                    }
-                }
-*/
-                return 'UTC';
-            },
-            I: function(){
-                return _dst(jsdate);
-            },
-            O: function(){
-               var t = pad(Math.abs(jsdate.getTimezoneOffset()/60*100), 4);
-               t = (jsdate.getTimezoneOffset() > 0) ? "-"+t : "+"+t;
-               return t;
-            },
-            P: function(){
-                var O = f.O();
-                return (O.substr(0, 3) + ":" + O.substr(3, 2));
-            },
-            T: function () {
-/*                var abbr='', i=0;
-                if (!tal.length) {
-                    tal = timezone_abbreviations_list();
-                }
-                if (this.php_js && this.php_js.default_timezone) {
-                    for (abbr in tal) {
-                        for (i=0; i < tal[abbr].length; i++) {
-                            if (tal[abbr][i].timezone_id === 
this.php_js.default_timezone) {
-                                return abbr.toUpperCase();
-                            }
-                        }
-                    }
-                }
-                for (abbr in tal) {
-                    for (i=0; i < tal[abbr].length; i++) {
-                        if (tal[abbr][i].offset === 
-jsdate.getTimezoneOffset()*60) {
-                            return abbr.toUpperCase();
-                        }
-                    }
-                }
-*/
-                return 'UTC';
-            },
-            Z: function(){
-               return -jsdate.getTimezoneOffset()*60;
-            },
-
-        // Full Date/Time
-            c: function(){
-                return f.Y() + "-" + f.m() + "-" + f.d() + "T" + f.h() + ":" + 
f.i() + ":" + f.s() + f.P();
-            },
-            r: function(){
-                return f.D()+', '+f.d()+' '+f.M()+' '+f.Y()+' 
'+f.H()+':'+f.i()+':'+f.s()+' '+f.O();
-            },
-            U: function(){
-                return Math.round(jsdate.getTime()/1000);
-            }
-    };
-
-    return format.replace(/[\\]?([a-zA-Z])/g, function(t, s){
-        if( t!=s ){
-            // escaped
-            ret = s;
-        } else if( f[s] ){
-            // a date function exists
-            ret = f[s]();
-        } else{
-            // nothing special
-            ret = s;
-        }
-        return ret;
-    });
-}
-</script>

Deleted: branches/dev-syncromind/rental/templates/base/composite.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/composite.php 2015-12-10 
14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/composite.php 2015-12-10 
14:38:47 UTC (rev 14566)
@@ -1,240 +0,0 @@
-<?php
-       include("common.php");
-       phpgwapi_yui::load_widget('tabview');
-       phpgwapi_yui::tabview_setup('composite_tabview');
-       $config = CreateObject('phpgwapi.config','rental');
-       $config->read();
-?>
-<?php echo rental_uicommon::get_page_error($error) ?>
-<?php echo rental_uicommon::get_page_message($message) ?>
-
-<div class="identifier-header">
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/actions/go-home.png" /> <?php echo lang('showing_composite') 
?></h1>
-       <div>
-               <button onclick="javascript:window.location.href ='<?php echo 
$cancel_link;?>;'">&laquo;&nbsp;<?php echo 
lang('composite_back');?></button><br/>
-               <label><?php echo lang('name') ?> </label><?php echo 
$composite->get_name() ?>
-       </div>
-</div>
-
-<div id="composite_tabview" class="yui-navset">
-       <ul class="yui-nav">
-               <li class="selected"><a href="#details"><em><img src="<?php 
echo RENTAL_TEMPLATE_PATH ?>images/16x16/actions/go-home.png" alt="icon" /> 
<?php echo lang('details') ?></em></a></li>
-               
-               <?php if($composite->get_id() > 0) { ?>
-               
-               <li><a href="#elements"><em><img src="<?php echo 
RENTAL_TEMPLATE_PATH ?>images/16x16/mimetypes/x-office-drawing-template.png" 
alt="icon" /> <?php echo lang('units') ?></em></a></li>
-               <li><a href="#contracts"><em><img src="<?php echo 
RENTAL_TEMPLATE_PATH ?>images/16x16/mimetypes/text-x-generic.png" alt="icon" /> 
  <?php echo lang('contracts') ?></em></a></li>
-
-               <?php } ?>
-       </ul>
-
-       <div class="yui-content">
-               <div id="details">
-                       <form action="#" method="post">
-                               <input type="hidden" name="id" value="<?php 
echo $composite->get_id() ?>"/>
-                               <dl class="proplist-col">
-                                       <dt>
-                                               <label for="name"><?php echo 
lang('name') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                                       if ($editable) {
-                                                               echo '<input 
type="text" name="name" id="name" value="' . $composite->get_name() . '"/>';
-                                                       } else {
-                                                               echo 
$composite->get_name();
-                                                       }
-                                               ?>
-                                       </dd>
-
-                                       <dt>
-                                               <label for="name"><?php echo 
lang('address');if (!$editable && $composite->has_custom_address()){echo " 
(<font style='color:red;'>" . lang('custom_address') . "</font>)";} ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                                       if (!$editable && 
$composite->has_custom_address()) {
-                                                               // In view mode 
the custom address should be displayed if it's filled in
-                                                               echo 
$composite->get_custom_address_1();
-                                                               if 
($composite->get_custom_address_2()) {
-                                                                       echo 
',<br/>' . $composite->get_custom_address_2();
-                                                               }
-                                                               if 
($composite->get_custom_house_number()) {
-                                                                       echo 
',<br/>' . $composite->get_custom_house_number();
-                                                               }
-                                                               if 
($composite->get_custom_postcode()) {
-                                                                       echo 
',<br />' . $composite->get_custom_postcode() . ' ' . 
$composite->get_custom_place();
-                                                               }
-                                                       }
-                                                       else if (!$editable){
-                                                               //no custom 
address
-                                                               
foreach($composite->get_units() as $unit){
-                                                                       echo 
$unit->get_location()->get_address_1();
-                                                               }
-                                                       }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <!-- composite standard  -->
-                                               <label 
for="composite_standard_id"><?php echo lang('composite standard') ?></label>
-                                                       <?php
-                                                               
$cur_standard_id = $composite->get_standard_id();
-
-                                                               
$composite_standard_arr = $composite->get_standards($cur_standard_id);
-
-                                                       // Edit composite
-                                                       if ($editable && 
$composite_standard_arr)
-                                                       {
-                                                               ?>
-                                                               <select 
name="composite_standard_id">
-                                                               <?php
-                                                                       
foreach($composite_standard_arr as $composite_standard)
-                                                                       {
-                                                                               
echo "<option ".($composite_standard['selected'] == 1 ? 'selected="selected"' : 
"")." 
value=\"{$composite_standard['id']}\">{$composite_standard['name']}</option>";
-                                                                       }
-                                                               ?>
-                                                               </select>
-                                                       <?php
-                                                       // View composite
-                                                       }
-                                                       else 
if($composite_standard_arr)
-                                                       {
-                                                               
$composite_standard_name = '';
-                                                               
foreach($composite_standard_arr as $composite_standard)
-                                                               {
-                                                                       if 
($composite_standard['selected'] == 1)
-                                                                       {
-                                                                               
$composite_standard_name = $composite_standard['name'];
-                                                                               
break;
-                                                                       }
-                                                               }
-
-                                                               ?>
-                                                                       <input 
type="text" id="composite_standard_id" value='<?php echo 
$composite_standard_name; ?>' disabled="disabled" />
-                                                               <?php
-
-                                                       } ?>
-                                       </dt>
-                                       <dt>
-                                               <!-- Furnish status  -->
-                                               <label 
for="furnish_type_id"><?php echo lang('furnish_type') ?></label>
-                                                       <?php
-                                                               
$furnish_types_arr = $composite->get_furnish_types();
-                                                               
$cur_furnish_type_id = $composite->get_furnish_type_id();
-
-                                                       // Edit composite
-                                                       if ($editable) { ?>
-                                                               <select 
name="furnish_type_id">
-                                                               <?php
-                                                                       
foreach($furnish_types_arr as $id => $title){
-                                                                               
if($cur_furnish_type_id == $id)
-                                                                               
        echo "<option selected='true' value='$id'>" . $title . "</option>";
-                                                                               
else
-                                                                               
        echo "<option value='$id'>" . $title . "</option>";
-                                                                       }
-                                                               ?>
-                                                               </select>
-                                                       <?php
-                                                       // View composite
-                                                       }else{ ?>
-                                                               <input 
type="text" id="furnish_type_id" value='<?php echo 
$furnish_types_arr[$cur_furnish_type_id]; ?>' disabled="disabled" />
-                                                       <?php } ?>
-                                       </dt>
-                                       <?php if ($editable) { // Only show 
custom address fields if we're in edit mode ?>
-                                       <dt>
-                                               <label 
for="has_custom_address"><?php echo lang('has_custom_address') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <input type="checkbox" 
name="has_custom_address" id="has_custom_address"<?php echo 
$composite->has_custom_address() ? ' checked="checked"' : '' ?>/>
-                                       </dd>
-                                       <dt>
-                                               <label for="address_1"><?php 
echo lang('overridden_address') ?></label> / <label for="house_number"><?php 
echo lang('house_number') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <input type="text" 
name="address_1" id="address_1" value="<?php echo 
$composite->get_custom_address_1() ?>" />
-                                               <input type="text" 
name="house_number" id="house_number" value="<?php echo 
$composite->get_custom_house_number() ?>" /><br/>
-                                               <input type="text" 
name="address_2" id="address_2" value="<?php echo 
$composite->get_custom_address_2() ?>" />
-                                       </dd>
-                                       <dt>
-                                               <label for="postcode"><?php 
echo lang('post_code') ?></label>
-                                               / <label for="place"><?php echo 
lang('post_place') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <input type="text" 
name="postcode" id="postcode" class="postcode" value="<?php echo 
$composite->get_custom_postcode() ?>"/>
-                                               <input type="text" name="place" 
id="place" value="<?php echo $composite->get_custom_place() ?>"/>
-                                       </dd>
-                                       <?php } // if ($editable) ?>
-                               </dl>
-
-                               <dl class="proplist-col">
-                                       <dt><?php echo lang('area_gros') ?></dt>
-                                       <dd><?php echo 
$composite->get_area_gros()?>&nbsp;<?php echo 
isset($config->config_data['area_suffix']) && 
$config->config_data['area_suffix'] ? $config->config_data['area_suffix'] : 
'kvm'; ?></dd>
-                                       <dt><?php echo lang('area_net') ?></dt>
-                                       <dd><?php echo 
$composite->get_area_net()?>&nbsp;<?php echo 
isset($config->config_data['area_suffix']) && 
$config->config_data['area_suffix'] ? $config->config_data['area_suffix'] : 
'kvm'; ?></dd>
-                                       <dt>
-                                               <label for="is_active"><?php 
echo lang('available?') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <input type="checkbox" 
name="is_active" id="is_active"<?php echo $composite->is_active() ? ' 
checked="checked"' : '' ?> <?php echo !$editable ? ' disabled="disabled"' : '' 
?>/>
-                                       </dd>
-                               </dl>
-
-                               <dl class="rental-description-edit">
-                                       <dt>
-                                               <label for="description"><?php 
echo lang('description') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <textarea name="description" 
id="description" rows="10" cols="50" <?php echo !$editable ? ' 
disabled="disabled"' : '' ?>><?php echo $composite->get_description() 
?></textarea>
-                                       </dd>
-                               </dl>
-
-                               <div class="form-buttons">
-                                       <?php
-                                               if ($editable) {
-                                                       echo '<input 
type="submit" name="save_composite" value="' . lang('save') . '"/>';
-                                               }
-                                       ?>
-                               </div>
-                       </form>
-               </div>
-
-               <?php if($composite->get_id() > 0) { ?>
-
-               <div id="elements">
-                       <h3><?php echo lang('included_units') ?></h3>
-                       <?php 
-                               $list_form = false; 
-                               $list_id = 'included_units';
-                               $url_add_on = 
'&amp;composite_id='.$composite->get_id();
-                               unset($extra_cols);
-                               include('unit_list_partial.php');
-
-                               
-            if ($editable) { 
-                           echo '<h3>'.lang('all_locations').'</h3>';
-                               $list_form = true; 
-                               $list_id = 'property_uilocations';
-                               $url_add_on = 
'&amp;composite_id='.$composite->get_id();
-                               unset($extra_cols);
-                               $related = array('included_units');
-                               include('property_location_partial.php');
-                       }
-                       ?>
-               </div>
-               <div id="contracts">
-                       <?php 
-                               $list_form = true; 
-                               $list_id = 'contracts_for_composite';
-                               $url_add_on = 
'&amp;type='.$list_id.'&amp;composite_id='.$composite->get_id();
-                               $editable = false;
-                               $extra_cols = array(
-                                       array("key" => "type", "label" => 
lang('title'), "index" => 3),
-                                       array("key" => "party", "label" => 
lang('party'), "index" => 4),
-                                       array("key" => 
"contract_notification_status", "label" => lang('notification_status'))
-                               );
-                               unset($related);
-                               include('contract_list_partial.php');
-                       ?>
-               </div>
-               
-               <?php  } ?>
-       </div>
-</div>

Deleted: branches/dev-syncromind/rental/templates/base/composite_list.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/composite_list.php    
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/composite_list.php    
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,47 +0,0 @@
-<?php
-       include("common.php");
-?>
-
-<script>
-
-       YAHOO.util.Event.addListener(
-       'ctrl_add_rental_composite',
-       'click',
-       function(e)
-       {
-               YAHOO.util.Event.stopEvent(e);
-               window.location = 'index.php?menuaction=rental.uicomposite.add';
-       }
-);
-</script>
-
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH ?>images/32x32/go-home.png" /> 
<?php echo lang('rc') ?></h1>
-
-
-<?php
-if($this->isExecutiveOfficer())
-{
-?>
-<fieldset>
-       <!-- Create new rental composite -->
-       <h3><?php echo lang('t_new_composite') ?></h3>
-       <input type="submit" name="ctrl_add_rental_composite" 
id="ctrl_add_rental_composite" value="<?php echo lang('f_new_rc') ?>" />
-</fieldset>
-<?php
-}
-?>
-<?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_composites';
-$url_add_on = '&amp;type=all_composites';
-include('composite_list_partial.php');
-?>
\ No newline at end of file

Deleted: 
branches/dev-syncromind/rental/templates/base/composite_list_partial.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/composite_list_partial.php    
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/composite_list_partial.php    
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,252 +0,0 @@
-<?php
-       $config = CreateObject('phpgwapi.config','rental');
-       $config->read();
-?>
-
-<script type="text/javascript">
-function checkAvailabitily()
-{ 
-       if(document.forms[0].availability_date_to.value == '')
-       {
-               document.forms[0].availability_date_to.value = 
document.forms[0].availability_date_from.value;
-               document.forms[0].availability_date_to_hidden.value = 
document.forms[0].availability_date_from_hidden.value
-       } 
-       return true;
-}
-
-//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.uicomposite.index';
-               }
-               );
-
-       // Defining columns for datatable
-       var columnDefs = [{
-                       key: "id",
-                       label: "<?php echo lang('serial') ?>",
-                       sortable: false,
-                       hidden: true
-               },
-               {
-                       key: "location_code",
-                       label: "<?php echo lang('object_number') ?>",
-                       sortable: true
-               },
-               {
-                       key: "name",
-                       label: "<?php echo lang('name') ?>",
-                   sortable: true
-               },
-               {
-                       key: "address",
-                       label: "<?php echo lang('address') ?>",
-                   sortable: true
-               },
-               {
-                       key: "gab_id",
-                       label: "<?php echo lang('propertyident') ?>",
-                   sortable: false
-               },
-               {
-                       key: "status",
-                       label: "<?php echo lang('status') ?>",
-                   sortable: true
-               },
-<?php
-       if(isset($config->config_data['contract_future_info']) && 
$config->config_data['contract_future_info'])
-       {
-?>
-                       {
-                               key: "contracts",
-                               label: "<?php echo lang('contract_future_info') 
?>",
-                           sortable: false
-                       },
-<?php
-       }
-       if(isset($config->config_data['contract_furnished_status']) && 
$config->config_data['contract_furnished_status'])
-       {
-
-?>
-
-                       {
-                               key: "furnished_status",
-                               label: "<?php echo lang('furnish_type') ?>",
-                           sortable: false
-                       },
-<?php
-       }
-?>
-               {
-                       key: "actions",
-                       hidden: true
-               },
-               {
-                       key: "labels",
-                       hidden: true
-               },
-               {
-                       key: "ajax",
-                       hidden: true
-               }];
-
-       // Initiating the data source
-       setDataSource(
-               
'index.php?menuaction=rental.uicomposite.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_toggle_furnished_status_rental_composites','<?php echo $list_id 
?>_ctrl_toggle_active_rental_composites','<?php echo $list_id 
?>_district_id','<?php echo $list_id 
?>_ctrl_toggle_occupancy_of_rental_composites','<?php echo $list_id 
?>_ctrl_toggle_has_contract_rental_composites','<?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 districtselect = document.getElementById('<?php echo $list_id 
?>_district_id');
-        var districtoption = 
districtselect.options[districtselect.selectedIndex].value;
-<?php
-       if(isset($config->config_data['contract_future_info']) && 
$config->config_data['contract_future_info'])
-       {
-?>
-        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;
-<?php
-       }
-?>
-        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;district_id='+districtoption+
-               '&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('rental', 'composite_query');
-               $s_type = phpgwapi_cache::session_get('rental', 
'composite_search_type');
-               $status = phpgwapi_cache::session_get('rental', 
'composite_status');
-               $status_contract = phpgwapi_cache::session_get('rental', 
'composite_status_contract');
-       } 
-?>
-       <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 : 
''?>"/>
-               <label for="ctrl_search_option"><?php echo lang('search_where') 
?></label>
-               <select name="search_option" id="<?php echo $list_id 
?>_ctrl_search_option">
-                       <option value="all" <?php echo ($s_type == 'all') ? 
'selected' : ''?>><?php echo lang('all') ?></option>
-                       <option value="name" <?php echo ($s_type == 'name') ? 
'selected' : ''?>><?php echo lang('name') ?></option>
-                       <option value="address" <?php echo ($s_type == 
'address') ? 'selected' : ''?>><?php echo lang('address') ?></option>
-                       <option value="property_id" <?php echo ($s_type == 
'property_id') ? 'selected' : ''?>><?php echo lang('object_number') ?></option>
-               </select>
-               <input type="submit" id="ctrl_search_button" value="<?php echo 
lang('search') ?>" onclick="javascript: checkAvailabitily();" />
-               <input type="button" id="ctrl_reset_button" value="<?php echo 
lang('reset') ?>" />
-       </fieldset>
-
-       <fieldset>
-               <!-- Filters -->
-               <h3><?php echo lang('filters') ?></h3>
-               <?php
-                 if(isset($config->config_data['contract_furnished_status']) 
&& $config->config_data['contract_furnished_status'])
-                 {
-
-                ?>
-                    <!-- Møbleringsstatus -->
-                    <label for="furnished_status"><?php echo 
lang('furnish_type') ?></label>
-                    <select name="furnished_status" id="<?php echo $list_id 
?>_ctrl_toggle_furnished_status_rental_composites">
-                            <?php
-                                    $furnish_types_arr = 
rental_composite::get_furnish_types();
-
-                                    echo "<option value='4'>Alle</option>";
-                                    foreach($furnish_types_arr as $id => 
$title){
-                                            echo "<option value='$id'>" . 
$title . "</option>";
-                                    }
-                            ?>
-                    </select>
-                <?php }
-                ?>
-                    <label for="district_id"><?php echo lang('district') 
?></label>
-                    <select name="district_id" id="<?php echo $list_id 
?>_district_id">
-                       <?php
-                                                       $districts = 
execMethod('property.sogeneric.get_list',array('type' => 'district'));
-
-                                                       echo "<option 
value=''>" . lang('select') . "</option>";
-                                                       foreach($districts as 
$district)
-                                                       {
-                                                               echo "<option 
value='{$district['id']}'>{$district['name']}</option>";
-                                                       }
-                                               ?>
-                    </select>
-               <label for="ctrl_toggle_active_rental_composites"><?php echo 
lang('availability') ?></label>
-               <select name="is_active" id="<?php echo $list_id 
?>_ctrl_toggle_active_rental_composites">
-                       <option value="both" <?php echo ($status == 'both') ? 
'selected' : ''?>><?php echo lang('all') ?></option>
-                       <option value="active" <?php echo ($status == 'active') 
? 'selected' : ''?>><?php echo lang('in_operation') ?></option>
-                       <option value="non_active" <?php echo ($status == 
'non_active') ? 'selected' : ''?>><?php echo lang('out_of_operation') 
?></option>
-               </select>
-               <select name="has_contract" id="<?php echo $list_id 
?>_ctrl_toggle_has_contract_rental_composites">
-                       <option value="both" <?php echo ($status_contract == 
'both') ? 'selected' : ''?>><?php echo lang('all') ?></option>
-                       <option value="has_contract" <?php echo 
($status_contract == 'has_contract') ? 'selected' : ''?>><?php echo 
lang('composite_has_contract') ?></option>
-                       <option value="has_no_contract" <?php echo 
($status_contract == 'has_no_contract') ? 'selected' : ''?>><?php echo 
lang('composite_has_no_contract') ?></option>
-               </select>
-               <label for="availability_period"><?php echo 
lang('availability_date')?></label>
-               <?php echo 
$GLOBALS['phpgw']->yuical->add_listener('availability_date_from', 
$availability_date_from); ?>&nbsp;&ndash;&nbsp;<?php echo 
$GLOBALS['phpgw']->yuical->add_listener('availability_date_to', 
$availability_date_to); ?>
-       </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>

Deleted: branches/dev-syncromind/rental/templates/base/contract.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/contract.php  2015-12-10 
14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/contract.php  2015-12-10 
14:38:47 UTC (rev 14566)
@@ -1,996 +0,0 @@
-<?php
-       include("common.php");
-       phpgwapi_yui::load_widget('tabview');
-       phpgwapi_yui::tabview_setup('contract_tabview');
-       $config = CreateObject('phpgwapi.config','rental');
-       $config->read();
-?>
-
-<?php echo rental_uicommon::get_page_error($error) ?>
-<?php echo 
rental_uicommon::get_page_warning($contract->get_validation_warnings()) ?>
-<?php echo rental_uicommon::get_page_message($message) ?>
-<?php 
-if($contract->get_id() > 0) {
-       if($contract->get_consistency_warnings()){?>
-<div class="warning" style="width: 50%;">
-<?php 
-               $list_form = false;
-               $list_id = 'get_contract_warnings';
-               unset($related);
-               $url_add_on = '&amp;contract_id='.$contract->get_id();
-               unset($extra_cols);
-       
-               include('contract_warnings_partial.php');
-?>
-</div>
-<?php 
-       }
-}
-?>
-
-<div class="identifier-header">
-       <h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/mimetypes/text-x-generic.png" /> <?php echo 
lang('showing_contract') ?></h1>
-       <div style="float: left; width: 50%;">
-               <?php 
-                       $back_button = lang('contract_back');
-                       if($cancel_text) $back_button = lang($cancel_text);
-               ?>
-               <button onclick="javascript:window.location.href ='<?php echo 
$cancel_link;?>;'">&laquo;&nbsp;<?php echo $back_button;?></button><br/>
-               <label><?php echo lang('contract_number') ?> </label>
-               <?php if($contract->get_old_contract_id()){ 
-                       echo $contract->get_old_contract_id(); 
-               } ?>
-               <br/>
-               <label><?php echo lang('parties') ?> </label>
-               <?php
-                       echo $contract->get_party_name_as_list();
-                ?>
-                <br/>
-               <label><?php echo lang('last_updated') ?> </label>
-               <?php
-                       if($contract->get_id() > 0) {
-                               echo 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$contract->get_last_updated());
-                       }
-                       else{
-                               echo 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$created);
-                       }
-                ?>
-               <label>&nbsp;&nbsp;<?php echo lang('name') ?></label>
-               <?php
-                       if($contract->get_id() > 0) {
-                               echo $contract->get_last_edited_by();
-                       }
-                       else
-                       {
-                               echo 
$GLOBALS['phpgw']->accounts->id2name($created_by);
-                       }
-                ?>
-               <br/>
-               <label><?php echo lang('composite') ?> </label>
-               <?php
-                       echo $contract->get_composite_name_as_list();
-                ?>              
-       </div>
-       <div style="float: right; width: 50%;">
-        
-       <?php 
-       if($contract->get_id() > 0) {
-               $list_form = false;
-               $list_id = 'total_price';
-               unset($related);
-               $url_add_on = '&amp;contract_id='.$contract->get_id();
-               unset($extra_cols);
-
-               include('total_price_partial.php');
-       }
-       ?>
-               </div>
-</div>
-<script type="text/javascript" language="JavaScript">
-function loadDatatables(currTab){
-       if(currTab == 'composites'){
-               for(i=0;i<YAHOO.rental.datatables.length;i++){
-                       if(YAHOO.rental.datatables[i].tid == 
'included_composites'){
-                               reloadDataSources(YAHOO.rental.datatables[i]);
-                       }
-<?php if($editable){?>
-                       if(YAHOO.rental.datatables[i].tid == 
'not_included_composites'){
-                               reloadDataSources(YAHOO.rental.datatables[i]);
-                       }
-<?php }?>
-               }
-       }
-       else if(currTab == 'parties'){
-               for(i=0;i<YAHOO.rental.datatables.length;i++){
-                       if(YAHOO.rental.datatables[i].tid == 
'included_parties'){
-                               reloadDataSources(YAHOO.rental.datatables[i]);
-                       }
-<?php if($editable){?>
-                       if(YAHOO.rental.datatables[i].tid == 
'available_parties'){
-                               reloadDataSources(YAHOO.rental.datatables[i]);
-                       }
-<?php }?>
-               }
-       }
-       else if(currTab == 'price'){
-               for(i=0;i<YAHOO.rental.datatables.length;i++){
-                       if(YAHOO.rental.datatables[i].tid == 
'included_price_items'){
-                               reloadDataSources(YAHOO.rental.datatables[i]);
-                       }
-<?php if($editable){?>
-                       if(YAHOO.rental.datatables[i].tid == 
'available_price_items'){
-                               reloadDataSources(YAHOO.rental.datatables[i]);
-                       }
-<?php }?>
-               }
-       }
-       else if(currTab == 'invoice'){
-               for(i=0;i<YAHOO.rental.datatables.length;i++){
-                       if(YAHOO.rental.datatables[i].tid == 
'invoice_price_items'){
-                               reloadDataSources(YAHOO.rental.datatables[i]);
-                       }
-               }
-       }
-       else if(currTab == 'documents'){
-               for(i=0;i<YAHOO.rental.datatables.length;i++){
-                       if(YAHOO.rental.datatables[i].tid == 
'documents_for_contract'){
-                               reloadDataSources(YAHOO.rental.datatables[i]);
-                       }
-               }
-       }
-       else if(currTab == 'notifications'){
-               for(i=0;i<YAHOO.rental.datatables.length;i++){
-                       if(YAHOO.rental.datatables[i].tid == 
'rental_notifications'){
-                               reloadDataSources(YAHOO.rental.datatables[i]);
-                       }
-               }
-       }
-       else if(currTab == 'details'){
-               for(i=0;i<YAHOO.rental.datatables.length;i++){
-                       if(YAHOO.rental.datatables[i].tid == 'total_price'){
-                               reloadDataSources(YAHOO.rental.datatables[i]);
-                       }
-               }
-       }
-}
-</script>
-<div id="contract_tabview" class="yui-navset">
-       <ul class="yui-nav">
-               <?php if($contract->get_id() > 0) {?>
-
-               <li><a href="#composites" onclick="javascript: 
loadDatatables('composites');"><em><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/16x16/actions/go-home.png" alt="icon" /> <?php echo lang('composite') 
?></em></a></li>
-               <li><a href="#parties" onclick="javascript: 
loadDatatables('parties');"><em><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/16x16/mimetypes/x-office-address-book.png" alt="icon" /> <?php echo 
lang('parties') ?></em></a></li>
-               <li><a href="#price" onclick="javascript: 
loadDatatables('price');"><em><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/16x16/mimetypes/x-office-spreadsheet.png" alt="icon" />   <?php echo 
lang('price') ?></em></a></li>
-               <?php }?>
-               <?php if($contract->get_id()>0){?>              
-               <li <?php echo (!isset($_POST['add_notification'])) ? 
'class="selected"' : "" ?>><a href="#details" onclick="javascript: 
loadDatatables('details');" ><em><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/16x16/mimetypes/text-x-generic.png" alt="icon" /> <?php echo 
lang('details') ?></em></a></li>
-               <?php }else{?>
-               <li <?php echo (!isset($_POST['add_notification'])) ? 
'class="selected"' : "" ?>><a href="#details"><em><img src="<?php echo 
RENTAL_TEMPLATE_PATH ?>images/16x16/mimetypes/text-x-generic.png" alt="icon" /> 
<?php echo lang('details') ?></em></a></li>
-               <?php }?>
-               <?php if($contract->get_id() > 0) {?>
-               <li><a href="#invoice" onclick="javascript: 
loadDatatables('invoice');"><em><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/16x16/mimetypes/text-x-generic.png" alt="icon" />   <?php echo 
lang('invoice') ?></em></a></li>
-               <li <?php echo (phpgw::get_var('tab') == 'documents') ?  
'class="selected"' : ""?>><a href="#documents" onclick="javascript: 
loadDatatables('documents');"><em><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/16x16/apps/system-file-manager.png" alt="icon" /> <?php echo 
lang('documents') ?></em></a></li>
-               <li <?php echo isset($_POST['add_notification']) ? 
'class="selected"' : "" ?>><a href="#notfications" onclick="javascript: 
loadDatatables('notifications');"><em><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/16x16/actions/appointment-new.png" alt="icon" /> <?php echo 
lang('notifications') ?></em></a></li>
-               
-               <?php } ?>
-       </ul>
-       <div class="yui-content">
-               <?php if($contract->get_id() > 0) {?>
-               <div id="composites">
-                       <h3><?php echo lang('selected_composites') ?></h3>
-                       <?php
-                               $list_form = false;
-                               $list_id = 'included_composites';
-                               $related = array('not_included_composites');
-                               $url_add_on = 
'&amp;type=included_composites&amp;contract_id='.$contract->get_id();
-                               include('composite_list_partial.php'); ?>
-
-                       <?php if ($editable) { ?>
-                       <h3><?php echo lang('available_composites') ?> (<?php 
echo lang('messages_right_click_to_add') ?>)</h3>
-                       <?php
-                               $list_form = true;
-                               $list_id = 'not_included_composites';
-                               $related = array('included_composites');
-                               $url_add_on = 
'&amp;type=not_included_composites&amp;contract_id='.$contract->get_id();
-                               include('composite_list_partial.php'); ?>
-                       <?php } ?>
-               </div>
-               <div id="parties">
-                       <h3><?php echo lang('selected_parties') ?></h3>
-                       <?php
-                               $list_form = false;
-                               $list_id = 'included_parties';
-                               $extra_cols = array(array("key" => "is_payer", 
"label" => lang('is_payer'), "index" => 3));
-                               $related = array('not_included_parties');
-                               $url_add_on = 
'&amp;type=included_parties&amp;contract_id='.$contract->get_id();
-                               include('party_list_partial.php');
-                               $extra_cols = array();
-                       ?>
-
-                       <?php if ($editable) {?>
-                       <h3><?php echo lang('available_parties') ?> (<?php echo 
lang('messages_right_click_to_add') ?>)</h3>
-                       <?php
-                               $list_form = true;
-                               $list_id = 'not_included_parties';
-                               $related = array('included_parties');
-                               $url_add_on = 
'&amp;type=not_included_parties&amp;contract_id='.$contract->get_id();
-                               include('party_list_partial.php'); ?>
-                       <?php } ?>
-               </div>
-               <div id="price">
-                       <h3><?php echo lang('selected_price_items') ?></h3>
-                       
-                       <?php
-                               $list_form = false;
-                               $list_id = 'included_price_items';
-                               $related = 
array('not_included_price_items','total_price','get_contract_warnings');
-                               $url_add_on = 
'&amp;type=included_price_items&amp;contract_id='.$contract->get_id();
-                               $extra_cols = array(
-                                       array("key" => "area", "label" => 
lang('area'), "index" => 4, "formatter" => "formatArea"),
-                                       array("key" => "count", "label" => 
lang('count'), "index" => 5, "formatter" => "formatCount"),
-                                       array("key" => "total_price", "label" 
=> lang('total_price'), "formatter" => "formatPrice", "index" => 6),
-                                       array("key" => "date_start", "label" => 
lang('date_start'), "index" => 7, "formatter" => "YAHOO.rental.formatDate", 
"parser" => '"date"'),
-                                       array("key" => "date_end", "label" => 
lang('date_end'), "index" => 8, "formatter" => "YAHOO.rental.formatDate", 
"parser" => '"date"'),
-                                       array("key" => "is_one_time", "label" 
=> lang('is_one_time'), "index" => 9, "formatter" => "formatBoolean")
-                               );
-
-                               $editor_action = 
'rental.uiprice_item.set_value';
-
-                               if ($editable) {
-                                       $editors = array(
-                                               'title' => 'new 
YAHOO.widget.TextboxCellEditor({disableBtns:true})',
-                                               'count' => 'new 
YAHOO.widget.TextboxCellEditor({disableBtns:true})',
-                                               'price' => 'new 
YAHOO.widget.TextboxCellEditor({disableBtns:true})',
-                                               'date_start' => 'new 
YAHOO.widget.DateCellEditor({LABEL_SAVE:"' .lang('save').'", LABEL_CANCEL:"' 
.lang('cancel').'",calendarOptions:{navigator:{strings:{month:"'.lang('month').'",year:"'.lang('year').'",submit:"'.lang('ok').'",cancel:"'.lang('cancel').'"},initialFocus:"month"},start_weekday:1,LOCALE_WEEKDAYS:"short",MONTHS_LONG:'.lang('calendar_months').',WEEKDAYS_SHORT:'.lang('calendar_weekdays').'}})',
-                                               'date_end' => 'new 
YAHOO.widget.DateCellEditor({LABEL_SAVE:"' .lang('save').'", LABEL_CANCEL:"' 
.lang('cancel').'",calendarOptions:{navigator:{strings:{month:"'.lang('month').'",year:"'.lang('year').'",submit:"'.lang('ok').'",cancel:"'.lang('cancel').'"},initialFocus:"month"},start_weekday:1,LOCALE_WEEKDAYS:"short",MONTHS_LONG:'.lang('calendar_months').',WEEKDAYS_SHORT:'.lang('calendar_weekdays').'}})',
-                                               'is_one_time' => 'new 
YAHOO.widget.CheckboxCellEditor({checkboxOptions:[{label:"ja", 
value:true},{label:"nei", value:false}],disableBtns:true})'
-                                       );
-                               }
-
-                               include('price_item_partial.php'); ?>
-                       <?php if ($editable) { ?>
-                       <h3><?php echo lang('available_price_items') ?> (<?php 
echo lang('messages_right_click_to_add') ?>)</h3>
-                       <?php
-                               $list_form = true;
-                               $list_id = 'not_included_price_items';
-                               $related = 
array('included_price_items','total_price');
-                               $url_add_on = 
'&amp;type=not_included_price_items&amp;contract_id='.$contract->get_id(). 
'&amp;responsibility_id='.$contract->get_location_id();
-                               unset($extra_cols);
-                               unset($editors);
-                               include('price_item_partial.php'); ?>
-                       <?php } ?>
-               </div>
-               <?php }?>
-               <div class="details">
-                       <form action="#" method="post">
-                               <input type="hidden" name="id" value="<?php 
echo $contract->get_id() ?>"/>
-                               <dl class="proplist-col">
-                                       <dt>
-                                               <label for="name"><?php echo 
lang('field_of_responsibility') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php 
-                                                       $contract_id = 
$contract->get_id();
-                                                       if($editable && 
(!isset($contract_id) || $contract_id <= 0)) {
-                                                               
-                                                        ?>
-                                                               <input 
type="hidden" name="location_id" id="location_id" value="<?php echo 
$contract->get_location_id() ?>" />
-                                                        <?php 
-                                                       }
-                                                       echo 
lang($contract->get_contract_type_title());
-                                                       ?>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="contract_type"><?php echo lang('contract_type') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                               $current_contract_type_id = 
$contract->get_contract_type_id();
-                                               if ($editable)
-                                               {
-                                                       ?>
-                                                       <select 
name="contract_type">
-                                                               <!-- Adds 
option Ingen type if the contract is not assigned responsibility area 
eksternleie  -->
-                                                               <?php  
-                                                               
$responsibility_area = 
rental_socontract::get_instance()->get_responsibility_title($contract->get_location_id());
                       
-                                                               
-                                                               if( 
strcmp($responsibility_area, "contract_type_eksternleie") != 0 ){ 
-                                                                       echo 
"<option>Ingen type</option>";
-                                                               }
-                                                               
-                                                               
foreach(rental_socontract::get_instance()->get_contract_types($contract->get_location_id())
 as $contract_type_id => $contract_type_label)
-                                                               {
-                                                                       echo 
"<option ".($current_contract_type_id == $contract_type_id ? 
'selected="selected"' : "")." 
value=\"{$contract_type_id}\">".lang($contract_type_label)."</option>";
-                                                               }
-                                                               ?>
-                                                       </select>
-                                                       <?php
-                                               ?>
-                                               <?php
-                                               }
-                                               else // Non-editable
-                                               {
-                                                       echo 
lang(rental_socontract::get_instance()->get_contract_type_label($current_contract_type_id));
-                                               }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="executive_officer"><?php echo lang('executive_officer') ?></label>
-                                       </dt>
-                                       <dd>
-                                       <?php 
-                                               if(!$executive_officer = 
$contract->get_executive_officer_id())
-                                               {
-                                                       $executive_officer = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                                               }
-
-                                               if($editable)
-                                               {
-                                                       $location_name = 
$contract->get_field_of_responsibility_name();
-                                                       $accounts = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_ADD, $location_name, 
'rental');
-                                       ?>
-                                                               <select 
name="executive_officer" id="executive_officer">
-                                                                       <option 
value=""><?php echo lang('nobody') ?></option>
-                                                                       <?php
-                                                                               
foreach($accounts as $account)
-                                                                               
{
-                                                                               
        $selected = '';
-                                                                               
        if($account['account_id'] == $executive_officer)
-                                                                               
        {
-                                                                               
                $selected = 'selected=\'selected\'';
-                                                                               
        }
-                                                                               
        echo "<option value='{$account['account_id']}' {$selected}>" . 
$GLOBALS['phpgw']->accounts->get($account['account_id'])->__toString() . 
"</option>";
-                                                                               
}
-                                                                       ?>
-                                                               </select>
-                                       <?php
-                                               }
-                                               else
-                                               { 
-                                                       
if(isset($executive_officer))
-                                                       {
-                                                                $account = 
$GLOBALS['phpgw']->accounts->get($executive_officer);
-                                                                
if(isset($account))
-                                                                {
-                                                                       echo 
$account->__toString();
-                                                                } 
-                                                                else
-                                                                {
-                                                                       echo 
lang('nobody');
-                                                                }
-                                                       }
-                                                       else
-                                                       {
-                                                               echo 
lang('nobody');
-                                                       }
-                                                       
-                                               }
-                                       ?>
-
-                                       </dd>
-                                       <dt>
-                                               <label for="name"><?php echo 
lang('date_start') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                                       $start_date = 
$contract->get_contract_date() && 
$contract->get_contract_date()->has_start_date() ? 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$contract->get_contract_date()->get_start_date()) : '';
-                                                       $start_date_yui = 
$contract->get_contract_date() && 
$contract->get_contract_date()->has_start_date() ? 
$GLOBALS['phpgw']->common->show_date($contract->get_contract_date()->get_start_date())
 : '';
-                                                       if ($editable)
-                                                       {
-                                                               echo 
$GLOBALS['phpgw']->jqcal->add_listener('date_start', 'date', $start_date);
-                                                       }
-                                                       else
-                                                       {
-                                                               echo 
$start_date;
-                                                       }
-                                               ?>
-                                       </dd>
-
-                                       <dt>
-                                               <label for="name"><?php echo 
lang('date_end') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                                       $end_date = 
$contract->get_contract_date() && 
$contract->get_contract_date()->has_end_date() ? 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$contract->get_contract_date()->get_end_date()) : '';
-                                                       $end_date_yui = 
$contract->get_contract_date() && 
$contract->get_contract_date()->has_end_date() ? 
$GLOBALS['phpgw']->common->show_date($contract->get_contract_date()->get_end_date())
 : '';
-                                                       if ($editable)
-                                                       {
-                                                               echo 
$GLOBALS['phpgw']->jqcal->add_listener('date_end', 'date', $end_date);
-                                                       }
-                                                       else
-                                                       {
-                                                               echo $end_date;
-                                                       }
-                                                ?>
-                                               <br/>
-                                       </dd>
-                                       <dt>
-                                               <label for="due_date"><?php 
echo lang('due_date') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                                       $due_date = 
$contract->get_due_date() ? 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$contract->get_due_date()) : '';
-                                                       $due_date_yui = 
$contract->get_due_date() ? 
$GLOBALS['phpgw']->common->show_date($contract->get_due_date()) : '';
-                                                       if ($editable)
-                                                       {
-                                                               echo 
$GLOBALS['phpgw']->jqcal->add_listener('due_date', 'date', $due_date);
-                                       //                      echo 
$GLOBALS['phpgw']->yuical->add_listener('due_date', $due_date);
-                                                       }
-                                                       else
-                                                       {
-                                                               echo $due_date;
-                                                       }
-                                               ?>
-                                               <br/>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="invoice_header"><?php echo lang('invoice_header') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                               if ($editable) {
-                                               ?>
-                                                       <input type="text" 
name="invoice_header" id="invoice_header" value="<?php echo 
$contract->get_invoice_header(); ?>" />
-                                               <?php
-                                               }
-                                               else
-                                               {
-                                                       echo 
$contract->get_invoice_header();
-                                               }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label for="billing_term"><?php 
echo lang('billing_term') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                               if(!$current_term_id = 
$contract->get_term_id())
-                                               {
-                                                       $current_term_id = 
$config->config_data['default_billing_term'];
-                                               }
-
-                                               if ($editable)
-                                               {
-                                                       ?>
-                                                       <select 
name="billing_term">
-                                                               <?php
-                                                               
foreach(rental_sobilling::get_instance()->get_billing_terms() as $term_id => 
$term_title)
-                                                               {
-                                                                       echo 
"<option ".($current_term_id == $term_id ? 'selected="selected"' : "")." 
value=\"{$term_id}\">".lang($term_title)."</option>";
-                                                               }
-                                                               ?>
-                                                       </select>
-                                                       <?php
-                                               ?>
-                                               <?php
-                                               }
-                                               else // Non-editable
-                                               {
-                                                       echo 
lang(rental_socontract::get_instance()->get_term_label($current_term_id));
-                                               }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="billing_start_date"><?php echo lang('billing_start') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                                       $billing_start_date = 
$contract->get_billing_start_date() ? 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$contract->get_billing_start_date()) : '';
-                                                       $billing_start_date_yui 
= $contract->get_billing_start_date() ? 
$GLOBALS['phpgw']->common->show_date($contract->get_billing_start_date()) : '';
-                                                       if ($editable)
-                                                       {
-//                                                             echo 
$GLOBALS['phpgw']->yuical->add_listener('billing_start_date', 
$billing_start_date);
-                                                               echo 
$GLOBALS['phpgw']->jqcal->add_listener('billing_start_date', 'date', 
$billing_start_date);
-                                                       }
-                                                       else
-                                                       {
-                                                               echo 
$billing_start_date;
-                                                       }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="billing_end_date"><?php echo lang('billing_end') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                                       $billing_end_date = 
$contract->get_billing_end_date() ? 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'], 
$contract->get_billing_end_date()) : '';
-                                                       $billing_end_date_yui = 
$contract->get_billing_end_date() ? 
$GLOBALS['phpgw']->common->show_date($contract->get_billing_end_date()) : '';
-                                                       if ($editable)
-                                                       {
-//                                                             echo 
$GLOBALS['phpgw']->yuical->add_listener('billing_end_date', $billing_end_date);
-                                                               echo 
$GLOBALS['phpgw']->jqcal->add_listener('billing_end_date', 'date', 
$billing_end_date);
-                                                       }
-                                                       else
-                                                       {
-                                                               echo 
$billing_end_date;
-                                                       }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label for="reference"><?php 
echo lang('reference') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                               if ($editable) {
-                                               ?>
-                                                       <input type="text" 
name="reference" id="reference" value="<?php echo $contract->get_reference(); 
?>"/>
-                                               <?php
-                                               }
-                                               else
-                                               {
-                                                       echo 
$contract->get_reference();
-                                               }
-                                               ?>
-                                       </dd>
-                               </dl>
-                               <dl class="proplist-col">
-                                       <dt>
-                                               <label 
for="responsibility_id"><?php echo lang('responsibility') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                               if ($editable)
-                                               {
-                                                       $cur_responsibility_id 
= $contract->get_responsibility_id();
-                                                       
$contract_responsibility_arr = 
$contract->get_responsibility_arr($cur_responsibility_id);
-
-                                                       
if($contract_responsibility_arr)
-                                                       {
-                                                               ?>
-                                                               <select 
name="responsibility_id">
-                                                               <?php
-                                                                       
foreach($contract_responsibility_arr as $contract_responsibility)
-                                                                       {
-                                                                               
echo "<option ".($contract_responsibility['selected'] == 1 ? 
'selected="selected"' : "")." 
value=\"{$contract_responsibility['id']}\">{$contract_responsibility['name']}</option>";
-                                                                       }
-                                                               ?>
-                                                               </select>
-                                                               <?php
-                                                       }
-                                                       else
-                                                       {
-                                                       ?>
-                                                               <input 
type="text" name="responsibility_id" id="responsibility_id" value="<?php echo 
$contract->get_responsibility_id(); ?>"/>
-                                                       <?php
-                                                       }
-                                               }
-                                               else
-                                               {
-                                                       echo 
$contract->get_responsibility_id();
-                                               }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label for="service_id"><?php 
echo lang('service') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                               if ($editable) {
-                                               ?>
-                                                       <input type="text" 
name="service_id" id="service_id" value="<?php echo 
$contract->get_service_id(); ?>"/>
-                                               <?php
-                                               }
-                                               else
-                                               {
-                                                       echo 
$contract->get_service_id();
-                                               }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label for="account_in"><?php 
echo lang('account_in') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                               if ($editable) {
-                                               ?>
-                                                       <input type="text" 
name="account_in" id="account_in" value="<?php 
-                                                       $cid = 
$contract->get_id();
-                                                       if(!isset($cid) || $cid 
<= 0)
-                                                       {
-                                                               
-                                                               echo 
rental_socontract::get_instance()->get_default_account($contract->get_location_id(),
 true);
-                                                       }
-                                                       else
-                                                       {
-                                                               echo 
$contract->get_account_in(); 
-                                                       }
-                                                       ?>"/>
-                                               <?php
-                                               }
-                                               else
-                                               {
-                                                       echo 
$contract->get_account_in();
-                                               }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label for="account_out"><?php 
echo lang('account_out') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                               if ($editable) {
-                                               ?>
-                                                       <input type="text" 
name="account_out" id="account_out" value="<?php 
-                                                       $cid = 
$contract->get_id();
-                                                       if(!isset($cid) || $cid 
<= 0)
-                                                       {
-                                                               echo 
rental_socontract::get_instance()->get_default_account($contract->get_location_id(),
 false);
-                                                       }
-                                                       else
-                                                       {
-                                                               echo 
$contract->get_account_out(); 
-                                                       }
-                                                       ?>"/>
-                                               <?php
-                                               }
-                                               else
-                                               {
-                                                       echo 
$contract->get_account_out();
-                                               }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label for="project_id"><?php 
echo lang('project_id') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                               if ($editable) {
-                                               ?>
-                                                       <input type="text" 
name="project_id" id="project_id" value="<?php 
-                                                       $cid = 
$contract->get_id();
-                                                       if(!isset($cid) || $cid 
<= 0)
-                                                       {
-                                                               echo 
rental_socontract::get_instance()->get_default_project_number($contract->get_location_id(),
 false);
-                                                       }
-                                                       else
-                                                       {
-                                                               echo 
$contract->get_project_id() ;
-                                                       }
-                                                       ?>"/>
-                                               <?php
-                                               }
-                                               else
-                                               {
-                                                       echo 
$contract->get_project_id();
-                                               }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="security_type"><?php echo lang('security') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <?php
-                                               if ($editable) {
-                                               ?>
-                                               <select name="security_type" 
id="security_type">
-                                                       <option value="0"><?php 
echo lang('nobody') ?></option>
-                                                       <option <?php echo 
$contract->get_security_type() == rental_contract::SECURITY_TYPE_BANK_GUARANTEE 
? 'selected="selected"' : '' ?>value="<?php echo 
rental_contract::SECURITY_TYPE_BANK_GUARANTEE ?>"><?php echo 
lang('bank_guarantee') ?></option>
-                                                       <option <?php echo 
$contract->get_security_type() == rental_contract::SECURITY_TYPE_DEPOSIT ? 
'selected="selected"' : '' ?>value="<?php echo 
rental_contract::SECURITY_TYPE_DEPOSIT ?>"><?php echo lang('deposit') 
?></option>
-                                                       <option <?php echo 
$contract->get_security_type() == rental_contract::SECURITY_TYPE_ADVANCE ? 
'selected="selected"' : '' ?>value="<?php echo 
rental_contract::SECURITY_TYPE_ADVANCE ?>"><?php echo lang('advance') 
?></option>
-                                                       <option <?php echo 
$contract->get_security_type() == 
rental_contract::SECURITY_TYPE_OTHER_GUARANTEE ? 'selected="selected"' : '' 
?>value="<?php echo rental_contract::SECURITY_TYPE_OTHER_GUARANTEE ?>"><?php 
echo lang('other_guarantee') ?></option>
-                                               </select>
-                                               <?php 
-                                               }
-                                               else
-                                               {
-                                                       if ($editable) {
-                                                               ?>
-
-                                                               <table><tr>
-                                                               <td>
-                                                                       <select 
name="security_type" id="security_type">
-                                                                       <option 
value="-1"></option>
-                                                                       <option 
<?php echo $contract->get_security_type() == 
rental_contract::SECURITY_TYPE_BANK_GUARANTEE ? 'selected="selected"' : '' 
?>value="<?php echo rental_contract::SECURITY_TYPE_BANK_GUARANTEE ?>"><?php 
echo lang('bank_guarantee') ?></option>
-                                                                       <option 
<?php echo $contract->get_security_type() == 
rental_contract::SECURITY_TYPE_DEPOSIT ? 'selected="selected"' : '' 
?>value="<?php echo rental_contract::SECURITY_TYPE_DEPOSIT ?>"><?php echo 
lang('deposit') ?></option>
-                                                                       <option 
<?php echo $contract->get_security_type() == 
rental_contract::SECURITY_TYPE_ADVANCE ? 'selected="selected"' : '' 
?>value="<?php echo rental_contract::SECURITY_TYPE_ADVANCE ?>"><?php echo 
lang('advance') ?></option>
-                                                                       <option 
<?php echo $contract->get_security_type() == 
rental_contract::SECURITY_TYPE_OTHER_GUARANTEE ? 'selected="selected"' : '' 
?>value="<?php echo rental_contract::SECURITY_TYPE_OTHER_GUARANTEE ?>"><?php 
echo lang('other_guarantee') ?></option>
-                                                               </select>
-                                                               </td>
-                                                               <td><label 
for="security_amount"><?php echo isset($config->config_data['currency_prefix']) 
&& $config->config_data['currency_prefix'] ? 
$config->config_data['currency_prefix'] : 'Kr'; ?></label></td>
-                                                               <td><input 
type="text" name="security_amount" id="security_amount" value="<?php echo 
$contract->get_security_amount(); ?>"/></td>
-                                                               </tr></table>
-
-
-                                                               <?php
-                                                       }
-                                                       else
-                                                       {
-                                                               switch 
($contract->get_security_type())
-                                                               {
-                                                                       case 
rental_contract::SECURITY_TYPE_BANK_GUARANTEE:
-                                                                               
echo lang('bank_guarantee');
-                                                                               
break;
-                                                                       case 
rental_contract::SECURITY_TYPE_DEPOSIT:
-                                                                               
echo lang('deposit');
-                                                                               
break;
-                                                                       case 
rental_contract::SECURITY_TYPE_ADVANCE:
-                                                                               
echo lang('advance');
-                                                                               
break;
-                                                                       case 
rental_contract::SECURITY_TYPE_OTHER_GUARANTEE:
-                                                                               
echo lang('other_guarantee');
-                                                                               
break;
-                                                                       default:
-                                                                               
echo lang('nobody');
-                                                                               
break;
-                                                               }
-                                                       }
-                                               }
-                                               ?>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="security_amount"><?php echo lang('security_amount') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <label 
for="security_amount"><?php echo 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'] ?></label>
-                                               <?php
-                                               if ($editable) {
-                                               ?>
-                                                       <input type="text" 
name="security_amount" id="security_amount" value="<?php echo 
$contract->get_security_amount(); ?>"/>
-                                               <?php
-                                               }
-                                               else
-                                               {       
-                                                       
if($contract->get_security_amount() && $contract->get_security_amount() > 0)
-                                                       {
-                                                               echo 
$contract->get_security_amount();
-                                                       }
-                                                       else
-                                                       {
-                                                               echo '0';
-                                                       }
-                                               }
-                                               ?>
-                                       </dd>
-                                       <dt><label for="rented_area"><?php echo 
lang('rented_area') ?></label></dt>
-                                       <dd>
-                                               <?php
-                                                       if ($editable) {?>
-                                                               <input 
type="text" name="rented_area" id="rented_area" value="<?php echo 
$contract->get_rented_area() ?>"/>&nbsp;<?php echo 
isset($config->config_data['area_suffix']) && 
$config->config_data['area_suffix'] ? $config->config_data['area_suffix'] : 
'kvm';?>
-                                                       <?php } else {?>
-                                                               <?php echo 
$contract->get_rented_area()?>&nbsp;<?php echo 
isset($config->config_data['area_suffix']) && 
$config->config_data['area_suffix'] ? $config->config_data['area_suffix'] : 
'kvm';?>
-                                                       <?php }
-                                               ?>
-                                       </dd>
-                                       <?php if($contract->is_adjustable() || 
$editable){?>
-                                               <dt>
-                                                       <label 
for="adjustable"><?php echo lang('adjustable') ?></label>
-                                               </dt>
-                                               <dd>
-                                                       <input type="checkbox" 
name="adjustable" id="adjustable"<?php echo $contract->is_adjustable() ? ' 
checked="checked"' : '' ?> <?php echo !$editable ? ' disabled="disabled"' : '' 
?>/>
-                                               </dd>
-                                       
-                                               <dt>
-                                                       <label 
for="adjustment_interval"><?php echo lang('adjustment_interval') ?></label>
-                                               </dt>
-                                               <dd>
-                                                       <?php
-                                                       $current_interval = 
$contract->get_adjustment_interval();
-                                                       if ($editable)
-                                                       {
-                                                               ?>
-                                                               <select 
name="adjustment_interval">
-                                                                       <?php
-                                                                               
echo "<option ".($current_interval == '1' ? 'selected="selected"' : "")." 
value=\"1\">1 ".lang('year')."</option>";
-                                                                               
echo "<option ".($current_interval == '2' ? 'selected="selected"' : "")." 
value=\"2\">2 ".lang('year')."</option>";
-                                                                               
echo "<option ".($current_interval == '10' ? 'selected="selected"' : "")." 
value=\"10\">10 ".lang('year')."</option>";
-                                                                       ?>
-                                                               </select>
-                                                               <?php
-                                                       ?>
-                                                       <?php
-                                                       }
-                                                       else // Non-editable
-                                                       {
-                                                               echo 
$current_interval." ".lang('year');
-                                                       }
-                                                       ?>
-                                               </dd>
-                                               <dt>
-                                                       <label 
for="adjustment_share"><?php echo lang('adjustment_share') ?></label>
-                                               </dt>
-                                               <dd>
-                                                       <?php
-                                                       $current_share = 
$contract->get_adjustment_share();
-                                                       if ($editable)
-                                                       {
-                                                               ?>
-                                                               <select 
name="adjustment_share">
-                                                                       <?php
-                                                                               
echo "<option ".($current_share == '100' ? 'selected="selected"' : "")." 
value=\"100\">100%</option>";
-                                                                               
echo "<option ".($current_share == '90' ? 'selected="selected"' : "")." 
value=\"90\">90%</option>";
-                                                                               
echo "<option ".($current_share == '80' ? 'selected="selected"' : "")." 
value=\"80\">80%</option>";
-                                                                               
echo "<option ".($current_share == '67' ? 'selected="selected"' : "")." 
value=\"67\">67%</option>";
-                                                                       ?>
-                                                               </select>
-                                                               <?php
-                                                       ?>
-                                                       <?php
-                                                       }
-                                                       else // Non-editable
-                                                       {
-                                                               echo 
$current_share."%";
-                                                       }
-                                                       ?>
-                                               </dd>
-                                               <dt>
-                                                       <label 
for="adjustment_year"><?php echo lang('adjustment_year') ?></label>
-                                               </dt>
-                                               <dd>
-                                                       <?php echo 
$contract->get_adjustment_year(); ?>
-                                               </dd>
-                                       <?php }else{
-                                               echo 
"<dt>".lang('contract_not_adjustable')."</dt>";
-                                       }?>
-                               </dl>
-                <dl class="proplist-col">
-                    <dt>
-                        <label for="comment"><?php echo lang('comment') 
?></label>
-                    </dt>
-                    <dd>
-                        <?php
-                        if ($editable)
-                        {
-                            ?>
-                            <textarea cols="40" rows="10" name="comment" 
id="comment"><?php echo $contract->get_comment(); ?></textarea>
-                            <?php
-                        }
-                        else
-                        {
-                            echo $contract->get_comment();
-                        }
-                        ?>
-                    </dd>
-                    <dt>
-                                               <label 
for="publish_comment"><?php echo lang('publish_comment') ?></label>
-                                       </dt>
-                                       <dd>
-                                               <input type="checkbox" 
name="publish_comment" id="publish_comment"<?php echo 
$contract->get_publish_comment() ? ' checked="checked"' : '' ?> <?php echo 
!$editable ? ' disabled="disabled"' : '' ?>/>
-                                       </dd>
-                </dl>
-                               <div class="form-buttons">
-                                       <?php
-                                               if ($editable) {
-                                                       echo '<input 
type="submit" name="save_contract" value="' . lang('save') . '"/>';
-                                               }
-                                       ?>
-                               </div>
-                       </form>
-               </div>
-               <?php if($contract->get_id() > 0) {?>           
-               <div id="invoice">
-                       <?php
-                               $list_form = true;
-                               $list_id = 'invoice_price_items';
-                               $url_add_on = "&amp;type={$list_id}";
-                               $extra_cols = null;
-                               include('invoice_price_item_list_partial.php');
-                       ?>
-               </div>
-               <div id="documents">
-                       <?php
-                               $list_form = true;
-                               $list_id = 'documents_for_contract';
-                               $url_add_on = 
"&amp;type={$list_id}&amp;contract_id={$contract->get_id()}";
-                               $upload_url_add_on = 
"&amp;contract_id={$contract->get_id()}";
-                               unset($extra_cols);
-                               unset($editors);
-                               unset($related);
-                               include('document_list_partial.php'); 
-                       ?>
-               </div>
-               <div id="notifications">
-                       <h3><?php echo lang('contract_notifications') ?></h3>
-                       <?php
-                       $list_form = false;
-                       $list_id = 'rental_notifications';
-                       $url_add_on = 
'&amp;type=notifications&amp;sort=date&amp;dir=DESC&amp;editable=true&amp;contract_id='.$contract->get_id();
-                       $disable_left_click = true;
-                       unset($extra_cols);
-                       unset($editors);
-                       include('notification_list.php');
-                       ?>
-                       <h3><?php echo lang('new_notification') ?></h3>
-                       <?php
-                       if ($editable) {
-
-                       ?>
-                               <form 
action="?menuaction=rental.uicontract.edit&id=<?php echo $contract->get_id() 
?>" method="post">
-                                       <?php
-                                       if(isset($notification))//Never??
-                                       {
-                                               $notification_date = 
$GLOBALS['phpgw']->common->show_date($notification->get_date());
-                                       }
-                                       else
-                                       {
-                                               $notification_date = 
$GLOBALS['phpgw']->common->show_date(time());
-                                       }
-                                       ?>
-
-
-                                       <input type="hidden" 
name="notification_contract_id" value="<?php echo $contract->get_id() ?>"/>
-                                       <!-- <input type="hidden" 
name="date_notification_hidden" id="date_notification_hidden" value="<?php echo 
$date ?>"/> -->
-                                       <fieldset>
-
-                                                               <label 
for="calendarNotificationDate"><?php echo lang('date') ?></label>
-                                                               <!--<input 
type="text" name="date_notification" id="date_notification" size="10" 
value="<?php echo isset($notification) ? 
htmlentities($notification->get_date()) : '' ?>" /> -->
-                                                               <?php 
-       //                                                              echo 
$GLOBALS['phpgw']->yuical->add_listener('date_notification', 
$notification_date);
-                                                                       echo 
$GLOBALS['phpgw']->jqcal->add_listener('date_notification', 'date', 
$notification_date);
-                                                                       echo 
rental_uicommon::get_field_error($notification, 'date')
-                                                               ?>
-                                                                       <label 
for="notification_recurrence"><?php echo lang('recurrence') ?></label>
-                                                               <select 
name="notification_recurrence" id="notification_recurrence">
-                                                                       <option 
<?php echo isset($notification) && $notification->get_recurrence() == 
rental_notification::RECURRENCE_NEVER ? 'selected="selected"' : '' 
?>value="<?php echo rental_notification::RECURRENCE_NEVER ?>"><?php echo 
lang('never') ?></option>
-                                                                       <option 
<?php echo isset($notification) && $notification->get_recurrence() == 
rental_notification::RECURRENCE_ANNUALLY ? 'selected="selected"' : '' ?> 
value="<?php echo rental_notification::RECURRENCE_ANNUALLY ?>"><?php echo 
lang('annually') ?></option>
-                                                                       <option 
<?php echo isset($notification) && $notification->get_recurrence() == 
rental_notification::RECURRENCE_MONTHLY ? 'selected="selected"' : '' ?> 
value="<?php echo rental_notification::RECURRENCE_MONTHLY ?>"><?php echo 
lang('monthly') ?></option>
-                                                                       <option 
<?php echo isset($notification) && $notification->get_recurrence() == 
rental_notification::RECURRENCE_WEEKLY ? 'selected="selected"' : '' ?> 
value="<?php echo rental_notification::RECURRENCE_WEEKLY ?>"><?php echo 
lang('weekly') ?></option>
-                                                               </select>
-                                       </fieldset>
-                                       <fieldset>
-                                               <label 
for="notification_message"><?php echo lang('message') ?></label>
-                                                               <input 
type="text" name="notification_message" id="notification_message" size="50" 
value="<?php echo isset($notification) ? 
htmlentities($notification->get_message()) : '' ?>" />
-                                       </fieldset>
-                                       <fieldset>
-                                               <label><?php echo 
lang('audience') ?></label>
-                                               <label 
for="notification_target"><?php echo lang('user_or_group') ?></label>
-                                               <select 
name="notification_target" id="notification_target">
-                                                       <option value=""><?php 
echo lang('target_none') ?></option>
-                                                       
-                                                       <?php
-                                                               $accounts = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_READ, 'run', 'rental');
-                                                               $label = 
lang('notification_optgroup_users');
-                                                               echo '<optgroup 
label="'.$label.'">';
-                                                               echo '<option 
value="'.$GLOBALS['phpgw_info']['user']['account_id'].'">'.lang('target_me').'</option>';
-                                                               
foreach($accounts as $account)
-                                                               {
-                                                                       if( 
$account['account_id'] != $GLOBALS['phpgw_info']['user']['account_id'])
-                                                                       {
-                                                                               
echo "<option value='{$account['account_id']}'>" . 
$GLOBALS['phpgw']->accounts->get($account['account_id'])->__toString() . 
'</option>';
-                                                                       }
-                                                               }
-                                                               echo 
'</optgroup>';
-                                                               $accounts = 
$GLOBALS['phpgw']->accounts->get_list('groups');
-                                                               $label = 
lang('notification_optgroup_groups');
-                                                               echo "<optgroup 
label='{$label}'>";
-                                                               
foreach($accounts as $account)
-                                                               {
-                                                                       echo 
"<option value='{$account->id}'>{$account->firstname}</option>";
-                                                               }
-                                                               echo 
'</optgroup>';
-                                                       ?>
-                                               </select>
-                                               <label 
for="notification_location"><?php echo lang('field_of_responsibility') 
?></label>
-                                               <select 
name="notification_location" id="notification_location">
-                                                       <option value=""><?php 
echo lang('target_none') ?></option>
-                                                       <?php
-                                                       $types = 
rental_socontract::get_instance()->get_fields_of_responsibility();
-                                                       foreach($types as $id 
=> $label)
-                                                       {
-                                                               $names = 
$this->locations->get_name($id);
-                                                               
if($names['appname'] == $GLOBALS['phpgw_info']['flags']['currentapp'])
-                                                               {
-                                                                       if($id 
== $contract->get_location_id()){
-                                                                               
$selected = 'selected="selected"';      
-                                                                       } 
-                                                                       echo 
'<option value="'.$id.'" '.$selected.'>'.lang($label).'</option>';
-                                                               }
-                                                       }
-                                                       ?>
-                                               </select>
-                                       </fieldset>
-                                       <fieldset>
-                                                               <input 
type="submit" name="add_notification" id="" value="<?php echo lang('add') ?>" />
-                                       </fieldset>
-                               </form>
-                       <?php
-                       }
-                       else
-                       {
-                               echo lang('log_in_to_add_notfications');
-                       }
-                       ?>
-               </div>
-               
-               <?php } ?>
-       </div>
-</div>

Deleted: branches/dev-syncromind/rental/templates/base/contract_list.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/contract_list.php     
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/contract_list.php     
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,84 +0,0 @@
-<?php
-       include("common.php");
-?>
-
-<script>
-       YAHOO.util.Event.addListener(
-               'ctrl_add_rental_contract',
-               'click',
-               function(e)
-               {
-               YAHOO.util.Event.stopEvent(e);
-
-               window.location = 
'index.php?menuaction=rental.uicontract.add&amp;location_id=' + 
document.getElementById('location_id').value;
-    }
-   );
-</script>
-
-<h1><img src="<?php echo RENTAL_TEMPLATE_PATH 
?>images/32x32/text-x-generic.png" /> <?php echo lang('contracts') ?></h1>
-
-<?php
-if($this->isAdministrator() || $this->isExecutiveOfficer())
-{
-?>
-<fieldset>
-       <!-- New contract -->
-       <h3><?php echo lang('t_new_contract') ?></h3>
-       <select name="location_id" id="location_id">
-               <?php
-                       $config = CreateObject('phpgwapi.config','rental');
-                       $config->read();
-                       $valid_contract_types = array();
-                       if(isset($config->config_data['contract_types']) && 
is_array($config->config_data['contract_types']))
-                       {
-                               foreach ($config->config_data['contract_types'] 
as $_key => $_value)
-                               {
-                                       if($_value)
-                                       {
-                                               $valid_contract_types[] = 
$_value;
-                                       }
-                               }
-                       }
-
-               $types = 
rental_socontract::get_instance()->get_fields_of_responsibility();
-               foreach($types as $id => $label)
-               {
-                       if($valid_contract_types && 
!in_array($id,$valid_contract_types))
-                       {
-                               continue;
-                       }
-                       $names = $this->locations->get_name($id);
-                       if($names['appname'] == 
$GLOBALS['phpgw_info']['flags']['currentapp'])
-                       {
-                               
if($this->hasPermissionOn($names['location'],PHPGW_ACL_ADD))
-                               {
-                               ?>
-                                       <option
-                                               value="<?php echo $id ?>"
-                                       >
-                                               <?php echo lang($label) ?>
-                                       </option>
-                               <?php
-                               }
-                       }
-               }
-               ?>
-       </select>
-       <input type="submit" name="ctrl_add_rental_contract" 
id="ctrl_add_rental_contract" value="<?php echo lang('f_new_contract') ?>" />
-</fieldset>
-<?php
-}
-
-$list_form = true;
-$list_id = 'all_contracts';
-$url_add_on = '&amp;type='.$list_id;
-$editable = false;
-$extra_cols = array(
-       array("key" => "type", "label" => lang('responsibility'), "index" => 3),
-       array("key" => "composite", "label" => lang('composite'), 
"sortable"=>'true', "index" => 4),
-       array("key" => "party", "label" => lang('party'), "sortable"=>'true', 
"index" => 5),
-       array("key" => "department", "label" => lang('department'), "sortable" 
=> 'false', "index" => 6),
-       array("key" => "contract_notification_status", "label" => 
lang('notification_status'), "sortable"=>false)
-);
-include('contract_list_partial.php');
-?>
\ No newline at end of file

Deleted: branches/dev-syncromind/rental/templates/base/contract_list_partial.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/contract_list_partial.php     
2015-12-10 14:36:15 UTC (rev 14565)
+++ branches/dev-syncromind/rental/templates/base/contract_list_partial.php     
2015-12-10 14:38:47 UTC (rev 14566)
@@ -1,309 +0,0 @@
-<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.uicontract.index';
-               }
-       );
-
-       var formatPrice = function(elCell, oRecord, oColumn, oData) {
-               if (oData != undefined) {
-                       elCell.innerHTML = YAHOO.util.Number.format( oData,
-                       {
-                               suffix: " <?php echo 
isset($config->config_data['currency_suffix']) && 
$config->config_data['currency_suffix'] ? 
$config->config_data['currency_suffix'] : 'NOK'; ?>",
-                               thousandsSeparator: "<?php echo 
lang('currency_thousands_separator') ?>",

@@ Diff output truncated at 153600 characters. @@



reply via email to

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