Author: ralfbecker
New Revision: 55872
URL: http://svn.stylite.de/viewvc/egroupware?rev=55872&view=rev
Log:
fix some ocurences with: instanceof , which is no longer true, when object is from new Api, but old extends new Api class
Modified:
trunk/calendar/inc/class.calendar_rrule.inc.php
trunk/setup/inc/class.setup_cmd.inc.php
trunk/wiki/lib/url.php
— trunk/calendar/inc/class.calendar_rrule.inc.php (original)
+++ trunk/calendar/inc/class.calendar_rrule.inc.php Wed Apr 27 09:10:04 2016
@@ -6,10 +6,12 @@
+use EGroupware\Api;
/**
- Recurrence rule iterator
@@ -182,14 +184,14 @@
/**
-
-
@var Api\DateTime
*/
public $time;
/**
* Current "position" / time
*
-
-
@var Api\DateTime
*/
public $current;
@@ -234,11 +236,11 @@
$this->lastdayofweek = self::SUNDAY;
}
-
$this->time = $time instanceof Api\DateTime ? $time : new Api\DateTime($time);
if (!in_array($type,array(self::NONE, self::DAILY, self::WEEKLY, self::MONTHLY_MDAY, self::MONTHLY_WDAY, self::YEARLY)))
{
-
throw new egw_exception_wrong_parameter(__METHOD__."($time,$type,$interval,$enddate,$weekdays,...) type $type is NOT valid!");
-
throw new Api\Exception\WrongParameter(__METHOD__."($time,$type,$interval,$enddate,$weekdays,...) type $type is NOT valid!");
}
$this->type = $type;
@@ -350,7 +352,7 @@
private static function daysInMonth(DateTime $time)
{
list($year,$month) = explode(’-’,$time->format(‘Y-m’));
@@ -437,7 +439,7 @@
break;
default:
@@ -600,13 +602,13 @@
}
if ($this->enddate)
{
-
$str_extra[] = lang('ends').': '.lang($this->enddate->format('l')).', '.$this->enddate->format(egw_time::$user_dateformat);
-
}
-
if ($this->time->getTimezone()->getName() != egw_time::$user_timezone->getName())
-
$str_extra[] = lang('ends').': '.lang($this->enddate->format('l')).', '.$this->enddate->format(Api\DateTime::$user_dateformat);
-
}
-
if ($this->time->getTimezone()->getName() != Api\DateTime::$user_timezone->getName())
{
$str_extra[] = $this->time->getTimezone()->getName();
}
@@ -725,8 +727,8 @@
{
if (!is_array($event) || !isset($event[‘tzid’])) return false;
if (!$to_tz) $to_tz = $event[‘tzid’];
-
$timestamp_tz = $usertime ? egw_time::$user_timezone : egw_time::$server_timezone;
-
$time = is_a($event['start'],'DateTime') ? $event['start'] : new egw_time($event['start'],$timestamp_tz);
-
$timestamp_tz = $usertime ? Api\DateTime::$user_timezone : Api\DateTime::$server_timezone;
-
$time = is_a($event['start'],'DateTime') ? $event['start'] : new Api\DateTime($event['start'],$timestamp_tz);
if (!isset(self::$tz_cache[$to_tz]))
{
@@ -739,13 +741,13 @@
if ($event['recur_enddate'])
{
-
$enddate = is_a($event['recur_enddate'],'DateTime') ? $event['recur_enddate'] : new Api\DateTime($event['recur_enddate'],$timestamp_tz);
}
if (is_array($event['recur_exception']))
{
foreach($event['recur_exception'] as $exception)
{
-
$exceptions[] = is_a($exception,'DateTime') ? $exception : new Api\DateTime($exception,$timestamp_tz);
}
}
return new calendar_rrule($time,$event['recur_type'],$event['recur_interval'],$enddate,$event['recur_data'],$exceptions);
@@ -796,7 +798,7 @@
}
$time = is_a($starttime,'DateTime') ?
@@ -832,13 +834,11 @@
error_reporting(E_ALL & ~E_NOTICE);
function lang($str) { return $str; }
$GLOBALS[‘egw_info’][‘user’][‘preferences’][‘common’][‘tz’] = $_REQUEST[‘user-tz’] ? $_REQUEST[‘user-tz’] : ‘Europe/Berlin’;
- require_once(’…/…/phpgwapi/inc/class.egw_time.inc.php’);
- require_once(’…/…/phpgwapi/inc/class.html.inc.php’);
- require_once(’…/…/phpgwapi/inc/class.egw_exception.inc.php’);
@@ -847,31 +847,31 @@
$_REQUEST[‘user-tz’] = ‘Europe/Berlin’;
}
echo “\n\n\tTest calendar_rrule class\n\n\n\n”;
- echo "
Date+Time: ".html::input(‘time’,$_REQUEST[‘time’]).
-
html::select('tz',$_REQUEST['tz'],egw_time::getTimezones())."</p>\n";
- echo “
Type: “.html::select(‘type’,$_REQUEST[‘type’],calendar_rrule::$types).”\n”.
-
"Interval: ".html::input('interval',$_REQUEST['interval'])."</p>\n";
- echo "
Date+Time: ".Api\Html::input(‘time’,$_REQUEST[‘time’]).
-
Api\Html::select('tz',$_REQUEST['tz'],Api\DateTime::getTimezones())."</p>\n";
- echo “
Type: “.Api\Html::select(‘type’,$_REQUEST[‘type’],calendar_rrule::$types).”\n”.
-
"Interval: ".Api\Html::input('interval',$_REQUEST['interval'])."</p>\n";
echo “
\n”;
- echo “Weekdays:
”.html::checkbox_multiselect(‘weekdays’,$_REQUEST[‘weekdays’],calendar_rrule::$days,false,’’,‘7’,false,‘height: 150px;’)."\n";
- echo “Weekdays:
”.Api\Html::checkbox_multiselect(‘weekdays’,$_REQUEST[‘weekdays’],calendar_rrule::$days,false,’’,‘7’,false,‘height: 150px;’)."\n";
echo “
|
\n”;
|
\n”;
- echo “
Enddate: “.html::input(‘enddate’,$_REQUEST[‘enddate’]).”
\n”;
- echo “
Display recurances in “.html::select(‘user-tz’,$_REQUEST[‘user-tz’],egw_time::getTimezones()).”
\n”;
- echo “
”.html::submit_button(‘calc’,‘Calculate’)."
\n";
-
echo “
Enddate: “.Api\Html::input(‘enddate’,$_REQUEST[‘enddate’]).”
\n”;
-
echo “
Display recurances in “.Api\Html::select(‘user-tz’,$_REQUEST[‘user-tz’],Api\DateTime::getTimezones()).”
\n”;
-
echo “
”.Api\Html::submit_button(‘calc’,‘Calculate’)."
\n";
echo “\n”;
$tz = new DateTimeZone($_REQUEST[‘tz’]);
- $time = new egw_time($_REQUEST[‘time’],$tz);
- if ($_REQUEST[‘enddate’]) $enddate = new egw_time($_REQUEST[‘enddate’],$tz);
- $time = new Api\DateTime($_REQUEST[‘time’],$tz);
- if ($_REQUEST[‘enddate’]) $enddate = new Api\DateTime($_REQUEST[‘enddate’],$tz);
$weekdays = 0; foreach((array)$_REQUEST[‘weekdays’] as $mask) { $weekdays |= $mask; }
- if ($_REQUEST[‘exceptions’]) foreach(preg_split("/[,\r\n]+ ?/",$_REQUEST[‘exceptions’]) as $exception) { $exceptions[] = new egw_time($exception); }
-
if ($_REQUEST[‘exceptions’]) foreach(preg_split("/[,\r\n]+ ?/",$_REQUEST[‘exceptions’]) as $exception) { $exceptions[] = new Api\DateTime($exception); }
$rrule = new calendar_rrule($time,$_REQUEST[‘type’],$_REQUEST[‘interval’],$enddate,$weekdays,$exceptions);
echo “
”.$time->format(‘l’).’, ‘.$time.’ (’.$tz->getName().’) '.$rrule."
\n";
foreach($rrule as $rtime)
{
— trunk/setup/inc/class.setup_cmd.inc.php (original)
+++ trunk/setup/inc/class.setup_cmd.inc.php Wed Apr 27 09:10:04 2016
@@ -5,10 +5,12 @@
+use EGroupware\Api\Egw;
/**
- setup command: abstract baseclass for all setup commands, extending admin_cmd
@@ -85,7 +87,7 @@
/**
- Saving the object to the database, reimplemented to not do it in setup context
-
-
-
@param boolean $set_modifier=true set the current user as modifier or 0 (= run by the system)
-
-
@param boolean $set_modifier =true set the current user as modifier or 0 (= run by the system)
-
@return boolean true on success, false otherwise
*/
function save($set_modifier=true)
@@ -120,7 +122,7 @@
self::$egw_setup->ConfigDomain = $domain;
if (isset($GLOBALS[‘egw_info’][‘server’][‘header_admin_user’]) && !isset($GLOBALS[‘egw_domain’]) &&
-
is_object($GLOBALS['egw']) && $GLOBALS['egw'] instanceof Egw)
{
// we run inside eGW, not setup --> read egw_domain array from the header via the showheader cmd
$cmd = new setup_cmd_showheader(null); // null = only header, no db stuff, no hashes
@@ -172,7 +174,7 @@
*
* @param string $user
* @param string $pw
-
-
@param string $domain=null if given we also check agains config user/pw
-
-
@param string $domain =null if given we also check agains config user/pw
-
@throws egw_exception_no_permission(lang(‘Access denied: wrong username or password for manage-header !!!’),21);
-
@throws egw_exception_no_permission(lang(“Access denied: wrong username or password to configure the domain ‘%1(%2)’ !!!”,$domain,$GLOBALS[‘egw_domain’][$domain][‘db_type’]),40);
*/
@@ -219,9 +221,9 @@
-
- Sets self::$apps_to_update and self::$apps_to_install for the last/only domain only!
-
-
-
@param string $domain=’’ domain to check, default ‘’ = all
-
-
@param int/array $stop=0 stop checks before given exit-code(s), default 0 = all checks
-
-
@param boolean $verbose=false echo messages as they happen, instead returning them
-
-
@param string $domain =’’ domain to check, default ‘’ = all
-
-
@param int/array $stop =0 stop checks before given exit-code(s), default 0 = all checks
-
-
@param boolean $verbose =false echo messages as they happen, instead returning them
-
@return array with translated messages
*/
static function check_installed($domain=’’,$stop=0,$verbose=false)
— trunk/wiki/lib/url.php (original)
+++ trunk/wiki/lib/url.php Wed Apr 27 09:10:04 2016
@@ -1,23 +1,24 @@
<?php
/* $Id$ */
+use EGroupware\Api\Egw;
+
// Under EGroupware these URL's are NOT configurable, you can set the webserver_url in setup
-if (is_object($GLOBALS['egw']) && ($GLOBALS['egw'] instanceof egw))
+if (is_object($GLOBALS['egw']) && ($GLOBALS['egw'] instanceof Egw))
{
- if (!method_exists($GLOBALS['egw'], 'link')) throw new egw_exception_assertion_failed('undefined method egw::link()!');
- $ScriptBase = $GLOBALS['egw']->link('/wiki/index.php');
+ $ScriptBase = Egw::link('/wiki/index.php');
$ScriptBase .= strpos($ScriptBase,'?') !== false ? '&' : '?';
$AdminScript = $ScriptBase . 'action=admin';
//if(!isset($ViewBase))
- { $ViewBase = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'wiki.wiki_ui.view')). '&page='; }
+ { $ViewBase = Egw::link('/index.php',array('menuaction'=>'wiki.wiki_ui.view')). '&page='; }
//if(!isset($EditBase))
- { $EditBase = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'wiki.wiki_ui.edit')).'&page='; }
+ { $EditBase = Egw::link('/index.php',array('menuaction'=>'wiki.wiki_ui.edit')).'&page='; }
//if(!isset($HistoryBase))
{ $HistoryBase = $ScriptBase . 'action=history&page='; }
//if(!isset($FindScript))
- { $FindScript = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'wiki.wiki_ui.search')); }
+ { $FindScript = Egw::link('/index.php',array('menuaction'=>'wiki.wiki_ui.search')); }
//if(!isset($FindBase))
{ $FindBase = $FindScript . '&search='; }
//if(!isset($SaveBase))
@@ -110,5 +111,3 @@
return $SaveBase . urlencode($page);
}
}
-
-?>
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
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs