* Admin: show new eT2 based pages without iframe, fixes additional scrollbars sometimes shown

merges everything but projectmanager stuff (and infolog commit belonging to it)
This commit is contained in:
Ralf Becker 2016-06-30 09:50:50 +02:00
commit b7b8696f18
19 changed files with 113 additions and 48 deletions

View File

@ -72,11 +72,13 @@ class addressbook_hooks
'Site configuration' => Egw::link('/index.php',array(
'menuaction' => 'admin.uiconfig.index',
'appname' => $appname,
'ajax' => 'true',
)),
'Global Categories' => Egw::link('/index.php',array(
'menuaction' => 'admin.admin_categories.index',
'appname' => $appname,
'global_cats'=> True,
'ajax' => 'true',
)),
);
// custom fields are not availible in LDAP

View File

@ -90,7 +90,6 @@ class admin_ui
{
$vars = $_GET;
$vars['menuaction'] = $vars['load'];
unset($vars['ajax']);
unset($vars['load']);
$content['iframe'] = Egw::link('/index.php', $vars);
}

View File

@ -35,6 +35,13 @@ app.classes.admin = AppJS.extend(
*/
nm: null,
/**
* Refarence to div to hold AJAX loadable pages
*
* {et2_box}
*/
ajax_target: null,
/**
* Reference to ACL edit dialog (not the list)
*/
@ -82,6 +89,7 @@ app.classes.admin = AppJS.extend(
case 'admin.index':
var iframe = this.iframe = this.et2.getWidgetById('iframe');
this.nm = this.et2.getWidgetById('nm');
this.ajax_target = this.et2.getWidgetById('ajax_target');
if (iframe)
{
var self = this;
@ -130,9 +138,35 @@ app.classes.admin = AppJS.extend(
window.open(_url, '_blank');
return;
}
var ajax = false;
if (_url)
{
this.iframe.set_src(_url);
// Try to load it without the iframe
ajax = _url.match(/ajax=true/);
if(ajax)
{
if(this.ajax_target.node.children.length)
{
// Node has children already? Check for loading over an
// existing etemplate, and remove it first
jQuery(this.ajax_target.node.children).each(function() {
var old = etemplate2.getById(this.id);
if(old) old.clear();
});
jQuery(this.ajax_target.node).empty();
}
this.egw.json(
framework.activeApp.getMenuaction('ajax_exec'),
// It's important that the context is null, or etemplate2
// won't load the template properly
[_url], this._ajax_load_callback,null, true, this
).sendRequest();
}
else
{
this.iframe.set_src(_url);
}
}
else
{
@ -140,8 +174,9 @@ app.classes.admin = AppJS.extend(
// blank iframe, to not keep something running there
this.iframe.getDOMNode().contentDocument.location.href = 'about:blank';
}
this.iframe.set_disabled(!_url);
this.nm.set_disabled(!!_url);
this.iframe.set_disabled(!_url || ajax);
this.nm.set_disabled(!!_url || ajax);
this.ajax_target.set_disabled(!ajax);
},
/**
@ -263,6 +298,19 @@ app.classes.admin = AppJS.extend(
this.load(url);
},
/**
* Callback to load an etemplate
*
* @param {Object[]} _data
*/
_ajax_load_callback: function(_data)
{
if(!_data || _data.type != undefined) return;
// Insert the content, etemplate will load into it
jQuery(this.ajax_target.node).append(_data[0]);
},
/**
* Link hander for jDots template to just reload our iframe, instead of reloading whole admin app
*
@ -276,7 +324,7 @@ app.classes.admin = AppJS.extend(
{
if (matches)
{
_url = _url.replace(/menuaction=admin.admin_ui.index/, 'menuaction='+matches[1]).replace(/&(ajax=true|load=[^&]+)/g, '');
_url = _url.replace(/menuaction=admin.admin_ui.index/, 'menuaction='+matches[1]).replace(/&(load=[^&]+)/g, '');
}
this.load(_url);
return true;

View File

@ -50,5 +50,6 @@
<tree autoloading="admin_ui::ajax_tree" id="tree" onclick="app.admin.run" parent_node="admin_tree_target" std_images="bullet"/>
<nextmatch id="nm" template="admin.index.rows" header_left="admin.index.add"/>
<iframe frameborder="1" height="100%" id="iframe" scrolling="auto" width="100%" disabled="true"/>
<box id="ajax_target" height="99%" disabled="true"/>
</template>
</overlay>

View File

@ -396,7 +396,7 @@ displayed in the top line of the groupbox (legend) common de wird oben in der Um
distribution lists as groups groupdav de Verteilerlisten als Gruppen
djibouti common de DSCHIBUTI
do not notify common de Nicht benachrichtigen
do not notify of these changes common de Keine Benachrichtigung
do not notify of these changes common de Es werden keine Benachrichtigungen beim Anlegen oder Ändern versendet.
do you also want to delete all subcategories ? common de Sollen alle Unterkategorien gelöscht werden ?
do you want to save the changes you made in table %s? common de Wollen Sie die Änderungen in der Tabelle '%s' speichern?
do you want to send the message to all selected entries, without further editing? common de Wollen Sie die Nachricht an alle ausgewählten Einträge OHNE weitere Bearbeitung versenden?

View File

@ -396,7 +396,7 @@ displayed in the top line of the groupbox (legend) common en Displayed in the to
distribution lists as groups groupdav en Distribution lists as groups
djibouti common en DJIBOUTI
do not notify common en Do not notify
do not notify of these changes common en Do not notify of these changes
do not notify of these changes common en Do not send notifications when creating or changing
do you also want to delete all subcategories ? common en Do you also want to delete all sub categories?
do you want to save the changes you made in table %s? common en Do you want to save the changes you made in table %s?
do you want to send the message to all selected entries, without further editing? common en Do you want to send the message to all selected entries, WITHOUT further editing?

View File

@ -317,6 +317,7 @@ location, start- and endtimes, ... calendar de Ort, Start- und Endzeiten
mail all participants calendar de Mail an alle Teilnehmer
make freebusy information available to not loged in persons? calendar de Die freien/nicht verfügbaren Zeiten für nicht angemeldete Personen sichtbar machen?
manage mapping calendar de Feldzuordnungen verwalten
mark event as private to hide title and description calendar de Kennzeichnet Termin als privat und unterdrückt Sichtbarkeit von Titel und Beschreibung
max. number of entries to show (leave empty for no restriction) calendar de Max. Anzahl von Einträgen die angezeigt werden sollen (Kein Eintrag = Keine Beschränkung)
maximum available quantity of %1 exceeded! calendar de Maximale Anzahl von %1 erreicht!
meeting canceled calendar de Termin abgesagt

View File

@ -317,6 +317,7 @@ location, start- and endtimes, ... calendar en Location, start and end times, ..
mail all participants calendar en Mail all participants
make freebusy information available to not loged in persons? calendar en Make Free/Busy information available to not logged in persons
manage mapping calendar en Manage mapping
mark event as private to hide title and description calendar en Mark event as private to hide title and description
max. number of entries to show (leave empty for no restriction) calendar en Max. number of entries to show. Leave empty for no restriction.
maximum available quantity of %1 exceeded! calendar en Maximum available quantity of %1 exceeded!
meeting canceled calendar en Meeting canceled

View File

@ -210,15 +210,15 @@
<description for="start" value="Start" width="88"/>
<date-time id="start" needed="1" class="required" onchange="app.calendar.edit_update_participant"/>
<description for="duration" value="Duration" id="calendar_edit_duration" />
<menulist >
<menulist>
<menupopup statustext="Duration of the meeting" class="et2_fullWidth" id="duration" no_lang="1" onchange="app.calendar.set_enddate_visibility" options="Use end date,,,,,,,false"/>
</menulist>
<date-time id="end" onchange="app.calendar.edit_update_participant"/>
</row>
<row class="dialogHeader2" height="28">
<label value="options"/>
<checkbox statustext="Event will occupy the whole day" label="whole day" id="whole_day" onchange="app.calendar.set_alarmOptions_WD"/>
<checkbox label="Private" id="public" options="0,1"/>
<checkbox statustext="Event will occupy the whole day" label="whole day" id="whole_day" onchange="app.calendar.set_alarmOptions_WD"/>
<checkbox label="Private" id="public" options="0,1" statustext="Mark event as private to hide title and description"/>
<checkbox statustext="A non blocking event will not conflict with other events" label="non blocking" id="non_blocking" options="1,0, ,disable"/>
<hbox>
<label for="priority" value="Priority"/>
@ -277,7 +277,7 @@
<menulist>
<menupopup statustext="Execute a further action for this entry" id="action" onchange="app.calendar.actions_change" options="Actions..."/>
</menulist>
<checkbox label="Do not notify" id="no_notifications"/>
<checkbox label="Do not notify" id="no_notifications" statustext="Do not notify of these changes"/>
<buttononly statustext="Find free timeslots where the selected participants are availible for the given timespan" label="Freetime search" id="freetime" onclick="app.calendar.freetime_search" image="timesheet" background_image="1" span="all"/>
<button align="right" statustext="Delete this event" label="Delete" id="button[delete]" onclick="app.calendar.delete_btn(widget,$cont[query_delete_exceptions]);" image="delete" background_image="1"/>
<textbox type="hidden" id="delete_exceptions"/>

View File

@ -637,10 +637,12 @@ class infolog_groupdav extends Api\CalDAV\Handler
if (!Api\Categories::is_global($task['info_cat']))
{
$cat_obj = new Api\Categories(Api\Categories::GLOBAL_ACCOUNT, 'infolog');
$cat = Api\Categories::read($task['info_cat']);
$cat['owner'] = Api\Categories::GLOBAL_ACCOUNT;
$cat['access'] = 'public';
$cat_obj->edit($cat);
if (($cat = Api\Categories::read($task['info_cat'])))
{
$cat['owner'] = Api\Categories::GLOBAL_ACCOUNT;
$cat['access'] = 'public';
$cat_obj->edit($cat);
}
}
// if replace, remove user of old category from responsible
if ($action == 'replace' && $oldTask && $oldTask['info_cat'] &&

View File

@ -259,7 +259,7 @@
<menulist>
<menupopup statustext="Execute a further action for this entry" id="action" onchange="app.infolog.edit_actions()" options="Actions..."/>
</menulist>
<checkbox label="Do not notify" id="no_notifications"/>
<checkbox label="Do not notify" id="no_notifications" statustext="Do not notify of these changes"/>
</hbox>
<button align="right" statustext="delete this entry" label="Delete" id="button[delete]" onclick="if($cont[info_anz_subs]) return $cont[info_anz_subs]; et2_dialog.confirm(widget,'Delete this entry','Delete');" image="delete" background_image="1" span="all"/>
</row>

View File

@ -1436,10 +1436,10 @@ div#ui-datepicker-div {
.ui-datepicker div.ui-timepicker-div dt.ui_tpicker_minute_label {
font-size: 0.9em;
}
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_hour_slider a.ui-slider-handle {
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_hour_slider span.ui-slider-handle {
background-color: #0C5DA5;
}
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_minute_slider a.ui-slider-handle {
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_minute_slider span.ui-slider-handle {
background-color: #0C5DA5;
}
.ui-datepicker div.ui-datepicker-buttonpane {

View File

@ -1425,10 +1425,10 @@ div#ui-datepicker-div {
.ui-datepicker div.ui-timepicker-div dt.ui_tpicker_minute_label {
font-size: 0.9em;
}
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_hour_slider a.ui-slider-handle {
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_hour_slider span.ui-slider-handle {
background-color: #0C5DA5;
}
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_minute_slider a.ui-slider-handle {
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_minute_slider span.ui-slider-handle {
background-color: #0C5DA5;
}
.ui-datepicker div.ui-datepicker-buttonpane {

View File

@ -349,10 +349,10 @@ span.ui-icon-search {
// Schieberegler
div.ui_tpicker_hour_slider {
a.ui-slider-handle {background-color: @egw_color_2_a;}
span.ui-slider-handle {background-color: @egw_color_2_a;}
}
div.ui_tpicker_minute_slider {
a.ui-slider-handle {background-color: @egw_color_2_a;}
span.ui-slider-handle {background-color: @egw_color_2_a;}
}
}

View File

@ -1447,10 +1447,10 @@ div#ui-datepicker-div {
.ui-datepicker div.ui-timepicker-div dt.ui_tpicker_minute_label {
font-size: 0.9em;
}
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_hour_slider a.ui-slider-handle {
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_hour_slider span.ui-slider-handle {
background-color: #0C5DA5;
}
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_minute_slider a.ui-slider-handle {
.ui-datepicker div.ui-timepicker-div div.ui_tpicker_minute_slider span.ui-slider-handle {
background-color: #0C5DA5;
}
.ui-datepicker div.ui-datepicker-buttonpane {

View File

@ -391,14 +391,16 @@ class resources_bo
Link::unlink(0,'resources',$resource['res_id'],'','resources',$old['accessory_of']);
// Check for resource changing to accessory - move its accessories to resource
if($old['accessory_of'] == -1 && $accessories = $this->get_acc_list($resource['res_id']))
if($old['accessory_of'] == -1 && ($accessories = $this->get_acc_list($resource['res_id'])))
{
foreach($accessories as $accessory => $name)
{
Link::unlink(0,'resources',$accessory,'','resources',$resource['res_id']);
$acc = $this->read($accessory);
$acc['accessory_of'] = -1;
$this->so->save($acc);
if (($acc = $this->read($accessory)))
{
$acc['accessory_of'] = -1;
$this->so->save($acc);
}
}
}
}
@ -412,10 +414,12 @@ class resources_bo
$accessories = $this->get_acc_list($resource['res_id']);
foreach($accessories as $accessory => $name)
{
$acc = $this->so->read($accessory);
$acc['cat_id'] = $resource['cat_id'];
$this->so->data = $acc;
$this->so->save();
if (($acc = $this->so->read($accessory)))
{
$acc['cat_id'] = $resource['cat_id'];
$this->so->data = $acc;
$this->so->save();
}
}
}
@ -439,6 +443,7 @@ class resources_bo
*
* @author Lukas Weiss <wnz_gh05t@users.sourceforge.net>
* @param int $res_id id of resource
* @return string|false string with error or false on success
*/
function delete($res_id)
{
@ -448,9 +453,12 @@ class resources_bo
}
// check if we only mark resources as deleted, or really delete them
$old = $this->read($res_id);
$config = Api\Config::read('resources');
if ($config['history'] != '' && $old['deleted'] == null)
if (!($old = $this->read($res_id)))
{
// error is returned at end of function
}
elseif ($config['history'] != '' && $old['deleted'] == null)
{
$old['deleted'] = time();
$this->save($old);
@ -459,8 +467,7 @@ class resources_bo
foreach($accessories as $acc_id => $name)
{
// Don't purge already deleted accessories
$acc = $this->read($acc_id);
if(!$acc['deleted'])
if (($acc = $this->read($acc_id)) && !$acc['deleted'])
{
$acc['deleted'] = time();
$this->save($acc);
@ -474,9 +481,8 @@ class resources_bo
$accessories = $this->get_acc_list($res_id, true);
foreach($accessories as $acc_id => $name)
{
if($this->delete($acc_id))
if($this->delete($acc_id) && ($acc = $this->read($acc_id)))
{
$acc = $this->read($acc_id);
$acc['accessory_of'] = -1;
$this->save($acc);
}

View File

@ -57,7 +57,9 @@ class resources_hooks
'Global Categories' => Egw::link('/index.php',array(
'menuaction' => 'admin.admin_categories.index',
'appname' => $appname,
'global_cats'=> true)),
'global_cats'=> true,
'ajax' => 'true'
)),
'Configure Access Permissions' => Egw::link('/index.php',
'menuaction=resources.resources_acl_ui.index&ajax=true'),
'Custom Fields'=>egw::link('/index.php',

View File

@ -44,10 +44,13 @@ class timesheet_egw_record implements importexport_iface_egw_record
public function __construct( $_identifier='' ){
$this->identifier = $_identifier;
$this->botimesheet = new timesheet_bo();
$data = $this->botimesheet->read($this->identifier);
// set ts_project from ts_project_blur, where it get moved, if it is no custom value
if (empty($data['ts_project'])) $data['ts_project'] = $data['ts_project_blur'];
$this->set_record($data);
if (($data = $this->botimesheet->read($this->identifier)))
{
// set ts_project from ts_project_blur, where it get moved, if it is no custom value
if (empty($data['ts_project'])) $data['ts_project'] = $data['ts_project_blur'];
$this->set_record($data);
}
}
/**

View File

@ -1133,9 +1133,9 @@ class timesheet_ui extends timesheet_bo
$cat_name = Api\Categories::id2name($settings);
$action_msg = lang('changed category to %1', $cat_name);
foreach((array)$checked as $n => $id) {
$entry = $this->read($id);
$entry['cat_id'] = $settings;
if($this->save($entry) == 0)
if (($entry = $this->read($id)) &&
($entry['cat_id'] = $settings) &&
$this->save($entry) == 0)
{
$success++;
}