[IMP] overlay.js orverlay.js, skin : change Icon + remove email in searchbox + openurl with menu in webclient + move menu

bzr revid: tfr@openerp.com-20101207161502-yo2b9i902uzml72l
This commit is contained in:
Thibault Francois 2010-12-07 17:15:02 +01:00
parent fd7173ceb6
commit f5342d897f
30 changed files with 1883 additions and 1794 deletions

View File

@ -3,14 +3,14 @@
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/create.dtd">
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="&title.label;" onload="myPrefObserver.createContact();" height="460" width="860">
title="&title.label;" onload="myPrefObserver.createContact();" height="415" width="720">
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/static.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
<tabpanel id="contact">
<groupbox id="contact" style="border:1px solid black">
<groupbox id="contact" >
<separator class="groove-thin" orient="horizontal" width="94"/>
<hbox>
<label align="right" id="partner" value="&selectpartner.value;" width="97" />
@ -18,41 +18,42 @@
<button label="&bsearch.label;" oncommand="Select.onMenuItemCommand(event);" image="&imagesearch.value;"/>
<button label="Create Partner" image="&imagecreate.value;" oncommand="CreatePartner.onMenuItemCommand(event);"/>
</hbox>
<hbox>
<label align="right" id="name" value="&name.value;" width="80" />
<textbox id="txtname" align="right" width="270"/>
</hbox>
<separator class="groove-thin" orient="horizontal" width="94"/>
<separator class="groove-thin" orient="horizontal" width="80"/>
</groupbox>
</tabpanel>
<separator class="groove-thin" orient="horizontal" width="94"/>
<tabpanel id="address">
<groupbox id="address" style="border:1px solid black">
<hbox>
<caption label="&postaladdress.value;" />
</hbox>
<separator class="groove-thin" orient="horizontal" width="94"/>
<hbox>
<label align="right" id="name" value="&name.value;" width="97" />
<textbox id="txtname" align="right" />
</hbox>
<hbox>
<label align="right" id="street" value="&street.value;" width="97" />
<textbox id="txtstreet" width="270" align="right"/>
<textbox id="txtstreet" align="right"/>
<spacer width="33"/>
</hbox>
<hbox>
<label align="right" id="street2" value="&street2.value;" width="97" />
<textbox id="txtstreet2" width="270" align="right"/>
<spacer width="35"/>
<textbox id="txtstreet2" align="right"/>
<spacer width="33"/>
</hbox>
<hbox>
<label align="right" id="zip" value="&zip.value;" width="97" />
<textbox id="txtzip" align="right" />
<spacer width="114"/>
<spacer width="33"/>
</hbox>
<hbox>
<label align="right" id="city" value="&city.value;" width="97"/>
<textbox id="txtcity" align="right" />
<spacer width="112"/>
<spacer width="33"/>
</hbox>
<hbox>
@ -72,9 +73,10 @@
</menupopup>
</menulist>
</hbox>
<separator class="groove-thin" orient="horizontal" width="94"/>
</groupbox>
<groupbox id="communication" style="border:1px solid black">
<separator class="groove-thin" orient="horizontal" width="60"/>
</groupbox>
<groupbox id="communication" style="border:1px solid black">
<vbox>
<caption label="&communication.value;" />
</vbox>
@ -93,11 +95,12 @@
</hbox>
<hbox>
<label align="right" id="emailid" value="&email.value;" width="97" />
<textbox id="txtemail" width="280" align="right"/>
<textbox id="txtemail" align="right"/>
<spacer width="30"/>
</hbox>
</groupbox>
</tabpanel>
<description></description>
</tabpanel>
<description></description>
<hbox align="right">
<button label="&cancel.label;" image="&imagecancel.value;" oncommand="close();" />
<button label="&ok.label;" image="&imageok.value;" oncommand="createContact();"/>

View File

@ -183,7 +183,7 @@ var openPartnerHandler = {
// var sendername = getSenderEmail();
var arrIdList = result.QueryInterface(Components.interfaces.nsISupportsArray);
var count = arrIdList.Count();
for (i = 0; i < count; i++) {
for (var i = 0; i < count; i++) {
var strlResult = arrIdList.QueryElementAt(i, Components.interfaces.nsISupportsArray);
var strlSearchResult = strlResult.QueryElementAt(0, Components.interfaces.nsISupportsCString);
var strlSearchResultValue = strlResult.QueryElementAt(1, Components.interfaces.nsISupportsCString);
@ -197,9 +197,12 @@ var openPartnerHandler = {
weburl = getWebServerURL();
if (parseInt(partner_id) > 0){
var t = weburl + "/openerp/form/view?model=res.partner&id="+partner_id;
window.open(t, "", "chrome","resizable=yes,scrollbars=yes,status=yes");
//Encode the url and form an url to have menu in webclient
var encoded = encodeURIComponent("/openerp/form/view?model=res.partner&id="+partner_id)
var t = weburl + "?next=" + encoded
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.launchExternalURL(t);
}
else{
alert("Partner is not Available.");
@ -239,6 +242,8 @@ function searchPartner(email)
strname.data = email;
xmlRpcClient.asyncCall(openPartnerHandler,null,'execute',[ strDbName,struid,strpass,strobj,strmethod,strname ],6);
}
function open_partner()
{
if (check() == false){
@ -269,6 +274,7 @@ function open_partner()
//gives the selected email uri
var messageUri= gDBView.URIForFirstSelectedMessage;
var messenger = Components.classes['@mozilla.org/messenger;1'].createInstance(Components.interfaces.nsIMessenger);
//gives the selected email object
@ -308,8 +314,12 @@ var listDocumentHandler = {
}
else
{
var t = weburl + "/openerp/form/view?model=" + model +"&id=" + res_id;
window.open(t, "", "chrome","resizable=yes,scrollbars=yes,status=yes,");
var encoded = encodeURIComponent("/openerp/form/view?model=" + model +"&id=" + res_id)
var t = weburl + "?next=" + encoded
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.launchExternalURL(t);
}
},
@ -322,7 +332,33 @@ var listDocumentHandler = {
}
}
//function to archive the mail content through xmlrpc request
function parse_eml(){
var fpath =""
if(navigator.userAgent.indexOf('Linux')!= -1){
fpath ="/tmp/"
}
else if(navigator.userAgent.indexOf('Win')!= -1){
fpath ="C:\\"
}
else if(navigator.userAgent.indexOf('Mac OS X')!= -1){
fpath ="/tmp/"
}
name = fpath + getPref().getCharPref('fname') +".eml"
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath( name );
if ( file.exists() == false ) {
return null;
} else {
var is = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance( Components.interfaces.nsIFileInputStream );
is.init( file,0x01, 00004, null);
var sis = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance( Components.interfaces.nsIScriptableInputStream );
sis.init( is );
var output = sis.read( sis.available() );
return output
}
}
function open_document()
{
if (check() == false){
@ -333,9 +369,7 @@ function open_document()
version_obj.QueryInterface(Components.interfaces.nsIPrefBranch2);
version = version_obj.getCharPref("lastAppVersion");
version = parseInt(version[0])
file = getPredefinedFolder(2);
if (version > 2)
{
var emlsArray = gFolderDisplay.selectedMessages;
@ -344,20 +378,25 @@ function open_document()
{
var emlsArray = GetSelectedMessages();
}
IETtotal = emlsArray.length;
IETexported = 0;
var msguri = emlsArray[0];
//gives the selected email uri
var messageUri= gDBView.URIForFirstSelectedMessage;
var messenger = Components.classes['@mozilla.org/messenger;1'].createInstance(Components.interfaces.nsIMessenger);
//gives the selected email object
var message = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri);
if (version > 2)
{
m_uri = message.folder.getUriForMsg(message);
saveMsgAsEML(m_uri,file,false,emlsArray,null);
}
else
{
saveMsgAsEML(msguri,file,false,emlsArray,null);
}
//gives the received email date
var stdate = new Date(message.date / 1000);
var branchobj = getPref();
setServerService('xmlrpc/object');
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
@ -372,8 +411,9 @@ function open_document()
strmethod.data = 'search_message';
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
strobj.data = 'thunderbird.partner';
var a = ['message_id'];
var b = ['<'+message.messageId+'>'];
var eml_string = parse_eml()
var a = ['message'];
var b = [eml_string];
var arrofarr = dictcontact(a,b);
xmlRpcClient.asyncCall(listDocumentHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
}

View File

@ -8,21 +8,56 @@
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/exportTools.js"></script>
<menupopup id="taskPopup">
<menuitem id="tiny-plugin2" label="&tinyplugin;"
<menubar id="mail-menubar" >
<menu insertafter="messageMenu" id="menu_openerp" label="&openerpMenu.label;" accesskey="&openerpMenu.accesskey;">
<menupopup id="taskPopup">
<menuitem id="tiny-plugin3" label="&tinyplugin;"
oncommand="Config.onMenuItemCommand(event);"
image="&menuicon.value;"
image="&menuicon.settings;"
class="menuitem-iconic"
tooltiptext="&pluginconfig.value;"/>
</menupopup>
<menupopup id="taskPopup">
<menuitem id="tiny-plugin1" label="&tinypluginconfig;"
tooltiptext="&pluginconfig.value;"
/>
<menuseparator/>
<menuitem id="tiny-plugin4" label="&tinypluginconfig;"
oncommand="searchmail();"
image="&menuicon.value;"
class="menuitem-iconic"
tooltiptext="&pluginconfigvalue.value;"/>
</menupopup>
tooltiptext="&pluginconfigvalue.value;"
/>
<menuseparator/>
<menuitem id="tiny-openpartner" label="&openpartner.value;"
oncommand="open_partner();"
image="&menuicon.value;"
class="menuitem-iconic"
tooltiptext="&openpartnertooltip.value;"
/>
<menuitem id="tiny-opendocument" label="&opendocument.value;"
oncommand="open_document();"
image="&menuicon.value;"
class="menuitem-iconic"
tooltiptext="&opendocumenttooltip.value;"
/>
</menupopup>
</menu>
</menubar>
<!--<menupopup id="taskPopup">-->
<!-- <menuitem id="tiny-plugin2" label="&tinyplugin;"-->
<!-- oncommand="Config.onMenuItemCommand(event);"-->
<!-- image="&menuicon.value;"-->
<!-- class="menuitem-iconic"-->
<!-- tooltiptext="&pluginconfig.value;"/>-->
<!--</menupopup>-->
<!--<menupopup id="taskPopup">-->
<!-- <menuitem id="tiny-plugin1" label="&tinypluginconfig;"-->
<!-- oncommand="searchmail();"-->
<!-- image="&menuicon.value;"-->
<!-- class="menuitem-iconic"-->
<!-- tooltiptext="&pluginconfigvalue.value;"/>-->
<!--</menupopup>-->
<popup id="threadPaneContext">
<menuitem id="threadPaneContext-saveAsMultiple"
@ -38,7 +73,7 @@
<toolbarbutton id="GA-button"
class="toolbarbutton-1"
image="&menuicon.value;"
label= "Push To OpenERP"
label= "Push"
oncommand="searchmail();" />
</toolbarpalette>
@ -46,7 +81,7 @@
<toolbarbutton id="GA-button2"
class="toolbarbutton-1"
image="&partnericon.value;"
label= "Open Partner"
label= "Partner"
oncommand="open_partner();"
/>
</toolbarpalette>
@ -54,7 +89,7 @@
<toolbarbutton id="GA-button3"
class="toolbarbutton-1"
image="&imagearchive.value;"
label= "Open Document"
label= "Document"
oncommand="open_document();" />
</toolbarpalette>

View File

@ -3,7 +3,7 @@
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/plugin.dtd">
<window id="pluginwindows" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="&title.label;" onload="myPrefObserver.loaddata()" height="650" width="1000">
title="&title.label;" onload="myPrefObserver.loaddata()" height="560" width="960">
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
@ -12,11 +12,9 @@
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/exportTools.js"></script>
<description></description>
<hbox id="root" height="10" width="800" style="padding:12px;border:1px solid black">
<caption label="&title.label;" />
<hbox id="root" height="10" width="800" >
</hbox>
<hbox id="root1" height="380" width="800" style="padding:12px;border:1px solid black">
<hbox id="root1" height="380" width="800" >
<vbox>
<caption label="&gptinyobj.label;" />
<groupbox id="existsobjectgroup" width="400" style="border:1px solid black">
@ -42,6 +40,7 @@
<listbox height="250" width="100%" id="listSearchBox" style="border:1px solid red" seltype="multiple">
<listhead>
<listheader label="&listSearchBox.header;"/>
<!-- <listheader label="&listSearchBox.header2;"/>-->
</listhead>
<listcols>
<listcol flex="1"/>
@ -59,8 +58,7 @@
<vbox>
<caption label="&newobject.label;" />
<groupbox id="newobjectgroup" width="400" align="left" style="border:1px solid black;">
<separator class="groove-thin" orient="horizontal" width="400"/>
<separator class="groove-thin" orient="horizontal" width="400" height="30"/>
<hbox align="left">
<vbox>
<label id="lblex3" align="right" width="135" control="section" value="&object.label;"/>
@ -76,9 +74,11 @@
<button width="50" label="&archive.label;" accesskey="c" image="&imagearchive.value;" oncommand="attachmentWidnowOpen('create');"/>
</vbox>
</hbox>
<separator class="groove-thin" orient="horizontal" width="180"/>
<separator class="groove-thin" orient="horizontal" width="180" height="100"/>
</groupbox>
<caption label="&newcontact.label;" />
<groupbox id="newcontactgroup" width="400" align="left" style="border:1px solid black;">
<separator class="groove-thin" orient="horizontal" width="400" height="30"/>
<hbox align="left">
<vbox>
<label align="right" width="135" id="lblsection" control="section" value="&partner.label;"/>
@ -87,13 +87,12 @@
<button label="&create.label;" image="&imagecreate.value;" oncommand="Create.onMenuItemCommand(event);"/>
</vbox>
</hbox>
<separator class="groove-thin" orient="horizontal" width="480"/>
<separator class="groove-thin" orient="horizontal" width="180" height="215"/>
</groupbox>
</vbox>
</hbox>
<hbox height="60" align="right" width="800">
</vbox>
</hbox>
<hbox height="60" align="right" width="800">
<button label="&close.label;" accesskey="l" image="&imagecancel.value;" oncommand="win_close();"/>
</hbox>
</window>

View File

@ -1841,7 +1841,10 @@ function testConnection(){
function testConnection_web(){
var branchobj = getPref();
weburl = getWebServerURL();
window.open(weburl, "", "chrome","resizable=yes,scrollbars=yes,status=yes");
// window.open(weburl, "", "chrome","resizable=yes,scrollbars=yes,status=yes");
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.launchExternalURL(weburl);
}
@ -2026,7 +2029,7 @@ var listsearchAttachmentHandler = {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
var objectlist = result.QueryInterface(Components.interfaces.nsISupportsCString);
getPref().setCharPref('tempobject',objectlist)
document.getElementById("txtvalueobj").value= getSenderEmail();
//document.getElementById("txtvalueobj").value= getSenderEmail();
var checkbox = document.getElementById("checkbox-dynamic");
var object = preferenceBranch.getCharPref("listobject").split(',');

View File

@ -1,11 +1,18 @@
<!ENTITY tinyplugin "OpenERP Configuration">
<!ENTITY tinypluginconfig "Push To OpenERP">
<!ENTITY tinyplugin "Configuration">
<!ENTITY tinypluginconfig "Push">
<!ENTITY tinyarchive "Push to OpenERP">
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
<!ENTITY menuicon.settings "chrome://openerp_plugin/skin/settings.png">
<!ENTITY menuicon.value "chrome://openerp_plugin/skin/openerp-icon.png">
<!ENTITY partnericon.value "chrome://openerp_plugin/skin/partner_icon.png">
<!ENTITY imagearchive.value "chrome://openerp_plugin/skin/document-new.png">
<!ENTITY tooltip.value "Add To Archive">
<!ENTITY pluginconfig.value "OpenERP Configuration Settings">
<!ENTITY pluginconfigvalue.value "Archieve To OpenERP Settings">
<!ENTITY openerpMenu.label "OpenERP">
<!ENTITY openerpMenu.accesskey "OE">
<!ENTITY openpartner.value "Partner">
<!ENTITY openpartnertooltip.value "Click to Open Partner Realted to Sender Eamil address.">
<!ENTITY opendocument.value "Document">
<!ENTITY opendocumenttooltip.value "Click to See the Mail if it is archived to OpenERP.">

View File

@ -1,6 +1,6 @@
<!ENTITY title.label "Push To OpenERP">
<!ENTITY gptinyobj.label "Link to an Existing Document">
<!ENTITY newobject.label "New Documents">
<!ENTITY newobject.label "Create a New Documents">
<!ENTITY document.label "Documents">
<!ENTITY bsearch.label "Search">
<!ENTITY close.label "Close">
@ -27,3 +27,5 @@
<!ENTITY imagearchive.value "chrome://openerp_plugin/skin/Archive.png">
<!ENTITY imagecreate.value "chrome://openerp_plugin/skin/Create.png">
<!ENTITY gptinyobjexe.label "Documents">
<!ENTITY newcontact.label "Create a New Contact">
<!ENTITY listSearchBox.header2 "Document Type">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 857 B

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 B

After

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 B

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 B

After

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -24,7 +24,7 @@ pref("extensions.tiny.partnername","");
pref("extensions.tiny.officeno","");
pref("extensions.tiny.phoneno","");
pref("extensions.tiny.address","");
pref("extensions.tiny.listobject","Partner,Accout Invoice,Product,Sale Order,Lead and opportunities");
pref("extensions.tiny.listobject","Partner,Account Invoice,Product,Sale Order,Lead and opportunities");
pref("extensions.tiny.object","res.partner,account.invoice,product.product,sale.order,crm.lead");
pref("extensions.tiny.imagename","chrome://openerp_plugin/skin/Partner.png,chrome://openerp_plugin/skin/Invoice.png,chrome://openerp_plugin/skin/Product.png,chrome://openerp_plugin/skin/Sale.png,chrome://openerp_plugin/skin/Case.png");
pref("extensions.tiny.attachmentlength","");