Work Item HTMLFieldControl Content - html

I am trying to pre-populate some a few different objects in a User Story in my TFS2012 work items list. The HTMLFieldControl is can be found in the Work Item Types section and I can see that it's created here:
<Tab Label="Details">
<Control FieldName="System.Description" Type="HtmlFieldControl" Dock="Fill" />
</Tab>
I've been looking on Google but I just can't seem to find anything around adding text into this field so that it is always available, perhaps I'm just doing something wrong.
Would doing something similar to this give me the results I require? I can't really just try it and potentially break the system (which is unfortunate) so I need some guidance so that I could quickly fix any formatting / spelling without having to roll back any changes.
<Tab Label="Details">
<Control FieldName="System.Description" Type="HtmlFieldControl" Dock="Fill" >
<FIELD name="Description" refname="System.Description" type="Text" Content="Hello there"/>
</Control>
</Tab>
Obviously the above is purely made up (from the FIELD section) but I included here just along the lines of what I was thinking and hopefully to show what I'm trying to do.

You were looking in the wrong place; those are the definitions for the form (aka, how the Work Item is displayed graphically). You need to scroll up to the top, under FIELDS, and find this:
<FIELD name="Description" refname="System.Description" type="HTML" />
...then change it to this:
<FIELD name="Description" refname="System.Description" type="HTML">
<DEFAULT from="value" value="Hello there" />
</FIELD>

Related

odoo (V11) add a new search button to control panel view

I want to add a new search button to the odoo control panel view. I am using odoo V11 and the screenshot of the view is pasted here so you can understand what I am talking about. I want to add this button next to the search box indicated as a black circle in the image. The new search box will provide Spatial data search function. That is why I want to create a new search button instead of using the existing search options.
Thanks
odoo control panel view
I would not complicate myself adding that button, just use the existing search box to enter the data to search and add a new option "Spatial data" to the menu shown when you enter text. That is added with xml, similar to this example taken from the bank views:
<field name="arch" type="xml">
<search string="Bank Accounts">
<field name="bank_name" filter_domain="['|', ('bank_name','ilike',self), ('acc_number','ilike',self)]" string="Bank Name"/>
<field name="company_id" invisible="context.get('company_hide', True)"/>
<field name="partner_id"/>
</search>
</field>
You may also need to do some coding in the .py files if it is not enough with just the domain filter, in that case override the name_search method of the model. You have many examples of that in the Odoo code itself.

get dataTable filter by widgetVar which is a composite attribute to clear filter

My p:dataTables are all generated in a composite attribute. Because there is more than one table on a site sometimes I need to link the widgetVar to a variable. I used a composite attribute for that.
Everything works fine but I can't find a way to access the datatables by their widgetVar to clear the filters, my code:
<composite:interface>
<composite:attribute name="CC_tableName" type="java.lang.String" />
</composite:interface>
<p:commandButton value="clear"
onclick="PF(#{cc.attrs.CC_tableName}).clearFilters()" />
<composite:implementation>
<p:dataTable
widgetVar="#{cc.attrs.CC_tableName}"
>
</p:dataTable>
</composite:implementation>
My problem is this part: PF(#{cc.attrs.CC_tableName})
The widgetVar of the table is set correctly, I can access it when I enter the tableName directly in the onclick attribute of the button, but then only 1 table on each site works correctly...so how can I get the dataTable by using the composite attribute?
Found the solution, it was pretty simple. You need to add the '' altough it's a variable, so this one works:
PF('#{cc.attrs.CC_tableName}')

MSDeploy SetParameters.xml create empty value

So my question is relatively simple.
In my Parameters.xml file I have the following line:
<parameter name="SEND_TO_FRIEND_BCC" description="Email address of developer" defaultValue="" tags="">
<parameterEntry kind="XmlFile" scope"\\web.config$" match="/configuration/appsettings/add[#key='SEND_TO_FRIEND_BCC']/#value" />
</parameter>
When publish this is creating a file that ends up like this:
<setParameter value="" name="SEND_TO_FRIEND_BCC" />
When going live, this should replace the current web.config value for SEND_TO_FRIEND_BCC to an empty string. Instead, when I try an publish I get the following:
Error: The 'SEND_TO_FRIEND_BCC" argument cannot be null or empty.
Error count: 1.
at InRelease.MSDeploy.Program.Main(String[] args)
Have to tell MSDeploy that it is okay for the value to be empty ...
<parameter name="SEND_TO_FRIEND_BCC" description="Email address of developer" defaultValue="" tags="">
<parameterValidation kind="AllowEmpty" />
<parameterEntry kind="XmlFile" scope"\\web.config$" match="/configuration/appsettings/add[#key='SEND_TO_FRIEND_BCC']/#value" />
</parameter>
So, by pure chance I tried entering a single empty space and it worked.
If there is a better way I am still eager to learn more...

How can I redesign Magento toplinks?

I have browsed through many articles, but none of them mention how I can go about redesigning the toplinks at the top of any Magento store.
Does anyone know how I can modify the default links which are found in the top right of my Magento store and assign an icon to each link and also spread the links across the full width of the top area.
It may include something like the below (example only).
Any suggestions would be much appreciated.
My website is: www.efficienttrade.co.nz if that helps.
Thanks,
Jason
Find the top.links in layout xml files and add a class. Then, you can customize this class via css.
For instance,
<!-- this piece of code available in rss.xml, look at the class define -->
<reference name="footer_links">
<action method="addLink" translate="label title" module="rss" ifconfig="rss/config/active"><label>RSS</label><url>rss</url><title>RSS</title><prepare>true</prepare><urlParams/><position/><li/><a>class="link-rss"</a></action>
</reference>
Same as Ogüz answer + more information:
You have to be a little bit like Sherlock Holmes.
The top links are generated thanks to a block that you can find in the layout file page.xml of your theme. Then search the block name "topLinks" in the header block (in the default theme, it's the name) and you will find <block type="page/template_links" name="top.links" as="topLinks"/>. This block topLinks is generated thanks to the block class Mage_Page_Block_Template_Links. The important method in this block is public function addLink(...), it means that you will have to search into the xml layout the following element/tag <action method='addLink'>...</action>.
An example for the customer module, in the file customer.xml of the layout folder:
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
</reference>
You should find more than one xml element which uses this kind of method.
Pay attention, the addLink method can also be called programmatically (into PHP code), not only in layout file.
Hope it helps

"text-overflow: ellipsis;" in XUL applications

I'm writing an extension to an existing XUL-application, conkeror. In that, In
some part of the user-interface of I'm writing, I'm creating HTML elements with
a fixed-width, <span>s in this case, to display various results.
Within those spans there's text some text, which, on occasion, is too long to
fit its fixed-with container. I'd like to cut-off the parts that are too long,
and end it with an ellipsis instead.
Those spans currently have the following CSS attributes:
display: inline-block;
width: 30%;
overflow: hidden;
white-space: nowrap;
In addition to that, I'd like to use text-overflow: ellipsis;, but it turns
out the Gecko platform doesn't implement that yet. However, for plain HTML pages
with regular style-sheets, there happens to be a workaround for Firefox and
other Gecko-based products, that makes cutting off overlong text and putting an
ellipsis at its end work anyway.
The details of that technique are described
here. It's
using Gecko's ability to run XUL code to do its magic.
So I've tried to use that in my XUL application as well. I've changed my
style-sheet to include the described
-moz-binding: url('ellipsis.xml#ellipsis');, and also created the
elipsis.xml file as described.
However, doing this (or similar things using different URLs, e.g. chrome:// or
absolute file:// URLs) seems to have no effect whatsoever within my
application. In fact, it doesn't even try to access the ellipsis.xml file at
all, according to strace.
Obviously XUL is able to do what I want, so I'm assuming I'm doing something
wrong, or am simply missing out on some detail I have to take care of first in
order to get the desired results.
What I'm looking for is a way to pull the regular text-overflow: ellipsis;
track within a XUL application or, alternatively, a way to get the same result
without the aforementioned technique.
For some (maybe security) reason you need to use a chrome:// url in your CSS file. I tested it with conkeror 0.9.2 and xulrunner 1.9.1.
-moz-binding: url("chrome://conkeror/content/ellipsis.xml#ellipsis");
Where your ellipsis.xml is in /conkeror/install/path/modules/ (on debian /usr/share/conkeror/modules). You can check the chrome.manifest file to find the right location for your XML file, probably the style folder.
You said it´s not having ANY effect?
With
display:block; text-overflow:clip; overflow:hidden; white-space:nowrap;
it should at least cut off the text without the "...".
Is the reference to your xml file correct and your css and xml files are at the same path?
Also, try using this code:
<?xml version="1.0"?>
<bindings
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<binding id="none">
<content><children/></content>
</binding>
<binding id="ellipsis">
<content>
<xul:label crop="end"><children/></xul:label>
</content>
<implementation>
<field name="label"> document.getAnonymousNodes( this )[ 0 ] </field>
<field name="style"> this.label.style </field>
<property name="display">
<getter>
this.style.display
</getter>
<setter>
if( this.style.display != val ) this.style.display= val
</setter>
</property>
<property name="value">
<getter>
this.label.value
</getter>
<setter>
if( this.label.value != val ) this.label.value= val
</setter>
</property>
<method name="update">
<body>
var strings= this.textContent.split( /\s+/g )
if( !strings[ 0 ] ) strings.shift()
if( !strings[ strings.length - 1 ] ) strings.pop()
this.value= strings.join( ' ' )
this.display= strings.length ? '' : 'none'
</body>
</method>
<constructor> this.update() </constructor>
</implementation>
<handlers>
<handler event="DOMSubtreeModified"> this.update() </handler>
</handlers>
</binding>
</bindings>