diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 3120f4343..fe72a8d8e 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -733,7 +733,7 @@ abstract class cmdbAbstractObject extends CMDBObject } $oUnlimitedFilter = new DBObjectSearch($sClassName); $sHtml .= "
\n"; - $sHtml .= "

".Dict::Format('UI:SearchFor_Class_Objects', $sClassesCombo)."

\n"; + $sHtml .= "

".Dict::Format('UI:SearchFor_Class_Objects', $sClassesCombo)."

\n"; $index = 0; $sHtml .= "\n"; $aFilterCriteria = $oSet->GetFilter()->GetCriteria(); @@ -904,7 +904,7 @@ abstract class cmdbAbstractObject extends CMDBObject case 'Text': $aEventsList[] ='keypress'; $aEventsList[] ='change'; - $sHTMLValue = " {$sValidationField}"; + $sHTMLValue = " {$sValidationField}"; break; case 'List': diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index b23ffe088..1da974202 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -46,11 +46,14 @@ class iTopWebPage extends NiceWebPage $this->m_sMenu = ""; $oAppContext = new ApplicationContext(); $sExtraParams = $oAppContext->GetForLink(); + $this->m_currentOrganization = $currentOrganization; $this->add_header("Content-type: text/html; charset=utf-8"); $this->add_header("Cache-control: no-cache"); - $this->m_currentOrganization = $currentOrganization; - $this->add_linked_script("../js/jquery.dimensions.js"); - $this->add_linked_script("../js/splitter.js"); + $this->add_linked_stylesheet("../css/jquery.treeview.css"); + $this->add_linked_stylesheet("../css/jquery.autocomplete.css"); +// $this->add_linked_stylesheet("../css/date.picker.css"); + $this->add_linked_script('../js/jquery.layout.min.js'); +// $this->add_linked_script("../js/jquery.dimensions.js"); $this->add_linked_script("../js/jquery.tablehover.js"); $this->add_linked_script("../js/jquery.treeview.js"); $this->add_linked_script("../js/jquery.autocomplete.js"); @@ -58,15 +61,11 @@ class iTopWebPage extends NiceWebPage $this->add_linked_script("../js/jquery.positionBy.js"); $this->add_linked_script("../js/jquery.popupmenu.js"); $this->add_linked_script("../js/date.js"); - $this->add_linked_script("../js/jquery.date.picker.js"); +// $this->add_linked_script("../js/jquery.date.picker.js"); $this->add_linked_script("../js/jquery.tablesorter.min.js"); $this->add_linked_script("../js/jquery.blockUI.js"); $this->add_linked_script("../js/utils.js"); - //$this->add_linked_script("../js/jquery-ui-personalized-1.5.3.js"); $this->add_linked_script("../js/swfobject.js"); - $this->add_linked_stylesheet("../css/jquery.treeview.css"); - $this->add_linked_stylesheet("../css/jquery.autocomplete.css"); - $this->add_linked_stylesheet("../css/date.picker.css"); $this->add_ready_script( << 0) + try { - $("#RightPane").splitter({ - type: "h" //, - //minA: 100, initA: 150, maxA: 500, - //accessKey: "_" + var myLayout; // a var is required because this page utilizes: myLayout.allowOverflow() method + + $(document).ready(function () { + // Layout + myLayout = $('body').layout({ + west : { minSize: 200, size: 300 /* TO DO: read from a cookie ?*/, spacing_open: 16, spacing_close: 16, slideTrigger_open: "mouseover", hideTogglerOnSlide: true } }); - } - - // Manually set the outer splitter's height to fill the browser window. - // This must be re-done any time the browser window is resized. - $(window).bind("resize", function(){ - var ms = $("#MySplitter"); - var top = ms.offset().top; // from dimensions.js - var wh = $(window).height(); - // Account for margin or border on the splitter container - var mrg = parseInt(ms.css("marginBottom")) || 0; - var brd = parseInt(ms.css("borderBottomWidth")) || 0; - ms.css("height", (wh-top-mrg-brd)+"px"); - - // IE fires resize for splitter; others don't so do it here - if ( !jQuery.browser.msie ) - ms.trigger("resize"); + myLayout.addPinBtn( "#tPinMenu", "west" ); + //myLayout.open( "west" ); + $('.ui-layout-resizer-west').html(''); + // Accordion Menu + $("#accordion").accordion({ header: "h3", navigation: true, autoHeight: false }); + }); - }).trigger("resize"); - - var ms = $("#MySplitter"); - ms.trigger("resize"); - - if ( $("#TopPane").length > 0) - { - $("#RightPane").trigger("resize"); - } - - $("div[id^=tabbedContent] > ul").tabs( 1, { fxFade: true, fxSpeed: 'fast' } ); // tabs + //$("div[id^=tabbedContent] > ul").tabs( 1, { fxFade: true, fxSpeed: 'fast' } ); // tabs + $("div[id^=tabbedContent]").tabs(); // tabs $("table.listResults").tableHover(); // hover tables $(".listResults").tablesorter( { headers: { 0:{sorter: false }}, widgets: ['zebra', 'truncatedList']} ); // sortable and zebra tables - $(".date-pick").datePicker( {clickInput: false, createButton: true, startDate: '1900-01-01'} ); // Date picker - $('#ModalDlg').jqm({ajax: '@href', trigger: 'a.jqmTrigger', overlay:70, modal:true, toTop:true}); // jqModal Window + $(".date-pick").datepicker({ + showOn: 'button', + buttonImage: '../images/calendar.png', + buttonImageOnly: true, + dateFormat: 'yy-mm-dd', + constrainInput: false, + changeMonth: true, + changeYear: true + }); + $('.resizable').resizable(); // Make resizable everything that claims to be resizable ! + docWidth = $(document).width(); + $('#ModalDlg').dialog({ autoOpen: false, modal: true, width: 0.8*docWidth }); // JQuery UI dialogs + ShowDebug(); + $('#logOffBtn>ul').popupmenu(); + } + catch(err) + { + // Do something with the error ! + } //$('.display_block').draggable(); // make the blocks draggable EOF @@ -161,6 +151,7 @@ EOF findValue(li); } + function formatItem(row) { return row[0]; } @@ -174,6 +165,14 @@ EOF { window.location.href = './UI.php?operation=details&class='+sClass+'&id='+id; } + + function ShowDebug() + { + if ($('#rawOutput > div').html() != '') + { + $('#rawOutput').dialog( {autoOpen: true, modal:false}); + } + } "); $this->DisplayMenu(); } @@ -183,17 +182,16 @@ EOF $this->m_sMenu .= $sHtml; } - public function DisplayMenu() - { - // Combo box to select the organization - $this->AddToMenu("
- '; // List of visible Organizations $oContext = new UserContext(); $oSearchFilter = $oContext->NewFilter("bizOrganization"); $oSet = new CMDBObjectSet($oSearchFilter); $sSelected = ($this->m_currentOrganization == '') ? ' selected' : ''; - $this->AddToMenu(""); + $sHtml .= ''; if ($oSet->Count() > 0) while($oOrg = $oSet->Fetch()) { @@ -201,24 +199,32 @@ EOF { $oCurrentOrganization = $oOrg; $sSelected = " selected"; + } else { $sSelected = ""; } - $this->AddToMenu("\n"); + $sHtml .= ''; } - $this->AddToMenu("\n"); + $sHtml .= ''; // Add other dimensions/context information to this form $oAppContext = new ApplicationContext(); $oAppContext->Reset('org_id'); // Org id is handled above and we want to be able to change it here ! - $this->AddToMenu($oAppContext->GetForForm()); - $this->AddToMenu("\n"); - $this->AddToMenu("
\n"); - $this->AddToMenu("
'; + echo ''; + echo '
'.$sLogOffMenu.'
'; + //echo '        '; + echo ' '; + echo '
'; + echo ' '; + echo $this->s_content; + echo ' '; + echo '
'; + echo ''; +/* echo "
iTop
\n"; //echo "
\n"; $sText = Utils::ReadParam('text', ''); @@ -373,50 +500,21 @@ EOF echo " \n"; echo "
\n"; - - // Render the tabs in the page (if any) - foreach($this->m_aTabs as $sTabContainerName => $m_aTabs) - { - $sTabs = ''; - $container_index = 0; - if (count($m_aTabs) > 0) - { - $sTabs = "\n
\n"; - $sTabs .= "\n"; - // Now add the content of the tabs themselves - $i = 0; - foreach($m_aTabs as $sTabName => $sTabContent) - { - $sTabs .= "
".$sTabContent."
\n"; - $i++; - } - $sTabs .= "
\n\n"; - } - $this->s_content = str_replace("\$Tabs:$sTabContainerName\$", $sTabs, $this->s_content); - $container_index++; - } + // Display the page's content echo $this->s_content; +*/ // Add the captured output if (trim($s_captured_output) != "") { - echo "
$s_captured_output
\n"; + echo "
$s_captured_output
\n"; } echo $this->s_deferred_content; - echo "
Please wait...
\n"; // jqModal Window - echo "
\n"; - echo " \n"; - echo "
"; + echo "
Please wait...
\n"; // jqModal Window + echo "
"; + echo "\n"; echo "\n"; } diff --git a/application/menunode.class.inc.php b/application/menunode.class.inc.php index c4bdd6297..fa4eb616b 100644 --- a/application/menunode.class.inc.php +++ b/application/menunode.class.inc.php @@ -136,20 +136,43 @@ class menuNode extends DBObject //$this->ProcessTemplate($sTemplate, $oPage, $aExtraParams); } - public function DisplayMenu(iTopWebPage $oP, $sType, $aExtraParams) + public function DisplayMenu(iTopWebPage $oP, $sType, $aExtraParams, $bRootLevel = true, $iActiveNodeId = -1) { - $oP->AddToMenu("
  • GetMenuLink($aExtraParams)."\" title=\"".$this->GetMenuLabel()."\">".$this->GetMenuName().""); - $oSet = $this->GetChildNodesSet($sType); - if ($oSet->Count() > 0) + $bActive = false; + if ($bRootLevel) { - $oP->AddToMenu("\n\n"); + $oP->AddToMenu("\n\n"); } - $oP->AddToMenu("
  • \n"); + else + { + $oP->AddToMenu("
  • GetMenuLink($aExtraParams)."\" title=\"".$this->GetMenuLabel()."\">".$this->GetMenuName().""); + $oSet = $this->GetChildNodesSet($sType); + if ($oSet->Count() > 0) + { + $oP->AddToMenu("\n\n"); + } + $oP->AddToMenu("
  • \n"); + } + $bResult = ($iActiveNodeId == $this->GetKey()) | $bActive; + return $bResult; } static public function DisplayCreationForm(WebPage $oP, $sClass, $sFilter, $aExtraParams = array()) { diff --git a/application/nicewebpage.class.inc.php b/application/nicewebpage.class.inc.php index a9dfbc5f6..8b59d7167 100644 --- a/application/nicewebpage.class.inc.php +++ b/application/nicewebpage.class.inc.php @@ -35,16 +35,18 @@ class NiceWebPage extends WebPage { parent::__construct($s_title); $this->m_aReadyScripts = array(); - $this->add_linked_script("../js/jquery.latest.js"); + $this->add_linked_script("../js/jquery-1.4.2.min.js"); $this->add_linked_script("../js/jquery.history_remote.pack.js"); + $this->add_linked_stylesheet('../css/ui-lightness/jquery-ui-1.8.2.custom.css'); + $this->add_linked_script('../js/jquery-ui-1.8.2.custom.min.js'); //$this->add_linked_script("../js/ui.resizable.js"); - $this->add_linked_script("../js/ui.tabs.js"); +// $this->add_linked_script("../js/ui.tabs.js"); $this->add_linked_script("../js/hovertip.js"); - $this->add_linked_script("../js/jqModal.js"); +// $this->add_linked_script("../js/jqModal.js"); $this->add_linked_stylesheet("../css/light-grey.css"); - $this->add_linked_stylesheet("../js/themes/light/light.tabs.css"); +// $this->add_linked_stylesheet("../js/themes/light/light.tabs.css"); //$this->add_linked_stylesheet("../css/jquery.tabs-ie.css", "lte IE 7"); - $this->add_linked_stylesheet("../css/jqModal.css"); +// $this->add_linked_stylesheet("../css/jqModal.css"); $this->add_ready_script(' window.setTimeout(hovertipInit, 1);'); } diff --git a/application/ui.linkswidget.class.inc.php b/application/ui.linkswidget.class.inc.php index 6da294fcd..ef2d60be7 100644 --- a/application/ui.linkswidget.class.inc.php +++ b/application/ui.linkswidget.class.inc.php @@ -255,6 +255,7 @@ class UILinksWidget protected function GetObjectPickerDialog($oPage, $sTargetClass, $sOkFunction) { + $sDialogTitle = Dict::S('UI:ManageObjectsDlg'); $sOkBtnLabel = Dict::S('UI:Button:Ok'); $sCancelBtnLabel = Dict::S('UI:Button:Cancel'); $sAddBtnLabel = Dict::S('UI:Button:AddToList'); @@ -263,9 +264,8 @@ class UILinksWidget $sLabelSelectedObjects = Dict::S('UI:Label:SelectedObjects'); $sLabelAvailableObjects = Dict::S('UI:Label:AvailableObjects'); $sHTML = <<< EOF -
    + EOF; - $oPage->add_ready_script("$('#ManageObjectsDlg_$this->m_iInputId').jqm({overlay:70, modal:true, toTop:true});"); // jqModal Window + $oPage->add_ready_script("$('#ManageObjectsDlg_$this->m_iInputId').dialog( {autoOpen: false, modal: true, width: 750, height: 350} );"); // JQuery UI dialog //$oPage->add_ready_script("UpdateObjectList('$sClass');"); return $sHTML; } @@ -309,9 +309,8 @@ EOF; $sExtKeyToMe = $oAttDef->GetExtKeyToMe(); $sExtKeyToRemote = $oAttDef->GetExtKeyToRemote(); - $sHTML = "
    \n"; + $sHTML = "
    \n"; $sHTML .= "
    \n"; - $sHTML .= "

    ".Dict::Format('UI:Link_Class_Attributes', MetaModel::GetName($sLinkedClass))."

    \n"; $sHTML .= "
    \n"; $index = 0; $aAttrsMap = array(); @@ -352,11 +351,11 @@ EOF; } } $sHTML .= $oPage->GetDetails($aDetails); - $sHTML .= "     \n"; + $sHTML .= "     \n"; $sHTML .= "
    \n"; $sHTML .= "
    \n"; $sHTML .= "
    \n"; - $oPage->add_ready_script("$('#LinkDlg_$sId').jqm({overlay:70, modal:true, toTop:true});"); // jqModal Window + $oPage->add_ready_script("$('#LinkDlg_$sId').dialog( {autoOpen: false, modal: true, width: 300 } );"); // jQuery UI dialog //$oPage->add_ready_script("UpdateObjectList('$sClass');"); return $sHTML; } diff --git a/application/uilinkswizard.class.inc.php b/application/uilinkswizard.class.inc.php index 0006641ca..cb2c015f0 100644 --- a/application/uilinkswizard.class.inc.php +++ b/application/uilinkswizard.class.inc.php @@ -145,7 +145,7 @@ class UILinksWizard $('#ModalDlg').css('width', dlgWidth); $('#ModalDlg').css('left', 50); $('#ModalDlg').css('top', 50); - $('#ModalDlg').jqmShow(); + $('#ModalDlg').dialog( 'open' ); }, 'html' ); @@ -179,18 +179,7 @@ class UILinksWizard function(data) { $('#SearchResultsToAdd').html(data); - nb_rows = $('#SearchResultsToAdd table.listResults tr').length; - if(nb_rows > 10) - { - yOffset = $('#ModalDlg').height() - $('#SearchResultsToAdd table.listResults tbody').height(); - tbodyHeight = $(document).height() - 100 - yOffset; - if ($('#ModalDlg').height() > ($(document).height() - 100)) - { - $('#SearchResultsToAdd table.listResults tbody').attr('height', tbodyHeight); - $('#SearchResultsToAdd .listResults tbody').css('overflow', 'auto'); - $('#SearchResultsToAdd .listResults').tablesorter( { headers: { 0:{sorter: false }}, widgets: ['zebra']} ); // sortable and zebra tables - } - } + $('#SearchResultsToAdd .listResults').tablesorter( { headers: { 0:{sorter: false }}, widgets: ['zebra']} ); // sortable and zebra tables }, 'html' @@ -248,7 +237,7 @@ class UILinksWizard }, 'html' ); - $('#ModalDlg').jqmHide(); + $('#ModalDlg').dialog('close'); return false; } @@ -287,7 +276,7 @@ EOF $this->DisplayFormTable($oP, $this->m_aTableConfig, $aForm); $oP->add("     "); $oP->add("   m_sLinkedClass))."\" onClick=\"AddObjects();\">\n"); - $oP->add(""); + $oP->add("m_iObjectId.");\">"); $oP->add("   \n"); $oP->add("

     

    \n"); $oP->add("
    \n"); @@ -380,9 +369,9 @@ EOF $sTargetClass = $oAttDef->GetTargetClass(); $oTargetObj = $oContext->GetObject($sTargetClass, $this->m_iObjectId); $oP->add("
    \n"); - $oP->add("
    \n"); - $oP->add("

    ".Dict::Format('UI:AddObjectsOf_Class_LinkedWith_Class_Instance', MetaModel::GetName($this->m_sLinkedClass), MetaModel::GetName(get_class($oTargetObj)), "".$oTargetObj->GetHyperlink()."")."

    \n"); - $oP->add("
    \n"); + //$oP->add("
    \n"); + //$oP->add("

    ".Dict::Format('UI:AddObjectsOf_Class_LinkedWith_Class_Instance', MetaModel::GetName($this->m_sLinkedClass), MetaModel::GetName(get_class($oTargetObj)), "".$oTargetObj->GetHyperlink()."")."

    \n"); + //$oP->add("
    \n"); $oFilter = $oContext->NewFilter($this->m_sLinkedClass); $oSet = new CMDBObjectSet($oFilter); @@ -392,9 +381,10 @@ EOF $oP->Add("
    \n"); $oP->Add("

    ".Dict::S('UI:Message:EmptyList:UseSearchForm')."

    \n"); $oP->Add("
    \n"); - $oP->add("  "); + $oP->add("  "); $oP->Add("
    \n"); $oP->Add("\n"); + $oP->add_ready_script("$('#ModalDlg').dialog('option', {title:'".Dict::Format('UI:AddObjectsOf_Class_LinkedWith_Class_Instance', MetaModel::GetName($this->m_sLinkedClass), MetaModel::GetName(get_class($oTargetObj)), "".$oTargetObj->GetHyperlink()."")."'});"); $oP->add_ready_script("$('div#SearchFormToAdd form').bind('submit.uilinksWizard', SubmitHook);"); } diff --git a/pages/ajax.render.php b/pages/ajax.render.php index 3ab4346ed..953c8346e 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -241,6 +241,8 @@ switch($operation) $sExtKeyToRemote = utils::ReadParam('sextkeytoremote', ''); $iObjectId = utils::ReadParam('id', -1); UILinksWidget::RenderSet($oPage, $sClass, $sJSONSet, $sExtKeyToMe, $sExtKeyToRemote, $iObjectId); + $iFieldId = utils::ReadParam('myid', '-1'); + $oPage->add_ready_script("$('#{$iFieldId}').trigger('validate');"); break; case 'autocomplete': diff --git a/pages/csvimport.php b/pages/csvimport.php index 591e34865..c69880abc 100644 --- a/pages/csvimport.php +++ b/pages/csvimport.php @@ -864,7 +864,7 @@ function SelectOptions(WebPage $oPage) $oPage->add('

    '.Dict::S('UI:Title:CSVImportStep2').'

    '); $oPage->add('
    '); - $oPage->add('
    '); + $oPage->add('
    '); $oPage->add('
    '); $oPage->add('

    '.Dict::S('UI:CSVImport:SeparatorCharacter').'

    '); $oPage->add('

    '.Dict::S('UI:CSVImport:SeparatorComma+').'
    '); @@ -872,13 +872,13 @@ function SelectOptions(WebPage $oPage) $oPage->add(' '.Dict::S('UI:CSVImport:SeparatorTab+').'
    '); $oPage->add(' '.Dict::S('UI:CSVImport:SeparatorOther').' '); $oPage->add('

    '); - $oPage->add('
    '); + $oPage->add(''); $oPage->add('

    '.Dict::S('UI:CSVImport:TextQualifierCharacter').'

    '); $oPage->add('

    '.Dict::S('UI:CSVImport:QualifierDoubleQuote+').'
    '); $oPage->add(' '.Dict::S('UI:CSVImport:QualifierSimpleQuote+').'
    '); $oPage->add(' '.Dict::S('UI:CSVImport:QualifierOther').' '); $oPage->add('

    '); - $oPage->add('
    '); + $oPage->add(''); $oPage->add('

    '.Dict::S('UI:CSVImport:CommentsAndHeader').'

    '); $oPage->add('

    '.Dict::S('UI:CSVImport:TreatFirstLineAsHeader').'

    '); $oPage->add('

    '.Dict::Format('UI:CSVImport:Skip_N_LinesAtTheBeginning', '').'

    ');