mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 08:38:45 +02:00
Compare commits
7 Commits
3.0.1
...
3.0.1-desi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b3d859522 | ||
|
|
079b406f18 | ||
|
|
dbe02a42c2 | ||
|
|
94365ea40e | ||
|
|
2716f9d24c | ||
|
|
92997e3e57 | ||
|
|
631b38a160 |
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 1.4 MiB |
@@ -789,6 +789,7 @@ class RuntimeDashboard extends Dashboard
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @return bool $bIsNew
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function Save()
|
||||
@@ -798,6 +799,7 @@ class RuntimeDashboard extends Dashboard
|
||||
$oUDSearch->AddCondition('user_id', UserRights::GetUserId(), '=');
|
||||
$oUDSearch->AddCondition('menu_code', $this->sId, '=');
|
||||
$oUDSet = new DBObjectSet($oUDSearch);
|
||||
$bIsNew = false;
|
||||
if ($oUDSet->Count() > 0)
|
||||
{
|
||||
// Assuming there is at most one couple {user, menu}!
|
||||
@@ -811,10 +813,12 @@ class RuntimeDashboard extends Dashboard
|
||||
$oUserDashboard->Set('user_id', UserRights::GetUserId());
|
||||
$oUserDashboard->Set('menu_code', $this->sId);
|
||||
$oUserDashboard->Set('contents', $sXml);
|
||||
$bIsNew = true;
|
||||
}
|
||||
utils::PushArchiveMode(false);
|
||||
$oUserDashboard->DBWrite();
|
||||
utils::PopArchiveMode();
|
||||
return $bIsNew;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -489,11 +489,11 @@ class Config
|
||||
'show_in_conf_sample' => true,
|
||||
],
|
||||
'cron_max_execution_time' => [
|
||||
'type' => 'integer',
|
||||
'description' => 'Duration (seconds) of the page cron.php, must be shorter than php setting max_execution_time and shorter than the web server response timeout',
|
||||
'default' => 600,
|
||||
'value' => 600,
|
||||
'source_of_value' => '',
|
||||
'type' => 'integer',
|
||||
'description' => 'Duration (seconds) of the cron.php script : if exceeded the script will exit even if there are remaining tasks to process. Must be shorter than php max_execution_time setting (note than when using CLI, this is set to 0 by default which means unlimited). If cron.php is ran via web, it must be shorter than the web server response timeout.',
|
||||
'default' => 600,
|
||||
'value' => 600,
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => true,
|
||||
],
|
||||
'cron_task_max_execution_time' => [
|
||||
@@ -886,7 +886,7 @@ class Config
|
||||
'type' => 'string',
|
||||
'description' => 'Regular expression to validate/detect the format of an URL (URL attributes and Wiki formatting for Text attributes)',
|
||||
'default' => /** @lang RegExp */
|
||||
'(https?|ftp)\://([a-zA-Z0-9+!*(),;?&=\$_.-]+(\:[a-zA-Z0-9+!*(),;?&=\$_.-]+)?@)?([a-zA-Z0-9-.]{3,})(\:[0-9]{2,5})?(/([a-zA-Z0-9:%+\$_-]\.?)+)*/?(\?[a-zA-Z+&\$_.-][a-zA-Z0-9;:[\]@&%=+/\$_.-]*)?(#[a-zA-Z_.-][a-zA-Z0-9+\$_.-]*)?',
|
||||
'(https?|ftp)\://([a-zA-Z0-9+!*(),;?&=\$_.-]+(\:[a-zA-Z0-9+!*(),;?&=\$_.-]+)?@)?([a-zA-Z0-9-.]{3,})(\:[0-9]{2,5})?(/([a-zA-Z0-9:%+\$_-]\.?)+)*/?(\?[a-zA-Z+&\$_.-][a-zA-Z0-9;:[\]@&%=+/\$_.-]*)?(#[a-zA-Z0-9_.-][a-zA-Z0-9+\$_.-]*)?',
|
||||
// SCHEME....... USER....................... PASSWORD.......................... HOST/IP........... PORT.......... PATH......................... GET............................................ ANCHOR..........................
|
||||
// Example: http://User:passWord@127.0.0.1:8888/patH/Page.php?arrayArgument[2]=something:blah20#myAnchor
|
||||
// RegExp source: http://www.php.net/manual/fr/function.preg-match.php#93824
|
||||
|
||||
@@ -4386,14 +4386,22 @@ abstract class DBObject implements iDisplay
|
||||
$sAttCode = $sPlaceholderAttCode;
|
||||
}
|
||||
|
||||
if ($sVerb == 'hyperlink')
|
||||
if (in_array($sVerb, ['hyperlink', 'url']))
|
||||
{
|
||||
$sPortalId = ($sAttCode === '') ? 'console' : $sAttCode;
|
||||
if (!array_key_exists($sPortalId, self::$aPortalToURLMaker))
|
||||
{
|
||||
throw new Exception("Unknown portal id '$sPortalId' in placeholder '$sPlaceholderAttCode''");
|
||||
}
|
||||
$ret = $this->GetHyperlink(self::$aPortalToURLMaker[$sPortalId], false);
|
||||
|
||||
if($sVerb == 'hyperlink')
|
||||
{
|
||||
$ret = $this->GetHyperlink(self::$aPortalToURLMaker[$sPortalId], false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret = ApplicationContext::MakeObjectUrl(get_class($this), $this->GetKey(), self::$aPortalToURLMaker[$sPortalId], false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -943,8 +943,6 @@ try
|
||||
}
|
||||
$oDashboard->Render($oPage, false, $aExtraParams);
|
||||
}
|
||||
//$oPage->add_ready_script("$('.ibo-dashboard table.listResults').tableHover(); $('.ibo-dashboard table.listResults')
|
||||
//.tablesorter( { widgets: ['myZebra', 'truncatedList']} );");
|
||||
break;
|
||||
|
||||
case 'reload_dashboard':
|
||||
@@ -963,12 +961,11 @@ try
|
||||
}
|
||||
$oDashboard->Render($oPage, false, $aExtraParams);
|
||||
}
|
||||
//$oPage->add_ready_script("$('.ibo-dashboard table.listResults').tableHover(); $('.ibo-dashboard table.listResults')
|
||||
//.tablesorter( { widgets: ['myZebra', 'truncatedList']} );");
|
||||
break;
|
||||
|
||||
case 'save_dashboard':
|
||||
$sDashboardId = utils::ReadParam('dashboard_id', '', false, 'context_param');
|
||||
|
||||
$aExtraParams = utils::ReadParam('extra_params', array(), false, 'raw_data');
|
||||
$sReloadURL = utils::ReadParam('reload_url', '', false, 'raw_data');
|
||||
appUserPreferences::SetPref('display_original_dashboard_'.$sDashboardId, false);
|
||||
@@ -982,14 +979,23 @@ try
|
||||
|
||||
$oDashboard = new RuntimeDashboard($sDashboardId);
|
||||
$oDashboard->FromParams($aParams);
|
||||
$oDashboard->Save();
|
||||
$bIsNew = $oDashboard->Save();
|
||||
|
||||
$sDashboardFile = addslashes(utils::ReadParam('file', '', false, 'string'));
|
||||
$sDashboardDivId = preg_replace('/[^a-zA-Z0-9_]/', '', $sDashboardId);
|
||||
|
||||
// trigger a reload of the current page since the dashboard just changed
|
||||
$oPage->add_script(
|
||||
<<<JS
|
||||
$sOperation = 'reload_dashboard';
|
||||
if ($bIsNew)
|
||||
{
|
||||
$oPage->add_script(
|
||||
<<<JS
|
||||
window.location.reload();
|
||||
JS
|
||||
);
|
||||
}
|
||||
else// trigger a reload of the current page since the dashboard just changed
|
||||
{
|
||||
$oPage->add_script(
|
||||
<<<JS
|
||||
$('.ibo-dashboard#{$sDashboardDivId}').block();
|
||||
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
|
||||
{ operation: 'reload_dashboard', dashboard_id: '{$sDashboardId}', file: '{$sDashboardFile}', extra_params: {$sJSExtraParams}, reload_url: '{$sReloadURL}'},
|
||||
@@ -999,7 +1005,8 @@ try
|
||||
}
|
||||
);
|
||||
JS
|
||||
);
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'revert_dashboard':
|
||||
|
||||
@@ -3585,6 +3585,8 @@ EOF;
|
||||
* @param $sRelativeDir
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
* @since 2.7.0 N°2498
|
||||
*/
|
||||
protected function WriteStaticOnlyHtaccess($sTempTargetDir)
|
||||
{
|
||||
@@ -3626,6 +3628,8 @@ EOF;
|
||||
* @param $sModuleVersion
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
* @since 2.7.0 N°2498
|
||||
*/
|
||||
protected function WriteStaticOnlyWebConfig($sTempTargetDir)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,6 @@ class AttributeURLDefaultPattern extends AttributeURL {
|
||||
{
|
||||
/** @noinspection OneTimeUseVariablesInspection */
|
||||
$oConfig = utils::GetConfig();
|
||||
return $oConfig->GetDefault('url_validation_pattern');
|
||||
return '^'.$oConfig->GetDefault('url_validation_pattern').'$';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ class AttributeURLTest extends ItopTestCase {
|
||||
'Sharepoint URL 2' => ['https://mydomain2.sharepoint.com/:u:/r/sites/DIS/ITSM/00_Admin_iTOP/iTop%20-%20Upgrade%20manuel/Procedure%20upgrade%20Combodo.url?csf=1&web=1&e=DAF0i3', 1],
|
||||
'Alfresco URL 2' => ['http://alfresco.mydomain3.org/share/page/site/books/document-details?nodeRef=workspace://SpacesStore/6274f55f-a25b-4762-a863-77f7066f2034', 1],
|
||||
'SF URL' => ['https://sourceforge.net/p/itop/discussion/customizing-itop/thread/707145b859/?limit=25#f53c', 1],
|
||||
'SF URL anchor starting with digit' => ['https://sourceforge.net/p/itop/discussion/customizing-itop/thread/b0a2d474ba/?limit=25#2b35', 1],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user