Conflicts:
	src/main/resources/hibernate.cfg.xml
	src/main/webapp/WEB-INF/spring/root-context.xml
This commit is contained in:
2014-05-12 08:44:06 +02:00
63 changed files with 2154 additions and 124 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>
+1 -1
View File
@@ -1,5 +1,5 @@
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.dialect=org.hibernate.dialect.MySQLDialect
jdbc.databaseurl=jdbc:mysql://127.0.0.1:3306/isspst
jdbc.databaseurl=jdbc:mysql://127.0.0.1:3306/isspst?characterEncoding=utf8
jdbc.username=root
jdbc.password=xsacfgd
@@ -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>
+30 -2
View File
@@ -1,6 +1,34 @@
<?page title="Uživatel" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="Uživatel" border="normal">
<window id="editWin" title="Uživatel" border="normal" closable="true" width="450px" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.users.UserForm')">
<style src="/app/form.css"/>
<grid width="440px">
<columns>
<column hflex="min"></column>
<column></column>
<column></column>
</columns>
<rows>
<row><label value="Login"/><textbox value="@bind(vm.dataBean.username)" instant="true" disabled="@load(vm.edit)" onChange="@command('checkLogin')"/><label value="Login je obsazený" sclass="error" visible="@load(not vm.loginFree)"/></row>
<row><label value="Jméno"/><textbox value="@bind(vm.dataBean.firstName)"/></row>
<row><label value="Příjmení"/><textbox value="@bind(vm.dataBean.lastName)"/></row>
<row><label value="Osobní číslo"/><textbox value="@bind(vm.dataBean.personalNumber)" width="90px"/></row>
<row><label value="E-mail"/><textbox value="@bind(vm.dataBean.email)"/></row>
<row><label value=""/><checkbox label="Zasílat upozornění" checked="@bind(vm.dataBean.notify)"/></row>
<row><label value="Heslo"/><textbox value="@bind(vm.password)" type="password" instant="true"/></row>
<row><label value="Znova heslo"/><textbox value="@bind(vm.retPasswd)" type="password" instant="true"/><label value="Hesla nesouhlasí" sclass="error" visible="@load(not vm.pwMatches)"/></row>
<row><label value=""/><checkbox label="Aktivní" checked="@bind(vm.dataBean.enabled)"/></row>
</rows>
</grid>
<groupbox mold="3d">
<caption label="Role"/>
<vbox children="@load(vm.userRoles.roleChecks)">
<template name="children">
<checkbox label="@load(each.role.description)" checked="@bind(each.checked)"/>
</template>
</vbox>
</groupbox>
<button image="/img/save.png" label="Uložit" onClick="@command('save', window=editWin) @global-command('refresh')" disabled="@load(not vm.canSave)" sclass="nicebutton" /><button image="~./zul/img/misc/drag-disallow.png" label="Zavřít" onClick="editWin.detach()" sclass="nicebutton"/>
</window>
</zk>
+28 -12
View File
@@ -2,28 +2,44 @@
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window title="Uživatelé" border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.UsersList')">
<toolbar>
<toolbarbutton image="/img/add.png" tooltiptext="${labels.New}" id="btnNew" onClick="@command('addNew')" disabled="@load(vm.filter)" />
<toolbarbutton image="/img/edit.png" tooltiptext="${labels.Edit}" id="btnEdit" onClick="@command('edit')" disabled="@load(empty vm.dataBean ? 'true' : 'false')"/>
<toolbarbutton image="/img/delete.png" tooltiptext="${labels.Delete}" id="btnDelete" onClick="@command('delObject')" disabled="@load(empty vm.dataBean ? 'true' : 'false')"/>
<toolbarbutton image="/img/funnel.png" tooltiptext="${labels.Filter}" id="btnFilter" onClick="@command('filter')" />
</toolbar>
viewModel="@id('vm') @init('info.bukova.isspst.ui.users.UsersList')" height="570px">
<include src="/app/toolbar.zul"/>
<listbox model="@load(vm.dataList)" selectedItem="@bind(vm.dataBean)">
<auxhead sclass="category-center" visible="@load(vm.filter)">
<auxheader>
<image src="/img/funnel.png" />
<textbox value="@bind(vm.filterTemplate.username)" instant="true" onChange="@command('doFilter')"/>
</auxheader>
<auxheader>
<image src="/img/funnel.png" />
<textbox value="@bind(vm.filterTemplate.personalNumber)" instant="true" onChange="@command('doFilter')"/>
</auxheader>
<auxheader>
<image src="/img/funnel.png" />
<textbox value="@bind(vm.filterTemplate.firstName)" instant="true" onChange="@command('doFilter')"/>
</auxheader>
<auxheader>
<image src="/img/funnel.png" />
<textbox value="@bind(vm.filterTemplate.lastName)" instant="true" onChange="@command('doFilter')"/>
</auxheader>
</auxhead>
<listhead>
<listheader label="Login"/>
<listheader label="Celé jméno"/>
<listheader label="Osobní číslo"/>
<listheader label="Jméno"/>
<listheader label="Příjmení"/>
</listhead>
<template name="model">
<listitem>
<listcell label="@load(each.username)"/>
<listcell label="@load(each.fullName)"/>
<listcell label="@load(each.personalNumber)"/>
<listcell label="@load(each.firstName)"/>
<listcell label="@load(each.lastName)"/>
</listitem>
</template>
</listbox>
</window>
</zk>
+55
View File
@@ -0,0 +1,55 @@
.nicebutton {
font-family: Arial;
color: #050005;
font-size: 12px;
padding-top: 3px;
padding-right: 10px;
padding-bottom: 3px;
padding-left: 10px;
margin: 4px;
text-decoration: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px #666666;
-moz-box-shadow: 0px 1px 3px #666666;
box-shadow: 0px 1px 3px #666666;
text-shadow: 1px 1px 2px #666666;
border: solid #8abaed 1px;
background: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#efefef));
background: -moz-linear-gradient(top, #ffffff, #efefef);
-ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#ffffff, endColorStr=#efefef);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#ffffff, endColorStr=#efefef);
display:inline-block; /* IE is so silly */
}
.nicebutton:hover {
background: #c5e8fa;
}
.nicebutton:disabled {
font-family: Arial;
color: #c4c4c4;
font-size: 12px;
padding-top: 3px;
padding-right: 10px;
padding-bottom: 3px;
padding-left: 10px;
margin: 5px;
text-decoration: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px #666666;
-moz-box-shadow: 0px 1px 3px #666666;
text-shadow: 0px 0px 0px #9e9e9e;
box-shadow: 0px 1px 3px #666666;
border: solid #d91c71 0px;
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="${labels.AgendaBuildings}" href="/buildings"/>
<menuitem label="Místnosti" href="/admin/users"/>
<menuitem label="Dodavatelé" href="/admin/addressbook"/>
</menubar>
</tabpanel>
<tabpanel>
+42
View File
@@ -1,7 +1,47 @@
<?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">
hlavicka
</div>
@@ -11,11 +51,13 @@
</div>
<div id="maincolumn">
<u:include src="${gridZul}"/>
</div>
<div id="footer">Footer
</div>
</div>
</html>
+9
View File
@@ -0,0 +1,9 @@
<?page title="toolbar" contentType="text/html;charset=UTF-8"?>
<zk>
<toolbar>
<toolbarbutton image="/img/add.png" tooltiptext="Nový" id="btnNew" onClick="@command('addNew')" disabled="@load(vm.filter)" />
<toolbarbutton image="/img/edit.png" tooltiptext="Upravit" id="btnEdit" onClick="@command('edit')" disabled="@load(empty vm.dataBean ? 'true' : 'false')"/>
<toolbarbutton image="/img/delete.png" tooltiptext="Smazat" id="btnDelete" onClick="@command('delete')" disabled="@load(empty vm.dataBean ? 'true' : 'false')"/>
<toolbarbutton image="/img/funnel.png" tooltiptext="Filtr" id="btnFilter" onClick="@command('filter')" />
</toolbar>
</zk>
Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B