mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-18 14:03:19 +01:00
38 lines
890 KiB
JavaScript
38 lines
890 KiB
JavaScript
|
/*!
|
||
|
* EGroupware (http://www.egroupware.org/) minified Javascript
|
||
|
*
|
||
|
* full sources are available under https://svn.stylite.de/viewvc/egroupware/
|
||
|
*
|
||
|
* build Mon Mar 07 2016 14:56:03
|
||
|
*/
|
||
|
|
||
|
function et2_loadXMLFromURL(_url,_callback,_context){"undefined"==typeof _context&&(_context=null);var win;try{opener&&opener.etemplate2&&(win=opener)}catch(e){}"undefined"==typeof win&&(win=top),win.jQuery.ajax({url:_url,context:_context,type:"GET",dataType:"xml",success:function(_data,_status,_xmlhttp){_callback.call(_context,_data.documentElement)},error:function(_xmlhttp,_err){egw().debug("error","Loading eTemplate from "+_url+" failed! "+_xmlhttp.status+" "+_xmlhttp.statusText)}})}function et2_directChildrenByTagName(_node,_tagName){_tagName=_tagName.toLowerCase();for(var result=[],i=0;i<_node.childNodes.length;i++)_tagName==_node.childNodes[i].nodeName.toLowerCase()&&result.push(_node.childNodes[i]);return result}function et2_filteredNodeIterator(_node,_callback,_context){for(var i=0;i<_node.childNodes.length;i++){var node=_node.childNodes[i],nodeName=node.nodeName.toLowerCase();"#"!=nodeName.charAt(0)&&_callback.call(_context,node,nodeName)}}function et2_readAttrWithDefault(_node,_name,_default){var val=_node.getAttribute(_name);return null===val?_default:val}function et2_evalBool(_val){return"string"!=typeof _val||"false"!=_val&&"0"!=_val?!!_val:!1}function et2_form_name(_cname,_name){for(var parts=[],i=0;i<arguments.length;++i){var name=arguments[i];"string"==typeof name&&name.length>0&&(parts=parts.concat(name.replace(/]/g,"").split("[")))}var name=parts.shift();return parts.length?name+"["+parts.join("][")+"]":name}function et2_checkType(_val,_type,_attr,_widget){function _err(){var res=et2_typeDefaults[_type];return"undefined"!=typeof _val&&_val&&egw.debug("warn","Widget %o: '"+_val+"' was not of specified _type '"+_type+(null!=_attr?"' for attribute '"+_attr+"' ":"")+"and is now '"+res+"'",_widget),res}if("undefined"==typeof _attr&&(_attr=null),"any"==_type)return _val;if(_val===et2_typeDefaults[_type])return _val;if("boolean"==_type){if(_val===!0||_val===!1)return _val;if("string"==typeof _val){var lcv=_val.toLowerCase();if("true"===lcv||"false"===lcv||""===lcv)return"true"===_val;if("0"===lcv||"1"===lcv)return"1"===_val}else if("number"==typeof _val)return 0!=_val;return _err()}if("string"==_type||"html"==_type||"rawstring"==_type)return"number"==typeof _val?_val.toString():"string"==typeof _val?"string"==_type?html_entity_decode(_val):_val:"object"==typeof _val&&jQuery.isEmptyObject(_val)?"":_err();if("float"==_type)return"number"==typeof _val?_val:isNaN(_val)?_err():parseFloat(_val);if("integer"==_type)return parseInt(_val)==_val?parseInt(_val):_err();if("dimension"==_type)return"auto"==_val?_val:isNaN(_val)?"string"==typeof _val&&(_val.indexOf("px")==_val.length-2&&!isNaN(_val.split("px")[0])||_val.indexOf("%")==_val.length-1&&!isNaN(_val.split("%")[0]))?_val:_err():parseFloat(_val)+"px";if("js"==_type){if("function"==typeof _val||"undefined"==typeof _val)return _val;if(_val&&(_val=_val.replace(/window\.close\(\)/g,"egw(window).close()")),"string"==typeof _val&&"app."==_val.substr(0,4)&&window.app){for(var parts=_val.split("."),func=parts.pop(),parent=window,i=0;i<parts.length&&"undefined"!=typeof parent[parts[i]];++i)parent=parent[parts[i]];if("function"==typeof parent[func])try{return jQuery.proxy(parent[func],parent)}catch(e){return req.egw.debug("error","Function",_val),_err()}}if(!_val||"string"==typeof _val)return _val}throw"Invalid type identifier '"+_attr+"': '"+_type+"'"}function et2_validateAttrib(_id,_attrib){"undefined"==typeof _attrib.ignore&&(_attrib.ignore=!1),_attrib.ignore||("undefined"==typeof _attrib.name&&(_attrib.name=_id,egw.debug("log","Human name ('name'-Field) for attribute '"+_id+"' has not been supplied, set to '"+_id+"'")),"undefined"==typeof _attrib.description&&(_attrib.description="",egw.debug("log","Description for attribute '"+_id+"' has not been supplied")),"undefined"==typeof _attrib.type?_attrib.type="any":et2_validTypes.indexOf(_attrib.type)<0&&egw.debug("error","Invalid type '"+_attrib.type+"' for attribute '"+_id+"' supplied. Valid types are ",et2_validTypes),"undefined"==typeof _attrib.default&&(_attrib.default=et2_typeDefaults[_attrib.type]))}function et2_array
|
||
|
}function convertStringToBoolean(t){switch("string"==typeof t&&(t=t.toLowerCase()),t){case"1":case"true":case"yes":case"y":case 1:case!0:return!0;default:return!1}}function getUrlSymbol(t){return-1!=t.indexOf("?")?"&":"?"}function dhtmlDragAndDropObject(){return window.dhtmlDragAndDrop?window.dhtmlDragAndDrop:(this.lastLanding=0,this.dragNode=0,this.dragStartNode=0,this.dragStartObject=0,this.tempDOMU=null,this.tempDOMM=null,this.waitDrag=0,window.dhtmlDragAndDrop=this,this)}function _dhtmlxError(){return this.catches||(this.catches=[]),this}function dhtmlXHeir(t,e){for(var n in e)"function"==typeof e[n]&&(t[n]=e[n]);return t}function dhtmlxEvent(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)}function dhtmlxDetachEvent(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&t.detachEvent("on"+e,n)}function dhtmlxDnD(t,e){e&&(this._settings=e),dhtmlxEventable(this),dhtmlxEvent(t,"mousedown",dhtmlx.bind(function(e){this.dragStart(t,e)},this))}function dataProcessor(t){return this.serverProcessor=t,this.action_param="!nativeeditor_status",this.object=null,this.updatedRows=[],this.autoUpdate=!0,this.updateMode="cell",this._tMode="GET",this.post_delim="_",this._waitMode=0,this._in_progress={},this._invalid={},this.mandatoryFields=[],this.messages=[],this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"},this.enableUTFencoding(!0),dhtmlxEventable(this),this}function itempickerDocumentAction(context,data){"use strict";var formid="itempicker_action_form",form="<form id='"+formid+"' action='index.php?menuaction="+data.app+"."+data.app+"_merge.download_by_request' method='POST'><input type='hidden' name='data_document_name' value='"+data.value.name+"' /><input type='hidden' name='data_document_dir' value='"+data.value.dir+"' /><input type='hidden' name='data_checked' value='"+data.checked.join(",")+"' /></form>";$j("body").append(form),$j("#"+formid).submit().remove()}function etemplate2(_container,_menuaction){"undefined"==typeof _menuaction&&(_menuaction="home.etemplate_new.ajax_process_content.etemplate"),this.DOMContainer=_container,this.menuaction=_menuaction,this.uniqueId=_container.getAttribute("id")?_container.getAttribute("id").replace(".","-"):"",this.widgetContainer=null}function etemplate2_handle_load(_type,_response){var data=_response.data;if(jQuery.isArray(data["refresh-opener"])&&window.opener){var egw=window.egw(opener);egw.refresh.apply(egw,data["refresh-opener"])}var egw=window.egw(window);if("object"==typeof data.data&&"string"==typeof data.data.app_header&&(egw.app_header(data.data.app_header,data.data.currentapp||null),delete data.data.app_header),jQuery.isArray(data.message)&&egw.message.apply(egw,data.message),data["window-close"])return"string"==typeof data["window-close"]&&"true"!==data["window-close"]&&alert(data["window-close"]),egw.close(),!0;if(data["window-focus"]&&window.focus(),window.framework&&jQuery.isArray(data.setSidebox)&&window.framework.setSidebox.apply(window.framework,data.setSidebox),"string"==typeof data.url&&"object"==typeof data.data){if("function"==typeof this.load)return this.load(data.name,data.url,data.data),!0;var node=document.getElementById(data.DOMNodeID);if(node){if(node.children.length){var old=etemplate2.getById(node.id);old&&old.clear()}var et2=new etemplate2(node);return et2.load(data.name,data.url,data.data),!0}egw.debug("error","Could not find target node %s",data.DOMNodeId)}throw"Error while parsing et2_load response"}function etemplate2_handle_validation_error(_type,_response){for(var id in _response.data){var widget=this.widgetContainer.getWidgetById(id);if(widget){widget.showMessage(_response.data[id],"validation_error");for(var tmpWidget=widget;tmpWidget._parent&&"tabbox"!=tmpWidget._type;)tmpWidget=tmpWidget._parent;"tabbox"==tmpWidget._type&&tmpWidget.activateTab(widget)}}egw().debug("warn","Validat
|
||
|
this.height=_value;var node=this.getDOMNode(this);node&&$j(node).css("height",_value)},set_class:function(_value){var node=this.getDOMNode(this);node&&(this.class&&$j(node).removeClass(this.class),$j(node).addClass(_value)),this.class=_value},set_overflow:function(_value){this.overflow=_value;var node=this.getDOMNode(this);node&&$j(node).css("overflow",_value)},set_data:function(_value){var node=this.getDOMNode(this);if(node&&_value)for(var pairs=_value.split(/,/g),i=0;i<pairs.length;++i){var name_value=pairs[i].split(":");$j(node).attr("data-"+name_value[0],name_value[1])}},set_background:function(_value){var node=this.getDOMNode(this),values="";_value&&node&&(values=_value.split(","),jQuery(node).css({"background-image":'url("'+values[0]+'")',"background-position-x":values[1],"background-position-y":values[2],"background-scale":values[3]}))},set_actions:function(actions){if(""==this.id||"undefined"==typeof this.id)return void this.egw().debug("warn","Widget should have an ID if you want actions",this);var gam=egw_getActionManager(this.egw().appName,!0,1);"object"!=typeof this._actionManager&&(null!==gam.getActionById(this.getInstanceManager().uniqueId,1)&&(gam=gam.getActionById(this.getInstanceManager().uniqueId,1)),null!=gam.getActionById(this.id,1)?this._actionManager=gam.getActionById(this.id,1):this._actionManager=gam.addAction("actionManager",this.id)),this._actionManager.updateActions(actions),this.options.default_execute&&this._actionManager.setDefaultExecute(this.options.default_execute),this._actionManager.data={widget:this},this._link_actions(actions)},set_default_execute:function(_default_execute){this.options.default_execute=_default_execute,this._actionManager&&this._actionManager.setDefaultExecute(null,_default_execute)},_get_action_links:function(actions){var action_links=[];for(var i in actions){var action=actions[i];action_links.push("undefined"!=typeof action.id?action.id:i)}return action_links},_link_actions:function(actions){var objectManager=egw_getAppObjectManager(!0),widget_object=objectManager.getObjectById(this.id);null==widget_object?widget_object=objectManager.insertObject(!1,new egwActionObject(this.id,objectManager,new et2_action_object_impl(this),this._actionManager||objectManager.manager.getActionById(this.id)||objectManager.manager)):widget_object.setAOI(new et2_action_object_impl(this,this.getDOMNode())),widget_object.clear(),widget_object.unregisterActions();var action_links=this._get_action_links(actions);widget_object.updateActionLinks(action_links)}})}.call(this),et2_surroundingsMgr=function(){"use strict";return ClassWithAttributes.extend({init:function(_widget){this.widget=_widget,this._widgetContainer=null,this._widgetSurroundings=[],this._widgetPlaceholder=null,this._widgetNode=null,this._ownPlaceholder=!0},destroy:function(){this._widgetContainer=null,this._widgetSurroundings=null,this._widgetPlaceholder=null,this._widgetNode=null},prependDOMNode:function(_node){this._widgetSurroundings.unshift(_node),this._surroundingsUpdated=!0},appendDOMNode:function(_node){this._ownPlaceholder&&null==this._widgetPlaceholder&&(this._widgetPlaceholder=document.createElement("span"),this._widgetSurroundings.push(this._widgetPlaceholder)),this._widgetSurroundings.push(_node),this._surroundingsUpdated=!0},insertDOMNode:function(_node){if(!this._ownPlaceholder||null==this._widgetPlaceholder)return void this.appendDOMNode(_node);var idx=this._widgetSurroundings.indexOf(this._widgetPlaceholder);this._widgetSurroundings.splice(idx,1,_node),this._widgetPlaceholder=null,this._ownPlaceholder=!1},removeDOMNode:function(_node){for(var i=0;this._widgetSurroundings&&i<this._widgetSurroundings.length;i++)if(this._widgetSurroundings[i]==_node){this._widgetSurroundings.splice(i,1),this._surroundingsUpdated=!0;break}},setWidgetPlaceholder:function(_node){if(_node!=this._widgetPlaceholder){if(null!=_node&&this._ownPlaceholder&&null!=this._widgetPlaceholder){var idx=this._widgetSurroundings.indexOf(this._widgetPlaceholder);this._widgetSurroundings.splice(idx,1),this._widgetPlaceholder=null,this._ownPlaceholder=
|
||
|
label:{name:"Label",type:"string",default:"",description:"Label for group box",translate:!0}},init:function(){this._super.apply(this,arguments);var legend=jQuery(document.createElement("legend")).text(this.options.label);this.setDOMNode(legend[0])}})}.call(this);et2_register_widget(et2_groupbox_legend,["caption"]),function($){var splitterCounter=0;$.fn.splitter=function(args){return args=args||{},this.each(function(){function setBarState(state){bar.removeClass(opts.barStateClasses).addClass(state)}function startSplitMouse(evt){1==evt.which&&(bar.removeClass(opts.barHoverClass),opts.outline&&(zombie=zombie||bar.clone(!1).insertAfter(A),bar.removeClass(opts.barDockedClass)),setBarState(opts.barActiveClass),panes.css("-webkit-user-select","none").find("iframe").andSelf().filter("iframe").addClass(opts.iframeClass),A._posSplit=A[0][opts.pxSplit]-evt[opts.eventPos],$(document).bind("mousemove"+opts.eventNamespace,doSplitMouse).bind("mouseup"+opts.eventNamespace,endSplitMouse))}function doSplitMouse(evt){var pos=A._posSplit+evt[opts.eventPos],range=Math.max(0,Math.min(pos,splitter._DA-bar._DA)),limit=Math.max(A._min,splitter._DA-B._max,Math.min(pos,A._max,splitter._DA-bar._DA-B._min));opts.outline?(opts.dockPane==A&&pos<Math.max(A._min,bar._DA)||opts.dockPane==B&&pos>Math.min(pos,A._max,splitter._DA-bar._DA-B._min)?bar.addClass(opts.barDockedClass).css(opts.origin,range):bar.removeClass(opts.barDockedClass).css(opts.origin,limit),bar._DA=bar[0][opts.pxSplit]):resplit(pos),setBarState(pos==limit?opts.barActiveClass:opts.barLimitClass)}function endSplitMouse(evt){setBarState(opts.barNormalClass),bar.addClass(opts.barHoverClass);var pos=A._posSplit+evt[opts.eventPos];opts.outline&&(zombie.remove(),zombie=null,resplit(pos)),panes.css("-webkit-user-select","text").find("iframe").andSelf().filter("iframe").removeClass(opts.iframeClass),$(document).unbind("mousemove"+opts.eventNamespace+" mouseup"+opts.eventNamespace)}function resplit(pos){bar._DA=bar[0][opts.pxSplit],opts.dockPane==A&&pos<Math.max(A._min,bar._DA)||opts.dockPane==B&&pos>Math.min(pos,A._max,splitter._DA-bar._DA-B._min)?(bar.addClass(opts.barDockedClass),bar._DA=bar[0][opts.pxSplit],pos=opts.dockPane==A?0:splitter._DA-bar._DA,null==bar._pos&&(bar._pos=A[0][opts.pxSplit])):(bar.removeClass(opts.barDockedClass),bar._DA=bar[0][opts.pxSplit],bar._pos=null,pos=Math.max(A._min,splitter._DA-B._max,Math.min(pos,A._max,splitter._DA-bar._DA-B._min))),bar.css(opts.origin,pos).css(opts.fixed,splitter._DF),A.css(opts.origin,0).css(opts.split,pos).css(opts.fixed,splitter._DF),B.css(opts.origin,pos+bar._DA).css(opts.split,splitter._DA-bar._DA-pos).css(opts.fixed,splitter._DF),panes.trigger("resize"+opts.eventNamespace)}function dimSum(jq,dims){for(var sum=0,i=1;i<arguments.length;i++)sum+=Math.max(parseInt(jq.css(arguments[i]),10)||0,0);return sum}if(!$(this).is(".splitter")){var zombie,vh=(args.splitHorizontal?"h":args.splitVertical?"v":args.type)||"v",opts=$.extend({splitterClass:"splitter ui-widget ui-widget-content",paneClass:"splitter-pane",barClass:"splitter-bar",barNormalClass:"ui-state-default",barHoverClass:"ui-state-hover",barActiveClass:"ui-state-highlight",barLimitClass:"ui-state-error",iframeClass:"splitter-iframe-hide",eventNamespace:".splitter"+ ++splitterCounter,pxPerKey:8,tabIndex:0,accessKey:""},{v:{keyLeft:39,keyRight:37,cursor:"e-resize",barStateClass:"splitter-bar-vertical",barDockedClass:"splitter-bar-vertical-docked"},h:{keyTop:40,keyBottom:38,cursor:"n-resize",barStateClass:"splitter-bar-horizontal",barDockedClass:"splitter-bar-horizontal-docked"}}[vh],args,{v:{type:"v",eventPos:"pageX",origin:"left",split:"width",pxSplit:"offsetWidth",side1:"Left",side2:"Right",fixed:"height",pxFixed:"offsetHeight",side3:"Top",side4:"Bottom"},h:{type:"h",eventPos:"pageY",origin:"top",split:"height",pxSplit:"offsetHeight",side1:"Top",side2:"Bottom",fixed:"width",pxFixed:"offsetWidth",side3:"Left",side4:"Right"}}[vh]);opts.barStateClasses=[opts.barNormalClass,opts.barHoverClass,opts.barActiveClass,opts.barLimitClass].join(" ");var splitter=$(this).css({position:"relative"}).ad
|
||
|
if(""!=e.target.value||e.target==hex.get(0)||(null==bindedHex||e.target==bindedHex.get(0))&&null!=bindedHex){if(!validateKey(e))return e;switch(e.target){case red.get(0):switch(e.keyCode){case 38:return red.val(setValueInRange.call($this,(red.val()<<0)+1,0,255)),color.val("r",red.val(),e.target),!1;case 40:return red.val(setValueInRange.call($this,(red.val()<<0)-1,0,255)),color.val("r",red.val(),e.target),!1}break;case green.get(0):switch(e.keyCode){case 38:return green.val(setValueInRange.call($this,(green.val()<<0)+1,0,255)),color.val("g",green.val(),e.target),!1;case 40:return green.val(setValueInRange.call($this,(green.val()<<0)-1,0,255)),color.val("g",green.val(),e.target),!1}break;case blue.get(0):switch(e.keyCode){case 38:return blue.val(setValueInRange.call($this,(blue.val()<<0)+1,0,255)),color.val("b",blue.val(),e.target),!1;case 40:return blue.val(setValueInRange.call($this,(blue.val()<<0)-1,0,255)),color.val("b",blue.val(),e.target),!1}break;case alpha&&alpha.get(0):switch(e.keyCode){case 38:return alpha.val(setValueInRange.call($this,parseFloat(alpha.val())+1,0,100)),color.val("a",Math.precision(255*alpha.val()/100,alphaPrecision),e.target),!1;case 40:return alpha.val(setValueInRange.call($this,parseFloat(alpha.val())-1,0,100)),color.val("a",Math.precision(255*alpha.val()/100,alphaPrecision),e.target),!1}break;case hue.get(0):switch(e.keyCode){case 38:return hue.val(setValueInRange.call($this,(hue.val()<<0)+1,0,360)),color.val("h",hue.val(),e.target),!1;case 40:return hue.val(setValueInRange.call($this,(hue.val()<<0)-1,0,360)),color.val("h",hue.val(),e.target),!1}break;case saturation.get(0):switch(e.keyCode){case 38:return saturation.val(setValueInRange.call($this,(saturation.val()<<0)+1,0,100)),color.val("s",saturation.val(),e.target),!1;case 40:return saturation.val(setValueInRange.call($this,(saturation.val()<<0)-1,0,100)),color.val("s",saturation.val(),e.target),!1}break;case value.get(0):switch(e.keyCode){case 38:return value.val(setValueInRange.call($this,(value.val()<<0)+1,0,100)),color.val("v",value.val(),e.target),!1;case 40:return value.val(setValueInRange.call($this,(value.val()<<0)-1,0,100)),color.val("v",value.val(),e.target),!1}}}},keyUp=function(e){if(""!=e.target.value||e.target==hex.get(0)||(null==bindedHex||e.target==bindedHex.get(0))&&null!=bindedHex){if(!validateKey(e))return e;switch(e.target){case red.get(0):red.val(setValueInRange.call($this,red.val(),0,255)),color.val("r",red.val(),e.target);break;case green.get(0):green.val(setValueInRange.call($this,green.val(),0,255)),color.val("g",green.val(),e.target);break;case blue.get(0):blue.val(setValueInRange.call($this,blue.val(),0,255)),color.val("b",blue.val(),e.target);break;case alpha&&alpha.get(0):alpha.val(setValueInRange.call($this,alpha.val(),0,100)),color.val("a",Math.precision(255*alpha.val()/100,alphaPrecision),e.target);break;case hue.get(0):hue.val(setValueInRange.call($this,hue.val(),0,360)),color.val("h",hue.val(),e.target);break;case saturation.get(0):saturation.val(setValueInRange.call($this,saturation.val(),0,100)),color.val("s",saturation.val(),e.target);break;case value.get(0):value.val(setValueInRange.call($this,value.val(),0,100)),color.val("v",value.val(),e.target);break;case hex.get(0):hex.val(hex.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6)),bindedHex&&bindedHex.val(hex.val()),color.val("hex",""!=hex.val()?hex.val():null,e.target);break;case bindedHex&&bindedHex.get(0):bindedHex.val(bindedHex.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6)),hex.val(bindedHex.val()),color.val("hex",""!=bindedHex.val()?bindedHex.val():null,e.target);break;case ahex&&ahex.get(0):ahex.val(ahex.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,2)),color.val("a",null!=ahex.val()?parseInt(ahex.val(),16):null,e.target)}}},blur=function(e){if(null!=color.val())switch(e.target){case red.get(0):red.val(color.val("r"));break;case green.get(0):green.val(color.val("g"));break;case blue.get(0):blue.val(color.val("b"));break;case alpha&&alpha.get(0):alpha.val(Math.precision(100*color.val("a")/255,alphaPr
|
||
|
win.expandable?(container.html(controlHtml),0==$(document.body).children("div.jPicker.Container").length?$(document.body).prepend(container):$(document.body).children("div.jPicker.Container:last").after(container),container.mousedown(function(){$(document.body).children("div.jPicker.Container").css({zIndex:10}),container.css({zIndex:20})}),container.css({left:"left"==win.position.x?popup.offset().left-530-("center"==win.position.y?25:0)+"px":"center"==win.position.x?popup.offset().left-260+"px":"right"==win.position.x?popup.offset().left-10+("center"==win.position.y?25:0)+"px":"screenCenter"==win.position.x?($(document).width()>>1)-260+"px":popup.offset().left+parseInt(win.position.x)+"px",position:"absolute",top:"top"==win.position.y?popup.offset().top-312+"px":"center"==win.position.y?popup.offset().top-156+"px":"bottom"==win.position.y?popup.offset().top+25+"px":popup.offset().top+parseInt(win.position.y)+"px"})):(container=$($this),container.html(controlHtml));var tbody=container.find("tbody:first");colorMapDiv=tbody.find("div.Map:first"),colorBarDiv=tbody.find("div.Bar:first");var MapMaps=colorMapDiv.find("span"),BarMaps=colorBarDiv.find("span");colorMapL1=MapMaps.filter(".Map1:first"),colorMapL2=MapMaps.filter(".Map2:first"),colorMapL3=MapMaps.filter(".Map3:first"),colorBarL1=BarMaps.filter(".Map1:first"),colorBarL2=BarMaps.filter(".Map2:first"),colorBarL3=BarMaps.filter(".Map3:first"),colorBarL4=BarMaps.filter(".Map4:first"),colorBarL5=BarMaps.filter(".Map5:first"),colorBarL6=BarMaps.filter(".Map6:first"),colorMap=new Slider(colorMapDiv,{map:{width:images.colorMap.width,height:images.colorMap.height},arrow:{image:images.clientPath+images.colorMap.arrow.file,width:images.colorMap.arrow.width,height:images.colorMap.arrow.height}}),colorMap.bind(mapValueChanged),colorBar=new Slider(colorBarDiv,{map:{width:images.colorBar.width,height:images.colorBar.height},arrow:{image:images.clientPath+images.colorBar.arrow.file,width:images.colorBar.arrow.width,height:images.colorBar.arrow.height}}),colorBar.bind(colorBarValueChanged),colorPicker=new ColorValuePicker(tbody,color.active,win.expandable&&win.bindToInput?win.input:null,win.alphaPrecision);var hex=null!=all?all.hex:null,preview=tbody.find(".Preview"),button=tbody.find(".Button");if(activePreview=preview.find(".Active:first").css({backgroundColor:hex&&"#"+hex||"transparent"}),currentPreview=preview.find(".Current:first").css({backgroundColor:hex&&"#"+hex||"transparent"}).bind("click",currentClicked),setAlpha.call($this,currentPreview,Math.precision(100*color.current.val("a"))/255,4),okButton=button.find(".Ok:first").bind("click",okClicked),cancelButton=button.find(".Cancel:first").bind("click",cancelClicked),grid=button.find(".Grid:first"),setTimeout(function(){setImg.call($this,colorMapL1,images.clientPath+"Maps.png"),setImg.call($this,colorMapL2,images.clientPath+"Maps.png"),setImg.call($this,colorMapL3,images.clientPath+"map-opacity.png"),setImg.call($this,colorBarL1,images.clientPath+"Bars.png"),setImg.call($this,colorBarL2,images.clientPath+"Bars.png"),setImg.call($this,colorBarL3,images.clientPath+"Bars.png"),setImg.call($this,colorBarL4,images.clientPath+"Bars.png"),setImg.call($this,colorBarL5,images.clientPath+"bar-opacity.png"),setImg.call($this,colorBarL6,images.clientPath+"AlphaBar.png"),setImg.call($this,preview.find("div:first"),images.clientPath+"preview-opacity.png")},0),tbody.find("td.Radio input").bind("click",radioClicked),color.quickList&&color.quickList.length>0){var html="";for(i=0;i<color.quickList.length;i++){"string"==(typeof color.quickList[i]).toString().toLowerCase()&&(color.quickList[i]=new Color({hex:color.quickList[i]}));var alpha=color.quickList[i].val("a"),ahex=color.quickList[i].val("ahex");!win.alphaSupport&&ahex&&(ahex=ahex.substring(0,6)+"ff");var quickHex=color.quickList[i].val("hex");html+='<span class="QuickColor"'+(ahex&&' title="#'+ahex+'"'||"")+' style="background-color:'+(quickHex&&"#"+quickHex||"")+";"+(quickHex?"":"background-image:url("+images.clientPath+"NoColor.png)")+(win.alphaSupport&&alpha&&255>alpha?";opacity:"+Math.
|
||
|
backgroundSize===!0&&(backgroundSize="contain"),backgroundSize=this.support.backgroundSize&&this.support.backgroundSize[backgroundSize]&&backgroundSize,backgroundSize?element=this.elementPrototype.cloneNode(!1):(element=img,img.draggable=!1),title&&(element.title=title),$(img).on("load error",callbackWrapper),img.src=url,element},createElement:function(obj,callback){var type=obj&&this.getItemProperty(obj,this.options.typeProperty),factory=type&&this[type.split("/")[0]+"Factory"]||this.imageFactory,element=obj&&factory.call(this,obj,callback);return element||(element=this.elementPrototype.cloneNode(!1),this.setTimeout(callback,[{type:"error",target:element}])),$(element).addClass(this.options.slideContentClass),element},loadElement:function(index){this.elements[index]||(this.slides[index].firstChild?this.elements[index]=$(this.slides[index]).hasClass(this.options.slideErrorClass)?3:2:(this.elements[index]=1,$(this.slides[index]).addClass(this.options.slideLoadingClass),this.slides[index].appendChild(this.createElement(this.list[index],this.proxyListener))))},loadElements:function(index){var i,limit=Math.min(this.num,2*this.options.preloadRange+1),j=index;for(i=0;limit>i;i+=1)j+=i*(i%2===0?-1:1),j=this.circle(j),this.loadElement(j)},unloadElements:function(index){var i,slide,diff;for(i in this.elements)this.elements.hasOwnProperty(i)&&(diff=Math.abs(index-i),diff>this.options.preloadRange&&diff+this.options.preloadRange<this.num&&(slide=this.slides[i],slide.removeChild(slide.firstChild),delete this.elements[i]))},addSlide:function(index){var slide=this.slidePrototype.cloneNode(!1);slide.setAttribute("data-index",index),this.slidesContainer[0].appendChild(slide),this.slides.push(slide)},positionSlide:function(index){var slide=this.slides[index];slide.style.width=this.slideWidth+"px",this.support.transform&&(slide.style.left=index*-this.slideWidth+"px",this.move(index,this.index>index?-this.slideWidth:this.index<index?this.slideWidth:0,0))},initSlides:function(reload){var clearSlides,i;for(reload||(this.positions=[],this.positions.length=this.num,this.elements={},this.imagePrototype=document.createElement("img"),this.elementPrototype=document.createElement("div"),this.slidePrototype=document.createElement("div"),$(this.slidePrototype).addClass(this.options.slideClass),this.slides=this.slidesContainer[0].children,clearSlides=this.options.clearSlides||this.slides.length!==this.num),this.slideWidth=this.container[0].offsetWidth,this.slideHeight=this.container[0].offsetHeight,this.slidesContainer[0].style.width=this.num*this.slideWidth+"px",clearSlides&&this.resetSlides(),i=0;i<this.num;i+=1)clearSlides&&this.addSlide(i),this.positionSlide(i);this.options.continuous&&this.support.transform&&(this.move(this.circle(this.index-1),-this.slideWidth,0),this.move(this.circle(this.index+1),this.slideWidth,0)),this.support.transform||(this.slidesContainer[0].style.left=this.index*-this.slideWidth+"px")},toggleControls:function(){var controlsClass=this.options.controlsClass;this.container.hasClass(controlsClass)?this.container.removeClass(controlsClass):this.container.addClass(controlsClass)},toggleSlideshow:function(){this.interval?this.pause():(this.play(),this.options.toggleFullscreenOnSlideShow&&this.requestFullScreen(this.container[0]))},toggleFullscreen:function(){this.getFullScreenElement()?this.exitFullScreen():this.requestFullScreen(this.container[0])},getNodeIndex:function(element){return parseInt(element.getAttribute("data-index"),10)},getNestedProperty:function(obj,property){return property.replace(/\[(?:'([^']+)'|"([^"]+)"|(\d+))\]|(?:(?:^|\.)([^\.\[]+))/g,function(str,singleQuoteProp,doubleQuoteProp,arrayIndex,dotProp){var prop=dotProp||singleQuoteProp||doubleQuoteProp||arrayIndex&&parseInt(arrayIndex,10);str&&obj&&(obj=obj[prop])}),obj},getDataProperty:function(obj,property){if(obj.getAttribute){var prop=obj.getAttribute("data-"+property.replace(/([A-Z])/g,"-$1").toLowerCase());if("string"==typeof prop){if(/^(true|false|null|-?\d+(\.\d+)?|\{[\s\S]*\}|\[[\s\S]*\])$/.test(prop))try{return $.parseJSON(prop)}catch(ignore){}ret
|
||
|
var value="-"==fields[i][0]?-1*this.getArrayMgr("content").getEntry(fields[i].replace("-","")):this.getArrayMgr("content").getEntry(fields[i]);if(sum+=parseFloat(value),value&&"sum"!==this.options.field){widget.options.value=value;break}}"sum"==this.options.field&&(this.options.precision&&jQuery.isNumeric(sum)&&(sum=parseFloat(sum).toFixed(this.options.precision)),widget.options.value=sum)}}})}.call(this);et2_register_widget(et2_entry,["entry","contact-value","contact-account","contact-template","infolog-value","tracker-value","records-value"]);var et2_textbox=function(){"use strict";return et2_inputWidget.extend([et2_IResizeable],{attributes:{multiline:{name:"multiline",type:"boolean",default:!1,description:"If true, the textbox is a multiline edit field."},size:{name:"Size",type:"integer",default:et2_no_init,description:"Field width"},maxlength:{name:"Maximum length",type:"integer",default:et2_no_init,description:"Maximum number of characters allowed"},blur:{name:"Placeholder",type:"string",default:"",description:"This text get displayed if an input-field is empty and does not have the input-focus (blur). It can be used to show a default value or a kind of help-text."},rows:{name:"Rows",type:"integer",default:-1,description:"Multiline field height - better to use CSS"},cols:{name:"Size",type:"integer",default:-1,description:"Multiline field width - better to use CSS"},validator:{name:"Validator",type:"string",default:et2_no_init,description:"Perl regular expression eg. '/^[0-9][a-f]{4}$/i'"},autocomplete:{name:"Autocomplete",type:"string",default:"",description:"Weither or not browser should autocomplete that field: 'on', 'off', 'default' (use attribute from form). Default value for type password is set to off."},onkeypress:{name:"onKeypress",type:"js",default:et2_no_init,description:"JS code or app.$app.$method called when key is pressed, return false cancels it."}},legacyOptions:["size","maxlength","validator"],init:function(){this._super.apply(this,arguments),this.input=null,this.createInputWidget()},createInputWidget:function(){if(this.options.multiline||this.options.rows>1||this.options.cols>1)this.input=$j(document.createElement("textarea")),this.options.rows>0&&this.input.attr("rows",this.options.rows),this.options.cols>0&&this.input.attr("cols",this.options.cols);else{switch(this.input=$j(document.createElement("input")),this.options.type){case"passwd":this.input.attr("type","password"),""===this.options.autocomplete&&(this.options.autocomplete="off");break;case"hidden":this.input.attr("type","hidden")}this.options.autocomplete&&this.input.attr("autocomplete",this.options.autocomplete)}if(this.options.size&&this.set_size(this.options.size),this.options.blur&&this.set_blur(this.options.blur),this.options.readonly&&this.set_readonly(!0),this.input.addClass("et2_textbox"),this.setDOMNode(this.input[0]),this.options.value&&this.set_value(this.options.value),this.options.onkeypress&&"function"==typeof this.options.onkeypress){var self=this;this.input.keypress(function(_ev){return self.options.onkeypress.call(this,_ev,self)})}},set_id:function(_value){this._super.apply(this,arguments),"passwd"===this.options.type&&"off"===this.options.autocomplete&&this.input.removeAttr("name")},destroy:function(){var node=this.getInputNode();node&&$j(node).unbind("keypress"),this._super.apply(this,arguments)},getValue:function(){return this.options&&this.options.blur&&this.input.val()==this.options.blur?"":this._super.apply(this,arguments)},isValid:function(_messages){var ok=!0;if(this.options&&this.options.validator&&!this.options.readonly&&!this.disabled){if("string"==typeof this.options.validator){var parts=this.options.validator.split("/"),flags=parts.pop();if(parts.length<2||""!==parts[0])return _messages.push(this.egw().lang("'%1' has an invalid format !!!",this.options.validator)),!1;parts.shift(),this.options.validator=new RegExp(parts.join("/"),flags)}var value=this.getValue();(ok=this.options.validator.test(value))||_messages.push(this.egw().lang("'%1' has an invalid format !!!",value))}return this._super.apply(this,argum
|
||
|
_options[key].title&&(_options[key].title=this.egw().lang(_options[key].title))):_options[key]=this.egw().lang(_options[key])),"object"==typeof _options[key]&&null!==_options[key])if("undefined"==typeof _options[key].label&&"undefined"==typeof _options[key].title){var group=$j(document.createElement("optgroup")).attr("label",this.options.no_lang?key:this.egw().lang(key)).appendTo(this.input);null==this.input&&(group=jQuery(document.createElement("ul")).append('<li class="ui-widget-header"><span>'+key+"</span></li>").appendTo(this.multiOptions));for(var sub in _options[key])"object"==typeof _options[key][sub]&&null!==_options[key][sub]?this._appendOptionElement(sub,_options[key][sub].label?_options[key][sub].label:"",_options[key][sub].title?_options[key][sub].title:"",group):this._appendOptionElement(sub,_options[key][sub],void 0,group)}else null==this.input?(_options[key].label=_options[key].label?_options[key].label:"",this._appendMultiOption("undefined"!=typeof _options[key].value?_options[key].value:key,_options[key],_options[key].title)):this._appendOptionElement("undefined"!=typeof _options[key].value?_options[key].value:key,_options[key].label?_options[key].label:"",_options[key].title?_options[key].title:"");else this._appendOptionElement(key,_options[key]);(this.value||this.options.empty_label)&&this.set_value(this.value)},getValue:function(){if(null==this.input){var value=[];jQuery("input:checked",this.multiOptions).each(function(){value.push(this.value)}),this.value=value}else this.value=this._super.apply(this,arguments),null===this.value&&(this.value=[]);return this.value},isDirty:function(){if(null==this.input){var value=this.getValue();return!(0==$j(this._oldValue).not(value).length&&0==$j(value).not(this._oldValue).length)}return this._super.apply(this,arguments)}})}.call(this);et2_register_widget(et2_selectbox,["menupopup","listbox","select","select-cat","select-percent","select-priority","select-country","select-state","select-year","select-month","select-day","select-dow","select-hour","select-number","select-app","select-lang","select-bool","select-timezone"]),jQuery.extend(et2_selectbox,{type_cache:{},find_select_options:function(widget,attr_options,attrs){var name_parts=widget.id.replace(/[/g,"[").replace(/]|]/g,"").split("["),type_options={},content_options={},type=widget.instanceOf(et2_nextmatch_filterheader)?attrs.widget_type||"":widget._type,type_function=type.replace("select-","").replace("_ro","")+"_options";if("function"==typeof this[type_function]){var old_type=widget._type;widget._type=type,"string"==typeof attrs.other&&(attrs.other=attrs.other.split(",")),type_options=this[type_function].call(this,widget,attrs);try{type_options=JSON.parse(JSON.stringify(type_options))}catch(e){egw.debug(e)}widget._type=old_type}if(widget.getArrayMgr("sel_options")){if(content_options=widget.getArrayMgr("sel_options").getEntry(widget.id),content_options&&1==content_options.length&&"string"==typeof content_options[0]&&""==content_options[0].trim()&&(content_options=null),content_options&&!isNaN(name_parts[name_parts.length-1])&&content_options.label&&content_options.title&&(name_parts.pop(),content_options=widget.getArrayMgr("sel_options").getEntry(name_parts.join("[")),delete content_options.$row),content_options&&0!=content_options.length||(content_options=widget.getArrayMgr("sel_options").getRoot().getEntry(name_parts[name_parts.length-1])),content_options&&0!=content_options.length||(content_options=widget.getArrayMgr("sel_options").getEntry(name_parts[name_parts.length-1])),name_parts.length>1&&(!content_options||0==content_options.length))for(var pop_that=jQuery.extend([],name_parts);pop_that.length>0&&(!content_options||0==content_options.length);){var last=pop_that.pop();content_options=widget.getArrayMgr("sel_options").getEntry(pop_that.join("[")),content_options&&"undefined"!=typeof content_options[last]&&content_options[last]&&(content_options=content_options[last])}for(var row_stuck=["${row}","{$row}"],i=0;i<row_stuck.length&&(!content_options||0==content_options.length);i++)if(widget.g
|
||
|
var et2_date_duration=function(){"use strict";return et2_date.extend({attributes:{data_format:{name:"Data format",default:"m",type:"string",description:"Units to read/store the data. 'd' = days (float), 'h' = hours (float), 'm' = minutes (int)."},display_format:{name:"Display format",default:"dhm",type:"string",description:"Permitted units for displaying the data. 'd' = days, 'h' = hours, 'm' = minutes. Use combinations to give a choice. Default is 'dh' = days or hours with selectbox."},percent_allowed:{name:"Percent allowed",default:!1,type:"boolean",description:"Allows to enter a percentage."},hours_per_day:{name:"Hours per day",default:8,type:"integer",description:"Number of hours in a day, for converting between hours and (working) days."},empty_not_0:{name:"0 or empty",default:!1,type:"boolean",description:"Should the widget differ between 0 and empty, which get then returned as NULL"},short_labels:{name:"Short labels",default:!1,type:"boolean",description:"use d/h/m instead of day/hour/minute"}},legacyOptions:["data_format","display_format","hours_per_day","empty_not_0","short_labels"],time_formats:{d:"d",h:"h",m:"m"},init:function(){this._super.apply(this,arguments),this.input=null,-1!=this.options.display_format.indexOf("%")&&(this.options.percent_allowed=!0,this.options.display_format=this.options.display_format.replace("%","")),this.options.display_format=this.options.display_format.replace(/[^dhm]/,""),this.options.display_format||(this.options.display_format=this.attributes.display_format.default),this.time_formats={d:this.options.short_labels?this.egw().lang("m"):this.egw().lang("Days"),h:this.options.short_labels?this.egw().lang("h"):this.egw().lang("Hours"),m:this.options.short_labels?this.egw().lang("m"):this.egw().lang("Minutes")},this.createInputWidget()},createInputWidget:function(){if(this.node=$j(document.createElement("span")).addClass("et2_date_duration"),this.duration=$j(document.createElement("input")).addClass("et2_date_duration").attr({type:"number",size:3}),this.node.append(this.duration),this.options.display_format.length>1){this.format=$j(document.createElement("select")).addClass("et2_date_duration"),this.node.append(this.format);for(var i=0;i<this.options.display_format.length;i++)this.format.append("<option value='"+this.options.display_format[i]+"'>"+this.time_formats[this.options.display_format[i]]+"</option>")}else this.time_formats[this.options.display_format]?this.format=$j("<span>"+this.time_formats[this.options.display_format]+"</span>").appendTo(this.node):this.format=$j("<span>"+this.time_formats.m+"</span>").appendTo(this.node)},attachToDOM:function(){var node=this.getInputNode();node&&$j(node).bind("change.et2_inputWidget",this,function(e){e.data.change(this)}),et2_DOMWidget.prototype.attachToDOM.apply(this,arguments)},getDOMNode:function(){return this.node[0]},getInputNode:function(){return this.duration[0]},set_id:function(_value){this.id=_value;var node=this.getDOMNode(this);node&&(""!=_value?node.setAttribute("id",this.getInstanceManager().uniqueId+"_"+this.id):node.removeAttribute("id"))},set_value:function(_value){this.options.value=_value;var display=this._convert_to_display(_value);"INPUT"==this.duration[0].nodeName?this.duration.val(display.value):this.duration.text(display.value+" "),display.unit!=this.options.display_format&&(this.format&&this.format.children().length>1?$j("option[value='"+display.unit+"']",this.format).attr("selected","selected"):this.format.text(this.time_formats[display.unit]))},_convert_to_display:function(_value){if(_value)switch(this.options.data_format){case"d":_value*=this.options.hours_per_day;case"h":_value*=60}var _unit="d"==this.options.display_format?"d":"h";this.options.display_format.indexOf("m")>-1&&_value&&60>_value?_unit="m":this.options.display_format.indexOf("d")>-1&&_value>=60*this.options.hours_per_day&&(_unit="d"),_value=this.options.empty_not_0&&""===_value||!this.options.empty_not_0&&!_value?"":"m"==_unit?parseInt(_value):Math.round(_value/60/("d"==_unit?this.options.hours_per_day:1)*100)/100,""===_value&&(_unit="");var
|
||
|
node.appendChild(ctelt("td","skip","")),idx+1==opcodes.length)break;continue}}toprows.push(node=document.createElement("tr")),inline?"insert"==change?addCellsInline(node,null,n++,newTextLines,change):"replace"==change?(botrows.push(node2=document.createElement("tr")),be>b&&addCellsInline(node,b++,null,baseTextLines,"delete"),ne>n&&addCellsInline(node2,null,n++,newTextLines,"insert")):"delete"==change?addCellsInline(node,b++,null,baseTextLines,change):addCellsInline(node,b++,n++,baseTextLines,change):(b=addCells(node,b,be,baseTextLines,change),n=addCells(node,n,ne,newTextLines,change))}for(var i=0;i<toprows.length;i++)rows.push(toprows[i]);for(var i=0;i<botrows.length;i++)rows.push(botrows[i])}rows.push(node=ctelt("th","author","diff view generated by ")),node.setAttribute("colspan",inline?3:4),node.appendChild(node2=telt("a","jsdifflib")),node2.setAttribute("href","http://github.com/cemerick/jsdifflib"),tdata.push(node=document.createElement("tbody"));for(var idx in rows)node.appendChild(rows[idx]);node=celt("table","diff"+(inline?" inlinediff":""));for(var idx in tdata)node.appendChild(tdata[idx]);return node}};var et2_diff=function(){"use strict";return et2_valueWidget.extend([et2_IDetachedDOM],{attributes:{value:{type:"any"}},init:function(){this._super.apply(this,arguments),this.mini=!0,this.egw().includeCSS("etemplate/js/lib/jsdifflib/diffview.css"),this.div=document.createElement("div"),jQuery(this.div).addClass("diff")},set_value:function(value){if(jQuery(this.div).empty(),"string"==typeof value.old&&"string"==typeof value.new){var old_text=difflib.stringAsLines(value.old.toString()),new_text=difflib.stringAsLines(value.new.toString()),sm=new difflib.SequenceMatcher(old_text,new_text),opcodes=sm.get_opcodes(),view=diffview.buildView({baseTextLines:old_text,newTextLines:new_text,opcodes:opcodes,baseTextName:"",newTextName:"",viewType:1});if(jQuery(this.div).append(view),this.mini){view=jQuery(view),this.minify(view);var self=this;jQuery('<span class="ui-icon ui-icon-circle-plus"> </span>').appendTo(self.div).css("cursor","pointer").click({diff:view,div:self.div},function(e){var diff=e.data.diff,div=e.data.div;self.un_minify(diff);var dialog_div=jQuery("<div>").append(diff);dialog_div.dialog({title:self.options.label,width:"auto",autoResize:!0,modal:!0,buttons:[{text:self.egw().lang("ok"),click:function(){jQuery(this).dialog("close")}}],close:function(event,ui){dialog_div.dialog("destroy"),self.minify(this),diff.prependTo(div)}})})}}else"object"!=typeof value&&jQuery(this.div).append(value)},set_label:function(_label){this.options.label=_label},minify:function(view){view=jQuery(view).addClass("mini").width("100%").css("height","inherit").show(),jQuery("th",view).hide(),jQuery("td.equal",view).hide().prevAll().hide()},un_minify:function(view){jQuery(view).removeClass("mini").show(),jQuery("th",view).show(),jQuery("td.equal",view).show()},getDetachedAttributes:function(_attrs){_attrs.push("value","label")},getDetachedNodes:function(){return[this.div]},setDetachedAttributes:function(_nodes,_values){this.div=_nodes[0],"undefined"!=typeof _values.label&&this.set_label(_values.label),"undefined"!=typeof _values.value&&this.set_value(_values.value)}})}.call(this);et2_register_widget(et2_diff,["diff"]);var et2_dropdown_button=function(){"use strict";return et2_inputWidget.extend({attributes:{label:{name:"caption",type:"string",description:"Label of the button",translate:!0,default:"Select..."},label_updates:{name:"Label updates",type:"boolean",description:"Button label updates when an option is selected from the menu",default:!0},image:{name:"Icon",type:"string",description:"Add an icon"},ro_image:{name:"Read-only Icon",type:"string",description:"Use this icon instead of hiding for read-only"},onclick:{description:"JS code which gets executed when the button is clicked"},select_options:{type:"any",name:"Select options",default:{},description:"Select options for dropdown. Can be a simple key => value list, or value can be full HTML",ignore:!0},accesskey:{name:"Access Key",type:"string",default:et2_no_init,description:
|
||
|
return _value&&"undefined"!=typeof _value.type&&_value.type.match(/video\//,"ig")?mediaContent=[{title:_value.id,type:_value.type,poster:"",href:base_url+egw().mime_open(_value),download_href:base_url+egw().mime_open(_value)+"?download"}]:_value&&(mediaContent=[{title:_value.id,href:base_url+egw().mime_open(_value).url,download_href:base_url+egw().mime_open(_value).url+"?download",type:_value.type}]),mediaContent[0].href&&mediaContent[0].href.match(/\/webdav.php/,"ig")&&(mediaContent[0].download_href=mediaContent[0].href+"?download"),mediaContent},_add_link:function(_link_data){var self=this,link=$j(document.createElement("li")).appendTo(this.list).addClass("et2_link loading").click(function(e){self.options.expose_view&&"undefined"!=typeof _link_data.type&&_link_data.type.match(self.mime_regexp,"ig")?self._init_blueimp_gallery(e,_link_data):self.egw().open(_link_data,"","view",null,_link_data.app,_link_data.app),e.stopImmediatePropagation()});_link_data.title&&link.text(_link_data.title),_link_data.title||this.egw().link_title(_link_data.app,_link_data.id,function(title){title?this.removeClass("loading").text(title):this.remove()},link)},getDetachedAttributes:function(_attrs){null==this._labelContainer&&(this._labelContainer=$j(document.createElement("label")).addClass("et2_label"),this.getSurroundings().insertDOMNode(this._labelContainer[0]),this.getSurroundings().update()),_attrs.push("value","label")},getDetachedNodes:function(){return null==this._labelContainer&&(this._labelContainer=$j(document.createElement("label")).addClass("et2_label"),this.getSurroundings().insertDOMNode(this._labelContainer[0])),[this.list[0],this._labelContainer[0]]},setDetachedAttributes:function(_nodes,_values){this.list=$j(_nodes[0]),this.set_value(_values.value),this._labelContainer=_nodes.length>1?$j(_nodes[1]):null,_values.label?this.set_label(_values.label):this._labelContainer&&this._labelContainer.contents().not(this.list).remove()}}))}.call(this);et2_register_widget(et2_link_string,["link-string"]);var et2_link_list=function(){"use strict";return et2_link_string.extend({attributes:{show_deleted:{name:"Show deleted",type:"boolean",default:!1,description:"Show links that are marked as deleted, being held for purge"},onchange:{name:"onchange",type:"js",default:et2_no_init,description:"JS code which is executed when the links change."},readonly:{name:"readonly",type:"boolean",default:!1,description:"Does NOT allow user to enter data, just displays existing data"}},init:function(){this._super.apply(this,arguments),this.list=$j(document.createElement("table")).addClass("et2_link_list"),this.options.class&&this.list.addClass(this.options.class),this.setDOMNode(this.list[0]);var self=this;this.context=new egwMenu,this.context.addItem("comment",this.egw().lang("Comment"),"",function(){var link_id="number"==typeof self.context.data.link_id?self.context.data.link_id:self.context.data.link_id.replace(/[:\.]/g,"_");et2_dialog.show_prompt(function(button,comment){if(button==et2_dialog.OK_BUTTON){var remark=jQuery("#link_"+(self.context.data.dom_id?self.context.data.dom_id:link_id),self.list).children(".remark");if(isNaN(self.context.data.link_id)){if(remark.text(comment),self.context.data.link_id){var _widget=link_id.widget||null;self.getRoot().iterateOver(function(widget){widget.id==self.id&&(_widget=widget)},self,et2_link_to);var value=null!=_widget?_widget.getValue():!1;_widget&&value&&value.to_id&&(value.to_id[self.context.data.link_id].remark=comment)}}else{remark.addClass("loading");egw.json(self.egw().getAppName()+".etemplate_widget_link.ajax_link_comment.etemplate",[link_id,comment],function(){remark&&(remark.removeClass("loading").text(comment+""),self.context.data.remark=comment+"")},this,!0).sendRequest()}}},"",self.egw().lang("Comment"),self.context.data.remark||"")}),this.context.addItem("file_info",this.egw().lang("File information"),this.egw().image("edit"),function(menu_item){var link_data=self.context.data;if("file"==link_data.app){var url="/apps/"+link_data.app2+"/"+link_data.id2+"/"+decodeURIComponent(link_data.id);"string"==t
|
||
|
this._super.apply(this,arguments);var data=this.getArrayMgr("modifications").getEntry(this.id),global_data=this.getArrayMgr("modifications").getRoot().getEntry("~custom_fields~",!0);if(global_data)for(var key in data)global_data[key]&&"fields"!==key&&(data[key]=jQuery.extend(!0,{},data[key],global_data[key]));for(var key in data)_attrs[key]=data[key];for(var key in global_data)"undefined"==typeof global_data[key]||_attrs[key]||(_attrs[key]=global_data[key]);if(this.id){var contentMgr=this.getArrayMgr("content");if(null!=contentMgr){var val=contentMgr.getEntry(this.id);if(_attrs.value={},null!==val)if(0===this.id.indexOf(this.prefix)&&"undefined"!=typeof data.fields&&data.fields[this.id.replace(this.prefix,"")]===!0)_attrs.value[this.id]=val;else for(var key in val)0==key.indexOf(this.prefix)&&(_attrs.value[key]=val[key]);else for(var key in _attrs.customfields)_attrs.value[this.prefix+key]=contentMgr.getEntry(this.prefix+key)}}},loadFromXML:function(_node){this.loadFields(),this._super.apply(this,arguments)},set_value:function(_value){if(this.options.customfields)for(var field_name in this.options.customfields)if((jQuery.isEmptyObject(this.options.fields)||this.options.fields[field_name])&&this.widgets[field_name]&&this.widgets[field_name].set_value){var value=_value[this.prefix+field_name]?_value[this.prefix+field_name]:null;switch(null==value&&this.id==this.DEFAULT_ID&&this.getArrayMgr("content").getEntry(this.prefix+field_name)&&(value=this.getArrayMgr("content").getEntry(this.prefix+field_name)),this.options.customfields[field_name].type){case"date":value&&isNaN(value)&&(value=jQuery.datepicker.parseDate("yy-mm-dd",value))}this.widgets[field_name].set_value(value)}},getValue:function(){if(this.id!=this.DEFAULT_ID)return null;var value={};for(var field_name in this.widgets)this.widgets[field_name].getValue&&!this.widgets[field_name].options.readonly&&(value[this.prefix+field_name]=this.widgets[field_name].getValue());return value},isDirty:function(){var dirty=!0;for(var field_name in this.widgets)this.widgets[field_name].isDirty&&(dirty=dirty&&this.widgets[field_name].isDirty());return dirty},resetDirty:function(){for(var field_name in this.widgets)this.widgets[field_name].resetDirty&&this.widgets[field_name].resetDirty()},isValid:function(){return!0},_setup_text:function(field_name,field,attrs){return delete attrs.label,field.type="textbox",attrs.rows=field.rows>1?field.rows:null,field.len&&(attrs.size=field.len,1==field.rows&&(attrs.maxlength=field.len)),!0},_setup_ajax_select:function(field_name,field,attrs){var attributes=["get_rows","get_title","id_field","template"];if(field.values)for(var i=0;i<attributes.length;i++)"undefined"!=typeof field.values[attributes[i]]&&(attrs[attributes[i]]=field.values[attributes[i]]);return!0},_setup_float:function(field_name,field,attrs){return delete attrs.label,field.type="float",field.len&&(attrs.size=field.len),!0},_setup_select:function(field_name,field,attrs){return delete attrs.label,attrs.rows=field.rows,attrs.tags=field.tags,!0},_setup_select_account:function(field_name,field,attrs){return attrs.empty_label=egw.lang("Select"),this._setup_select(field_name,field,attrs)},_setup_date:function(field_name,field,attrs){return attrs.data_format="Y-m-d",!0},_setup_date_time:function(field_name,field,attrs){return attrs.data_format="Y-m-d H:i:s",!0},_setup_htmlarea:function(field_name,field,attrs){attrs.config=field.config?field.config:{},attrs.config.toolbarStartupExpanded=!1,field.len&&(attrs.config.width=field.len+"px"),attrs.config.height=16*(field.rows>0&&"undefined"!=field.rows?field.rows:5)+"px";var data=this.getArrayMgr("modifications").getEntry(this.prefix+field_name);return data&&jQuery.extend(data.config,attrs.config),!0},_setup_radio:function(field_name,field,attrs){return delete attrs.label,field.values&&field.values[""]&&(attrs.label=field.values[""],delete field.values[""]),field.type="radiogroup",attrs.options=field.values,!0},_setup_checkbox:function(field_name,field,attrs){return attrs.readonly&&(attrs.ro_true=field.label),!0},_setup_button:function(field_name,
|
||
|
this._indexMap={},this._total=0,this._focusedEntry=null,this._invertSelection=!1,this._selectAll=!1,this._inUpdate=!1},setIndexMap:function(_indexMap){this._indexMap=_indexMap},setTotalCount:function(_total){this._total=_total},registerRow:function(_uid,_idx,_tr,_links){var entry=this._getRegisteredRowsEntry(_uid);entry.tr&&entry.tr!==_tr&&this.unregisterRow(_uid,entry.tr,!0),!entry.tr&&_links&&(this._attachActionObjectInterface(entry,_tr,_uid),this._attachActionObject(entry,_tr,_uid,_links,_idx)),entry.ao&&entry.ao._index,entry.idx=_idx,entry.tr=_tr,this._updateEntryState(entry,entry.state)},unregisterRow:function(_uid,_tr,_noDelete){_noDelete=!!_noDelete,"undefined"!=typeof this._registeredRows[_uid]&&this._registeredRows[_uid].tr===_tr&&(this._inUpdate=!0,this._registeredRows[_uid].tr=null,this._registeredRows[_uid].aoi=null,this._registeredRows[_uid].ao&&(this._registeredRows[_uid].ao.remove(),this._registeredRows[_uid].ao=null),_noDelete||this._registeredRows[_uid].state!==EGW_AO_STATE_NORMAL||delete this._registeredRows[_uid],this._inUpdate=!1)},resetSelection:function(){this._invertSelection=!1,this._selectAll=!1,this._actionObjectManager.setAllSelected(!1);for(var key in this._registeredRows)this.setSelected(key,!1);for(var i=0;i<this._children.length;i++)this._children[i].resetSelection()},setSelected:function(_uid,_selected){this._selectAll=!1;var entry=this._getRegisteredRowsEntry(_uid);this._updateEntryState(entry,egwSetBit(entry.state,EGW_AO_STATE_SELECTED,_selected))},setFocused:function(_uid,_focused){if(this._focusedEntry&&(this._updateEntryState(this._focusedEntry,egwSetBit(this._focusedEntry.state,EGW_AO_STATE_FOCUSED,!1)),this._focusedEntry=null),_focused){var entry=this._focusedEntry=this._getRegisteredRowsEntry(_uid);this._updateEntryState(entry,egwSetBit(entry.state,EGW_AO_STATE_FOCUSED,!0))}},selectAll:function(){this.resetSelection(),this._selectAll=!0,this._actionObjectManager.setAllSelected(!0);for(var key in this._registeredRows){var entry=this._registeredRows[key];this._updateEntryState(entry,entry.state)}},getSelected:function(){var ids=[];for(var key in this._registeredRows)egwBitIsSet(this._registeredRows[key].state,EGW_AO_STATE_SELECTED)&&ids.push(key);for(var i=0;i<this._children.length;i++)ids=ids.concat(this._children[i].getSelected().ids);return{all:this._selectAll,ids:ids}},_attachActionObjectInterface:function(_entry,_tr,_uid){_entry.aoi=new et2_dataview_rowAOI(_tr),_entry.aoi.setStateChangeCallback(function(_newState,_changedBit,_shiftState){_changedBit===EGW_AO_STATE_SELECTED&&this._handleSelect(_uid,_entry,egwBitIsSet(_shiftState,EGW_AO_SHIFT_STATE_BLOCK),egwBitIsSet(_shiftState,EGW_AO_SHIFT_STATE_MULTI))},this)},_getDummyAOI:function(_entry,_tr,_uid,_idx){var dummyAOI=new egwActionObjectInterface,self=this;return dummyAOI.doSetState=function(_state){self._inUpdate||(self.setFocused(_uid,egwBitIsSet(_state,EGW_AO_STATE_FOCUSED)),self._updateState(_uid,_state))},dummyAOI.doMakeVisible=function(){self._makeVisibleCallback.call(self._context,_idx)},dummyAOI.doTriggerEvent=_entry.aoi.doTriggerEvent,dummyAOI.getDOMNode=function(){return _tr},dummyAOI},_attachActionObject:function(_entry,_tr,_uid,_links,_idx){function getIndexAO(_idx){return"undefined"!=typeof self._indexMap[_idx]&&self._indexMap[_idx].uid?self._getRegisteredRowsEntry(self._indexMap[_idx].uid).ao:null}function getElementRelatively(_step){for(var max_index=(self._total||Object.keys(self._indexMap).length,Math.max.apply(Math,Object.keys(self._indexMap))),count=Math.max(1,Math.min(self._total,50)),element=null,idx=_entry.idx;null==element&&count>0&&max_index>0;)count--,element=getIndexAO(Math.max(0,Math.min(max_index,idx+=_step)));return element}var dummyAOI=this._getDummyAOI(_entry,_tr,_uid,_idx);_entry.ao=this._actionObjectManager.addObject(_uid,dummyAOI),_entry.ao._context=this._context,_entry.ao.updateActionLinks(_links),_entry.ao._index=_idx;var self=this;_entry.ao.getPrevious=function(_step){return getElementRelatively(-_step)},_entry.ao.getNext=function(_step){return getElementRelatively(_step)},_entry.ao.traverseP
|
||
|
entry.placeholder=null,entry.widget.implements(et2_IDOMNode)){var node=entry.widget.getDOMNode(entry.widget);node&&node.parentNode&&(entry.placeholder=document.createElement("span"),node.parentNode.replaceChild(entry.placeholder,node),_rowTemplate.placeholders.push({widget:entry.widget,func:this._compileDOMAccessFunc(_rowTemplate.row,entry.placeholder)}))}}},_nodeIndex:function(_node){if(null==_node.parentNode)return 0;for(var i=0;i<_node.parentNode.childNodes.length;i++)if(_node.parentNode.childNodes[i]==_node)return i;return-1},_compileDOMAccessFunc:function(_root,_target){function recordPath(_root,_target,_path){if("undefined"==typeof _path&&(_path=[]),_root!=_target&&_target){var idx=this._nodeIndex(_target);if(idx>=0)return _path.unshift("childNodes["+idx+"]"),recordPath.call(this,_root,_target.parentNode,_path);throw"Internal error while compiling DOM access function."}return _path.unshift("_node"),"return "+_path.join(".")+";"}return new Function("_node",recordPath.call(this,_root,_target))},_buildNodeAccessFuncs:function(_rowTemplate){for(var i=0;i<_rowTemplate.seperated.detachable.length;i++)for(var entry=_rowTemplate.seperated.detachable[i],nodes=entry.widget.getDetachedNodes(),nodeFuncs=entry.nodeFuncs=new Array(nodes.length),j=0;j<nodes.length;j++)nodeFuncs[j]=this._compileDOMAccessFunc(_rowTemplate.row,nodes[j])},cat_regexp:/(^| |,|cat_)([0-9]+)/g,cat_cleanup:/[^0-9]/g,_setRowData:function(_data,_tr,_mgrs){if(_data.class){var classes=_mgrs.content.expandName(_data.class),cats=[];if(-1!==_data.class.indexOf("cat")||classes.match(/[0-9]+/)){var category_location=_data.class.match(/(cat(_id|egory)?)/);category_location&&(category_location=category_location[0]),cats=classes.match(this.cat_regexp)||[],classes=classes.replace(this.cat_regexp,"");for(var i=0;i<cats.length;i++){var cat_id=cats[i].replace(this.cat_cleanup,""),cat_class="cat_"+cat_id;classes+=" "+cat_class}classes+=" row_category"}classes+=" row",_tr.setAttribute("class",classes)}if(_data.valign){var align=_mgrs.content.expandName(_data.valign);_tr.setAttribute("valign",align)}}})}.call(this),et2_nextmatch_rowWidget=function(){"use strict";return et2_widget.extend(et2_IDOMNode,{init:function(_mgrs,_row){this._super(null,{id:"",type:"rowWidget"}),this._widgets=[],this._mgrs=_mgrs,this._row=_row},createWidgets:function(_widgets){this._widgets=new Array(_widgets.length);for(var i=0;i<_widgets.length;i++)_widgets[i]&&(this._widgets[i]=_widgets[i].clone(this),this._widgets[i].loadingFinished(),this._widgets[i].align&&(this._row.childNodes[i].align=this._widgets[i].align))},getDOMNode:function(_sender){for(var i=0;i<this._widgets.length;i++)if(this._widgets[i]==_sender)return this._row.childNodes[i].childNodes[0];return null}})}.call(this),et2_nextmatch_rowTemplateWidget=function(){"use strict";return et2_widget.extend(et2_IDOMNode,{init:function(_root,_row){this._super(null,{id:"",type:"rowTemplateWidget"}),this._root=_root,this._mgrs={},this._row=_row,this._parent=_root,this._widgets=[]},createWidgets:function(_mgrs,_widgets){this._mgrs=_mgrs,this._widgets=new Array(_widgets.length);for(var i=0;i<_widgets.length;i++)this._row.childNodes[0].childNodes[0],this._widgets[i]={widget:_widgets[i].widget.clone(this),node:_widgets[i].func(this._row)},this._widgets[i].widget.loadingFinished()},getDOMNode:function(_sender){for(var i=0;i<this._widgets.length;i++)if(this._widgets[i].widget==_sender)return this._widgets[i].node;return null}})}.call(this),et2_dynheight=function(){"use strict";return Class.extend({init:function(_outerNode,_innerNode,_minHeight){this.outerNode=$j(_outerNode),this.innerNode=$j(_innerNode),this.minHeight=_minHeight,this.bottomNodes=[],this.initialized=!1,this.innerMargin=0,this.outerMargin=0},update:function(_callback,_context){if(this.innerNode.is(":visible")){this._initialize();for(var oh=this.outerNode.height(),ot=this.outerNode.offset()?this.outerNode.offset().top:0,it=this.innerNode.offset().top,bminTop=this.bottomNodes.length?1/0:0,bmaxBot=0,i=0;i<this.bottomNodes.length;i++)if(this.bottomNodes[i].find(".action_popup").length)egw.deb
|
||
|
},_createElements:function(){this.containerTr=$j(document.createElement("tr")),this.headTr=$j(document.createElement("tr")),this.thead=$j(document.createElement("thead")).append(this.headTr),this.tbody=$j(document.createElement("tbody")).append(this.containerTr),this.table=$j(document.createElement("table")).addClass("egwGridView_outer").append(this.thead,this.tbody).appendTo(this.parentNode)},_clearHeader:function(){this.columnMgr&&(this.columnMgr.free(),this.columnMgr=null);for(var i=0;i<this.columns.length;i++)this.columns[i].tdClass&&this.egw.css("."+this.columns[i].tdClass),this.columns[i].divClass&&(this.egw.css("."+this.columns[i].divClass),this.egw.css(".egwGridView_outer ."+this.columns[i].divClass),this.egw.css(".egwGridView_grid ."+this.columns[i].divClass));this.egw.css(".egwGridView_grid ."+this.uniqueId+"_div_fullRow"),this.egw.css(".egwGridView_outer ."+this.uniqueId+"_td_fullRow"),this.egw.css(".egwGridView_outer ."+this.uniqueId+"_spacer_fullRow"),this.columnNodes=[],this.columns=[],this.headTr.empty()},_updateColumns:function(){this.columns=this.columnMgr.getColumnData();for(var total_cnt=0,i=0;i<this.columns.length;i++)this.columns[i].visible&&total_cnt++;for(var first=!0,vis_col=this.visibleColumnCount=0,totalWidth=0,i=0;i<this.columns.length;i++){var col=this.columns[i];if(col.tdClass=this.uniqueId+"_td_"+col.id,col.divClass=this.uniqueId+"_div_"+col.id,col.visible){vis_col++,this.visibleColumnCount++,this.egw.css("."+col.tdClass,"display: table-cell; !important;");var subBorder=0,subHBorder=0;vis_col==total_cnt&&(subBorder+=1);var headerWidth=Math.max(0,col.width-this.headerBorderWidth-subHBorder);this.egw.css(".egwGridView_outer ."+col.divClass,"width: "+headerWidth+"px;");var columnWidth=Math.max(0,col.width-this.columnBorderWidth-subBorder);this.egw.css(".egwGridView_grid ."+col.divClass,"width: "+columnWidth+"px;"),totalWidth+=col.width,first=!1}else this.egw.css("."+col.tdClass,"display: none;")}this.egw.css(".egwGridView_grid ."+this.uniqueId+"_div_fullRow","width: "+(totalWidth-this.columnBorderWidth-2)+"px; border-right-width: 0 !important;"),this.egw.css(".egwGridView_outer ."+this.uniqueId+"_td_fullRow","border-right-width: 0 !important;"),this.egw.css(".egwGridView_outer ."+this.uniqueId+"_spacer_fullRow","width: "+(totalWidth-1)+"px; border-right-width: 0 !important;")},_buildHeader:function(){for(var self=this,i=0;i<this.columns.length;i++){var col=this.columns[i],cont=$j(document.createElement("div")).addClass("innerContainer").addClass(col.divClass),column=$j(document.createElement("th")).addClass(col.tdClass).attr("align","left").append(cont).appendTo(this.headTr);this.columnMgr&&this.columnMgr.columns[i]&&column.addClass(this.columnMgr.columns[i].fixedWidth?"fixedWidth":"relativeWidth");var enc_column=self.columnMgr.getColumnById(col.id);et2_dataview_makeResizeable(column,function(_w){if(this.relativeWidth){this.set_width(_w+"px"),self.columnMgr.updated=!0,self.columnMgr.getColumnWidth(0);var relative=self.columnMgr.totalWidth-self.columnMgr.totalFixed+_w;this.set_width(_w/relative);for(var i=0;i<self.columnMgr.columns.length;i++){var col=self.columnMgr.columns[i];col==this||col.fixedWidth||col.set_width(self.columnMgr.columnWidths[i]/relative)}self.updateColumns()}else this.set_width(this.relativeWidth?_w/self.columnMgr.totalWidth:_w+"px"),self.columnMgr.updated=!0,self.updateColumns()},enc_column),this.columnNodes.push({column:column,container:cont})}this._buildSelectCol()},_buildSelectCol:function(){this.selectColIcon=$j(document.createElement("span")).addClass("selectcols").css("display","inline-block"),this.selectCol=$j(document.createElement("th")).addClass("optcol").append(this.selectColIcon).click(this,function(e){e.data.selectColumnsClick&&e.data.selectColumnsClick(e)}).appendTo(this.headTr),this.selectCol.css("width",this.scrollbarWidth-this.selectCol.outerWidth()+this.selectCol.width()+1)},_buildGrid:function(){for(var colIds=new Array(this.columns.length),i=0;i<this.columns.length;i++)colIds[i]=this.columns[i].id;this.rowProvider&&this.rowProvider.free(),this.rowProvide
|
||
|
},this),1e3*time)},this)),$j(this.getInstanceManager().DOMContainer.parentNode).on("show.et2_nextmatch",jQuery.proxy(function(e){this._set_autorefresh(this._get_autorefresh()),$j(e.target).off(e)},this)))},_get_autorefresh:function(){var refresh_preference="nextmatch-"+this.options.settings.columnselection_pref+"-autorefresh",app=this.options.template.split(".");return this.egw().preference(refresh_preference,app[0])},set_template:function(_value){if(this.template){if(this.template==_value)return;this.dataview.free(),this.rowProvider.free(),this.controller.free();for(var i=this._children.length-1;i>=0;i--){var _node=this._children[i];_node!=this.header&&(this.removeChild(_node),_node.destroy())}this.template==this.options.settings.columnselection_pref&&(this.options.settings.columnselection_pref=_value),this.dataview=new et2_dataview(this.innerDiv,this.egw())}var template=et2_createWidget("template",{id:_value},this);if(!template)return void this.egw().debug("error","Error while loading definition template for nextmatch widget.",_value);var parse=function(template){this.template=_value;var definitionGrid=template.getChildren()[0];return definitionGrid&&definitionGrid instanceof et2_grid?(this._parseGrid(definitionGrid),setTimeout(function(){template.free()},1),this.iterateOver(function(_node){_node.setNextmatch(this)},this,et2_INextmatchHeader),this.controller.setFilters(this.activeFilters),this.options.settings.num_rows||this.controller.update(),this.options.settings.order&&this.options.settings.sort&&this.sortBy(this.options.settings.order,"ASC"==this.options.settings.sort,!1),void this._set_autorefresh(this._get_autorefresh())):void this.egw().debug("error","Nextmatch widget expects a grid to be the first child of the defined template.")},promise=[];template.loadingFinished(promise),jQuery.when.apply(null,promise).done(jQuery.proxy(function(){parse.call(this,template),this.dynheight.initialized=!1,this.resize()},this))},set_hide_header:function(hide){hide?this.header.div.hide():this.header.div.show()},set_header_left:function(template){this.header._build_header("left",template)},set_header_right:function(template){this.header._build_header("right",template)},set_header_row:function(template){this.header._build_header("row",template)},set_no_filter:function(bool,filter_name){"undefined"==typeof filter_name&&(filter_name="filter"),this.options["no_"+filter_name]=bool;var filter=this.header[filter_name];filter?filter.set_disabled(bool):bool&&(filter=this.header._build_select(filter_name,"select",this.settings[filter_name],this.settings[filter_name+"_no_lang"]))},set_no_filter2:function(bool){this.set_no_filter(bool,"filter2")},set_disabled:function(_value){var previous=this.disabled;this._super.apply(this,arguments),previous&&!_value&&this.resize()},set_actions:function(actions){if(actions!=this.options.actions&&null!=this.controller&&this.controller._actionManager){for(var i=this.controller._actionManager.children.length-1;i>=0;i--)this.controller._actionManager.children[i].remove();this.options.actions=actions,this.options.settings.action_links=this.controller._actionLinks=this._get_action_links(actions),this.controller._initActions(actions)}},set_view:function(view){"tile"==view?this.view="tile":this.view="row"},set_onfiledrop:function(handler){this.options.onfiledrop=handler},handle_drop:function(event,target){var row=this.controller.getRowByNode(target),uid=row.uid||null,files=[];if(!(event.originalEvent&&event.originalEvent.dataTransfer&&event.originalEvent.dataTransfer.files&&event.originalEvent.dataTransfer.files.length>0))return!1;if(files=event.originalEvent.dataTransfer.files,this.options.onfiledrop&&!this.options.onfiledrop.call(this,uid,files))return!1;if(event.stopPropagation(),event.preventDefault(),!row||!row.uid)return!1;var split=uid.split("::"),link_value={to_app:split.shift(),to_id:split.join("::")},link=et2_createWidget("link-to",{value:link_value},this);if(link.loadingFinished(),link.file_upload.set_drop_target(!1),row.row.tr){var status=$j(document.createElement("div")).addClass("et2_link_to").wid
|
||
|
}this.favSortedList=["blank"];var apps=egw().user("apps");this.is_admin="undefined"!=typeof apps.admin,this.stored_filters=this.load_favorites(this.options.app),this.preferred=egw.preference(this.options.default_pref,this.options.app),this.preferred&&"undefined"!=typeof this.stored_filters[this.preferred]||(this.preferred="blank"),this.set_id(this.id),this.init_filters(this),this.menu.addClass("favorites"),this.set_value(this.preferred,!0);var self=this;$j(this.menu).on("click","input:radio",function(event){event.stopImmediatePropagation(),self.egw().set_preference(self.options.app,self.options.default_pref,$j(this).val()),self.preferred=$j(this).val(),self.sidebox_target.length&&(self.sidebox_target.find("div.ui-icon-heart").replaceWith("<div class='sideboxstar'/>"),$j("li[data-id='"+self.preferred+"'] div.sideboxstar",self.sidebox_target).replaceWith("<div class='ui-icon ui-icon-heart'/>")),self.menu.hide(),self.button.addClass("ui-state-active",500,"swing",function(){self.button.removeClass("ui-state-active",2e3)})});var sideBoxDOMNodeSort=function(_favSList){for(var favS=jQuery.isArray(_favSList)?_favSList.slice(0).reverse():[],i=0;i<favS.length;i++)self.sidebox_target.children().find('[data-id$="'+favS[i]+'"]').prependTo(self.sidebox_target.children())};$j(this.menu).sortable({items:'li:not([data-id$="add"])',placeholder:"ui-fav-sortable-placeholder",delay:250,update:function(event,ui){self.favSortedList=jQuery(this).sortable("toArray",{attribute:"data-id"}),self.egw().set_preference(self.options.app,"fav_sort_pref",self.favSortedList),sideBoxDOMNodeSort(self.favSortedList)}}),this.menu.on("click","div.ui-icon-trash",app[self.options.app],function(){app[self.options.app].delete_favorite.apply(this,arguments)}).on("mouseenter","div.ui-icon-trash",function(){$j(this).wrap("<span class='ui-state-active'/>")}).on("mouseleave","div.ui-icon-trash",function(){$j(this).unwrap()}),this.sidebox_target.length>0&&this.init_filters(this)},load_favorites:function(app){var stored_filters={blank:{name:this.egw().lang("No filters"),state:{}}},preferences=egw.preference("*",app);for(var pref_name in preferences){if(0==pref_name.indexOf(this.favorite_prefix)&&"object"==typeof preferences[pref_name]){var name=pref_name.substr(this.favorite_prefix.length);stored_filters[name]=preferences[pref_name],preferences[pref_name].filters&&(stored_filters[pref_name].state=preferences[pref_name].filters)}"fav_sort_pref"==pref_name&&(this.favSortedList=preferences[pref_name],jQuery.isArray(this.favSortedList)||(this.favSortedList=this.favSortedList.split(",")))}if("undefined"!=typeof stored_filters&&stored_filters){for(var name in stored_filters)this.favSortedList.indexOf(name)<0&&this.favSortedList.push(name);if(this.egw().set_preference(this.options.app,"fav_sort_pref",this.favSortedList),this.favSortedList.length>0){for(var sortedListObj={},i=0;i<this.favSortedList.length;i++)"undefined"!=typeof stored_filters[this.favSortedList[i]]?sortedListObj[this.favSortedList[i]]=stored_filters[this.favSortedList[i]]:(this.favSortedList.splice(i,1),this.egw().set_preference(this.options.app,"fav_sort_pref",this.favSortedList));stored_filters=jQuery.extend(sortedListObj,stored_filters)}}else stored_filters={};return stored_filters},init_filters:function(widget,filters){"undefined"==typeof filters&&(filters=this.stored_filters);var options={};for(var name in filters)options[name]="<input type='radio' name='"+this.internal_ids.menu+"[button][favorite]' value='"+name+"' title='"+this.egw().lang("Set as default")+"'/>"+(void 0!=filters[name].name?filters[name].name:name)+(0!=filters[name].group&&!this.is_admin||"blank"==name?"":"<div class='ui-icon ui-icon-trash' title='"+this.egw().lang("Delete")+"'/>");this.nextmatch&&(options.add="<img src='"+this.egw().image("new")+"'/>"+this.egw().lang("Add current")),widget.set_select_options.call(widget,options),$j("input[value='"+this.preferred+"']:radio",this.menu).attr("checked",!0)},set_nm_filters:function(filters){this.nextmatch?this.nextmatch.applyFilters(filters):console.log(filters)},onclick:function(node){this.
|
||
|
h=h||"";var c="<div class='"+l+"' style='"+_+"' column_id='"+o.name+"'>"+h+d+"</div>";e.push(c)}this.$grid_scale.style.height=this.config.scale_height-1+"px",this.$grid_scale.style.lineHeight=a+"px",this.$grid_scale.style.width=n-1+"px",this.$grid_scale.innerHTML=e.join("")},gantt._render_grid_item=function(t){if(!gantt._is_grid_visible())return null;for(var e=this.config.columns,n=[],i=0;i<e.length;i++){var a,s,r=i==e.length-1,o=e[i];"add"==o.name&&i==e.length-1?s="<div class='gantt_add'></div>":(s=o.template?o.template(t):t[o.name],s instanceof Date&&(s=this.templates.date_grid(s)),s="<div class='gantt_tree_content'>"+s+"</div>");var d="gantt_cell"+(r?" gantt_last_cell":""),l="";if(o.tree){for(var _=0;_<t.$level;_++)l+=this.templates.grid_indent(t);var h=this._branches[t.id]&&this._branches[t.id].length>0;h?(l+=this.templates.grid_open(t),l+=this.templates.grid_folder(t)):(l+=this.templates.grid_blank(t),l+=this.templates.grid_file(t))}var c="width:"+(o.width-(r?1:0))+"px;";dhtmlx.defined(o.align)&&(c+="text-align:"+o.align+";"),a="<div class='"+d+"' style='"+c+"'>"+l+s+"</div>",n.push(a)}var d=t.$index%2===0?"":" odd";if(d+=t.$transparent?" gantt_transparent":"",this.templates.grid_row_class){var g=this.templates.grid_row_class.call(this,t.start_date,t.end_date,t);g&&(d+=" "+g)}this.getState().selected_task==t.id&&(d+=" gantt_selected");var u=document.createElement("div");return u.className="gantt_row"+d,u.style.height=this.config.row_height+"px",u.style.lineHeight=gantt.config.row_height+"px",u.setAttribute(this.config.task_attribute,t.id),u.innerHTML=n.join(""),u},gantt.open=function(t){gantt._set_item_state(t,!0),this.callEvent("onTaskOpened",[t])},gantt.close=function(t){gantt._set_item_state(t,!1),this.callEvent("onTaskClosed",[t])},gantt._set_item_state=function(t,e){t&&this._pull[t]&&(this._pull[t].$open=e,this.refreshData())},gantt._is_grid_visible=function(){return this.config.grid_width&&this.config.show_grid},gantt._get_grid_width=function(){return this._is_grid_visible()?this._is_chart_visible()?this.config.grid_width:this._x:0},gantt.getTaskIndex=function(t){for(var e=this._branches[this.getTask(t).parent],n=0;n<e.length;n++)if(e[n]==t)return n;return-1},gantt.getGlobalTaskIndex=function(t){for(var e=this._order,n=0;n<e.length;n++)if(e[n]==t)return n;return-1},gantt.moveTask=function(t,e,n){var i=arguments[3];if(i){if(i===t)return;n=this.getTask(i).parent,e=this.getTaskIndex(i)}n=n||this.config.root_id;var a=this.getTask(t),s=(this._branches[a.parent],this._branches[n]);if(-1==e&&(e=s.length+1),a.parent==n){var r=this.getTaskIndex(t);if(r==e)return;e>r&&e--}this._replace_branch_child(a.parent,t),s=this._branches[n];var o=s[e];o?s=s.slice(0,e).concat([t]).concat(s.slice(e)):s.push(t),a.parent=n,this._branches[n]=s,this.refreshData()},gantt._init_dnd=function(){var t=new dhtmlxDnD(this.$grid_data,{updates_per_second:60});dhtmlx.defined(this.config.dnd_sensitivity)&&(t.config.sensitivity=this.config.dnd_sensitivity),t.attachEvent("onBeforeDragStart",dhtmlx.bind(function(t,e){var n=this._locateHTML(e);if(!n)return!1;this.hideQuickInfo&&this._hideQuickInfo();var i=this.locate(e);return this.callEvent("onRowDragStart",[i,e.target||e.srcElement,e])?void 0:!1},this)),t.attachEvent("onAfterDragStart",dhtmlx.bind(function(e,n){var i=this._locateHTML(n);t.config.marker.innerHTML=i.outerHTML,t.config.id=this.locate(n);var a=this.getTask(t.config.id);a.$open=!1,a.$transparent=!0,this.refreshData()},this)),t.lastTaskOfLevel=function(t){for(var e=gantt._order,n=gantt._pull,i=null,a=0,s=e.length;s>a;a++)n[e[a]].$level==t&&(i=n[e[a]]);return i?i.id:null},t.attachEvent("onDragMove",dhtmlx.bind(function(e,n){var i=t.config,a=this._get_position(this.$grid_data),s=a.x+10,r=n.pos.y-10;r<a.y&&(r=a.y),r>a.y+this.$grid_data.offsetHeight-this.config.row_height&&(r=a.y+this.$grid_data.offsetHeight-this.config.row_height),i.marker.style.left=s+"px",i.marker.style.top=r+"px";var o=document.elementFromPoint(a.x-document.body.scrollLeft+1,r-document.body.scrollTop),d=this.locate(o),l=this.getTask(t.config.id);if(this.isTaskExists(d)||
|
||
|
c},gantt._adjust_scales=function(){if(this.config.fit_tasks){var t=+this._min_date,e=+this._max_date;if(this._init_tasks_range(),+this._min_date!=t||+this._max_date!=e)return this.render(),this.callEvent("onScaleAdjusted",[]),!0}return!1},gantt.refreshTask=function(t,e){var n=this._get_task_renderers(),i=this.getTask(t);if(i&&this.isTaskVisible(t))for(var a=0;a<n.length;a++)n[a].render_item(i);else for(var a=0;a<n.length;a++)n[a].remove_item(t);if(void 0===e||e){for(var i=this.getTask(t),a=0;a<i.$source.length;a++)gantt.refreshLink(i.$source[a]);for(var a=0;a<i.$target.length;a++)gantt.refreshLink(i.$target[a])}},gantt.refreshLink=function(t){this.isLinkExists(t)?gantt._render_link(t):gantt._linkRenderer.remove_item(t)},gantt._combine_item_class=function(t,e,n){var i=[t];e&&i.push(e);var a=gantt.getState(),s=this.getTask(n);this._get_safe_type(s.type)==this.config.types.milestone&&i.push("gantt_milestone"),this._get_safe_type(s.type)==this.config.types.project&&i.push("gantt_project"),this._is_flex_task(s)&&i.push("gantt_dependent_task"),this.config.select_task&&n==a.selected_task&&i.push("gantt_selected"),n==a.drag_id&&i.push("gantt_drag_"+a.drag_mode);var r=gantt._get_link_state();if(r.link_source_id==n&&i.push("gantt_link_source"),r.link_target_id==n&&i.push("gantt_link_target"),r.link_landing_area&&r.link_target_id&&r.link_source_id&&r.link_target_id!=r.link_source_id){var o=r.link_source_id,d=r.link_source_start,l=r.link_target_start,_=gantt.isLinkAllowed(o,n,d,l),h="";h=_?l?"link_start_allow":"link_finish_allow":l?"link_start_deny":"link_finish_deny",i.push(h)}return i.join(" ")},gantt._render_pair=function(t,e,n,i){var a=gantt.getState();+n.end_date<=+a.max_date&&t.appendChild(i(e+" task_right")),+n.start_date>=+a.min_date&&t.appendChild(i(e+" task_left"))},gantt._get_task_height=function(){var t=this.config.task_height;return"full"==t&&(t=this.config.row_height-5),t=Math.min(t,this.config.row_height),Math.max(t,0)},gantt._get_milestone_width=function(){return this._get_task_height()},gantt._get_visible_milestone_width=function(){var t=gantt._get_task_height();return Math.sqrt(2*t*t)},gantt._get_task_width=function(t){return Math.round(this._get_task_pos(t,!1).x-this._get_task_pos(t,!0).x)},gantt._render_task_element=function(t){var e=this._get_task_pos(t),n=this.config,i=this._get_task_height(),a=Math.floor((this.config.row_height-i)/2);t.type==n.types.milestone&&n.link_line_width>1&&(a+=1);var s=document.createElement("div"),r=gantt._get_task_width(t),o=this._get_safe_type(t.type);s.setAttribute(this.config.task_attribute,t.id),s.appendChild(gantt._render_task_content(t,r)),s.className=this._combine_item_class("gantt_task_line",this.templates.task_class(t.start_date,t.end_date,t),t.id),s.style.cssText=["left:"+e.x+"px","top:"+(a+e.y)+"px","height:"+i+"px","line-height:"+i+"px","width:"+r+"px"].join(";");var d=this._render_leftside_content(t);return d&&s.appendChild(d),d=this._render_rightside_content(t),d&&s.appendChild(d),n.show_progress&&o!=this.config.types.milestone&&this._render_task_progress(t,s,r),this.config.readonly||(n.drag_resize&&!this._is_flex_task(t)&&o!=this.config.types.milestone&&gantt._render_pair(s,"gantt_task_drag",t,function(t){var e=document.createElement("div");return e.className=t,e}),n.drag_links&&gantt._render_pair(s,"gantt_link_control",t,function(t){var e=document.createElement("div");e.className=t,e.style.cssText=["height:"+i+"px","line-height:"+i+"px"].join(";");var n=document.createElement("div");return n.className="gantt_link_point",e.appendChild(n),e})),s},gantt._render_side_content=function(t,e,n){if(!e)return null;var i=e(t.start_date,t.end_date,t);if(!i)return null;var a=document.createElement("div");return a.className="gantt_side_content "+n,a.innerHTML=i,a},gantt._render_leftside_content=function(t){var e="gantt_left "+gantt._get_link_crossing_css(!0,t);return gantt._render_side_content(t,this.templates.leftside_text,e)},gantt._render_rightside_content=function(t){var e="gantt_right "+gantt._get_link_crossing_css(!1,t);return gantt._render_side_content(t,this.templates.righ
|
||
|
if(i){t[n].id="area_"+dhtmlx.uid();var a=t[n].hidden?" style='display:none'":"",s="";t[n].button&&(s="<div class='dhx_custom_button' index='"+n+"'><div class='dhx_custom_button_"+t[n].button+"'></div><div>"+this.locale.labels["button_"+t[n].button]+"</div></div>"),this.config.wide_form&&(e+="<div class='dhx_wrap_section' "+a+">"),e+="<div id='"+t[n].id+"' class='dhx_cal_lsection'>"+s+this.locale.labels["section_"+t[n].name]+"</div>"+i.render.call(this,t[n]),e+="</div>"}}return e},gantt.resizeLightbox=function(){var t=this._lightbox;if(t){var e=t.childNodes[1];e.style.height="0px",e.style.height=e.scrollHeight+"px",t.style.height=e.scrollHeight+this.config.lightbox_additional_height+"px",e.style.height=e.scrollHeight+"px"}},gantt._center_lightbox=function(t){if(t){t.style.display="block";var e=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop,n=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,i=window.innerHeight||document.documentElement.clientHeight;t.style.top=e?Math.round(e+Math.max((i-t.offsetHeight)/2,0))+"px":Math.round(Math.max((i-t.offsetHeight)/2,0)+9)+"px",t.style.left=document.documentElement.scrollWidth>document.body.offsetWidth?Math.round(n+(document.body.offsetWidth-t.offsetWidth)/2)+"px":Math.round((document.body.offsetWidth-t.offsetWidth)/2)+"px"}},gantt.showCover=function(){if(!this._cover){this._cover=document.createElement("DIV"),this._cover.className="dhx_cal_cover";var t=void 0!==document.height?document.height:document.body.offsetHeight,e=document.documentElement?document.documentElement.scrollHeight:0;this._cover.style.height=Math.max(t,e)+"px",document.body.appendChild(this._cover)}},gantt._init_lightbox_events=function(){gantt.lightbox_events={},gantt.lightbox_events.dhx_save_btn=function(){gantt._save_lightbox()},gantt.lightbox_events.dhx_delete_btn=function(){gantt.callEvent("onLightboxDelete",[gantt._lightbox_id])&&gantt.$click.buttons.delete(gantt._lightbox_id)},gantt.lightbox_events.dhx_cancel_btn=function(){gantt._cancel_lightbox()},gantt.lightbox_events.default=function(t,e){if(e.getAttribute("dhx_button"))gantt.callEvent("onLightboxButton",[e.className,e,t]);else{var n,i,a;-1!=e.className.indexOf("dhx_custom_button")&&(-1!=e.className.indexOf("dhx_custom_button_")?(n=e.parentNode.getAttribute("index"),a=e.parentNode.parentNode):(n=e.getAttribute("index"),a=e.parentNode,e=e.firstChild));var s=gantt._get_typed_lightbox_config();n&&(i=gantt.form_blocks[s[n].type],i.button_click(n,e,a,a.nextSibling))}},dhtmlxEvent(gantt.getLightbox(),"click",function(t){t=t||window.event;var e=t.target?t.target:t.srcElement;if(e.className||(e=e.previousSibling),e&&e.className&&0===e.className.indexOf("dhx_btn_set")&&(e=e.firstChild),e&&e.className){var n=dhtmlx.defined(gantt.lightbox_events[e.className])?gantt.lightbox_events[e.className]:gantt.lightbox_events.default;return n(t,e)}return!1}),gantt.getLightbox().onkeydown=function(t){switch((t||event).keyCode){case gantt.keys.edit_save:if((t||event).shiftKey)return;gantt._save_lightbox();break;case gantt.keys.edit_cancel:gantt._cancel_lightbox()}}},gantt._cancel_lightbox=function(){var t=this.getLightboxValues();this.callEvent("onLightboxCancel",[this._lightbox_id,t.$new]),t.$new&&(this._deleteTask(t.id,!0),this.refreshData()),this.hideLightbox()},gantt._save_lightbox=function(){var t=this.getLightboxValues();this.callEvent("onLightboxSave",[this._lightbox_id,t,!!t.$new])&&(t.$new?(delete t.$new,this.addTask(t)):(dhtmlx.mixin(this.getTask(t.id),t,!0),this.updateTask(t.id)),this.refreshData(),this.hideLightbox())},gantt.getLightboxValues=function(){for(var t=dhtmlx.mixin({},this.getTask(this._lightbox_id)),e=this._get_typed_lightbox_config(),n=0;n<e.length;n++){var i=document.getElementById(e[n].id);i=i?i.nextSibling:i;var a=this.form_blocks[e[n].type],s=a.get_value.call(this,i,t,e[n]);"auto"!=e[n].map_to&&(t[e[n].map_to]=s)}return t},gantt.hideLightbox=function(){var t=this.getLightbox();t&&(t.style.display="none"),this._lightbox_id=null,this.hideCover(),this.callEvent("onAfterLightbox",[])},gant
|
||
|
if(r&&o)return i}}i=i.parentNode}return null},gantt._locateHTML=function(t,e){var n=gantt._get_target_node(t);for(e=e||this.config.task_attribute;n;){if(n.getAttribute){var i=n.getAttribute(e);if(i)return n}n=n.parentNode}return null},gantt.getTaskRowNode=function(t){for(var e=this.$grid_data.childNodes,n=this.config.task_attribute,i=0;i<e.length;i++)if(e[i].getAttribute){var a=e[i].getAttribute(n);if(a==t)return e[i]}return null},gantt.getState=function(){return{drag_id:this._tasks_dnd.drag.id,drag_mode:this._tasks_dnd.drag.mode,drag_from_start:this._tasks_dnd.drag.left,selected_task:this._selected_task,min_date:new Date(this._min_date),max_date:new Date(this._max_date),lightbox:this._lightbox_id}},gantt._checkTimeout=function(t,e){if(!e)return!0;var n=1e3/e;return 1>n?!0:t._on_timeout?!1:(setTimeout(function(){delete t._on_timeout},n),t._on_timeout=!0,!0)},gantt.selectTask=function(t){if(!this.config.select_task)return!1;if(t){if(this._selected_task==t)return this._selected_task;if(!this.callEvent("onBeforeTaskSelected",[t]))return!1;this.unselectTask(),this._selected_task=t,this.refreshTask(t),this.callEvent("onTaskSelected",[t])}return this._selected_task},gantt.unselectTask=function(){var t=this._selected_task;t&&(this._selected_task=null,this.refreshTask(t),this.callEvent("onTaskUnselected",[t]))},gantt.getSelectedId=function(){return dhtmlx.defined(this._selected_task)?this._selected_task:null},gantt.changeLightboxType=function(t){return this.getLightboxType()==t?!0:void gantt._silent_redraw_lightbox(t)},gantt.date={init:function(){for(var t=gantt.locale.date.month_short,e=gantt.locale.date.month_short_hash={},n=0;n<t.length;n++)e[t[n]]=n;for(var t=gantt.locale.date.month_full,e=gantt.locale.date.month_full_hash={},n=0;n<t.length;n++)e[t[n]]=n},date_part:function(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.getHours()&&t.setTime(t.getTime()+36e5*(24-t.getHours())),t},time_part:function(t){return(t.valueOf()/1e3-60*t.getTimezoneOffset())%86400},week_start:function(t){var e=t.getDay();return gantt.config.start_on_monday&&(0===e?e=6:e--),this.date_part(this.add(t,-1*e,"day"))},month_start:function(t){return t.setDate(1),this.date_part(t)},year_start:function(t){return t.setMonth(0),this.month_start(t)},day_start:function(t){return this.date_part(t)},hour_start:function(t){var e=t.getHours();return this.day_start(t),t.setHours(e),t},minute_start:function(t){var e=t.getMinutes();return this.hour_start(t),t.setMinutes(e),t},_add_days:function(t,e){var n=new Date(t.valueOf());return n.setDate(n.getDate()+e),!t.getHours()&&n.getHours()&&n.setTime(n.getTime()+36e5*(24-n.getHours())),n},add:function(t,e,n){var i=new Date(t.valueOf());switch(n){case"day":i=gantt.date._add_days(i,e);break;case"week":i=gantt.date._add_days(i,7*e);break;case"month":i.setMonth(i.getMonth()+e);break;case"year":i.setYear(i.getFullYear()+e);break;case"hour":i.setTime(i.getTime()+60*e*60*1e3);break;case"minute":i.setTime(i.getTime()+60*e*1e3);break;default:return gantt.date["add_"+n](t,e,n)}return i},to_fixed:function(t){return 10>t?"0"+t:t},copy:function(t){return new Date(t.valueOf())},date_to_str:function(t,e){return t=t.replace(/%[a-zA-Z]/g,function(t){switch(t){case"%d":return'"+gantt.date.to_fixed(date.getDate())+"';case"%m":return'"+gantt.date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+gantt.date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+gantt.locale.date.day_short[date.getDay()]+"';case"%l":return'"+gantt.locale.date.day_full[date.getDay()]+"';case"%M":return'"+gantt.locale.date.month_short[date.getMonth()]+"';case"%F":return'"+gantt.locale.date.month_full[date.getMonth()]+"';case"%h":return'"+gantt.date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+gantt.date.to_fixed(date.getHours())+"';case"%i":return'"+gantt.date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHou
|
||
|
widget_object.flags=EGW_AO_FLAG_IS_CONTAINER},_link_task:function(taskId){if(taskId){var objectManager=egw_getObjectManager(this.id,!1),obj=null;(obj=objectManager.getObjectById(taskId))||(obj=objectManager.addObject(taskId,this.dhtmlxGanttItemAOI(this.gantt,taskId)),obj.data=this.gantt.getTask(taskId),obj.updateActionLinks(objectManager.actionLinks)),objectManager.setAllSelected(!1),obj.setSelected(!0),objectManager.updateSelectedChildren(obj,!0)}},dhtmlxGanttItemAOI:function(gantt,task_id){var aoi=new egwActionObjectInterface;return aoi.node=gantt.getTaskNode(task_id),aoi.id=task_id,aoi.doGetDOMNode=function(){return aoi.node},aoi.doTriggerEvent=function(_event){_event==EGW_AI_DRAG_OVER&&$j(this.node).addClass("draggedOver"),_event==EGW_AI_DRAG_OUT&&$j(this.node).removeClass("draggedOver")},aoi.doSetState=function(_state){gantt&&gantt.isTaskExists(this.id)&&(egwBitIsSet(_state,EGW_AO_STATE_SELECTED)?gantt.selectTask(this.id):gantt.unselectTask(this.id))},aoi}})}.call(this);et2_register_widget(et2_gantt,["gantt"]),$j(function(){"use strict";gantt.templates.grid_file=function(item){return item.pe_icon&&egw.image(item.pe_icon)?"<div class='gantt_tree_icon' style='background-image: url(\""+egw.image(item.pe_icon)+"\");'/></div>":"<div class='gantt_tree_icon gantt_file'></div>"},gantt.templates.scale_row_class=function(scale){return"minute"!=scale.unit&&"month"!=scale.unit?scale.class||"et2_clickable":scale.class},gantt.templates.progress_text=function(start,end,task){return"<span>"+Math.round(100*task.progress)+"% </span>"},gantt.templates.scale_cell_class=function(date){return 0==date.getDay()||6==date.getDay()?"weekend":void 0},gantt.templates.task_cell_class=function(item,date){return 0==date.getDay()||6==date.getDay()?"weekend":void 0},gantt.templates.leftside_text=function(start,end,task){var text="";if(task.planned_start){"string"==typeof task.planned_start&&(task.planned_start=gantt.date.parseDate(task.planned_start,"xml_date"));var p_start=gantt.posFromDate(task.planned_start)-gantt.posFromDate(start);text="<div class='gantt_task_line gantt_task_planned' style='width:"+Math.abs(p_start)+"px; right:"+(p_start>0?-p_start:0)+"px;'><span>"+gantt.date.date_to_str(gantt.config.api_date)(task.planned_start)+"</span></div>"}return text},gantt.templates.rightside_text=function(start,end,task){var text="";if(task.planned_end){"string"==typeof task.planned_end&&(task.planned_end=gantt.date.parseDate(task.planned_end,"xml_date"));var p_end=gantt.posFromDate(task.planned_end)-gantt.posFromDate(end);text="<div class='gantt_task_line gantt_task_planned' style='left:"+(p_end>0?0:p_end)+"px; width:"+Math.abs(p_end)+"px'><span>"+gantt.date.date_to_str(gantt.config.api_date)(task.planned_end)+"</span></div>"}return text},gantt.templates.link_class=function(link){var link_class="",source=gantt.getTask(link.source),target=gantt.getTask(link.target),valid=!0,types=gantt.config.links;switch(link.type){case types.finish_to_start:valid=source.end_date<=target.start_date;break;case types.start_to_start:valid=source.start_date<=target.start_date;break;case types.finish_to_finish:valid=source.end_date>=target.end_date;break;case types.start_to_finish:valid=source.start_date>=target.end_date}return link_class+=valid?"":"invalid_constraint"}});var et2_html=function(){"use strict";return et2_valueWidget.extend([et2_IDetachedDOM],{attributes:{label:{default:"",description:"The label is displayed by default in front (for radiobuttons behind) each widget (if not empty). If you want to specify a different position, use a '%s' in the label, which gets replaced by the widget itself. Eg. '%s Name' to have the label Name behind a checkbox. The label can contain variables, as descript for name. If the label starts with a '@' it is replaced by the value of the content-array at this index (with the '@'-removed and after expanding the variables).",ignore:!1,name:"Label",translate:!0,type:"string"},needed:{ignore:!0},value:{name:"Value",description:"The value of the widget",type:"html",default:et2_no_init}},init:function(){this._super.apply(this,arguments),
|
||
|
}),cfg.expanded===!0&&(cfg.expanded=!1,ms.expand())},_renderComboItems:function(items,isGrouped){var ref=this,html="";$.each(items,function(index,value){var displayed=null!==cfg.renderer?cfg.renderer.call(ref,value):value[cfg.displayField],disabled=null!==cfg.disabledField&&value[cfg.disabledField]===!0,resultItemEl=$("<div/>",{class:"ms-res-item "+(isGrouped?"ms-res-item-grouped ":"")+(disabled?"ms-res-item-disabled ":"")+(index%2===1&&cfg.useZebraStyle===!0?"ms-res-odd":""),html:cfg.highlight===!0?self._highlightSuggestion(displayed):displayed,"data-json":JSON.stringify(value)});html+=$("<div/>").append(resultItemEl).html()}),ms.combobox.append(html),_comboItemHeight=ms.combobox.find(".ms-res-item:first").outerHeight()},_renderSelection:function(){var ref=this,w=0,inputOffset=0,items=[],asText=cfg.resultAsString===!0&&!_hasFocus;ms.selectionContainer.find(".ms-sel-item").remove(),void 0!==ms._valueContainer&&ms._valueContainer.remove(),$.each(_selection,function(index,value){var selectedItemEl,delItemEl,selectedItemHtml=null!==cfg.selectionRenderer?cfg.selectionRenderer.call(ref,value):value[cfg.displayField],validCls=self._validateSingleItem(value[cfg.displayField])?"":" ms-sel-invalid";asText===!0?selectedItemEl=$("<div/>",{class:"ms-sel-item ms-sel-text "+cfg.selectionCls+validCls,html:selectedItemHtml+(index===_selection.length-1?"":cfg.resultAsStringDelimiter)}).data("json",value):(selectedItemEl=$("<div/>",{class:"ms-sel-item "+cfg.selectionCls+validCls,html:selectedItemHtml}).data("json",value),cfg.disabled===!1&&(delItemEl=$("<span/>",{class:"ms-close-btn"}).data("json",value).appendTo(selectedItemEl),delItemEl.click($.proxy(handlers._onTagTriggerClick,ref)),cfg.allowFreeEntries===!0&&selectedItemEl.dblclick($.proxy(handlers._onTagEditTriggerDblClick,ref)))),items.push(selectedItemEl)}),ms.selectionContainer.prepend(items),ms._valueContainer=$("<div/>",{style:"display: none;"}),$.each(ms.getValue(),function(i,val){var el=$("<input/>",{type:"hidden",name:cfg.name,value:val});el.appendTo(ms._valueContainer)}),ms._valueContainer.appendTo(ms.selectionContainer),"inner"!==cfg.selectionPosition||cfg.selectionContainer||(ms.input.width(0),inputOffset=ms.input.offset().left-ms.selectionContainer.offset().left,w=ms.container.width()-inputOffset-42,ms.input.width(w)),_selection.length===cfg.maxSelection?self._updateHelper(cfg.maxSelectionRenderer.call(this,_selection.length)):ms.helper.hide()},_selectItem:function(item){1===cfg.maxSelection&&(_selection=[]),ms.addToSelection(item.data("json")),item.removeClass("ms-res-item-active"),cfg.expandOnFocus!==!1&&_selection.length!==cfg.maxSelection||ms.collapse(),_hasFocus?_hasFocus&&(cfg.expandOnFocus||_ctrlDown)&&(self._processSuggestions(),_ctrlDown&&ms.expand()):ms.input.focus()},_sortAndTrim:function(data){var q=ms.getRawValue(),filtered=[],newSuggestions=[],selectedValues=ms.getValue();return q.length>0?$.each(data,function(index,obj){var name=obj[cfg.displayField];(cfg.matchCase===!0&&name.indexOf(q)>-1||cfg.matchCase===!1&&name.toLowerCase().indexOf(q.toLowerCase())>-1)&&(cfg.strictSuggest!==!1&&0!==name.toLowerCase().indexOf(q.toLowerCase())||filtered.push(obj))}):filtered=data,$.each(filtered,function(index,obj){(cfg.allowDuplicates||-1===$.inArray(obj[cfg.valueField],selectedValues))&&newSuggestions.push(obj)}),null!==cfg.sortOrder&&newSuggestions.sort(function(a,b){return a[cfg.sortOrder]<b[cfg.sortOrder]?"asc"===cfg.sortDir?-1:1:a[cfg.sortOrder]>b[cfg.sortOrder]?"asc"===cfg.sortDir?1:-1:0}),cfg.maxSuggestions&&cfg.maxSuggestions>0&&(newSuggestions=newSuggestions.slice(0,cfg.maxSuggestions)),newSuggestions},_group:function(data){return null!==cfg.groupBy&&(_groups={},$.each(data,function(index,value){var props=cfg.groupBy.indexOf(".")>-1?cfg.groupBy.split("."):cfg.groupBy,prop=value[cfg.groupBy];if("string"!=typeof props)for(prop=value;props.length>0;)prop=prop[props.shift()];void 0===_groups[prop]?_groups[prop]={title:prop,items:[value]}:_groups[prop].items.push(value)})),data},_updateHelper:function(html){ms.helper.html(html),ms.helper.is(":visible")||ms.helper.f
|
||
|
var children={},add_children=function(root,children){for(var id in root.children){var info={id:id||root.children[id].id,label:root.children[id].caption},childaction={};root.children[id].iconUrl&&(info.icon=root.children[id].iconUrl),root.children[id].children&&add_children(root.children[id],info),children[id]=info,that.flat_list&&(childaction=root.children[id],"undefined"!=typeof pref||isDefault?isDefault||"undefined"==typeof pref[childaction.id]&&that._fix_preference(childaction):childaction.toolbarDefault?that.set_prefered(childaction.id,!1):that.set_prefered(childaction.id,!0),"undefined"!=typeof root.children[id].group&&"undefined"!=typeof root.group&&(childaction.group=root.group),that._make_button(childaction))}};if(add_children(action,children),this.flat_list&&children)continue;var dropdown=et2_createWidget("dropdown_button",{id:action.id},this);if(dropdown.set_select_options(children),dropdown.set_label(action.caption),"undefined"!=typeof action.children)for(var child in action.children)action.children[child].default&&dropdown.set_label(action.children[child].caption);dropdown.set_image(action.iconUrl||""),dropdown.onchange=jQuery.proxy(function(selected,dropdown){var action=that._actionManager.getActionById(selected.attr("data-id"));dropdown.set_label(action.caption),action&&(this.value=action.id,action.execute([]))},action),dropdown.onclick=jQuery.proxy(function(selected,dropdown){var action=that._actionManager.getActionById(this.getValue());action&&(this.value=action.id,action.execute([]))},dropdown),$j(dropdown.getDOMNode()).attr("id",this.id+"-"+dropdown.id).addClass(this.preference[action.id]?"et2_toolbar-dropdown et2_toolbar-dropdown-menulist":"et2_toolbar-dropdown").appendTo(this.preference[action.id]?this.actionbox.children()[1]:$j("[data-group="+action.group+"]",this.actionlist))}else this._make_button(action)}this.actionlist.find("span[data-group]").sort(function(lg,g){return+lg.getAttribute("data-group")-+g.getAttribute("data-group")}).appendTo(this.actionlist),this.actionlist.appendTo(this.div),this.actionbox.appendTo(this.div);var toolbar=this.actionlist.find("span[data-group]").children(),toolbox=this.actionbox,menulist=jQuery(this.actionbox.children()[1]);toolbar.draggable({cancel:!0,zIndex:1e3,delay:500,containment:"document",cursor:"move",helper:"clone",appendTo:"body",stop:function(event,ui){that._build_menu(actions)}}),menulist.children().draggable({cancel:!0,containment:"document",helper:"clone",appendTo:"body",zIndex:1e3,cursor:"move",start:function(){jQuery(that.actionlist).addClass("et2_toolbarDropArea")},stop:function(){jQuery(that.actionlist).removeClass("et2_toolbarDropArea")}}),toolbox.children().droppable({accept:toolbar,drop:function(event,ui){that.set_prefered(ui.draggable.attr("id").replace(that.id+"-",""),!0),ui.draggable.appendTo(menulist),0==that.actionlist.find(".ui-draggable").length&&(that.preference={},egw.set_preference(that.egw().getAppName(),that.dom_id,that.preference))},tolerance:"touch"}),this.actionlist.droppable({tolerance:"pointer",drop:function(event,ui){that.set_prefered(ui.draggable.attr("id").replace(that.id+"-",""),!1),ui.draggable.appendTo(that.actionlist),that._build_menu(actions)}}),toolbox.accordion({heightStyle:"fill",collapsible:!0,active:"none",activate:function(event,ui){var menubox=event.target;0==ui.oldHeader.length&&$j("html").on("click.outsideOfMenu",function(event){$j(menubox).accordion("option","active",2),$j(this).unbind(event),$j(menubox).children().removeClass("ui-state-focus")})},create:function(event,ui){$j("html").unbind("click.outsideOfMenu")},beforeActivate:function(){return 0==menulist.children().length?!1:void 0}})},set_prefered:function(_action,_state){this.preference[_action]=_state,egwIsMobile()||egw.set_preference(this.egw().getAppName(),this.dom_id,this.preference)},_make_button:function(action){var button_options={},button=$j(document.createElement("button")).addClass("et2_button et2_button_text et2_button_with_image").attr("id",this.id+"-"+action.id).attr("title",action.hint?action.hint:action.caption).attr("type","button").appen
|
||
|
},transformAttributes:function(_attrs){if(this._super.apply(arguments),"undefined"!=typeof _attrs.src){var manager=this.getArrayMgr("content");if(manager){var src=manager.getEntry(_attrs.src);"undefined"!=typeof src&&null!==src&&("object"==typeof src&&(src=egw().link("/index.php",src)),_attrs.src=src)}}},set_label:function(_value){this.options.label=_value,_value=this.egw().lang(_value),this.image.attr("alt",_value).attr("title",_value)},setValue:function(_value){this.set_src(_value)},set_href:function(_value){if(!this.isInTree())return!1;this.options.href=_value,this.image.wrapAll('<a href="'+_value+'"></a>"');var href=this.options.href,popup=this.options.extra_link_popup,target=this.options.extra_link_target,self=this;return this.image.click(function(e){return self.options.expose_view?(self._init_blueimp_gallery(e,_value),e.stopImmediatePropagation()):egw.open_link(href,target,popup),e.preventDefault(),!1}),!0},set_src:function(_value){if(!this.isInTree())return!1;this.options.src=_value;var src=this.egw().image(_value);return src?(this.image.attr("src",src).show(),!0):"/"==_value[0]||"http"==_value.substr(0,4)?(this.image.attr("src",_value).show(),!0):(src=null,this.options.default_src&&(src=this.egw().image(this.options.default_src)),src?this.image.attr("src",src).show():this.image.css("display","none"),!1)},getMedia:function(_value){var base_url=egw.webserverUrl.match(/^\//,"ig")?egw(window).window.location.origin+egw.webserverUrl+"/":egw.webserverUrl+"/",mediaContent=[];return _value&&(mediaContent=[{title:this.options.label,href:base_url+_value,type:this.options.type+"/*",thumbnail:base_url+_value}]),mediaContent},getDetachedAttributes:function(_attrs){_attrs.push("src","label","href")},getDetachedNodes:function(){return[this.image[0]]},setDetachedAttributes:function(_nodes,_values){this.image=$j(_nodes[0]),_values.src&&this.set_src(_values.src),_values.label&&this.set_label(_values.label),_values.href&&(this.image.addClass("et2_clickable"),this.set_href(_values.href))}}))}.call(this);et2_register_widget(et2_image,["image"]);var et2_appicon=function(){"use strict";return et2_image.extend({attributes:{default_src:{name:"Default image",type:"string",default:"nonav",description:"Image to use if there is no application icon"}},set_src:function(_app){_app||(_app=this.egw().app_name()),this.image.addClass("et2_appicon"),this._super.call(this,"sitemgr-link"==_app?"sitemgr/sitemgr-link":(this.egw().app(_app,"icon_app")||_app)+"/"+(this.egw().app(_app,"icon")||"navbar"))}})}.call(this);et2_register_widget(et2_appicon,["appicon"]);var et2_iframe=function(){"use strict";return et2_valueWidget.extend({attributes:{label:{default:"",description:"The label is displayed by default in front (for radiobuttons behind) each widget (if not empty). If you want to specify a different position, use a '%s' in the label, which gets replaced by the widget itself. Eg. '%s Name' to have the label Name behind a checkbox. The label can contain variables, as descript for name. If the label starts with a '@' it is replaced by the value of the content-array at this index (with the '@'-removed and after expanding the variables).",ignore:!1,name:"Label",translate:!0,type:"string"},needed:{ignore:!0},seamless:{name:"Seamless",default:!0,description:"Specifies that the iframe should be rendered in a manner that makes it appear to be part of the containing document",translate:!1,type:"boolean"},name:{name:"Name",default:"",description:"Specifies name of frame, to be used as target for links",type:"string"},fullscreen:{name:"Fullscreen",default:!1,description:"Make the iframe compatible to be a fullscreen video player mode",type:"boolean"}},init:function(){this._super.apply(this,arguments),this.supportedWidgetClasses=[],this.htmlNode=$j(document.createElement("iframe")),this.options.label&&this.htmlNode.append('<span class="et2_label">'+this.options.label+"</span>"),this.options.fullscreen&&this.htmlNode.attr("allowfullscreen",!0),this.setDOMNode(this.htmlNode[0])},set_name:function(_name){this.htmlNode.attr("name",this.htmlNode.name=_name)},set_seamle
|
||
|
var et2_progress=function(){"use strict";return et2_valueWidget.extend([et2_IDetachedDOM],{attributes:{href:{name:"Link Target",type:"string",description:"Link URL, empty if you don't wan't to display a link."},extra_link_target:{name:"Link target",type:"string",default:"_self",description:"Link target descriptor"},extra_link_popup:{name:"Popup",type:"string",description:"widthxheight, if popup should be used, eg. 640x480"},label:{name:"Label",default:"",type:"string",description:"The label is displayed as the title. The label can contain variables, as descript for name. If the label starts with a '@' it is replaced by the value of the content-array at this index (with the '@'-removed and after expanding the variables).",translate:!0}},legacyOptions:["href","extra_link_target","imagemap","extra_link_popup","id"],init:function(){this._super.apply(this,arguments);var outer=document.createElement("div");outer.className="et2_progress",this.progress=document.createElement("div"),this.progress.style.width="0",outer.appendChild(this.progress),this.options.href&&(outer.className+=" et2_clickable"),this.options.class&&(outer.className+=" "+this.options.class),this.setDOMNode(outer)},click:function(){this._super.apply(this,arguments),this.options.href&&this.egw().open_link(this.options.href,this.options.extra_link_target,this.options.extra_link_popup)},set_value:function(_value){_value=parseInt(_value)+"%",this.progress.style.width=_value,this.options.label||this.set_label(_value)},set_label:function(_value){this.node.title=_value},set_class:function(_value){var baseClass="et2_progress";this.options.href&&(baseClass+=" et2_clickable"),this.node.setAttribute("class",baseClass+" "+_value)},set_href:function(_value){if(!this.isInTree())return!1;if(this.options.href=_value,_value){jQuery(this.node).addClass("et2_clickable").wrapAll('<a href="'+_value+'"></a>"');var href=this.options.href,popup=this.options.extra_link_popup,target=this.options.extra_link_target;jQuery(this.node).parent().click(function(e){return egw.open_link(href,target,popup),e.preventDefault(),!1})}else jQuery(this.node).parent("a").length&&jQuery(this.node).removeClass("et2_clickable").unwrap();return!0},getDetachedAttributes:function(_attrs){_attrs.push("value","label","href")},getDetachedNodes:function(){return[this.node,this.progress]},setDetachedAttributes:function(_nodes,_values){this.node=_nodes[0],this.progress=_nodes[1],_values.label&&this.set_label(_values.label),_values.value?this.set_value(_values.value):_values.label&&this.set_value(_values.label),_values.href&&(jQuery(this.node).addClass("et2_clickable"),this.set_href(_values.href))}})}.call(this);et2_register_widget(et2_progress,["progress"]);var et2_portlet=function(){"use strict";return et2_valueWidget.extend({attributes:{title:{name:"Title",description:"Goes in the little bit at the top with the icons",type:"string",default:""},edit_template:{name:"Edit template",description:"Custom eTemplate used to customize / set up the portlet",type:"string",default:window.egw_webserverUrl+"/home/templates/default/edit.xet"},color:{name:"Color",description:"Set the portlet color",type:"string",default:""},settings:{name:"Customization settings",description:"Array of customization settings, similar in structure to preference settings",type:"any",default:et2_no_init},actions:{default:{}},width:{default:2,ignore:!0},height:{default:1,type:"integer"},rows:{ignore:!0,default:et2_no_init},cols:{ignore:!0,default:et2_no_init},resize_ratio:{ignore:!0,default:et2_no_init},row:{name:"Row",description:"Home page location (row) - handled by home app",default:1},col:{name:"Column",description:"Home page location(column) - handled by home app",default:1}},createNamespace:!0,GRID:55,default_actions:{edit_settings:{icon:"edit",caption:"Configure",default:!0,hideOnDisabled:!0,group:"portlet"},remove_portlet:{icon:"delete",caption:"Remove",group:"portlet"}},init:function(){this._super.apply(this,arguments);var self=this;this.div=$j(document.createElement("div")).addClass(this.options.class).addClass("ui-widget ui-widget-conten
|
||
|
},computeMod11:function(e){for(var d=0,f=2,c=e.length-1;c>=0;c--)d+=f*a.intval(e.charAt(c)),f=7==f?2:f+1;return e+((11-d%11)%11).toString()},getDigit:function(f,g){var e="0123456789",d=0,c="";for(f=this.compute(f,!1),c="110",i=0;i<f.length;i++){if(d=e.indexOf(f.charAt(i)),0>d)return"";c+=this.encoding[d]}return c+="1001"}},code11:{encoding:["101011","1101011","1001011","1100101","1011011","1101101","1001101","1010011","1101001","110101","101101"],getDigit:function(e){var j,m,p="0123456789-",q="",f="0";for(q="1011001"+f,j=0;j<e.length;j++){if(m=p.indexOf(e.charAt(j)),0>m)return"";q+=this.encoding[m]+f}var o=0,h=0,l=1,d=0;for(j=e.length-1;j>=0;j--)o=10==o?1:o+1,l=10==l?1:l+1,m=p.indexOf(e.charAt(j)),h+=o*m,d+=l*m;var n=h%11;d+=n;var g=d%11;return q+=this.encoding[n]+f,e.length>=10&&(q+=this.encoding[g]+f),q+="1011001"}},code39:{encoding:["101001101101","110100101011","101100101011","110110010101","101001101011","110100110101","101100110101","101001011011","110100101101","101100101101","110101001011","101101001011","110110100101","101011001011","110101100101","101101100101","101010011011","110101001101","101101001101","101011001101","110101010011","101101010011","110110101001","101011010011","110101101001","101101101001","101010110011","110101011001","101101011001","101011011001","110010101011","100110101011","110011010101","100101101011","110010110101","100110110101","100101011011","110010101101","100110101101","100100100101","100100101001","100101001001","101001001001","100101101101"],getDigit:function(h){var f,e,g="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*",d="",c="0";if(h.indexOf("*")>=0)return"";for(h=("*"+h+"*").toUpperCase(),f=0;f<h.length;f++){if(e=g.indexOf(h.charAt(f)),0>e)return"";f>0&&(d+=c),d+=this.encoding[e]}return d}},code93:{encoding:["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"],getDigit:function(e,j){var l,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%____*",o="";if(e.indexOf("*")>=0)return"";for(e=e.toUpperCase(),o+=this.encoding[47],i=0;i<e.length;i++){if(l=e.charAt(i),index=n.indexOf(l),"_"==l||index<0)return"";o+=this.encoding[index]}if(j){var m=0,g=0,h=1,d=0;for(i=e.length-1;i>=0;i--)m=20==m?1:m+1,h=15==h?1:h+1,index=n.indexOf(e.charAt(i)),g+=m*index,d+=h*index;var l=g%47;d+=l;var f=d%47;o+=this.encoding[l],o+=this.encoding[f]}return o+=this.encoding[47],o+="1"}},code128:{encoding:["11011001100","11001101100","11001100110","10010011000","10010001100","10001001100","10011001000","10011000100","10001100100","11001001000","11001000100","11000100100","10110011100","10011011100","10011001110","10111001100","10011101100","10011100110","11001110010","11001011100","11001001110","11011100100","11001110100","11101101110","11101001100","11100101100","11100100110","11101100100","11100110100","11100110010","11011011000","11011000110","11000110110","10100011000","10001011000","10001000110","10110001000","10001101000","10001100010","11010001000","11000101000","11000100010","10110111000","10110001110","10001101110","10111011000","10111000110","10001110110","11101110110","11010001110","11000101110","11011101000","11011100010","11011101110","11101011000","11101000110","11100010110","11101101000","11101100010","11100011010","11101111010","11001000010","11110001010","10100110000","10100001100","10010110000","10010000110","10000101100","10000100110","10110010000","10110000100","10011010000","10011000010","10000110100","10000110010","11000010010","11001010000","11110111010","11000010100","10001111010","10100111100","10010111100","10010011110","10111100100","10011110100","10011110010","11110100100"
|
||
|
_widget.resize(excess_height)},this,et2_IResizeable)},etemplate2.prototype.clear=function(){$j(this.DOMContainer).trigger("clear"),this.uniqueId&&$j(window).off("."+this.uniqueId),this.destroy_session&&(this.destroy_session(),this.unbind_unload()),null!=this.widgetContainer&&(this.widgetContainer.egw().unregisterJSONPlugin(etemplate2_handle_assign,this,"assign"),this.widgetContainer.free(),this.widgetContainer=null),$j(this.DOMContainer).empty();for(name in this.templates)if("undefined"!=typeof etemplate2._byTemplate[name])for(var i=0;i<etemplate2._byTemplate[name].length;i++)etemplate2._byTemplate[name][i]==this&&etemplate2._byTemplate[name].splice(i,1)},etemplate2.prototype._createArrayManagers=function(_data){"undefined"==typeof _data&&(_data={});for(var neededEntries=["content","sel_options","readonlys","modifications","validation_errors"],i=0;i<neededEntries.length;i++)"undefined"!=typeof _data[neededEntries[i]]&&_data[neededEntries[i]]||(egw.debug("log","Created not passed entry '"+neededEntries[i]+"' in data array."),_data[neededEntries[i]]={});var result={};for(var key in _data)switch(key){case"etemplate_exec_id":case"app_header":break;case"readonlys":result[key]=new et2_readonlysArrayMgr(_data[key]),result[key].perspectiveData.owner=this.widgetContainer;break;default:result[key]=new et2_arrayMgr(_data[key]),result[key].perspectiveData.owner=this.widgetContainer}return result},etemplate2.prototype.bind_unload=function(){this.etemplate_exec_id&&(this.destroy_session=jQuery.proxy(function(ev){var request=egw.json(this.app+".etemplate_new.ajax_destroy_session.etemplate",[this.etemplate_exec_id],null,null,!1);request.sendRequest()},this),window.onbeforeunload||(window.onbeforeunload=this.destroy_session))},etemplate2.prototype.unbind_unload=function(){window.onbeforeunload===this.destroy_session&&(window.onbeforeunload=null),delete this.destroy_session},etemplate2.prototype.download=function(_url){this.unbind_unload(),document.location=_url,window.setTimeout(jQuery.proxy(this.bind_unload,this),100)},etemplate2.prototype.load=function(_name,_url,_data,_callback,_app){var app=_app||window.app;this.name=_name,_url&&"/"!=_url[0]?(this.template_base_url=_url.match(/https?:\/\/[^/]+/).shift(),_url=_url.split(this.template_base_url)[1]):this.template_base_url="",this.template_base_url+=_url.split(_name.split(".").shift())[0],egw().debug("info","Loaded data",_data);var currentapp=this.app=_data.currentapp||egw().app_name(),msg=_data.content.msg;if("undefined"!=typeof msg&&(egw(window).message(msg),delete _data.content.msg),egw(currentapp,window).registerJSONPlugin(etemplate2_handle_assign,this,"assign"),egw.debug_level()>=3&&console.groupCollapsed&&egw.window.console.groupCollapsed("Loading %s into ",_name,"#"+this.DOMContainer.id),egw.debug_level()>=4){console.time&&console.time(_name),console.profile&&console.profile(_name);var start_time=(new Date).getTime()}$j.isArray(_data.langRequire)||(_data.langRequire=[]),egw(currentapp,window).langRequire(window,_data.langRequire,function(){var split=_name.split("."),appname=split[0],app_callback=null;"object"!=typeof app[appname]&&"function"==typeof app.classes[appname]?app[appname]=new app.classes[appname]:"function"==typeof app[appname]?function(){new app[appname]}.call():"object"!=typeof app[appname]&&egw.debug("warn","Did not load '%s' JS object",appname),"object"!=typeof app[this.app]&&"function"==typeof app.classes[this.app]&&(app[this.app]=new app.classes[this.app]),"object"==typeof app[appname]&&(app_callback=function(_et2,_name){app[appname].et2_ready(_et2,_name)});var frag=document.createDocumentFragment();this.clear(),this.widgetContainer=new et2_container(null),this.widgetContainer.setApiInstance(egw(currentapp,egw.elemWindow(this.DOMContainer))),this.widgetContainer.setInstanceManager(this),this.widgetContainer.setParentDOMNode(this.DOMContainer),_data&&(this.etemplate_exec_id=_data.etemplate_exec_id,"string"==typeof _data.app_header&&window.egw_app_header(_data.app_header),this.bind_unload());var _load=function(){egw.debug("log","Loading template..."),egw.debug_leve
|
||
|
//# sourceMappingURL=etemplate2.min.js.map
|