[eGroupWare-svn] r56021 - in /trunk: addressbook/inc/ calendar/inc/ egroupware/ egroupware/api/js/etemplate/ egroupware/api/js/framework/ egr...

[email protected] Wed, 04 May 2016 19:07:54 -0000
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: ralfbecker
Date: Wed May  4 21:07:54 2016
New Revision: 56021

URL: http://svn.stylite.de/viewvc/egroupware?rev=56021&view=rev
Log:
WIP EGroupware without phpgwapi&etemplate

Added:
    trunk/egroupware/api/src/Header/Referer.php
      - copied, changed from r56017, trunk/egroupware/api/src/Header/UserAgent.php
Modified:
    trunk/addressbook/inc/class.addressbook_ui.inc.php
    trunk/calendar/inc/class.boholiday.inc.php
    trunk/calendar/inc/class.calendar_bo.inc.php
    trunk/calendar/inc/class.calendar_uiforms.inc.php
    trunk/calendar/inc/class.calendar_uiviews.inc.php
    trunk/egroupware/api/js/etemplate/etemplate2.js
    trunk/egroupware/api/js/framework/fw_base.js
    trunk/egroupware/api/js/framework/fw_desktop.js
    trunk/egroupware/api/js/jsapi/egw.js
    trunk/egroupware/api/js/jsapi/egw_data.js
    trunk/egroupware/api/js/jsapi/egw_links.js
    trunk/egroupware/api/src/Translation.php
    trunk/egroupware/doc/fix_api.php
    trunk/egroupware/home/inc/class.home_birthday_portlet.inc.php
    trunk/egroupware/index.php
    trunk/egroupware/json.php
    trunk/infolog/inc/class.infolog_bo.inc.php
    trunk/infolog/inc/class.infolog_ui.inc.php
    trunk/phpgwapi/inc/class.common.inc.php

Modified: trunk/addressbook/inc/class.addressbook_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_ui.inc.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_ui.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_ui.inc.php Wed May  4 21:07:54 2016
@@ -756,8 +756,12 @@
 				'disableClass' => 'rowNoEdit',
 			);
 		}
-		if (isset($actions['export']['children']['csv']) && !importexport_helper_functions::has_definitions('addressbook','export')) unset($actions['export']['children']['csv']);
-
+		if (isset($actions['export']['children']['csv']) &&
+			(!isset($GLOBALS['egw_info']['user']['apps']['importexport']) ||
+			!importexport_helper_functions::has_definitions('addressbook','export')))
+		{
+			unset($actions['export']['children']['csv']);
+		}
 		// Intercept open action in order to open entry into view mode instead of edit
 		if (Api\Header\UserAgent::mobile())
 		{

Modified: trunk/calendar/inc/class.boholiday.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/inc/class.boholiday.inc.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/calendar/inc/class.boholiday.inc.php (original)
+++ trunk/calendar/inc/class.boholiday.inc.php Wed May  4 21:07:54 2016
@@ -56,15 +56,16 @@
 
 	function boholiday()
 	{
-		$this->so =& CreateObject('calendar.soholiday');
-
-		$this->start  = (int)get_var('start',array('POST','GET'));
-		$this->query  = get_var('query',array('POST','GET'));
-		$this->sort   = get_var('sort',array('POST','GET'));
-		$this->order  = get_var('order',array('POST','GET'));
-		$this->id     = get_var('id',array('POST','GET'));
-		$this->year   = get_var('year',array('POST','GET'),date('Y'));
-		$this->locale = get_var('locale',array('POST','GET'));
+		require_once(__DIR__.'/class.soholiday.inc.php');
+		$this->so = new soholiday();
+
+		$this->start  = (int)$_REQUEST['start'];
+		$this->query  = $_REQUEST['query'];
+		$this->sort   = $_REQUEST['sort'];
+		$this->order  = $_REQUEST['order'];
+		$this->id     = $_REQUEST['id'];
+		$this->year   = (int)(!empty($_REQUEST['year']) ? $_REQUEST['year'] : date('Y'));
+		$this->locale = $_REQUEST['locale'];
 		if ($this->locale)
 		{
 			$this->locales[] = $this->locale;

Modified: trunk/calendar/inc/class.calendar_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/inc/class.calendar_bo.inc.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/calendar/inc/class.calendar_bo.inc.php (original)
+++ trunk/calendar/inc/class.calendar_bo.inc.php Wed May  4 21:07:54 2016
@@ -1474,11 +1474,11 @@
 		if ($end_m == 24*60-1) ++$duration;
 		$duration = floor($duration/60).lang('h').($duration%60 ? $duration%60 : '');
 
-		$timespan = $t = common::formattime(sprintf('%02d',$start_m/60),sprintf('%02d',$start_m%60));
+		$timespan = $t = Api\DateTime::to('20000101T'.sprintf('%02d',$start_m/60).sprintf('%02d',$start_m%60).'00', false);
 
 		if ($both)	// end-time too
 		{
-			$timespan .= ' - '.common::formattime(sprintf('%02d',$end_m/60),sprintf('%02d',$end_m%60));
+			$timespan .= ' - '.Api\DateTime::to('20000101T'.sprintf('%02d',$end_m/60).sprintf('%02d',$end_m%60).'00', false);
 			// dont double am/pm if they are the same in both times
 			if ($this->common_prefs['timeformat'] == 12 && substr($timespan,-2) == substr($t,-2))
 			{

Modified: trunk/calendar/inc/class.calendar_uiforms.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/inc/class.calendar_uiforms.inc.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/calendar/inc/class.calendar_uiforms.inc.php (original)
+++ trunk/calendar/inc/class.calendar_uiforms.inc.php Wed May  4 21:07:54 2016
@@ -2031,7 +2031,7 @@
 	 */
 	function conflicts($event,$conflicts,$preserv)
 	{
-		$etpl = CreateObject('etemplate.etemplate_new','calendar.conflicts');
+		$etpl = new Etemplate('calendar.conflicts');
 		$allConflicts = array();
 
 		foreach($conflicts as $k => $conflict)

Modified: trunk/calendar/inc/class.calendar_uiviews.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/inc/class.calendar_uiviews.inc.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/calendar/inc/class.calendar_uiviews.inc.php (original)
+++ trunk/calendar/inc/class.calendar_uiviews.inc.php Wed May  4 21:07:54 2016
@@ -412,7 +412,7 @@
 	/**
 	 * Displays the planner view
 	 *
-	 * @param boolean|etemplate_new $home = false if etemplate return content suitable for home-page
+	 * @param boolean|Etemplate $home = false if etemplate return content suitable for home-page
 	 */
 	function &planner($content = array(), $home=false)
 	{

Modified: trunk/egroupware/api/js/etemplate/etemplate2.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/js/etemplate/etemplate2.js?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/api/js/etemplate/etemplate2.js (original)
+++ trunk/egroupware/api/js/etemplate/etemplate2.js Wed May  4 21:07:54 2016
@@ -284,7 +284,7 @@
 	{
 		this.destroy_session = jQuery.proxy(function(ev)
 		{
-			var request = egw.json(this.app+".etemplate_new.ajax_destroy_session.etemplate",
+			var request = egw.json("EGroupware\\Api\\Etemplate::ajax_destroy_session",
 				[this.etemplate_exec_id], null, null, false);
 			request.sendRequest();
 		}, this);

Modified: trunk/egroupware/api/js/framework/fw_base.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/js/framework/fw_base.js?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/api/js/framework/fw_base.js (original)
+++ trunk/egroupware/api/js/framework/fw_base.js Wed May  4 21:07:54 2016
@@ -415,7 +415,7 @@
 		{
 			this.serializedTabState = serialized;
 
-			egw.jsonq("api.jdots_framework.ajax_tab_changed_state", [data]);
+			egw.jsonq("api.jdots_framework.ajax_tab_changed_state.template", [data]);
 		}
 	},
 
@@ -998,7 +998,7 @@
 						var app = framework.activeApp;
 						framework.activeApp = '';
 						framework.setActiveApp(app);
-						
+
 						egw.loading_prompt(app.appName,true,egw.lang('please wait...'),app.browser.baseDiv, egwIsMobile()?'horizental':'spinner');
 
 						// Give framework a chance to deal, then reset the etemplates

Modified: trunk/egroupware/api/js/framework/fw_desktop.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/js/framework/fw_desktop.js?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/api/js/framework/fw_desktop.js (original)
+++ trunk/egroupware/api/js/framework/fw_desktop.js Wed May  4 21:07:54 2016
@@ -302,7 +302,7 @@
 			}
 
 			//Send the sort order to the server via ajax
-			var req = egw.jsonq('api.jdots_framework.ajax_appsort', [name_array]);
+			var req = egw.jsonq('api.jdots_framework.ajax_appsort.template', [name_array]);
 		},
 
 		/**

Modified: trunk/egroupware/api/js/jsapi/egw.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/js/jsapi/egw.js?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/api/js/jsapi/egw.js (original)
+++ trunk/egroupware/api/js/jsapi/egw.js Wed May  4 21:07:54 2016
@@ -289,7 +289,7 @@
 						window.setTimeout(resize_popup, 50);
 					});
 				}
-				var et2 = new etemplate2(node, currentapp+".etemplate_new.ajax_process_content.etemplate");
+				var et2 = new etemplate2(node, "EGroupware\\Api\\Etemplate::ajax_process_content");
 				et2.load(data.name,data.url,data.data);
 				if (typeof data.response != 'undefined')
 				{

Modified: trunk/egroupware/api/js/jsapi/egw_data.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/js/jsapi/egw_data.js?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/api/js/jsapi/egw_data.js (original)
+++ trunk/egroupware/api/js/jsapi/egw_data.js Wed May  4 21:07:54 2016
@@ -283,7 +283,7 @@
 
 		/**
 		 * The dataFetch function provides an abstraction layer for the
-		 * corresponding "etemplate_widget_nextmatch::ajax_get_rows" function.
+		 * corresponding "EGroupware\Api\Etemplate\Widget\Nextmatch::ajax_get_rows" function.
 		 * The server returns the following structure:
 		 * 	{
 		 * 		order: [uid, ...],
@@ -429,7 +429,7 @@
 			// independent of changes happening while waiting for the response
 			_context.filters = jQuery.extend({}, _filters);
 			var request = egw.json(
-				_app+".etemplate_widget_nextmatch.ajax_get_rows.etemplate",
+				"EGroupware\\Api\\Etemplate\\Widget\\Nextmatch::ajax_get_rows",
 				[
 					_execId,
 					_queriedRange,
@@ -836,7 +836,7 @@
 			if(typeof registeredCallbacks[_uid] !== "undefined" && registeredCallbacks[_uid].length > 0)
 			{
 				var _execId = registeredCallbacks[_uid][0].execId;
-				// This widget ID MUST be a nextmatch, because the data call is to etemplate_widget_nexmatch
+				// This widget ID MUST be a nextmatch, because the data call is to Etemplate\Widget\Nexmatch
 				var nextmatchId = registeredCallbacks[_uid][0].widgetId;
 				var uid = _uid.split("::");
 				var context = {

Modified: trunk/egroupware/api/js/jsapi/egw_links.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/js/jsapi/egw_links.js?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/api/js/jsapi/egw_links.js (original)
+++ trunk/egroupware/api/js/jsapi/egw_links.js Wed May  4 21:07:54 2016
@@ -398,7 +398,7 @@
 			// if there's no active jsonq request, start a new one
 			if (title_uid == null)
 			{
-				title_uid = this.jsonq(_app+'.etemplate_widget_link.ajax_link_titles.etemplate',[{}], this.link_title_callback, this, this.link_title_before_send);
+				title_uid = this.jsonq('EGroupware\\Api\\Etemplate\\Widget\\Link::ajax_link_titles',[{}], this.link_title_callback, this, this.link_title_before_send);
 			}
 		},
 

Copied: trunk/egroupware/api/src/Header/Referer.php (from r56017, trunk/egroupware/api/src/Header/UserAgent.php)
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Header/Referer.php?p2=trunk/egroupware/api/src/Header/Referer.php&p1=trunk/egroupware/api/src/Header/UserAgent.php&r1=56017&r2=56021&rev=56021&view=diff
==============================================================================
--- trunk/egroupware/api/src/Header/UserAgent.php (original)
+++ trunk/egroupware/api/src/Header/Referer.php Wed May  4 21:07:54 2016
@@ -1,11 +1,10 @@
 <?php
 /**
- * EGroupware API: server-side browser and mobile device detection
+ * EGroupware API: HTTP_REFERER header handling
  *
  * @link http://www.egroupware.org
- * @author Ralf Becker <RalfBecker-AT-outdoor-training.de> complete rewrite in 6/2006 and earlier modifications
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
- * @author RalfBecker-AT-outdoor-training.de
+ * @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
  * @copyright 2001-2016 by [email protected]
  * @package api
  * @subpackage header
@@ -15,105 +14,37 @@
 namespace EGroupware\Api\Header;
 
 /**
- * Server-side browser and mobile device detection based on User-Agent header
+ * Handling of HTTP_REFERER header
  */
-class UserAgent
+class Referer
 {
 	/**
-	 * Normalized type of user-agent
+	 * gets an eGW conformant referer from $_SERVER['HTTP_REFERER'], suitable for direct use in the link function
 	 *
-	 * @return string 'firefox', 'msie', 'safari' (incl. iPhone), 'chrome', 'opera', 'konqueror', 'mozilla'
+	 * @param string $default ='' default to use if referer is not set by webserver or not determinable
+	 * @param string $referer ='' referer string to use, default ('') use $_SERVER['HTTP_REFERER']
+	 * @return string
+	 * @todo get "real" referer for jDots template
 	 */
-	public static function type()
+	static function get($default='',$referer='')
 	{
-		return self::$user_agent;
-	}
+		// HTTP_REFERER seems NOT to get urldecoded
+		if (!$referer) $referer = urldecode($_SERVER['HTTP_REFERER']);
 
-	/**
-	 * Version of user-agent as specified by browser
-	 *
-	 * @return string
-	 */
-	public static function version()
-	{
-		return self::$ua_version;
-	}
+		$webserver_url = $GLOBALS['egw_info']['server']['webserver_url'];
+		if (empty($webserver_url) || $webserver_url{0} == '/')	// url is just a path
+		{
+			$referer = preg_replace('/^https?:\/\/[^\/]+/','',$referer);	// removing the domain part
+		}
+		if (strlen($webserver_url) > 1)
+		{
+			list(,$referer) = explode($webserver_url,$referer,2);
+		}
+		$ret = str_replace('/etemplate/process_exec.php', '/index.php', $referer);
 
-	/**
-	 * Mobile device type
-	 *
-	 * @return string "iphone", "ipod", "ipad", "android", "symbianos", "blackberry", "kindle", "opera mobi", "windows phone"
-	 */
-	public static function mobile()
-	{
-		return self::$ua_mobile;
-	}
+		if (empty($ret) || strpos($ret, 'cd=yes') !== false) $ret = $default;
 
-	/**
-	 * user-agent: 'firefox', 'msie', 'edge', 'safari' (incl. iPhone), 'chrome', 'opera', 'konqueror', 'mozilla'
-	 *
-	 * @var string
-	 */
-	protected static $user_agent;
-	/**
-	 * User agent is mobile browser: "iphone", "ipod", "ipad", "android", "symbianos", "blackberry", "kindle", "opera mobi", "windows phone"
-	 *
-	 * @var string with name of mobile browser or null, if not mobile browser
-	 */
-	protected static $ua_mobile;
-
-	/**
-	 * version of user-agent as specified by browser
-	 *
-	 * @var string
-	 */
-	protected static $ua_version;
-
-	/**
-	 * initialise our static vars
-	 */
-	static function _init_static()
-	{
-		// should be Ok for all HTML 4 compatible browsers
-		$parts = $all_parts = null;
-		if(!preg_match('/compatible; ([a-z]+)[\/ ]+([0-9.]+)/i',$_SERVER['HTTP_USER_AGENT'],$parts))
-		{
-			preg_match_all('/([a-z]+)\/([0-9.]+)/i',$_SERVER['HTTP_USER_AGENT'],$all_parts,PREG_SET_ORDER);
-			$parts = array_pop($all_parts);
-			foreach($all_parts as $p)
-			{
-				if ($p[1] == 'Chrome' && $parts[1] != 'Edge')
-				{
-					$parts = $p;
-					break;
-				}
-			}
-		}
-		list(,self::$user_agent,self::$ua_version) = $parts;
-		if ((self::$user_agent = strtolower(self::$user_agent)) == 'version') self::$user_agent = 'opera';
-		// IE no longer reports MSIE, but "Trident/7.0; rv:11.0"
-		if (self::$user_agent=='trident')
-		{
-			self::$user_agent='msie';
-			$matches = null;
-			self::$ua_version = preg_match('|Trident/[0-9.]+; rv:([0-9.]+)|i', $_SERVER['HTTP_USER_AGENT'], $matches) ?
-				$matches[1] : 11.0;
-		}
-		// iceweasel is based on mozilla and we treat it like as firefox
-		if (self::$user_agent == 'iceweasel')
-		{
-			self::$user_agent = 'firefox';
-		}
-		// MS Edge sometimes reports just "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
-		if (self::$user_agent == 'mozilla' && self::$ua_version == '5.0')
-		{
-			self::$user_agent = 'edge';
-			self::$ua_version = '12.0';
-		}
-		self::$ua_mobile = preg_match('/(iPhone|iPod|iPad|Android|SymbianOS|Blackberry|Kindle|Opera Mobi|Windows Phone)/i',
-			$_SERVER['HTTP_USER_AGENT'], $matches) ? strtolower($matches[1]) : null;
-
-		//error_log("HTTP_USER_AGENT='$_SERVER[HTTP_USER_AGENT]', UserAgent: '".self::$user_agent."', Version: '".self::$ua_version."', isMobile=".array2string(self::$ua_mobile));
+		return $ret;
 	}
 }
 UserAgent::_init_static();

Modified: trunk/egroupware/api/src/Translation.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Translation.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/api/src/Translation.php (original)
+++ trunk/egroupware/api/src/Translation.php Wed May  4 21:07:54 2016
@@ -195,7 +195,7 @@
 			}
 			$apps = array('common');
 			// for eTemplate apps, load etemplate before app itself (allowing app to overwrite etemplate translations)
-			if (class_exists('etemplate_new', false) || class_exists('etemplate', false)) $apps[] = 'etemplate';
+			if (class_exists('EGroupware\\Api\\Etemplate', false) || class_exists('etemplate', false)) $apps[] = 'etemplate';
 			if ($GLOBALS['egw_info']['flags']['currentapp']) $apps[] = $GLOBALS['egw_info']['flags']['currentapp'];
 			// load instance specific translations last, so they can overwrite everything
 			$apps[] = 'custom';

Modified: trunk/egroupware/doc/fix_api.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/doc/fix_api.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/doc/fix_api.php (original)
+++ trunk/egroupware/doc/fix_api.php Wed May  4 21:07:54 2016
@@ -85,6 +85,7 @@
 	'common::egw_footer' => "\$GLOBALS['egw']->framework->footer",
 	'common::show_date' => 'Api\\DateTime::server2user',
 	'common::get_tpl_dir' => 'Api\\Framework\\Template::get_dir',
+	'common::get_referer' => 'Api\\Header\\Referer::get',
 	'country' => 'Api\\Country',
 	'egw' => 'Api\\Egw',
 	'egw_minimal' => 'Api\\Egw\\Base',
@@ -158,6 +159,7 @@
 	'etemplate_request' => 'Api\\Etemplate\\Request',
 	'nextmatch_widget::category_action' => 'Api\\Etemplate\\Widget\\Nextmatch::category_action',
 	'nextmatch_widget::DEFAULT_MAX_MENU_LENGTH' => 'Api\\Etemplate\\Widget\\Nextmatch::DEFAULT_MAX_MENU_LENGTH',
+	'customfields_widget::update_customfield_links' => 'Api\Storage\Customfields::update_links',
 	'egw_keymanager' => 'Api\\Etemplate\\KeyManager',
 	// so_sql and friends
 	'so_sql' => 'Api\\Storage\\Base',

Modified: trunk/egroupware/home/inc/class.home_birthday_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_birthday_portlet.inc.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_birthday_portlet.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_birthday_portlet.inc.php Wed May  4 21:07:54 2016
@@ -133,10 +133,12 @@
 								$text = lang("Tomorrow is %1's birthday.", $contact['n_given'].' '.$contact['n_family']);
 								break;
 							default:
-								list($y,$m,$d) = explode('-',$contact['bday']);
-								if ($GLOBALS['egw_info']['server']['hide_birthdays'] == 'dateonly') $y = '';
-								$text = lang("In %1 days (%2) is %3's birthday.",$n,
-									common::dateformatorder($y,$m,$d,true),
+								$date = Api\DateTime::to($contact['bday'], true);
+								if ($GLOBALS['egw_info']['server']['hide_birthdays'] == 'dateonly')
+								{
+									$date = preg_replace('/\d{4}/', '', $date);
+								}
+								$text = lang("In %1 days (%2) is %3's birthday.", $n, $date,
 									$contact['n_given'].' '.$contact['n_family']);
 								break;
 						}

Modified: trunk/egroupware/index.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/index.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/index.php (original)
+++ trunk/egroupware/index.php Wed May  4 21:07:54 2016
@@ -86,7 +86,7 @@
 	$GLOBALS['egw']->preferences->add('common','tz',$_GET['tz']);
 	$GLOBALS['egw']->preferences->save_repository();
 
-	if (($referer = common::get_referer()))
+	if (($referer = Api\Header\Referer::get()))
 	{
 		Egw::redirect_link($referer);
 	}

Modified: trunk/egroupware/json.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/json.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/egroupware/json.php (original)
+++ trunk/egroupware/json.php Wed May  4 21:07:54 2016
@@ -101,7 +101,7 @@
 			'no_exception_handler' => true,	// we already installed our own
 			// only log ajax requests which represent former GET requests or submits
 			// cuts down updates to egw_access_log table
-			'no_dla_update' => !preg_match('/(\.etemplate_new\.ajax_process_content\.etemplate|\.jdots_framework\.ajax_exec\.template)$/', $_GET['menuaction']),
+			'no_dla_update' => !preg_match('/(Etemplate::ajax_process_content|\.jdots_framework\.ajax_exec\.template)$/', $_GET['menuaction']),
 		)
 	);
 	include_once('./header.inc.php');

Modified: trunk/infolog/inc/class.infolog_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/infolog/inc/class.infolog_bo.inc.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/infolog/inc/class.infolog_bo.inc.php (original)
+++ trunk/infolog/inc/class.infolog_bo.inc.php Wed May  4 21:07:54 2016
@@ -596,7 +596,7 @@
 			}
 		}
 
-		if (($data = $this->so->read($info_id)) === False)
+		if (!$info_id || ($data = $this->so->read($info_id)) === False)
 		{
 			return null;
 		}
@@ -948,7 +948,7 @@
 				$to_write['info_responsible'] = $values['info_responsible'];
 			}
 			// create (and remove) links in custom fields
-			customfields_widget::update_customfield_links('infolog',$values,$old,'info_id');
+			Api\Storage\Customfields::update_links('infolog',$values,$old,'info_id');
 
 			// Check for restore of deleted entry, restore held links
 			if($old['info_status'] == 'deleted' && $values['info_status'] != 'deleted')
@@ -1361,7 +1361,7 @@
 			foreach ($infos as $info)
 			{
 				$start = new Api\DateTime($info['info_startdate'],Api\DateTime::$user_timezone);
-				$title = ($do_events?common::formattime($start->format('H'),$start->format('i')).' ':'').
+				$title = ($do_events ? $start->format(false).' ' : '').
 					$info['info_subject'];
 				$view = Link::view('infolog',$info['info_id']);
 				$size = null;

Modified: trunk/infolog/inc/class.infolog_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/infolog/inc/class.infolog_ui.inc.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/infolog/inc/class.infolog_ui.inc.php (original)
+++ trunk/infolog/inc/class.infolog_ui.inc.php Wed May  4 21:07:54 2016
@@ -704,7 +704,7 @@
 		}
 		elseif ($own_referer === '')
 		{
-			$own_referer = common::get_referer();
+			$own_referer = Api\Header\Referer::get();
 			if (strpos($own_referer,'menuaction=infolog.infolog_ui.edit') !== false)
 			{
 				$own_referer = Api\Cache::getSession('infolog', 'own_session');
@@ -787,9 +787,9 @@
 		}
 		if (!$action)
 		{
-			$action = is_array($values) && $values['action'] ? $values['action'] : get_var('action',array('POST','GET'));
-			$action_id = is_array($values) && $values['action_id'] ? $values['action_id'] : get_var('action_id',array('POST','GET'));
-			$action_title = is_array($values) && $values['action_title'] ? $values['action_title'] : get_var('action_title',array('POST','GET'));
+			$action = is_array($values) && $values['action'] ? $values['action'] : $_REQUEST['action'];
+			$action_id = is_array($values) && $values['action_id'] ? $values['action_id'] : $_REQUEST['action_id'];
+			$action_title = is_array($values) && $values['action_title'] ? $values['action_title'] : $_REQUEST['action_title'];
 		}
 		//echo "<p>".__METHOD__."(action='$action/$action_id',called_as='$called_as/$values[referer]',own_referer='$own_referer') values=\n"; _debug_array($values);
 		if (!is_array($values))
@@ -1881,12 +1881,12 @@
 		else	// new call via GET
 		{
 			//echo "<p>infolog_ui::edit: info_id=$info_id,  action='$action', action_id='$action_id', type='$type', referer='$referer'</p>\n";
-			$action    = $action    ? $action    : get_var('action',   array('POST','GET'));
-			$action_id = $action_id ? $action_id : get_var('action_id',array('POST','GET'));
-			$info_id   = $content   ? $content   : get_var('info_id',  array('POST','GET'));
-			$type      = $type      ? $type      : get_var('type',     array('POST','GET'));
+			$action    = $action    ? $action    : $_REQUEST['action'];
+			$action_id = $action_id ? $action_id : $_REQUEST['action_id'];
+			$info_id   = $content   ? $content   : $_REQUEST['info_id'];
+			$type      = $type      ? $type      : $_REQUEST['type'];
 			$referer   = $referer !== '' ? $referer : ($_GET['referer'] ? $_GET['referer'] :
-				common::get_referer('/index.php?menuaction=infolog.infolog_ui.index'));
+				Api\Header\Referer::get('/index.php?menuaction=infolog.infolog_ui.index'));
 			if (strpos($referer, 'msg=') !== false) $referer = preg_replace('/([&?]{1})msg=[^&]+&?/','\\1',$referer);	// remove previou/old msg from referer
 			$no_popup  = $_GET['no_popup'];
 			$print = (int) $_REQUEST['print'];
@@ -2360,7 +2360,7 @@
 		{
 			$icon = $this->icons[$cat][$id];
 		}
-		if ($icon && !is_readable(common::get_image_dir() . '/' . $icon))
+		if ($icon && !Api\Image::find('infolog', $icon))
 		{
 			$icon = False;
 		}

Modified: trunk/phpgwapi/inc/class.common.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/phpgwapi/inc/class.common.inc.php?rev=56021&r1=56020&r2=56021&view=diff
==============================================================================
--- trunk/phpgwapi/inc/class.common.inc.php (original)
+++ trunk/phpgwapi/inc/class.common.inc.php Wed May  4 21:07:54 2016
@@ -1213,32 +1213,16 @@
 	}
 
 	/**
-	 * gets an eGW conformat referer from $_SERVER['HTTP_REFERER'], suitable for direct use in the link function
+	 * gets an eGW conformant referer from $_SERVER['HTTP_REFERER'], suitable for direct use in the link function
 	 *
 	 * @param string $default ='' default to use if referer is not set by webserver or not determinable
 	 * @param string $referer ='' referer string to use, default ('') use $_SERVER['HTTP_REFERER']
 	 * @return string
-	 * @todo get "real" referer for jDots template
+	 * @deprecated use Api\Header\Referer::get
 	 */
 	static function get_referer($default='',$referer='')
 	{
-		// HTTP_REFERER seems NOT to get urldecoded
-		if (!$referer) $referer = urldecode($_SERVER['HTTP_REFERER']);
-
-		$webserver_url = $GLOBALS['egw_info']['server']['webserver_url'];
-		if (empty($webserver_url) || $webserver_url{0} == '/')	// url is just a path
-		{
-			$referer = preg_replace('/^https?:\/\/[^\/]+/','',$referer);	// removing the domain part
-		}
-		if (strlen($webserver_url) > 1)
-		{
-			list(,$referer) = explode($webserver_url,$referer,2);
-		}
-		$ret = str_replace('/etemplate/process_exec.php', '/index.php', $referer);
-
-		if (empty($ret) || strpos($ret, 'cd=yes') !== false) $ret = $default;
-
-		return $ret;
+		return Api\Header\Referer::get($default, $referer);
 	}
 
 	// some depricated functions for the migration


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z