Cost-Benefit-Projection/admin/views/intervention/tmpl/edit.php

196 lines
6.6 KiB
PHP
Raw Normal View History

2015-12-01 05:06:34 +00:00
<?php
/*----------------------------------------------------------------------------------| www.giz.de |----/
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
/-------------------------------------------------------------------------------------------------------/
@version 3.3.6
@build 22nd February, 2016
2015-12-01 05:06:34 +00:00
@created 15th June, 2012
@package Cost Benefit Projection
@subpackage edit.php
@author Llewellyn van der Merwe <http://www.vdm.io>
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
/-------------------------------------------------------------------------------------------------------/
Cost Benefit Projection Tool.
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = JComponentHelper::getParams('com_costbenefitprojection');
?>
<form action="<?php echo JRoute::_('index.php?option=com_costbenefitprojection&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('intervention.details_above', $this); ?><div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'interventionTab', array('active' => 'details')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'interventionTab', 'details', JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('intervention.details_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'interventionTab', 'settings', JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_SETTINGS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('intervention.settings_left', $this); ?>
</div>
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('intervention.settings_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if ($this->canDo->get('intervention.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('intervention.edit.state') || $this->canDo->get('core.edit.created')) : ?>
2015-12-01 05:06:34 +00:00
<?php echo JHtml::_('bootstrap.addTab', 'interventionTab', 'publishing', JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('intervention.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('intervention.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
2015-12-01 05:06:34 +00:00
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'interventionTab', 'permissions', JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
<div class="adminformlist">
<?php foreach ($this->form->getFieldset('accesscontrol') as $field): ?>
<div>
<?php echo $field->label; echo $field->input;?>
</div>
<div class="clearfix"></div>
<?php endforeach; ?>
</div>
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="intervention.edit" />
<?php echo JHtml::_('form.token'); ?>
</div>
</div>
<div class="clearfix"></div>
<?php echo JLayoutHelper::render('intervention.details_under', $this); ?>
</form>
<script type="text/javascript">
// #jform_type listeners for type_BjxWJbr function
2015-12-01 05:06:34 +00:00
jQuery('#jform_type').on('keyup',function()
{
var type_BjxWJbr = jQuery("#jform_type input[type='radio']:checked").val();
BjxWJbr(type_BjxWJbr);
2015-12-01 05:06:34 +00:00
});
jQuery('#adminForm').on('change', '#jform_type',function (e)
{
e.preventDefault();
var type_BjxWJbr = jQuery("#jform_type input[type='radio']:checked").val();
BjxWJbr(type_BjxWJbr);
2015-12-01 05:06:34 +00:00
});
// #jform_type listeners for type_LpRkBxe function
2015-12-01 05:06:34 +00:00
jQuery('#jform_type').on('keyup',function()
{
var type_LpRkBxe = jQuery("#jform_type input[type='radio']:checked").val();
LpRkBxe(type_LpRkBxe);
2015-12-01 05:06:34 +00:00
});
jQuery('#adminForm').on('change', '#jform_type',function (e)
{
e.preventDefault();
var type_LpRkBxe = jQuery("#jform_type input[type='radio']:checked").val();
LpRkBxe(type_LpRkBxe);
});
// #jform_company listeners for company_IcMhmLU function
jQuery('#jform_company').on('keyup',function()
{
var company_IcMhmLU = jQuery("#jform_company").val();
IcMhmLU(company_IcMhmLU);
});
jQuery('#adminForm').on('change', '#jform_company',function (e)
{
e.preventDefault();
var company_IcMhmLU = jQuery("#jform_company").val();
IcMhmLU(company_IcMhmLU);
2015-12-01 05:06:34 +00:00
});
jQuery('#adminForm').on('change', '#jform_interventions',function (e)
{
e.preventDefault();
var cluster = jQuery("#jform_interventions").val();
getClusterData(cluster,'jform_interventions');
});
jQuery('#adminForm').on('change', '.clusterintervention',function (e)
{
jQuery('.clusterintervention').keyup(function () {
this.value = this.value.replace(/[^0-9-& \.]/g,'');
});
changeFieldValue(this.id,this.value);
});
jQuery('input.form-field-repeatable').on('value-update', function(e, value){
if (value)
{
getBuildTable(value,e.currentTarget.id,'ne');
}
});
jQuery('input.form-field-repeatable').on('row-add', function(e, row) {
setSelection();
updateSelection(row);
});
var causerisk = new Array;
function setSelection()
{
causerisk.length = 0;
<?php $fieldNrs = range(1,99,1); ?>
<?php foreach($fieldNrs as $fieldNr): ?>
// get options
var causerisk_<?php echo $fieldNr ?> = jQuery("#jform_intervention_fields_causerisk-<?php echo $fieldNr ?> option:selected").val();
if (causerisk_<?php echo $fieldNr ?>)
{
causerisk.push(causerisk_<?php echo $fieldNr ?>);
}
<?php endforeach; ?>
}
</script>