2010-11-22 23:44:52 +01:00
|
|
|
/**
|
2011-05-03 09:26:32 +02:00
|
|
|
* EGroupware infolog javascript code used on index page
|
|
|
|
*
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @package infolog
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @version $Id$
|
2010-11-22 23:44:52 +01:00
|
|
|
*/
|
|
|
|
|
2011-05-03 09:26:32 +02:00
|
|
|
var infolog_popup_action, infolog_popup_senders;
|
2010-11-22 23:44:52 +01:00
|
|
|
|
|
|
|
/**
|
2011-05-03 09:26:32 +02:00
|
|
|
* Open popup for a certain action requiring further input
|
|
|
|
*
|
|
|
|
* @param _action
|
|
|
|
* @param _senders
|
2010-11-22 23:44:52 +01:00
|
|
|
*/
|
2011-05-02 21:41:21 +02:00
|
|
|
function open_popup(_action, _senders)
|
|
|
|
{
|
2011-05-03 02:14:44 +02:00
|
|
|
var prefix = 'exec';
|
|
|
|
var popup = document.getElementById(prefix + '[' + _action.id + '_popup]');
|
2011-05-03 09:26:32 +02:00
|
|
|
|
|
|
|
if (popup) {
|
|
|
|
infolog_popup_action = _action;
|
|
|
|
infolog_popup_senders = _senders;
|
2011-05-03 02:14:44 +02:00
|
|
|
popup.style.display = 'block';
|
|
|
|
}
|
2011-05-02 21:41:21 +02:00
|
|
|
}
|
|
|
|
|
2010-11-22 23:44:52 +01:00
|
|
|
/**
|
2011-05-03 09:26:32 +02:00
|
|
|
* Submit a popup action
|
2010-11-22 23:44:52 +01:00
|
|
|
*/
|
2011-05-03 09:26:32 +02:00
|
|
|
function submit_popup(button)
|
|
|
|
{
|
|
|
|
button.form.submit_button.value = button.name; // set name of button (sub-action)
|
|
|
|
|
2011-05-04 01:31:40 +02:00
|
|
|
// call regular nm_action to transmit action and senders correct
|
2011-05-03 09:26:32 +02:00
|
|
|
nm_action(infolog_popup_action, infolog_popup_senders);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hide popup
|
|
|
|
*/
|
|
|
|
function hide_popup(element, div_id)
|
|
|
|
{
|
2010-11-22 23:44:52 +01:00
|
|
|
var prefix = element.id.substring(0,element.id.indexOf('['));
|
|
|
|
var popup = document.getElementById(prefix+'['+div_id+']');
|
2011-05-03 02:14:44 +02:00
|
|
|
|
|
|
|
// Hide popup
|
2010-11-22 23:44:52 +01:00
|
|
|
if(popup) {
|
|
|
|
popup.style.display = 'none';
|
|
|
|
}
|
2011-05-04 01:31:40 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Confirm delete
|
|
|
|
* If entry has children, asks if you want to delete children too
|
|
|
|
*
|
|
|
|
* @param _action
|
|
|
|
* @param _senders
|
|
|
|
*/
|
|
|
|
function confirm_delete(_action, _senders)
|
|
|
|
{
|
|
|
|
var child_button = document.getElementById('exec[delete_sub]');
|
|
|
|
var children = false;
|
|
|
|
if(child_button) {
|
|
|
|
for(var i = 0; i < _senders.length; i++) {
|
2011-05-05 08:30:44 +02:00
|
|
|
if ($(_senders[i].iface.node).hasClass('rowHasSubs')) {
|
|
|
|
children = true;
|
|
|
|
break;
|
|
|
|
}
|
2011-05-04 01:31:40 +02:00
|
|
|
}
|
|
|
|
child_button.style.display = children ? 'block' : 'none';
|
|
|
|
}
|
|
|
|
open_popup(_action, _senders);
|
2010-11-22 23:44:52 +01:00
|
|
|
}
|