make home a regular application, which can eg. disabled, incl. moving all services using "home" as appname to "api" and moved some other forgotten stuff from phpgwapi&etemplate to api

This commit is contained in:
Ralf Becker 2016-05-01 09:57:48 +00:00
parent fa9cd4766f
commit 429177686a
86 changed files with 194 additions and 168 deletions

View File

@ -267,7 +267,7 @@ var et2_selectAccount = (function(){ "use strict"; return et2_selectbox.extend(
if(!found && !isNaN(search[j]))
{
// Add it in
var name = this.egw().link_title('home-accounts', search[j]);
var name = this.egw().link_title('api-accounts', search[j]);
if (name) // was already cached on client-side
{
update_options = true;
@ -278,7 +278,7 @@ var et2_selectAccount = (function(){ "use strict"; return et2_selectbox.extend(
++num_calls;
// Add immediately with value as label, we'll replace later
this._appendOptionElement(search[j],search[j]);
this.egw().link_title('home-accounts', search[j], function(name)
this.egw().link_title('api-accounts', search[j], function(name)
{
if (++current_call >= num_calls) // only run last callback
{
@ -463,7 +463,7 @@ var et2_selectAccount = (function(){ "use strict"; return et2_selectbox.extend(
var search = this.search = jQuery(document.createElement("div"));
var search_widget = this.search_widget = et2_createWidget('link-entry', {
'only_app': 'home-accounts',
'only_app': 'api-accounts',
'query': function(request, response) {
// Clear previous search results for multi-select
if(!request.options)
@ -639,7 +639,7 @@ var et2_selectAccount = (function(){ "use strict"; return et2_selectbox.extend(
.addClass("loading")
.appendTo(node);
this.egw().link_title('home-accounts', item.value, function(name) {
this.egw().link_title('api-accounts', item.value, function(name) {
label.text(name).removeClass("loading");
}, label);
@ -721,7 +721,7 @@ var et2_selectAccount = (function(){ "use strict"; return et2_selectbox.extend(
var label = jQuery(document.createElement('label'))
.addClass("loading")
.appendTo(option);
this.egw().link_title('home-accounts', value, function(name) {this.text(name).removeClass("loading");}, label);
this.egw().link_title('api-accounts', value, function(name) {this.text(name).removeClass("loading");}, label);
},
/**
@ -790,7 +790,7 @@ var et2_selectAccount_ro = (function(){ "use strict"; return et2_link_string.ext
}
}
this.options.application = 'home-accounts';
this.options.application = 'api-accounts';
// Editable version allows app to set options that aren't accounts, so allow for them
var options = et2_selectbox.find_select_options(this,options['select_options']);

View File

@ -980,7 +980,7 @@ var et2_taglist_account = (function(){ "use strict"; return et2_taglist.extend(
else if (typeof v != 'object' && !isNaN(v) && (typeof v != 'string' || v.match(this.int_reg_exp)))
{
v = parseInt(v);
var label = this.egw().link_title('home-accounts', v);
var label = this.egw().link_title('api-accounts', v);
if (label) // already cached on client-side --> replace it
{
values[i] = {
@ -991,7 +991,7 @@ var et2_taglist_account = (function(){ "use strict"; return et2_taglist.extend(
else if (!this.deferred_loading) // call set_value again, after result has arrived from server
{
this.deferred_loading++;
this.egw().link_title('home-accounts', v, function(label) {
this.egw().link_title('api-accounts', v, function(label) {
this.deferred_loading--;
if (label) this.set_value(values);
}, this);

View File

@ -82,7 +82,7 @@ function etemplate2(_container, _menuaction)
{
if (typeof _menuaction == "undefined")
{
_menuaction = "home.etemplate_new.ajax_process_content.etemplate";
_menuaction = "EGroupware\\Api\\Etemplate::ajax_process_content";
}
// Copy the given parameters
@ -1083,7 +1083,7 @@ function etemplate2_handle_load(_type, _response)
// Check the parameters
var data = _response.data;
// handle egw_framework::refresh_opener()
// handle Api\Framework::refresh_opener()
if (jQuery.isArray(data['refresh-opener']))
{
if (window.opener)// && typeof window.opener.egw_refresh == 'function')
@ -1101,13 +1101,13 @@ function etemplate2_handle_load(_type, _response)
delete data.data.app_header;
}
// handle egw_framework::message()
// handle Api\Framework::message()
if (jQuery.isArray(data.message))
{
egw.message.apply(egw, data.message);
}
// handle egw_framework::window_close(), this will terminate execution
// handle Api\Framework::window_close(), this will terminate execution
if (data['window-close'])
{
if (typeof data['window-close'] == 'string' && data['window-close'] !== 'true')
@ -1118,7 +1118,7 @@ function etemplate2_handle_load(_type, _response)
return true;
}
// handle egw_framework::window_focus()
// handle Api\Framework::window_focus()
if (data['window-focus'])
{
window.focus();

View File

@ -415,7 +415,7 @@ var fw_base = (function(){ "use strict"; return Class.extend(
{
this.serializedTabState = serialized;
egw.jsonq("home.jdots_framework.ajax_tab_changed_state", [data]);
egw.jsonq("api.jdots_framework.ajax_tab_changed_state", [data]);
}
},
@ -857,7 +857,7 @@ var fw_base = (function(){ "use strict"; return Class.extend(
tzSelection: function(_tz)
{
//Perform an AJAX request to tell server
var req = egw.json('home.jdots_framework.ajax_tz_selection.template',[_tz],null,null,false); // false = synchron
var req = egw.json('api.jdots_framework.ajax_tz_selection.template',[_tz],null,null,false); // false = synchron
req.sendRequest();
if (this.activeApp.browser)

View File

@ -302,7 +302,7 @@
}
//Send the sort order to the server via ajax
var req = egw.jsonq('home.jdots_framework.ajax_appsort', [name_array]);
var req = egw.jsonq('api.jdots_framework.ajax_appsort', [name_array]);
},
/**

View File

@ -764,7 +764,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
if(typeof self.favorite_popup.group != "undefined" && self.favorite_popup.group.getValue() != '')
{
// Admin stuff - save preference server side
self.egw.jsonq(self.appname+'.egw_framework.ajax_set_favorite.template',
self.egw.jsonq('EGroupware\\Api\\Framework::ajax_set_favorite',
[
self.appname,
name.val(),
@ -874,7 +874,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
$j(trash).hide();
// Delete preference server side
var request = egw.json(app.appname + ".egw_framework.ajax_set_favorite.template",
var request = egw.json("EGroupware\\Api\\Framework::ajax_set_favorite",
[app.appname, id, "delete", group, ''],
function(result) {
// Got the full response from callback, which we don't want
@ -1117,15 +1117,15 @@ var AppJS = (function(){ "use strict"; return Class.extend(
{
var resolve = _resolve;
var reject = _reject;
self.egw.json('home.home_tutorial_ui.ajax_data', [self.egw.app_name()], function(_data){
resolve(_data);
self.egw.json('EGroupware\\Api\\Framework\\Tutorial::ajax_data', [self.egw.app_name()], function(_data){
resolve(_data);
}).sendRequest();
});
},
/**
* Create and Render etemplate2 for egroupware tutorial
* sidebox option. The .xet file is stored in etemplate/templates/default/egw_tutorials
* sidebox option. The .xet file is stored in api/templates/default/egw_tutorials
*
* @description tutorials json object should have the following structure:
* object:
@ -1159,7 +1159,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
{
// et2 object
var etemplate = new etemplate2 (div, false);
var template = egw.webserverUrl+'/etemplate/templates/default/egw_tutorial.xet?1';
var template = egw.webserverUrl+'/api/templates/default/egw_tutorial.xet?1';
this.egwTutorialGetData().then(function(_data){
var lang = egw.preference('lang');
@ -1200,10 +1200,39 @@ var AppJS = (function(){ "use strict"; return Class.extend(
*/
egwTutorialPopup: function (_tuid)
{
var url = egw.link('/index.php', 'menuaction=home.home_tutorial_ui.popup&tuid='+_tuid);
var url = egw.link('/index.php', 'menuaction=api.EGroupware\\Api\\Framework\\Tutorial.popup&tuid='+_tuid);
egw.open_link(url,'_blank','960x580');
},
/**
* Function to set video iframe base on selected tutorial from tutorials box
*
* @param {string} _url
*/
tutorial_videoOnClick: function (_url)
{
var frame = etemplate2.getByApplication('api')[0].widgetContainer.getWidgetById('src');
if (frame)
{
frame.set_value(_url);
}
},
/**
* Function calls on discard checkbox and will set
* the egw_tutorial_noautoload preference
*
* @param {type} egw
* @param {type} widget
*/
tutorial_autoloadDiscard: function (egw, widget)
{
if (widget)
{
this.egw.set_preference('common', 'egw_tutorial_noautoload', widget.get_value());
}
},
/**
* Check if Mailvelope is available, open (or create) "egroupware" keyring and call callback with it
*
@ -1257,7 +1286,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
downloadSync: function(_downloadObj)
{
return new Promise(function(_resolve,_reject){});
},
},
/**
* function called by Mailvelope to upload an encrypted private key backup
@ -1492,7 +1521,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
menu:_content
}
},
template: egw.webserverUrl+'/etemplate/templates/default/pgp_backup_restore.xet',
template: egw.webserverUrl+'/api/templates/default/pgp_backup_restore.xet',
class: "pgp_backup_restore",
modal:true
});
@ -1546,7 +1575,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
value: {
content: _content
},
template: egw.webserverUrl+'/etemplate/templates/default/pgp_installation.xet',
template: egw.webserverUrl+'/api/templates/default/pgp_installation.xet',
class: "pgp_installation",
modal: true
//resizable:false,

View File

@ -381,7 +381,7 @@
/**
* Creates the egw object --- if the egw object should be created, some data
* has already been set inside the object by the egw_framework::header
* has already been set inside the object by the Api\Framework::header
* function and the instance has been marked as "prefsOnly".
*/
if (typeof window.egw != "undefined" && window.egw.prefsOnly)

View File

@ -105,8 +105,7 @@ egw.extend('jsonq', egw.MODULE_GLOBAL, function()
}
if (something_to_send)
{
// TODO: Passing this to the "home" application looks quite ugly
var request = egw.json('home.queue', jobs_to_send, jsonq_callback, this);
var request = egw.json('api.queue', jobs_to_send, jsonq_callback, this);
request.sendRequest(true);
}
}

View File

@ -65,7 +65,7 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function()
if (typeof prefs[_app] == 'undefined')
{
var request = this.json('home.egw_framework.ajax_get_preference.template', [_app], _callback, _context);
var request = this.json('EGroupware\\Api\\Framework::ajax_get_preference', [_app], _callback, _context);
request.sendRequest(typeof _callback == 'function', 'GET'); // use synchronous (cachable) GET request
if (typeof prefs[_app] == 'undefined') prefs[_app] = {};
if (typeof _callback == 'function') return false;
@ -91,7 +91,7 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function()
// if there is no change, no need to submit it to server
if (typeof prefs[_app] != 'undefined' && prefs[_app][_name] === _val) return;
this.jsonq('home.egw_framework.ajax_set_preference.template',[_app, _name, _val], _callback);
this.jsonq('EGroupware\\Api\\Framework::ajax_set_preference',[_app, _name, _val], _callback);
// update own preference cache, if _app prefs are loaded (dont update otherwise, as it would block loading of other _app prefs!)
if (typeof prefs[_app] != 'undefined')

View File

@ -100,7 +100,7 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
if(jQuery.isEmptyObject(accountStore))
{
// Synchronous
egw.json('home.egw_framework.ajax_user_list.template',[],
egw.json('EGroupware\\Api\\Framework::ajax_user_list',[],
function(data) {
accountStore = jQuery.extend(true, {}, data||{});
}
@ -166,7 +166,7 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
// something not found in cache --> ask server
if (_account_ids.length)
{
egw.json('home.egw_framework.ajax_account_data.template',[_account_ids, _field, _resolve_groups],
egw.json('EGroupware\\Api\\Framework::ajax_account_data',[_account_ids, _field, _resolve_groups],
function(_data) {
for(var account_id in _data)
{
@ -229,7 +229,7 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
}
else
{
this.link_title('home-accounts', _id, function(_label)
this.link_title('api-accounts', _id, function(_label)
{
store[i].label = _label;
if (_id < 0)

View File

@ -399,7 +399,7 @@ hold [%1] and [%2] key to drag %3 to your desktop common de [%1] und [%2] Tasten
holy see (vatican city state) common de VATICAN
home common de Home
home email common de private E-Mail
home-accounts common de Benutzerkonten
api-accounts common de Benutzerkonten
honduras common de HONDURAS
hong kong common de HONG KONG
how many days to sync in the future (default %1) groupdav de Wie viele Tage soll in die Zukunft gesynced werden (Vorgabe %1)

View File

@ -399,7 +399,7 @@ hold [%1] and [%2] key to drag %3 to your desktop common en Hold [%1] and [%2] k
holy see (vatican city state) common en HOLY SEE (VATICAN CITY STATE)
home common en Home
home email common en Home email
home-accounts common en User accounts
api-accounts common en User accounts
honduras common en HONDURAS
hong kong common en HONG KONG
how many days to sync in the future (default %1) groupdav en How many days to sync in the future (default %1)

View File

@ -399,7 +399,7 @@ hold [%1] and [%2] key to drag %3 to your desktop common it Premere [%1] e [%2]
holy see (vatican city state) common it SANTA SEDE (STATO DI CITTA' DEL VATICANO)
home common it Home
home email common it e-mail abitazione
home-accounts common it Account utenti
api-accounts common it Account utenti
honduras common it HONDURAS
hong kong common it HONG KONG
how many days to sync in the future (default %1) groupdav it Quanti giorni nel futuro sincronizzare (predefinito %1)

View File

@ -380,7 +380,7 @@ hold [%1] and [%2] key to drag %3 to your desktop common nl Houd [%1] en [%2] to
holy see (vatican city state) common nl VATICAANSTAD
home common nl Start
home email common nl email thuis
home-accounts common nl Gebruiker accounts
api-accounts common nl Gebruiker accounts
honduras common nl HONDURAS
hong kong common nl HONG KONG
how many days to sync in the future (default %1) groupdav nl Hoeveel dagen om te synchroniseren in de toekomst (Standaard %1)

View File

@ -391,7 +391,7 @@ hold [%1] and [%2] key to drag %3 to your desktop common sk Ak chcete premiestni
holy see (vatican city state) common sk VATIKÁN (MESTSKÝ ŠTÁT)
home common sk Domov
home email common sk Domáci E-mail
home-accounts common sk Používateľské účty
api-accounts common sk Používateľské účty
honduras common sk HONDURAS
hong kong common sk HONG KONG
how many days to sync in the future (default %1) groupdav sk Koľko dní do budúcnosti synchronizovať (predvolené %1)

View File

@ -59,6 +59,7 @@ $setup_info['api']['hooks']['addgroup'] = 'EGroupware\\Api\\Vfs\\Hooks::ad
$setup_info['api']['hooks']['deletegroup'] = array('EGroupware\\Api\\Vfs\\Hooks::deleteGroup', 'EGroupware\\Api\\Mail\\Hooks::deletegroup');
$setup_info['api']['hooks']['editgroup'] = 'EGroupware\\Api\\Vfs\\Hooks::editGroup';
$setup_info['api']['hooks']['changepassword'] = 'EGroupware\\Api\\Mail\\Hooks::changepassword';
$setup_info['api']['hooks']['sidebox_all'] = 'EGroupware\\Api\\Framework\\Tutorial::tutorial_menu';
// installation checks
$setup_info['api']['check_install'] = array(

View File

@ -181,9 +181,9 @@ $phpgw_baseline = array(
'fd' => array(
'link_id' => array('type' => 'auto','nullable' => False),
'link_app1' => array('type' => 'ascii','precision' => '16','nullable' => False),
'link_id1' => array('type' => 'ascii','meta' => array("link_app1='home-accounts'" => 'account'),'precision' => '64','nullable' => False),
'link_id1' => array('type' => 'ascii','meta' => array("link_app1='api-accounts'" => 'account'),'precision' => '64','nullable' => False),
'link_app2' => array('type' => 'ascii','precision' => '16','nullable' => False),
'link_id2' => array('type' => 'ascii','meta' => array("link_app2='home-accounts'" => 'account'),'precision' => '64','nullable' => False),
'link_id2' => array('type' => 'ascii','meta' => array("link_app2='api-accounts'" => 'account'),'precision' => '64','nullable' => False),
'link_remark' => array('type' => 'varchar','precision' => '100'),
'link_lastmod' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False),
'link_owner' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False),

View File

@ -631,7 +631,7 @@ class Acl
}
if ($add_implicit_apps)
{
$apps['home'] = 1; // give everyone implicit rights for the home app
$apps['api'] = 1; // give everyone implicit rights for the home app
}
return $apps;
}

View File

@ -357,7 +357,7 @@ class Egw extends Egw\Base
{
$this->currentapp = $GLOBALS['egw_info']['flags']['currentapp']; // some apps change it later
if (!in_array($GLOBALS['egw_info']['flags']['currentapp'], array('api', 'home'))) // give everyone implicit home rights
if ($GLOBALS['egw_info']['flags']['currentapp'] != 'api') // give everyone implicit api rights
{
// This will need to use ACL in the future
if (!$GLOBALS['egw_info']['user']['apps'][$currentapp = $GLOBALS['egw_info']['flags']['currentapp']] ||

View File

@ -829,7 +829,7 @@ abstract class Framework extends Framework\Extra
$debug_minify = $GLOBALS['egw_info']['server']['debug_minify'] === 'True';
if (!$debug_minify && file_exists(EGW_SERVER_ROOT.($theme_min_css = str_replace('.css', '.min.css', $theme_css))))
{
error_log(__METHOD__."() Framework\CssIncludes::get()=".array2string(Framework\CssIncludes::get()));
//error_log(__METHOD__."() Framework\CssIncludes::get()=".array2string(Framework\CssIncludes::get()));
self::includeCSS($theme_min_css);
}
else

View File

@ -3,18 +3,20 @@
* EGroupware - Tutorial
*
* @link http://www.egroupware.org
* @package home
* @package api
* @subpackage framework
* @author Hadi Nategh [hn@stylite.de]
* @copyright (c) 2015 by Stylite AG <info-AT-stylite.de>
* @copyright (c) 2015-16 by Stylite AG <info-AT-stylite.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
namespace EGroupware\Api\Framework;
use EGroupware\Api;
use EGroupware\Api\Framework;
use EGroupware\Api\Etemplate;
class home_tutorial_ui
class Tutorial
{
/**
* Methods callable via menuaction
@ -33,8 +35,8 @@ class home_tutorial_ui
function popup ($content=null)
{
// check and if not done register tutorial_menu hook
if (!EGroupware\Api\Hooks::exists('sidebox_all', 'home') ||
EGroupware\Api\Hooks::exists('sidebox_all', 'home', true) != 'home_tutorial_ui::tutorial_menu')
if (!Api\Hooks::exists('sidebox_all', 'api') ||
Api\Hooks::exists('sidebox_all', 'api', true) != 'EGroupware\\Api\\Framework\\Tutorial::tutorial_menu')
{
Api\Hooks::read(true);
}
@ -42,7 +44,7 @@ class home_tutorial_ui
//Allow youtube frame to pass the CSP check
Api\Header\ContentSecurityPolicy::add('frame-src', array('https://www.youtube.com'));
$tmpl = new Etemplate('home.tutorial');
$tmpl = new Etemplate('api.tutorial');
if (!is_array($content))
{
// Get tutorial object id
@ -81,7 +83,7 @@ class home_tutorial_ui
);
foreach (isset($tutorials[$appName][$lang]) ? $tutorials[$appName][$lang] : $tutorials[$appName]['en'] as $v)
{
$v ['onclick'] = 'app.home.tutorial_videoOnClick("'.$v['src'].'")';
$v ['onclick'] = 'app[egw.app_name()].tutorial_videoOnClick("'.$v['src'].'")';
array_push($list, $v);
}
$content = array (
@ -94,16 +96,16 @@ class home_tutorial_ui
else
{
$content = array();
Framework::message(lang('You do not have permission to see this tutorial!'));
Api\Framework::message(lang('You do not have permission to see this tutorial!'));
}
$tmpl->exec('home.home_tutorial_ui.popup', $content, $sel_options, array(), array(), 2);
$tmpl->exec('api.EGroupware\\Api\\Framework\\Tutorial.popup', $content, $sel_options, array(), array(), 2);
}
/**
* Ajax function to get videos links as json
*/
function ajax_data()
public static function ajax_data()
{
$response = Api\Json\Response::get();
$response->data(json_decode(self::getJsonData()));
@ -116,13 +118,13 @@ class home_tutorial_ui
*/
static function getJsonData()
{
if (!($json = Api\Cache::getCache(Api\Cache::TREE, 'home', 'egw_tutorial_json')))
if (!($json = Api\Cache::getCache(Api\Cache::TREE, __CLASS__, 'egw_tutorial_json')))
{
$json = file_get_contents('http://www.egroupware.de/videos/tutorials.json');
// Fallback tutorials.json
if (!$json) $json = file_get_contents('home/setup/tutorials.json');
if (!$json) $json = file_get_contents('api/setup/tutorials.json');
// Cache the json object for two hours
Api\Cache::setCache(Api\Cache::TREE, 'home', 'egw_tutorial_json', $json, 7200);
Api\Cache::setCache(Api\Cache::TREE, __CLASS__, 'egw_tutorial_json', $json, 7200);
}
return $json;

View File

@ -50,7 +50,7 @@ class Request
* Parses the raw input data supplied with the input_data parameter and calls the menuaction
* passing all parameters supplied in the request to it.
*
* Also handle queued requests (menuaction == 'home.queue') containing multiple requests
* Also handle queued requests (menuaction == 'api.queue') containing multiple requests
*
* @param string menuaction to call
* @param string $input_data is the RAW input data as it was received from the client
@ -73,7 +73,7 @@ class Request
$parameters = array();
}
// do we have a single request or an array of queued requests
if ($menuaction == 'home.queue')
if ($menuaction == 'api.queue')
{
$responses = array();
$response = Response::get();

View File

@ -140,7 +140,7 @@ class Link extends Link\Storage
* @var array
*/
static $app_register = array(
'home-accounts' => array( // user need run-rights for home
'api-accounts' => array( // user need run-rights for home
'app' => 'home',
'name' => 'Accounts',
'icon' => 'addressbook/accounts',
@ -243,7 +243,7 @@ class Link extends Link\Storage
if ($GLOBALS['egw_info']['user']['preferences']['common']['account_selection'] == 'none' &&
!isset($GLOBALS['egw_info']['user']['apps']['admin']))
{
unset(self::$app_register['home-accounts']);
unset(self::$app_register['api-accounts']);
}
if (!(self::$title_cache = Cache::getSession(__CLASS__, 'link_title_cache')))
{

View File

@ -518,7 +518,7 @@ class Customfields implements \IteratorAggregate
{
foreach($cfs as $name => $data)
{
if ($data['type'] == 'select-account' || $data['type'] == 'home-accounts')
if ($data['type'] == 'select-account' || $data['type'] == 'api-accounts')
{
$types['account'.($data['rows'] > 1 ? '-commasep' : '')][] = $name;
}

View File

@ -1368,9 +1368,9 @@ abstract class Merge
{
$field_app = $cfs[$field]['type'];
}
else if ($cfs[$field]['type'] == 'home-accounts' || $cfs[$field]['type'] == 'select-account')
else if ($cfs[$field]['type'] == 'api-accounts' || $cfs[$field]['type'] == 'select-account')
{
// Special case for home-accounts -> contact
// Special case for api-accounts -> contact
$field_app = 'addressbook';
$account = $GLOBALS['egw']->accounts->read($values['#'.$field]);
$app_replacements[$field] = $this->contact_replacements($account['person_id']);

View File

@ -2,7 +2,7 @@
<!DOCTYPE overlay PUBLIC "-//Stylite AG//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd">
<!-- $Id$ -->
<overlay>
<template id="home.tutorial" template="" lang="" group="0" version="15.1">
<template id="api.tutorial" template="" lang="" group="0" version="15.1">
<grid height="100%" width="100%">
<columns>
<column width="100%"/>
@ -37,10 +37,10 @@
<hbox class="tutorial_iframe_wrapper">
<iframe id="src" height="100%" seamless="true" width="100%" fullscreen="true"/>
</hbox>
</hbox>
</hbox>
</row>
<!-- This row needs to be here in order to keep footer always at bottom when we resize the window -->
<row>
<row>
<grid resize_ratio="1">
<columns>
<column/>
@ -56,7 +56,7 @@
<hbox span="all">
<button align="left" statustext="Close this window" label="Close" id="button[close]" onclick="window.close()" image="close" background_image="1"/>
</hbox>
</row>
</row>
</rows>
</grid>
</template>

View File

@ -251,7 +251,7 @@ class calendar_bo
);
$this->resources[''] = array(
'type' => '',
'app' => 'home-accounts',
'app' => 'api-accounts',
);
$GLOBALS['egw']->session->appsession('resources','calendar',$this->resources);
}

View File

@ -861,4 +861,4 @@ function calendar_purge_old($config)
$GLOBALS['config_error'] = 'Unable to schedule purge';
}
}
}
}

View File

@ -260,7 +260,7 @@ class calendar_merge extends bo_merge
foreach($event['participants'] as $uid => $status)
{
$type = $this->bo->resources[$uid[0]]['app'];
if($type == 'home-accounts')
if($type == 'api-accounts')
{
$type = ($GLOBALS['egw']->accounts->get_type($uid) == 'g' ? 'group' : 'account');
}

View File

@ -30,7 +30,7 @@ class calendar_owner_etemplate_widget extends etemplate_widget_taglist
egw_framework::validate_file('.','et2_widget_owner','calendar');
egw_framework::includeCSS('calendar');
$bo = new calendar_bo();
$form_name = self::form_name($cname, $this->id, $expand);
@ -62,7 +62,7 @@ class calendar_owner_etemplate_widget extends etemplate_widget_taglist
return array(
'value' => ''.$account_id,
'label' => $account_name,
'app' => lang('home-accounts')
'app' => lang('api-accounts')
);
},
array_keys($accounts), $accounts
@ -82,8 +82,8 @@ class calendar_owner_etemplate_widget extends etemplate_widget_taglist
}
else if (!in_array($owner, array_keys($accounts)))
{
$label = egw_link::title('home-accounts',$owner);
$resource = array('app'=> 'home-accounts');
$label = egw_link::title('api-accounts',$owner);
$resource = array('app'=> 'api-accounts');
}
else
{
@ -112,7 +112,7 @@ class calendar_owner_etemplate_widget extends etemplate_widget_taglist
{
$value = Array($value);
}
$valid =& self::get_array($validated, $form_name, true);
$valid = $value;
}

View File

@ -231,7 +231,7 @@ class calendar_uiforms extends calendar_ui
notifications::errors(true);
$messages = null;
$msg_permission_denied_added = false;
// We'd like to just refresh the data as that's the fastest, but some changes
// affect more than just one event widget, so require a full refresh.
// $update_type is one of the update types
@ -693,7 +693,7 @@ class calendar_uiforms extends calendar_ui
unset($recur_event['start']); unset($recur_event['end']); // no update necessary
unset($recur_event['alarm']); // unsetting alarms too, as they cant be updated without start!
$this->bo->update($recur_event,true); // no conflict check here
unset($recur_event);
unset($event['edit_single']); // if we further edit it, it's just a single event
unset($preserv['edit_single']);
@ -780,7 +780,7 @@ class calendar_uiforms extends calendar_ui
$event['button_was'] = $button; // remember for ignore
return $this->conflicts($event,$conflicts,$preserv);
}
// Event spans multiple days, need an edit to make sure they all get updated
// We could check old date, as removing from days could still be an update
if(date('Ymd', $event['start']) != date('Ymd', $event['end']))
@ -1074,7 +1074,7 @@ class calendar_uiforms extends calendar_ui
}
//error_log(__METHOD__ . egw_time::to($old_event['start']) . ' -> '. egw_time::to($event['start']) . ' as of ' . egw_time::to($as_of_date));
if(!($next_occurrence = $this->bo->read($event['id'], $this->bo->now_su + 1, true)))
{
$msg = lang("Error: You can't shift a series from the past!");
@ -1087,7 +1087,7 @@ class calendar_uiforms extends calendar_ui
$offset = $event['start'] - $old_event['start'];
$duration = $event['duration'] ? $event['duration'] : $event['end'] - $event['start'];
// base start-date of new series on actual / clicked date
$event['start'] = $as_of_date ;
@ -1096,7 +1096,7 @@ class calendar_uiforms extends calendar_ui
egw_time::to($as_of_date,'ts') < time()
)
{
unset($orig_event);
// copy event by unsetting the id(s)
unset($event['id']);
@ -2554,7 +2554,7 @@ class calendar_uiforms extends calendar_ui
{
list($eventId, $date) = explode(':', $_eventId,2);
$ignore_conflicts = false;
// we do not allow dragging into another users calendar ATM
if($targetOwner < 0)
{
@ -2608,7 +2608,7 @@ class calendar_uiforms extends calendar_ui
// For DnD, create an exception if they gave the date
$this->_create_exception($event,$preserv);
unset($event['id']);
$conflicts = $this->bo->update($event,false,true,false,true,$messages);
if (!is_array($conflicts) && $conflicts)
{
@ -2637,7 +2637,7 @@ class calendar_uiforms extends calendar_ui
$offset = egw_time::to($targetDateTime,'ts') - egw_time::to($seriesInstance,'ts');
$event['start'] = $old_event['start'] + $offset;
$event['duration'] = $duration;
// We have a recurring event starting in the past -
// stop it & create a new one.
$this->_break_recurring($event, $old_event, $this->bo->date2ts($targetDateTime));
@ -2695,7 +2695,7 @@ class calendar_uiforms extends calendar_ui
$message = false;
$conflicts=$this->bo->update($event,$ignore_conflicts, true, false, true, $message);
$this->update_client($event['id'],$d);
$response = egw_json_response::get();
if(!is_array($conflicts) && $conflicts)

View File

@ -1359,7 +1359,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
this.set_end_date(day_list[day_list.length-1]);
}
// Sub widgets actually get their own data from egw.data, so we'll
// stick it there
var consolidated = et2_calendar_view.is_consolidated(this.options.owner, this.day_list.length == 1 ? 'day' : 'week');
@ -1438,7 +1438,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
}
else
{
this.owner.options.application = 'home-accounts';
this.owner.options.application = 'api-accounts';
this.owner.set_value(typeof _owner == "string" || typeof _owner == "number" ? _owner : jQuery.extend([],_owner));
this.set_label('');
$j(this.getDOMNode(this.owner)).prepend(this.owner.getDOMNode());
@ -1699,7 +1699,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
x = Math.round(x);
y = Math.round(y);
var path = [];
var day = null;
var time = null;

View File

@ -168,7 +168,7 @@ class filemanager_select
case 'select-dir':
$files = $content['path'];
break;
case 'saveas':
// Don't trust the name the user gives, encode it
$content['name'] = egw_vfs::encodePathComponent($content['name']);
@ -346,7 +346,7 @@ class filemanager_select
unset($apps['mydms']); // they do NOT support adding files to VFS
unset($apps['wiki']);
unset($apps['home-accounts']);
unset($apps['api-accounts']);
unset($apps['addressbook-email']);
return $apps;

View File

@ -746,36 +746,6 @@ app.classes.home = (function(){ "use strict"; return AppJS.extend(
nm.div.toggleClass('header_hidden');
nm.set_hide_header(nm.div.hasClass('header_hidden'));
nm.resize();
},
/**
* Function to set video iframe base on selected tutorial from
* tutorials box
*
* @param {type} url
*/
tutorial_videoOnClick: function (_url)
{
var frame = etemplate2.getByApplication('home')[0].widgetContainer.getWidgetById('src');
if (frame)
{
frame.set_value(_url);
}
},
/**
* Function calls on discard checkbox and will set
* the egw_tutorial_noautoload preference
*
* @param {type} egw
* @param {type} widget
*/
tutorial_autoloadDiscard: function (egw, widget)
{
if (widget)
{
this.egw.set_preference('common', 'egw_tutorial_noautoload', widget.get_value());
}
}
})}).call(this);

View File

@ -11,24 +11,21 @@
/* Basic information about this app */
$setup_info['home']['name'] = 'home';
$setup_info['home']['title'] = 'Home';
$setup_info['home']['version'] = '14.1.001';
$setup_info['home']['version'] = '16.1';
$setup_info['home']['app_order'] = 1;
$setup_info['home']['enable'] = 1;
$setup_info['home']['index'] = 'home.home_ui.index&ajax=true';
$setup_info['home']['author'] = 'eGroupWare Core Team';
$setup_info['home']['license'] = 'GPL';
$setup_info['home']['description'] = 'Displays eGroupWare\' homepage';
$setup_info['home']['description'] = 'Displays EGroupware\' homepage';
$setup_info['home']['maintainer'] = array(
'name' => 'eGroupWare Developers',
'email' => 'egroupware-developers@lists.sourceforge.net'
);
/* The hooks this app includes, needed for hooks registration */
$setup_info['home']['hooks']['sidebox_all'] = 'home_tutorial_ui::tutorial_menu';
/* Dependencies for this app to work */
$setup_info['home']['depends'][] = array(
'appname' => 'phpgwapi',
'versions' => Array('14.1')
'appname' => 'api',
'versions' => Array('16.1')
);

View File

@ -83,3 +83,30 @@ function home_upgrade14_1()
return $GLOBALS['setup_info']['home']['currentver'] = '14.1.001';
}
/**
* Update to 16.1: rename "home-accounts" to "api-accounts" and give everyone updating home run-rights
*
* @return string
*/
function home_upgrade14_1_001()
{
// rename "home-accounts" to "api-accounts"
foreach(array('link_app1', 'link_app2') as $col)
{
$GLOBALS['egw_setup']->db->update('egw_links', array(
$col => 'api-accounts',
),
array(
$col => 'home-accounts',
), __LINE__, __FILE__);
}
// give Default group run-rights for home, as it is no longer implicit
$GLOBALS['egw_setup']->setup_account_object();
if (($defaultgroup = $GLOBALS['egw_setup']->accounts->name2id('Default', 'account_lid', 'g')))
{
$GLOBALS['egw_setup']->add_acl('home', 'run', $defaultgroup);
}
return $GLOBALS['setup_info']['home']['currentver'] = '16.1';
}

View File

@ -2,7 +2,7 @@
/**
* EGroupware index page
*
* Starts all applications using $_GET[menuaction]
* Starts all Egw\Applications using $_GET[menuaction]
*
* @link http://www.egroupware.org
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
@ -10,6 +10,10 @@
* @version $Id$
*/
use EGroupware\Api;
use EGroupware\Api\Framework;
use EGroupware\Api\Egw;
// support of Mac or iPhone trying to autodetect CalDAV or CardDAV support
// if EGroupware is not installed in the docroot, you need either this code in the index.php there,
// or an uncoditional redirect to this file or copy groupdav.htaccess to your docroot as .htaccess
@ -55,13 +59,13 @@ if(isset($_GET['menuaction']) && preg_match('/^[A-Za-z0-9_]+\.[A-Za-z0-9_\\\\]+\
}
else
{
$app = 'home';
$app = 'api';
$invalid_data = True;
}
//error_log(__METHOD__."$app,$class,$method");
if($app == 'phpgwapi')
{
$app = 'home';
$app = 'api';
$api_requested = True;
}
@ -77,14 +81,14 @@ include('./header.inc.php');
// user changed timezone
if (isset($_GET['tz']))
{
egw_time::setUserPrefs($_GET['tz']); // throws exception, if tz is invalid
Api\DateTime::setUserPrefs($_GET['tz']); // throws exception, if tz is invalid
$GLOBALS['egw']->preferences->add('common','tz',$_GET['tz']);
$GLOBALS['egw']->preferences->save_repository();
if (($referer = common::get_referer()))
{
egw::redirect_link($referer);
Egw::redirect_link($referer);
}
}
@ -105,7 +109,7 @@ if(@file_exists($tpl_info))
}
if($app == 'home' && !$class && !$api_requested && !($windowed && $_GET['cd'] == 'yes' && !html::$ua_mobile) && $GLOBALS['egw_info']['user']['preferences']['common']['template_set'] == 'idots')
if($app == 'api' && !$class && !$api_requested && !($windowed && $_GET['cd'] == 'yes' && !Api\Header\UserAgent::mobile()) && $GLOBALS['egw_info']['user']['preferences']['common']['template_set'] == 'idots')
{
if ($GLOBALS['egw_info']['server']['force_default_app'] && $GLOBALS['egw_info']['server']['force_default_app'] != 'user_choice')
{
@ -113,11 +117,11 @@ if($app == 'home' && !$class && !$api_requested && !($windowed && $_GET['cd'] ==
}
if($GLOBALS['egw_info']['user']['preferences']['common']['default_app'] && !$hasupdates)
{
egw::redirect(egw_framework::index($GLOBALS['egw_info']['user']['preferences']['common']['default_app']),$GLOBALS['egw_info']['user']['preferences']['common']['default_app']);
Egw::redirect(Framework::index($GLOBALS['egw_info']['user']['preferences']['common']['default_app']),$GLOBALS['egw_info']['user']['preferences']['common']['default_app']);
}
else
{
egw::redirect_link('/home/index.php?cd=yes');
Egw::redirect_link('/home/index.php?cd=yes');
}
}
@ -128,8 +132,8 @@ if($windowed && $_GET['cd'] == 'yes')
'nonavbar' => False,
'currentapp' => 'eGroupWare'
);
common::egw_header();
common::egw_footer();
$GLOBALS['egw']->framework->header();
$GLOBALS['egw']->framework->footer();
}
else
{
@ -192,6 +196,6 @@ else
if(!isset($GLOBALS['egw_info']['nofooter']))
{
common::egw_footer();
$GLOBALS['egw']->framework->footer();
}
}

View File

@ -11,6 +11,7 @@
*/
use EGroupware\Api;
use EGroupware\Api\Egw;
use EGroupware\Api\Json;
/**
@ -27,11 +28,11 @@ function login_redirect(&$anon_account)
{
return $session_id;
}
Json\Request::isJSONRequest(true); // because egw_json_request::parseRequest() is not (yet) called
Json\Request::isJSONRequest(true); // because Api\Json\Request::parseRequest() is not (yet) called
$response = Json\Response::get();
$response->redirect($GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=10', true);
common::egw_exit();
exit();
}
/**
@ -46,7 +47,7 @@ function ajax_exception_handler($e)
// handle redirects without logging
if (is_a($e, 'egw_exception_redirect'))
{
egw::redirect($e->url, $e->app);
Egw::redirect($e->url, $e->app);
}
// logging all exceptions to the error_log
$message = null;
@ -64,10 +65,6 @@ function ajax_exception_handler($e)
}
$response->alert($message);
if (is_object($GLOBALS['egw']))
{
common::egw_exit();
}
exit;
}
@ -121,7 +118,7 @@ if (isset($_GET['menuaction']))
}
$json->parseRequest($_GET['menuaction'], $_REQUEST['json_data']);
Json\Response::get();
common::egw_exit();
exit();
}
throw new Json\Exception($_SERVER['PHP_SELF'] . ' Invalid AJAX JSON Request');

View File

@ -88,7 +88,7 @@ abstract class egw_framework extends Api\Framework
if (EGW_APP_INC != EGW_API_INC && // this prevents an endless inclusion on the homepage
// (some apps set currentapp in hook_home => it's not releyable)
(file_exists (EGW_APP_INC . '/footer.inc.php') || isset($_GET['menuaction'])) &&
$GLOBALS['egw_info']['flags']['currentapp'] != 'home' &&
$GLOBALS['egw_info']['flags']['currentapp'] != 'api' &&
$GLOBALS['egw_info']['flags']['currentapp'] != 'login' &&
$GLOBALS['egw_info']['flags']['currentapp'] != 'logout' &&
!@$GLOBALS['egw_info']['flags']['noappfooter'])

View File

@ -49,7 +49,7 @@ class jscalendar
}
else
{
$args['app'] = 'home'; // home can be granted to anyone.
$args['app'] = 'api';
}
if ($do_header)
{

View File

@ -7,7 +7,7 @@
* Copyright (C) 2005 Lingewoud BV and Pim Snel *
* -------------------------------------------------------------------------*
* This library is part of the eGroupWare API *
* http://www.egroupware.org *
* http://www.egroupware.org *
* ------------------------------------------------------------------------ *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
@ -74,26 +74,26 @@
$Sav2Version = @file_get_contents(EGW_INCLUDE_ROOT.'/phpgwapi/inc/savant2/VERSION',"rb");
if(trim($Sav2Version) != trim($this->version))
{
$this->halt(lang('Savant2 version differs from Savant2 wrapper. <br/>This version: %1 <br/>Savants version: %2',$this->version, $Sav2Version));
{
$this->halt(lang('Savant2 version differs from Savant2 wrapper. <br/>This version: %1 <br/>Savants version: %2',$this->version, $Sav2Version));
}
}
/**
* set_tpl_path sets the preferred and fallback template search paths
*
* set_tpl_path sets the preferred and fallback template search paths
*
* @param string $man_dir custom manual given template path in filesystem
* @access public
* @return void
*/
function set_tpl_path($man_dir=null)
{
$preferred_dir=$this->get_tpl_dir();
$fallback_dir=$this->get_tpl_dir(true);
$preferred_dir=$this->get_tpl_dir();
$fallback_dir=$this->get_tpl_dir(true);
if(!$preferred_dir && $man_dir && $fallback_dir)
{
$this->halt(lang('No Savant2 template directories were found in:'.EGW_APP_ROOT));
$this->halt(lang('No Savant2 template directories were found in:'.EGW_APP_ROOT));
}
else
{
@ -101,7 +101,7 @@
{
$this->addPath('template',$fallback_dir);
}
// add preferred tpl dir last because savant set the last added first in the search array
// add preferred tpl dir last because savant set the last added first in the search array
if($preferred_dir)
{
$this->addPath('template',$preferred_dir);
@ -116,7 +116,7 @@
/**
* get_tpl_dir get template dir of an application
*
*
* @param bool $fallback if true the default fallback template dir is returned
* @param string $appname appication name optional can be derived from $GLOBALS['egw_info']['flags']['currentapp'];
* @access public
@ -128,7 +128,7 @@
{
$appname = $GLOBALS['egw_info']['flags']['currentapp'];
}
if ($appname == 'home' || $appname == 'logout' || $appname == 'login')
if ($appname == 'api' || $appname == 'logout' || $appname == 'login')
{
$appname = 'phpgwapi';
}
@ -217,9 +217,9 @@
/**
* set_var the same as assign()
*
* @param mixed $tplvar
* @param string $val
*
* @param mixed $tplvar
* @param string $val
* @access public
* @return void
*/

View File

@ -12,7 +12,7 @@
$GLOBALS['egw_info'] = array(
'flags' => array(
'currentapp' => 'home',
'currentapp' => 'api',
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,

View File

@ -76,7 +76,7 @@ function check_access(&$account)
$GLOBALS['egw_info']['flags'] = array(
'noheader' => True,
'currentapp' => 'home',
'currentapp' => 'api',
'autocreate_session_callback' => 'check_access',
);
// if you move this file somewhere else, you need to adapt the path to the header!

View File

@ -366,8 +366,8 @@ class idots_framework extends egw_framework
foreach($apps as $app => $app_data)
{
if ($app != 'preferences' && $app != 'about' && $app != 'logout' && $app != 'manual' &&
($app != 'home' || $GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] != 'no') ||
html::$ua_mobile && in_array($app,array('preferences','logout','home')))
($app != 'api' || $GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] != 'no') ||
html::$ua_mobile && in_array($app,array('preferences','logout','api')))
{
$this->tpl->set_var($app_data);