Agenda Dodavatelé - adresář

This commit is contained in:
2014-05-11 21:18:46 +02:00
parent 5a9b8fd679
commit 3f411eadd2
35 changed files with 1417 additions and 0 deletions
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<language-addon>
<!-- The name of this addon. It must be unique -->
<addon-name>ckezbind</addon-name>
<!-- Specifies what other addon this depends
<depends></depends>
-->
<!-- Which language this addon will be added to -->
<language-name>xul/html</language-name>
<component>
<component-name>ckeditor</component-name>
<extends>ckeditor</extends>
<annotation>
<annotation-name>ZKBIND</annotation-name>
<property-name>value</property-name>
<attribute>
<attribute-name>ACCESS</attribute-name>
<attribute-value>both</attribute-value>
</attribute>
<attribute>
<attribute-name>SAVE_EVENT</attribute-name>
<attribute-value>onChange</attribute-value>
</attribute>
<attribute>
<attribute-name>LOAD_REPLACEMENT</attribute-name>
<attribute-value>value</attribute-value>
</attribute>
<attribute>
<attribute-name>LOAD_TYPE</attribute-name>
<attribute-value>java.lang.String</attribute-value>
</attribute>
</annotation>
</component>
</language-addon>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<language-addon>
<addon-name>mapa</addon-name>
<language-name>xul/html</language-name>
<component>
<component-name>mapa</component-name>
<component-class>info.bukova.isspst.ui.Mapa</component-class>
<widget-class>info.bukova.isspst.ui.Mapa</widget-class>
</component>
</language-addon>
@@ -88,7 +88,13 @@
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="addressDao" class="info.bukova.isspst.dao.jpa.AddressDaoJPA">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- Business logic -->
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
<bean id="userService" class="info.bukova.isspst.services.users.UserServiceImpl">
<property name="dao" ref="userDao"/>
<property name="encoder" ref="passwordEncoder"/>
@@ -97,5 +103,31 @@
<bean id="roleService" class="info.bukova.isspst.services.users.RoleServiceImpl">
<property name="dao" ref="roleDao"/>
</bean>
<bean id="adbService" class="info.bukova.isspst.services.addressbook.AdbServiceImpl">
<property name="dao" ref="addressDao"/>
<property name="validator" ref="validator"/>
</bean>
<bean id="addressFinderAres" class="info.bukova.isspst.services.addressbook.AddressFinderAres">
<property name="aresUrl" value="http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_std.cgi"/>
<property name="unmarsheller" ref="unmarshallerAres"/>
</bean>
<bean id="addressFinderTaxID" class="info.bukova.isspst.services.addressbook.AddressFinderTaxID">
<property name="aresDicUrl" value="http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_bas.cgi"/>
</bean>
<bean id="xmlCtxAres" class="org.castor.spring.xml.XMLContextFactoryBean">
<property name="mappingLocations">
<list>
<value>info/bukova/isspst/services/addressbook/mappingAres.xml</value>
</list>
</property>
</bean>
<bean id="unmarshallerAres" class="org.castor.spring.xml.CastorUnmarshallerFactoryBean">
<property name="xmlContext" ref="xmlCtxAres"/>
</bean>
</beans>
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<zk>
<!-- [Optional]
Uncomment if you want to defines the application's name
<preference>
<name>org.zkoss.zk.ui.WebApp.name</name>
<value>rsfaktura</value>
</preference>
-->
<client-config>
<debug-js>true</debug-js>
</client-config>
<library-property>
<name>org.zkoss.web.classWebResource.cache</name>
<value>false</value>
</library-property>
<language-config>
<addon-uri>/WEB-INF/mapa-lang-addon.xml</addon-uri>
<addon-uri>/WEB-INF/ckez-bind-lang-addon.xml</addon-uri>
</language-config>
<!-- <library-property>
<name>org.zkoss.zul.progressbox.position</name>
<value>center</value>
</library-property> -->
</zk>
@@ -0,0 +1,30 @@
<?page title="${labels.FindResult}" contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk>
<window id="findResult" title="Výsledek hledání" border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.addressbook.AddressFindResult')"
closable="true" width="700px">
<style src="/app/form.css"/>
<listbox model="@load(vm.listResult)" height="300px" selectedItem="@bind(vm.selectedAddr)">
<listhead>
<listheader label="Firma" sort="auto(company)"/>
<listheader label="IČ"/>
<listheader label="Ulice"/>
<listheader label="Číslo domu" width="80px"/>
<listheader label="Město"/>
</listhead>
<template name="model">
<listitem>
<listcell label="@load(each.company)"/>
<listcell label="@load(each.ic)"/>
<listcell label="@load(each.street)"/>
<listcell label="@load(each.houseNumber)"/>
<listcell label="@load(each.city)"/>
</listitem>
</template>
</listbox>
<button label="Zvolit" onClick="@global-command('selectAddress', selected=vm.selectedAddr, window=findResult)" disabled="@bind(vm.selected)" sclass="nicebutton"/> <button label="Zavřít" onClick="findResult.detach()" sclass="nicebutton"/>
</window>
</zk>
@@ -0,0 +1,78 @@
<?page title="Adresa" contentType="text/html;charset=UTF-8"?>
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window id="editWin" title="Adresa" border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.addressbook.AddressForm')"
closable="true" width="600px">
<style src="/app/form.css"/>
<grid width="580px">
<columns>
<column label="" hflex="min"/>
<column label="" hflex="min"/>
<column label=""/>
<column label=""/>
</columns>
<rows>
<row>
<label value="Firma" /> <textbox value="@bind(vm.dataBean.company)" instant="true"/>
<label visible="true" value="@load(vm.errMessages['company'])" style="color:red"/>
<button image="/img/search.png" label="Hledat v ARESu" onClick="@command('searchAres')" sclass="nicebutton" disabled="@load((vm.dataBean.ic == 0) &amp;&amp; (empty vm.dataBean.company))" />
</row>
<row>
<label value="IČ" /> <textbox value="@bind(vm.dataBean.ic)"/>
</row>
<row>
<label value="DIČ" /> <textbox value="@bind(vm.dataBean.dic)"/>
</row>
<row>
<label value="Oddělení" /> <textbox value="@bind(vm.dataBean.department)"/>
</row>
<row>
<label value="Kontaktní osoba" /> <textbox value="@bind(vm.dataBean.contactName)"/>
</row>
<row>
<label value="Ulice" /> <textbox value="@bind(vm.dataBean.street)"/>
</row>
<row>
<label value="Číslo domu" /> <textbox value="@bind(vm.dataBean.houseNumber)"/>
</row>
<row>
<label value="Město" /> <textbox value="@bind(vm.dataBean.city)"/>
<label visible="true" value="@load(vm.errMessages['city'])" style="color:red"/>
</row>
<row>
<label value="PSČ" /> <textbox value="@bind(vm.dataBean.zipCode)"/>
</row>
<row>
<label value="Telefon" /> <textbox value="@bind(vm.dataBean.phone)"/>
</row>
<row>
<label value="E-mail" /> <textbox value="@bind(vm.dataBean.email)"/>
<label visible="true" value="@load(vm.errMessages['email'])" style="color:red"/>
</row>
<row>
<label value="Web" /> <textbox value="@bind(vm.dataBean.web)"/>
<label visible="true" value="@load(vm.errMessages['web'])" style="color:red"/>
</row>
</rows>
</grid>
<hlayout>
<panel>
<panelchildren>
<vlayout>
<panel>
<panelchildren><label value="Poznámka"/> </panelchildren>
</panel>
<panel>
<panelchildren><ckeditor height="65px" width="330px" toolbar="Basic" value="@bind(vm.dataBean.description)"/>
</panelchildren>
</panel>
</vlayout>
</panelchildren>
</panel>
</hlayout>
<include src="/app/formButtons.zul"/>
</window>
</zk>
@@ -0,0 +1,89 @@
<?page title="Dodavatelé" contentType="text/html;charset=UTF-8"?>
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window title="Dodavatelé" border="normal"
apply="org.zkoss.bind.BindComposer" height="570px"
viewModel="@id('vm') @init('info.bukova.isspst.ui.addressbook.AddressList')">
<include src="/app/toolbar.zul"/>
<style src="/app/form.css"/>
<hbox width="100%">
<listbox id="dataGrid" model="@load(vm.dataList)" selectedItem="@bind(vm.dataBean)"
onAfterRender="@command('afterRender')" selectedIndex="@load(vm.selIndex)" hflex="6" height="480px">
<auxhead sclass="category-center" visible="@load(vm.filter)">
<auxheader>
<image src="/img/funnel.png" />
<textbox instant="true" width="85%"
value="@bind(vm.filterTemplate.company)" onChange="@command('doFilter')" />
</auxheader>
<auxheader>
<image src="/img/funnel.png" />
<textbox instant="true" width="85%"
value="@bind(vm.filterTemplate.ic)" onChange="@command('doFilter')" />
</auxheader>
<auxheader>
<image src="/img/funnel.png" />
<textbox instant="true" width="85%"
value="@bind(vm.filterTemplate.contactName)" onChange="@command('doFilter')"/>
</auxheader>
<auxheader>
<image src="/img/funnel.png" />
<textbox instant="true" width="85%"
value="@bind(vm.filterTemplate.street)" onChange="@command('doFilter')"/>
</auxheader>
<auxheader>
<image src="/img/funnel.png" />
<textbox instant="true" width="85%"
value="@bind(vm.filterTemplate.houseNumber)" onChange="@command('doFilter')"/>
</auxheader>
<auxheader>
<image src="/img/funnel.png" />
<textbox instant="true" width="85%"
value="@bind(vm.filterTemplate.city)" onChange="@command('doFilter')"/>
</auxheader>
</auxhead>
<listhead vflex="true">
<listheader label="Firma" sort="auto(company)" onSort="@command('onSort', column='company')" />
<listheader label="IČ" width="100px"/>
<listheader label="Kontaktní osoba"/>
<listheader label="Ulice"/>
<listheader label="Číslo domu" width="80px"/>
<listheader label="Město" sort="auto(city)" onSort="@command('onSort', column='city')"/>
</listhead>
<template name="model">
<listitem>
<listcell label="@load(each.company)"/>
<listcell label="@load(each.ic)"/>
<listcell label="@load(each.contactName)"/>
<listcell label="@load(each.street)"/>
<listcell label="@load(each.houseNumber)"/>
<listcell label="@load(each.city)"/>
</listitem>
</template>
</listbox>
<div hflex="4">
<label value="Detail:" sclass="bold"/>
<grid visible="@load(vm.dataBean ne null)" hflex="1">
<columns>
<column hflex="min"/>
<column/>
</columns>
<rows>
<row><label value="Oddělení"/><label value="@load(vm.dataBean.department)"/></row>
<row><label value="Telefon"/><label value="@load(vm.dataBean.phone)"/></row>
<row><label value="Email"/><label value="@load(vm.dataBean.email)"/></row>
<row><label value="Web"/><label value="@load(vm.dataBean.web)"/></row>
</rows>
</grid>
<label value="Poznámka:" visible="@load(not empty vm.dataBean.description)" sclass="bold"/>
<html style="font-family:arial,sans-serif;font-size:12px;" content="@load(vm.dataBean.description)"/>
<mapa address="@load((empty vm.dataBean.street ? vm.dataBean.city : vm.dataBean.street).concat(' ').concat(vm.dataBean.houseNumber).concat(', ').concat(vm.dataBean.city))" width="360px" height="180px" visible="@load(vm.dataBean ne null)"/>
</div>
</hbox>
</window>
</zk>
@@ -0,0 +1,11 @@
<?page title="Dodavatelé" contentType="text/html;charset=UTF-8"?>
<?script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB6sVWLvFMvbK994Pa418XDhbDUZ6Xr4CQ&amp;sensor=false"?>
<zk>
<zscript>
String gridZul = "addressbook.zul";
</zscript>
<include src="/app/template.zhtml"/>
</zk>
+4
View File
@@ -48,4 +48,8 @@ background: #ebebeb;
.error {
color: red;
}
.bold {
font-weight: bold;
}
+4
View File
@@ -0,0 +1,4 @@
<?page title="buttons" contentType="text/html;charset=UTF-8"?>
<zk>
<button image="/img/save.png" label="Uložit" onClick="@command('save', window=editWin) @global-command('refresh')" sclass="nicebutton" /><button image="~./zul/img/misc/drag-disallow.png" label="Zrušit" onClick="editWin.detach()" sclass="nicebutton"/>
</zk>
+1
View File
@@ -31,6 +31,7 @@
<menuitem label="Střediska" href="/admin/users" disabled="${not sec:isAllGranted('ROLE_ADMIN')}"/>
<menuitem label="Budovy" href="/admin/users"/>
<menuitem label="Místnosti" href="/admin/users"/>
<menuitem label="Dodavatelé" href="/admin/addressbook"/>
</menubar>
</tabpanel>
<tabpanel>
+39
View File
@@ -1,6 +1,45 @@
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="native" xmlns:u="zul" xmlns:zk="zk">
<u:style src="/app/page.css"/>
<script type="text/javascript">
zk.afterLoad("zk", function () {
var oldProgressbox = zUtl.progressbox;
zUtl.progressbox = function () {
oldProgressbox.apply(this, arguments);
var $mask = jq('.z-loading');
if ($mask) {
var $img = jq('.z-loading-indicator'),
$body = jq(document.body),
body = $body[0],
bw = $body.width() + body.scrollLeft - 10,
bh = $body.height() + body.scrollTop - 10;
// update mask and image's style
$mask.width(bw);
$mask.height(bh);
$mask.css('opacity', .75);
$img.width('150px');
$img.css('margin-left', (bw - $img.width()) / 2 + 'px');
$img.css('margin-top', (bh - $img.height()) / 2 + 'px');
// update mask size when window scroll
if (!window.eventBinded) {
var $win = jq(window);
$win.scroll(function () {
var $maskInst = jq('.z-loading');
if ($maskInst[0]) {
$maskInst.width(bw + $win.scrollLeft());
$maskInst.height(bh + $win.scrollTop());
}
});
window.eventBinded = true;
}
}
}
});
</script>
<div id="container">
<div id="header">
Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B