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

204 lines
6.9 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
/-------------------------------------------------------------------------------------------------------/
2019-04-04 11:51:37 +00:00
@version 3.4.x
2019-08-14 02:20:32 +00:00
@build 14th August, 2019
2019-04-04 11:51:37 +00:00
@created 15th June, 2012
2015-12-01 05:06:34 +00:00
@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');
JHtml::_('behavior.tabstate');
JHtml::_('behavior.calendar');
2019-04-04 11:51:37 +00:00
$componentParams = $this->params; // will be removed just use $this->params instead
2015-12-01 05:06:34 +00:00
?>
<?php echo $this->toolbar->render(); ?>
2019-04-04 11:51:37 +00:00
<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">
2015-12-01 05:06:34 +00:00
<?php echo JLayoutHelper::render('intervention.details_above', $this); ?>
<div class="form-horizontal">
2015-12-01 05:06:34 +00:00
<?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'); ?>
2019-04-04 11:51:37 +00:00
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'interventionTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?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_vvvvvvy function
2015-12-01 05:06:34 +00:00
jQuery('#jform_type').on('keyup',function()
{
var type_vvvvvvy = jQuery("#jform_type input[type='radio']:checked").val();
vvvvvvy(type_vvvvvvy);
2015-12-01 05:06:34 +00:00
});
jQuery('#adminForm').on('change', '#jform_type',function (e)
{
e.preventDefault();
var type_vvvvvvy = jQuery("#jform_type input[type='radio']:checked").val();
vvvvvvy(type_vvvvvvy);
2015-12-01 05:06:34 +00:00
});
// #jform_type listeners for type_vvvvvvz function
2015-12-01 05:06:34 +00:00
jQuery('#jform_type').on('keyup',function()
{
var type_vvvvvvz = jQuery("#jform_type input[type='radio']:checked").val();
vvvvvvz(type_vvvvvvz);
2015-12-01 05:06:34 +00:00
});
jQuery('#adminForm').on('change', '#jform_type',function (e)
{
e.preventDefault();
var type_vvvvvvz = jQuery("#jform_type input[type='radio']:checked").val();
vvvvvvz(type_vvvvvvz);
});
// #jform_company listeners for company_vvvvvwa function
jQuery('#jform_company').on('keyup',function()
{
var company_vvvvvwa = jQuery("#jform_company").val();
vvvvvwa(company_vvvvvwa);
});
jQuery('#adminForm').on('change', '#jform_company',function (e)
{
e.preventDefault();
var company_vvvvvwa = jQuery("#jform_company").val();
vvvvvwa(company_vvvvvwa);
2015-12-01 05:06:34 +00:00
});
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>