Thread: [osm-devel] SF.net SVN: openstamanager:[920] new_trunk/openstamanager (2024)

Thread: [osm-devel] SF.net SVN: openstamanager:[920]new_trunk/openstamanager (5)

Brought to you by:loviuz,lucasalva,magreba

  • Summary
  • Files
  • Reviews
  • Support
  • Mailing Lists
  • External Link ▾
  • Code
  • Wiki

Menu▾▴

  • openstamanager-devel
  • openstamanager-testers
  • openstamanager-users

openstamanager-devel

[osm-devel] SF.net SVN: openstamanager:[920]new_trunk/openstamanager

From: <lo...@us...> - 2014-06-02 12:33:08

Revision: 920 http://sourceforge.net/p/openstamanager/code/920Author: loviuzDate: 2014-06-02 12:33:00 +0000 (Mon, 02 Jun 2014)Log Message:-----------[core] - aggiunta file mancanti di OSM2Added Paths:----------- new_trunk/openstamanager/README new_trunk/openstamanager/files/ new_trunk/openstamanager/index.php new_trunk/openstamanager/lib/ new_trunk/openstamanager/lib/dbo.class.php new_trunk/openstamanager/lib/functions.php new_trunk/openstamanager/lib/jscripts/ new_trunk/openstamanager/lib/jscripts/bootstrap.min.js new_trunk/openstamanager/lib/jscripts/fullcalendar.min.js new_trunk/openstamanager/lib/jscripts/jquery/ new_trunk/openstamanager/lib/jscripts/jquery/chosen.jquery.js new_trunk/openstamanager/lib/jscripts/jquery/images/ new_trunk/openstamanager/lib/jscripts/jquery/images/chosen-sprite-2x.png new_trunk/openstamanager/lib/jscripts/jquery/jquery-ui-1.10.3.min.js new_trunk/openstamanager/lib/jscripts/jquery/jquery.datetimepicker.js new_trunk/openstamanager/lib/jscripts/jquery/jquery.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/bootstrap-slider/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/bootstrap-slider/bootstrap-slider.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/bootstrap-wysihtml5/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/CHANGES.md new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/LICENSE.md new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/README.md new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/adapters/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/adapters/jquery.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/build-config.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/ckeditor.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/config.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/contents.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/af.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ar.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/bg.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/bn.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/bs.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ca.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/cs.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/cy.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/da.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/de.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/el.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/en-au.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/en-ca.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/en-gb.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/en.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/eo.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/es.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/et.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/eu.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/fa.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/fi.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/fo.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/fr-ca.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/fr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/gl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/gu.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/he.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/hi.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/hr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/hu.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/id.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/is.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/it.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ja.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ka.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/km.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ko.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ku.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/lt.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/lv.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/mk.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/mn.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ms.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/nb.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/nl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/no.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/pl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/pt-br.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/pt.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ro.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ru.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/si.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/sk.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/sl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/sq.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/sr-latn.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/sr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/sv.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/th.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/tr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/ug.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/uk.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/vi.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/zh-cn.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/lang/zh.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/da.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/de.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/el.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/en.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/es.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/et.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/fr-ca.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/gl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/he.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/id.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/it.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/km.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/ko.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/no.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/si.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/sq.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/sr-latn.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/sr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/th.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/zh.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/about/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/about/dialogs/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/about/dialogs/about.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/about/dialogs/hidpi/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/about/dialogs/logo_ckeditor.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/clipboard/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/clipboard/dialogs/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/clipboard/dialogs/paste.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/dialog/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/dialog/dialogDefinition.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/fakeobjects/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/fakeobjects/images/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/fakeobjects/images/spacer.gif new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/icons.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/icons_hidpi.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/image/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/image/dialogs/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/image/dialogs/image.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/image/images/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/image/images/noimage.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/link/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/link/dialogs/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/link/dialogs/anchor.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/link/dialogs/link.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/link/images/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/link/images/anchor.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/link/images/hidpi/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/link/images/hidpi/anchor.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/magicline/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/magicline/images/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/magicline/images/hidpi/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/magicline/images/hidpi/icon.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/magicline/images/icon.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/pastefromword/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/pastefromword/filter/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/pastefromword/filter/default.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/scayt/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/scayt/LICENSE.md new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/scayt/README.md new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/scayt/dialogs/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/scayt/dialogs/options.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/scayt/dialogs/toolbar.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/ar.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/bg.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/ca.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/cs.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/cy.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/de.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/el.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/en.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/eo.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/es.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/et.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/fa.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/fi.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/fr-ca.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/fr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/gl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/he.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/hr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/hu.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/id.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/it.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/ja.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/km.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/ku.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/lv.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/nb.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/nl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/no.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/pl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/pt.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/ru.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/si.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/sk.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/sl.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/sq.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/sv.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/th.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/tr.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/ug.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/uk.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/vi.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/lang/zh.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/specialchar/dialogs/specialchar.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/table/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/table/dialogs/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/table/dialogs/table.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/tabletools/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/tabletools/dialogs/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/tabletools/dialogs/tableCell.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/wsc/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/wsc/LICENSE.md new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/wsc/README.md new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/wsc/dialogs/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/wsc/dialogs/ciframe.html new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/wsc/dialogs/tmp.html new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/wsc/dialogs/tmpFrameset.html new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/wsc/dialogs/wsc.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/wsc/dialogs/wsc.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/plugins/wsc/dialogs/wsc_ie.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/dialog.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/dialog_ie.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/dialog_ie7.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/dialog_ie8.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/dialog_iequirks.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/dialog_opera.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/editor.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/editor_gecko.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/editor_ie.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/editor_ie7.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/editor_ie8.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/editor_iequirks.css new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/icons.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/icons_hidpi.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/arrow.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/close.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/hidpi/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/hidpi/close.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/hidpi/lock-open.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/hidpi/lock.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/hidpi/refresh.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/lock-open.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/lock.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/images/refresh.png new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/skins/moono/readme.md new_trunk/openstamanager/lib/jscripts/jquery/plugins/ckeditor/styles.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/colorpicker/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/colorpicker/bootstrap-colorpicker.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/colorpicker/bootstrap-colorpicker.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/dataTables.bootstrap.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/daterangepicker/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/daterangepicker/daterangepicker.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/excanvas.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/excanvas.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.colorhelpers.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.colorhelpers.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.canvas.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.canvas.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.categories.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.categories.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.crosshair.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.crosshair.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.errorbars.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.errorbars.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.fillbetween.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.fillbetween.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.image.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.image.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.navigate.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.navigate.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.pie.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.pie.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.resize.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.resize.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.selection.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.selection.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.stack.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.stack.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.symbol.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.symbol.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.threshold.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.threshold.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.time.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/flot/jquery.flot.time.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/fullcalendar/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/fullcalendar/fullcalendar.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/fullcalendar/fullcalendar.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/iCheck/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/iCheck/icheck.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/iCheck/icheck.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.date.extensions.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.extensions.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.numeric.extensions.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.phone.extensions.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.regex.extensions.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/phone-codes/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/phone-codes/phone-be.json new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/phone-codes/phone-codes.json new_trunk/openstamanager/lib/jscripts/jquery/plugins/input-mask/phone-codes/readme.txt new_trunk/openstamanager/lib/jscripts/jquery/plugins/ionslider/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/ionslider/ion.rangeSlider.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/jqueryKnob/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/jqueryKnob/jquery.knob.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/jvectormap/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/jvectormap/jquery-jvectormap-world-mill-en.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/misc/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/misc/html5shiv.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/misc/jquery.ba-resize.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/misc/jquery.placeholder.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/misc/modernizr.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/misc/respond.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/morris/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/morris/morris.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/morris/morris.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/slimScroll/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/slimScroll/jquery.slimscroll.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/slimScroll/jquery.slimscroll.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/slimScroll/slimScroll.jquery.json new_trunk/openstamanager/lib/jscripts/jquery/plugins/sparkline/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/sparkline/jquery.sparkline.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/sparkline/jquery.sparkline.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/timepicker/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/timepicker/bootstrap-timepicker.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/timepicker/bootstrap-timepicker.min.js new_trunk/openstamanager/lib/modulebuilder.php new_trunk/openstamanager/lib/permissions_check.php new_trunk/openstamanager/lib/photo.class.php new_trunk/openstamanager/lib/user_check.phpAdded: new_trunk/openstamanager/README===================================================================--- new_trunk/openstamanager/README (rev 0)+++ new_trunk/openstamanager/README2014-06-02 12:33:00 UTC (rev 920)@@ -0,0 +1,72 @@+.:: NOME ::.+OpenSTAManager+++.:: LICENZA ::.+GPL versione 3+++.:: DEVELOPERS ::.+Fabio Lovato aka T~d~L (fa...@l-...)+Fabio Piovan (fa...@fp...)+Luca Salvà (lu...@tc...)++.:: DESCRIZIONE ::.+OpenSTAManager è un software per la gestione del servizio di assistenza. E' un software web+based, modulare e semplice da usare.+++.:: INSTALLAZIONE ::.+E' necessario disporre di un server web con supporto al PHP e di un database+MySQL.+++ -- GNU/Linux --+ Testato su Apache2 e MySQL > 5.0 su distribuzioni basate su Debian e ArchLinux++ -- Windows --+ Testato su Windows XP (SP1, SP2, SP3) e Windows Vista (SP1) con WAMP 2.0.+ + -- Mac --+ Testato su Mac OS X con MAMP e XAMPP.++L'installazione è semplice e si compone di pochi passaggi:+1) copiare il contenuto di questa cartella nella root del server web;+2) configurare alcuni (molto pochi) parametri del file config.php;+3) avviare il browser e collegarsi a http://localhost/nomecartella++dove nomecartella è il nome della directory che contiene il programma.+Username e password di default sono rispettivamente admin e admin.++Se avete dei problemi di qualsiasi tipo provate a porre la vostra domanda+nelle sezioni più adeguate:++SEGNALAZIONE ERRORI DEL PROGRAMMA:+++SUPPORTO ONLINE:+++RICHIESTA DI FUNZIONALITA' AGGIUNTIVE:+++INVIO CORREZIONI DEL PROGRAMMA (SOLO PER PROGRAMMATORI):++++.:: IMPORTANTE ::.+OpenSTAManager è software libero, con licenza GPL versione 3. Dai link sopra+riportati non c'è nessuna garanzia che qualcuno risponda in tempo alle vostre+richieste o problemi.++Se utilizzate il programma per uso commerciale e volete avere certezze e supporto+professionali non utilizzate le versioni da SVN ma solo le release ufficiali+e richiedete assistenza dal supporto ufficiale a http://www.openstamanager.com.+++.:: MAILING-LIST ::.+Sono disponibili 3 mailing list:+ - ope...@li...: per gli sviluppatori;+ - ope...@li...: per gli utenti che desiderano rimanere aggiornati sulle ultime novità del+ programma;+ - ope...@li...: per chi vuole testare il programma prima delle release;Property changes on: new_trunk/openstamanager/README___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/index.php===================================================================--- new_trunk/openstamanager/index.php (rev 0)+++ new_trunk/openstamanager/index.php2014-06-02 12:33:00 UTC (rev 920)@@ -0,0 +1,63 @@+<!DOCTYPE html>+<html class="bg-black">+ <head>+ <meta charset="UTF-8">+ <title>AdminLTE | Log in</title>+ <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>+ <!-- bootstrap 3.0.2 -->+ <link href="../../css/bootstrap.min.css" rel="stylesheet" type="text/css" />+ <!-- font Awesome -->+ <link href="../../css/font-awesome.min.css" rel="stylesheet" type="text/css" />+ <!-- Theme style -->+ <link href="../../css/AdminLTE.css" rel="stylesheet" type="text/css" />++ <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->+ <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->+ <!--[if lt IE 9]>+ <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>+ <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>+ <![endif]-->+ </head>+ <body class="bg-black">++ <div class="form-box" id="login-box">+ <div class="header">Sign In</div>+ <form action="../../index.html" method="post">+ <div class="body bg-gray">+ <div class="form-group">+ <input type="text" name="userid" class="form-control" placeholder="User ID"/>+ </div>+ <div class="form-group">+ <input type="password" name="password" class="form-control" placeholder="Password"/>+ </div> + <div class="form-group">+ <input type="checkbox" name="remember_me"/> Remember me+ </div>+ </div>+ <div class="footer"> + <button type="submit" class="btn bg-olive btn-block">Sign me in</button> + + <p><a href="#">I forgot my password</a></p>+ + <a href="register.html" class="text-center">Register a new membership</a>+ </div>+ </form>++ <div class="margin text-center">+ <span>Sign in using social networks</span>+ <br/>+ <button class="btn bg-light-blue btn-circle"><i class="fa fa-facebook"></i></button>+ <button class="btn bg-aqua btn-circle"><i class="fa fa-twitter"></i></button>+ <button class="btn bg-red btn-circle"><i class="fa fa-google-plus"></i></button>++ </div>+ </div>+++ <!-- jQuery 2.0.2 -->+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>+ <!-- Bootstrap -->+ <script src="../../js/bootstrap.min.js" type="text/javascript"></script> ++ </body>+</html>\ No newline at end of fileProperty changes on: new_trunk/openstamanager/index.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/lib/dbo.class.php===================================================================--- new_trunk/openstamanager/lib/dbo.class.php (rev 0)+++ new_trunk/openstamanager/lib/dbo.class.php2014-06-02 12:33:00 UTC (rev 920)@@ -0,0 +1,154 @@+<?+/*+ DATABASE CLASS+ */+class Dbo{++//connection to the DBMS+function connect(){+global $db_host;+global $db_username;+global $db_password;+global $db_name;++if( $conn = @mysql_connect( $db_host, $db_username, $db_password ) )+if( @mysql_select_db($db_name, $conn) )+return "ok";+else+return mysql_error();+else+return mysql_error();+}++//query on the table+function query($sql, $hide_errors=0){+if( @mysql_query($sql) ){+$id = mysql_insert_id();+if( $id==0 )+return 1;+else+return $id;+}+else{+if( $hide_errors==0 )+write_error( mysql_error(),"300px" );+else+return false;+}+}++//fetch row+function fetchRow($sql){+$rows = @mysql_fetch_row( mysql_query($sql) ) or write_error( mysql_error(),"300px" );+return $rows;+}++//record count+function fetchNum($sql, $hide_error=0){+if( $hide_error==0 )+$num = @mysql_num_rows( mysql_query($sql) ) or write_error( mysql_error(),"300px" );+else+$num = @mysql_num_rows( mysql_query($sql) );+return $num;+}++//fetch records+function fetchArray($sql){+$i=0;+if( $q=@mysql_query($sql) )+while( $rs=mysql_fetch_array( $q, MYSQL_ASSOC ) ){+$array[$i]=$rs;+$i++;+}+else+if( $hide_error==0 )+write_error( mysql_error(),"300px" );+return $array;+}++//fetch records (numero al posto del nome del campo)+function fetchRows($sql){+$i=0;+if( $q=@mysql_query($sql) )+while( $rs=mysql_fetch_row($q) ){+$array[$i]=$rs;+$i++;+}+else+if( $hide_error==0 )+write_error( mysql_error(),"300px" );+return $array;+}++//Returns the last inserted record+function last_inserted_id(){+return mysql_insert_id();+}++//Esegue più query prese da un dump SQL+function multiQuery( $filename, $delimiter = ';' ) {+$inString = false;+$escChar = false;+$sql = '';+$stringChar = '';+$queryLine = array();+$queryBlock = file_get_contents( $filename );+$sqlRows = split ( "\n", $queryBlock );+$delimiterLen = strlen ( $delimiter );+do {+ $sqlRow = current ( $sqlRows ) . "\n";+ $sqlRowLen = strlen ( $sqlRow );+ for ( $i = 0; $i < $sqlRowLen; $i++ ) {+ //if ( ( substr ( ltrim ( $sqlRow ), $i, 2 ) === '--' || substr ( ltrim ( $sqlRow ), $i, 1 ) === '#' ) && !$inString ) {+ if ( ( substr ( ltrim ( $sqlRow ), $i, 2 ) === '--' ) && !$inString ) {+ break;+ }+ $znak = substr ( $sqlRow, $i, 1 );+ if ( $znak === '\'' || $znak === '"' ) {+ if ( $inString ) {+ if ( !$escChar && $znak === $stringChar ) {+ $inString = false;+ }+ }+ else {+ $stringChar = $znak;+ $inString = true;+ }+ }+ if ( $znak === '\\' && substr ( $sqlRow, $i - 1, 2 ) !== '\\\\' ) {+ $escChar = !$escChar;+ }+ else {+ $escChar = false;+ }+ if ( substr ( $sqlRow, $i, $delimiterLen ) === $delimiter ) {+ if ( !$inString ) {+ $sql = trim ( $sql );+ $delimiterMatch = array();+ if ( preg_match ( '/^DELIMITER[[:space:]]*([^[:space:]]+)$/i', $sql, $delimiterMatch ) ) {+ $delimiter = $delimiterMatch [1];+ $delimiterLen = strlen ( $delimiter );+ }+ else {+ $queryLine [] = $sql;+ }+ $sql = '';+ continue;+ }+ }+ $sql .= $znak;+ }+} while ( next( $sqlRows ) !== false );++foreach( $queryLine as $singleQuery ){+mysql_query( $singleQuery );+}+}+++//closing db connection+function close(){+@mysql_close();+}+}+?>Property changes on: new_trunk/openstamanager/lib/dbo.class.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/lib/functions.php===================================================================--- new_trunk/openstamanager/lib/functions.php (rev 0)+++ new_trunk/openstamanager/lib/functions.php2014-06-02 12:33:00 UTC (rev 920)@@ -0,0 +1,1014 @@+<?php+function fix_str($text){+ $text = str_replace( "\r\n", "<br/>", $text );+ $text = str_replace( "'", "&rsquo;", $text );+ return $text;+}++/*+Trasforma un testo in un nome di id valido per l'html+*/+function makeid($text){+$text = strtolower( $text );+$text = str_replace( " ", "_", $text );+return $text;+}++/*+It replace " and < > for hacking and various problems+*/+function save($text){+$text = htmlentities($text, ENT_QUOTES, "UTF-8");+return $text;+}+++/*+Legge il valore di una impostazione dalla tabella zz_impostazioni+*/+function get_var( $name ){+global $dbo;+$rs = $dbo->fetchArray("SELECT valore FROM zz_impostazioni WHERE nome=\"$name\"");+return $rs[0]['valore'];+}++/*+It checks if the id format is right+*/+function is_id_ok( $id ){+if( preg_match( "/^[a-z0-9\/\.,:_()-]+$/i", $id ) )+return true;+else+return false;+}++++/*+It replace &quot;with "+*/+function read($text){+$text = str_replace( "&quot;", "\"", $text );+return $text;+}++++/*+It shows an error in a red div with specified WIDTH+*/+function write_error($text,$width=200){+if( $text != '' )+echo "<div class=\"error\">$text</div>\n";+return true;+}++++/*+It print text whenever an operation is executed successfully+*/+function write_ok($text,$width=200){+if( $text != '' ){+echo "<div class=\"ok\">$text</div>\n";+}+return true;+}++++/*+Taglia un testo ($str) al numero di caratteri stabilito ($length), fermandosi però al primo spazio successivo+per non troncare una parola se specificato $at_next_space=1+*/+function cut_text( $str, $length, $at_next_space=0 ){+if( strlen($str)>$length ){+$s = substr( $str, 0, $length );++if( $at_next_space ){+for( $i=$length; $i<strlen($str); $i++ ){+$carattere = substr( $str, $i, 1 );+if( $carattere==" " || $carattere=="," )+return $s."...";+else+$s .= $carattere;+}+}++else+$s .= "...";++return $s;+}+else+return $str;+}++++/*+It redirects in some different way+*/+function redirect( $url, $type ){+switch( $type ){+case "php":+header("Location: $url");+break;+case "js":+echo "<script type=\"text/javascript\">location.href='$url';</script>";+}+return true;+}++/*+It create a data format by editing date in the input text box (created with datapicker jsquery)+*/+function saveDate( $data ){+$date=explode( '/',$data );+$date = $date[1] . '/' . $date[0] . '/' . $date[2];+$date = strtotime($date);+return date( 'Y-m-d',$date);+}++/*+It create a data format by reading from database and writing to the input text box (datapicker jsquery)+*/+function readDate( $data ){+$date=explode( '-',$data );+$date = $date[2] . '/' . $date[1] . '/' . $date[0];+return $date;+}++/*+It loads all the javascripts included in jscript_modules+*/+function loadJscriptModules($jscript_modules_array){+foreach( $jscript_modules_array as $jsname ){+echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"$jsname\"></script>\n";+}+return true;+}++/*+It loads all the css included in css_modules+*/+function loadCSSModules($css_modules_array){+foreach( $css_modules_array as $css ){+echo "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"$css\"/>\n";+}+return true;+}++++/*+Legge i moduli installati+*/+function getAvailableModules(){+global $modules;+$modules_line = $modules;++$vmodules = array();+if( $modules_line != '' ){+$modules=explode( ',',$modules_line );++foreach( $modules as $module )+array_push( $vmodules, $module );+}+return $vmodules;+}++/*+Legge la versione in uso+*/+function getVersion( $file = 'VERSION' ){+global $docroot;+$version = file_get_contents( $docroot."/".$file );+$version = str_replace( "\r\n", '', $version );+$version = str_replace( "\n", '', $version );+return $version;+}++function read_file( $file ){+$r = file_get_contents( $file );+$r = str_replace( "\r\n", '', $r );+$r = str_replace( "\n", '', $r );+$r = str_replace( " ", '', $r );+return $r;+}++/*+Legge l'ora nel formato hh:mm+*/+function readTime( $time ){+$vtime = split( ':',$time );+$hour = $vtime[0];+$minutes = $vtime[1];+$seconds = $vtime[2];+return "$hour:$minutes";+}+++/*+Salva l'ora aiutando l'utente se ha scritto cavolate!+*/+function saveTime( $time ){+//scrive solo l'ora (16, oppure 9)+$result = $time;+if( preg_match( "/^([0-9]{1,2})$/", $time ) )+$result = "$time:00:00";++$result = str_replace( ',', ':', $result );+$result = str_replace( '.', ':', $result );+return $result;+}++/*++Salvo data e ora (Y-m-d H:i)++*/++function saveDateTime( $datetime ){+++$data = substr ($datetime, 0, -6);++$date = explode( '/',$data );+$date = $date[1] . '/' . $date[0] . '/' . $date[2];+$date = strtotime($date);+$date = date( 'Y-m-d', $date );++$time = substr ($datetime, -5);++$result = $time;+$result = str_replace( ',', ':', $result );+$result = str_replace( '.', ':', $result );+$time = date( 'H:i', strtotime($result) );++++$datetime = $date." ".$time;++return $datetime;++}++++function readDateTime( $datetime ){+++$data = substr ($datetime, 0, -9);++$date = explode( '-',$data );+$date = $date[2] . '/' . $date[1] . '/' . $date[0];+++$time = substr ($datetime, -8);++$result = $time;+$result = str_replace( ',', ':', $result );+$result = str_replace( '.', ':', $result );+$time = date( 'H:i', strtotime($result) );++$datetime = $date." ".$time;++return $datetime;+++}+++function readDateTimePrint( $datetime, $view ){+++$data = substr ($datetime, 0, -9);++$date = explode( '-',$data );+$date = $date[2] . '/' . $date[1] . '/' . $date[0];+++$time = substr ($datetime, -8);++$result = $time;+$result = str_replace( ',', ':', $result );+$result = str_replace( '.', ':', $result );+$time = date( 'H:i', strtotime($result) );++$datetime = $date." ".$time;+++if ($view == "date")+return $date;++if ($view == "time")+return $time;++}+++/*+Verifica (e corregge) il nome del file che si carica+*/+function sanitizeFilename( $filename ){+$result = str_replace( '/', '', $filename );+$result = str_replace( '\\', '', $result );+return $result;+}+++++/*+Funzione per rimuovere ricorsivamente una directory+*/+function deltree($path) {+if (is_dir($path)) {+if (version_compare(PHP_VERSION, '5.0.0') < 0) {+$entries = array();+if ($handle = opendir($path)) {+while (false !== ($file = readdir($handle))) $entries[] = $file;+closedir($handle);+}+}+else {+$entries = scandir($path);+if ($entries === false) $entries = array(); // just in case scandir fail...+}++foreach ($entries as $entry) {+if ($entry != '.' && $entry != '..') {+deltree($path.'/'.$entry);+}+}++return rmdir($path);+}else {+return unlink($path);+}+}++++/**+ * Copy a file, or recursively copy a folder and its contents+ *+ * @author Aidan Lister <ai...@ph...>+ * @version 1.0.1+ * @link http://aidanlister.com/repos/v/function.copyr.php+ * @param string $source Source path+ * @param string $dest Destination path+ * @return bool Returns TRUE on success, FALSE on failure+ */+function copyr($source, $dest)+{+// Simple copy for a file+if (is_file($source)) {+ return copy($source, $dest);+}++// Make destination directory+if (!is_dir($dest)) {+ mkdir($dest);+}++// If the source is a symlink+if (is_link($source)) {+ $link_dest = readlink($source);+ return symlink($link_dest, $dest);+}++// Loop through the folder+$dir = dir($source);+while (false !== $entry = $dir->read()) {+ // Skip pointers+ if ($entry == '.' || $entry == '..') {+ continue;+ }++ // Deep copy directories+ if ($dest !== "$source/$entry") {+ copyr("$source/$entry", "$dest/$entry");+ }+}++// Clean up+$dir->close();+return true;+}+++++function datediff($interval, $datefrom, $dateto, $using_timestamps = false){+/*+$interval can be:+yyyy - Number of full years+q - Number of full quarters+m - Number of full months+y - Difference between day numbers+(eg 1st Jan 2004 is "1", the first day. 2nd Feb 2003 is "33". The datediff is "-32".)+d - Number of full days+w - Number of full weekdays+ww - Number of full weeks+h - Number of full hours+n - Number of full minutes+s - Number of full seconds (default)+*/++if (!$using_timestamps) {+$datefrom = strtotime($datefrom, 0);+$dateto = strtotime($dateto, 0);+}+$difference = $dateto - $datefrom; // Difference in seconds++switch($interval){+case 'yyyy': // Number of full years+$years_difference = floor($difference / 31536000);+if (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom), date("j", $datefrom), date("Y", $datefrom)+$years_difference) > $dateto){+$years_difference--;+}+if (mktime(date("H", $dateto), date("i", $dateto), date("s", $dateto), date("n", $dateto), date("j", $dateto), date("Y", $dateto)-($years_difference+1)) > $datefrom) {+$years_difference++;+}+$datediff = $years_difference;+break;++case "q": // Number of full quarters+$quarters_difference = floor($difference / 8035200);+while (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom)+($quarters_difference*3), date("j", $dateto), date("Y", $datefrom)) < $dateto) {+$months_difference++;+}+$quarters_difference--;+$datediff = $quarters_difference;+break;++case "m": // Number of full months+$months_difference = floor($difference / 2678400);+while (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom)+($months_difference), date("j", $dateto), date("Y", $datefrom)) < $dateto) {+$months_difference++;+}+$months_difference--;+$datediff = $months_difference;+break;++case 'y': // Difference between day numbers+$datediff = date("z", $dateto) - date("z", $datefrom);+break;+ +case "d": // Number of full days+$datediff = floor($difference / 86400);+break;++case "w": // Number of full weekdays+$days_difference = floor($difference / 86400);+$weeks_difference = floor($days_difference / 7); // Complete weeks+$first_day = date("w", $datefrom);+$days_remainder = floor($days_difference % 7);+$odd_days = $first_day + $days_remainder; // Do we have a Saturday or Sunday in the remainder?+if ($odd_days > 7) { // Sunday+$days_remainder--;+}+if ($odd_days > 6) { // Saturday+$days_remainder--;+}+$datediff = ($weeks_difference * 5) + $days_remainder;+break;++case "ww": // Number of full weeks+$datediff = floor($difference / 604800);+break;++case "h": // Number of full hours+$datediff = floor($difference / 3600);+break;++case "n": // Number of full minutes+$datediff = floor($difference / 60);+break;++default: // Number of full seconds (default)+$datediff = $difference;+break;+}+return $datediff; +}++/*+Funzione per aggiungere n giorni a una data+Ritorna la data nel formato YYYY-mm-dd+La data passata come 1° parametro è nella forma: YYYY-mm-dd+code snippet from: http://it2.php.net/mktime+*/+function dateadd( $date, $totalDays=1 ){+ // You can add as many days as you want. mktime will accumulate to the next month / year.+ $thePHPDate = getdate( strtotime($date) );+ $thePHPDate['mday'] = $thePHPDate['mday']+$totalDays;+ $timeStamp = mktime($thePHPDate['hours'], $thePHPDate['minutes'], $thePHPDate['seconds'], $thePHPDate['mon'], $thePHPDate['mday'], $thePHPDate['year']);+ $newdate = getdate( $timeStamp );+ $y = $newdate['year'];+ $m = $newdate['mon'];+ strlen($m)==1 ? $m="0".$m : $m=$m;+ $d = $newdate['mday'];+ strlen($d)==1 ? $d="0".$d : $d=$d;++ return "$y-$m-$d";+ }+++//Controllo dei file zip e gestione errori+function checkZip($zip_file) {+$errno = zip_open($zip_file);+zip_close($errno);+if (!is_resource($errno)) {+// using constant name as a string to make this function PHP4 compatible+$zipFileFunctionsErrors = array(+'ZIPARCHIVE::ER_MULTIDISK' => 'archivi multi-disco non supportati',+'ZIPARCHIVE::ER_RENAME' => 'ridenominazione del file temporaneo fallita',+'ZIPARCHIVE::ER_CLOSE' => 'impossibile chiudere il file zip',+'ZIPARCHIVE::ER_SEEK' => 'errore durante la ricerca dei file',+'ZIPARCHIVE::ER_READ' => 'errore di lettura',+'ZIPARCHIVE::ER_WRITE' => 'errore di scrittura',+'ZIPARCHIVE::ER_CRC' => 'errore CRC',+'ZIPARCHIVE::ER_ZIPCLOSED' => 'l&rsquo;archivio zip &eacute; stato chiuso',+'ZIPARCHIVE::ER_NOENT' => 'file non trovato',+'ZIPARCHIVE::ER_EXISTS' => 'il file esiste gi&agrave;',+'ZIPARCHIVE::ER_OPEN' => 'impossibile aprire il file',+'ZIPARCHIVE::ER_TMPOPEN' => 'impossibile creare il file temporaneo',+'ZIPARCHIVE::ER_ZLIB' => 'errore nella libreria Zlib',+'ZIPARCHIVE::ER_MEMORY' => 'fallimento nell&rsquo;allocare memoria',+'ZIPARCHIVE::ER_CHANGED' => 'voce modificata',+'ZIPARCHIVE::ER_COMPNOTSUPP' => 'metodo di compressione non supportato',+'ZIPARCHIVE::ER_EOF' => 'fine del file non prevista',+'ZIPARCHIVE::ER_INVAL' => 'argomento non valido',+'ZIPARCHIVE::ER_NOZIP' => 'file zip non valido',+'ZIPARCHIVE::ER_INTERNAL' => 'errore interno',+'ZIPARCHIVE::ER_INCONS' => 'archivio zip inconsistente',+'ZIPARCHIVE::ER_REMOVE' => 'impossibile rimuovere la voce',+'ZIPARCHIVE::ER_DELETED' => 'voce eliminata',+);+foreach ($zipFileFunctionsErrors as $constName => $errorMessage) {+if (defined($constName) and constant($constName) === $errno) {+return "Errore: $errorMessage";+}+}+}+else+return true;+}+++//Mostra tutti i messaggi informativi nell'array+function show_info_messages( $infos ){+if( sizeof($infos)>0 ){++foreach( $infos as $info ){+echo "<div>\n";+write_ok( $info, "400px" );+echo "\n</div>\n";+}+}+}++//Mostra tutti i messaggi di errore nell'array+function show_error_messages( $errors ){+if( sizeof($errors)>0 ){+foreach( $errors as $error )+echo "<div>\n";+write_error( $... [truncated message content]

[osm-devel] SF.net SVN: openstamanager:[921]new_trunk/openstamanager

From: <lo...@us...> - 2014-06-02 12:59:07

Revision: 921 http://sourceforge.net/p/openstamanager/code/921Author: loviuzDate: 2014-06-02 12:59:01 +0000 (Mon, 02 Jun 2014)Log Message:-----------[core] - aggiunta ultimi file mancanti di osm2Modified Paths:-------------- new_trunk/openstamanager/index.php new_trunk/openstamanager/lib/functions.php new_trunk/openstamanager/lib/jscripts/jquery/jquery.js new_trunk/openstamanager/share/themes/default/css/AdminLTE.css new_trunk/openstamanager/share/themes/default/css/font-awesome.css new_trunk/openstamanager/share/themes/default/css/font-awesome.min.css new_trunk/openstamanager/share/themes/default/css/jQueryUI/jquery-ui-1.10.3.custom.min.css new_trunk/openstamanager/share/themes/default/fonts/FontAwesome.otf new_trunk/openstamanager/share/themes/default/fonts/fontawesome-webfont.eot new_trunk/openstamanager/share/themes/default/fonts/fontawesome-webfont.svg new_trunk/openstamanager/share/themes/default/fonts/fontawesome-webfont.ttf new_trunk/openstamanager/share/themes/default/fonts/fontawesome-webfont.woffAdded Paths:----------- new_trunk/openstamanager/controller.php new_trunk/openstamanager/core.php new_trunk/openstamanager/include/ new_trunk/openstamanager/include/bottom.php new_trunk/openstamanager/include/top.php new_trunk/openstamanager/include/topmenu.php new_trunk/openstamanager/lib/html-helpers.class.php new_trunk/openstamanager/lib/jscripts/app.js new_trunk/openstamanager/lib/jscripts/functions.js new_trunk/openstamanager/lib/jscripts/html5shiv.js new_trunk/openstamanager/lib/jscripts/jquery/jquery-ui-1.10.4.min.js new_trunk/openstamanager/lib/jscripts/jquery/jquery.ui.datepicker-it.js new_trunk/openstamanager/lib/jscripts/respond.min.js new_trunk/openstamanager/share/themes/default/css/chosen.css new_trunk/openstamanager/share/themes/default/css/style.css new_trunk/openstamanager/share/themes/default/img/chosen-sprite-2x.png new_trunk/openstamanager/share/themes/default/img/logo.pngAdded: new_trunk/openstamanager/controller.php===================================================================--- new_trunk/openstamanager/controller.php (rev 0)+++ new_trunk/openstamanager/controller.php2014-06-02 12:59:01 UTC (rev 921)@@ -0,0 +1,14 @@+<?php+include("core.php");+include($docroot."/config.php");+include($docroot."/lib/user_check.php");++$module = $html->form('module');++include($docroot."/include/top.php");++echo $module;++include($docroot."/include/bottom.php");+?>+ Property changes on: new_trunk/openstamanager/controller.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/core.php===================================================================--- new_trunk/openstamanager/core.php (rev 0)+++ new_trunk/openstamanager/core.php2014-06-02 12:59:01 UTC (rev 921)@@ -0,0 +1,75 @@+<?php+header("Content-Type: text/html; charset=UTF-8");+ob_start();+session_start();++$time = microtime();+$time = explode(' ', $time);+$time = $time[1] + $time[0];+$__start = $time;++ini_set("magic_quotes","Off");+ini_set("register_globals","Off");+ini_set( 'date.timezone', 'Europe/Rome' );+error_reporting( "E_ALL & ~E_NOTICE" );+++$script_filename = str_replace( "\\", "/", __FILE__ );//fix for Windows+$script_name = substr( $script_filename, strrpos($script_filename, "/")+1, 20 );+$docroot = preg_replace( "/\/$/", "", str_replace( "\\", "/", $_SERVER['DOCUMENT_ROOT'] ) );+$rootdir = str_replace( $script_name, "", $script_filename );+$rootdir = substr( str_replace( $docroot, "", $rootdir ), 0, -1 );+$docroot = $docroot.$rootdir;+++//short_open_tag deve essere a TRUE+if( ini_get("short_open_tag")==FALSE ){+echo "<center><span>Devi impostare la variabile <b>short_open_tag</b> del tuo <b>php.ini</b> a <big><b>On</b></big>.</span></center>\n";+exit;+}++include("config.inc.php");+++//Se manca il tema nel config carico quello di default+if( $theme_path=="" ){+$theme = "default";+$theme_path = $rootdir."/share/themes/".$theme;+}+++$lang = "it";+$jscript_modules = array();+$css_modules = array();+$infos = array();+$errors = array();++include($docroot."/lib/dbo.class.php");+include($docroot."/lib/functions.php");+include($docroot."/lib/htmlbuilder.php");+include($docroot."/lib/modulebuilder.php");+include($docroot."/lib/html-helpers.class.php");++$html = new HTMLHelper();++++array_push($css_modules, $theme_path."/css/bootstrap.min.css");+array_push($css_modules, $theme_path."/css/font-awesome.min.css");+array_push($css_modules, $theme_path."/css/AdminLTE.css");+array_push($css_modules, $theme_path."/css/jQueryUI/jquery-ui-1.10.3.custom.min.css");+array_push($css_modules, $theme_path."/css/chosen.css");+array_push($css_modules, $theme_path."/css/style.css");++array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/bootstrap.min.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/app.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery-ui-1.10.4.min.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery.ui.datepicker-".$lang.".js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/chosen.jquery.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/functions.js");+++$dbo = new Dbo();+$dbo->Connect();+?>Property changes on: new_trunk/openstamanager/core.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/include/bottom.php===================================================================--- new_trunk/openstamanager/include/bottom.php (rev 0)+++ new_trunk/openstamanager/include/bottom.php2014-06-02 12:59:01 UTC (rev 921)@@ -0,0 +1,27 @@+</div><!-- /.col -->+ + </div><!-- /.row --> + </section><!-- /.content -->+ </aside><!-- /.right-side -->+ </div><!-- ./wrapper -->+++<?php+$time = microtime();+$time = explode(' ', $time);+$time = $time[1] + $time[0];+$__finish = $time;+$total_time = round(($__finish - $__start), 4);+echo "<br/><br/><div class='text-center' style='color:#777;'><small>"._("Pagina generata in")." ".$total_time." "._("secondi")."</small></div><br/>\n";++if( isset($_SESSION['keep_alive']) ){+echo "<script>\n";+echo "setInterval( \"session_keep_alive()\", 5*60*1000 );\n";//5 minuti+echo "</script>\n";+}+?>+</body>+</html><?php+$dbo->close();+ob_end_flush();+?>Property changes on: new_trunk/openstamanager/include/bottom.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/include/top.php===================================================================--- new_trunk/openstamanager/include/top.php (rev 0)+++ new_trunk/openstamanager/include/top.php2014-06-02 12:59:01 UTC (rev 921)@@ -0,0 +1,209 @@+<?php+include_once("core.php");++//PARAMETRI PER PAGINAZIONE+$is_db_installed = $dbo->fetchNum( "DESCRIBE an_anagrafiche", 1 );+if( $is_db_installed ){+$rs = $dbo->fetchArray( "SELECT * FROM zz_impostazioni WHERE nome='Righe per pagina'" );+$rows_per_page = $rs[0]['valore'];+$page = $_GET['page'];+( isset( $_GET['page'] ) && is_numeric( $_GET['page'] ) && $_GET['page']>0 ) ? $start=$_GET['page']*$rows_per_page : $start=0;+++//Ordinamento moduli di primo livello+if( $_GET['op']=="sortmodules" ){+$ids = explode(",", $_GET['ids'] );+for($i=0; $i<sizeof($ids); $i++ ){+$dbo->query("UPDATE zz_modules SET `order`='$i' WHERE id='".$ids[$i]."'");+echo "UPDATE zz_modules SET `order`='$i' WHERE id='".$ids[$i]."'\n";+}+exit;+}+++$nome_modulo = get_module_name();+}++?><!DOCTYPE html>+<html class="bg-black">+ <head>+ <meta charset="UTF-8">+ <title><?php echo $module; ?> - OpenSTAManager</title>+ <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>+ <?php+loadCSSModules($css_modules);+loadJscriptModules($jscript_modules);+?>++<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->+ <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->+ <!--[if lt IE 9]>+ <script src="<?php echo $rootdir ?>/lib/jscripts/html5shiv.js"></script>+ <script src="<?php echo $rootdir ?>/lib/jscripts/respond.min.js"></script>+ <![endif]-->++<script>+globals = { rootdir: '<?php echo $rootdir ?>' };+</script>+ </head>+++<body class="skin-black">+<!-- header logo: style can be found in header.less -->+ <header class="header">+ <a href="../index.html" class="logo">+ <!-- Add the class icon to your logo image or logo icon to add the margining -->+ <?php echo _("OpenSTAManager") ?>+ </a>+ <!-- Header Navbar: style can be found in header.less -->+ <nav class="navbar navbar-static-top" role="navigation">+ <!-- Sidebar toggle button-->+ <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">+ <span class="sr-only"><?php echo _("Mostra/nascondi menu") ?></span>+ <span class="icon-bar"></span>+ <span class="icon-bar"></span>+ <span class="icon-bar"></span>+ </a>+ <div id="right-menu" class="pull-right">+ <a href="<?php echo $rootdir ?>/info.php" class="tip" title="<?php echo _("Informazioni") ?>"><i class="fa fa-2x fa-info-circle"></i></a>+ <a href="<?php echo $rootdir ?>/permissions.php" class="tip" title="<?php echo _("Gestione permessi") ?>"><i class="fa fa-2x fa-lock"></i></a>+ <a href="<?php echo $rootdir ?>/settings.php" class="tip" title="<?php echo _("Impostazioni") ?>"><i class="fa fa-2x fa-cog"></i></a>+ <a href="<?php echo $rootdir ?>/index.php?op=logout" class="tip" title="<?php echo _("Esci") ?>"><i class="fa fa-2x text-danger fa-power-off"></i></a>+ </div>+ </nav>+ </header>+ <div class="wrapper row-offcanvas row-offcanvas-left">+ <!-- Left side column. contains the logo and sidebar -->+ <aside class="left-side sidebar-offcanvas"> + <!-- sidebar: style can be found in sidebar.less -->+ <section class="sidebar">+ <!-- Sidebar user panel -->+ <div class="user-panel">+ <div class="pull-left image">+ <img src="<?php echo $theme_path ?>/img/logo.png" class="img-circle" alt="<?php echo _("Foto profilo") ?>" />+ </div>+ <div class="pull-left info">+ <p><?php echo $_SESSION['username'] ?></p>+ <a href="#"><i class="fa fa-circle text-success"></i> <?php echo _("online") ?></a>+ </div>+ <div class="clearfix"></div>++ <div class="text-center" id="datetime">...</div>+ </div>+ <!-- search form -->+ <form action="#" method="get" class="sidebar-form">+ <div class="input-group">+ <input type="text" name="q" class="form-control" placeholder="<?php echo _("Cerca") ?>..."/>+ <span class="input-group-btn">+ <button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>+ </span>+ </div>+ </form>+ <!-- /.search form -->+ <!-- sidebar menu: : style can be found in sidebar.less -->+ <ul class="sidebar-menu">+ <?php+//Se l'utente è is_admin mostro tutti i moduli, altrimenti solo quelli con accesso in r o rw+$q = "SELECT *, ( SELECT GROUP_CONCAT(name) FROM zz_modules GROUP BY parent HAVING parent=m1.id ) AS submodules FROM zz_modules m1 WHERE level='0' AND enabled='1' AND `type`='menu' ORDER BY `order` ASC";+$rs = $dbo->fetchArray($q);++if( sizeof($rs) > 0 ){+for( $i=0; $i<sizeof($rs); $i++){++//Se non sono admin, passo alla verifica dei permessi+if( !$_SESSION['is_admin'] ){++//Verifico che questo modulo sia r o rw o abbia almeno un sottomodulo in r o rw+$q2 = "SELECT permessi FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule='".$rs[$i]['id']."'";+$rs2 = $dbo->fetchArray($q2);++//Se non c'è il permesso di vedere il modulo di primo livello, verifico se ci sono dei moduli collegati nel secondo livello, quindi mostrerò anche il primo+if( sizeof($rs2)==0 || $rs2[0]['permessi']=='-' || $rs2[0]['permessi']=='r' ){+$q3 = "SELECT permessi FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule='".$rs[$i]['id']."' AND permessi IN ('rw', 'r')";+if( $dbo->fetchNum($q3) == 0 )+$show = false;+else+$show = true;+}+else+$show = true;+}++//Se sono admin e nono sono specificati permessi, proseguo. Altrimenti li tengo in considerazione+else{+$rsa = $dbo->fetchArray("SELECT permessi FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule='".$rs[$i]['id']."'");+if( sizeof($rsa)==0 )+$show = true;+else{+if( $rsa[0]['permessi']!='-' )+$show = true;+else+$show = false;+}+}+++if( $show ){+//Evidenzio il modulo principale anche se sono dentro ad un sottomodulo+$submodules = explode( ',', $rs[$i]['submodules'] );+( $module == $rs[$i]['name'] || (in_array($nome_modulo, $submodules) && $rs[$i]['submodules']!='') ) ? $class="active" : $class="";++( $rs[$i]['link']!="#" ) ? $link=$rootdir."/controller.php?module=".$rs[$i]['name'] : $link="#";++echo "<li class='treeview ".$class."'>\n";+echo "<a href=\"".$link."\">\n";+echo "<i class=\"".$rs[$i]['icon']."\"></i> <span>".$rs[$i]['name']."</span>\n";+}++++//Sottomenu livello 2+if( $_SESSION['is_admin'] ){+$q2 = "SELECT * FROM zz_modules WHERE level='1' AND enabled='1' AND parent='".$rs[$i]['id']."' AND `type`='menu' ORDER BY `order` ASC";+}++else{+$q2 = "SELECT * FROM zz_modules WHERE level='1' AND enabled='1' AND parent='".$rs[$i]['id']."' AND `type`='menu' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND (permessi IN('rw', 'r'))) ORDER BY `order` ASC";+}++$rs2 = $dbo->fetchArray($q2);++if( sizeof($rs2) > 0 ){+echo "<i class=\"fa fa-angle-left pull-right\"></i>\n";+echo "</a>\n";++echo "<ul class='treeview-menu'>\n";++for( $j=0; $j<sizeof($rs2); $j++ ){+( $rs2[$j]['module_dir']!='' ) ? $subdir=$rs2[$j]['module_dir']."/" : $subdir='';+( $module == $rs2[$j]['name'] ) ? $attr='class="active"' : $attr='';+echo "<li $attr><a href='".$rootdir."/controller.php?module=".$rs2[$j]['name']."'>".$rs2[$j]['name']."</a></li>\n";+}++echo "</ul>\n";+}++else{+echo "</a>\n";+}+++if( $show ){+echo "</li>\n";+}+}+}+?>+ </ul>+ </section>+ <!-- /.sidebar -->+ </aside>++ <!-- Right side column. Contains the navbar and content of the page -->+ <aside class="right-side"> + <!-- Main content -->+ <section class="content">+ <div class="row">+ <div class="col-md-9">+ + Property changes on: new_trunk/openstamanager/include/top.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/include/topmenu.php===================================================================--- new_trunk/openstamanager/include/topmenu.php (rev 0)+++ new_trunk/openstamanager/include/topmenu.php2014-06-02 12:59:01 UTC (rev 921)@@ -0,0 +1,137 @@+<!-- first bar -->+<div id="top">+<div>+<div style="float:left; margin-top:-4px;">+<input type="text" class="searchfld" id="supersearch" placeholder="Ricerca rapida..." />+</div>++<div style="float:left; left:220px; position:relative;" id="datetime"></div>+<? if( $_SESSION['username']!="" ){ ?>+<div style="float:right; margin-top:-2px;">+<p style="display:inline-block;position:relative; top:-8px;">Ciao, <? echo $_SESSION['username'] ?>!</p>+<a href="<? echo $rootdir ?>/info.php" class="tip" title="Info"><img src="<? echo $theme_path ?>/images/btn_info.png" alt="Info" border="0" /></a>+<?php if( $_SESSION['is_admin']==true ){ ?>+<a href="<? echo $rootdir ?>/permissions.php" class="tip" title="Utenti e permessi"><img src="<? echo $theme_path ?>/images/btn_permissions.png" alt="Utenti e permessi" border="0" /></a>+<a href="<? echo $rootdir ?>/settings.php" class="tip" title="Impostazioni"><img src="<? echo $theme_path ?>/images/btn_settings.png" alt="Impostazioni" border="0" /></a>+<?php } ?>+<a class="clickable tip" title="Esci dal programma" onclick="confirmAndLink( '','','Sei sicuro di voler uscire?','','<? echo $rootdir ?>/index.php?op=logout' );"><img src="<? echo $theme_path ?>/images/btn_logout.png" alt="Logout" border="0" /></a>+</div>+<? } ?>+</div>+</div>++<!-- PAGE -->+<div id="page">++<!--LOGO margin: 3px 10px 0px 40px; -->+<img src="<? echo $theme_path ?>/images/logo.png" alt="OpenSTAManager" border="0" id="logo" />++<!--TOOLBAR-->+<ul id="toolbar" >++<?php+//Se l'utente è is_admin mostro tutti i moduli, altrimenti solo quelli con accesso in r o rw+$q = "SELECT *, ( SELECT GROUP_CONCAT(name) FROM zz_modules GROUP BY parent HAVING parent=m1.id ) AS submodules FROM zz_modules m1 WHERE level='0' AND enabled='1' AND `type`='menu' ORDER BY `order` ASC";+$rs = $dbo->fetchArray($q);++if( sizeof($rs) > 0 ){+for( $i=0; $i<sizeof($rs); $i++){++//Se non sono admin, passo alla verifica dei permessi+if( !$_SESSION['is_admin'] ){++//Verifico che questo modulo sia r o rw o abbia almeno un sottomodulo in r o rw+$q2 = "SELECT permessi FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule='".$rs[$i]['id']."'";+$rs2 = $dbo->fetchArray($q2);++//Se non c'è il permesso di vedere il modulo di primo livello, verifico se ci sono dei moduli collegati nel secondo livello, quindi mostrerò anche il primo+if( sizeof($rs2)==0 || $rs2[0]['permessi']=='-' || $rs2[0]['permessi']=='r' ){+$q3 = "SELECT permessi FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule='".$rs[$i]['id']."' AND permessi IN ('rw', 'r')";+if( $dbo->fetchNum($q3) == 0 )+$show = false;+else+$show = true;+}+else+$show = true;+}++//Se sono admin e nono sono specificati permessi, proseguo. Altrimenti li tengo in considerazione+else{+$rsa = $dbo->fetchArray("SELECT permessi FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule='".$rs[$i]['id']."'");+if( sizeof($rsa)==0 )+$show = true;+else{+if( $rsa[0]['permessi']!='-' )+$show = true;+else+$show = false;+}+}+++if( $show ){+//Evidenzio il modulo principale anche se sono dentro ad un sottomodulo+$submodules = explode( ',', $rs[$i]['submodules'] );+( $nome_modulo == $rs[$i]['name'] || (in_array($nome_modulo, $submodules) && $rs[$i]['submodules']!='') ) ? $class = " class='module selected'" : $class=" class='module'";+echo "<li id=\"".$rs[$i]['id']."\" $class>\n";++//Se non si deve linkare il menu metto l'ancora+( $rs[$i]['link']!="#" ) ? $link=$rootdir."/modules/".$rs[$i]['module_dir']."/".$rs[$i]['link'] : $link="#";+echo "<a href=\"".$link."\"><img src=\"".$theme_path."/images/".$rs[$i]['icon']."\" alt=\"".$rs[$i]['name']."\" border=\"0\" /><br/>".$rs[$i]['name']."</a>\n";+}++++//Sottomenu livello 2+if( $_SESSION['is_admin'] )+$q2 = "SELECT * FROM zz_modules WHERE level='1' AND enabled='1' AND parent='".$rs[$i]['id']."' AND `type`='menu' ORDER BY `order` ASC";+else+$q2 = "SELECT * FROM zz_modules WHERE level='1' AND enabled='1' AND parent='".$rs[$i]['id']."' AND `type`='menu' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND (permessi IN('rw', 'r'))) ORDER BY `order` ASC";+$rs2 = $dbo->fetchArray($q2);+if( sizeof($rs2) > 0 ){+echo "<ul>\n";+for( $j=0; $j<sizeof($rs2); $j++ ){+( $rs2[$j]['module_dir']!='' ) ? $subdir=$rs2[$j]['module_dir']."/" : $subdir='';+( $nome_modulo == $rs2[$j]['name'] ) ? $attr='class="selected"' : $attr='';+echo "<li $attr><a href='".$rootdir."/modules/".$rs[$i]['module_dir']."/".$subdir.$rs2[$j]['link']."'>".$rs2[$j]['name']."</a></li>\n";+}+echo "</ul>\n";+}++if( $show )+echo "</li>\n";++}+}+?>+</ul>+<div style="clear:both;"></div>+++<?php+include_once($docroot."/lib/permissions_check.php");+?>+++<?php if( $permessi[$nome_modulo]=='r' ){ ?>+<!-- Disabilito i campi di input se l'utente ha i permessi in sola lettura -->+<script type="text/javascript">+$(document).ready( function(){+$('input, select, textarea').not('.searchfld').each( function(){+if( $(this).is('input[type=text], input[type=password]') || $(this).is('textarea') ){+$(this).replaceWith('<span>'+$(this).val().replace("\n", "<br/>")+'</span>');+}+else if( $(this).is('select') ){+$(this).replaceWith('<span>'+$(this).find('option:selected').text()+'</span>');+}+});++$('input[type=button], input[type=submit], .only_rw').not('.searchfld').hide();+$('input[type=checkbox]').not('.searchfld').show().attr('disabled', 'true');+});+</script>+<?php } ?>++<!-- TITOLO MODULO -->+<div class="center"><h3><? echo $nome_modulo ?></h3></div>Property changes on: new_trunk/openstamanager/include/topmenu.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyModified: new_trunk/openstamanager/index.php===================================================================--- new_trunk/openstamanager/index.php2014-06-02 12:33:00 UTC (rev 920)+++ new_trunk/openstamanager/index.php2014-06-02 12:59:01 UTC (rev 921)@@ -1,63 +1,180 @@-<!DOCTYPE html>+<?php+include("core.php");+include($docroot."/config.php");++$username = save($_POST['username']);+$password = save($_POST['password']);+$op = $_GET['op'];+++//Redirect al primo modulo su cui l'utente ha accesso se l'utente è già loggato+if( isset($_SESSION['idutente']) ){+if( $_SESSION['is_admin'] )+$q = "SELECT name, module_dir, link FROM zz_modules WHERE level='0' ORDER BY `order` ASC";+else+$q = "SELECT name, module_dir, link FROM zz_modules WHERE level='0' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT id FROM zz_gruppi WHERE nome='".$rs[0]['gruppo']."') AND permessi IN ('r', 'rw') ) ORDER BY `order` ASC";++$rs = $dbo->fetchArray($q);++if( sizeof($rs) <= 0 && !$_SESSION['is_admin'] ){+if ($op!='logout')+array_push( $errors, _("L'utente non ha nessun permesso impostato!") );+else+array_push( $infos, _("Arrivederci!") );+}++else if( $rs[0]['link']!='#' ){+redirect( $rootdir."/controller.php?module=".$rs[0]['name'], "js" );+}++else{+redirect( $rootdir."/controller.php?module=dashboard", "js" );+}+}+++++//LOGIN+switch ( $op ){+case 'login':+$query = "SELECT *, (SELECT nome FROM zz_gruppi WHERE id=idgruppo) AS gruppo FROM zz_utenti WHERE username=\"$username\" AND password=MD5(\"".$password."\")";+$rs = $dbo->fetchArray( $query );++if( sizeof($rs) <= 0 ){+array_push( $errors, _("Autenticazione fallita!") );+}++else if( $rs[0]['enabled']==0 ){+array_push( $errors, _("Utente non abilitato!") );+}++else{+if( $_POST['keep_alive']=='on' ){+$_SESSION['keep_alive'] = true;+}++$_SESSION['idutente'] = $rs[0]['idutente'];+$_SESSION['username'] = $rs[0]['username'];+$_SESSION['gruppo'] = $rs[0]['gruppo'];++if( $rs[0]['gruppo']=='Amministratori' ){+$_SESSION['is_admin'] = true;+}++else{+$_SESSION['is_admin'] = false;+}++//Redirect al primo modulo su cui l'utente ha accesso+if( $_SESSION['is_admin'] ){+$q = "SELECT name, module_dir, link FROM zz_modules WHERE level='0' ORDER BY `order` ASC";+}++else{+$q = "SELECT name, module_dir, link FROM zz_modules WHERE level='0' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT id FROM zz_gruppi WHERE nome='".$rs[0]['gruppo']."') AND permessi IN ('r', 'rw') ) ORDER BY `order` ASC";+}++$rs = $dbo->fetchArray($q);++if( sizeof($rs) <= 0 && !$_SESSION['is_admin'] ){+array_push( $errors, _("L'utente non ha nessun permesso impostato!") );+}++else if( $rs[0]['link'] != '#' ){+redirect( $rootdir."/controller.php?module=".$rs[0]['name'], "js" );+}++else{+redirect( $rootdir."/controller.php?module=dashboard", "js" );+}+}+break;++case 'logout':+unset( $_SESSION['keep_alive'] );+unset( $_SESSION['idutente'] );+unset( $_SESSION['username'] );+unset( $_SESSION['is_admin'] );++unset( $_SESSION['agente_per_cui_sto_lavorando'] );+unset( $_SESSION['op_session'] );+unset( $_SESSION['v_idagente'] );+unset( $_SESSION['v_idtipoattivita'] );++break;+}+?><!DOCTYPE html> <html class="bg-black"> <head> <meta charset="UTF-8">- <title>AdminLTE | Log in</title>+ <title>OpenSTAManager Login</title> <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> <!-- bootstrap 3.0.2 -->- <link href="../../css/bootstrap.min.css" rel="stylesheet" type="text/css" />+ <link href="<?php echo $theme_path ?>/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <!-- font Awesome -->- <link href="../../css/font-awesome.min.css" rel="stylesheet" type="text/css" />+ <link href="<?php echo $theme_path ?>/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> <!-- Theme style -->- <link href="../../css/AdminLTE.css" rel="stylesheet" type="text/css" />+ <link href="<?php echo $theme_path ?>/css/AdminLTE.css" rel="stylesheet" type="text/css" />+ + <link href="<?php echo $theme_path ?>/css/style.css" rel="stylesheet" type="text/css" /> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]>- <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>- <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>+ <script src="<?php echo $rootdir ?>/lib/jscripts/html5shiv.js"></script>+ <script src="<?php echo $rootdir ?>/lib/jscripts/respond.min.js"></script> <![endif]-->+ + <!-- jQuery 2.0.2 -->+ <script src="<?php echo $rootdir ?>/lib/jscripts/jquery/jquery.js"></script>+ <!-- Bootstrap -->+ <script src="<?php echo $rootdir ?>/lib/jscripts/bootstrap.min.js"></script> </head>+ + <body class="bg-black">+ <br>+ <?php+ include($docroot."/update/update_checker.php"); + ?> <div class="form-box" id="login-box">- <div class="header">Sign In</div>- <form action="../../index.html" method="post">+ <div class="header"><img src="<?php echo $theme_path ?>/img/logo.png" alt="OSM Logo"> OpenSTAManager</div>+ + ++ <form action="?op=login" method="post"> <div class="body bg-gray">- <div class="form-group">- <input type="text" name="userid" class="form-control" placeholder="User ID"/>+ <div class="form-group input-group">+ <span class="input-group-addon"><i class="fa fa-user"></i> </span>+ <input type="text" name="username" class="form-control" placeholder="<?php echo _("Nome utente") ?>"/> </div>- <div class="form-group">- <input type="password" name="password" class="form-control" placeholder="Password"/>+ <div class="form-group input-group">+ <span class="input-group-addon"><i class="fa fa-lock"></i> </span>+ <input type="password" name="password" class="form-control" placeholder="<?php echo _("Password") ?>"/> </div> <div class="form-group">- <input type="checkbox" name="remember_me"/> Remember me+ <input type="checkbox" name="remember_me"/> <?php echo _("Mantieni attiva la sessione") ?> </div> </div>- <div class="footer"> - <button type="submit" class="btn bg-olive btn-block">Sign me in</button> - - <p><a href="#">I forgot my password</a></p>- - <a href="register.html" class="text-center">Register a new membership</a>+ <div class="footer"> + <button type="submit" class="btn btn-warning btn-block"><?php echo _("Accedi") ?></button> + <br>+ <?php+ show_messages( $ok, 'alert-success' );+show_messages( $warning, 'alert-warning' );+show_messages( $errors, 'alert-danger' );+?> </div> </form>-- <div class="margin text-center">- <span>Sign in using social networks</span>- <br/>- <button class="btn bg-light-blue btn-circle"><i class="fa fa-facebook"></i></button>- <button class="btn bg-aqua btn-circle"><i class="fa fa-twitter"></i></button>- <button class="btn bg-red btn-circle"><i class="fa fa-google-plus"></i></button>-- </div> </div>+ + <script type="text/javascript">+$(document).ready( function(){+$('input[name=username]').focus();+});+</script> -- <!-- jQuery 2.0.2 -->- <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>- <!-- Bootstrap -->- <script src="../../js/bootstrap.min.js" type="text/javascript"></script> - </body>-</html>\ No newline at end of file+</html>Modified: new_trunk/openstamanager/lib/functions.php===================================================================--- new_trunk/openstamanager/lib/functions.php2014-06-02 12:33:00 UTC (rev 920)+++ new_trunk/openstamanager/lib/functions.php2014-06-02 12:59:01 UTC (rev 921)@@ -54,30 +54,8 @@ -/*-It shows an error in a red div with specified WIDTH-*/-function write_error($text,$width=200){-if( $text != '' )-echo "<div class=\"error\">$text</div>\n";-return true;-} -- /*-It print text whenever an operation is executed successfully-*/-function write_ok($text,$width=200){-if( $text != '' ){-echo "<div class=\"ok\">$text</div>\n";-}-return true;-}----/* Taglia un testo ($str) al numero di caratteri stabilito ($length), fermandosi però al primo spazio successivo per non troncare una parola se specificato $at_next_space=1 */@@ -559,27 +537,19 @@ } -//Mostra tutti i messaggi informativi nell'array-function show_info_messages( $infos ){-if( sizeof($infos)>0 ){--foreach( $infos as $info ){-echo "<div>\n";-write_ok( $info, "400px" );-echo "\n</div>\n";+//Mostra tutti i messaggi nell'array+function show_messages( $array, $class ){+if( sizeof($array)>0 ){+foreach( $array as $v ){+$text = $v;+if( $class == 'alert-success' ){ $text="<i class='fa fa-check'></i> ".$text; }+if( $class == 'alert-warning' ){ $text="<i class='fa fa-warning'></i> ".$text; }+if( $class == 'alert-danger' ){ $text="<i class='fa fa-exclamation-circle'></i> ".$text; }++echo "<div class='alert ".$class."'>".$text."</div>\n"; } } }--//Mostra tutti i messaggi di errore nell'array-function show_error_messages( $errors ){-if( sizeof($errors)>0 ){-foreach( $errors as $error )-echo "<div>\n";-write_error( $error, "400px" );-echo "\n</div>\n";-}-} Added: new_trunk/openstamanager/lib/html-helpers.class.php===================================================================--- new_trunk/openstamanager/lib/html-helpers.class.php (rev 0)+++ new_trunk/openstamanager/lib/html-helpers.class.php2014-06-02 12:59:01 UTC (rev 921)@@ -0,0 +1,37 @@+<?php++class HTMLHelper{+/**+ * Function to read parameter from GET or POST request, escape it and filter it by its rules:+ * stringevery string+ * intinteger value+ * decimaldecimal value (force conversion of commas into points: 0,01 become 0.01)+ */+public function form( $param, $method='get', $escape=true, $rule='text' ){+//method+if( $method == 'get' )+$value = $_GET[$param];+else+$value = $_POST[$param];+++//Rules filter+if( $rule=='int' ){+$value = intval( $value );+}++else if( $rule=='decimal' ){+$value = str_replace( ",", ".", $value );+$value = float( $value );+}+++//escape+if( $escape )+$value = mysql_escape_string( $value );++return $value;+}+}++?>Property changes on: new_trunk/openstamanager/lib/html-helpers.class.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/lib/jscripts/app.js===================================================================--- new_trunk/openstamanager/lib/jscripts/app.js (rev 0)+++ new_trunk/openstamanager/lib/jscripts/app.js2014-06-02 12:59:01 UTC (rev 921)@@ -0,0 +1,1057 @@+/*!+ * Author: Abdullah A Almsaeed+ * Date: 4 Jan 2014+ * Description:+ * This file should be included in all pages+ !**/++/*+ * Global variables. If you change any of these vars, don't forget + * to change the values in the less files!+ */+var left_side_width = 220; //Sidebar width in pixels++$(function() {+ "use strict";++ //Enable sidebar toggle+ $("[data-toggle='offcanvas']").click(function(e) {+ e.preventDefault();++ //If window is small enough, enable sidebar push menu+ if ($(window).width() <= 992) {+ $('.row-offcanvas').toggleClass('active');+ $('.left-side').removeClass("collapse-left");+ $(".right-side").removeClass("strech");+ $('.row-offcanvas').toggleClass("relative");+ } else {+ //Else, enable content streching+ $('.left-side').toggleClass("collapse-left");+ $(".right-side").toggleClass("strech");+ }+ });++ //Add hover support for touch devices+ $('.btn').bind('touchstart', function() {+ $(this).addClass('hover');+ }).bind('touchend', function() {+ $(this).removeClass('hover');+ });++ //Activate tooltips+ $("[data-toggle='tooltip']").tooltip();++ /* + * Add collapse and remove events to boxes+ */+ $("[data-widget='collapse']").click(function() {+ //Find the box parent + var box = $(this).parents(".box").first();+ //Find the body and the footer+ var bf = box.find(".box-body, .box-footer");+ if (!box.hasClass("collapsed-box")) {+ box.addClass("collapsed-box");+ bf.slideUp();+ } else {+ box.removeClass("collapsed-box");+ bf.slideDown();+ }+ });++ /*+ * ADD SLIMSCROLL TO THE TOP NAV DROPDOWNS+ * ---------------------------------------+ */+ $(".navbar .menu").slimscroll({+ height: "200px",+ alwaysVisible: false,+ size: "3px"+ }).css("width", "100%");++ /*+ * INITIALIZE BUTTON TOGGLE+ * ------------------------+ */+ $('.btn-group[data-toggle="btn-toggle"]').each(function() {+ var group = $(this);+ $(this).find(".btn").click(function(e) {+ group.find(".btn.active").removeClass("active");+ $(this).addClass("active");+ e.preventDefault();+ });++ });++ $("[data-widget='remove']").click(function() {+ //Find the box parent + var box = $(this).parents(".box").first();+ box.slideUp();+ });++ /* Sidebar tree view */+ $(".sidebar .treeview").tree();++ /* + * Make sure that the sidebar is streched full height+ * ---------------------------------------------+ * We are gonna assign a min-height value every time the+ * wrapper gets resized and upon page load. We will use+ * Ben Alman's method for detecting the resize event.+ * + **/+ function _fix() {+ //Get window height and the wrapper height+ var height = $(window).height() - $("body > .header").height();+ $(".wrapper").css("min-height", height + "px");+ var content = $(".wrapper").height();+ //If the wrapper height is greater than the window+ if (content > height)+ //then set sidebar height to the wrapper+ $(".left-side, html, body").css("min-height", content + "px");+ else {+ //Otherwise, set the sidebar to the height of the window+ $(".left-side, html, body").css("min-height", height + "px");+ }+ }+ //Fire upon load+ _fix();+ //Fire when wrapper is resized+ $(".wrapper").resize(function() {+ _fix();+ fix_sidebar();+ });++ //Fix the fixed layout sidebar scroll bug+ fix_sidebar();++ /*+ * We are gonna initialize all checkbox and radio inputs to + * iCheck plugin in.+ * You can find the documentation at http://fronteed.com/iCheck/+ */+ $("input[type='checkbox'], input[type='radio']").iCheck({+ checkboxClass: 'icheckbox_minimal',+ radioClass: 'iradio_minimal'+ });++});+function fix_sidebar() {+ //Make sure the body tag has the .fixed class+ if (!$("body").hasClass("fixed")) {+ return;+ }++ //Add slimscroll+ $(".sidebar").slimscroll({+ height: ($(window).height() - $(".header").height()) + "px",+ color: "rgba(0,0,0,0.2)"+ });+}+function change_layout() {+ $("body").toggleClass("fixed");+ fix_sidebar();+}+function change_skin(cls) {+ $("body").removeClass("skin-blue skin-black");+ $("body").addClass(cls);+}+/*END DEMO*/+$(window).load(function() {+ /*! pace 0.4.17 */+ (function() {+ var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V = [].slice, W = {}.hasOwnProperty, X = function(a, b) {+ function c() {+ this.constructor = a+ }+ for (var d in b)+ W.call(b, d) && (a[d] = b[d]);+ return c.prototype = b.prototype, a.prototype = new c, a.__super__ = b.prototype, a+ }, Y = [].indexOf || function(a) {+ for (var b = 0, c = this.length; c > b; b++)+ if (b in this && this[b] === a)+ return b;+ return-1+ };+ for (t = {catchupTime:500, initialRate:.03, minTime:500, ghostTime:500, maxProgressPerFrame:10, easeFactor:1.25, startOnPageLoad:!0, restartOnPushState:!0, restartOnRequestAfter:500, target:"body", elements:{checkInterval:100, selectors:["body"]}, eventLag:{minSamples:10, sampleCount:3, lagThreshold:3}, ajax:{trackMethods:["GET"], trackWebSockets:!1}}, B = function() {+ var a;+ return null != (a = "undefined" != typeof performance && null !== performance ? "function" == typeof performance.now ? performance.now() : void 0 : void 0) ? a : +new Date+ }, D = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame, s = window.cancelAnimationFrame || window.mozCancelAnimationFrame, null == D && (D = function(a) {+ return setTimeout(a, 50)+ }, s = function(a) {+ return clearTimeout(a)+ }), F = function(a) {+ var b, c;+ return b = B(), (c = function() {+ var d;+ return d = B() - b, d >= 33 ? (b = B(), a(d, function() {+ return D(c)+ })) : setTimeout(c, 33 - d)+ })()+ }, E = function() {+ var a, b, c;+ return c = arguments[0], b = arguments[1], a = 3 <= arguments.length ? V.call(arguments, 2) : [], "function" == typeof c[b] ? c[b].apply(c, a) : c[b]+ }, u = function() {+ var a, b, c, d, e, f, g;+ for (b = arguments[0], d = 2 <= arguments.length?V.call(arguments, 1):[], f = 0, g = d.length; g > f; f++)+ if (c = d[f])+ for (a in c)+ W.call(c, a) && (e = c[a], null != b[a] && "object" == typeof b[a] && null != e && "object" == typeof e ? u(b[a], e) : b[a] = e);+ return b+ }, p = function(a) {+ var b, c, d, e, f;+ for (c = b = 0, e = 0, f = a.length; f > e; e++)+ d = a[e], c += Math.abs(d), b++;+ return c / b+ }, w = function(a, b) {+ var c, d, e;+ if (null == a && (a = "options"), null == b && (b = !0), e = document.querySelector("[data-pace-" + a + "]")) {+ if (c = e.getAttribute("data-pace-" + a), !b)+ return c;+ try {+ return JSON.parse(c)+ } catch (f) {+ return d = f, "undefined" != typeof console && null !== console ? console.error("Error parsing inline pace options", d) : void 0+ }+ }+ }, g = function() {+ function a() {+ }+ return a.prototype.on = function(a, b, c, d) {+ var e;+ return null == d && (d = !1), null == this.bindings && (this.bindings = {}), null == (e = this.bindings)[a] && (e[a] = []), this.bindings[a].push({handler: b, ctx: c, once: d})+ }, a.prototype.once = function(a, b, c) {+ return this.on(a, b, c, !0)+ }, a.prototype.off = function(a, b) {+ var c, d, e;+ if (null != (null != (d = this.bindings) ? d[a] : void 0)) {+ if (null == b)+ return delete this.bindings[a];+ for (c = 0, e = []; c < this.bindings[a].length; )+ this.bindings[a][c].handler === b ? e.push(this.bindings[a].splice(c, 1)) : e.push(c++);+ return e+ }+ }, a.prototype.trigger = function() {+ var a, b, c, d, e, f, g, h, i;+ if (c = arguments[0], a = 2 <= arguments.length ? V.call(arguments, 1) : [], null != (g = this.bindings) ? g[c] : void 0) {+ for (e = 0, i = []; e < this.bindings[c].length; )+ h = this.bindings[c][e], d = h.handler, b = h.ctx, f = h.once, d.apply(null != b ? b : this, a), f ? i.push(this.bindings[c].splice(e, 1)) : i.push(e++);+ return i+ }+ }, a+ }(), null == window.Pace && (window.Pace = {}), u(Pace, g.prototype), C = Pace.options = u({}, t, window.paceOptions, w()), S = ["ajax", "document", "eventLag", "elements"], O = 0, Q = S.length; Q > O; O++)+ I = S[O], C[I] === !0 && (C[I] = t[I]);+ i = function(a) {+ function b() {+ return T = b.__super__.constructor.apply(this, arguments)+ }+ return X(b, a), b+ }(Error), b = function() {+ function a() {+ this.progress = 0+ }+ return a.prototype.getElement = function() {+ var a;+ if (null == this.el) {+ if (a = document.querySelector(C.target), !a)+ throw new i;+ this.el = document.createElement("div"), this.el.className = "pace pace-active", document.body.className = document.body.className.replace("pace-done", ""), document.body.className += " pace-running", this.el.innerHTML = '<div class="pace-progress">\n <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>', null != a.firstChild ? a.insertBefore(this.el, a.firstChild) : a.appendChild(this.el)+ }+ return this.el+ }, a.prototype.finish = function() {+ var a;+ return a = this.getElement(), a.className = a.className.replace("pace-active", ""), a.className += " pace-inactive", document.body.className = document.body.className.replace("pace-running", ""), document.body.className += " pace-done"+ }, a.prototype.update = function(a) {+ return this.progress = a, this.render()+ }, a.prototype.destroy = function() {+ try {+ this.getElement().parentNode.removeChild(this.getElement())+ } catch (a) {+ i = a+ }+ return this.el = void 0+ }, a.prototype.render = function() {+ var a, b;+ return null == document.querySelector(C.target) ? !1 : (a = this.getElement(), a.children[0].style.width = "" + this.progress + "%", (!this.lastRenderedProgress || this.lastRenderedProgress | 0 !== this.progress | 0) && (a.children[0].setAttribute("data-progress-text", "" + (0 | this.progress) + "%"), this.progress >= 100 ? b = "99" : (b = this.progress < 10 ? "0" : "", b += 0 | this.progress), a.children[0].setAttribute("data-progress", "" + b)), this.lastRenderedProgress = this.progress)+ }, a.prototype.done = function() {+ return this.progress >= 100+ }, a+ }(), h = function() {+ function a() {+ this.bindings = {}+ }+ return a.prototype.trigger = function(a, b) {+ var c, d, e, f, g;+ if (null != this.bindings[a]) {+ for (f = this.bindings[a], g = [], d = 0, e = f.length; e > d; d++)+ c = f[d], g.push(c.call(this, b));+ return g+ }+ }, a.prototype.on = function(a, b) {+ var c;+ return null == (c = this.bindings)[a] && (c[a] = []), this.bindings[a].push(b)+ }, a+ }(), N = window.XMLHttpRequest, M = window.XDomainRequest, L = window.WebSocket, v = function(a, b) {+ var c, d, e, f;+ f = [];+ for (d in b.prototype)+ try {+ e = b.prototype[d], null == a[d] && "function" != typeof e ? f.push(a[d] = e) : f.push(void 0)+ } catch (g) {+ c = g+ }+ return f+ }, z = [], Pace.ignore = function() {+ var a, b, c;+ return b = arguments[0], a = 2 <= arguments.length ? V.call(arguments, 1) : [], z.unshift("ignore"), c = b.apply(null, a), z.shift(), c+ }, Pace.track = function() {+ var a, b, c;+ return b = arguments[0], a = 2 <= arguments.length ? V.call(arguments, 1) : [], z.unshift("track"), c = b.apply(null, a), z.shift(), c+ }, H = function(a) {+ var b;+ if (null == a && (a = "GET"), "track" === z[0])+ return"force";+ if (!z.length && C.ajax) {+ if ("socket" === a && C.ajax.trackWebSockets)+ return!0;+ if (b = a.toUpperCase(), Y.call(C.ajax.trackMethods, b) >= 0)+ return!0+ }+ return!1+ }, j = function(a) {+ function b() {+ var a, c = this;+ b.__super__.constructor.apply(this, arguments), a = function(a) {+ var b;+ return b = a.open, a.open = function(d, e) {+ return H(d) && c.trigger("request", {type: d, url: e, request: a}), b.apply(a, arguments)+ }+ }, window.XMLHttpRequest = function(b) {+ var c;+ return c = new N(b), a(c), c+ }, v(window.XMLHttpRequest, N), null != M && (window.XDomainRequest = function() {+ var b;+ return b = new M, a(b), b+ }, v(window.XDomainRequest, M)), null != L && C.ajax.trackWebSockets && (window.WebSocket = function(a, b) {+ var d;+ return d = new L(a, b), H("socket") && c.trigger("request", {type: "socket", url: a, protocols: b, request: d}), d+ }, v(window.WebSocket, L))+ }+ return X(b, a), b+ }(h), P = null, x = function() {+ return null == P && (P = new j), P+ }, x().on("request", function(b) {+ var c, d, e, f;+ return f = b.type, e = b.request, Pace.running || C.restartOnRequestAfter === !1 && "force" !== H(f) ? void 0 : (d = arguments, c = C.restartOnRequestAfter || 0, "boolean" == typeof c && (c = 0), setTimeout(function() {+ var b, c, g, h, i, j;+ if (b = "socket" === f ? e.readyState < 2 : 0 < (h = e.readyState) && 4 > h) {+ for (Pace.restart(), i = Pace.sources, j = [], c = 0, g = i.length; g > c; c++) {+ if (I = i[c], I instanceof a) {+ I.watch.apply(I, d);+ break+ }+ j.push(void 0)+ }+ return j+ }+ }, c))+ }), a = function() {+ function a() {+ var a = this;+ this.elements = [], x().on("request", function() {+ return a.watch.apply(a, arguments)+ })+ }+ return a.prototype.watch = function(a) {+ var b, c, d;+ return d = a.type, b = a.request, c = "socket" === d ? new m(b) : new n(b), this.elements.push(c)+ }, a+ }(), n = function() {+ function a(a) {+ var b, c, d, e, f, g, h = this;+ if (this.progress = 0, null != window.ProgressEvent)+ for (c = null, a.addEventListener("progress", function(a) {+ return h.progress = a.lengthComputable ? 100 * a.loaded / a.total : h.progress + (100 - h.progress) / 2+ }), g = ["load", "abort", "timeout", "error"], d = 0, e = g.length; e > d; d++)+ b = g[d], a.addEventListener(b, function() {+ return h.progress = 100+ });+ else+ f = a.onreadystatechange, a.onreadystatechange = function() {+ var b;+ return 0 === (b = a.readyState) || 4 === b ? h.progress = 100 : 3 === a.readyState && (h.progress = 50), "function" == typeof f ? f.apply(null, arguments) : void 0+ }+ }+ return a+ }(), m = function() {+ function a(a) {+ var b, c, d, e, f = this;+ for (this.progress = 0, e = ["error", "open"], c = 0, d = e.length; d > c; c++)+ b = e[c], a.addEventListener(b, function() {+ return f.progress = 100+ })+ }+ return a+ }(), d = function() {+ function a(a) {+ var b, c, d, f;+ for (null == a && (a = {}), this.elements = [], null == a.selectors && (a.selectors = []), f = a.selectors, c = 0, d = f.length; d > c; c++)+ b = f[c], this.elements.push(new e(b))+ }+ return a+ }(), e = function() {+ function a(a) {+ this.selector = a, this.progress = 0, this.check()+ }+ return a.prototype.check = function() {+ var a = this;+ return document.querySelector(this.selector) ? this.done() : setTimeout(function() {+ return a.check()+ }, C.elements.checkInterval)+ }, a.prototype.done = function() {+ return this.progress = 100+ }, a+ }(), c = function() {+ function a() {+ var a, b, c = this;+ this.progress = null != (b = this.states[document.readyState]) ? b : 100, a = document.onreadystatechange, document.onreadystatechange = function() {+ return null != c.states[document.readyState] && (c.progress = c.states[document.readyState]), "function" == typeof a ? a.apply(null, arguments) : void 0+ }+ }+ return a.prototype.states = {loading: 0, interactive: 50, complete: 100}, a+ }(), f = function() {+ function a() {+ var a, b, c, d, e, f = this;+ this.progress = 0, a = 0, e = [], d = 0, c = B(), b = setInterval(function() {+ var g;+ return g = B() - c - 50, c = B(), e.push(g), e.length > C.eventLag.sampleCount && e.shift(), a = p(e), ++d >= C.eventLag.minSamples && a < C.eventLag.lagThreshold ? (f.progress = 100, clearInterval(b)) : f.progress = 100 * (3 / (a + 3))+ }, 50)+ }+ return a+ }(), l = function() {+ function a(a) {+ this.source = a, this.last = this.sinceLastUpdate = 0, this.rate = C.initialRate, this.catchup = 0, this.progress = this.lastProgress = 0, null != this.source && (this.progress = E(this.source, "progress"))+ }+ return a.prototype.tick = function(a, b) {+ var c;+ return null == b && (b = E(this.source, "progress")), b >= 100 && (this.done = !0), b === this.last ? this.sinceLastUpdate += a : (this.sinceLastUpdate && (this.rate = (b - this.last) / this.sinceLastUpdate), this.catchup = (b - this.progress) / C.catchupTime, this.sinceLastUpdate = 0, this.last = b), b > this.progress && (this.progress += this.catchup * a), c = 1 - Math.pow(this.progress / 100, C.easeFactor), this.progress += c * this.rate * a, this.progress = Math.min(this.lastProgress + C.maxProgressPerFrame, this.progress), this.progress = Math.max(0, this.progress), this.progress = Math.min(100, this.progress), this.lastProgress = this.progress, this.progress+ }, a+ }(), J = null, G = null, q = null, K = null, o = null, r = null, Pace.running = !1, y = function() {+ return C.restartOnPushState ? Pace.restart() : void 0+ }, null != window.history.pushState && (R = window.history.pushState, window.history.pushState = function() {+ return y(), R.apply(window.history, arguments)+ }), null != window.history.replaceState && (U = window.history.replaceState, window.history.replaceState = function() {+ return y(), U.apply(window.history, arguments)+ }), k = {ajax: a, elements: d, document: c, eventLag: f}, (A = function() {+ var a, c, d, e, f, g, h, i;+ for (Pace.sources = J = [], g = ["ajax", "elements", "document", "eventLag"], c = 0, e = g.length; e > c; c++)+ a = g[c], C[a] !== !1 && J.push(new k[a](C[a]));+ for (i = null != (h = C.extraSources)?h:[], d = 0, f = i.length; f > d; d++)+ I = i[d], J.push(new I(C));+ return Pace.bar = q = new b, G = [], K = new l+ })(), Pace.stop = function() {+ return Pace.trigger("stop"), Pace.running = !1, q.destroy(), r = !0, null != o && ("function" == typeof s && s(o), o = null), A()+ }, Pace.restart = function() {+ return Pace.trigger("restart"), Pace.stop(), Pace.start()+ }, Pace.go = function() {+ return Pace.running = !0, q.render(), r = !1, o = F(function(a, b) {+ var c, d, e, f, g, h, i, j, k, m, n, o, p, s, t, u, v;+ for (j = 100 - q.progress, d = o = 0, e = !0, h = p = 0, t = J.length; t > p; h = ++p)+ for (I = J[h], m = null != G[h]?G[h]:G[h] = [], g = null != (v = I.elements)?v:[I], i = s = 0, u = g.length; u > s; i = ++s)+ f = g[i], k = null != m[i] ? m[i] : m[i] = new l(f), e &= k.done, k.done || (d++, o += k.tick(a));+ return c = o / d, q.update(K.tick(a, c)), n = B(), q.done() || e || r ? (q.update(100), Pace.trigger("done"), setTimeout(function() {+ return q.finish(), Pace.running = !1, Pace.trigger("hide")+ }, Math.max(C.ghostTime, Math.min(C.minTime, B() - n)))) : b()+ })+ }, Pace.start = function(a) {+ u(C, a), Pace.running = !0;+ try {+ q.render()+ } catch (b) {+ i = b+ }+ return document.querySelector(".pace") ? (Pace.trigger("start"), Pace.go()) : setTimeout(Pace.start, 50)+ }, "function" == typeof define && define.amd ? define('theme-app', [], function() {+ return Pace+ }) : "object" == typeof exports ? module.exports = Pace : C.startOnPageL... [truncated message content]

[osm-devel] SF.net SVN: openstamanager:[922]new_trunk/openstamanager

From: <lo...@us...> - 2014-06-02 13:23:51

Revision: 922 http://sourceforge.net/p/openstamanager/code/922Author: loviuzDate: 2014-06-02 13:23:42 +0000 (Mon, 02 Jun 2014)Log Message:-----------[core] - aggiunta altre 2 directory per OSM2Added Paths:----------- new_trunk/openstamanager/templates/ new_trunk/openstamanager/templates/contratti/ new_trunk/openstamanager/templates/contratti/contratto.html new_trunk/openstamanager/templates/contratti/contratto_body.html new_trunk/openstamanager/templates/contratti/logo_azienda.jpg new_trunk/openstamanager/templates/contratti/pdfgen.contratti.php new_trunk/openstamanager/templates/contratti_cons/ new_trunk/openstamanager/templates/contratti_cons/contratto.html new_trunk/openstamanager/templates/contratti_cons/contratto_body.html new_trunk/openstamanager/templates/contratti_cons/logo_azienda.jpg new_trunk/openstamanager/templates/contratti_cons/pdfgen.contratti_cons.php new_trunk/openstamanager/templates/ddt/ new_trunk/openstamanager/templates/ddt/ddt.html new_trunk/openstamanager/templates/ddt/ddt_body.html new_trunk/openstamanager/templates/ddt/logo_azienda.jpg new_trunk/openstamanager/templates/ddt/pdfgen.ddt.php new_trunk/openstamanager/templates/fatturato/ new_trunk/openstamanager/templates/fatturato/fatturato.html new_trunk/openstamanager/templates/fatturato/fatturato_body.html new_trunk/openstamanager/templates/fatturato/logo_azienda.jpg new_trunk/openstamanager/templates/fatturato/pdfgen.fatturato.php new_trunk/openstamanager/templates/fatture/ new_trunk/openstamanager/templates/fatture/fattura.html new_trunk/openstamanager/templates/fatture/fattura_body.html new_trunk/openstamanager/templates/fatture/logo_azienda.jpg new_trunk/openstamanager/templates/fatture/pdfgen.fatture.php new_trunk/openstamanager/templates/fatture_accompagnatorie/ new_trunk/openstamanager/templates/fatture_accompagnatorie/fattura.html new_trunk/openstamanager/templates/fatture_accompagnatorie/fattura_body.html new_trunk/openstamanager/templates/fatture_accompagnatorie/logo_azienda.jpg new_trunk/openstamanager/templates/fatture_accompagnatorie/pdfgen.fatture_accompagnatorie.php new_trunk/openstamanager/templates/interventi/ new_trunk/openstamanager/templates/interventi/intervento.html new_trunk/openstamanager/templates/interventi/intervento_body.html new_trunk/openstamanager/templates/interventi/logo_azienda.jpg new_trunk/openstamanager/templates/interventi/pdfgen.interventi.php new_trunk/openstamanager/templates/interventi_ordiniservizio/ new_trunk/openstamanager/templates/interventi_ordiniservizio/intervento.html new_trunk/openstamanager/templates/interventi_ordiniservizio/intervento_body.html new_trunk/openstamanager/templates/interventi_ordiniservizio/logo_azienda.jpg new_trunk/openstamanager/templates/interventi_ordiniservizio/pdfgen.interventi_ordiniservizio.php new_trunk/openstamanager/templates/magazzino_inventario/ new_trunk/openstamanager/templates/magazzino_inventario/logo_azienda.jpg new_trunk/openstamanager/templates/magazzino_inventario/magazzino_inventario.html new_trunk/openstamanager/templates/magazzino_inventario/magazzino_inventario_body.html new_trunk/openstamanager/templates/magazzino_inventario/pdfgen.magazzino_inventario.php new_trunk/openstamanager/templates/ordini/ new_trunk/openstamanager/templates/ordini/logo_azienda.jpg new_trunk/openstamanager/templates/ordini/ordine.html new_trunk/openstamanager/templates/ordini/ordine_body.html new_trunk/openstamanager/templates/ordini/pdfgen.ordini.php new_trunk/openstamanager/templates/pdfgen.php new_trunk/openstamanager/templates/pdfgen_variables.php new_trunk/openstamanager/templates/preventivi/ new_trunk/openstamanager/templates/preventivi/logo_azienda.jpg new_trunk/openstamanager/templates/preventivi/pdfgen.preventivi.php new_trunk/openstamanager/templates/preventivi/preventivo.html new_trunk/openstamanager/templates/preventivi/preventivo_body.html new_trunk/openstamanager/templates/preventivi_cons/ new_trunk/openstamanager/templates/preventivi_cons/logo_azienda.jpg new_trunk/openstamanager/templates/preventivi_cons/pdfgen.preventivi_cons.php new_trunk/openstamanager/templates/preventivi_cons/preventivo.html new_trunk/openstamanager/templates/preventivi_cons/preventivo_body.html new_trunk/openstamanager/templates/riepilogo_contratti/ new_trunk/openstamanager/templates/riepilogo_contratti/contratto.html new_trunk/openstamanager/templates/riepilogo_contratti/contratto_body.html new_trunk/openstamanager/templates/riepilogo_contratti/logo_azienda.jpg new_trunk/openstamanager/templates/riepilogo_contratti/pdfgen.riepilogo_contratti.php new_trunk/openstamanager/templates/riepilogo_interventi/ new_trunk/openstamanager/templates/riepilogo_interventi/intervento.html new_trunk/openstamanager/templates/riepilogo_interventi/intervento_body.html new_trunk/openstamanager/templates/riepilogo_interventi/logo_azienda.jpg new_trunk/openstamanager/templates/riepilogo_interventi/pdfgen.riepilogo_interventi.php new_trunk/openstamanager/update/ new_trunk/openstamanager/update/base.sql new_trunk/openstamanager/update/create_updates.sql new_trunk/openstamanager/update/update_0.2.1.sql new_trunk/openstamanager/update/update_0.3.1.sql new_trunk/openstamanager/update/update_0.3.4.sql new_trunk/openstamanager/update/update_0.3.7.sql new_trunk/openstamanager/update/update_0.3.8.sql new_trunk/openstamanager/update/update_0.3.9.php new_trunk/openstamanager/update/update_0.3.9.sql new_trunk/openstamanager/update/update_0.3.sql new_trunk/openstamanager/update/update_1.0.1.sql new_trunk/openstamanager/update/update_1.0.2.sql new_trunk/openstamanager/update/update_1.0beta1.php new_trunk/openstamanager/update/update_1.0beta1.sql new_trunk/openstamanager/update/update_1.0beta2.php new_trunk/openstamanager/update/update_1.1.2.sql new_trunk/openstamanager/update/update_1.1.3.php new_trunk/openstamanager/update/update_1.1.3.sql new_trunk/openstamanager/update/update_1.1.4.php new_trunk/openstamanager/update/update_1.1.4.sql new_trunk/openstamanager/update/update_1.1.5.sql new_trunk/openstamanager/update/update_1.1.6.php new_trunk/openstamanager/update/update_1.1.6.sql new_trunk/openstamanager/update/update_1.1.7.sql new_trunk/openstamanager/update/update_1.1.8.php new_trunk/openstamanager/update/update_1.1.8.sql new_trunk/openstamanager/update/update_1.1.8RC2.sql new_trunk/openstamanager/update/update_1.1.9RC1.php new_trunk/openstamanager/update/update_1.1.9RC1.sql new_trunk/openstamanager/update/update_1.1.sql new_trunk/openstamanager/update/update_1.1RC1.sql new_trunk/openstamanager/update/update_1.1RC2.php new_trunk/openstamanager/update/update_1.1RC2.sql new_trunk/openstamanager/update/update_1.1RC3.sql new_trunk/openstamanager/update/update_1.1RC4.sql new_trunk/openstamanager/update/update_1.1beta1.sql new_trunk/openstamanager/update/update_1.1beta10.sql new_trunk/openstamanager/update/update_1.1beta11.php new_trunk/openstamanager/update/update_1.1beta11.sql new_trunk/openstamanager/update/update_1.1beta4.sql new_trunk/openstamanager/update/update_1.1beta5.sql new_trunk/openstamanager/update/update_1.1beta6.sql new_trunk/openstamanager/update/update_1.1beta8.php new_trunk/openstamanager/update/update_1.1beta8.sql new_trunk/openstamanager/update/update_1.1beta9.sql new_trunk/openstamanager/update/update_2.0.sql new_trunk/openstamanager/update/update_checker.phpAdded: new_trunk/openstamanager/templates/contratti/contratto.html===================================================================--- new_trunk/openstamanager/templates/contratti/contratto.html (rev 0)+++ new_trunk/openstamanager/templates/contratti/contratto.html2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,18 @@+<style>+<!--+.table_values td{+border: 1px solid #888;+padding: 4px;+white-space: normal;+}++.table_values th{+background: #abbfcb;+padding: 4px;+}+-->+</style>++<page backcolor="#ffffff" backtop="45mm" backbottom="80mm" backleft="0mm" backright="0mm" footer="" style="font-size: $font_size$">+$body$+</page>Property changes on: new_trunk/openstamanager/templates/contratti/contratto.html___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/contratti/contratto_body.html===================================================================--- new_trunk/openstamanager/templates/contratti/contratto_body.html (rev 0)+++ new_trunk/openstamanager/templates/contratti/contratto_body.html2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,37 @@+<page_header>+<table $body_table_params$>+<!-- Intestazione fornitore -->+<tr><td style="width:110mm; font-size:8pt; color:#555;">+<img src="$docroot$/templates/riepilogo_contratti/logo_azienda.jpg" alt="Logo" border="0" /><br/>+$f_ragionesociale$+$f_indirizzo$+$f_citta$+$f_piva$+$f_codicefiscale$+$f_capsoc$+$f_telefono$+$f_sitoweb$+$f_email$+</td>++<!-- Intestazione cliente -->+<td style="width:100mm; font-size:10pt">+Spett.le $c_ragionesociale$+$c_indirizzo$+$c_citta$+$c_piva$+</td></tr>++</table>+<br/>+</page_header>+++<!-- Footer -->+<page_footer>+<table>+<tr><td style="font-size:7pt; color:#999;">+Stampato con OpenSTAManager+</td></tr>+</table>+</page_footer>Property changes on: new_trunk/openstamanager/templates/contratti/contratto_body.html___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/contratti/logo_azienda.jpg===================================================================(Binary files differ)Index: new_trunk/openstamanager/templates/contratti/logo_azienda.jpg===================================================================--- new_trunk/openstamanager/templates/contratti/logo_azienda.jpg2014-06-02 12:59:01 UTC (rev 921)+++ new_trunk/openstamanager/templates/contratti/logo_azienda.jpg2014-06-02 13:23:42 UTC (rev 922)Property changes on: new_trunk/openstamanager/templates/contratti/logo_azienda.jpg___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: svn:mime-type## -0,0 +1 ##+application/octet-stream\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/contratti/pdfgen.contratti.php===================================================================--- new_trunk/openstamanager/templates/contratti/pdfgen.contratti.php (rev 0)+++ new_trunk/openstamanager/templates/contratti/pdfgen.contratti.php2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,240 @@+<?php+//carica intervento+$idcontratto = save($_GET['idcontratto']);++$show_costi = get_var("Stampa i prezzi sui contratti");++//Lettura dati contratto e interventi+$q = "SELECT *, (SELECT orario_inizio FROM in_interventi_tecnici WHERE idintervento=in_interventi.idintervento) AS data, co_contratti.descrizione AS `cdescrizione`, co_contratti.idanagrafica AS `idanagrafica`, co_contratti.costo_orario AS costo_orario , co_contratti.costo_km AS costo_km FROM co_contratti LEFT OUTER JOIN (co_righe_contratti LEFT OUTER JOIN in_interventi ON co_righe_contratti.idintervento=in_interventi.idintervento) ON co_contratti.id=co_righe_contratti.idcontratto WHERE co_contratti.id='".$idcontratto."' ORDER BY data DESC";+$rscontrattii = $dbo->fetchArray( $q );+$idcliente = $rscontrattii[0]['idanagrafica'];++//carica report html+$report = file_get_contents ($docroot."/templates/contratti/contratto.html");+$body = file_get_contents ($docroot."/templates/contratti/contratto_body.html");++include_once( "pdfgen_variables.php" );++$totrows = sizeof($rscontrattii);+$totale_km = 0;+$totale_ore = 0;+$totale = 0;+$contratti = array();+$ore = array();+$km = array();+$ntecnici = array();+$tecnici = array();+$costi_orari = array();+$costi_km = array();+$idinterventi = array('-1');++++//Sostituisco i valori tra | | con il valore del campo del db+$body .= preg_replace( "/|(.+?)|/", $rscontrattii[0]['${1}'], $body );++//Lettura nome referenti collegati all'anagrafica+$query = "SELECT * FROM an_referenti WHERE id = \"".$rscontrattii[0]['idreferente']."\"";+$rs = $dbo->fetchArray( $query );+$nome_referente = $rs[0]['nome'];++++++// Tabella intestazione+$body .= "<table class='table_values' border='0' cellpadding='0'>\n";++$body .= "<tr><td align=\"left\" width='356' >\n";+$body .= "<big><b>Prot RP/sm: ".$rscontrattii[0]['numero']."</b></big>\n";+$body .= "</td>\n";+$body .= "<td align=\"left\" width='356' >\n";+++if ($c_cap!=""){+$c_cap = $c_cap." ";+}++if ($c_provincia!=""){+$c_provincia = " (".$c_provincia.")";+}++++$body .= "<big style=\"line-height:5mm\" >Spettabile<br/><b>".$c_ragionesociale."<br>".$c_indirizzo."<br>".$c_cap.$c_citta.$c_provincia."<br> P.Iva: ".$c_piva."</b></big>\n";+$body .= "</td>\n";+$body .= "</tr>\n";+++$body .= "<tr><td align=\"left\" colspan=\"2\" >\n";+$body .= "<big>".$f_citta.", <b>".date("d/m/Y", strtotime( $rscontrattii[0]['data_bozza']) )."</b></big>\n";+$body .= "</td>\n";+$body .= "</tr>\n";+++$body .= "<tr><td align=\"left\" colspan=\"2\" >\n";+$body .= "<big><b>OGGETTO: CONTRATTO N<sup>o</sup> ".$rscontrattii[0]['numero']." DEL ".date("d/m/Y", strtotime( $rscontrattii[0]['data_bozza']) )."</b></big>\n";+$body .= "</td>\n";+$body .= "</tr>\n";++if ($nome_referente!=""){+$body .= "<tr><td align=\"left\" colspan=\"2\" >\n";+$body .= "<b><u>C.A.</u></b> ".$nome_referente."\n";+$body .= "</td>\n";+$body .= "</tr>\n";+}++$body .= "</table>\n";+++++++/*+TABELLA COSTI+*/+$body .= "<table class='table_values' border='0' cellpadding='0'>\n";+$body .= "<col width='390'><col width='50'><col width='40'><col width='90'><col width='75'><col width='60'><col width='78'>\n";+$body .= "<thead>\n";+$body .= "<tr><th width='390'>Descrizione</th>\n";+$body .= "<th width='50' align='center'>Q.t&agrave;</th>\n";+$body .= "<th width='40' align='center'>u.m.</th>\n";+$body .= "<th width='90' align='center'>Costo&nbsp;unitario</th>\n";++$body .= "<th width='75' align='center'>Imponibile</th></tr>\n";+$body .= "</thead>\n";++$body .= "<tbody>\n";+++++$rs = $dbo->fetchArray("SELECT * FROM co_righe2_contratti WHERE idcontratto=\"".$idcontratto."\"");+$totale = 0;++for( $i=0; $i<sizeof($rs); $i++ ){+//Descrizione+$body .= "<tr><td>".$rs[$i]['descrizione']."</td>\n";++//Q.tà+$body .= "<td align='center'>".$rs[$i]['qta']."</td>\n";++//um+$body .= "<td align='center'>".$rs[$i]['um']."</td>\n";++//Costo unitario+$body .= "<td align='center'>".number_format( $rs[$i]['subtotale']/$rs[$i]['qta'], 2, ",", "" )." &euro;</td>\n";++//Subtotale+$body .= "<td align='center'>".number_format( $rs[$i]['subtotale'], 2, ",", "" )." &euro;</td>\n";+$body .= "</tr>\n";++$totale += $rs[$i]['subtotale'];+}++++//Totale complessivo intervento+$body .= "<tr><td align=\"right\" colspan=\"4\">\n";+$body .= "<big><b>QUOTAZIONE TOTALE:</b></big>\n";+$body .= "</td>\n";++$body .= "<td align=\"right\" bgcolor=\"#cccccc\">\n";+$body .= "<big><b>".number_format( $totale , 2, ",", ".")." &euro;</b></big>\n";+$body .= "</td></tr>\n";+$body .= "</tbody>\n";+$body .= "</table><br/><br/>\n";++++++//CONDIZIONI GENERALI DI FORNITURA++//Lettura pagamenti+$query = "SELECT * FROM co_pagamenti WHERE id = ".$rscontrattii[0]['idpagamento'];+$rs = $dbo->fetchArray( $query );+$pagamento = $rs[0]['descrizione'];+++$rscontrattii[0]['idpagamento'];++$body .= "<table style=\"width:100%;\" border=\"0\" >\n";+$body .= "<tr><td align=\"center\" valign=\"middle\" style=\"height:5mm;font-size:14pt;\" bgcolor=\"#dddddd\" colspan=\"2\">\n";+$body .= "<span><b>CONDIZIONI GENERALI DI FORNITURA</b></span><br/>\n";+$body .= "</td></tr>\n";++$body .= "<tr><td align=\"center\" colspan=\"2\">\n";+$body .= "<span><b> </b></span>\n";+$body .= "</td></tr>\n";++++//PAGAMENTI+$body .= "<tr><td width='356' colspan=\"1\">\n";+$body .= "<big><b><u>PAGAMENTI:</u></b></big>\n";+$body .= "</td>\n";++$body .= "<td width='356' colspan=\"1\">\n";+$body .= "<span><b>".$pagamento."</b></span>\n";+$body .= "</td></tr>\n";+++$body .= "<tr><td align=\"center\" colspan=\"2\">\n";+$body .= "<span><b> </b></span>\n";+$body .= "</td></tr>\n";+++++//VALIDITA' OFFERTA+$body .= "<tr><td width='356' colspan=\"1\">\n";+$body .= "<big><b><u>VALIDIT&Agrave; OFFERTA:</u></b></big>\n";+$body .= "</td>\n";++$body .= "<td width='356' colspan=\"1\">\n";+$body .= "<span><b>".$rscontrattii[0]['validita']." giorni</b></span>\n";+$body .= "</td></tr>\n";++$body .= "<tr><td align=\"center\" colspan=\"2\">\n";+$body .= "<span><b> </b></span>\n";+$body .= "</td></tr>\n";+++//VALIDITA' CONTRATTO+$body .= "<tr><td width='356' colspan=\"1\">\n";+$body .= "<big><b><u>VALIDIT&Agrave; CONTRATTO:</u></b></big>\n";+$body .= "</td>\n";++$body .= "<td width='356' colspan=\"1\">\n";+$body .= "<span><b>dal ".date( "d/m/Y", strtotime($rscontrattii[0]['data_accettazione']) )." al ".date( "d/m/Y", strtotime($rscontrattii[0]['data_conclusione']) )."</b></span>\n";+$body .= "</td></tr>\n";++$body .= "<tr><td align=\"center\" colspan=\"2\">\n";+$body .= "<span><b> </b></span>\n";+$body .= "</td></tr>\n";+++//ESCLUSIONI+$body .= "<tr><td width='356' colspan=\"1\">\n";+$body .= "<big><b><u>ESCLUSIONI:</u></b></big>\n";+$body .= "</td>\n";++$body .= "<td width='356' colspan=\"1\">\n";+$body .= "<span><b>".$rscontrattii[0]['esclusioni']."</b></span>\n";+$body .= "</td></tr>\n";+++$body .= "</table>\n";++$body .= "<br/><br/>\n";++++$body .= "<span><b>Il tutto S.E. & O.</b></span><br/><br/>\n";+$body .= "<span>In attesa di un Vostro Cortese riscontro scritto, l&rsquo;occasione mi &egrave; gradita per porgere Cordiali Saluti.</span>\n";+++$report_name = "contratto_".$idcontratto.".pdf";+?>Property changes on: new_trunk/openstamanager/templates/contratti/pdfgen.contratti.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/contratti_cons/contratto.html===================================================================--- new_trunk/openstamanager/templates/contratti_cons/contratto.html (rev 0)+++ new_trunk/openstamanager/templates/contratti_cons/contratto.html2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,18 @@+<style>+<!--+.table_values td{+border: 1px solid #888;+padding: 4px;+white-space: normal;+}++.table_values th{+background: #abbfcb;+padding: 4px;+}+-->+</style>++<page backcolor="#ffffff" backtop="65mm" backbottom="10mm" backleft="0mm" backright="0mm" footer="" style="font-size: $font_size$">+$body$+</page>Property changes on: new_trunk/openstamanager/templates/contratti_cons/contratto.html___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/contratti_cons/contratto_body.html===================================================================--- new_trunk/openstamanager/templates/contratti_cons/contratto_body.html (rev 0)+++ new_trunk/openstamanager/templates/contratti_cons/contratto_body.html2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,40 @@+<page_header>+<table $body_table_params$>+<!-- Intestazione fornitore -->+<tr><td style="width:105mm; font-size:8pt; color:#555;">+<img src="$docroot$/templates/contratti/logo_azienda.jpg" alt="Logo" border="0" /><br/>+$f_ragionesociale$+$f_indirizzo$+$f_citta$+$f_piva$+$f_codicefiscale$+$f_capsoc$+$f_telefono$+$f_sitoweb$+$f_email$+</td>++<!-- Intestazione cliente -->+<td style="width:95mm; font-size:10pt">+Spett.le $c_ragionesociale$+$c_indirizzo$+$c_citta$+$c_piva$+</td></tr>++</table>+<br/>+</page_header>+++<!-- Footer -->+<page_footer>+<table style="width:200mm; font-size:7pt; color:#999;">+<tr><td style="width:100mm;">+Stampato con OpenSTAManager+</td>+<td style="width:100mm; text-align:right;">+Pagina [[page_cu]] di [[page_nb]]+</td></tr>+</table>+</page_footer>Property changes on: new_trunk/openstamanager/templates/contratti_cons/contratto_body.html___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/contratti_cons/logo_azienda.jpg===================================================================(Binary files differ)Index: new_trunk/openstamanager/templates/contratti_cons/logo_azienda.jpg===================================================================--- new_trunk/openstamanager/templates/contratti_cons/logo_azienda.jpg2014-06-02 12:59:01 UTC (rev 921)+++ new_trunk/openstamanager/templates/contratti_cons/logo_azienda.jpg2014-06-02 13:23:42 UTC (rev 922)Property changes on: new_trunk/openstamanager/templates/contratti_cons/logo_azienda.jpg___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: svn:mime-type## -0,0 +1 ##+application/octet-stream\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/contratti_cons/pdfgen.contratti_cons.php===================================================================--- new_trunk/openstamanager/templates/contratti_cons/pdfgen.contratti_cons.php (rev 0)+++ new_trunk/openstamanager/templates/contratti_cons/pdfgen.contratti_cons.php2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,386 @@+<?php+//carica intervento+$idcontratto = save($_GET['idcontratto']);++//Lettura dati contratto+$q = "SELECT * FROM co_contratti WHERE id='".$idcontratto."'";+$rscontratti = $dbo->fetchArray( $q );+$idcliente = $rscontratti[0]['idanagrafica'];++//carica report html+$report = file_get_contents ($docroot."/templates/contratti/contratto.html");+$body = file_get_contents ($docroot."/templates/contratti/contratto_body.html");++include_once( "pdfgen_variables.php" );++$totale_km = 0;+$totale_ore = 0;+$totale_diritto_chiamata = 0;+$totale = 0;+$contratti = array();+$ore = array();++$src_costo_orario = array();+$src_costo_km = array();+$src_diritto_chiamata = array();++$tot_ore_consuntivo = array();+$tot_km_consuntivo = array();++$km = array();+$ntecnici = array();+$tecnici = array();+$costi_orari = array();+$costi_km = array();+$idinterventi = array();+++//Ciclo tra le righe degli interventi da programmare+$rs_righe = $dbo->fetchArray("SELECT * FROM co_righe_contratti WHERE idcontratto=\"".$idcontratto."\" ORDER BY data_richiesta ASC");+$totrows = sizeof($rs_righe);++for( $r=0; $r<sizeof($rs_righe); $r++ ){+if( $rs_righe[$r]['idintervento']!='' ){+$q = "SELECT idintervento, data, (SELECT SUM(km) FROM in_interventi_tecnici GROUP BY idintervento HAVING idintervento=in_interventi.idintervento) AS km, (SELECT costo_orario FROM in_tipiintervento WHERE idtipointervento=in_interventi.idtipointervento) AS src_costo_orario, (SELECT costo_km FROM in_tipiintervento WHERE idtipointervento=in_interventi.idtipointervento) AS src_costo_km, (SELECT costo_diritto_chiamata FROM in_tipiintervento WHERE idtipointervento=in_interventi.idtipointervento) AS src_diritto_chiamata, (SELECT SUM(prezzo_ore_consuntivo) FROM in_interventi_tecnici GROUP BY idintervento HAVING idintervento=in_interventi.idintervento) AS `tot_ore_consuntivo`, (SELECT SUM(prezzo_km_consuntivo) FROM in_interventi_tecnici GROUP BY idintervento HAVING idintervento=in_interventi.idintervento) AS `tot_km_consuntivo` FROM in_interventi WHERE idintervento=\"".$rs_righe[$r]['idintervento']."\"";+$rscontrattii = $dbo->fetchArray( $q );++if( sizeof($rscontrattii) == 1 ){+//Lettura numero tecnici collegati all'intervento+$query = "SELECT an_anagrafiche.idanagrafica, ragione_sociale, ora_dal1, ora_al1, ora_dal2, ora_al2, km FROM in_interventi_tecnici LEFT OUTER JOIN an_anagrafiche ON in_interventi_tecnici.idtecnico=an_anagrafiche.idanagrafica WHERE idintervento=\"".$rscontrattii[0]['idintervento']."\"";+$rst = $dbo->fetchArray( $query );+$n_tecnici = sizeof($rst);+$tecnici_full = "";+$t = 0;++for( $j=0; $j<$n_tecnici; $j++ ){+$t1 = datediff( "n", $rst[$j]['ora_dal1'], $rst[$j]['ora_al1'] );+$t2 = datediff( "n", $rst[$j]['ora_dal2'], $rst[$j]['ora_al2'] );++$orario = "";+if( floatval($t1)>0 )+$orario .= readTime( $rst[$j]['ora_dal1'] )."-".readTime( $rst[$j]['ora_al1'] );++if( floatval($t2)>0 )+$orario .= "&nbsp;&nbsp;&nbsp;".readTime( $rst[$j]['ora_dal2'] )."-".readTime( $rst[$j]['ora_al2'] );++$tecnici_full .= $rst[$j]['ragione_sociale']." (".$orario.")<br/>\n";++//Conteggio ore totali+$t += ($t1+$t2) / 60;+}++$desc = str_replace( "\n", "<br/>&nbsp;&nbsp;", $rscontratti[$i]['descrizione'] );++$line = "Intervento <b>".$rscontrattii[0]['idintervento']."</b> del <b>".date( "d/m/Y", strtotime($rscontrattii[0]['data']) )."</b><br/>\n&nbsp;&nbsp;".$desc;++array_push( $contratti, $line );+array_push( $km, floatval($rscontrattii[0]['km']) );+array_push( $ore, $t );++array_push( $src_costo_orario, $rscontrattii[0]['src_costo_orario'] );+array_push( $src_costo_km, $rscontrattii[0]['src_costo_km'] );+array_push( $src_diritto_chiamata, $rscontrattii[0]['src_diritto_chiamata'] );++array_push( $tot_ore_consuntivo, $rscontrattii[0]['tot_ore_consuntivo'] );+array_push( $tot_km_consuntivo, $rscontrattii[0]['tot_km_consuntivo'] );++array_push( $ntecnici, $n_tecnici );+array_push( $tecnici, $tecnici_full );+$totale_ore += $t;+$totale_diritto_chiamata += $rscontrattii[0]['src_diritto_chiamata'];+$totale_km += floatval( $rscontrattii[0]['km'] );+}+}+++//Visualizzo i dati degli interventi programmati+else{+$line = "Da programmare entro il ".date( "d/m/Y", strtotime($rs_righe[$r]['data_richiesta']) );++array_push( $contratti, $line );+array_push( $km, 0 );+array_push( $ore, 0 );++array_push( $src_costo_orario, 0 );+array_push( $src_costo_km, 0 );+array_push( $src_diritto_chiamata, 0 );++array_push( $tot_ore_consuntivo, 0 );+array_push( $tot_km_consuntivo, 0 );++array_push( $ntecnici, 0 );+array_push( $tecnici, '-' );+}+}++++$body .= "<big><b>&gt; CONSUNTIVO CONTRATTO: ".$rscontratti[0]['nome']."</b></big><br/><br/>\n";+$body .= "<span>".str_replace( "\n", "<br/>", $rscontratti[0]['cdescrizione'] )."</span><br/><br/>\n";++//Sostituisco i valori tra | | con il valore del campo del db+$body .= preg_replace( "/|(.+?)|/", $rscontratti[0]['${1}'], $body );++if( sizeof($contratti)>0 ){+//Tabella con riepilogo interventi, km e ore+$body .= "<table class=\"table_values\" width=\"100%\" border=\"0\">\n";+$body .= "<thead>\n";+$body .= "<tr><th align=\"left\">Interventi</th>\n";+$body .= "<th align=\"center\">km</th>\n";+$body .= "<th align=\"center\">Costo<br/>unitario<br/>al km</th>\n";+$body .= "<th align=\"center\">Ore</th>\n";+$body .= "<th align=\"center\">Costo<br/>unitario<br/>all&rsquo;ora</th>\n";+$body .= "<th align=\"center\">Diritto<br/>chiamata</th>\n";+$body .= "<th align=\"center\">Subtotale</th></tr>\n";+$body .= "</thead>\n";++$body .= "<tbody>\n";+++//Tabella con i dati+for( $j=0; $j<sizeof($contratti); $j++ ){+$body .= "<tr><td>\n";+$body .= "<div style=\"width:80mm;\">".$contratti[$j]."<br/><span style=\"font-size:10px; color:#777;\"><b>Tecnici:</b><br/>".$tecnici[$j]."</span></div>\n";+$body .= "</td>\n";++//Km+$body .= "<td valign=\"top\">";+$body .= "<div style=\"text-align:center; width:15mm;\">".str_replace( ".", ",", $km[$j] )."</div>\n";+$body .= "</td>\n";++//Costo unitario km+$body .= "<td valign=\"top\">";+$body .= "<div style=\"text-align:center; width:15mm;\">".number_format( $src_costo_km[$j], 2, ",", "." )."</div>\n";+$body .= "</td>\n";++//Ore+$body .= "<td valign=\"top\">";+$body .= "<div style=\"text-align:center; width:15mm;\">".number_format( $ore[$j], 2, ",", "." )."</div>\n";+$body .= "</td>\n";++//Costo unitario ore+$body .= "<td valign=\"top\">";+$body .= "<div style=\"text-align:center; width:15mm;\">".number_format( $src_costo_orario[$j], 2, ",", "." )."</div>\n";+$body .= "</td>\n";++//Diritto chiamata+$body .= "<td valign=\"top\">";+$body .= "<div style=\"text-align:center; width:15mm;\">".number_format( $src_diritto_chiamata[$j], 2, ",", "." )."</div>\n";+$body .= "</td>\n";++//Subtotale+$subtotale = floatval( $src_costo_km[$j]*$km[$j] + $src_costo_orario[$j]*$ore[$j] + $src_diritto_chiamata[$j] );+$body .= "<td valign=\"top\">";+$body .= "<div style=\"text-align:center; width:24mm;\">".number_format( $subtotale, 2, ",", "." )."</div>\n";+$body .= "</td></tr>\n";+$totale += $subtotale;+$totale_consuntivo += $tot_ore_consuntivo[$j] + $tot_km_consuntivo[$j];+array_push( $idinterventi, "'".$rscontratti[$j]['idintervento']."'" );+}++$body .= "<tr><td style='border:0px;' align=\"right\">\n";+$body .= "<span><b>Totale:</b></span>\n";+$body .= "</td>\n";++$body .= "<td align=\"center\">\n";+$body .= "<span><b>".number_format( $totale_km, 2, ",", "." )."</b></span>\n";+$body .= "</td>\n";+$body .= "<td></td>\n";++$body .= "<td align=\"center\">\n";+$body .= "<span><b>".number_format( $totale_ore, 2, ",", "." )."</b></span>\n";+$body .= "</td>\n";+$body .= "<td></td>\n";++$body .= "<td align=\"center\">\n";+$body .= "<span><b>".number_format( $totale_diritto_chiamata, 2, ",", "." )."</b></span>\n";+$body .= "</td>\n";++$body .= "<td align=\"center\" bgcolor=\"#dddddd\">\n";+$body .= "<span><b>".number_format($totale, 2, ",", ".")." &euro;</b></span>\n";+$body .= "</td></tr>\n";+++//Riga dello sconto+$sconto = $totale_consuntivo - $totale;+if( $sconto != 0 ){+$body .= "<tr><td style=\"border:0px;\" align=\"right\" colspan=\"6\">\n";+$body .= "<span><b>Arrotondamenti:</b></span>\n";++$body .= "</td><td align=\"center\">\n";+$body .= "<span><b>".number_format( $sconto, 2, ",", "." )." &euro;</b></span>\n";+$body .= "</td></tr>\n\n";++$body .= "<tr><td style=\"border:0px;\" align=\"right\" colspan=\"6\">\n";+$body .= "<span><b>Totale:</b></span>\n";++$body .= "</td><td align=\"center\" bgcolor=\"#dddddd\">\n";+$body .= "<span><b>".number_format( $totale_consuntivo, 2, ",", "." )." &euro;</b></span>\n";+$body .= "</td></tr>\n";+}+$totale_intervento_consuntivo += $totale_consuntivo;+$body .= "</tbody>\n";+$body .= "</table>\n";+}+$body .= "<br/>\n";++++++//Conteggio articoli utilizzati+$query = "SELECT *, (SELECT data FROM in_interventi WHERE idintervento=mg_articoli_interventi.idintervento) AS data_intervento, (SELECT percentuale FROM co_iva WHERE id=mg_articoli_interventi.idiva_vendita) AS prciva_vendita, (SELECT codice FROM mg_articoli WHERE id=idarticolo) AS codice_art, GROUP_CONCAT( CONCAT_WS(lotto, 'Lotto: ', ', '), CONCAT_WS(serial, 'SN: ', ', '), CONCAT_WS(altro, 'Altro: ', '') SEPARATOR '<br/>') AS codice, SUM(qta) AS sumqta FROM `mg_articoli_interventi` GROUP BY idarticolo, idintervento, lotto HAVING idintervento IN(".implode(',', $idinterventi).") AND NOT idarticolo='0' ORDER BY idarticolo ASC";+$rs2 = $dbo->fetchArray($query);++if( sizeof($rs2)>0 ){+$body .= "<table style=\"width:100%;\" class=\"table_values\" cellspacing=\"2\" cellpadding=\"5\" style=\"border-color:#aaa;\">\n";+$body .= "<tr><th align='center' colspan='4'><b>Materiale utilizzato per gli interventi</b></th></tr>\n";++$body .= "<tr><th style=\"width:130mm;\">\n";+$body .= "<b>Articolo</b>\n";+$body .= "</th>\n";++$body .= "<th style=\"width:10mm;\" align=\"center\">\n";+$body .= "<b>Q.t&agrave;</b>\n";+$body .= "</th>\n";++$body .= "<th style=\"width:20mm;\" align=\"center\">\n";+$body .= "<b>Prezzo unitario</b>\n";+$body .= "</th>\n";++$body .= "<th style=\"width:20mm;\" align=\"center\">\n";+$body .= "<b>Subtot</b>\n";+$body .= "</th></tr>\n";+++$totale_articoli = 0.00;++for( $i=0; $i<sizeof($rs2); $i++ ){+//Articolo+$body .= "<tr><td class='first_cell'>\n";+$body .= "<span>".nl2br($rs2[$i]['descrizione'])."</span>\n";+if( $rs2[$i]['codice']!='' && $rs2[$i]['codice']!='Lotto: , SN: , Altro: ' ){ $body .= "<br/><small>".$rs2[$i]['codice']."</small>\n"; }+++$body .= "<br/><span><small style=\"color:#777;\">Intervento del ".date("d/m/Y", strtotime($rs2[$i]['data_intervento']) )."</small></span>\n";+$body .= "</td>\n";+++//Quantità+$qta = $rs2[$i]['sumqta'];+$body .= "<td class='table_cell' align='center'>\n";+$body .= "<span>".$rs2[$i]['sumqta']."</span>\n";+$body .= "</td>\n";+++//Prezzo unitario+$body .= "<td class='table_cell' align='center'>\n";+$netto = $rs2[$i]['prezzo_vendita'];+$netto = $netto + $netto/100*$rs2[$i]['prc_guadagno'];+$iva = $netto/100*$rs2[$i]['prciva_vendita'];+$body .= "<span>".number_format( $netto, 2, ",", "" )." &euro;</span>\n";+$body .= "</td>\n";+++//Prezzo di vendita+$body .= "<td class='table_cell' align='center'>\n";+$body .= "<span><span class='prezzo_articolo'>".number_format( $netto*$qta, 2, ",", "" )."</span> &euro;</span>\n";+$body .= "</td></tr>\n";+$totale_articoli += $netto*$qta;+}++//Totale spesa articoli+$body .= "<tr><td colspan=\"3\" align=\"right\">\n";+$body .= "<b>TOTALE MATERIALE UTILIZZATO:</b>\n";+$body .= "</td>\n";++$body .= "<td align=\"center\" bgcolor=\"#dddddd\">\n";+$body .= "<b>".number_format( $totale_articoli, 2, ",", ".")." &euro;</b>\n";+$body .= "</td></tr>\n";+$body .= "</table><br/>\n";+}+++++//Conteggio spese aggiuntive+$query = "SELECT *, (SELECT data FROM in_interventi WHERE idintervento=in_righe_interventi.idintervento) AS data_intervento FROM in_righe_interventi WHERE idintervento IN(".implode( ',', $idinterventi ).") ORDER BY id ASC";+$rs2 = $dbo->fetchArray($query);++if( sizeof($rs2)>0 ){+$body .= "<table style=\"width:100%;\" class=\"table_values\" cellspacing=\"2\" cellpadding=\"5\" style=\"border-color:#aaa;\">\n";+$body .= "<tr><th align='center' colspan='4'><b>Spese aggiuntive</b></th></tr>\n";++$body .= "<tr><th style=\"width:130mm;\">\n";+$body .= "<b>Descrizione</b>\n";+$body .= "</th>\n";++$body .= "<th style=\"width:10mm;\" align=\"center\">\n";+$body .= "<b>Q.t&agrave;</b>\n";+$body .= "</th>\n";++$body .= "<th style=\"width:20mm;\" align=\"center\">\n";+$body .= "<b>Prezzo unitario</b>\n";+$body .= "</th>\n";++$body .= "<th style=\"width:20mm;\" align=\"center\">\n";+$body .= "<b>Subtot</b>\n";+$body .= "</th></tr>\n";+++$totale_spese = 0.00;++for( $i=0; $i<sizeof($rs2); $i++ ){+//Articolo+$body .= "<tr><td class='first_cell'>\n";+$body .= "<span>".$rs2[$i]['descrizione']."</span><br/>\n";+$body .= "<span><small style=\"color:#777;\">Intervento del ".date("d/m/Y", strtotime($rs2[$i]['data_intervento']) )."</small></span>\n";+$body .= "</td>\n";+++//Quantità+$qta = $rs2[$i]['qta'];+$body .= "<td class='table_cell' align='center'>\n";+$body .= "<span>".number_format($rs2[$i]['qta'], 2, ",", "")."</span>\n";+$body .= "</td>\n";+++//Prezzo unitario+$body .= "<td class='table_cell' align='center'>\n";+$netto = $rs2[$i]['prezzo'];+$body .= "<span>".number_format( $netto, 2, ",", "" )." &euro;</span>\n";+$body .= "</td>\n";+++//Prezzo di vendita+$body .= "<td class='table_cell' align='center'>\n";+$body .= "<span>".number_format( $netto*$qta, 2, ",", "" )." &euro;</span>\n";+$body .= "</td></tr>\n";+$totale_spese += $netto*$qta;+}+//Totale spese aggiuntive+$body .= "<tr><td colspan=\"3\" align=\"right\">\n";+$body .= "<b>ALTRE SPESE:</b>\n";+$body .= "</td>\n";++$body .= "<td align=\"center\" bgcolor=\"#dddddd\">\n";+$body .= "<b>".number_format( $totale_spese, 2, ",", ".")." &euro;</b>\n";+$body .= "</td></tr>\n";+$body .= "</table><br/>\n";+}++++//Totale complessivo intervento+$body .= "<table style=\"width:100%;\" class=\"table_values\" cellspacing=\"2\" cellpadding=\"5\">\n";+$body .= "<tr><td align=\"right\" width=\"131mm\">\n";+$body .= "<b>TOTALE CONSUNTIVO:</b>\n";+$body .= "</td>\n";++$body .= "<td align=\"center\" bgcolor=\"#cccccc\" width=\"24mm\">\n";+$body .= "<b>".number_format( $totale_intervento_consuntivo + $totale_articoli + $totale_spese, 2, ",", ".")." &euro;</b>\n";+$body .= "</td></tr>\n";+$body .= "</table>\n";++$report_name = "contratto_".$idcontratto."_cons.pdf";+?>Property changes on: new_trunk/openstamanager/templates/contratti_cons/pdfgen.contratti_cons.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/ddt/ddt.html===================================================================--- new_trunk/openstamanager/templates/ddt/ddt.html (rev 0)+++ new_trunk/openstamanager/templates/ddt/ddt.html2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,22 @@+<style>+<!--+.table_values td{+border: 1px solid #888;+padding: 4px;+white-space: normal;+}++.table_values th{+background: #cfe1ec;+padding: 4px;+}++.center{+text-align: center;+}+-->+</style>++<page backcolor="#ffffff" backtop="75mm" backbottom="10mm" backleft="0mm" backright="0mm" footer="" style="font-size: $font_size$">+$body$+</page>Property changes on: new_trunk/openstamanager/templates/ddt/ddt.html___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/ddt/ddt_body.html===================================================================--- new_trunk/openstamanager/templates/ddt/ddt_body.html (rev 0)+++ new_trunk/openstamanager/templates/ddt/ddt_body.html2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,58 @@+<page_header>+<table $body_table_params$>+<!-- Intestazione fornitore -->+<tr><td style="font-size:8pt; color:#555;">+<img src="$docroot$/templates/ordini/logo_azienda.jpg" alt="Logo" border="0" />+</td>+<td>+$f_ragionesociale$+$f_indirizzo$+$f_citta$+$f_piva$+$f_codicefiscale$+$f_capsoc$+$f_telefono$+$f_sitoweb$+$f_email$+</td></tr>+</table><br/>+++<!-- Intestazione cliente -->+<table $body_table_params$>+<tr><td style="width:97mm; border:1px solid #777;" valign="top">+<small><b>CLIENTE</b></small><br/>+<div style="padding: 4px 20px 20px 20px;">+$c_ragionesociale$+$c_indirizzo$+$c_citta$+$c_piva$+$c_codicefiscale$+</div>+</td>++<td valign="top" style="width:96mm; border:1px solid #777;">+<small><b>DESTINAZIONE</b></small><br/>+<div style="padding: 4px 20px 20px 20px;">+$c_destinazione$+</div>+</td></tr>++</table>+<br/>+</page_header>+++<!-- Footer -->+<page_footer>+|footer|+<table border="0" style="width:200mm; font-size:7pt; color:#999; border: 0px solid red;">+<tr><td style="width:100mm;">+Stampato con OpenSTAManager+</td>+<td style="width:100mm; text-align:right;">+Pagina [[page_cu]] di [[page_nb]]+</td></tr>++</table>+</page_footer>Property changes on: new_trunk/openstamanager/templates/ddt/ddt_body.html___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/ddt/logo_azienda.jpg===================================================================(Binary files differ)Index: new_trunk/openstamanager/templates/ddt/logo_azienda.jpg===================================================================--- new_trunk/openstamanager/templates/ddt/logo_azienda.jpg2014-06-02 12:59:01 UTC (rev 921)+++ new_trunk/openstamanager/templates/ddt/logo_azienda.jpg2014-06-02 13:23:42 UTC (rev 922)Property changes on: new_trunk/openstamanager/templates/ddt/logo_azienda.jpg___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: svn:mime-type## -0,0 +1 ##+application/octet-stream\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/ddt/pdfgen.ddt.php===================================================================--- new_trunk/openstamanager/templates/ddt/pdfgen.ddt.php (rev 0)+++ new_trunk/openstamanager/templates/ddt/pdfgen.ddt.php2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,393 @@+<?php+$idddt = save($_GET['idddt']);++$show_costi = get_var("Stampa i prezzi sui ddt");++//Lettura info ddt+$q = "SELECT *, (SELECT descrizione FROM dt_tipiddt WHERE dt_tipiddt.id=idtipoddt) AS tipo_doc, (SELECT descrizione FROM co_pagamenti WHERE id=idpagamento) AS tipo_pagamento, (SELECT descrizione FROM dt_causalet WHERE id=idcausalet) AS causalet, (SELECT descrizione FROM dt_porto WHERE id=idporto) AS porto, (SELECT descrizione FROM dt_aspettobeni WHERE id=idaspettobeni) AS aspettobeni, (SELECT descrizione FROM dt_spedizione WHERE id=idspedizione) AS spedizione, (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=idvettore) AS vettore FROM dt_ddt WHERE id='$idddt'";+$rs = $dbo->fetchArray($q);+$numero_ddt = $rs[0]['numero'];+$idcliente = $rs[0]['idanagrafica'];+( $rs[0]['numero_esterno']!='' ) ? $numero=$rs[0]['numero_esterno'] : $numero=$rs[0]['numero'];++//Lettura righe ddt+$q2 = "SELECT * FROM dt_righe_ddt WHERE idddt='$idddt'";+$righe = $dbo->fetchArray( $q2 );++//carica report html+$report = file_get_contents ("ddt/ddt.html");+$body = file_get_contents ("ddt/ddt_body.html");++include_once( "pdfgen_variables.php" );+++//Leggo i dati della destinazione (se 0=sede legale, se!=altra sede da leggere da tabella an_sedi)+$destinazione = '';+if( $rs[0]['idsede']==0 ){+$queryd = "SELECT ragione_sociale, indirizzo, indirizzo2, cap, citta, provincia, piva, codice_fiscale FROM an_anagrafiche WHERE idanagrafica='".$idcliente."'";+$rsd = $dbo->fetchArray($queryd);++if( $rsd[0]['ragione_sociale']!='' )+$destinazione .= $rsd[0]['ragione_sociale']."<br/>\n";+if( $rsd[0]['indirizzo']!='' )+$destinazione .= $rsd[0]['indirizzo']."<br/>\n";+if( $rsd[0]['indirizzo2']!='' )+$destinazione .= $rsd[0]['indirizzo2']."<br/>\n";+if( $rsd[0]['cap']!='' )+$destinazione .= $rsd[0]['cap']." ";+if( $rsd[0]['citta']!='' )+$destinazione .= $rsd[0]['citta'];+if( $rsd[0]['provincia']!='' )+$destinazione .= " (".$rsd[0]['provincia'].")<br/>\n";+if( $rsd[0]['piva']!='' )+$destinazione .= "P.IVA: ".$rsd[0]['piva']."<br/>\n";+if( $rsd[0]['codice_fiscale']!='' )+$destinazione .= "C.F.: ".$rsd[0]['codice_fiscale']."<br/>\n";+}++else{+$queryd = "SELECT (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=an_sedi.idanagrafica) AS ragione_sociale, indirizzo, indirizzo2, cap, citta, provincia, piva, codice_fiscale FROM an_sedi WHERE idanagrafica='".$idcliente."' AND id='".$rs[0]['idsede']."'";+$rsd = $dbo->fetchArray($queryd);++if( $rsd[0]['ragione_sociale']!='' )+$destinazione .= $rsd[0]['ragione_sociale']."<br/>\n";+if( $rsd[0]['indirizzo']!='' )+$destinazione .= $rsd[0]['indirizzo']."<br/>\n";+if( $rsd[0]['indirizzo2']!='' )+$destinazione .= $rsd[0]['indirizzo2']."<br/>\n";+if( $rsd[0]['cap']!='' )+$destinazione .= $rsd[0]['cap']." ";+if( $rsd[0]['citta']!='' )+$destinazione .= $rsd[0]['citta'];+if( $rsd[0]['provincia']!='' )+$destinazione .= " (".$rsd[0]['provincia'].")<br/>\n";+if( $rsd[0]['piva']!='' )+$destinazione .= "P.IVA: ".$rsd[0]['piva']."<br/>\n";+if( $rsd[0]['codice_fiscale']!='' )+$destinazione .= "C.F.: ".$rsd[0]['codice_fiscale']."<br/>\n";+}+$body = str_replace( '$c_destinazione$', $destinazione, $body );++++//Dati generici ddt+$body .= "<table style='width:200mm;' class='table_values' border='0' cellspacing='1'>\n";+$body .= "<tr><td width='229' class='center'><b>".$rs[0]['tipo_doc']."</b><br/>n<sup>o</sup> $numero</td>\n";+$body .= "<td width='229' class='center'><b>Data:</b><br/>".date( "d/m/Y", strtotime($rs[0]['data']) )."</td>\n";+$body .= "<td width='229' class='center'><b>Pagamento:</b><br/>".$rs[0]['tipo_pagamento']."</td></tr>\n";+$body .= "</table><br/><br/>\n";++//Intestazione tabella per righe+$body .= "<table class='table_values' border='0' cellspacing='1' style='table-layout:fixed;'>\n";+$body .= "<col width='300'><col width='50'><col width='40'><col width='90'><col width='75'><col width='60'><col width='78'>\n";+$body .= "<thead>\n";+$body .= "<tr><th width='300'>Descrizione</th>\n";+$body .= "<th width='50' align='center'>Q.t&agrave;</th>\n";+$body .= "<th width='40' align='center'>u.m.</th>\n";+$body .= "<th width='90' align='center'>Costo&nbsp;unitario</th>\n";+$body .= "<th width='60' align='center'>Iva</th>\n";+$body .= "<th width='75' align='center'>Imponibile</th></tr>\n";+$body .= "</thead>\n";++$body .= "<tbody>\n";++//Mostro le righe del ddt+$totale_ddt = 0.00;+$totale_imponibile = 0.00;+$totale_iva = 0.00;+$sconto = 0.00;++++/*+Articoli+*/+$q_art = "SELECT *, GROUP_CONCAT( CONCAT_WS(lotto, 'Lotto: ', ', '), CONCAT_WS(serial, 'SN: ', ', '), CONCAT_WS(altro, 'Altro: ', '') SEPARATOR '<br/>') AS codice, SUM(qta) AS sumqta FROM `dt_righe_ddt` GROUP BY idarticolo, idddt, lotto HAVING idddt='$idddt' AND NOT idarticolo='0' ORDER BY idarticolo ASC";+$rs_art = $dbo->fetchArray( $q_art );+$tot_art = sizeof($rs_art);+$imponibile_art = 0.0;+$iva_art = 0.0;++if( $tot_art>0 ){+for( $i=0; $i<$tot_art; $i++ ){+$body .= "<tr><td class='first_cell'>\n";+$body .= nl2br( $rs_art[$i]['descrizione'] );+if( $rs_art[$i]['codice']!='' ){ $body .= "<br/><small>".$rs_art[$i]['codice']."</small>\n"; }++//Aggiunta riferimento a ordine+if( $rs_art[$i]['idordine']!='0' ){+$rso = $dbo->fetchArray("SELECT numero, numero_esterno, data FROM or_ordini WHERE id=\"".$rs_art[$i]['idordine']."\"");+( $rso[0]['numero_esterno']!='' ) ? $numero=$rso[0]['numero_esterno'] : $numero=$rso[0]['numero'];+$body .= "<br/><small>Rif. ordine n<sup>o</sup>".$numero." del ".date("d/m/Y", strtotime($rso[0]['data']) )."</small>";+}++$body .= "</td>\n";++$body .= "<td class='table_cell center' valign='top'>\n";+$body .= number_format($rs_art[$i]['sumqta'], 1, ",", "")."\n";+$body .= "</td>\n";++$body .= "<td class='table_cell center' valign='top'>\n";+$body .= $rs_art[$i]['um']."\n";+$body .= "</td>\n";++$body .= "<td class='table_cell center' valign='top'>\n";+if( $show_costi )+$body .= number_format( $rs_art[$i]['subtotale'], 2, ",", "" )." &euro;\n";+else+$body .= "-";+$body .= "</td>\n";++//Iva+$body .= "<td class='table_cell center' valign='top'>\n";+$iva = $rs_art[$i]['iva'];+if( $show_costi )+$body .= number_format( $iva, 2, ",", "." )." &euro;\n";+else+$body .= "-";+$body .= "</td>\n";++//Imponibile+$body .= "<td class='table_cell center' valign='top'>\n";+if( $show_costi ){+$body .= number_format( $rs_art[$i]['subtotale'], 2, ",", "." )." &euro;\n";++if( $rs_art[$i]['sconto']>0 )+$body .= "<br/>\n<small style='color:#555;'>- sconto ".number_format( $rs_art[$i]['sconto'], 2, ",", "." )." &euro;</small>\n";+}+else+$body .= "-";+$body .= "</td></tr>\n";++$imponibile_art += $rs_art[$i]['subtotale'];+$iva_art += $iva;+$sconto += $rs_art[$i]['sconto'];+}+$imponibile_ddt += $imponibile_art;+$totale_iva += $iva_art;+$totale_ddt += $imponibile_art;+}++++/*+Righe generiche+*/+$q_gen = "SELECT * FROM `dt_righe_ddt` WHERE idddt='$idddt' AND idarticolo=0";+$rs_gen = $dbo->fetchArray( $q_gen );+$tot_gen = sizeof($rs_gen);+$imponibile_gen = 0.0;+$iva_gen = 0.0;++if( $tot_gen>0 ){+for( $i=0; $i<$tot_gen; $i++ ){+$body .= "<tr><td class='first_cell'>\n";+$body .= nl2br( $rs_gen[$i]['descrizione'] );++//Aggiunta riferimento a ordine+if( $rs_gen[$i]['idordine']!='0' ){+$rso = $dbo->fetchArray("SELECT numero, numero_esterno, data FROM or_ordini WHERE id=\"".$rs_gen[$i]['idordine']."\"");+( $rso[0]['numero_esterno']!='' ) ? $numero=$rso[0]['numero_esterno'] : $numero=$rso[0]['numero'];+$body .= "<br/><small>Rif. ordine n<sup>o</sup>".$numero." del ".date("d/m/Y", strtotime($rso[0]['data']) )."</small>";+}+$body .= "</td>\n";++$body .= "<td class='table_cell center'>\n";+$body .= number_format($rs_gen[$i]['qta'], 1, ",", "")."\n";+$body .= "</td>\n";++$body .= "<td class='table_cell center'>\n";+$body .= $rs_gen[$i]['um']."\n";+$body .= "</td>\n";++$body .= "<td class='table_cell center'>\n";+if( $show_costi )+$body .= number_format( $rs_gen[$i]['subtotale']/$rs_gen[$i]['qta'], 2, ",", "" )." &euro;\n";+else+$body .= "-";+$body .= "</td>\n";++//Iva+$body .= "<td class='table_cell center'>\n";+$iva = $rs_gen[$i]['iva'];+if( $show_costi )+$body .= number_format( $iva, 2, ",", "." )." &euro;\n";+else+$body .= "-";+$body .= "</td>\n";++//Imponibile+$body .= "<td class='table_cell center'>\n";+if( $show_costi ){+$body .= number_format( $rs_gen[$i]['subtotale'], 2, ",", "." )." &euro;\n";++if( $rs_gen[$i]['sconto']>0 )+$body .= "<br/>\n<small style='color:#555;'>- sconto ".number_format( $rs_gen[$i]['sconto'], 2, ",", "." )." &euro;</small>\n";+}+else+$body .= "-";+$body .= "</td></tr>\n";++$imponibile_gen += $rs_gen[$i]['subtotale'];+$iva_gen += $iva;+$sconto += $rs_gen[$i]['sconto'];+}+$imponibile_ddt += $imponibile_gen;+$totale_iva += $iva_gen;+$totale_ddt += $imponibile_gen;+}+++//Totale imponibile+if( $show_costi ){+$body .= "<tr><td class='first_cell' colspan='5' align='right'>\n";+$body .= "<b>Totale imponibile:</b>";+$body .= "</td>\n";++$body .= "<td class='table_cell_h center'>\n";+$body .= "<b>".number_format( $imponibile_ddt, 2, ",", "." )." &euro;</b>\n";+$body .= "</td></tr>\n";+++//Mostra sconto se c'è+if( abs($sconto)>0 ){+$body .= "<tr><td class='first_cell' colspan='5' align='right'>\n";+$body .= "<b>Sconto:</b>";+$body .= "</td>\n";++//Sconto+$body .= "<td class='table_cell center'>\n";+$body .= number_format( $sconto, 2, ",", "." )." &euro;";+$body .= "</td>";+$body .= "</tr>\n";+++//Totale scontato+$body .= "<tr><td class='first_cell' colspan='5' align='right'>\n";+$body .= "<b>Totale scontato:</b>";+$body .= "</td>\n";++//Sconto+$body .= "<td class='table_cell center'>\n";+$totale_ddt -= $sconto;+$body .= number_format( $totale_ddt, 2, ",", "." )." &euro;";+$body .= "</td></tr>\n";+}+++//Mostra INPS se c'è+if( abs($rs[0]['rivalsainps'])>0 ){+$body .= "<tr><td class='first_cell' colspan='5' align='right'>\n";+$body .= "<b>Rivalsa INPS:</b>";+$body .= "</td>\n";++//Rivalsa INPS+$body .= "<td class='table_cell center'>\n";+$body .= number_format( $rs[0]['rivalsainps'], 2, ",", "." )." &euro;";+$body .= "</td></tr>\n";+$totale_ddt += $rs[0]['rivalsainps'];+}++//Mostra iva se c'è+$totale_iva += $rs[0]['iva_rivalsainps'];+if( abs($totale_iva)>0 ){+$body .= "<tr><td class='first_cell' colspan='5' align='right'>\n";+$body .= "<b>Iva:</b>";+$body .= "</td>\n";++//Iva+$body .= "<td class='table_cell center'>\n";+$body .= number_format( $totale_iva, 2, ",", "." )." &euro;\n";+$body .= "</td></tr>\n";+$totale_ddt += $totale_iva;+}++/*+Totale ddt+*/+$body .= "<tr><td class='first_cell' colspan='5' align='right'>\n";+$body .= "<b>Totale ddt:</b>";+$body .= "</td>\n";++$body .= "<td class='table_cell_h center'>\n";+$body .= "<b>".number_format( $totale_ddt, 2, ",", "." )." &euro;</b>\n";+$body .= "</td></tr>\n";+$netto_a_pagare = $totale_ddt;+++//Mostra marca da bollo se c'è+if( abs($rs[0]['bollo'])>0 ){+$body .= "<tr><td class='first_cell' colspan='5' align='right'>\n";+$body .= "<b>Marca da bollo:</b>";+$body .= "</td>\n";++//Marca da bollo+$body .= "<td class='table_cell center'>\n";+$marca_da_bollo = str_replace( ",", ".", $rs[0]['bollo'] );+$body .= number_format( $marca_da_bollo, 2, ",", "." )." &euro;";+$body .= "</td></tr>\n";+$netto_a_pagare += $marca_da_bollo;+}+++//Mostra ritenuta d'acconto se c'è+if( abs($rs[0]['ritenutaacconto'])>0 ){+$body .= "<tr><td class='first_cell' colspan='5' align='right'>\n";+$body .= "<b>Ritenuta d'acconto:</b>";+$body .= "</td>\n";++//Ritenuta d'acconto+$body .= "<td class='table_cell center'>\n";+$body .= number_format( $rs[0]['ritenutaacconto'], 2, ",", "." )." &euro;";+$body .= "</td></tr>\n";+$netto_a_pagare -= $rs[0]['ritenutaacconto'];+}++/*+Netto a pagare (se diverso dal totale)+*/+if( $totale_ddt!=$netto_a_pagare ){+$body .= "<tr><td class='first_cell' colspan='5' align='right'>\n";+$body .= "<b>Netto a pagare:</b>";+$body .= "</td>\n";++$body .= "<td class='table_cell_h center'>\n";+$body .= "<b>".number_format( $netto_a_pagare, 2, ",", "." )." &euro;</b>\n";+$body .= "</td></tr>\n";+}+}+$body .= "</tbody>\n";+$body .= "</table>\n";+++//Note+$body .= "<p>".nl2br($rs[0]['note'])."</p>\n";++++if( $rs[0]['vettore']!='' )+$vettore = " (".$rs[0]['vettore'].")";+else+$vettore = '';++//Dati footer ddt+$footer = "<br/><br/><table style='width:200mm;' class='table_values' style='table-layout:fixed;' border='0' cellspacing='1'>\n";+$footer .= "<col width='169'><col width='169'><col width='169'><col width='169'>\n";+$footer .= "<tr><td width='169' height='25' class='center'><b>Colli:</b><br/>".$rs[0]['n_colli']."&nbsp;</td>\n";+$footer .= "<td width='169' class='center'><b>Aspetto beni:</b><br/>".$rs[0]['aspettobeni']."&nbsp;</td>\n";+$footer .= "<td width='169' class='center'><b>Causale trasporto:</b><br/>".$rs[0]['causalet']."&nbsp;</td>\n";+$footer .= "<td width='169' class='center'><b>Porto:</b><br/>".$rs[0]['porto']."&nbsp;</td></tr>\n";+$footer .= "</table>\n";++$footer .= "<table style='width:200mm;' class='table_values' style='table-layout:fixed;' border='0' cellspacing='1'>\n";+$footer .= "<col width='232'><col width='232'><col width='232'>\n";+$footer .= "<tr><td width='232' height='25' class='center'><b>Tipo di spedizione:</b><br/>".$rs[0]['spedizione'].$vettore."&nbsp;</td>\n";+$footer .= "<td width='232' class='center'><b>Conducente:</b><br/>______________________</td>\n";+$footer .= "<td width='233' class='center'><b>Destinatario:</b><br/>______________________</td></tr>\n";+$footer .= "</table>\n";+++$body = str_replace( "|footer|", $footer, $body );++$report_name = "ddt_".$numero_ddt.".pdf";+?>Property changes on: new_trunk/openstamanager/templates/ddt/pdfgen.ddt.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/fatturato/fatturato.html===================================================================--- new_trunk/openstamanager/templates/fatturato/fatturato.html (rev 0)+++ new_trunk/openstamanager/templates/fatturato/fatturato.html2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,59 @@+<style>+<!--+.table_values td{+border: 1px solid #888;+padding: 4px;+white-space: normal;+}++.table_values th{+background: #abbfcb;+padding: 4px;+}++.first_cell{+border-left: 1px solid #aaa;+border-right: 1px solid #aaa;+border-bottom: 1px solid #aaa;+}++.table_cell{+border-bottom: 1px solid #aaa;+border-right: 1px solid #aaa;+}++.full_cell1{+border: 1px solid #aaa;+}++.full_cell{+border-top: 1px solid #aaa;+border-right: 1px solid #aaa;+border-bottom: 1px solid #aaa;+}++.text-center{+text-align: center;+}++.text-right{+text-align: right;+}++.b-right{+border-right: 1px solid #aaa;+}++.b-bottom{+border-bottom: 1px solid #aaa;+}++.cell-padded{+padding: 4px;+}+-->+</style>++<page backcolor="#ffffff" backtop="35mm" backbottom="10mm" backleft="0mm" backright="0mm" footer="" style="font-size: $font_size$">+$body$+</page>Property changes on: new_trunk/openstamanager/templates/fatturato/fatturato.html___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/fatturato/fatturato_body.html===================================================================--- new_trunk/openstamanager/templates/fatturato/fatturato_body.html (rev 0)+++ new_trunk/openstamanager/templates/fatturato/fatturato_body.html2014-06-02 13:23:42 UTC (rev 922)@@ -0,0 +1,22 @@+<page_header>+<table $body_table_params$>+<!-- Intestazione fornitore -->+<tr><td style="width:105mm; font-size:8pt; color:#555;">+<img src="$docroot$/templates/fatturato/logo_azienda.jpg" alt="Logo" border="0" />+</td></tr>+</table>+<br/>+</page_header>+++<!-- Footer -->+<page_footer>+<table style="width:200mm; font-size:7pt; color:#999;">+<tr><td style="width:100mm;">+Stampato con OpenSTAManager+</td>+<td style="width:100mm; text-align:right;">+Pagina [[page_cu]] di [[page_nb]]+</td></tr>+</table>+</page_footer>Property changes on: new_trunk/openstamanager/templates/fatturato/fatturato_body.html___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/fatturato/logo_azienda.jpg===================================================================(Binary files differ)Index: new_trunk/openstamanager/templates/fatturato/logo_azienda.jpg===================================================================--- new_trunk/openstamanager/templates/fatturato/logo_azienda.jpg2014-06-02 12:59:01 UTC (rev 921)+++ new_trunk/openstamanager/templates/fatturato/logo_azienda.jpg2014-06-02 13:23:42 UTC (rev 922)Property changes on: new_trunk/openstamanager/templates/fatturato/logo_azienda.jpg___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: svn:mime-type## -0,0 +1 ##+application/octet-stream\ No newline at end of propertyAdded: new_trunk/openstamanager/templates/fatturato/pdfgen.fatturato.php===================================================================--- new_trunk/openstama... [truncated message content]

[osm-devel] SF.net SVN: openstamanager:[923]new_trunk/openstamanager

From: <lo...@us...> - 2014-06-02 14:29:44

Revision: 923 http://sourceforge.net/p/openstamanager/code/923Author: loviuzDate: 2014-06-02 14:29:39 +0000 (Mon, 02 Jun 2014)Log Message:-----------[core] - predisposizione primo modulo con controller e datatablesModified Paths:-------------- new_trunk/openstamanager/controller.php new_trunk/openstamanager/core.php new_trunk/openstamanager/include/bottom.php new_trunk/openstamanager/include/top.php new_trunk/openstamanager/lib/dbo.class.php new_trunk/openstamanager/lib/functions.php new_trunk/openstamanager/lib/jscripts/app.js new_trunk/openstamanager/lib/jscripts/functions.js new_trunk/openstamanager/update/update_2.0.sqlAdded Paths:----------- new_trunk/openstamanager/lib/htmlbuilder.php new_trunk/openstamanager/lib/jscripts/datatables/ new_trunk/openstamanager/lib/jscripts/datatables/dataTables.bootstrap.js new_trunk/openstamanager/lib/jscripts/datatables/jquery.dataTables.jsRemoved Paths:------------- new_trunk/openstamanager/include/topmenu.phpModified: new_trunk/openstamanager/controller.php===================================================================--- new_trunk/openstamanager/controller.php2014-06-02 13:23:42 UTC (rev 922)+++ new_trunk/openstamanager/controller.php2014-06-02 14:29:39 UTC (rev 923)@@ -1,14 +1,63 @@ <?php include("core.php");-include($docroot."/config.php");+include($docroot."/config.inc.php"); include($docroot."/lib/user_check.php");+include($docroot."/include/top.php"); -$module = $html->form('module');+echo "<h3>".$module."</h3><hr>\n"; -include($docroot."/include/top.php");+/**+ * Widget top+ */ -echo $module; ++/**+ * Datatables con record+ */+//Lettura parametri modulo+$rs = $dbo->fetchArray("SELECT `options` FROM zz_modules WHERE id=\"".$id_module."\"");+$module_options = mb_convert_encoding( $rs[0]['options'], "utf-8", "iso-8859-1" );+$module_options = json_decode( $module_options, true );++$module_query = $module_options['main_query'][0]['query'];+$module_fields = $module_options['main_query'][0]['fields'];+$fields = explode( ",", $module_fields );++$rs = $dbo->fetchArray( $module_query );+++echo "<table class='datatables'>\n";++echo "<thead>";+echo "<tr>";+for( $c=0; $c<sizeof($fields); $c++ ){+echo "<th>".$fields[$c]."</th>\n";+}+echo "</tr>";+echo "</thead>";+++for( $r=0; $r<sizeof($rs); $r++ ){+echo "<tbody>";+echo "<tr>";++for( $c=0; $c<sizeof($fields); $c++ ){+echo "<td>".$rs[$r][ trim($fields[$c]) ]."</td>\n";+}++echo "</tr>\n";+echo "</tbody>";+}++echo "</table>\n";++++/**+ * TODO: Futuro include di widget laterali+ */+ include($docroot."/include/bottom.php"); ?>- +Modified: new_trunk/openstamanager/core.php===================================================================--- new_trunk/openstamanager/core.php2014-06-02 13:23:42 UTC (rev 922)+++ new_trunk/openstamanager/core.php2014-06-02 14:29:39 UTC (rev 923)@@ -11,7 +11,7 @@ ini_set("magic_quotes","Off"); ini_set("register_globals","Off"); ini_set( 'date.timezone', 'Europe/Rome' );-error_reporting( "E_ALL & ~E_NOTICE" );+//error_reporting( "E_ALL & ~E_NOTICE" ); $script_filename = str_replace( "\\", "/", __FILE__ );//fix for Windows@@ -58,6 +58,7 @@ array_push($css_modules, $theme_path."/css/font-awesome.min.css"); array_push($css_modules, $theme_path."/css/AdminLTE.css"); array_push($css_modules, $theme_path."/css/jQueryUI/jquery-ui-1.10.3.custom.min.css");+array_push($css_modules, $theme_path."/css/datatables/dataTables.bootstrap.css"); array_push($css_modules, $theme_path."/css/chosen.css"); array_push($css_modules, $theme_path."/css/style.css"); @@ -66,6 +67,8 @@ array_push($jscript_modules, $rootdir."/lib/jscripts/app.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery-ui-1.10.4.min.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery.ui.datepicker-".$lang.".js");+array_push($jscript_modules, $rootdir."/lib/jscripts/datatables/jquery.dataTables.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/datatables/dataTables.bootstrap.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/chosen.jquery.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/functions.js"); Modified: new_trunk/openstamanager/include/bottom.php===================================================================--- new_trunk/openstamanager/include/bottom.php2014-06-02 13:23:42 UTC (rev 922)+++ new_trunk/openstamanager/include/bottom.php2014-06-02 14:29:39 UTC (rev 923)@@ -19,7 +19,21 @@ echo "setInterval( \"session_keep_alive()\", 5*60*1000 );\n";//5 minuti echo "</script>\n"; }+++echo "<div id='alerts'>\n";++for( $i=0; $i<sizeof($infos); $i++ ){+echo "<div class='alert alert-success'>".$infos[$i]."</div>";+}++for( $i=0; $i<sizeof($errors); $i++ ){+echo "<div class='alert alert-danger'>".$errors[$i]."</div>";+}++echo "</div>\n"; ?>+ </body> </html><?php $dbo->close();Modified: new_trunk/openstamanager/include/top.php===================================================================--- new_trunk/openstamanager/include/top.php2014-06-02 13:23:42 UTC (rev 922)+++ new_trunk/openstamanager/include/top.php2014-06-02 14:29:39 UTC (rev 923)@@ -20,15 +20,15 @@ exit; } --$nome_modulo = get_module_name();+$id_module = $html->form('id_module');+$module = get_module_name( $id_module ); } ?><!DOCTYPE html> <html class="bg-black"> <head> <meta charset="UTF-8">- <title><?php echo $module; ?> - OpenSTAManager</title>+ <title><?php echo $module ?> - OpenSTAManager</title> <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> <?php loadCSSModules($css_modules);@@ -148,7 +148,7 @@ $submodules = explode( ',', $rs[$i]['submodules'] ); ( $module == $rs[$i]['name'] || (in_array($nome_modulo, $submodules) && $rs[$i]['submodules']!='') ) ? $class="active" : $class=""; -( $rs[$i]['link']!="#" ) ? $link=$rootdir."/controller.php?module=".$rs[$i]['name'] : $link="#";+( $rs[$i]['link']!="#" ) ? $link=$rootdir."/controller.php?id_module=".$rs[$i]['id'] : $link="#"; echo "<li class='treeview ".$class."'>\n"; echo "<a href=\"".$link."\">\n";@@ -177,20 +177,21 @@ for( $j=0; $j<sizeof($rs2); $j++ ){ ( $rs2[$j]['module_dir']!='' ) ? $subdir=$rs2[$j]['module_dir']."/" : $subdir=''; ( $module == $rs2[$j]['name'] ) ? $attr='class="active"' : $attr='';-echo "<li $attr><a href='".$rootdir."/controller.php?module=".$rs2[$j]['name']."'>".$rs2[$j]['name']."</a></li>\n";+echo "<li $attr><a href='".$rootdir."/controller.php?id_module=".$rs2[$j]['id']."'>".$rs2[$j]['name']."</a></li>\n"; } echo "</ul>\n"; } else{-echo "</a>\n";+if( $show ){+echo "</a>\n";+echo "</li>\n";+} } -if( $show ){-echo "</li>\n";-}+ } } ?>@@ -205,5 +206,5 @@ <section class="content"> <div class="row"> <div class="col-md-9">- + <div id="main-alerts"></div> Deleted: new_trunk/openstamanager/include/topmenu.php===================================================================--- new_trunk/openstamanager/include/topmenu.php2014-06-02 13:23:42 UTC (rev 922)+++ new_trunk/openstamanager/include/topmenu.php2014-06-02 14:29:39 UTC (rev 923)@@ -1,137 +0,0 @@-<!-- first bar -->-<div id="top">-<div>-<div style="float:left; margin-top:-4px;">-<input type="text" class="searchfld" id="supersearch" placeholder="Ricerca rapida..." />-</div>--<div style="float:left; left:220px; position:relative;" id="datetime"></div>-<? if( $_SESSION['username']!="" ){ ?>-<div style="float:right; margin-top:-2px;">-<p style="display:inline-block;position:relative; top:-8px;">Ciao, <? echo $_SESSION['username'] ?>!</p>-<a href="<? echo $rootdir ?>/info.php" class="tip" title="Info"><img src="<? echo $theme_path ?>/images/btn_info.png" alt="Info" border="0" /></a>-<?php if( $_SESSION['is_admin']==true ){ ?>-<a href="<? echo $rootdir ?>/permissions.php" class="tip" title="Utenti e permessi"><img src="<? echo $theme_path ?>/images/btn_permissions.png" alt="Utenti e permessi" border="0" /></a>-<a href="<? echo $rootdir ?>/settings.php" class="tip" title="Impostazioni"><img src="<? echo $theme_path ?>/images/btn_settings.png" alt="Impostazioni" border="0" /></a>-<?php } ?>-<a class="clickable tip" title="Esci dal programma" onclick="confirmAndLink( '','','Sei sicuro di voler uscire?','','<? echo $rootdir ?>/index.php?op=logout' );"><img src="<? echo $theme_path ?>/images/btn_logout.png" alt="Logout" border="0" /></a>-</div>-<? } ?>-</div>-</div>--<!-- PAGE -->-<div id="page">--<!--LOGO margin: 3px 10px 0px 40px; -->-<img src="<? echo $theme_path ?>/images/logo.png" alt="OpenSTAManager" border="0" id="logo" />--<!--TOOLBAR-->-<ul id="toolbar" >--<?php-//Se l'utente è is_admin mostro tutti i moduli, altrimenti solo quelli con accesso in r o rw-$q = "SELECT *, ( SELECT GROUP_CONCAT(name) FROM zz_modules GROUP BY parent HAVING parent=m1.id ) AS submodules FROM zz_modules m1 WHERE level='0' AND enabled='1' AND `type`='menu' ORDER BY `order` ASC";-$rs = $dbo->fetchArray($q);--if( sizeof($rs) > 0 ){-for( $i=0; $i<sizeof($rs); $i++){--//Se non sono admin, passo alla verifica dei permessi-if( !$_SESSION['is_admin'] ){--//Verifico che questo modulo sia r o rw o abbia almeno un sottomodulo in r o rw-$q2 = "SELECT permessi FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule='".$rs[$i]['id']."'";-$rs2 = $dbo->fetchArray($q2);--//Se non c'è il permesso di vedere il modulo di primo livello, verifico se ci sono dei moduli collegati nel secondo livello, quindi mostrerò anche il primo-if( sizeof($rs2)==0 || $rs2[0]['permessi']=='-' || $rs2[0]['permessi']=='r' ){-$q3 = "SELECT permessi FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule='".$rs[$i]['id']."' AND permessi IN ('rw', 'r')";-if( $dbo->fetchNum($q3) == 0 )-$show = false;-else-$show = true;-}-else-$show = true;-}--//Se sono admin e nono sono specificati permessi, proseguo. Altrimenti li tengo in considerazione-else{-$rsa = $dbo->fetchArray("SELECT permessi FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule='".$rs[$i]['id']."'");-if( sizeof($rsa)==0 )-$show = true;-else{-if( $rsa[0]['permessi']!='-' )-$show = true;-else-$show = false;-}-}---if( $show ){-//Evidenzio il modulo principale anche se sono dentro ad un sottomodulo-$submodules = explode( ',', $rs[$i]['submodules'] );-( $nome_modulo == $rs[$i]['name'] || (in_array($nome_modulo, $submodules) && $rs[$i]['submodules']!='') ) ? $class = " class='module selected'" : $class=" class='module'";-echo "<li id=\"".$rs[$i]['id']."\" $class>\n";--//Se non si deve linkare il menu metto l'ancora-( $rs[$i]['link']!="#" ) ? $link=$rootdir."/modules/".$rs[$i]['module_dir']."/".$rs[$i]['link'] : $link="#";-echo "<a href=\"".$link."\"><img src=\"".$theme_path."/images/".$rs[$i]['icon']."\" alt=\"".$rs[$i]['name']."\" border=\"0\" /><br/>".$rs[$i]['name']."</a>\n";-}----//Sottomenu livello 2-if( $_SESSION['is_admin'] )-$q2 = "SELECT * FROM zz_modules WHERE level='1' AND enabled='1' AND parent='".$rs[$i]['id']."' AND `type`='menu' ORDER BY `order` ASC";-else-$q2 = "SELECT * FROM zz_modules WHERE level='1' AND enabled='1' AND parent='".$rs[$i]['id']."' AND `type`='menu' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND (permessi IN('rw', 'r'))) ORDER BY `order` ASC";-$rs2 = $dbo->fetchArray($q2);-if( sizeof($rs2) > 0 ){-echo "<ul>\n";-for( $j=0; $j<sizeof($rs2); $j++ ){-( $rs2[$j]['module_dir']!='' ) ? $subdir=$rs2[$j]['module_dir']."/" : $subdir='';-( $nome_modulo == $rs2[$j]['name'] ) ? $attr='class="selected"' : $attr='';-echo "<li $attr><a href='".$rootdir."/modules/".$rs[$i]['module_dir']."/".$subdir.$rs2[$j]['link']."'>".$rs2[$j]['name']."</a></li>\n";-}-echo "</ul>\n";-}--if( $show )-echo "</li>\n";--}-}-?>-</ul>-<div style="clear:both;"></div>---<?php-include_once($docroot."/lib/permissions_check.php");-?>---<?php if( $permessi[$nome_modulo]=='r' ){ ?>-<!-- Disabilito i campi di input se l'utente ha i permessi in sola lettura -->-<script type="text/javascript">-$(document).ready( function(){-$('input, select, textarea').not('.searchfld').each( function(){-if( $(this).is('input[type=text], input[type=password]') || $(this).is('textarea') ){-$(this).replaceWith('<span>'+$(this).val().replace("\n", "<br/>")+'</span>');-}-else if( $(this).is('select') ){-$(this).replaceWith('<span>'+$(this).find('option:selected').text()+'</span>');-}-});--$('input[type=button], input[type=submit], .only_rw').not('.searchfld').hide();-$('input[type=checkbox]').not('.searchfld').show().attr('disabled', 'true');-});-</script>-<?php } ?>--<!-- TITOLO MODULO -->-<div class="center"><h3><? echo $nome_modulo ?></h3></div>Modified: new_trunk/openstamanager/lib/dbo.class.php===================================================================--- new_trunk/openstamanager/lib/dbo.class.php2014-06-02 13:23:42 UTC (rev 922)+++ new_trunk/openstamanager/lib/dbo.class.php2014-06-02 14:29:39 UTC (rev 923)@@ -22,6 +22,9 @@ //query on the table function query($sql, $hide_errors=0){+global $infos;+global $errors;+ if( @mysql_query($sql) ){ $id = mysql_insert_id(); if( $id==0 )@@ -31,7 +34,7 @@ } else{ if( $hide_errors==0 )-write_error( mysql_error(),"300px" );+array_push( $errors, mysql_error() ); else return false; }@@ -54,6 +57,9 @@ //fetch records function fetchArray($sql){+global $infos;+global $errors;+ $i=0; if( $q=@mysql_query($sql) ) while( $rs=mysql_fetch_array( $q, MYSQL_ASSOC ) ){@@ -62,12 +68,15 @@ } else if( $hide_error==0 )-write_error( mysql_error(),"300px" );+array_push( $errors, mysql_error() ); return $array; } //fetch records (numero al posto del nome del campo) function fetchRows($sql){+global $infos;+global $errors;+ $i=0; if( $q=@mysql_query($sql) ) while( $rs=mysql_fetch_row($q) ){@@ -76,7 +85,7 @@ } else if( $hide_error==0 )-write_error( mysql_error(),"300px" );+array_push( $errors, mysql_error() ); return $array; } Modified: new_trunk/openstamanager/lib/functions.php===================================================================--- new_trunk/openstamanager/lib/functions.php2014-06-02 13:23:42 UTC (rev 922)+++ new_trunk/openstamanager/lib/functions.php2014-06-02 14:29:39 UTC (rev 923)@@ -629,45 +629,14 @@ /**- * Restituisce il nome del modulo in uso partendo dall'URL+ * Restituisce il nome del modulo in uso partendo dal parametro "module=" dell'URL */-function get_module_name(){+function get_module_name( $id_module ){ global $dbo; -//Lettura modulo attuale-$pagina = $_SERVER['REQUEST_URI'];-preg_match( "/^(.*)\/(.*)\.php(.*)$/", $pagina, $m );-$pagina = $m[2].".php";--if( strstr( $m[3], "&" ) ){-$v = explode("&", $m[3] );-$params = $v[0];-}-else-$params = $m[3];--if( $params!='' )-$pagina .= $params;--$rs = $dbo->fetchArray( "SELECT name, module_dir FROM zz_modules AS m1 WHERE (link LIKE \"%".$pagina."%\" AND module_dir=\"".getLastPathSegment($_SERVER['REQUEST_URI'])."\") OR (link LIKE \"%".$pagina."%\" AND (SELECT module_dir FROM zz_modules m2 WHERE id=m1.parent)=\"".getLastPathSegment($_SERVER['REQUEST_URI'])."\")" );--//Se c'è un modulo con dei parametri nell'url (subito dopo il ?) lo trova...-if( sizeof($rs)==1 ){-$nome_modulo = $rs[0]['name'];-}--//...altrimenti bisogna provare a leggere splittando sul ?-else{-$p = explode("?", $pagina);-$pagina = $p[0];-$f = pathinfo($pagina);-$pagina = $f['basename'];---if( $rs = $dbo->fetchArray( "SELECT name, module_dir FROM zz_modules WHERE link LIKE \"%".$pagina."%\"" ) )-$nome_modulo = $rs[0]['name'];-}-return $nome_modulo;+$rs = $dbo->fetchArray( "SELECT name FROM zz_modules WHERE id=\"".$id_module."\"" );++return $rs[0]['name']; } Added: new_trunk/openstamanager/lib/htmlbuilder.php===================================================================--- new_trunk/openstamanager/lib/htmlbuilder.php (rev 0)+++ new_trunk/openstamanager/lib/htmlbuilder.php2014-06-02 14:29:39 UTC (rev 923)@@ -0,0 +1,249 @@+<?php+/**+ * Questa classe serve per costruire pezzi di html ripetitivi, in modo da non ripetere+ * porzioni di codice con copia-incolla+*/+++/**+ * Crea l'elemento <select> a partire da una query e alcuni valori+ * $querystringQuery da cui generare la scelta+ * $idnamestringid da assegnare al <select>+ * $default_valuestringValore di default in base a cui impostare una <option> come selezionata, Se non+ c'è, non la mostra come <option>+ * $unselected_labelstringStringa da visualizzare nella prima <option> quando non è selezionata+ * $condition_rwbooleanCondizione da indicare per rendere il campo un <select>. Se false, rende il campo+ un semplice campo di testo (ad esempio se i permessi sono sola lettura). Si deve+ avere anche il permesso rw del modulo+ * $otherstringAltri attributi da aggiungere al <select> (tipo eventi onchange, ecc)+ */+function html_select( $query, $idname, $default_value, $unselected_label, $other='', $condition_rw=true ){+global $dbo;+global $permessi;+global $nome_modulo;+++$rs = $dbo->fetchArray($query);++//Verifico a cascata i permessi per scegliere se visualizzare il <select> o lo <span>+$can_edit = false;++if( $permessi[$nome_modulo]=='rw' ){+if( $condition_rw )+$can_edit = true;+else+$can_edit = false;+}+else{+$can_edit = false;+}++++if( $can_edit ){+echo "<select name=\"".$idname."\" id=\"".$idname."\" $other >\n";+if( $unselected_label!='' )+echo "<option value=\"0\">".$unselected_label."</option>\n";+for( $i=0; $i<sizeof($rs); $i++ ){+( $rs[$i]['id'] == $default_value ) ? $attr='selected="true"' : $attr='';+echo "<option value=\"".$rs[$i]['id']."\" $attr>".$rs[$i]['descrizione']."</option>\n";+}+echo "</select>\n";+}++//Se non ci sono i permessi in scrittura mostro uno span+else{+//Se non c'è un valore predefinito non mostro niente...+if( $default_value == '0' ){+//echo "<span>".$rs[0]['descrizione']."</span>\n";+//echo "<input type='hidden' name=\"".$idname."\" value=\"".$rs[0]['id']."\" />\n";+echo "<input type='hidden' name=\"".$idname."\" value=\"\" />\n";+}++//...altrimenti mostro come testo il valore selezionato+else{+$descrizione = '';+for( $i=0; $i<sizeof($rs); $i++ )+if( $rs[$i]['id'] == $default_value )+$descrizione = $rs[$i]['descrizione'];++echo "<span>".$descrizione."</span>\n";+echo "<input type='hidden' name=\"".$idname."\" value=\"".$default_value."\" />\n";+}+}+}+++++/**+ * Funzione per generare i campi <input> di tipo testo. I nomi dei campi devono avere lo stesso nome dei campi+ di database per far funzionare correttamente l'UPDATE+ *+ *$namestringNome del campo+ * $valuestringValore del campo+ * $default_valuestringValore di default+ * $condition_rwbooleanCondizione da indicare per rendere il campo un <input>. Se false, rende il campo+ un semplice campo di testo (ad esempio se i permessi sono sola lettura). Si deve+ avere anche il permesso rw del modulo+ * $otherstringAltri attributi da aggiungere all'<input> (tipo eventi onchange, ecc)+ *+*/+function html_inputtext( $name, $title='', $value='', $default_value='', $condition_rw=true, $other='' ){+global $dbo;+global $permessi;+global $nome_modulo;+++//Verifico a cascata i permessi per scegliere se visualizzare il <select> o lo <span>+$can_edit = false;++if( $permessi[$nome_modulo]=='rw' ){+if( $condition_rw )+$can_edit = true;+else+$can_edit = false;+}+else{+$can_edit = false;+}++++if( $can_edit ){+if( $default_value!='' && $default_value==$value )+$attr = 'class="default_value" start_value="'.$default_value.'"';+else+$attr = '';+echo "<input type='text' name=\"".$name."\" id=\"".$name."\" title=\"".htmlentities($title)."\" value=\"".$value."\" $attr $other />\n";+}++//Se non ci sono i permessi in scrittura mostro uno span+else{+echo "<span>".$value."</span>\n";+echo "<input type='hidden' name=\"".$name."\" id=\"".$name."\" value=\"".$value."\" />\n";+}+}+++++/**+ * Visualizza una tabella con $n_cols colonne in base alla tabella di database, mostrando solo i campi con un Comment+ * Se viene specificata anche la $query, ripete il form in base al numero di risultati della query e la popola con i record+ */+function html_table4input( $table, $n_cols, $query='', $other='', $col1_width='100', $col2_width='200' ){+global $dbo;+global $permessi;+global $nome_modulo;++$q = "SHOW FULL COLUMNS FROM $table";+$rs = $dbo->fetchArray($q);+++//Popolamento campi+if( $query!='' ){+$rs2 = $dbo->fetchArray($query);++for( $j=0; $j<sizeof($rs2); $j++ ){+echo "<table $other>\n";++$c = 0;+for( $i=0; $i<sizeof($rs); $i++ ){+if( $rs[$i]['Comment']!='' ){+if( ($c%$n_cols) == 0 )+echo "<tr>";++//Se nel commento c'è una query di selezione, la tolgo dall'etichetta e mostro il <select> popolandolo con+//i risultati della query (es. Comment = "Zona (query=SELECT....)"+if( preg_match( "/(.+?) \{(.+?)\}/", $rs[$i]['Comment'], $m ) ){+$label = $m[1];+$query = str_replace( "query=", "", $m[2] );+}++else{+$label = $rs[$i]['Comment'];+$query = "";+}++echo "<td width='".$col2_width."'>\n";+if( $query=="" ){+html_inputtext( $rs[$i]['Field'], $rs[$i]['Comment'], $rs2[$j][ $rs[$i]['Field'] ] );+}++//Campo query, quindi mostro un select+else{+$rs3 = $dbo->fetchArray($query);++echo "<select name='".$rs[$i]['Field']."' class='inputtext'>\n";+echo "<option value=''>- Seleziona un valore -</option>\n";+for( $x=0; $x<sizeof($rs3); $x++ ){+echo "<option value='".$rs3[$x]['id']."'>".$rs3[$x]['descrizione']."</option>\n";+}+echo "</select>\n";+}+echo "</td>\n";++if( (($c-1)%$n_cols) == 0 )+echo "</tr>";+$c++;+}+}+echo "</table>\n";+}+}++//Una tabella vuota+else{+echo "<table $other>\n";++$c = 0;+for( $i=0; $i<sizeof($rs); $i++ ){+if( $rs[$i]['Comment']!='' ){+if( ($c%$n_cols) == 0 )+echo "<tr>";+++//Se nel commento c'è una query di selezione, la tolgo dall'etichetta e mostro il <select> popolandolo con+//i risultati della query (es. Comment = "Zona (query=SELECT....)"+if( preg_match( "/(.+?) \{(.+?)\}/", $rs[$i]['Comment'], $m ) ){+$label = $m[1];+$query = str_replace( "query=", "", $m[2] );+}++else{+$label = $rs[$i]['Comment'];+$query = "";+}++echo "<td align='right' width='".$col1_width."'>\n";+echo "<b>".$label.":</b>\n";+echo "</td>\n";++echo "<td width='".$col2_width."'>\n";+if( $query=="" ){+html_inputtext( $rs[$i]['Field'], $rs[$i]['Comment'], $rs2[$j][ $rs[$i]['Field'] ] );+}++//Campo query, quindi mostro un select+else{+$rs3 = $dbo->fetchArray($query);++echo "<select name='".$rs[$i]['Field']."' class='inputtext'>\n";+echo "<option value=''>- Seleziona un valore -</option>\n";+for( $x=0; $x<sizeof($rs3); $x++ ){+echo "<option value='".$rs3[$x]['id']."'>".$rs3[$x]['descrizione']."</option>\n";+}+echo "</select>\n";+}+echo "</td>\n";++if( (($c-1)%$n_cols) == 0 )+echo "</tr>";+$c++;+}+}+echo "</table>\n";+}+}+?>Property changes on: new_trunk/openstamanager/lib/htmlbuilder.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyModified: new_trunk/openstamanager/lib/jscripts/app.js===================================================================--- new_trunk/openstamanager/lib/jscripts/app.js2014-06-02 13:23:42 UTC (rev 922)+++ new_trunk/openstamanager/lib/jscripts/app.js2014-06-02 14:29:39 UTC (rev 923)@@ -590,8 +590,8 @@ //initialize already active menus if (isActive) {- menu.show();- btn.children(".fa-angle-left").first().removeClass("fa-angle-left").addClass("fa-angle-down");+ //menu.show();+ //btn.children(".fa-angle-left").first().removeClass("fa-angle-left").addClass("fa-angle-down"); } //Slide open or close the menu on link click btn.click(function(e) {Added: new_trunk/openstamanager/lib/jscripts/datatables/dataTables.bootstrap.js===================================================================--- new_trunk/openstamanager/lib/jscripts/datatables/dataTables.bootstrap.js (rev 0)+++ new_trunk/openstamanager/lib/jscripts/datatables/dataTables.bootstrap.js2014-06-02 14:29:39 UTC (rev 923)@@ -0,0 +1,250 @@+/* Set the defaults for DataTables initialisation */+$.extend( true, $.fn.dataTable.defaults, {+"sDom":+"<'row'<'col-xs-6'l><'col-xs-6'f>r>"++"t"++"<'row'<'col-xs-6'i><'col-xs-6'p>>",+"oLanguage": {+"sLengthMenu": "_MENU_ records per page"+}+} );+++/* Default class modification */+$.extend( $.fn.dataTableExt.oStdClasses, {+"sWrapper": "dataTables_wrapper form-inline",+"sFilterInput": "form-control input-sm",+"sLengthSelect": "form-control input-sm"+} );++// In 1.10 we use the pagination renderers to draw the Bootstrap paging,+// rather than custom plug-in+if ( $.fn.dataTable.Api ) {+$.fn.dataTable.defaults.renderer = 'bootstrap';+$.fn.dataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) {+var api = new $.fn.dataTable.Api( settings );+var classes = settings.oClasses;+var lang = settings.oLanguage.oPaginate;+var btnDisplay, btnClass;++var attach = function( container, buttons ) {+var i, ien, node, button;+var clickHandler = function ( e ) {+e.preventDefault();+if ( e.data.action !== 'ellipsis' ) {+api.page( e.data.action ).draw( false );+}+};++for ( i=0, ien=buttons.length ; i<ien ; i++ ) {+button = buttons[i];++if ( $.isArray( button ) ) {+attach( container, button );+}+else {+btnDisplay = '';+btnClass = '';++switch ( button ) {+case 'ellipsis':+btnDisplay = '&hellip;';+btnClass = 'disabled';+break;++case 'first':+btnDisplay = lang.sFirst;+btnClass = button + (page > 0 ?+'' : ' disabled');+break;++case 'previous':+btnDisplay = lang.sPrevious;+btnClass = button + (page > 0 ?+'' : ' disabled');+break;++case 'next':+btnDisplay = lang.sNext;+btnClass = button + (page < pages-1 ?+'' : ' disabled');+break;++case 'last':+btnDisplay = lang.sLast;+btnClass = button + (page < pages-1 ?+'' : ' disabled');+break;++default:+btnDisplay = button + 1;+btnClass = page === button ?+'active' : '';+break;+}++if ( btnDisplay ) {+node = $('<li>', {+'class': classes.sPageButton+' '+btnClass,+'aria-controls': settings.sTableId,+'tabindex': settings.iTabIndex,+'id': idx === 0 && typeof button === 'string' ?+settings.sTableId +'_'+ button :+null+} )+.append( $('<a>', {+'href': '#'+} )+.html( btnDisplay )+)+.appendTo( container );++settings.oApi._fnBindAction(+node, {action: button}, clickHandler+);+}+}+}+};++attach(+$(host).empty().html('<ul class="pagination"/>').children('ul'),+buttons+);+}+}+else {+// Integration for 1.9-+$.fn.dataTable.defaults.sPaginationType = 'bootstrap';++/* API method to get paging information */+$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )+{+return {+"iStart": oSettings._iDisplayStart,+"iEnd": oSettings.fnDisplayEnd(),+"iLength": oSettings._iDisplayLength,+"iTotal": oSettings.fnRecordsTotal(),+"iFilteredTotal": oSettings.fnRecordsDisplay(),+"iPage": oSettings._iDisplayLength === -1 ?+0 : Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),+"iTotalPages": oSettings._iDisplayLength === -1 ?+0 : Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )+};+};++/* Bootstrap style pagination control */+$.extend( $.fn.dataTableExt.oPagination, {+"bootstrap": {+"fnInit": function( oSettings, nPaging, fnDraw ) {+var oLang = oSettings.oLanguage.oPaginate;+var fnClickHandler = function ( e ) {+e.preventDefault();+if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) {+fnDraw( oSettings );+}+};++$(nPaging).append(+'<ul class="pagination">'++'<li class="prev disabled"><a href="#">&larr; '+oLang.sPrevious+'</a></li>'++'<li class="next disabled"><a href="#">'+oLang.sNext+' &rarr; </a></li>'++'</ul>'+);+var els = $('a', nPaging);+$(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler );+$(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler );+},++"fnUpdate": function ( oSettings, fnDraw ) {+var iListLength = 5;+var oPaging = oSettings.oInstance.fnPagingInfo();+var an = oSettings.aanFeatures.p;+var i, ien, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);++if ( oPaging.iTotalPages < iListLength) {+iStart = 1;+iEnd = oPaging.iTotalPages;+}+else if ( oPaging.iPage <= iHalf ) {+iStart = 1;+iEnd = iListLength;+} else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) {+iStart = oPaging.iTotalPages - iListLength + 1;+iEnd = oPaging.iTotalPages;+} else {+iStart = oPaging.iPage - iHalf + 1;+iEnd = iStart + iListLength - 1;+}++for ( i=0, ien=an.length ; i<ien ; i++ ) {+// Remove the middle elements+$('li:gt(0)', an[i]).filter(':not(:last)').remove();++// Add the new list items and their event handlers+for ( j=iStart ; j<=iEnd ; j++ ) {+sClass = (j==oPaging.iPage+1) ? 'class="active"' : '';+$('<li '+sClass+'><a href="#">'+j+'</a></li>')+.insertBefore( $('li:last', an[i])[0] )+.bind('click', function (e) {+e.preventDefault();+oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength;+fnDraw( oSettings );+} );+}++// Add / remove disabled classes from the static elements+if ( oPaging.iPage === 0 ) {+$('li:first', an[i]).addClass('disabled');+} else {+$('li:first', an[i]).removeClass('disabled');+}++if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {+$('li:last', an[i]).addClass('disabled');+} else {+$('li:last', an[i]).removeClass('disabled');+}+}+}+}+} );+}+++/*+ * TableTools Bootstrap compatibility+ * Required TableTools 2.1++ */+if ( $.fn.DataTable.TableTools ) {+// Set the classes that TableTools uses to something suitable for Bootstrap+$.extend( true, $.fn.DataTable.TableTools.classes, {+"container": "DTTT btn-group",+"buttons": {+"normal": "btn btn-default",+"disabled": "disabled"+},+"collection": {+"container": "DTTT_dropdown dropdown-menu",+"buttons": {+"normal": "",+"disabled": "disabled"+}+},+"print": {+"info": "DTTT_print_info modal"+},+"select": {+"row": "active"+}+} );++// Have the collection use a bootstrap compatible dropdown+$.extend( true, $.fn.DataTable.TableTools.DEFAULTS.oTags, {+"collection": {+"container": "ul",+"button": "li",+"liner": "a"+}+} );+}\ No newline at end of fileProperty changes on: new_trunk/openstamanager/lib/jscripts/datatables/dataTables.bootstrap.js___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/lib/jscripts/datatables/jquery.dataTables.js===================================================================--- new_trunk/openstamanager/lib/jscripts/datatables/jquery.dataTables.js (rev 0)+++ new_trunk/openstamanager/lib/jscripts/datatables/jquery.dataTables.js2014-06-02 14:29:39 UTC (rev 923)@@ -0,0 +1,12099 @@+/**+ * @summary DataTables+ * @description Paginate, search and sort HTML tables+ * @version 1.9.4+ * @file jquery.dataTables.js+ * @author Allan Jardine (www.sprymedia.co.uk)+ * @contact www.sprymedia.co.uk/contact+ *+ * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved.+ *+ * This source file is free software, under either the GPL v2 license or a+ * BSD style license, available at:+ * http://datatables.net/license_gpl2+ * http://datatables.net/license_bsd+ * + * This source file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.+ * + * For details please refer to: http://www.datatables.net+ */++/*jslint evil: true, undef: true, browser: true */+/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns*/++(/** @lends <global> */function( window, document, undefined ) {++(function( factory ) {+"use strict";++// Define as an AMD module if possible+if ( typeof define === 'function' && define.amd )+{+define( ['jquery'], factory );+}+/* Define using browser globals otherwise+ * Prevent multiple instantiations if the script is loaded twice+ */+else if ( jQuery && !jQuery.fn.dataTable )+{+factory( jQuery );+}+}+(/** @lends <global> */function( $ ) {+"use strict";+/** + * DataTables is a plug-in for the jQuery Javascript library. It is a + * highly flexible tool, based upon the foundations of progressive + * enhancement, which will add advanced interaction controls to any + * HTML table. For a full list of features please refer to+ * <a href="http://datatables.net">DataTables.net</a>.+ *+ * Note that the <i>DataTable</i> object is not a global variable but is+ * aliased to <i>jQuery.fn.DataTable</i> and <i>jQuery.fn.dataTable</i> through which + * it may be accessed.+ *+ * @class+ * @param {object} [oInit={}] Configuration object for DataTables. Options+ * are defined by {@link DataTable.defaults}+ * @requires jQuery 1.3++ * + * @example+ * // Basic initialisation+ * $(document).ready( function {+ * $('#example').dataTable();+ * } );+ * + * @example+ * // Initialisation with configuration options - in this case, disable+ * // pagination and sorting.+ * $(document).ready( function {+ * $('#example').dataTable( {+ * "bPaginate": false,+ * "bSort": false + * } );+ * } );+ */+var DataTable = function( oInit )+{+++/**+ * Add a column to the list used for the table with default values+ * @param {object} oSettings dataTables settings object+ * @param {node} nTh The th element for this column+ * @memberof DataTable#oApi+ */+function _fnAddColumn( oSettings, nTh )+{+var oDefaults = DataTable.defaults.columns;+var iCol = oSettings.aoColumns.length;+var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {+"sSortingClass": oSettings.oClasses.sSortable,+"sSortingClassJUI": oSettings.oClasses.sSortJUI,+"nTh": nTh ? nTh : document.createElement('th'),+"sTitle": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '',+"aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol],+"mData": oDefaults.mData ? oDefaults.oDefaults : iCol+} );+oSettings.aoColumns.push( oCol );++/* Add a column specific filter */+if ( oSettings.aoPreSearchCols[ iCol ] === undefined || oSettings.aoPreSearchCols[ iCol ] === null )+{+oSettings.aoPreSearchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch );+}+else+{+var oPre = oSettings.aoPreSearchCols[ iCol ];++/* Don't require that the user must specify bRegex, bSmart or bCaseInsensitive */+if ( oPre.bRegex === undefined )+{+oPre.bRegex = true;+}++if ( oPre.bSmart === undefined )+{+oPre.bSmart = true;+}++if ( oPre.bCaseInsensitive === undefined )+{+oPre.bCaseInsensitive = true;+}+}++/* Use the column options function to initialise classes etc */+_fnColumnOptions( oSettings, iCol, null );+}+++/**+ * Apply options for a column+ * @param {object} oSettings dataTables settings object+ * @param {int} iCol column index to consider+ * @param {object} oOptions object with sType, bVisible and bSearchable etc+ * @memberof DataTable#oApi+ */+function _fnColumnOptions( oSettings, iCol, oOptions )+{+var oCol = oSettings.aoColumns[ iCol ];++/* User specified column options */+if ( oOptions !== undefined && oOptions !== null )+{+/* Backwards compatibility for mDataProp */+if ( oOptions.mDataProp && !oOptions.mData )+{+oOptions.mData = oOptions.mDataProp;+}++if ( oOptions.sType !== undefined )+{+oCol.sType = oOptions.sType;+oCol._bAutoType = false;+}++$.extend( oCol, oOptions );+_fnMap( oCol, oOptions, "sWidth", "sWidthOrig" );++/* iDataSort to be applied (backwards compatibility), but aDataSort will take+ * priority if defined+ */+if ( oOptions.iDataSort !== undefined )+{+oCol.aDataSort = [ oOptions.iDataSort ];+}+_fnMap( oCol, oOptions, "aDataSort" );+}++/* Cache the data get and set functions for speed */+var mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null;+var mData = _fnGetObjectDataFn( oCol.mData );++oCol.fnGetData = function (oData, sSpecific) {+var innerData = mData( oData, sSpecific );++if ( oCol.mRender && (sSpecific && sSpecific !== '') )+{+return mRender( innerData, sSpecific, oData );+}+return innerData;+};+oCol.fnSetData = _fnSetObjectDataFn( oCol.mData );++/* Feature sorting overrides column specific when off */+if ( !oSettings.oFeatures.bSort )+{+oCol.bSortable = false;+}++/* Check that the class assignment is correct for sorting */+if ( !oCol.bSortable ||+ ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) )+{+oCol.sSortingClass = oSettings.oClasses.sSortableNone;+oCol.sSortingClassJUI = "";+}+else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1 )+{+oCol.sSortingClass = oSettings.oClasses.sSortable;+oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI;+}+else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 )+{+oCol.sSortingClass = oSettings.oClasses.sSortableAsc;+oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIAscAllowed;+}+else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) != -1 )+{+oCol.sSortingClass = oSettings.oClasses.sSortableDesc;+oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIDescAllowed;+}+}+++/**+ * Adjust the table column widths for new data. Note: you would probably want to + * do a redraw after calling this function!+ * @param {object} oSettings dataTables settings object+ * @memberof DataTable#oApi+ */+function _fnAdjustColumnSizing ( oSettings )+{+/* Not interested in doing column width calculation if auto-width is disabled */+if ( oSettings.oFeatures.bAutoWidth === false )+{+return false;+}++_fnCalculateColumnWidths( oSettings );+for ( var i=0 , iLen=oSettings.aoColumns.length ; i<iLen ; i++ )+{+oSettings.aoColumns[i].nTh.style.width = oSettings.aoColumns[i].sWidth;+}+}+++/**+ * Covert the index of a visible column to the index in the data array (take account+ * of hidden columns)+ * @param {object} oSettings dataTables settings object+ * @param {int} iMatch Visible column index to lookup+ * @returns {int} i the data index+ * @memberof DataTable#oApi+ */+function _fnVisibleToColumnIndex( oSettings, iMatch )+{+var aiVis = _fnGetColumns( oSettings, 'bVisible' );++return typeof aiVis[iMatch] === 'number' ?+aiVis[iMatch] :+null;+}+++/**+ * Covert the index of an index in the data array and convert it to the visible+ * column index (take account of hidden columns)+ * @param {int} iMatch Column index to lookup+ * @param {object} oSettings dataTables settings object+ * @returns {int} i the data index+ * @memberof DataTable#oApi+ */+function _fnColumnIndexToVisible( oSettings, iMatch )+{+var aiVis = _fnGetColumns( oSettings, 'bVisible' );+var iPos = $.inArray( iMatch, aiVis );++return iPos !== -1 ? iPos : null;+}+++/**+ * Get the number of visible columns+ * @param {object} oSettings dataTables settings object+ * @returns {int} i the number of visible columns+ * @memberof DataTable#oApi+ */+function _fnVisbleColumns( oSettings )+{+return _fnGetColumns( oSettings, 'bVisible' ).length;+}+++/**+ * Get an array of column indexes that match a given property+ * @param {object} oSettings dataTables settings object+ * @param {string} sParam Parameter in aoColumns to look for - typically + * bVisible or bSearchable+ * @returns {array} Array of indexes with matched properties+ * @memberof DataTable#oApi+ */+function _fnGetColumns( oSettings, sParam )+{+var a = [];++$.map( oSettings.aoColumns, function(val, i) {+if ( val[sParam] ) {+a.push( i );+}+} );++return a;+}+++/**+ * Get the sort type based on an input string+ * @param {string} sData data we wish to know the type of+ * @returns {string} type (defaults to 'string' if no type can be detected)+ * @memberof DataTable#oApi+ */+function _fnDetectType( sData )+{+var aTypes = DataTable.ext.aTypes;+var iLen = aTypes.length;++for ( var i=0 ; i<iLen ; i++ )+{+var sType = aTypes[i]( sData );+if ( sType !== null )+{+return sType;+}+}++return 'string';+}+++/**+ * Figure out how to reorder a display list+ * @param {object} oSettings dataTables settings object+ * @returns array {int} aiReturn index list for reordering+ * @memberof DataTable#oApi+ */+function _fnReOrderIndex ( oSettings, sColumns )+{+var aColumns = sColumns.split(',');+var aiReturn = [];++for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )+{+for ( var j=0 ; j<iLen ; j++ )+{+if ( oSettings.aoColumns[i].sName == aColumns[j] )+{+aiReturn.push( j );+break;+}+}+}++return aiReturn;+}+++/**+ * Get the column ordering that DataTables expects+ * @param {object} oSettings dataTables settings object+ * @returns {string} comma separated list of names+ * @memberof DataTable#oApi+ */+function _fnColumnOrdering ( oSettings )+{+var sNames = '';+for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )+{+sNames += oSettings.aoColumns[i].sName+',';+}+if ( sNames.length == iLen )+{+return "";+}+return sNames.slice(0, -1);+}+++/**+ * Take the column definitions and static columns arrays and calculate how+ * they relate to column indexes. The callback function will then apply the+ * definition found for a column to a suitable configuration object.+ * @param {object} oSettings dataTables settings object+ * @param {array} aoColDefs The aoColumnDefs array that is to be applied+ * @param {array} aoCols The aoColumns array that defines columns individually+ * @param {function} fn Callback function - takes two parameters, the calculated+ * column index and the definition for that column.+ * @memberof DataTable#oApi+ */+function _fnApplyColumnDefs( oSettings, aoColDefs, aoCols, fn )+{+var i, iLen, j, jLen, k, kLen;++// Column definitions with aTargets+if ( aoColDefs )+{+/* Loop over the definitions array - loop in reverse so first instance has priority */+for ( i=aoColDefs.length-1 ; i>=0 ; i-- )+{+/* Each definition can target multiple columns, as it is an array */+var aTargets = aoColDefs[i].aTargets;+if ( !$.isArray( aTargets ) )+{+_fnLog( oSettings, 1, 'aTargets must be an array of targets, not a '+(typeof aTargets) );+}++for ( j=0, jLen=aTargets.length ; j<jLen ; j++ )+{+if ( typeof aTargets[j] === 'number' && aTargets[j] >= 0 )+{+/* Add columns that we don't yet know about */+while( oSettings.aoColumns.length <= aTargets[j] )+{+_fnAddColumn( oSettings );+}++/* Integer, basic index */+fn( aTargets[j], aoColDefs[i] );+}+else if ( typeof aTargets[j] === 'number' && aTargets[j] < 0 )+{+/* Negative integer, right to left column counting */+fn( oSettings.aoColumns.length+aTargets[j], aoColDefs[i] );+}+else if ( typeof aTargets[j] === 'string' )+{+/* Class name matching on TH element */+for ( k=0, kLen=oSettings.aoColumns.length ; k<kLen ; k++ )+{+if ( aTargets[j] == "_all" ||+ $(oSettings.aoColumns[k].nTh).hasClass( aTargets[j] ) )+{+fn( k, aoColDefs[i] );+}+}+}+}+}+}++// Statically defined columns array+if ( aoCols )+{+for ( i=0, iLen=aoCols.length ; i<iLen ; i++ )+{+fn( i, aoCols[i] );+}+}+}++/**+ * Add a data array to the table, creating DOM node etc. This is the parallel to + * _fnGatherData, but for adding rows from a Javascript source, rather than a+ * DOM source.+ * @param {object} oSettings dataTables settings object+ * @param {array} aData data array to be added+ * @returns {int} >=0 if successful (index of new aoData entry), -1 if failed+ * @memberof DataTable#oApi+ */+function _fnAddData ( oSettings, aDataSupplied )+{+var oCol;++/* Take an independent copy of the data source so we can bash it about as we wish */+var aDataIn = ($.isArray(aDataSupplied)) ?+aDataSupplied.slice() :+$.extend( true, {}, aDataSupplied );++/* Create the object for storing information about this new row */+var iRow = oSettings.aoData.length;+var oData = $.extend( true, {}, DataTable.models.oRow );+oData._aData = aDataIn;+oSettings.aoData.push( oData );++/* Create the cells */+var nTd, sThisType;+for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )+{+oCol = oSettings.aoColumns[i];++/* Use rendered data for filtering / sorting */+if ( typeof oCol.fnRender === 'function' && oCol.bUseRendered && oCol.mData !== null )+{+_fnSetCellData( oSettings, iRow, i, _fnRender(oSettings, iRow, i) );+}+else+{+_fnSetCellData( oSettings, iRow, i, _fnGetCellData( oSettings, iRow, i ) );+}++/* See if we should auto-detect the column type */+if ( oCol._bAutoType && oCol.sType != 'string' )+{+/* Attempt to auto detect the type - same as _fnGatherData() */+var sVarType = _fnGetCellData( oSettings, iRow, i, 'type' );+if ( sVarType !== null && sVarType !== '' )+{+sThisType = _fnDetectType( sVarType );+if ( oCol.sType === null )+{+oCol.sType = sThisType;+}+else if ( oCol.sType != sThisType && oCol.sType != "html" )+{+/* String is always the 'fallback' option */+oCol.sType = 'string';+}+}+}+}++/* Add to the display array */+oSettings.aiDisplayMaster.push( iRow );++/* Create the DOM information */+if ( !oSettings.oFeatures.bDeferRender )+{+_fnCreateTr( oSettings, iRow );+}++return iRow;+}+++/**+ * Read in the data from the target table from the DOM+ * @param {object} oSettings dataTables settings object+ * @memberof DataTable#oApi+ */+function _fnGatherData( oSettings )+{+var iLoop, i, iLen, j, jLen, jInner,+ nTds, nTrs, nTd, nTr, aLocalData, iThisIndex,+iRow, iRows, iColumn, iColumns, sNodeName,+oCol, oData;++/*+ * Process by row first+ * Add the data object for the whole table - storing the tr node. Note - no point in getting+ * DOM based data if we are going to go and replace it with Ajax source data.+ */+if ( oSettings.bDeferLoading || oSettings.sAjaxSource === null )+{+nTr = oSettings.nTBody.firstChild;+while ( nTr )+{+if ( nTr.nodeName.toUpperCase() == "TR" )+{+iThisIndex = oSettings.aoData.length;+nTr._DT_RowIndex = iThisIndex;+oSettings.aoData.push( $.extend( true, {}, DataTable.models.oRow, {+"nTr": nTr+} ) );++oSettings.aiDisplayMaster.push( iThisIndex );+nTd = nTr.firstChild;+jInner = 0;+while ( nTd )+{+sNodeName = nTd.nodeName.toUpperCase();+if ( sNodeName == "TD" || sNodeName == "TH" )+{+_fnSetCellData( oSettings, iThisIndex, jInner, $.trim(nTd.innerHTML) );+jInner++;+}+nTd = nTd.nextSibling;+}+}+nTr = nTr.nextSibling;+}+}++/* Gather in the TD elements of the Table - note that this is basically the same as+ * fnGetTdNodes, but that function takes account of hidden columns, which we haven't yet+ * setup!+ */+nTrs = _fnGetTrNodes( oSettings );+nTds = [];+for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )+{+nTd = nTrs[i].firstChild;+while ( nTd )+{+sNodeName = nTd.nodeName.toUpperCase();+if ( sNodeName == "TD" || sNodeName == "TH" )+{+nTds.push( nTd );+}+nTd = nTd.nextSibling;+}+}++/* Now process by column */+for ( iColumn=0, iColumns=oSettings.aoColumns.length ; iColumn<iColumns ; iColumn++ )+{+oCol = oSettings.aoColumns[iColumn];++/* Get the title of the column - unless there is a user set one */+if ( oCol.sTitle === null )+{+oCol.sTitle = oCol.nTh.innerHTML;+}++var+bAutoType = oCol._bAutoType,+bRender = typeof oCol.fnRender === 'function',+bClass = oCol.sClass !== null,+bVisible = oCol.bVisible,+nCell, sThisType, sRendered, sValType;++/* A single loop to rule them all (and be more efficient) */+if ( bAutoType || bRender || bClass || !bVisible )+{+for ( iRow=0, iRows=oSettings.aoData.length ; iRow<iRows ; iRow++ )+{+oData = oSettings.aoData[iRow];+nCell = nTds[ (iRow*iColumns) + iColumn ];++/* Type detection */+if ( bAutoType && oCol.sType != 'string' )+{+sValType = _fnGetCellData( oSettings, iRow, iColumn, 'type' );+if ( sValType !== '' )+{+sThisType = _fnDetectType( sValType );+if ( oCol.sType === null )+{+oCol.sType = sThisType;+}+else if ( oCol.sType != sThisType && + oCol.sType != "html" )+{+/* String is always the 'fallback' option */+oCol.sType = 'string';+}+}+}++if ( oCol.mRender )+{+// mRender has been defined, so we need to get the value and set it+nCell.innerHTML = _fnGetCellData( oSettings, iRow, iColumn, 'display' );+}+else if ( oCol.mData !== iColumn )+{+// If mData is not the same as the column number, then we need to+// get the dev set value. If it is the column, no point in wasting+// time setting the value that is already there!+nCell.innerHTML = _fnGetCellData( oSettings, iRow, iColumn, 'display' );+}++/* Rendering */+if ( bRender )+{+sRendered = _fnRender( oSettings, iRow, iColumn );+nCell.innerHTML = sRendered;+if ( oCol.bUseRendered )+{+/* Use the rendered data for filtering / sorting */+_fnSetCellData( oSettings, iRow, iColumn, sRendered );+}+}++/* Classes */+if ( bClass )+{+nCell.className += ' '+oCol.sClass;+}++/* Column visibility */+if ( !bVisible )+{+oData._anHidden[iColumn] = nCell;+nCell.parentNode.removeChild( nCell );+}+else+{+oData._anHidden[iColumn] = null;+}++if ( oCol.fnCreatedCell )+{+oCol.fnCreatedCell.call( oSettings.oInstance,+nCell, _fnGetCellData( oSettings, iRow, iColumn, 'display' ), oData._aData, iRow, iColumn+);+}+}+}+}++/* Row created callbacks */+if ( oSettings.aoRowCreatedCallback.length !== 0 )+{+for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )+{+oData = oSettings.aoData[i];+_fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [oData.nTr, oData._aData, i] );+}+}+}+++/**+ * Take a TR element and convert it to an index in aoData+ * @param {object} oSettings dataTables settings object+ * @param {node} n the TR element to find+ * @returns {int} index if the node is found, null if not+ * @memberof DataTable#oApi+ */+function _fnNodeToDataIndex( oSettings, n )+{+return (n._DT_RowIndex!==undefined) ? n._DT_RowIndex : null;+}+++/**+ * Take a TD element and convert it into a column data index (not the visible index)+ * @param {object} oSettings dataTables settings object+ * @param {int} iRow The row number the TD/TH can be found in+ * @param {node} n The TD/TH element to find+ * @returns {int} index if the node is found, -1 if not+ * @memberof DataTable#oApi+ */+function _fnNodeToColumnIndex( oSettings, iRow, n )+{+var anCells = _fnGetTdNodes( oSettings, iRow );++for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )+{+if ( anCells[i] === n )+{+return i;+}+}+return -1;+}+++/**+ * Get an array of data for a given row from the internal data cache+ * @param {object} oSettings dataTables settings object+ * @param {int} iRow aoData row id+ * @param {string} sSpecific data get type ('type' 'filter' 'sort')+ * @param {array} aiColumns Array of column indexes to get data from+ * @returns {array} Data array+ * @memberof DataTable#oApi+ */+function _fnGetRowData( oSettings, iRow, sSpecific, aiColumns )+{+var out = [];+for ( var i=0, iLen=aiColumns.length ; i<iLen ; i++ )+{+out.push( _fnGetCellData( oSettings, iRow, aiColumns[i], sSpecific ) );+}+return out;+}+++/**+ * Get the data for a given cell from the internal cache, taking into account data mapping+ * @param {object} oSettings dataTables settings object+ * @param {int} iRow aoData row id+ * @param {int} iCol Column index+ * @param {string} sSpecific data get type ('display', 'type' 'filter' 'sort')+ * @returns {*} Cell data+ * @memberof DataTable#oApi+ */+function _fnGetCellData( oSettings, iRow, iCol, sSpecific )+{+var sData;+var oCol = oSettings.aoColumns[iCol];+var oData = oSettings.aoData[iRow]._aData;++if ( (sData=oCol.fnGetData( oData, sSpecific )) === undefined )+{+if ( oSettings.iDrawError != oSettings.iDraw && oCol.sDefaultContent === null )+{+_fnLog( oSettings, 0, "Requested unknown parameter "++(typeof oCol.mData=='function' ? '{mData function}' : "'"+oCol.mData+"'")++" from the data source for row "+iRow );+oSettings.iDrawError = oSettings.iDraw;+}+return oCol.sDefaultContent;+}++/* When the data source is null, we can use default column data */+if ( sData === null && oCol.sDefaultContent !== null )+{+sData = oCol.sDefaultContent;+}+else if ( typeof sData === 'function' )+{+/* If the data source is a function, then we run it and use the return */+return sData();+}++if ( sSpecific == 'display' && sData === null )+{+return '';+}+return sData;+}+++/**+ * Set the value for a specific cell, into the internal data cache+ * @param {object} oSettings dataTables settings object+ * @param {int} iRow aoData row id+ * ... [truncated message content]

[osm-devel] SF.net SVN: openstamanager:[924]new_trunk/openstamanager

From: <lo...@us...> - 2014-06-06 22:54:45

Revision: 924 http://sourceforge.net/p/openstamanager/code/924Author: loviuzDate: 2014-06-06 22:54:33 +0000 (Fri, 06 Jun 2014)Log Message:-----------[CORE] - aggiornati css vari e completata tabella di riepilogo record con DataTablesModified Paths:-------------- new_trunk/openstamanager/controller.php new_trunk/openstamanager/core.php new_trunk/openstamanager/include/top.php new_trunk/openstamanager/index.php new_trunk/openstamanager/share/themes/default/css/AdminLTE.css new_trunk/openstamanager/share/themes/default/css/style.css new_trunk/openstamanager/update/update_2.0.sqlAdded Paths:----------- new_trunk/openstamanager/ajax_autocomplete.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/dataTables.fixedHeader.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.columnFilter.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.datatables.lang-it.js new_trunk/openstamanager/share/themes/default/css/datatables/dataTables.fixedHeader.min.css new_trunk/openstamanager/share/themes/default/fonts/bgothm-webfont.eot new_trunk/openstamanager/share/themes/default/fonts/bgothm-webfont.svg new_trunk/openstamanager/share/themes/default/fonts/bgothm-webfont.ttf new_trunk/openstamanager/share/themes/default/fonts/bgothm-webfont.woffRemoved Paths:------------- new_trunk/openstamanager/lib/jscripts/datatables/ new_trunk/openstamanager/lib/jscripts/functions.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.jsAdded: new_trunk/openstamanager/ajax_autocomplete.php===================================================================--- new_trunk/openstamanager/ajax_autocomplete.php (rev 0)+++ new_trunk/openstamanager/ajax_autocomplete.php2014-06-06 22:54:33 UTC (rev 924)@@ -0,0 +1,1084 @@+<?php+include("core.php");+include("lib/user_check.php");+$nome_modulo = save( $_GET['module'] );++if( $nome_modulo != "*" ){+include("lib/permissions_check.php");+}++$additional_where['Anagrafiche'] = str_replace( "|idtecnico|", $user_idanagrafica, $additional_where['Anagrafiche'] );+$additional_where['Anagrafiche'] = str_replace( "|idagente|", "'".$user_idanagrafica."'", $additional_where['Anagrafiche'] );+++$op = save( $_GET['op'] );++switch( $nome_modulo ){+case "Anagrafiche":++//Elenco nomi+if( $op=="get_ragione_sociale" ){+$ragione_sociale = save( $_GET['ragione_sociale'] );+$idagente = save( $_GET['idagente'] );++if ($idagente!=""){++$WHERE_AGENTE = "AND idagente = ".$idagente;++}++$q = "SELECT ragione_sociale FROM an_anagrafiche WHERE deleted=0 AND ragione_sociale LIKE '%$ragione_sociale%' ".$WHERE_AGENTE." ".$additional_where['Anagrafiche']." GROUP BY ragione_sociale ORDER BY ragione_sociale";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo htmlspecialchars_decode( $rs[$i]['ragione_sociale'], ENT_QUOTES );+if( ($i+1)<$n )+echo '|';+}+}++//Elenco città+else if( $op=="getcitta" ){+$q = "SELECT DISTINCT(citta) FROM an_anagrafiche WHERE 1=1 ".$additional_where['Anagrafiche']." ORDER BY citta";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo htmlspecialchars_decode( $rs[$i]['citta'], ENT_QUOTES );+if( ($i+1)<$n )+echo '|';+}+}++//Elenco province+else if( $op=="getprovince" ){+$q = "SELECT DISTINCT(provincia) FROM an_anagrafiche WHERE 1=1 ".$additional_where['Anagrafiche']." ORDER BY provincia";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['provincia'] );+if( ($i+1)<$n )+echo '|';+}+}++//Elenco cap+else if( $op=="getcap" ){+$q = "SELECT DISTINCT(cap) FROM an_anagrafiche WHERE 1=1 ".$additional_where['Anagrafiche']." ORDER BY cap";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['cap'] );+if( ($i+1)<$n )+echo '|';+}+}+++//Elenco settori+else if( $op=="getsettori" ){+$q = "SELECT DISTINCT(settore) FROM an_anagrafiche WHERE 1=1 ".$additional_where['Anagrafiche']." ORDER BY settore";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['settore'], ENT_QUOTES );+if( ($i+1)<$n )+echo '|';+}+}+++//Elenco marche+else if( $op=="getmarche" ){+$q = "SELECT DISTINCT(marche) FROM an_anagrafiche WHERE 1=1 ".$additional_where['Anagrafiche']." ORDER BY marche";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['marche'], ENT_QUOTES );+if( ($i+1)<$n )+echo '|';+}+}++++//Elenco e-mail - uso la funzione nativa di php "trim" per rimuovere eventuali spazi dalle e-mail +else if( $op=="getemail" ){++$idanagrafica = save( $_GET['idanagrafica'] );++if ($idanagrafica!=""){++$WHERE_IDANAGRAFICA = "AND idanagrafica = ".$idanagrafica;++}++//tutti i referenti per questo cliente+$q = "SELECT DISTINCT(email),idanagrafica,nome FROM an_referenti WHERE 1=1 ".$WHERE_IDANAGRAFICA." ORDER BY idanagrafica";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+if (trim($rs[$i]['email'])!=""){+echo html_entity_decode( $rs[$i]['nome']." &lt;".trim($rs[$i]['email'])."&gt;" );+if( ($i)<$n )+echo '|';+}+}++//--++//tutti gli agenti+$q = "SELECT DISTINCT(email),ragione_sociale,an_anagrafiche.idanagrafica FROM an_anagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE idtipoanagrafica=(SELECT idtipoanagrafica FROM an_tipianagrafiche WHERE descrizione='Agente') ORDER BY idanagrafica";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+if (trim($rs[$i]['email'])!=""){+echo html_entity_decode( $rs[$i]['nome']." &lt;".trim($rs[$i]['email'])."&gt;" );+if( ($i)<$n )+echo '|';+}+}++//--++//email azienda di questo cliente+$q = "SELECT DISTINCT(email),ragione_sociale,idanagrafica FROM an_anagrafiche WHERE 1=1 ".$WHERE_IDANAGRAFICA." ORDER BY idanagrafica";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+if (trim($rs[$i]['email'])!=""){+echo html_entity_decode( $rs[$i]['ragione_sociale']." &lt;".trim($rs[$i]['email'])."&gt;" );+if( ($i+1)<$n )+echo '|';+}+}+}++//Elenco sedi+else if( $op=="get_sedi" ){+$idanagrafica = save( $_GET['idanagrafica'] );+$q = "SELECT id, CONCAT_WS( ' - ', nomesede, citta ) AS descrizione FROM an_sedi WHERE idanagrafica='".$idanagrafica."' ".$additional_where['Anagrafiche']." ORDER BY id";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);++for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['id'].":".$rs[$i]['descrizione'] );+if( ($i+1)<$n )+echo '|';+}+}+++//Elenco sedi con <option>+else if( $op=="get_sedi_select" ){+$idanagrafica = save( $_GET['idanagrafica'] );+$q = "SELECT id, CONCAT_WS( ' - ', nomesede, citta ) AS descrizione FROM an_sedi WHERE idanagrafica='".$idanagrafica."' ".$additional_where['Anagrafiche']." ORDER BY id";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+++echo "<option value=\"-1\">- Nessuna -</option>\n";+echo "<option value=\"0\">Sede legale</option>\n";+++for( $i=0;$i<$n;$i++ ){+echo "<option value=\"".$rs[$i]['id']."\">".$rs[$i]['descrizione']."</option>\n";+}+}++++break;++case "Articoli":+//Elenco categorie+if( $op=="getcategorie" ){+$q = "SELECT DISTINCT(categoria) FROM mg_articoli WHERE 1=1 ".$additional_where['Magazzino']." ORDER BY categoria";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['categoria'] );+if( ($i+1)<$n )+echo '|';+}+}++//Elenco subcategorie+else if( $op=="getsubcategorie" ){+$q = "SELECT DISTINCT(subcategoria) FROM mg_articoli WHERE 1=1 ".$additional_where['Magazzino']." ORDER BY subcategoria";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['subcategoria'] );+if( ($i+1)<$n )+echo '|';+}+}++//Elenco descrizione+else if( $op=="getdescrizione" ){+$q = "SELECT DISTINCT(descrizione) FROM mg_articoli WHERE 1=1 ".$additional_where['Magazzino']." ORDER BY descrizione";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['descrizione'] );+if( ($i+1)<$n )+echo '|';+}+}++//Elenco codici+else if( $op=="getcodice" ){+$q = "SELECT DISTINCT(codice) FROM mg_articoli WHERE 1=1 ".$additional_where['Magazzino']." ORDER BY codice";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['codice'] );+if( ($i+1)<$n )+echo '|';+}+}++//Elenco lotti in base all'articolo+else if( $op=="getlotti" ){+$idarticolo = save( $_GET['idarticolo'] );+$q = "SELECT DISTINCT(lotto) FROM mg_prodotti WHERE idarticolo=\"".$idarticolo."\" ".$additional_where['Magazzino']." ORDER BY lotto ASC";+echo $q;+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);++echo "<option value=''>- Seleziona un lotto -</option>\n";++for( $i=0;$i<$n;$i++ )+echo "<option value=\"".htmlentities($rs[$i]['lotto'])."\">".htmlentities( $rs[$i]['lotto'] )."</option>\n";+}+++//Elenco lotti in base all'articolo e lotto+else if( $op=="getserial" ){+$idarticolo = save( $_GET['idarticolo'] );+$lotto = save( $_GET['lotto'] );+$q = "SELECT DISTINCT(serial) FROM mg_prodotti WHERE idarticolo=\"".$idarticolo."\" AND lotto=\"".$lotto."\" AND (serial NOT IN(SELECT serial FROM co_righe_documenti WHERE lotto=\"".$lotto."\" AND serial=mg_prodotti.serial) AND serial NOT IN(SELECT serial FROM or_righe_ordini WHERE lotto=\"".$lotto."\" AND serial=mg_prodotti.serial) AND serial NOT IN(SELECT serial FROM dt_righe_ddt WHERE lotto=\"".$lotto."\" AND serial=mg_prodotti.serial) AND serial NOT IN(SELECT serial FROM mg_articoli_interventi WHERE lotto=\"".$lotto."\" AND serial=mg_prodotti.serial)) ".$additional_where['Magazzino']." ORDER BY serial ASC";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);++echo "<option value=''>- Seleziona un serial number -</option>\n";++for( $i=0;$i<$n;$i++ )+echo "<option value=\"".htmlentities($rs[$i]['serial'])."\">".htmlentities( $rs[$i]['serial'] )."</option>\n";+}+++//Elenco lotti in base all'articolo, lotto e serial+else if( $op=="getaltro" ){+$idarticolo = save( $_GET['idarticolo'] );+$lotto = save( $_GET['lotto'] );+$serial = save( $_GET['serial'] );+$q = "SELECT DISTINCT(altro) FROM mg_prodotti WHERE idarticolo=\"".$idarticolo."\" AND lotto=\"".$lotto."\" AND serial=\"".$serial."\" AND (altro NOT IN(SELECT altro FROM co_righe_documenti WHERE lotto=\"".$lotto."\" AND serial=\"".$serial."\" AND altro=mg_prodotti.altro) AND altro NOT IN(SELECT altro FROM or_righe_ordini WHERE lotto=\"".$lotto."\" AND serial=\"".$serial."\" AND altro=mg_prodotti.altro) AND altro NOT IN(SELECT altro FROM dt_righe_ddt WHERE lotto=\"".$lotto."\" AND serial=\"".$serial."\" AND altro=mg_prodotti.altro) AND altro NOT IN(SELECT altro FROM mg_articoli_interventi WHERE lotto=\"".$lotto."\" AND serial=\"".$serial."\" AND altro=mg_prodotti.altro)) ".$additional_where['Magazzino']." ORDER BY altro ASC";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);++echo "<option value=''>- Seleziona un altro codice -</option>\n";++for( $i=0;$i<$n;$i++ )+echo "<option value=\"".htmlentities($rs[$i]['altro'])."\">".htmlentities( $rs[$i]['altro'] )."</option>\n";+}+++//Legge gli ultimi prezzi di vendita di un determinato articolo e li visualizza per suggerire il prezzo di vendita+else if( $op=="getprezzi" ){+$idarticolo = save( $_GET['idarticolo'] );+$idanagrafica = save( $_GET['idanagrafica'] );+$ids = array('""');+++if( $idarticolo!='0' && $idarticolo!='' ){+//Ultime 5 vendite al cliente+$fatture = $dbo->fetchArray("SELECT iddocumento, (subtotale/qta)-sconto AS costo_unitario, (SELECT numero FROM co_documenti WHERE id=iddocumento) AS n_fattura, (SELECT numero_esterno FROM co_documenti WHERE id=iddocumento) AS n2_fattura, (SELECT data FROM co_documenti WHERE id=iddocumento) AS data_fattura FROM co_righe_documenti WHERE idarticolo=\"".$idarticolo."\" AND iddocumento IN(SELECT id FROM co_documenti WHERE idtipodocumento IN(SELECT id FROM co_tipidocumento WHERE dir='entrata') AND idanagrafica=\"".$idanagrafica."\") LIMIT 0,5");++echo "<br/><b>Ultime 5 vendite a questo cliente</b>\n";+if( sizeof($fatture)>0 ){+echo "<br/><table cellspacing='0'>\n";+echo "<tr><th width='150'>Documento</th>\n";+echo "<th width='50'>Data</th>\n";+echo "<th width='80'>Totale</th></tr>\n";++for( $i=0; $i<sizeof($fatture); $i++ ){+( $fatture[$i]['n2_fattura']!='' ) ? $n_fattura=$fatture[$i]['n2_fattura'] : $n_fattura=$fatture[$i]['n_fattura'];+echo "<tr><td class='first_cell'><a href=\"".$rootdir."/modules/contabilita/documenti/documenti.php?dir=entrata&iddocumento=".$fatture[$i]['iddocumento']."\" target=\"_blank\" title=\"Apri il documento su una nuova finestra\">Fattura n<sup>o</sup> ".$n_fattura."</a></td>\n";+echo "<td class='table_cell'>".date( "d/m/Y", strtotime($fatture[$i]['data_fattura']) )."</td>\n";+echo "<td class='table_cell'>".number_format( $fatture[$i]['costo_unitario'], 2, ",", "" )." &euro;</td></tr>\n";+array_push( $ids, "\"".$fatture[$i]['iddocumento']."\"" );+}+echo "</table>\n";+}+else+echo "<br/>... Nessuna vendita di questo articolo al cliente ...<br/>\n";++++++//Ultime 5 vendite totali+$fatture = $dbo->fetchArray("SELECT iddocumento, (subtotale/qta)-sconto AS costo_unitario, (SELECT numero FROM co_documenti WHERE id=iddocumento) AS n_fattura, (SELECT numero_esterno FROM co_documenti WHERE id=iddocumento) AS n2_fattura, (SELECT data FROM co_documenti WHERE id=iddocumento) AS data_fattura FROM co_righe_documenti WHERE idarticolo=\"".$idarticolo."\" AND iddocumento IN(SELECT id FROM co_documenti WHERE idtipodocumento IN(SELECT id FROM co_tipidocumento WHERE dir='entrata') AND id NOT IN(".implode(',', $ids).") ) LIMIT 0,5");++echo "<br/><b>Altre 5 vendite</b>\n";+if( sizeof($fatture)>0 ){+echo "<br/><table cellspacing='0'>\n";+echo "<tr><th width='150'>Documento</th>\n";+echo "<th width='50'>Data</th>\n";+echo "<th width='80'>Totale</th></tr>\n";++for( $i=0; $i<sizeof($fatture); $i++ ){+( $fatture[$i]['n2_fattura']!='' ) ? $n_fattura=$fatture[$i]['n2_fattura'] : $n_fattura=$fatture[$i]['n_fattura'];+echo "<tr><td class='first_cell'><a href=\"".$rootdir."/modules/contabilita/documenti/documenti.php?dir=entrata&iddocumento=".$fatture[$i]['iddocumento']."\" target=\"_blank\" title=\"Apri il documento su una nuova finestra\">Fattura n<sup>o</sup> ".$n_fattura."</a></td>\n";+echo "<td class='table_cell'>".date( "d/m/Y", strtotime($fatture[$i]['data_fattura']) )."</td>\n";+echo "<td class='table_cell'>".number_format( $fatture[$i]['costo_unitario'], 2, ",", "" )." &euro;</td></tr>\n";+}+echo "</table>\n";+}++else+echo "<br/>... Questo articolo non &eacute; ancora stato venduto ad altri ...<br/>\n";+}+}+break;+++case "Interventi":+//Elenco nomi+if( $op=="get_ragione_sociale" ){+$ragione_sociale = save( $_GET['ragione_sociale'] );+$q = "SELECT ragione_sociale FROM an_anagrafiche WHERE ragione_sociale LIKE '%$ragione_sociale%' ".$additional_where['Anagrafiche']." ORDER BY ragione_sociale";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo htmlspecialchars_decode( $rs[$i]['ragione_sociale'], ENT_QUOTES );+if( ($i+1)<$n )+echo '|';+}+}+break;++case "Preventivi":+//Elenco nomi preventivi+if( $op=="get_select_preventivi" ){+$idanagrafica = save( $_GET['idanagrafica'] );+$q = "SELECT co_preventivi.id AS idpreventivo, an_anagrafiche.idanagrafica, nome, idtipointervento FROM co_preventivi INNER JOIN an_anagrafiche ON co_preventivi.idanagrafica=an_anagrafiche.idanagrafica WHERE an_anagrafiche.idanagrafica='$idanagrafica' AND idstato NOT IN (SELECT `id` FROM co_statipreventivi WHERE descrizione='Bozza' OR descrizione='Rifiutato' OR descrizione='Pagato') ".$additional_where['Preventivi'];+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['idpreventivo'].":".$rs[$i]['nome'].":".$rs[$i]['idtipointervento'] );+if( ($i+1)<$n )+echo '|';+}+}+break;+++case "Contratti":+//Elenco nomi preventivi+if( $op=="get_select_contratti" ){+$idanagrafica = save( $_GET['idanagrafica'] );+$q = "SELECT co_contratti.id AS idcontratto, an_anagrafiche.idanagrafica, nome FROM co_contratti INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica WHERE an_anagrafiche.idanagrafica='$idanagrafica' AND idstato NOT IN (SELECT `id` FROM co_staticontratti WHERE descrizione='Bozza' OR descrizione='Rifiutato' OR descrizione='Pagato') ".$additional_where['Contratti'];+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+for( $i=0;$i<$n;$i++ ){+echo html_entity_decode( $rs[$i]['idcontratto'].":".$rs[$i]['nome'] );+if( ($i+1)<$n )+echo '|';+}+}+break;+++case "Fatture":+//Elenco fatture non pagate per anagrafica+if( $op=="get_fatture" ){+$idanagrafica = save( $_GET['idanagrafica'] );+$q = "SELECT data, co_documenti.id AS iddocumento, co_tipidocumento.descrizione AS tipo_doc, dir FROM co_documenti INNER JOIN co_tipidocumento ON co_documenti.idtipodocumento=co_tipidocumento.id WHERE co_documenti.idanagrafica='$idanagrafica' AND (idstatodocumento=(SELECT `id` FROM co_statidocumento WHERE descrizione='Emessa') OR (SELECT da_pagare-pagato AS differenza FROM co_scadenziario WHERE NOT iddocumento=co_documenti.id=0) )";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+if( $n>0 ){+echo "<select name='iddocumento' id='iddocumento' class='inputtext'>\n";+for( $i=0;$i<$n;$i++ ){+echo "<option value='".$rs[$i]['iddocumento']."' dir=\"".$rs[$i]['dir']."\">".html_entity_decode( $rs[$i]['tipo_doc'] )." del ".date("d/m/Y", strtotime($rs[$i]['data']))."</option>\n";+}+echo "</select>\n";+}+else+echo "... Nessuna fattura trovata ...";+}++//Elenco causali prima nota+else if( $op=="get_causali" ){+$descrizione = save($_GET['descrizione']);+$q = "SELECT DISTINCT descrizione FROM co_movimenti WHERE descrizione LIKE \"%".$descrizione."%\" AND (iddocumento='' OR iddocumento IS NULL) AND primanota=1 ".$additional_where['Prima nota'];+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+if( $n>0 ){+for( $i=0;$i<$n;$i++ ){+echo $rs[$i]['descrizione'];+if( ($i+1)<$n )+echo "|";+}+}+}+break;+++case "Ddt":+//Elenco ddt del fornitore scelto+if( $op=="get_ddt" ){+$idfornitore = save( $_GET['idfornitore'] );+$q = "SELECT data, dt_ddt.id AS idddt, numero, dt_tipiddt.descrizione AS tipo_doc, dir FROM dt_ddt INNER JOIN dt_tipiddt ON dt_ddt.idtipoddt=dt_tipiddt.id WHERE dt_ddt.idanagrafica='$idfornitore'";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);+if( $n>0 ){+echo "<select name='idddt' id='idddt' class='inputtext'>\n";+echo "<option value=''>- Seleziona un ddt -</option>\n";+for( $i=0;$i<$n;$i++ ){+echo "<option value='".$rs[$i]['idddt']."'>".html_entity_decode( $rs[$i]['tipo_doc'] )." ".$rs[$i]['numero']." del ".date("d/m/Y", strtotime($rs[$i]['data']))."</option>\n";+}+echo "</select>\n";+}+else+echo "... Nessun ddt trovato ...\n";+}+break;+++case "MyImpianti":+//Elenco ddt del fornitore scelto+if( $op=="get_impianti" ){+$idanagrafica = save( $_GET['idanagrafica'] );+$idsede = save( $_GET['idsede'] );++$q = "SELECT *, (SELECT nomesede FROM an_sedi WHERE id=my_impianti.idsede) AS nomesede FROM my_impianti WHERE idanagrafica=\"".$idanagrafica."\" AND idsede=\"".$idsede."\" ORDER BY idsede";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);++for( $i=0; $i<$n; $i++ ){+echo $rs[$i]['matricola'].":".$rs[$i]['matricola']." - ".$rs[$i]['nome']."\n";++if( ($i+1)<$n )+echo "|";+}+}+break;+}++++/*+== Super search ==+Ricerca di un termine su tutti i moduli.+Il risultato è in json+*/+if( $op == "supersearch" ){+$term = save( $_GET['term'] );+$term = str_replace( "/", "\\/", $term );+$i = 0;+++if( strlen($term) < 2 ){+echo "null";+exit;+}++++/*+Anagrafiche+*/+if( get_permessi('Anagrafiche') != '-' ){+$campi= array( 'codice', 'ragione_sociale', 'piva', 'codice_fiscale', 'indirizzo', 'indirizzo2', 'citta', 'cap', 'provincia', 'nazione', 'telefono', 'fax', 'cellulare', 'email', 'sitoweb', 'note', 'codicerea', 'settore', 'marche', 'cciaa', 'n_alboartigiani' );+$campi_text= array( 'Codice', 'Ragione sociale', 'Partita iva', 'Codice fiscale', 'Indirizzo', 'Indirizzo2', 'Città', 'C.A.P.', 'Provincia', 'Nazione', 'Telefono', 'Fax', 'Cellulare', 'Email', 'Sito web', 'Note', 'Codice REA', 'Settore', 'Marche', 'CCIAA', 'Numero di iscrizione albo artigiani' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR ".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT * FROM an_anagrafiche WHERE 1=0 ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+$result[$r+$i]['link']= $rootdir."/modules/anagrafiche/anagrafiche.php?idanagrafica=".$rs[$r]['idanagrafica'];+$result[$r+$i]['title']= $rs[$r]['ragione_sociale'];+$result[$r+$i]['category']= "Anagrafiche";+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}+}++$i += $r;+}+}+++//Ricerca anagrafiche per ragione sociale per potere mostrare gli interventi, fatture,+//ordini, ecc della persona ricercata+$idanagrafiche = array('-1');+$ragioni_sociali = array('-1');+$rs = $dbo->fetchArray("SELECT idanagrafica, ragione_sociale FROM an_anagrafiche WHERE ragione_sociale LIKE \"%".$term."%\"");++for( $a=0; $a<sizeof($rs); $a++ ){+array_push( $idanagrafiche, $rs[$a]['idanagrafica'] );+$ragioni_sociali[ $rs[$a]['idanagrafica'] ] = $rs[$a]['ragione_sociale'];+}++++/*+Referenti anagrafiche+*/+if( get_permessi('Anagrafiche') != '-' ){+$campi= array( 'nome', 'mansione', 'telefono', 'email' );+$campi_text= array( 'Nome', 'Mansione', 'Telefono', 'Email' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR ".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT * FROM an_referenti WHERE idanagrafica IN(".implode(',', $idanagrafiche).") ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+$result[$r+$i]['link']= $rootdir."/modules/anagrafiche/anagrafiche.php?idanagrafica=".$rs[$r]['idanagrafica']."#tabs-2";+$result[$r+$i]['title']= $rs[$r]['nome'];+$result[$r+$i]['category']= "Referenti";+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r+$i][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}++//Aggiunta nome anagrafica come ultimo campo+if( sizeof($ragioni_sociali) > 1 ){+array_push( $result[$r+$i]['labels'], "Anagrafica: ".$ragioni_sociali[ $rs[$r]['idanagrafica'] ]."<br/>" );+}+}++$i += $r;+}+}+++++/*+Interventi+*/+if( get_permessi('Interventi') != '-' ){+$campi= array( 'idintervento', 'data', 'data_richiesta', 'info_sede', 'richiesta', 'descrizione', 'informazioniaggiuntive' );+$campi_text= array( 'Codice intervento', 'Data intervento', 'Data richiesta intervento', 'Sede intervento', 'Richiesta', 'Descrizione', 'Informazioni aggiuntive' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR ".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT * FROM in_interventi WHERE idanagrafica IN(".implode(',', $idanagrafiche).") ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+$result[$r+$i]['link']= $rootdir."/modules/interventi/interventi.php?idintervento=".$rs[$r]['idintervento'];+$result[$r+$i]['title']= "Intervento ".$rs[$r]['idintervento']." del ".date("d/m/Y", strtotime($rs[$r]['data']) );+$result[$r+$i]['category']= "Interventi";+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}++//Aggiunta nome anagrafica come ultimo campo+if( sizeof($ragioni_sociali) > 1 ){+array_push( $result[$r+$i]['labels'], "Anagrafica: ".$ragioni_sociali[ $rs[$r]['idanagrafica'] ]."<br/>" );+}+}++$i += $r;+}+}++++/*+Preventivi+*/+if( get_permessi('Contabilita') != '-' ){+$campi= array( 'numero', 'nome', 'descrizione' );+$campi_text= array( 'Codice preventivo', 'Nome', 'Descrizione' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR ".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT * FROM co_preventivi WHERE idanagrafica IN(".implode(',', $idanagrafiche).") ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+$result[$r+$i]['link']= $rootdir."/modules/contabilita/preventivi/preventivi.php?idpreventivo=".$rs[$r]['id'];+$result[$r+$i]['title']= "Preventivo ".$rs[$r]['numero']." del ".date("d/m/Y", strtotime($rs[$r]['data_accettazione']) );+$result[$r+$i]['category']= "Preventivi";+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}++//Aggiunta nome anagrafica come ultimo campo+if( sizeof($ragioni_sociali) > 1 ){+array_push( $result[$r+$i]['labels'], "Anagrafica: ".$ragioni_sociali[ $rs[$r]['idanagrafica'] ]."<br/>" );+}+}++$i += $r;+}+}++++/*+Fatture+*/+if( get_permessi('Contabilita') != '-' ){+$campi= array( 'numero', 'numero_esterno', 'data', 'note', 'note_aggiuntive', 'buono_ordine' );+$campi_text= array( 'Numero', 'Numero secondario', 'Data', 'Note', 'Note aggiuntive', 'Buono d\'ordine' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR ".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT *, co_documenti.id AS iddocumento FROM co_documenti INNER JOIN co_tipidocumento ON co_documenti.idtipodocumento=co_tipidocumento.id WHERE idanagrafica IN(".implode(',', $idanagrafiche).") ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+if( $rs[$r]['numero_esterno'] == '' ){+$numero = $rs[$r]['numero'];+}+else{+$numero = $rs[$r]['numero_esterno'];+}++$result[$r+$i]['link']= $rootdir."/modules/contabilita/documenti/documenti.php?iddocumento=".$rs[$r]['iddocumento']."&dir=".$rs[$r]['dir'];+$result[$r+$i]['title']= $rs[$r]['descrizione']." n<sup>o</sup> ".$numero." del ".date("d/m/Y", strtotime($rs[$r]['data']) );+$result[$r+$i]['category']= $rs[$r]['descrizione'];+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}++//Aggiunta nome anagrafica come ultimo campo+if( sizeof($ragioni_sociali) > 1 ){+array_push( $result[$r+$i]['labels'], "Anagrafica: ".$ragioni_sociali[ $rs[$r]['idanagrafica'] ]."<br/>" );+}+}++$i += $r;+}+}+++++/*+Righe fatture+*/+if( get_permessi('Contabilita') != '-' ){+$campi= array( 'descrizione' );+$campi_text= array( 'Riga' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR co_righe_documenti.".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT co_documenti.*, co_documenti.id AS iddocumento, co_tipidocumento.descrizione AS tipodoc, co_tipidocumento.dir, co_righe_documenti.descrizione FROM co_righe_documenti INNER JOIN (co_documenti INNER JOIN co_tipidocumento ON co_documenti.idtipodocumento=co_tipidocumento.id) ON co_documenti.id=co_righe_documenti.iddocumento WHERE idanagrafica IN(".implode(',', $idanagrafiche).") ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+if( $rs[$r]['numero_esterno'] == '' ){+$numero = $rs[$r]['numero'];+}+else{+$numero = $rs[$r]['numero_esterno'];+}++$result[$r+$i]['link']= $rootdir."/modules/contabilita/documenti/documenti.php?iddocumento=".$rs[$r]['iddocumento']."&dir=".$rs[$r]['dir'];+$result[$r+$i]['title']= $rs[$r]['tipodoc']." n<sup>o</sup> ".$numero." del ".date("d/m/Y", strtotime($rs[$r]['data']) );+$result[$r+$i]['category']= $rs[$r]['tipodoc'];+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}++//Aggiunta nome anagrafica come ultimo campo+if( sizeof($ragioni_sociali) > 1 ){+array_push( $result[$r+$i]['labels'], "Anagrafica: ".$ragioni_sociali[ $rs[$r]['idanagrafica'] ]."<br/>" );+}+}++$i += $r;+}+}++++/*+Articoli+*/+if( get_permessi('Articoli') != '-' ){+$campi= array( 'codice', 'descrizione', 'categoria', 'subcategoria', 'note' );+$campi_text= array( 'Codice', 'Descrizione', 'Categoria', 'Subcategoria', 'Note' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR ".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT * FROM mg_articoli WHERE 1=0 ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+$result[$r+$i]['link']= $rootdir."/modules/magazzino/articoli/articoli.php?idarticolo=".$rs[$r]['id'];+$result[$r+$i]['title']= $rs[$r]['codice']." - ".$rs[$r]['descrizione'];+$result[$r+$i]['category']= "Articoli";+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}+}++$i += $r;+}+}++++/*+Automezzi+*/+if( get_permessi('Automezzi') != '-' ){+$campi= array( 'nome', 'descrizione', 'targa' );+$campi_text= array( 'Nome', 'Descrizione', 'Targa' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR ".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT * FROM dt_automezzi WHERE 1=0 ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+$result[$r+$i]['link']= $rootdir."/modules/magazzino/automezzi/automezzi.php?idautomezzo=".$rs[$r]['id'];+$result[$r+$i]['title']= $rs[$r]['nome'];+$result[$r+$i]['category']= "Automezzi";+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}+}++$i += $r;+}+}++++/*+Ddt+*/+if( get_permessi('Magazzino') != '-' ){+$campi= array( 'numero', 'numero_esterno', 'data', 'note' );+$campi_text= array( 'Numero', 'Numero secondario', 'Data', 'Note' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR ".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT *, dt_ddt.id AS idddt FROM dt_ddt INNER JOIN dt_tipiddt ON dt_ddt.idtipoddt=dt_tipiddt.id WHERE idanagrafica IN(".implode(',', $idanagrafiche).") ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+if( $rs[$r]['numero_esterno'] == '' ){+$numero = $rs[$r]['numero'];+}+else{+$numero = $rs[$r]['numero_esterno'];+}++$result[$r+$i]['link']= $rootdir."/modules/magazzino/ddt/ddt.php?idddt=".$rs[$r]['idddt']."&dir=".$rs[$r]['dir'];+$result[$r+$i]['title']= $rs[$r]['descrizione']." n<sup>o</sup> ".$numero." del ".date("d/m/Y", strtotime($rs[$r]['data']) );+$result[$r+$i]['category']= $rs[$r]['descrizione'];+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}++//Aggiunta nome anagrafica come ultimo campo+if( sizeof($ragioni_sociali) > 1 ){+array_push( $result[$r+$i]['labels'], "Anagrafica: ".$ragioni_sociali[ $rs[$r]['idanagrafica'] ]."<br/>" );+}+}++$i += $r;+}+}++++/*+Righe ddt+*/+if( get_permessi('Magazzino') != '-' ){+$campi= array( 'descrizione' );+$campi_text= array( 'Riga' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR dt_righe_ddt.".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT dt_ddt.*, dt_ddt.id AS idddt, dt_tipiddt.descrizione AS tipodoc, dt_tipiddt.dir, dt_righe_ddt.descrizione FROM dt_righe_ddt INNER JOIN (dt_ddt INNER JOIN dt_tipiddt ON dt_ddt.idtipoddt=dt_tipiddt.id) ON dt_ddt.id=dt_righe_ddt.idddt WHERE idanagrafica IN(".implode(',', $idanagrafiche).") ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+if( $rs[$r]['numero_esterno'] == '' ){+$numero = $rs[$r]['numero'];+}+else{+$numero = $rs[$r]['numero_esterno'];+}++$result[$r+$i]['link']= $rootdir."/modules/magazzino/ddt/ddt.php?idddt=".$rs[$r]['iddocumento']."&dir=".$rs[$r]['dir'];+$result[$r+$i]['title']= $rs[$r]['tipodoc']." n<sup>o</sup> ".$numero." del ".date("d/m/Y", strtotime($rs[$r]['data']) );+$result[$r+$i]['category']= $rs[$r]['tipodoc'];+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}++//Aggiunta nome anagrafica come ultimo campo+if( sizeof($ragioni_sociali) > 1 ){+array_push( $result[$r+$i]['labels'], "Anagrafica: ".$ragioni_sociali[ $rs[$r]['idanagrafica'] ]."<br/>" );+}+}++$i += $r;+}+}++++/*+MyImpianti+*/+if( get_permessi('MyImpianti') != '-' ){+$campi= array( 'matricola', 'nome', 'descrizione', 'ubicazione', 'occupante', 'proprietario' );+$campi_text= array( 'Matricola', 'Nome', 'Descrizione', 'Ubicazione', 'Occupante', 'Proprietario' );++$build_query = '';++for( $c=0; $c<sizeof($campi); $c++ ){+$build_query .= " OR ".$campi[$c]." LIKE \"%".$term."%\"";+}++$rs = $dbo->fetchArray("SELECT * FROM my_impianti WHERE idanagrafica IN(".implode(',', $idanagrafiche).") ".$build_query);++if( sizeof($rs) > 0 ){+//Loop record corrispondenti alla ricerca+for( $r=0; $r<sizeof($rs); $r++ ){+$result[$r+$i]['link']= $rootdir."/modules/my_impianti/my_impianti.php?matricola=".$rs[$r]['matricola'];+$result[$r+$i]['title']= $rs[$r]['matricola']." - ".$rs[$r]['nome'];+$result[$r+$i]['category']= "MyImpianti";+$result[$r+$i]['labels']= array();++//Loop campi da evidenziare+for( $c=0; $c<sizeof($campi); $c++ ){+if( preg_match("/".$term."/i", $rs[$r][ $campi[$c] ]) ){+$text = $rs[$r][ $campi[$c] ];++//Evidenzio la parola cercata nei valori dei campi+preg_match( "/".$term."/i", $rs[$r][ $campi[$c] ], $matches );++for( $m=0; $m<sizeof($matches); $m++ ){+$text = str_replace( $matches[$m], "<span class='highlight'>".$matches[$m]."</span>", $text );+}++array_push( $result[$r+$i]['labels'], $campi_text[$c].": ".$text."<br/>" );+}+}++//Aggiunta nome anagrafica come ultimo campo+if( sizeof($ragioni_sociali) > 1 ){+array_push( $result[$r+$i]['labels'], "Anagrafica: ".$ragioni_sociali[ $rs[$r]['idanagrafica'] ]."<br/>" );+}+}++$i += $r;+}+}+++//Contratti+++//Ordini++echo json_encode( $result );+}+?>Property changes on: new_trunk/openstamanager/ajax_autocomplete.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyModified: new_trunk/openstamanager/controller.php===================================================================--- new_trunk/openstamanager/controller.php2014-06-02 14:29:39 UTC (rev 923)+++ new_trunk/openstamanager/controller.php2014-06-06 22:54:33 UTC (rev 924)@@ -7,7 +7,7 @@ echo "<h3>".$module."</h3><hr>\n"; /**- * Widget top+ * TODO: Futuro include di widget prima di datatables */ @@ -27,29 +27,49 @@ $rs = $dbo->fetchArray( $module_query ); -echo "<table class='datatables'>\n";+echo "<table id='main-records' class='datatables table table-striped table-hover table-condensed table-bordered'>\n"; -echo "<thead>";-echo "<tr>";+echo "<thead>\n";+echo "<tr>\n";+ for( $c=0; $c<sizeof($fields); $c++ ){-echo "<th>".$fields[$c]."</th>\n";+//Check per tipologie di campi particolari+if( preg_match( "/^color_/", trim($fields[$c]) ) ){+$label = str_replace( "color_", "", $fields[$c] );+}++else{+$label = $fields[$c];+}++echo "<th>".$label."</th>\n"; }-echo "</tr>";-echo "</thead>"; +echo "</tr>\n";+echo "</thead>\n"; ++//Loop record+echo "<tbody>"; for( $r=0; $r<sizeof($rs); $r++ ){-echo "<tbody>"; echo "<tr>"; for( $c=0; $c<sizeof($fields); $c++ ){-echo "<td>".$rs[$r][ trim($fields[$c]) ]."</td>\n";+//Check per tipologie di campi particolari+if( preg_match( "/^color_/", trim($fields[$c]) ) ){+$value = "<div class='img-circle square' style='background:".$rs[$r][ trim($fields[$c]) ].";'>&nbsp;</div>";+}++else{+$value = $rs[$r][ trim($fields[$c]) ];+}++echo "<td>".$value."</td>\n"; } echo "</tr>\n";-echo "</tbody>"; }-+echo "</tbody>\n"; echo "</table>\n"; Modified: new_trunk/openstamanager/core.php===================================================================--- new_trunk/openstamanager/core.php2014-06-02 14:29:39 UTC (rev 923)+++ new_trunk/openstamanager/core.php2014-06-06 22:54:33 UTC (rev 924)@@ -59,18 +59,21 @@ array_push($css_modules, $theme_path."/css/AdminLTE.css"); array_push($css_modules, $theme_path."/css/jQueryUI/jquery-ui-1.10.3.custom.min.css"); array_push($css_modules, $theme_path."/css/datatables/dataTables.bootstrap.css");+array_push($css_modules, $theme_path."/css/datatables/dataTables.fixedHeader.min.css"); array_push($css_modules, $theme_path."/css/chosen.css"); array_push($css_modules, $theme_path."/css/style.css"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/bootstrap.min.js");-array_push($jscript_modules, $rootdir."/lib/jscripts/app.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery-ui-1.10.4.min.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery.ui.datepicker-".$lang.".js");-array_push($jscript_modules, $rootdir."/lib/jscripts/datatables/jquery.dataTables.js");-array_push($jscript_modules, $rootdir."/lib/jscripts/datatables/dataTables.bootstrap.js");-array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/chosen.jquery.js");-array_push($jscript_modules, $rootdir."/lib/jscripts/functions.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.min.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.columnFilter.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/dataTables.bootstrap.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/dataTables.fixedHeader.js");+//array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/chosen.jquery.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/app.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/functionsjs.php"); $dbo = new Dbo();Modified: new_trunk/openstamanager/include/top.php===================================================================--- new_trunk/openstamanager/include/top.php2014-06-02 14:29:39 UTC (rev 923)+++ new_trunk/openstamanager/include/top.php2014-06-06 22:54:33 UTC (rev 924)@@ -93,10 +93,7 @@ <!-- search form --> <form action="#" method="get" class="sidebar-form"> <div class="input-group">- <input type="text" name="q" class="form-control" placeholder="<?php echo _("Cerca") ?>..."/>- <span class="input-group-btn">- <button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>- </span>+ <input type="text" name="q" class="form-control" id="supersearch" placeholder="<?php echo _("Cerca") ?>..."/> </div> </form> <!-- /.search form -->@@ -205,6 +202,6 @@ <!-- Main content --> <section class="content"> <div class="row">- <div class="col-md-9">+ <div class="col-md-10"> <div id="main-alerts"></div> Modified: new_trunk/openstamanager/index.php===================================================================--- new_trunk/openstamanager/index.php2014-06-02 14:29:39 UTC (rev 923)+++ new_trunk/openstamanager/index.php2014-06-06 22:54:33 UTC (rev 924)@@ -1,6 +1,6 @@ <?php include("core.php");-include($docroot."/config.php");+include($docroot."/config.inc.php"); $username = save($_POST['username']); $password = save($_POST['password']);Deleted: new_trunk/openstamanager/lib/jscripts/functions.js===================================================================--- new_trunk/openstamanager/lib/jscripts/functions.js2014-06-02 14:29:39 UTC (rev 923)+++ new_trunk/openstamanager/lib/jscripts/functions.js2014-06-06 22:54:33 UTC (rev 924)@@ -1,323 +0,0 @@-$(document).ready( function(){-//Clock start-clock();--$('.tip').tooltip();--$('#main-alerts').html( $('#alerts').html() );-$('#alerts').html('');----$('.datatables').dataTable({- "bPaginate": true,- "bLengthChange": true,- "bFilter": true,- "bSort": true,- "bInfo": true,- "bAutoWidth": true- });----/*-Open submenu on mouseover-*/-$('.sidebar-menu > li.treeview').mouseenter( function(){-if( !$(this).hasClass('active') ){-$(this).find('i.fa-angle-left').removeClass('fa-angle-left').addClass('fa-angle-down');-$(this).find('ul').stop().slideDown();-}-}).mouseleave( function(){-if( !$(this).hasClass('active') ){-$(this).find('i.fa-angle-down').removeClass('fa-angle-down').addClass('fa-angle-left');-$(this).find('ul').stop().slideUp();-}-});----/*-Add class "active" on parent menu-*/-$('.treeview-menu > li.active').each( function(){-$(this).parent().show().parent().addClass('active');-$(this).parent().parent().find('i.fa-angle-left').removeClass('fa-angle-left').addClass('fa-angle-down');-});-----/*-Creo la finestra di dialogo-*/-$('.thickbox').click( function(e){-e.preventDefault();-var href = $(this).attr('href');-var title = $(this).attr('title');-var content = '';--ui_dialog( href, title );-} );---/*-Datepicker agli elementi con classe "datepicker"-*/-$(".datepicker").datepicker();---//Menu ordinabile-if( document.getElementById("toolbar") ){-$("#toolbar").sortable( {-items: 'li.module',-cursor: 'move',-stop: function(event,ui){-id = ui.item.attr("id");-var order = $(this).sortable('toArray').toString();-$.get( globals.rootdir+"/include/top.php?op=sortmodules&ids="+order, function(data, response){} );-}-} );-}--//Tabs-$('#tabs').tabs();-});----//Aggiunta main loading all'unload del body-window.onbeforeunload = function(){-$('#main_loading').show();-};---/*-Funzione per mostrare la popup di JQueryUI-*/-function ui_dialog( href, title ){-$('#dialog').dialog({-open: function(){-$("#dialog").html('');--//Carico nella dialog-ui il contenuto di un div se inizia con #...-if( href.substr(0,1)=="#" ){-divid = href.substr( 0, href.indexOf('?') );-$("#dialog").html( $(divid).html() );-}--//...o di una url-else{-$.get(href, function(data,response){-if( response=="success" ){-$("#dialog").html(data);-$(".datepicker").datepicker();-$('.chosen').chosen({no_results_text: "Nessun risultato trovato"});-}-});-}---container = $(this).parent();-$(this).dialog( 'option', 'position', 'center' );-$(this).dialog( 'option', 'position', ['middle',100] );-},-resizable: false,-title: title || ' ',-width: getUrlVars(href)["width"],-height: getUrlVars(href)["height"],-modal: true,-closeText: 'Chiudi',-close: function(){-$("#dialog").html('');-}-});--$('.ui-dialog').css('top', '100px').css('position','fixed');-setTimeout( "$('.ui-dialog').css('top', '100px').css('position','fixed');", 100 );-}---/*-Funzione per far scrollare la pagina fino a un id + focus e offset-es: ScrollToAndFocus ('id',0,'','Attenzione');-*/-function ScrollToAndFocus(id,offset,focus,messaggio){--$('html,body').animate( { scrollTop: $('#'+id).offset().top+offset }, 'slow', function() { if (messaggio!='') { alert(messaggio); messaggio=''; }; if (focus!='') { $('#'+focus).focus(); } } );--}---function session_keep_alive(){-$.get( globals.rootdir+'/core.php' );-};---function force_decimal( n ){-n = n.replace( ",", "." );-return n;-}----/*-Barra supersearch-*/-$(document).ready( function(){-//JQuery-UI Autocomplete wrapper-$.widget( "custom.catcomplete", $.ui.autocomplete, {-_renderMenu: function( ul, items ) {-if( items[0].value == undefined ){-$('#supersearch').removeClass('wait');-ul.html('');-}--else{-var that = this, currentCategory = "";--ul.addClass('ui-autocomplete-scrollable');--$.each( items, function( index, item ) {--if ( item.category != currentCategory ) {-ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );-currentCategory = item.category;-}--that._renderItemData( ul, item );-});-}-},--_renderItem: function( ul, item ){-return $("<li>")-.append( "<a href='"+item.link+"' title='Clicca per aprire'><b>"+item.value+"</b><br/>"+item.label+"</a>" )-.appendTo( ul );-}-});---$('#supersearch').keyup( function(){-$(document).ajaxStop();--if( $(this).val() == '' ){-$(this).removeClass('wait');-}--else{-$(this).addClass('wait');-}-});----//Configurazione supersearch-$('#supersearch').catcomplete({-html: true,-source: function( request, response ){-$.ajax({-url: globals.rootdir+"/ajax_autocomplete.php?op=supersearch&module=*",-async: false,-dataType: "json",-data: {-term: request.term-},---complete: function(jqXHR){-$('#supersearch').removeClass('wait');-},--success: function(data){-if( data == null ){-response( $.map( ['a'], function(item){-return false;-} ) );-}--else{-response( $.map( data, function( item ){-labels = (item.labels).toString();-labels = labels.replace( '<br/>,', '<br/>' );--return {-label: labels,-category: item.category,-link: item.link,-value: item.title-}-}));-}-},--minLength: 2,--select: function( event, ui ){-location.href = ui.link;-}-});-}-});-});--/*-True: se sText è un numero-False: altrimenti-*/-function isNumeric2(sText){-var ValidChars = "0123456789.";-var IsNumber = true;-var Char;--if( sText=='' )-return false;--for (i = 0; i < sText.length && IsNumber == true; i++){-Char = sText.charAt(i); -if (ValidChars.indexOf(Char) == -1)-IsNumber = false;-}-return IsNumber;-}--function isNumeric(input){- return (input - 0) == input && input.length > 0;-}---// Read a page's GET URL variables and return them as an associative array.-function getUrlVars( url ){- var vars = [], hash;- if( url == undefined )- var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');-else-var hashes = url.slice(url.indexOf('?') + 1).split('&');-- for(var i = 0; i < hashes.length; i++){- hash = hashes[i].split('=');- vars.push(hash[0]);- vars[hash[0]] = hash[1];- }- return vars;-}---/*-Data e ora aggiornate-*/-function clock() {- var now = new Date();- now.getHours()<10 ? h="0"+now.getHours() : h=now.getHours();- now.getMinutes()<10 ? m="0"+now.getMinutes() : m=now.getMinutes();- now.getSeconds()<10 ? s="0"+now.getSeconds() : s=now.getSeconds();- now.getDate()<10 ? dd="0"+now.getDate() : dd=now.getDate();- (now.getMonth()+1)<10 ? mm="0"+(now.getMonth()+1) : mm=(now.getMonth()+1);- yy = now.getFullYear();-- var outStr = dd+'/'+mm+'/'+yy+' '+h+':'+m+':'+s;- $('#datetime').html( outStr );- setTimeout('clock()',1000);-}--Copied: new_trunk/openstamanager/lib/jscripts/functionsjs.php (from rev 923, new_trunk/openstamanager/lib/jscripts/functions.js)===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php (rev 0)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-06-06 22:54:33 UTC (rev 924)@@ -0,0 +1,335 @@+<?php include("../../core.php") ?>+$(document).ready( function(){+//Clock start+clock();++$('.tip').tooltip();++$('#main-alerts').html( $('#alerts').html() );+$('#alerts').html('');++++// Setup - add a text input to each footer cell+var table = $('.datatables').dataTable({+"oLanguage": { "sUrl": "<?php echo $rootdir ?>/lib/jscripts/jquery/plugins/datatables/jquery.datatables.lang-<?php echo $lang ?>.js" },+ "bPaginate": false,+ "bLengthChange": false,+ "bFilter": true,+ "bSort": true,+ "bInfo": false,+ "bAutoWidth": true,+ "iDisplayLength": -1+ }).columnFilter({ 'sPlaceHolder': 'head:before' });++new $.fn.dataTable.FixedHeader( table );++ + $.fn.dataTableExt.oStdClasses.sSortDesc = "form-control";+++++++/*+Open submenu on mouseover+*/+$('.sidebar-menu > li.treeview').mouseenter( function(){+if( !$(this).hasClass('active') ){+$(this).find('i.fa-angle-left').removeClass('fa-angle-left').addClass('fa-angle-down');+$(this).find('ul').stop().slideDown();+}+}).mouseleave( function(){+if( !$(this).hasClass('active') ){+$(this).find('i.fa-angle-down').removeClass('fa-angle-down').addClass('fa-angle-left');+$(this).find('ul').stop().slideUp();+}+});++++/*+Add class "active" on parent menu+*/+$('.treeview-menu > li.active').each( function(){+$(this).parent().show().parent().addClass('active');+$(this).parent().parent().find('i.fa-angle-left').removeClass('fa-angle-left').addClass('fa-angle-down');+});+++++/*+Creo la finestra di dialogo+*/+$('.thickbox').click( function(e){+e.preventDefault();+var href = $(this).attr('href');+var title = $(this).attr('title');+var content = '';++ui_dialog( href, title );+} );+++/*+Datepicker agli elementi con classe "datepicker"+*/+$(".datepicker").datepicker();+++//Menu ordinabile+if( document.getElementById("toolbar") ){+$("#toolbar").sortable( {+items: 'li.module',+cursor: 'move',+stop: function(event,ui){+id = ui.item.attr("id");+var order = $(this).sortable('toArray').toString();+$.get( globals.rootdir+"/include/top.php?op=sortmodules&ids="+order, function(data, response){} );+}+} );+}++//Tabs+$('#tabs').tabs();+});++++//Aggiunta main loading all'unload del body+window.onbeforeunload = function(){+$('#main_loading').show();+};+++/*+Funzione per mostrare la popup di JQueryUI+*/+function ui_dialog( href, title ){+$('#dialog').dialog({+open: function(){+$("#dialog").html('');++//Carico nella dialog-ui il contenuto di un div se inizia ... [truncated message content]

[osm-devel] SF.net SVN: openstamanager:[925]new_trunk/openstamanager

From: <lo...@us...> - 2014-06-17 10:09:34

Revision: 925 http://sourceforge.net/p/openstamanager/code/925Author: loviuzDate: 2014-06-17 10:09:31 +0000 (Tue, 17 Jun 2014)Log Message:-----------[ANAGRAFICHE]predisposizione cartelle e file per OSM2[CORE]eliminazione file immagine non necessariAdded Paths:----------- new_trunk/openstamanager/modules/anagrafiche/ new_trunk/openstamanager/modules/anagrafiche/actions.php new_trunk/openstamanager/modules/anagrafiche/modutil.php new_trunk/openstamanager/share/themes/default/modules/ new_trunk/openstamanager/share/themes/default/modules/anagrafiche/ new_trunk/openstamanager/share/themes/default/modules/anagrafiche/add.html new_trunk/openstamanager/share/themes/default/modules/anagrafiche/custom/ new_trunk/openstamanager/share/themes/default/modules/anagrafiche/edit.htmlRemoved Paths:------------- new_trunk/openstamanager/share/themes/default/img/avatar.png new_trunk/openstamanager/share/themes/default/img/avatar04.png new_trunk/openstamanager/share/themes/default/img/avatar2.png new_trunk/openstamanager/share/themes/default/img/avatar3.png new_trunk/openstamanager/share/themes/default/img/avatar5.png new_trunk/openstamanager/share/themes/default/img/blur-background04.jpg new_trunk/openstamanager/share/themes/default/img/blur-background08.jpg new_trunk/openstamanager/share/themes/default/img/blur-background09.jpg new_trunk/openstamanager/share/themes/default/img/credit/ new_trunk/openstamanager/share/themes/default/img/sprite-skin-flat.png new_trunk/openstamanager/share/themes/default/img/sprite-skin-nice.png new_trunk/openstamanager/share/themes/default/img/user-bg.png new_trunk/openstamanager/share/themes/default/img/user.jpg new_trunk/openstamanager/share/themes/default/img/user2.jpgAdded: new_trunk/openstamanager/modules/anagrafiche/actions.php===================================================================Added: new_trunk/openstamanager/modules/anagrafiche/modutil.php===================================================================Deleted: new_trunk/openstamanager/share/themes/default/img/avatar.png===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/avatar04.png===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/avatar2.png===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/avatar3.png===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/avatar5.png===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/blur-background04.jpg===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/blur-background08.jpg===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/blur-background09.jpg===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/sprite-skin-flat.png===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/sprite-skin-nice.png===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/user-bg.png===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/user.jpg===================================================================(Binary files differ)Deleted: new_trunk/openstamanager/share/themes/default/img/user2.jpg===================================================================(Binary files differ)Added: new_trunk/openstamanager/share/themes/default/modules/anagrafiche/add.html===================================================================Added: new_trunk/openstamanager/share/themes/default/modules/anagrafiche/edit.html===================================================================--- new_trunk/openstamanager/share/themes/default/modules/anagrafiche/edit.html (rev 0)+++ new_trunk/openstamanager/share/themes/default/modules/anagrafiche/edit.html2014-06-17 10:09:31 UTC (rev 925)@@ -0,0 +1,9 @@+<div class="row">+<div class="col-md-6">+[type="input", class="form-control", name="ragione_sociale", value="$ragione_sociale$"]+</div>++<div class="col-md-6">+[type="select", class="form-control", name="idzona", extra="", query="SELECT id, descrizione FROM an_zone"]+</div>+</div>This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[926]new_trunk/openstamanager

From: <lo...@us...> - 2014-06-26 14:28:58

Revision: 926 http://sourceforge.net/p/openstamanager/code/926Author: loviuzDate: 2014-06-26 14:28:54 +0000 (Thu, 26 Jun 2014)Log Message:-----------[CORE]aggiunta ordinamento colonne record cliccando solo sull'etichetta della colonna, con filtro colonne ora funzionanteModified Paths:-------------- new_trunk/openstamanager/core.php new_trunk/openstamanager/include/bottom.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/share/themes/default/css/style.css new_trunk/openstamanager/update/update_2.0.sqlAdded Paths:----------- new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.js new_trunk/openstamanager/share/themes/default/img/osm_loading.gifRemoved Paths:------------- new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/dataTables.fixedHeader.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.columnFilter.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.min.jsModified: new_trunk/openstamanager/core.php===================================================================--- new_trunk/openstamanager/core.php2014-06-17 10:09:31 UTC (rev 925)+++ new_trunk/openstamanager/core.php2014-06-26 14:28:54 UTC (rev 926)@@ -67,11 +67,9 @@ array_push($jscript_modules, $rootdir."/lib/jscripts/bootstrap.min.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery-ui-1.10.4.min.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery.ui.datepicker-".$lang.".js");-array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.min.js");-array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.columnFilter.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/dataTables.bootstrap.js");-array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/dataTables.fixedHeader.js");-//array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/chosen.jquery.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/chosen.jquery.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/app.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/functionsjs.php"); Modified: new_trunk/openstamanager/include/bottom.php===================================================================--- new_trunk/openstamanager/include/bottom.php2014-06-17 10:09:31 UTC (rev 925)+++ new_trunk/openstamanager/include/bottom.php2014-06-26 14:28:54 UTC (rev 926)@@ -34,6 +34,12 @@ echo "</div>\n"; ?> +<div id="main_loading">+<div>+<i class="fa fa-cog fa-spin text-danger"></i>+</div>+</div>+ </body> </html><?php $dbo->close();Modified: new_trunk/openstamanager/lib/jscripts/functionsjs.php===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-06-17 10:09:31 UTC (rev 925)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-06-26 14:28:54 UTC (rev 926)@@ -19,11 +19,29 @@ "bSort": true, "bInfo": false, "bAutoWidth": true,- "iDisplayLength": -1- }).columnFilter({ 'sPlaceHolder': 'head:before' });+ "iDisplayLength": -1,+ "aaSorting": [],+ + "fnInitComplete": function( oSettings ){+//Aggiungo il filtro per colonna+ $('#main-records th.sorting').each( function(e){+$(this).html( $(this).html() + "<br><input type='text' class='filter form-control' placeholder='<?php echo _("Filtra") ?>...'>" );+});++//Disabilito l'ordinamento al click sull'<input>+$("thead input").click( function (e) {+stopTableSorting(e);+});++$("thead th input").on( "keyup change", function(){+idx = $(this).parent().index();++$('.datatables').DataTable().column( idx ).search( $(this).val() ).draw();+});+ }+ });+ -new $.fn.dataTable.FixedHeader( table );- $.fn.dataTableExt.oStdClasses.sSortDesc = "form-control"; @@ -35,20 +53,18 @@ /* Open submenu on mouseover */-$('.sidebar-menu > li.treeview').mouseenter( function(){-if( !$(this).hasClass('active') ){-$(this).find('i.fa-angle-left').removeClass('fa-angle-left').addClass('fa-angle-down');-$(this).find('ul').stop().slideDown();-}-}).mouseleave( function(){-if( !$(this).hasClass('active') ){-$(this).find('i.fa-angle-down').removeClass('fa-angle-down').addClass('fa-angle-left');-$(this).find('ul').stop().slideUp();-}+$('.sidebar-menu > li.treeview i.fa-angle-left').click( function(e){+e.preventDefault();+$(this).find('ul').stop().slideDown(); }); +$('.sidebar-menu > li.treeview i.fa-angle-down').click( function(e){+e.preventDefault();+$(this).find('ul').stop().slideUp();+}); + /* Add class "active" on parent menu */@@ -103,7 +119,11 @@ $('#main_loading').show(); }; +$(window).load( function(){+$('#main_loading').fadeOut();+}); + /* Funzione per mostrare la popup di JQueryUI */@@ -333,3 +353,8 @@ } +function stopTableSorting(e) {+ if (!e) var e = window.event+ e.cancelBubble = true;+ if (e.stopPropagation) e.stopPropagation();+}Deleted: new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/dataTables.fixedHeader.js===================================================================--- new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/dataTables.fixedHeader.js2014-06-17 10:09:31 UTC (rev 925)+++ new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/dataTables.fixedHeader.js2014-06-26 14:28:54 UTC (rev 926)@@ -1,1026 +0,0 @@-/*! FixedHeader 2.1.1- * ©2010-2014 SpryMedia Ltd - datatables.net/license- */--/**- * @summary FixedHeader- * @description Fix a table's header or footer, so it is always visible while- * Scrolling- * @version 2.1.1- * @file dataTables.fixedHeader.js- * @author SpryMedia Ltd (www.sprymedia.co.uk)- * @contact www.sprymedia.co.uk/contact- * @copyright Copyright 2009-2014 SpryMedia Ltd.- *- * This source file is free software, available under the following license:- * MIT license - http://datatables.net/license/mit- *- * This source file is distributed in the hope that it will be useful, but- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.- *- * For details please refer to: http://www.datatables.net- */--/* Global scope for FixedColumns for backwards compatibility - will be removed- * in future. Not documented in 1.1.x.- */--/* Global scope for FixedColumns */-var FixedHeader;--(function(window, document, undefined) {---var factory = function( $, DataTable ) {-"use strict";--/*- * Function: FixedHeader- * Purpose: Provide 'fixed' header, footer and columns for a DataTable- * Returns: object:FixedHeader - must be called with 'new'- * Inputs: mixed:mTable - target table- * @param {object} dt DataTables instance or HTML table node. With DataTables- * 1.10 this can also be a jQuery collection (with just a single table in its- * result set), a jQuery selector, DataTables API instance or settings- * object.- * @param {object} [oInit] initialisation settings, with the following- * properties (each optional)- * * bool:top - fix the header (default true)- * * bool:bottom - fix the footer (default false)- * * int:left - fix the left column(s) (default 0)- * * int:right - fix the right column(s) (default 0)- * * int:zTop - fixed header zIndex- * * int:zBottom - fixed footer zIndex- * * int:zLeft - fixed left zIndex- * * int:zRight - fixed right zIndex- */-FixedHeader = function ( mTable, oInit ) {-/* Sanity check - you just know it will happen */-if ( ! this instanceof FixedHeader )-{-alert( "FixedHeader warning: FixedHeader must be initialised with the 'new' keyword." );-return;-}--var that = this;-var oSettings = {-"aoCache": [],-"oSides": {-"top": true,-"bottom": false,-"left": 0,-"right": 0-},-"oZIndexes": {-"top": 104,-"bottom": 103,-"left": 102,-"right": 101-},-"oCloneOnDraw": {-"top": false,-"bottom": false,-"left": true,-"right": true-},-"oMes": {-"iTableWidth": 0,-"iTableHeight": 0,-"iTableLeft": 0,-"iTableRight": 0, /* note this is left+width, not actually "right" */-"iTableTop": 0,-"iTableBottom": 0 /* note this is top+height, not actually "bottom" */-},-"oOffset": {-"top": 0-},-"nTable": null,-"bFooter": false,-"bInitComplete": false-};--/*- * Function: fnGetSettings- * Purpose: Get the settings for this object- * Returns: object: - settings object- * Inputs: -- */-this.fnGetSettings = function () {-return oSettings;-};--/*- * Function: fnUpdate- * Purpose: Update the positioning and copies of the fixed elements- * Returns: -- * Inputs: -- */-this.fnUpdate = function () {-this._fnUpdateClones();-this._fnUpdatePositions();-};--/*- * Function: fnPosition- * Purpose: Update the positioning of the fixed elements- * Returns: -- * Inputs: -- */-this.fnPosition = function () {-this._fnUpdatePositions();-};---var dt = $.fn.dataTable.Api ?-new $.fn.dataTable.Api( mTable ).settings()[0] :-mTable.fnSettings();--dt._oPluginFixedHeader = this;--/* Let's do it */-this.fnInit( dt, oInit );--};---/*- * Variable: FixedHeader- * Purpose: Prototype for FixedHeader- * Scope: global- */-FixedHeader.prototype = {-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * Initialisation- */--/*- * Function: fnInit- * Purpose: The "constructor"- * Returns: -- * Inputs: {as FixedHeader function}- */-fnInit: function ( oDtSettings, oInit )-{-var s = this.fnGetSettings();-var that = this;--/* Record the user definable settings */-this.fnInitSettings( s, oInit );--if ( oDtSettings.oScroll.sX !== "" || oDtSettings.oScroll.sY !== "" )-{-alert( "FixedHeader 2 is not supported with DataTables' scrolling mode at this time" );-return;-}--s.nTable = oDtSettings.nTable;-oDtSettings.aoDrawCallback.unshift( {-"fn": function () {-FixedHeader.fnMeasure();-that._fnUpdateClones.call(that);-that._fnUpdatePositions.call(that);-},-"sName": "FixedHeader"-} );--s.bFooter = ($('>tfoot', s.nTable).length > 0) ? true : false;--/* Add the 'sides' that are fixed */-if ( s.oSides.top )-{-s.aoCache.push( that._fnCloneTable( "fixedHeader", "FixedHeader_Header", that._fnCloneThead ) );-}-if ( s.oSides.bottom )-{-s.aoCache.push( that._fnCloneTable( "fixedFooter", "FixedHeader_Footer", that._fnCloneTfoot ) );-}-if ( s.oSides.left )-{-s.aoCache.push( that._fnCloneTable( "fixedLeft", "FixedHeader_Left", that._fnCloneTLeft, s.oSides.left ) );-}-if ( s.oSides.right )-{-s.aoCache.push( that._fnCloneTable( "fixedRight", "FixedHeader_Right", that._fnCloneTRight, s.oSides.right ) );-}--/* Event listeners for window movement */-FixedHeader.afnScroll.push( function () {-that._fnUpdatePositions.call(that);-} );--$(window).resize( function () {-FixedHeader.fnMeasure();-that._fnUpdateClones.call(that);-that._fnUpdatePositions.call(that);-} );--$(s.nTable)-.on('column-reorder.dt', function () {-FixedHeader.fnMeasure();-that._fnUpdateClones( true );-that._fnUpdatePositions();-} )-.on('column-visibility.dt', function () {-FixedHeader.fnMeasure();-that._fnUpdateClones( true );-that._fnUpdatePositions();-} );--/* Get things right to start with */-FixedHeader.fnMeasure();-that._fnUpdateClones();-that._fnUpdatePositions();--s.bInitComplete = true;-},---/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * Support functions- */--/*- * Function: fnInitSettings- * Purpose: Take the user's settings and copy them to our local store- * Returns: -- * Inputs: object:s - the local settings object- * object:oInit - the user's settings object- */-fnInitSettings: function ( s, oInit )-{-if ( oInit !== undefined )-{-if ( oInit.top !== undefined ) {-s.oSides.top = oInit.top;-}-if ( oInit.bottom !== undefined ) {-s.oSides.bottom = oInit.bottom;-}-if ( typeof oInit.left == 'boolean' ) {-s.oSides.left = oInit.left ? 1 : 0;-}-else if ( oInit.left !== undefined ) {-s.oSides.left = oInit.left;-}-if ( typeof oInit.right == 'boolean' ) {-s.oSides.right = oInit.right ? 1 : 0;-}-else if ( oInit.right !== undefined ) {-s.oSides.right = oInit.right;-}--if ( oInit.zTop !== undefined ) {-s.oZIndexes.top = oInit.zTop;-}-if ( oInit.zBottom !== undefined ) {-s.oZIndexes.bottom = oInit.zBottom;-}-if ( oInit.zLeft !== undefined ) {-s.oZIndexes.left = oInit.zLeft;-}-if ( oInit.zRight !== undefined ) {-s.oZIndexes.right = oInit.zRight;-}--if ( oInit.offsetTop !== undefined ) {-s.oOffset.top = oInit.offsetTop;-}-if ( oInit.alwaysCloneTop !== undefined ) {-s.oCloneOnDraw.top = oInit.alwaysCloneTop;-}-if ( oInit.alwaysCloneBottom !== undefined ) {-s.oCloneOnDraw.bottom = oInit.alwaysCloneBottom;-}-if ( oInit.alwaysCloneLeft !== undefined ) {-s.oCloneOnDraw.left = oInit.alwaysCloneLeft;-}-if ( oInit.alwaysCloneRight !== undefined ) {-s.oCloneOnDraw.right = oInit.alwaysCloneRight;-}-}-},--/*- * Function: _fnCloneTable- * Purpose: Clone the table node and do basic initialisation- * Returns: -- * Inputs: -- */-_fnCloneTable: function ( sType, sClass, fnClone, iCells )-{-var s = this.fnGetSettings();-var nCTable;--/* We know that the table _MUST_ has a DIV wrapped around it, because this is simply how- * DataTables works. Therefore, we can set this to be relatively position (if it is not- * alreadu absolute, and use this as the base point for the cloned header- */-if ( $(s.nTable.parentNode).css('position') != "absolute" )-{-s.nTable.parentNode.style.position = "relative";-}--/* Just a shallow clone will do - we only want the table node */-nCTable = s.nTable.cloneNode( false );-nCTable.removeAttribute( 'id' );--var nDiv = document.createElement( 'div' );-nDiv.style.position = "absolute";-nDiv.style.top = "0px";-nDiv.style.left = "0px";-nDiv.className += " FixedHeader_Cloned "+sType+" "+sClass;--/* Set the zIndexes */-if ( sType == "fixedHeader" )-{-nDiv.style.zIndex = s.oZIndexes.top;-}-if ( sType == "fixedFooter" )-{-nDiv.style.zIndex = s.oZIndexes.bottom;-}-if ( sType == "fixedLeft" )-{-nDiv.style.zIndex = s.oZIndexes.left;-}-else if ( sType == "fixedRight" )-{-nDiv.style.zIndex = s.oZIndexes.right;-}--/* remove margins since we are going to position it absolutely */-nCTable.style.margin = "0";--/* Insert the newly cloned table into the DOM, on top of the "real" header */-nDiv.appendChild( nCTable );-document.body.appendChild( nDiv );--return {-"nNode": nCTable,-"nWrapper": nDiv,-"sType": sType,-"sPosition": "",-"sTop": "",-"sLeft": "",-"fnClone": fnClone,-"iCells": iCells-};-},--/*- * Function: _fnMeasure- * Purpose: Get the current positioning of the table in the DOM- * Returns: -- * Inputs: -- */-_fnMeasure: function ()-{-var-s = this.fnGetSettings(),-m = s.oMes,-jqTable = $(s.nTable),-oOffset = jqTable.offset(),-iParentScrollTop = this._fnSumScroll( s.nTable.parentNode, 'scrollTop' ),-iParentScrollLeft = this._fnSumScroll( s.nTable.parentNode, 'scrollLeft' );--m.iTableWidth = jqTable.outerWidth();-m.iTableHeight = jqTable.outerHeight();-m.iTableLeft = oOffset.left + s.nTable.parentNode.scrollLeft;-m.iTableTop = oOffset.top + iParentScrollTop;-m.iTableRight = m.iTableLeft + m.iTableWidth;-m.iTableRight = FixedHeader.oDoc.iWidth - m.iTableLeft - m.iTableWidth;-m.iTableBottom = FixedHeader.oDoc.iHeight - m.iTableTop - m.iTableHeight;-},--/*- * Function: _fnSumScroll- * Purpose: Sum node parameters all the way to the top- * Returns: int: sum- * Inputs: node:n - node to consider- * string:side - scrollTop or scrollLeft- */-_fnSumScroll: function ( n, side )-{-var i = n[side];-while ( n = n.parentNode )-{-if ( n.nodeName == 'HTML' || n.nodeName == 'BODY' )-{-break;-}-i = n[side];-}-return i;-},--/*- * Function: _fnUpdatePositions- * Purpose: Loop over the fixed elements for this table and update their positions- * Returns: -- * Inputs: -- */-_fnUpdatePositions: function ()-{-var s = this.fnGetSettings();-this._fnMeasure();--for ( var i=0, iLen=s.aoCache.length ; i<iLen ; i++ )-{-if ( s.aoCache[i].sType == "fixedHeader" )-{-this._fnScrollFixedHeader( s.aoCache[i] );-}-else if ( s.aoCache[i].sType == "fixedFooter" )-{-this._fnScrollFixedFooter( s.aoCache[i] );-}-else if ( s.aoCache[i].sType == "fixedLeft" )-{-this._fnScrollHorizontalLeft( s.aoCache[i] );-}-else-{-this._fnScrollHorizontalRight( s.aoCache[i] );-}-}-},--/*- * Function: _fnUpdateClones- * Purpose: Loop over the fixed elements for this table and call their cloning functions- * Returns: -- * Inputs: -- */-_fnUpdateClones: function ( full )-{-var s = this.fnGetSettings();--if ( full ) {-// This is a little bit of a hack to force a full clone draw. When-// `full` is set to true, we want to reclone the source elements,-// regardless of the clone-on-draw settings-s.bInitComplete = false;-}--for ( var i=0, iLen=s.aoCache.length ; i<iLen ; i++ )-{-s.aoCache[i].fnClone.call( this, s.aoCache[i] );-}--if ( full ) {-s.bInitComplete = true;-}-},---/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * Scrolling functions- */--/*- * Function: _fnScrollHorizontalLeft- * Purpose: Update the positioning of the scrolling elements- * Returns: -- * Inputs: object:oCache - the cached values for this fixed element- */-_fnScrollHorizontalRight: function ( oCache )-{-var-s = this.fnGetSettings(),-oMes = s.oMes,-oWin = FixedHeader.oWin,-oDoc = FixedHeader.oDoc,-nTable = oCache.nWrapper,-iFixedWidth = $(nTable).outerWidth();--if ( oWin.iScrollRight < oMes.iTableRight )-{-/* Fully right aligned */-this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', oMes.iTableTop+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', (oMes.iTableLeft+oMes.iTableWidth-iFixedWidth)+"px", 'left', nTable.style );-}-else if ( oMes.iTableLeft < oDoc.iWidth-oWin.iScrollRight-iFixedWidth )-{-/* Middle */-this._fnUpdateCache( oCache, 'sPosition', 'fixed', 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', (oMes.iTableTop-oWin.iScrollTop)+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', (oWin.iWidth-iFixedWidth)+"px", 'left', nTable.style );-}-else-{-/* Fully left aligned */-this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', oMes.iTableTop+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );-}-},--/*- * Function: _fnScrollHorizontalLeft- * Purpose: Update the positioning of the scrolling elements- * Returns: -- * Inputs: object:oCache - the cached values for this fixed element- */-_fnScrollHorizontalLeft: function ( oCache )-{-var-s = this.fnGetSettings(),-oMes = s.oMes,-oWin = FixedHeader.oWin,-oDoc = FixedHeader.oDoc,-nTable = oCache.nWrapper,-iCellWidth = $(nTable).outerWidth();--if ( oWin.iScrollLeft < oMes.iTableLeft )-{-/* Fully left align */-this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', oMes.iTableTop+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );-}-else if ( oWin.iScrollLeft < oMes.iTableLeft+oMes.iTableWidth-iCellWidth )-{-this._fnUpdateCache( oCache, 'sPosition', 'fixed', 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', (oMes.iTableTop-oWin.iScrollTop)+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', "0px", 'left', nTable.style );-}-else-{-/* Fully right align */-this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', oMes.iTableTop+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', (oMes.iTableLeft+oMes.iTableWidth-iCellWidth)+"px", 'left', nTable.style );-}-},--/*- * Function: _fnScrollFixedFooter- * Purpose: Update the positioning of the scrolling elements- * Returns: -- * Inputs: object:oCache - the cached values for this fixed element- */-_fnScrollFixedFooter: function ( oCache )-{-var-s = this.fnGetSettings(),-oMes = s.oMes,-oWin = FixedHeader.oWin,-oDoc = FixedHeader.oDoc,-nTable = oCache.nWrapper,-iTheadHeight = $("thead", s.nTable).outerHeight(),-iCellHeight = $(nTable).outerHeight();--if ( oWin.iScrollBottom < oMes.iTableBottom )-{-/* Below */-this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', (oMes.iTableTop+oMes.iTableHeight-iCellHeight)+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );-}-else if ( oWin.iScrollBottom < oMes.iTableBottom+oMes.iTableHeight-iCellHeight-iTheadHeight )-{-this._fnUpdateCache( oCache, 'sPosition', 'fixed', 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', (oWin.iHeight-iCellHeight)+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', (oMes.iTableLeft-oWin.iScrollLeft)+"px", 'left', nTable.style );-}-else-{-/* Above */-this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', (oMes.iTableTop+iCellHeight)+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );-}-},--/*- * Function: _fnScrollFixedHeader- * Purpose: Update the positioning of the scrolling elements- * Returns: -- * Inputs: object:oCache - the cached values for this fixed element- */-_fnScrollFixedHeader: function ( oCache )-{-var-s = this.fnGetSettings(),-oMes = s.oMes,-oWin = FixedHeader.oWin,-oDoc = FixedHeader.oDoc,-nTable = oCache.nWrapper,-iTbodyHeight = 0,-anTbodies = s.nTable.getElementsByTagName('tbody');--for (var i = 0; i < anTbodies.length; ++i) {-iTbodyHeight += anTbodies[i].offsetHeight;-}--oMes.iTableTop -= 19;--if ( oMes.iTableTop > oWin.iScrollTop + s.oOffset.top )-{-/* Above the table */-this._fnUpdateCache( oCache, 'sPosition', "absolute", 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', oMes.iTableTop+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );-}-else if ( oWin.iScrollTop + s.oOffset.top > oMes.iTableTop+iTbodyHeight )-{-/* At the bottom of the table */-this._fnUpdateCache( oCache, 'sPosition', "absolute", 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', (oMes.iTableTop+iTbodyHeight)+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );-}-else-{-/* In the middle of the table */-this._fnUpdateCache( oCache, 'sPosition', 'fixed', 'position', nTable.style );-this._fnUpdateCache( oCache, 'sTop', s.oOffset.top+"px", 'top', nTable.style );-this._fnUpdateCache( oCache, 'sLeft', (oMes.iTableLeft-oWin.iScrollLeft)+"px", 'left', nTable.style );-}-},--/*- * Function: _fnUpdateCache- * Purpose: Check the cache and update cache and value if needed- * Returns: -- * Inputs: object:oCache - local cache object- * string:sCache - cache property- * string:sSet - value to set- * string:sProperty - object property to set- * object:oObj - object to update- */-_fnUpdateCache: function ( oCache, sCache, sSet, sProperty, oObj )-{-if ( oCache[sCache] != sSet )-{-oObj[sProperty] = sSet;-oCache[sCache] = sSet;-}-},----/**- * Copy the classes of all child nodes from one element to another. This implies- * that the two have identical structure - no error checking is performed to that- * fact.- * @param {element} source Node to copy classes from- * @param {element} dest Node to copy classes too- */-_fnClassUpdate: function ( source, dest )-{-var that = this;--if ( source.nodeName.toUpperCase() === "TR" || source.nodeName.toUpperCase() === "TH" ||- source.nodeName.toUpperCase() === "TD" || source.nodeName.toUpperCase() === "SPAN" )-{-dest.className = source.className;-}--$(source).children().each( function (i) {-that._fnClassUpdate( $(source).children()[i], $(dest).children()[i] );-} );-},---/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * Cloning functions- */--/*- * Function: _fnCloneThead- * Purpose: Clone the thead element- * Returns: -- * Inputs: object:oCache - the cached values for this fixed element- */-_fnCloneThead: function ( oCache )-{-var s = this.fnGetSettings();-var nTable = oCache.nNode;--if ( s.bInitComplete && !s.oCloneOnDraw.top )-{-this._fnClassUpdate( $('thead', s.nTable)[0], $('thead', nTable)[0] );-return;-}--/* Set the wrapper width to match that of the cloned table */-var iDtWidth = $(s.nTable).outerWidth();-oCache.nWrapper.style.width = iDtWidth+"px";-nTable.style.width = iDtWidth+"px";--/* Remove any children the cloned table has */-while ( nTable.childNodes.length > 0 )-{-$('thead th', nTable).unbind( 'click' );-nTable.removeChild( nTable.childNodes[0] );-}--/* Clone the DataTables header */-var nThead = $('thead', s.nTable).clone(true)[0];-nTable.appendChild( nThead );--/* Copy the widths across - apparently a clone isn't good enough for this */-var a = [];-var b = [];--$("thead>tr th", s.nTable).each( function (i) {-a.push( $(this).width() );-} );--$("thead>tr td", s.nTable).each( function (i) {-b.push( $(this).width() );-} );--$("thead>tr th", s.nTable).each( function (i) {-$("thead>tr th:eq("+i+")", nTable).width( a[i] );-$(this).width( a[i] );-} );--$("thead>tr td", s.nTable).each( function (i) {-$("thead>tr td:eq("+i+")", nTable).width( b[i] );-$(this).width( b[i] );-} );--// Stop DataTables 1.9 from putting a focus ring on the headers when-// clicked to sort-$('th.sorting, th.sorting_desc, th.sorting_asc', nTable).bind( 'click', function () {-this.blur();-} );-},--/*- * Function: _fnCloneTfoot- * Purpose: Clone the tfoot element- * Returns: -- * Inputs: object:oCache - the cached values for this fixed element- */-_fnCloneTfoot: function ( oCache )-{-var s = this.fnGetSettings();-var nTable = oCache.nNode;--/* Set the wrapper width to match that of the cloned table */-oCache.nWrapper.style.width = $(s.nTable).outerWidth()+"px";--/* Remove any children the cloned table has */-while ( nTable.childNodes.length > 0 )-{-nTable.removeChild( nTable.childNodes[0] );-}--/* Clone the DataTables footer */-var nTfoot = $('tfoot', s.nTable).clone(true)[0];-nTable.appendChild( nTfoot );--/* Copy the widths across - apparently a clone isn't good enough for this */-$("tfoot:eq(0)>tr th", s.nTable).each( function (i) {-$("tfoot:eq(0)>tr th:eq("+i+")", nTable).width( $(this).width() );-} );--$("tfoot:eq(0)>tr td", s.nTable).each( function (i) {-$("tfoot:eq(0)>tr td:eq("+i+")", nTable).width( $(this).width() );-} );-},--/*- * Function: _fnCloneTLeft- * Purpose: Clone the left column(s)- * Returns: -- * Inputs: object:oCache - the cached values for this fixed element- */-_fnCloneTLeft: function ( oCache )-{-var s = this.fnGetSettings();-var nTable = oCache.nNode;-var nBody = $('tbody', s.nTable)[0];--/* Remove any children the cloned table has */-while ( nTable.childNodes.length > 0 )-{-nTable.removeChild( nTable.childNodes[0] );-}--/* Is this the most efficient way to do this - it looks horrible... */-nTable.appendChild( $("thead", s.nTable).clone(true)[0] );-nTable.appendChild( $("tbody", s.nTable).clone(true)[0] );-if ( s.bFooter )-{-nTable.appendChild( $("tfoot", s.nTable).clone(true)[0] );-}--/* Remove unneeded cells */-var sSelector = 'gt(' + (oCache.iCells - 1) + ')';-$('thead tr', nTable).each( function (k) {-$('th:' + sSelector, this).remove();-} );--$('tfoot tr', nTable).each( function (k) {-$('th:' + sSelector, this).remove();-} );--$('tbody tr', nTable).each( function (k) {-$('td:' + sSelector, this).remove();-} );--this.fnEqualiseHeights( 'thead', nBody.parentNode, nTable );-this.fnEqualiseHeights( 'tbody', nBody.parentNode, nTable );-this.fnEqualiseHeights( 'tfoot', nBody.parentNode, nTable );--var iWidth = 0;-for (var i = 0; i < oCache.iCells; i++) {-iWidth += $('thead tr th:eq(' + i + ')', s.nTable).outerWidth();-}-nTable.style.width = iWidth+"px";-oCache.nWrapper.style.width = iWidth+"px";-},--/*- * Function: _fnCloneTRight- * Purpose: Clone the right most column(s)- * Returns: -- * Inputs: object:oCache - the cached values for this fixed element- */-_fnCloneTRight: function ( oCache )-{-var s = this.fnGetSettings();-var nBody = $('tbody', s.nTable)[0];-var nTable = oCache.nNode;-var iCols = $('tbody tr:eq(0) td', s.nTable).length;--/* Remove any children the cloned table has */-while ( nTable.childNodes.length > 0 )-{-nTable.removeChild( nTable.childNodes[0] );-}--/* Is this the most efficient way to do this - it looks horrible... */-nTable.appendChild( $("thead", s.nTable).clone(true)[0] );-nTable.appendChild( $("tbody", s.nTable).clone(true)[0] );-if ( s.bFooter )-{-nTable.appendChild( $("tfoot", s.nTable).clone(true)[0] );-}-$('thead tr th:lt('+(iCols-oCache.iCells)+')', nTable).remove();-$('tfoot tr th:lt('+(iCols-oCache.iCells)+')', nTable).remove();--/* Remove unneeded cells */-$('tbody tr', nTable).each( function (k) {-$('td:lt('+(iCols-oCache.iCells)+')', this).remove();-} );--this.fnEqualiseHeights( 'thead', nBody.parentNode, nTable );-this.fnEqualiseHeights( 'tbody', nBody.parentNode, nTable );-this.fnEqualiseHeights( 'tfoot', nBody.parentNode, nTable );--var iWidth = 0;-for (var i = 0; i < oCache.iCells; i++) {-iWidth += $('thead tr th:eq('+(iCols-1-i)+')', s.nTable).outerWidth();-}-nTable.style.width = iWidth+"px";-oCache.nWrapper.style.width = iWidth+"px";-},---/**- * Equalise the heights of the rows in a given table node in a cross browser way. Note that this- * is more or less lifted as is from FixedColumns- * @method fnEqualiseHeights- * @returns void- * @param {string} parent Node type - thead, tbody or tfoot- * @param {element} original Original node to take the heights from- * @param {element} clone Copy the heights to- * @private- */-"fnEqualiseHeights": function ( parent, original, clone )-{-var that = this;-var originals = $(parent +' tr', original);-var height;--$(parent+' tr', clone).each( function (k) {-height = originals.eq( k ).css('height');--// This is nasty :-(. IE has a sub-pixel error even when setting-// the height below (the Firefox fix) which causes the fixed column-// to go out of alignment. Need to add a pixel before the assignment-// Can this be feature detected? Not sure how...-if ( navigator.appName == 'Microsoft Internet Explorer' ) {-height = parseInt( height, 10 ) + 1;-}--$(this).css( 'height', height );--// For Firefox to work, we need to also set the height of the-// original row, to the value that we read from it! Otherwise there-// is a sub-pixel rounding error-originals.eq( k ).css( 'height', height );-} );-}-};---/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * Static properties and methods- * We use these for speed! This information is common to all instances of FixedHeader, so no- * point if having them calculated and stored for each different instance.- */--/*- * Variable: oWin- * Purpose: Store information about the window positioning- * Scope: FixedHeader- */-FixedHeader.oWin = {-"iScrollTop": 0,-"iScrollRight": 0,-"iScrollBottom": 0,-"iScrollLeft": 0,-"iHeight": 0,-"iWidth": 0-};--/*- * Variable: oDoc- * Purpose: Store information about the document size- * Scope: FixedHeader- */-FixedHeader.oDoc = {-"iHeight": 0,-"iWidth": 0-};--/*- * Variable: afnScroll- * Purpose: Array of functions that are to be used for the scrolling components- * Scope: FixedHeader- */-FixedHeader.afnScroll = [];--/*- * Function: fnMeasure- * Purpose: Update the measurements for the window and document- * Returns: -- * Inputs: -- */-FixedHeader.fnMeasure = function ()-{-var-jqWin = $(window),-jqDoc = $(document),-oWin = FixedHeader.oWin,-oDoc = FixedHeader.oDoc;--oDoc.iHeight = jqDoc.height();-oDoc.iWidth = jqDoc.width();--oWin.iHeight = jqWin.height();-oWin.iWidth = jqWin.width();-oWin.iScrollTop = jqWin.scrollTop();-oWin.iScrollLeft = jqWin.scrollLeft();-oWin.iScrollRight = oDoc.iWidth - oWin.iScrollLeft - oWin.iWidth;-oWin.iScrollBottom = oDoc.iHeight - oWin.iScrollTop - oWin.iHeight;-};---FixedHeader.version = "2.1.1";---/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * Global processing- */--/*- * Just one 'scroll' event handler in FixedHeader, which calls the required components. This is- * done as an optimisation, to reduce calculation and proagation time- */-$(window).scroll( function () {-FixedHeader.fnMeasure();--for ( var i=0, iLen=FixedHeader.afnScroll.length ; i<iLen ; i++ ) {-FixedHeader.afnScroll[i]();-}-} );---$.fn.dataTable.FixedHeader = FixedHeader;-$.fn.DataTable.FixedHeader = FixedHeader;---return FixedHeader;-}; // /factory---// Define as an AMD module if possible-if ( typeof define === 'function' && define.amd ) {-define( 'datatables-fixedheader', ['jquery', 'datatables'], factory );-}-else if ( jQuery && !jQuery.fn.dataTable.FixedHeader ) {-// Otherwise simply initialise as normal, stopping multiple evaluation-factory( jQuery, jQuery.fn.dataTable );-}---})(window, document);-Deleted: new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.columnFilter.js===================================================================--- new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.columnFilter.js2014-06-17 10:09:31 UTC (rev 925)+++ new_trunk/openstamanager/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.columnFilter.js2014-06-26 14:28:54 UTC (rev 926)@@ -1,829 +0,0 @@-/*-* File: jquery.dataTables.columnFilter.js-* Version: 1.5.6.-* Author: Jovan Popovic -* -* Copyright 2011-2014 Jovan Popovic, all rights reserved.-*-* This source file is free software, under either the GPL v2 license or a-* BSD style license, as supplied with this software.-* -* This source file is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -* or FITNESS FOR A PARTICULAR PURPOSE. -* -* Parameters:"-* @sPlaceHolder String Place where inline filtering function should be placed ("tfoot", "thead:before", "thead:after"). Default is "tfoot"-* @sRangeSeparator String Separator that will be used when range values are sent to the server-side. Default value is "~".-* @sRangeFormat string Default format of the From ... to ... range inputs. Default is From {from} to {to}-* @aoColumns Array Array of the filter settings that will be applied on the columns-*/-(function ($) {--- $.fn.columnFilter = function (options) {-- var asInitVals, i, label, th;-- //var sTableId = "table";- var sRangeFormat = "From {from} to {to}";- //Array of the functions that will override sSearch_ parameters- var afnSearch_ = new Array();- var aiCustomSearch_Indexes = new Array();-- var oFunctionTimeout = null;-- var fnOnFiltered = function () { };-- function _fnGetColumnValues(oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty) {- ///<summary>- ///Return values in the column- ///</summary>- ///<param name="oSettings" type="Object">DataTables settings</param>- ///<param name="iColumn" type="int">Id of the column</param>- ///<param name="bUnique" type="bool">Return only distinct values</param>- ///<param name="bFiltered" type="bool">Return values only from the filtered rows</param>- ///<param name="bIgnoreEmpty" type="bool">Ignore empty cells</param>-- // check that we have a column id- if (typeof iColumn == "undefined") return new Array();-- // by default we only wany unique data- if (typeof bUnique == "undefined") bUnique = true;-- // by default we do want to only look at filtered data- if (typeof bFiltered == "undefined") bFiltered = true;-- // by default we do not wany to include empty values- if (typeof bIgnoreEmpty == "undefined") bIgnoreEmpty = true;-- // list of rows which we're going to loop through- var aiRows;-- // use only filtered rows- if (bFiltered == true) aiRows = oSettings.aiDisplay;- // use all rows- else aiRows = oSettings.aiDisplayMaster; // all row numbers-- // set up data array- var asResultData = new Array();-- for (var i = 0, c = aiRows.length; i < c; i++) {- var iRow = aiRows[i];- var aData = oTable.fnGetData(iRow);- var sValue = aData[iColumn];-- // ignore empty values?- if (bIgnoreEmpty == true && sValue.length == 0) continue;-- // ignore unique values?- else if (bUnique == true && jQuery.inArray(sValue, asResultData) > -1) continue;-- // else push the value onto the result data array- else asResultData.push(sValue);- }-- return asResultData.sort();- }-- function _fnColumnIndex(iColumnIndex) {- if (properties.bUseColVis)- return iColumnIndex;- else- return oTable.fnSettings().oApi._fnVisibleToColumnIndex(oTable.fnSettings(), iColumnIndex);- //return iColumnIndex;- //return oTable.fnSettings().oApi._fnColumnIndexToVisible(oTable.fnSettings(), iColumnIndex);- }-- function fnCreateInput(oTable, regex, smart, bIsNumber, iFilterLength, iMaxLenght) {- var sCSSClass = "text_filter form-control";- if (bIsNumber)- sCSSClass = "number_filter form-control";-- label = label.replace(/(^\s*)|(\s*$)/g, "");- var currentFilter = oTable.fnSettings().aoPreSearchCols[i].sSearch;- var search_init = 'search_init ';- var inputvalue = label;- if (currentFilter != '' && currentFilter != '^') {- if (bIsNumber && currentFilter.charAt(0) == '^')- inputvalue = currentFilter.substr(1); //ignore trailing ^- else- inputvalue = currentFilter;- search_init = '';- }-- var input = $('<input type="text" class="' + search_init + sCSSClass + '" value="' + inputvalue + '" rel="' + i + '"/>');- if (iMaxLenght != undefined && iMaxLenght != -1) {- input.attr('maxlength', iMaxLenght);- }- th.html(input);- if (bIsNumber)- th.wrapInner('<span class="filter_column filter_number" />');- else- th.wrapInner('<span class="filter_column filter_text" />');-- asInitVals[i] = label;- var index = i;-- if (bIsNumber && !oTable.fnSettings().oFeatures.bServerSide) {- input.keyup(function () {- /* Filter on the column all numbers that starts with the entered value */- oTable.fnFilter('^' + this.value, _fnColumnIndex(index), true, false); //Issue 37- fnOnFiltered();- });- } else {- input.keyup(function () {- if (oTable.fnSettings().oFeatures.bServerSide && iFilterLength != 0) {- //If filter length is set in the server-side processing mode- //Check has the user entered at least iFilterLength new characters-- var currentFilter = oTable.fnSettings().aoPreSearchCols[index].sSearch;- var iLastFilterLength = $(this).data("dt-iLastFilterLength");- if (typeof iLastFilterLength == "undefined")- iLastFilterLength = 0;- var iCurrentFilterLength = this.value.length;- if (Math.abs(iCurrentFilterLength - iLastFilterLength) < iFilterLength- //&& currentFilter.length == 0 //Why this?- ) {- //Cancel the filtering- return;- }- else {- //Remember the current filter length- $(this).data("dt-iLastFilterLength", iCurrentFilterLength);- }- }- /* Filter on the column (the index) of this element */- oTable.fnFilter(this.value, _fnColumnIndex(index), regex, smart); //Issue 37- fnOnFiltered();- });- }-- input.focus(function () {- if ($(this).hasClass("search_init")) {- $(this).removeClass("search_init");- this.value = "";- }- });- input.blur(function () {- if (this.value == "") {- $(this).addClass("search_init");- this.value = asInitVals[index];- }- });- }-- function fnCreateRangeInput(oTable) {--//var currentFilter = oTable.fnSettings().aoPreSearchCols[i].sSearch;- th.html(_fnRangeLabelPart(0));- var sFromId = oTable.attr("id") + '_range_from_' + i;- var from = $('<input type="text" class="number_range_filter form-control" id="' + sFromId + '" rel="' + i + '"/>');- th.append(from);- th.append(_fnRangeLabelPart(1));- var sToId = oTable.attr("id") + '_range_to_' + i;- var to = $('<input type="text" class="number_range_filter form-control" id="' + sToId + '" rel="' + i + '"/>');- th.append(to);- th.append(_fnRangeLabelPart(2));- th.wrapInner('<span class="filter_column filter_number_range form-control" />');- var index = i;- aiCustomSearch_Indexes.push(i);---- //------------start range filtering function--- /* Custom filtering function which will filter data in column four between two values- *Author: Allan Jardine, Modified by Jovan Popovic- */- //$.fn.dataTableExt.afnFiltering.push(- oTable.dataTableExt.afnFiltering.push(- function (oSettings, aData, iDataIndex) {- if (oTable.attr("id") != oSettings.sTableId)- return true;- // Try to handle missing nodes more gracefully- if (document.getElementById(sFromId) == null)- return true;- var iMin = document.getElementById(sFromId).value * 1;- var iMax = document.getElementById(sToId).value * 1;- var iValue = aData[_fnColumnIndex(index)] == "-" ? 0 : aData[_fnColumnIndex(index)] * 1;- if (iMin == "" && iMax == "") {- return true;- }- else if (iMin == "" && iValue <= iMax) {- return true;- }- else if (iMin <= iValue && "" == iMax) {- return true;- }- else if (iMin <= iValue && iValue <= iMax) {- return true;- }- return false;- }- );- //------------end range filtering function---- $('#' + sFromId + ',#' + sToId, th).keyup(function () {-- var iMin = document.getElementById(sFromId).value * 1;- var iMax = document.getElementById(sToId).value * 1;- if (iMin != 0 && iMax != 0 && iMin > iMax)- return;-- oTable.fnDraw();- fnOnFiltered();- });--- }--- function fnCreateDateRangeInput(oTable) {-- var aoFragments = sRangeFormat.split(/[}{]/);-- th.html("");- //th.html(_fnRangeLabelPart(0));- var sFromId = oTable.attr("id") + '_range_from_' + i;- var from = $('<input type="text" class="date_range_filter form-control" id="' + sFromId + '" rel="' + i + '"/>');- from.datepicker();- //th.append(from);- //th.append(_fnRangeLabelPart(1));- var sToId = oTable.attr("id") + '_range_to_' + i;- var to = $('<input type="text" class="date_range_filter form-control" id="' + sToId + '" rel="' + i + '"/>');- //th.append(to);- //th.append(_fnRangeLabelPart(2));-- for (ti = 0; ti < aoFragments.length; ti++) {-- if (aoFragments[ti] == properties.sDateFromToken) {- th.append(from);- } else {- if (aoFragments[ti] == properties.sDateToToken) {- th.append(to);- } else {- th.append(aoFragments[ti]);- }- }- -- }--- th.wrapInner('<span class="filter_column filter_date_range" />');- to.datepicker();- var index = i;- aiCustomSearch_Indexes.push(i);--- //------------start date range filtering function-- //$.fn.dataTableExt.afnFiltering.push(- oTable.dataTableExt.afnFiltering.push(- function (oSettings, aData, iDataIndex) {- if (oTable.attr("id") != oSettings.sTableId)- return true;-- var dStartDate = from.datepicker("getDate");-- var dEndDate = to.datepicker("getDate");-- if (dStartDate == null && dEndDate == null) {- return true;- }-- var dCellDate = null;- try {- if (aData[_fnColumnIndex(index)] == null || aData[_fnColumnIndex(index)] == "")- return false;- dCellDate = $.datepicker.parseDate($.datepicker.regional[""].dateFormat, aData[_fnColumnIndex(index)]);- } catch (ex) {- return false;- }- if (dCellDate == null)- return false;--- if (dStartDate == null && dCellDate <= dEndDate) {- return true;- }- else if (dStartDate <= dCellDate && dEndDate == null) {- return true;- }- else if (dStartDate <= dCellDate && dCellDate <= dEndDate) {- return true;- }- return false;- }- );- //------------end date range filtering function-- $('#' + sFromId + ',#' + sToId, th).change(function () {- oTable.fnDraw();- fnOnFiltered();- });--- }-- function fnCreateColumnSelect(oTable, aData, iColumn, nTh, sLabel, bRegex, oSelected, bMultiselect) {- if (aData == null)- aData = _fnGetColumnValues(oTable.fnSettings(), iColumn, true, false, true);- var index = iColumn;- var currentFilter = oTable.fnSettings().aoPreSearchCols[i].sSearch;- if (currentFilter == null || currentFilter == "")//Issue 81- currentFilter = oSelected;-- var r = '<select class="search_init select_filter form-control" rel="' + i + '"><option value="" class="search_init">' + sLabel + '</option>';-if(bMultiselect) {-r = '<select class="search_init select_filter form-control" rel="' + i + '" multiple>';-}- var j = 0;- var iLen = aData.length;- for (j = 0; j < iLen; j++) {- if (typeof (aData[j]) != 'object') {- var selected = '';- if (escape(aData[j]) == currentFilter- || escape(aData[j]) == escape(currentFilter)- )- selected = 'selected '- r += '<option ' + selected + ' value="' + escape(aData[j]) + '">' + aData[j] + '</option>';- }- else {- var selected = '';- if (bRegex) {- //Do not escape values if they are explicitely set to avoid escaping special characters in the regexp- if (aData[j].value == currentFilter) selected = 'selected ';- r += '<option ' + selected + 'value="' + aData[j].value + '">' + aData[j].label + '</option>';- } else {- if (escape(aData[j].value) == currentFilter) selected = 'selected ';- r += '<option ' + selected + 'value="' + escape(aData[j].value) + '">' + aData[j].label + '</option>';- }- }- }-- var select = $(r + '</select>');- nTh.html(select);- nTh.wrapInner('<span class="filter_column filter_select" />');--if(bMultiselect) {-select.change(function () {-if ($(this).val() != "") {-$(this).removeClass("search_init");-} else {-$(this).addClass("search_init");-}-var selectedOptions = $(this).val();-var asEscapedFilters = [];-if(selectedOptions==null || selectedOptions==[]){-var re = '^(.*)$';-}else{-$.each( selectedOptions, function( i, sFilter ) {-asEscapedFilters.push( fnRegExpEscape( sFilter ) );-} );-var re = '^(' + asEscapedFilters.join('|') + ')$';-}- -oTable.fnFilter( re, index, true, false );-});-} else {-select.change(function () {-//var val = $(this).val();-if ($(this).val() != "") {-$(this).removeClass("search_init");-} else {-$(this).addClass("search_init");-}-if (bRegex)-oTable.fnFilter($(this).val(), iColumn, bRegex); //Issue 41-else-oTable.fnFilter(unescape($(this).val()), iColumn); //Issue 25-fnOnFiltered();-});-if (currentFilter != null && currentFilter != "")//Issue 81-oTable.fnFilter(unescape(currentFilter), iColumn);-}- }-- function fnCreateSelect(oTable, aData, bRegex, oSelected, bMultiselect) {- var oSettings = oTable.fnSettings();- if ( (aData == null || typeof(aData) == 'function' ) && oSettings.sAjaxSource != "" && !oSettings.oFeatures.bServerSide) {- // Add a function to the draw callback, which will check for the Ajax data having - // been loaded. Use a closure for the individual column elements that are used to - // built the column filter, since 'i' and 'th' (etc) are locally "global".- oSettings.aoDrawCallback.push({- "fn": (function (iColumn, nTh, sLabel) {- return function (oSettings) {- // Only rebuild the select on the second draw - i.e. when the Ajax- // data has been loaded.- if (oSettings.iDraw == 2 && oSettings.sAjaxSource != null && oSettings.sAjaxSource != "" && !oSettings.oFeatures.bServerSide) {- return fnCreateColumnSelect(oTable, aData && aData(oSettings.aoData, oSettings), _fnColumnIndex(iColumn), nTh, sLabel, bRegex, oSelected, bMultiselect); //Issue 37- }- };- })(i, th, label),- "sName": "column_filter_" + i- });- }- // Regardless of the Ajax state, build the select on first pass- fnCreateColumnSelect(oTable, typeof(aData) == 'function' ? null: aData, _fnColumnIndex(i), th, label, bRegex, oSelected, bMultiselect); //Issue 37-- }- -function fnRegExpEscape( sText ) { -return sText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); -};--function fnCreateDropdown(aData) {-var index = i;-var r = '<div class="dropdown select_filter form-control"><a class="dropdown-toggle" data-toggle="dropdown" href="#">' + label + '<b class="caret"></b></a><ul class="dropdown-menu" role="menu"><li data-value=""><a>Show All</a></li>', j, iLen = aData.length;--for (j = 0; j < iLen; j++) {-r += '<li data-value="' + aData[j] + '"><a>' + aData[j] + '</a></li>';-}-var select = $(r + '</ul></div>');-th.html(select);-th.wrapInner('<span class="filterColumn filter_select" />');-select.find('li').click(function () {-oTable.fnFilter($(this).data('value'), index);-});-}--- function fnCreateCheckbox(oTable, aData) {-- if (aData == null)- aData = _fnGetColumnValues(oTable.fnSettings(), i, true, true, true);- var index = i;-- var r = '', j, iLen = aData.length;-- //clean the string- var localLabel = label.replace('%', 'Perc').replace("&", "AND").replace("$", "DOL").replace("£", "STERL").replace("@", "AT").replace(/\s/g, "_");- localLabel = localLabel.replace(/[^a-zA-Z 0-9]+/g, '');- //clean the string-- //button label override- var labelBtn = label;- if (properties.sFilterButtonText != null || properties.sFilterButtonText != undefined) {- labelBtn = properties.sFilterButtonText;- }-- var relativeDivWidthToggleSize = 10;- var numRow = 12; //numero di checkbox per colonna- var numCol = Math.floor(iLen / numRow);- if (iLen % numRow > 0) {- numCol = numCol + 1;- };-- //count how many column should be generated and split the div size- var divWidth = 100 / numCol - 2;-- var divWidthToggle = relativeDivWidthToggleSize * numCol;-- if (numCol == 1) {- divWidth = 20;- }-- var divRowDef = '<div style="float:left; min-width: ' + divWidth + '%; " >';- var divClose = '</div>';-- var uniqueId = oTable.attr("id") + localLabel;- var buttonId = "chkBtnOpen" + uniqueId;- var checkToggleDiv = uniqueId + "-flt-toggle";- r += '<button id="' + buttonId + '" class="checkbox_filter btn btn-default" > ' + labelBtn + '</button>'; //filter button witch open dialog- r += '<div id="' + checkToggleDiv + '" '- + 'title="' + label + '" '- + 'rel="' + i + '" '- + 'class="toggle-check ui-widget-content ui-corner-all" style="width: ' + (divWidthToggle) + '%; " >'; //dialog div- //r+= '<div align="center" style="margin-top: 5px; "> <button id="'+buttonId+'Reset" class="checkbox_filter" > reset </button> </div>'; //reset button and its div- r += divRowDef;-- for (j = 0; j < iLen; j++) {-- //if last check close div- if (j % numRow == 0 && j != 0) {- r += divClose + divRowDef;- }-- var sLabel = aData[j];- var sValue = aData[j];-- if (typeof (aData[j]) == 'object') {- sLabel = aData[j].label;- sValue = aData[j].value;- }-- //check button- r += '<input class="search_init checkbox_filter btn btn-default" type="checkbox" id= "' + uniqueId + '_cb_' + sValue + '" name= "' + localLabel + '" value="' + sValue + '" >' + sLabel + '<br/>';-- var checkbox = $(r);- th.html(checkbox);- th.wrapInner('<span class="filter_column filter_checkbox" />');- //on every checkbox selection- checkbox.change(function () {-- var search = '';- var or = '|'; //var for select checks in 'or' into the regex- var resSize = $('input:checkbox[name="' + localLabel + '"]:checked').size();- $('input:checkbox[name="' + localLabel + '"]:checked').each(function (index) {-- //search = search + ' ' + $(this).val();- //concatenation for selected checks in or- if ((index == 0 && resSize == 1)- || (index != 0 && index == resSize - 1)) {- or = '';- }- //trim- search = search.replace(/^\s+|\s+$/g, "");- search = search + $(this).val() + or;- or = '|';-- });--- if (search != "") {- $('input:checkbox[name="' + localLabel + '"]').removeClass("search_init");- } else {- $('input:checkbox[name="' + localLabel + '"]').addClass("search_init");- }- /* Old code for setting search_init CSS class on checkboxes if any of them is checked- for (var jj = 0; jj < iLen; jj++) {... [truncated message content]

[osm-devel] SF.net SVN: openstamanager:[927]new_trunk/openstamanager

From: <lo...@us...> - 2014-07-05 13:03:27

Revision: 927 http://sourceforge.net/p/openstamanager/code/927Author: loviuzDate: 2014-07-05 13:03:23 +0000 (Sat, 05 Jul 2014)Log Message:-----------[ANAGRAFICHE]costruito primo modello del modulo anagrafiche con il sistema di template[CORE]avanzamento motore php per gestione template modulisistemati quasi tutti i link del supersearchModified Paths:-------------- new_trunk/openstamanager/ajax_autocomplete.php new_trunk/openstamanager/controller.php new_trunk/openstamanager/core.php new_trunk/openstamanager/include/top.php new_trunk/openstamanager/lib/htmlbuilder.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/modules/anagrafiche/actions.php new_trunk/openstamanager/modules/anagrafiche/modutil.php new_trunk/openstamanager/share/themes/default/css/style.css new_trunk/openstamanager/update/update_2.0.sqlAdded Paths:----------- new_trunk/openstamanager/modules/anagrafiche/custom/ new_trunk/openstamanager/modules/anagrafiche/init.php new_trunk/openstamanager/modules/anagrafiche/template.html new_trunk/openstamanager/share/themes/default/img/bodybg.pngModified: new_trunk/openstamanager/ajax_autocomplete.php===================================================================--- new_trunk/openstamanager/ajax_autocomplete.php2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/ajax_autocomplete.php2014-07-05 13:03:23 UTC (rev 927)@@ -493,6 +493,9 @@ if( get_permessi('Anagrafiche') != '-' ){ $campi= array( 'codice', 'ragione_sociale', 'piva', 'codice_fiscale', 'indirizzo', 'indirizzo2', 'citta', 'cap', 'provincia', 'nazione', 'telefono', 'fax', 'cellulare', 'email', 'sitoweb', 'note', 'codicerea', 'settore', 'marche', 'cciaa', 'n_alboartigiani' ); $campi_text= array( 'Codice', 'Ragione sociale', 'Partita iva', 'Codice fiscale', 'Indirizzo', 'Indirizzo2', 'Città', 'C.A.P.', 'Provincia', 'Nazione', 'Telefono', 'Fax', 'Cellulare', 'Email', 'Sito web', 'Note', 'Codice REA', 'Settore', 'Marche', 'CCIAA', 'Numero di iscrizione albo artigiani' );++$rs = $dbo->fetchArray("SELECT id FROM zz_modules WHERE name='Anagrafiche'");+$id_module = $rs[0]['id']; $build_query = ''; @@ -505,7 +508,7 @@ if( sizeof($rs) > 0 ){ //Loop record corrispondenti alla ricerca for( $r=0; $r<sizeof($rs); $r++ ){-$result[$r+$i]['link']= $rootdir."/modules/anagrafiche/anagrafiche.php?idanagrafica=".$rs[$r]['idanagrafica'];+$result[$r+$i]['link']= $rootdir."/editor.php?id_module=".$id_module."&id_record=".$rs[$r]['idanagrafica']; $result[$r+$i]['title']= $rs[$r]['ragione_sociale']; $result[$r+$i]['category']= "Anagrafiche"; $result[$r+$i]['labels']= array();@@ -563,7 +566,7 @@ if( sizeof($rs) > 0 ){ //Loop record corrispondenti alla ricerca for( $r=0; $r<sizeof($rs); $r++ ){-$result[$r+$i]['link']= $rootdir."/modules/anagrafiche/anagrafiche.php?idanagrafica=".$rs[$r]['idanagrafica']."#tabs-2";+$result[$r+$i]['link']= $rootdir."/editor.php?id_module=".$id_module."&id_record=".$rs[$r]['idanagrafica']."#tabs-2"; $result[$r+$i]['title']= $rs[$r]['nome']; $result[$r+$i]['category']= "Referenti"; $result[$r+$i]['labels']= array();@@ -603,6 +606,9 @@ if( get_permessi('Interventi') != '-' ){ $campi= array( 'idintervento', 'data', 'data_richiesta', 'info_sede', 'richiesta', 'descrizione', 'informazioniaggiuntive' ); $campi_text= array( 'Codice intervento', 'Data intervento', 'Data richiesta intervento', 'Sede intervento', 'Richiesta', 'Descrizione', 'Informazioni aggiuntive' );++$rs = $dbo->fetchArray("SELECT id FROM zz_modules WHERE name='Interventi'");+$id_module = $rs[0]['id']; $build_query = ''; @@ -615,6 +621,7 @@ if( sizeof($rs) > 0 ){ //Loop record corrispondenti alla ricerca for( $r=0; $r<sizeof($rs); $r++ ){+$result[$r+$i]['link']= $rootdir."/editor.php?id_module=".$id_module."&id_record=".$rs[$r]['idintervento']; $result[$r+$i]['link']= $rootdir."/modules/interventi/interventi.php?idintervento=".$rs[$r]['idintervento']; $result[$r+$i]['title']= "Intervento ".$rs[$r]['idintervento']." del ".date("d/m/Y", strtotime($rs[$r]['data']) ); $result[$r+$i]['category']= "Interventi";@@ -654,6 +661,9 @@ if( get_permessi('Contabilita') != '-' ){ $campi= array( 'numero', 'nome', 'descrizione' ); $campi_text= array( 'Codice preventivo', 'Nome', 'Descrizione' );++$rs = $dbo->fetchArray("SELECT id FROM zz_modules WHERE name='Preventivi'");+$id_module = $rs[0]['id']; $build_query = ''; @@ -666,7 +676,7 @@ if( sizeof($rs) > 0 ){ //Loop record corrispondenti alla ricerca for( $r=0; $r<sizeof($rs); $r++ ){-$result[$r+$i]['link']= $rootdir."/modules/contabilita/preventivi/preventivi.php?idpreventivo=".$rs[$r]['id'];+$result[$r+$i]['link']= $rootdir."/editor.php?id_module=".$id_module."&id_record=".$rs[$r]['idpreventivo']; $result[$r+$i]['title']= "Preventivo ".$rs[$r]['numero']." del ".date("d/m/Y", strtotime($rs[$r]['data_accettazione']) ); $result[$r+$i]['category']= "Preventivi"; $result[$r+$i]['labels']= array();@@ -705,6 +715,7 @@ if( get_permessi('Contabilita') != '-' ){ $campi= array( 'numero', 'numero_esterno', 'data', 'note', 'note_aggiuntive', 'buono_ordine' ); $campi_text= array( 'Numero', 'Numero secondario', 'Data', 'Note', 'Note aggiuntive', 'Buono d\'ordine' );+ $build_query = ''; @@ -822,6 +833,9 @@ if( get_permessi('Articoli') != '-' ){ $campi= array( 'codice', 'descrizione', 'categoria', 'subcategoria', 'note' ); $campi_text= array( 'Codice', 'Descrizione', 'Categoria', 'Subcategoria', 'Note' );++$rs = $dbo->fetchArray("SELECT id FROM zz_modules WHERE name='Articoli'");+$id_module = $rs[0]['id']; $build_query = ''; @@ -834,7 +848,7 @@ if( sizeof($rs) > 0 ){ //Loop record corrispondenti alla ricerca for( $r=0; $r<sizeof($rs); $r++ ){-$result[$r+$i]['link']= $rootdir."/modules/magazzino/articoli/articoli.php?idarticolo=".$rs[$r]['id'];+$result[$r+$i]['link']= $rootdir."/editor.php?id_module=".$id_module."&id_record=".$rs[$r]['id']; $result[$r+$i]['title']= $rs[$r]['codice']." - ".$rs[$r]['descrizione']; $result[$r+$i]['category']= "Articoli"; $result[$r+$i]['labels']= array();@@ -868,6 +882,9 @@ if( get_permessi('Automezzi') != '-' ){ $campi= array( 'nome', 'descrizione', 'targa' ); $campi_text= array( 'Nome', 'Descrizione', 'Targa' );++$rs = $dbo->fetchArray("SELECT id FROM zz_modules WHERE name='Automezzi'");+$id_module = $rs[0]['id']; $build_query = ''; @@ -880,7 +897,7 @@ if( sizeof($rs) > 0 ){ //Loop record corrispondenti alla ricerca for( $r=0; $r<sizeof($rs); $r++ ){-$result[$r+$i]['link']= $rootdir."/modules/magazzino/automezzi/automezzi.php?idautomezzo=".$rs[$r]['id'];+$result[$r+$i]['link']= $rootdir."/editor.php?id_module=".$id_module."&id_record=".$rs[$r]['id']; $result[$r+$i]['title']= $rs[$r]['nome']; $result[$r+$i]['category']= "Automezzi"; $result[$r+$i]['labels']= array();@@ -1030,6 +1047,9 @@ if( get_permessi('MyImpianti') != '-' ){ $campi= array( 'matricola', 'nome', 'descrizione', 'ubicazione', 'occupante', 'proprietario' ); $campi_text= array( 'Matricola', 'Nome', 'Descrizione', 'Ubicazione', 'Occupante', 'Proprietario' );++$rs = $dbo->fetchArray("SELECT id FROM zz_modules WHERE name='MyImpianti'");+$id_module = $rs[0]['id']; $build_query = ''; @@ -1042,7 +1062,7 @@ if( sizeof($rs) > 0 ){ //Loop record corrispondenti alla ricerca for( $r=0; $r<sizeof($rs); $r++ ){-$result[$r+$i]['link']= $rootdir."/modules/my_impianti/my_impianti.php?matricola=".$rs[$r]['matricola'];+$result[$r+$i]['link']= $rootdir."/editor.php?id_module=".$id_module."&id_record=".$rs[$r]['matricola']; $result[$r+$i]['title']= $rs[$r]['matricola']." - ".$rs[$r]['nome']; $result[$r+$i]['category']= "MyImpianti"; $result[$r+$i]['labels']= array();Modified: new_trunk/openstamanager/controller.php===================================================================--- new_trunk/openstamanager/controller.php2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/controller.php2014-07-05 13:03:23 UTC (rev 927)@@ -33,16 +33,36 @@ echo "<tr>\n"; for( $c=0; $c<sizeof($fields); $c++ ){+$attr_td = '';+ //Check per tipologie di campi particolari if( preg_match( "/^color_/", trim($fields[$c]) ) ){+$attr_td .= " width='30'"; $label = str_replace( "color_", "", $fields[$c] ); } +//Data (larghezza fissa)+else if( preg_match( "/^Data/", trim($fields[$c]) ) ){+$attr_td .= " width='100'";+}++//Icona di stampa+else if( trim($fields[$c]) == '_print_' ){+$attr_td .= " width='30'";+$label = str_replace( "_print_", "", $fields[$c] );+}++//Icona+else if( preg_match( "/^icon_/", trim($fields[$c]) ) ){+$attr_td .= " width='30'";+$label = str_replace( "icon_", "", $fields[$c] );+}+ else{ $label = $fields[$c]; } -echo "<th>".$label."</th>\n";+echo "<th".$attr_td.">".$label."</th>\n"; } echo "</tr>\n";@@ -52,19 +72,45 @@ //Loop record echo "<tbody>"; for( $r=0; $r<sizeof($rs); $r++ ){-echo "<tr>";+$attr_tr = '';+$attr_td = ''; +if( $rs[$r]['_bg_'] != '' ){+$attr_td .= ' style="background:'.$rs[$r]['_bg_'].';"';+}+++echo "<tr class=\"clickable\" onclick=\"location.href='editor.php?id_module=".$id_module."&id_record=".$rs[$r]['id']."';\" ".$attr_tr.">";+ for( $c=0; $c<sizeof($fields); $c++ ){ //Check per tipologie di campi particolari-if( preg_match( "/^color_/", trim($fields[$c]) ) ){-$value = "<div class='img-circle square' style='background:".$rs[$r][ trim($fields[$c]) ].";'>&nbsp;</div>";+if( preg_match( "/^color_(.+?)$/", trim($fields[$c]), $m ) ){+$value = "<div class='img-circle square' style='background:".$rs[$r][ trim($fields[$c]) ].";' data-toggle=\"tooltip\" title=\"".htmlentities($rs[$r][ "color_title_".$m[1] ])."\">&nbsp;</div>"; } +//Icona di stampa+else if( trim($fields[$c]) == '_print_' ){+$print_url = $rs[$r]['_print_'];+$print_url = preg_replace( '/\$(.+?)\$/', $rs[$r][${1}], $print_url );++$value = "<a href='".$rootdir."/templates/".$print_url."' target='_blank'><i class='fa fa-2x fa-print'></i></a>";+}++//Data+else if( preg_match( "/^Data/", trim($fields[$c]) ) ){+$value = "<div class='text-center'>".$rs[$r][ trim($fields[$c]) ]."</div>";+}++//Icona+else if( preg_match( "/^icon_(.+?)$/", trim($fields[$c]), $m ) ){+$value = "<div class='text-center'><i class='".$rs[$r][ trim($fields[$c]) ]."' data-toggle=\"tooltip\" title=\"".htmlentities($rs[$r][ "icon_title_".$m[1] ])."\"></i></div>";+}+ else{ $value = $rs[$r][ trim($fields[$c]) ]; } -echo "<td>".$value."</td>\n";+echo "<td".$attr_td.">".$value."</td>\n"; } echo "</tr>\n";Modified: new_trunk/openstamanager/core.php===================================================================--- new_trunk/openstamanager/core.php2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/core.php2014-07-05 13:03:23 UTC (rev 927)@@ -70,6 +70,9 @@ array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/dataTables.bootstrap.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/chosen.jquery.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.date.extensions.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.extensions.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/app.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/functionsjs.php"); Modified: new_trunk/openstamanager/include/top.php===================================================================--- new_trunk/openstamanager/include/top.php2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/include/top.php2014-07-05 13:03:23 UTC (rev 927)@@ -4,12 +4,7 @@ //PARAMETRI PER PAGINAZIONE $is_db_installed = $dbo->fetchNum( "DESCRIBE an_anagrafiche", 1 ); if( $is_db_installed ){-$rs = $dbo->fetchArray( "SELECT * FROM zz_impostazioni WHERE nome='Righe per pagina'" );-$rows_per_page = $rs[0]['valore'];-$page = $_GET['page'];-( isset( $_GET['page'] ) && is_numeric( $_GET['page'] ) && $_GET['page']>0 ) ? $start=$_GET['page']*$rows_per_page : $start=0;--+ //Ordinamento moduli di primo livello if( $_GET['op']=="sortmodules" ){ $ids = explode(",", $_GET['ids'] );@@ -21,7 +16,7 @@ } $id_module = $html->form('id_module');-$module = get_module_name( $id_module );+$id_record = $html->form('id_record'); } ?><!DOCTYPE html>@@ -103,6 +98,8 @@ //Se l'utente è is_admin mostro tutti i moduli, altrimenti solo quelli con accesso in r o rw $q = "SELECT *, ( SELECT GROUP_CONCAT(name) FROM zz_modules GROUP BY parent HAVING parent=m1.id ) AS submodules FROM zz_modules m1 WHERE level='0' AND enabled='1' AND `type`='menu' ORDER BY `order` ASC"; $rs = $dbo->fetchArray($q);++$modules = array(); if( sizeof($rs) > 0 ){ for( $i=0; $i<sizeof($rs); $i++){@@ -145,11 +142,14 @@ $submodules = explode( ',', $rs[$i]['submodules'] ); ( $module == $rs[$i]['name'] || (in_array($nome_modulo, $submodules) && $rs[$i]['submodules']!='') ) ? $class="active" : $class=""; -( $rs[$i]['link']!="#" ) ? $link=$rootdir."/controller.php?id_module=".$rs[$i]['id'] : $link="#";+( $rs[$i]['options']!="" ) ? $link=$rootdir."/controller.php?id_module=".$rs[$i]['id'] : $link="javascript:;"; echo "<li class='treeview ".$class."'>\n"; echo "<a href=\"".$link."\">\n"; echo "<i class=\"".$rs[$i]['icon']."\"></i> <span>".$rs[$i]['name']."</span>\n";++$modules[ $rs[$i]['id'] ]['name'] = $rs[$i]['name'];+$modules[ $rs[$i]['id'] ]['icon'] = $rs[$i]['icon']; } @@ -175,6 +175,9 @@ ( $rs2[$j]['module_dir']!='' ) ? $subdir=$rs2[$j]['module_dir']."/" : $subdir=''; ( $module == $rs2[$j]['name'] ) ? $attr='class="active"' : $attr=''; echo "<li $attr><a href='".$rootdir."/controller.php?id_module=".$rs2[$j]['id']."'>".$rs2[$j]['name']."</a></li>\n";++$modules[ $rs2[$i]['id'] ]['name'] = $rs2[$i]['name'];+$modules[ $rs2[$i]['id'] ]['icon'] = $rs2[$i]['icon']; } echo "</ul>\n";Modified: new_trunk/openstamanager/lib/htmlbuilder.php===================================================================--- new_trunk/openstamanager/lib/htmlbuilder.php2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/lib/htmlbuilder.php2014-07-05 13:03:23 UTC (rev 927)@@ -6,244 +6,117 @@ /**- * Crea l'elemento <select> a partire da una query e alcuni valori- * $querystringQuery da cui generare la scelta- * $idnamestringid da assegnare al <select>- * $default_valuestringValore di default in base a cui impostare una <option> come selezionata, Se non- c'è, non la mostra come <option>- * $unselected_labelstringStringa da visualizzare nella prima <option> quando non è selezionata- * $condition_rwbooleanCondizione da indicare per rendere il campo un <select>. Se false, rende il campo- un semplice campo di testo (ad esempio se i permessi sono sola lettura). Si deve- avere anche il permesso rw del modulo- * $otherstringAltri attributi da aggiungere al <select> (tipo eventi onchange, ecc)+ * Genera una porzione di codice html a partire da una stringa nei seguenti formati:+ * campo <input> generico:+ * {"type": "text", "required": 1, "class": "", "value": "$idintervento$", "extra": ""}+ *+ * campo di testo normale e non modificabile+ * {"type": "span", "value": "$testo$"}+ *+ * <select>+ * {"type": "select", "required": 1, "class": "", "values": "[query='SELECT id, descrizione FROM co_contratti WHERE idanagrafica=$idanagrafica$"]', "default_value": "$idcontratto$", "extra": ""}+ *+ * Il parametro $records contiene il risultato della query di selezione record per fare i vari replace delle variabili racchiuse tra $$ nel template */-function html_select( $query, $idname, $default_value, $unselected_label, $other='', $condition_rw=true ){-global $dbo;-global $permessi;-global $nome_modulo;+function build_html_element( $str, $records ){+global $dbo;+global $id_module;+global $id_record;++$str = mb_convert_encoding( $str, "utf-8", "iso-8859-1" );+$json = json_decode( $str, true ); --$rs = $dbo->fetchArray($query);--//Verifico a cascata i permessi per scegliere se visualizzare il <select> o lo <span>-$can_edit = false;--if( $permessi[$nome_modulo]=='rw' ){-if( $condition_rw )-$can_edit = true;-else-$can_edit = false;-}-else{-$can_edit = false;-}----if( $can_edit ){-echo "<select name=\"".$idname."\" id=\"".$idname."\" $other >\n";-if( $unselected_label!='' )-echo "<option value=\"0\">".$unselected_label."</option>\n";-for( $i=0; $i<sizeof($rs); $i++ ){-( $rs[$i]['id'] == $default_value ) ? $attr='selected="true"' : $attr='';-echo "<option value=\"".$rs[$i]['id']."\" $attr>".$rs[$i]['descrizione']."</option>\n";+//Attributi particolari+( $json['required'] == 1 ) ? $attr='required="true"' : $attr='';+( $json['maxlength'] != '' ) ? $attr.=' maxlength="'.$json['maxlength'].'"' : $attr.='';+++//Lettura valore di default+if( $json['value'] != '' ){+if( preg_match('/^\$(.+?)\$$/', $json['value']) ){+$db_field_name = str_replace( "$", "", $json['value'] );+$value = $records[0][ $db_field_name ];+}++else{+$value = $json['value'];+} }-echo "</select>\n";-}--//Se non ci sono i permessi in scrittura mostro uno span-else{-//Se non c'è un valore predefinito non mostro niente...-if( $default_value == '0' ){-//echo "<span>".$rs[0]['descrizione']."</span>\n";-//echo "<input type='hidden' name=\"".$idname."\" value=\"".$rs[0]['id']."\" />\n";-echo "<input type='hidden' name=\"".$idname."\" value=\"\" />\n";-}--//...altrimenti mostro come testo il valore selezionato+ else{-$descrizione = '';-for( $i=0; $i<sizeof($rs); $i++ )-if( $rs[$i]['id'] == $default_value )-$descrizione = $rs[$i]['descrizione'];--echo "<span>".$descrizione."</span>\n";-echo "<input type='hidden' name=\"".$idname."\" value=\"".$default_value."\" />\n";+$value = ""; }-}-}-----/**- * Funzione per generare i campi <input> di tipo testo. I nomi dei campi devono avere lo stesso nome dei campi- di database per far funzionare correttamente l'UPDATE- *- *$namestringNome del campo- * $valuestringValore del campo- * $default_valuestringValore di default- * $condition_rwbooleanCondizione da indicare per rendere il campo un <input>. Se false, rende il campo- un semplice campo di testo (ad esempio se i permessi sono sola lettura). Si deve- avere anche il permesso rw del modulo- * $otherstringAltri attributi da aggiungere all'<input> (tipo eventi onchange, ecc)- *-*/-function html_inputtext( $name, $title='', $value='', $default_value='', $condition_rw=true, $other='' ){-global $dbo;-global $permessi;-global $nome_modulo;---//Verifico a cascata i permessi per scegliere se visualizzare il <select> o lo <span>-$can_edit = false;--if( $permessi[$nome_modulo]=='rw' ){-if( $condition_rw )-$can_edit = true;-else-$can_edit = false;-}-else{-$can_edit = false;-}-++ --if( $can_edit ){-if( $default_value!='' && $default_value==$value )-$attr = 'class="default_value" start_value="'.$default_value.'"';-else-$attr = '';-echo "<input type='text' name=\"".$name."\" id=\"".$name."\" title=\"".htmlentities($title)."\" value=\"".$value."\" $attr $other />\n";-}--//Se non ci sono i permessi in scrittura mostro uno span-else{-echo "<span>".$value."</span>\n";-echo "<input type='hidden' name=\"".$name."\" id=\"".$name."\" value=\"".$value."\" />\n";-}-}-----/**- * Visualizza una tabella con $n_cols colonne in base alla tabella di database, mostrando solo i campi con un Comment- * Se viene specificata anche la $query, ripete il form in base al numero di risultati della query e la popola con i record- */-function html_table4input( $table, $n_cols, $query='', $other='', $col1_width='100', $col2_width='200' ){-global $dbo;-global $permessi;-global $nome_modulo;--$q = "SHOW FULL COLUMNS FROM $table";-$rs = $dbo->fetchArray($q);---//Popolamento campi-if( $query!='' ){-$rs2 = $dbo->fetchArray($query); -for( $j=0; $j<sizeof($rs2); $j++ ){-echo "<table $other>\n";--$c = 0;-for( $i=0; $i<sizeof($rs); $i++ ){-if( $rs[$i]['Comment']!='' ){-if( ($c%$n_cols) == 0 )-echo "<tr>";+$html = "<div class='form-group'>\n";+$html .= "<label for='".$json['name']."'>".mb_convert_encoding( $json['label'], "iso-8859-1", "utf-8" )."</label>\n";++if( $json['icon-before'] != '' || $json['icon-after'] != '' ){+$html .= "<div class='input-group'>\n";+}++if( $json['icon-before'] != '' ){+$html .= "<span class='input-group-addon'>".$json['icon-before']."</span>\n";+}+++switch( $json['type'] ){+case 'text':+case 'date':+if( $json['type'] == 'date' ){+$attr .= " data-inputmask=\"'alias': 'dd/mm/yyyy'\""; -//Se nel commento c'è una query di selezione, la tolgo dall'etichetta e mostro il <select> popolandolo con-//i risultati della query (es. Comment = "Zona (query=SELECT....)"-if( preg_match( "/(.+?) \{(.+?)\}/", $rs[$i]['Comment'], $m ) ){-$label = $m[1];-$query = str_replace( "query=", "", $m[2] );-}+$value = date( "d/m/Y", strtotime($value) ); -else{-$label = $rs[$i]['Comment'];-$query = "";+if( $value == "01/01/1970" ){+$value = ""; }--echo "<td width='".$col2_width."'>\n";-if( $query=="" ){-html_inputtext( $rs[$i]['Field'], $rs[$i]['Comment'], $rs2[$j][ $rs[$i]['Field'] ] );-}--//Campo query, quindi mostro un select-else{-$rs3 = $dbo->fetchArray($query);--echo "<select name='".$rs[$i]['Field']."' class='inputtext'>\n";-echo "<option value=''>- Seleziona un valore -</option>\n";-for( $x=0; $x<sizeof($rs3); $x++ ){-echo "<option value='".$rs3[$x]['id']."'>".$rs3[$x]['descrizione']."</option>\n";-}-echo "</select>\n";-}-echo "</td>\n";--if( (($c-1)%$n_cols) == 0 )-echo "</tr>";-$c++; }-}-echo "</table>\n";-}-}--//Una tabella vuota-else{-echo "<table $other>\n";--$c = 0;-for( $i=0; $i<sizeof($rs); $i++ ){-if( $rs[$i]['Comment']!='' ){-if( ($c%$n_cols) == 0 )-echo "<tr>";+$html .= "<input class='form-control ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$attr." value=\"".$value."\">";+break;++++case 'select':+//Generazione <select> da query+if( preg_match_all( "/^query=(.+?)$/", $json['values'], $m) ){+eval( "\$query = \"".$m[1][0]."\";" );+$rs = $dbo->fetchArray( $query ); -//Se nel commento c'è una query di selezione, la tolgo dall'etichetta e mostro il <select> popolandolo con-//i risultati della query (es. Comment = "Zona (query=SELECT....)"-if( preg_match( "/(.+?) \{(.+?)\}/", $rs[$i]['Comment'], $m ) ){-$label = $m[1];-$query = str_replace( "query=", "", $m[2] );-}+$html .= "<select class='form-control ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$attr.">\n";+$html .= "<option value=''>- Seleziona un valore -</option>\n"; -else{-$label = $rs[$i]['Comment'];-$query = "";+for( $i=0; $i<sizeof($rs); $i++ ){+( $rs[$i]['id'] == $value ) ? $this_attr=' selected="true"' : $this_attr='';+( $rs[$i]['_bgcolor_'] != '' ) ? $this_attr.=' style="background:'.$rs[$i]['_bgcolor_'].';"' : $this_attr.='';++$html .= "<option value=\"".$rs[$i]['id']."\"".$this_attr.">".$rs[$i]['descrizione']."</option>\n"; }--echo "<td align='right' width='".$col1_width."'>\n";-echo "<b>".$label.":</b>\n";-echo "</td>\n";--echo "<td width='".$col2_width."'>\n";-if( $query=="" ){-html_inputtext( $rs[$i]['Field'], $rs[$i]['Comment'], $rs2[$j][ $rs[$i]['Field'] ] );-} -//Campo query, quindi mostro un select-else{-$rs3 = $dbo->fetchArray($query);--echo "<select name='".$rs[$i]['Field']."' class='inputtext'>\n";-echo "<option value=''>- Seleziona un valore -</option>\n";-for( $x=0; $x<sizeof($rs3); $x++ ){-echo "<option value='".$rs3[$x]['id']."'>".$rs3[$x]['descrizione']."</option>\n";-}-echo "</select>\n";-}-echo "</td>\n";--if( (($c-1)%$n_cols) == 0 )-echo "</tr>";-$c++;+$html .= "</select>\n"; }-}-echo "</table>\n";+break;+++case 'textarea':+$html .= "<textarea class='form-control ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$attr.">".$value."</textarea>";+break;+}++if( $json['icon-after'] != '' ){+$html .= "<span class='input-group-addon'>".$json['icon-after']."</span>\n";+}+++if( $json['icon-before'] != '' || $json['icon-after'] != '' ){+$html .= "</div>\n";+}++$html .= "</div>\n";++return $html; }-} ?>Modified: new_trunk/openstamanager/lib/jscripts/functionsjs.php===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-05 13:03:23 UTC (rev 927)@@ -8,8 +8,15 @@ $('#main-alerts').html( $('#alerts').html() ); $('#alerts').html(''); +$('.date-picker').datepicker(); +//Input mask+$(".date-mask").inputmask( "dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"} );+ $("[data-mask]").inputmask();+++ // Setup - add a text input to each footer cell var table = $('.datatables').dataTable({ "oLanguage": { "sUrl": "<?php echo $rootdir ?>/lib/jscripts/jquery/plugins/datatables/jquery.datatables.lang-<?php echo $lang ?>.js" },Modified: new_trunk/openstamanager/modules/anagrafiche/actions.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/actions.php2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/modules/anagrafiche/actions.php2014-07-05 13:03:23 UTC (rev 927)@@ -0,0 +1,7 @@+<?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}+++?>Added: new_trunk/openstamanager/modules/anagrafiche/init.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/init.php (rev 0)+++ new_trunk/openstamanager/modules/anagrafiche/init.php2014-07-05 13:03:23 UTC (rev 927)@@ -0,0 +1,7 @@+<?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}++$records = $dbo->fetchArray("SELECT *, (SELECT GROUP_CONCAT(descrizione) FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica=an_anagrafiche.idanagrafica) AS tipianagrafica FROM an_anagrafiche GROUP BY idanagrafica HAVING idanagrafica=\"".$id_record."\"");+?>Modified: new_trunk/openstamanager/modules/anagrafiche/modutil.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/modutil.php2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/modules/anagrafiche/modutil.php2014-07-05 13:03:23 UTC (rev 927)@@ -0,0 +1,7 @@+<?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}+++?>Added: new_trunk/openstamanager/modules/anagrafiche/template.html===================================================================--- new_trunk/openstamanager/modules/anagrafiche/template.html (rev 0)+++ new_trunk/openstamanager/modules/anagrafiche/template.html2014-07-05 13:03:23 UTC (rev 927)@@ -0,0 +1,221 @@+<div class="panel panel-primary">+<div class="panel-heading">+<h3 class="panel-title">Dati anagrafici</h3>+</div>++<div class="panel-body">+<div class="row">+<div class="col-md-12">+{ "type": "text", "label": "Ragione sociale", "name": "ragione_sociale", "required": 1, "class": "", "value": "$ragione_sociale$", "extra": "" }+</div>+</div>++<div class="row">+<div class="col-md-4">+{ "type": "text", "label": "Partita iva", "maxlength": 13, "name": "piva", "required": 1, "class": "text-center", "value": "$piva$", "extra": "" }+</div>++<div class="col-md-4">+{ "type": "text", "label": "Codice fiscale", "maxlength": 16, "name": "codice_fiscale", "required": 0, "class": "text-center", "value": "$codice_fiscale$", "extra": "" }+</div>++<div class="col-md-4">+{ "type": "text", "label": "Codice anagrafica", "name": "codice", "required": 1, "class": "text-center", "value": "$codice$", "extra": "" }+</div>+</div>++<div class="row">+<div class="col-md-6">+{ "type": "text", "label": "Luogo di nascita", "name": "luogo_nascita", "required": 0, "class": "", "value": "$luogo_nascita$", "extra": "" }+</div>++<div class="col-md-6">+{ "type": "date", "label": "Data di nascita", "maxlength": 10, "name": "data_nascita", "required": 0, "class": "text-center date-mask", "value": "$data_nascita$", "extra": "" }+</div>+</div>++<div class="row">+<div class="col-md-6">+{ "type": "text", "label": "Indirizzo", "name": "indirizzo", "required": 0, "class": "", "value": "$indirizzo$", "extra": "" }+</div>++<div class="col-md-6">+{ "type": "text", "label": "Indirizzo2", "name": "indirizzo2", "required": 0, "class": "", "value": "$indirizzo2$", "extra": "" }+</div>+</div>++<div class="row">+<div class="col-md-4">+{ "type": "select", "label": "Nazione", "name": "nazione", "required": 0, "class": "", "values": "query=SELECT nome AS id, nome AS descrizione FROM an_nazioni ORDER BY nome ASC", "value": "$nazione$", "extra": "" }+</div>++<div class="col-md-2">+{ "type": "text", "label": "C.A.P.", "name": "cap", "maxlength": 5, "required": 0, "class": "text-center", "value": "$cap$", "extra": "" }+</div>++<div class="col-md-4">+{ "type": "text", "label": "Città", "name": "citta", "required": 0, "class": "text-center", "value": "$citta$", "extra": "" }+</div>++<div class="col-md-2">+{ "type": "text", "label": "Provincia", "name": "provincia", "maxlength": 2, "required": 0, "class": "text-center", "value": "$provincia$", "extra": "" }+</div>+</div>+</div>+</div>+++<div class="panel panel-primary">+<div class="panel-heading">+<h3 class="panel-title">Contatti</h3>+</div>++<div class="panel-body">+<div class="row">+<div class="col-md-4">+{ "type": "text", "label": "Telefono", "name": "telefono", "required": 0, "class": "text-center", "value": "$telefono$", "extra": "", "icon-before": "<i class='fa fa-phone'></i>" }+</div>++<div class="col-md-4">+{ "type": "text", "label": "Fax", "name": "fax", "required": 0, "class": "text-center", "value": "$fax$", "extra": "", "icon-before": "<i class='fa fa-fax'></i>" }+</div>++<div class="col-md-4">+{ "type": "text", "label": "Cellulare", "name": "cellulare", "required": 0, "class": "text-center", "value": "$cellulare$", "extra": "", "icon-before": "<i class='fa fa-mobile'></i>" }+</div>+</div>++<div class="row">+<div class="col-md-4">+{ "type": "text", "label": "Email", "name": "email", "required": 0, "class": "", "value": "$email$", "extra": "", "icon-before": "<i class='fa fa-envelope'></i>" }+</div>++<div class="col-md-4">+{ "type": "text", "label": "Sito web", "name": "sitoweb", "required": 0, "class": "", "value": "$sitoweb$", "extra": "", "icon-before": "<i class='fa fa-globe'></i>" }+</div>++<div class="col-md-4">+{ "type": "select", "label": "Zona", "name": "idzona", "required": 0, "class": "", "values": "query=SELECT id, CONCAT_WS( ' - ', nome, descrizione) AS descrizione FROM an_zone ORDER BY descrizione ASC", "value": "$idzona$", "extra": "" }+</div>+</div>+</div>+</div>++++<div class="panel panel-primary">+<div class="panel-heading">+<h3 class="panel-title">Informazioni aggiuntive</h3>+</div>++<div class="panel-body">+<div class="row">+<div class="col-md-3">+{ "type": "select", "label": "Pagamento preferito", "name": "idpagamento", "required": 0, "class": "", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "select", "label": "Iva predefinita", "name": "idiva", "required": 0, "class": "", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "select", "label": "Listino articoli", "name": "idlistino", "required": 0, "class": "", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "select", "label": "Indirizzo di fatturazione", "name": "idsede_fatturazione", "required": 0, "class": "", "values": "query=SELECT id, CONCAT_WS(', ', nomesede, citta) AS descrizione FROM an_sedi WHERE idanagrafica='$id_record' UNION SELECT '0' AS id, 'Sede legale' AS descrizione ORDER BY descrizione", "value": "$idsede_fatturazione$", "extra": "" }+</div>+</div>+++<div class="row">+<div class="col-md-3">+{ "type": "text", "label": "Codice registro imprese", "name": "codiceri", "required": 0, "class": "", "value": "$codiceri$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "text", "label": "Codice R.E.A. <small>(provincia/C.C.I.A.A.)</small>", "name": "codicerea", "required": 0, "class": "", "value": "$codicerea$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "text", "label": "N<sup>o</sup> iscr. C.C.I.A.A.", "name": "cciaa", "required": 0, "class": "", "value": "$cciaa$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "text", "label": "Città iscr. C.C.I.A.A.", "name": "cciaa_citta", "required": 0, "class": "", "value": "$cciaa_citta$", "extra": "" }+</div>+</div>++<div class="row">+<div class="col-md-3">+{ "type": "text", "label": "Appoggio bancario", "name": "appoggiobancario", "required": 0, "class": "", "value": "$appoggiobancario$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "text", "label": "Filiale banca", "name": "filiale", "required": 0, "class": "", "value": "$filiale$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "text", "label": "Codice IBAN", "name": "codiceiban", "required": 0, "class": "", "value": "$codiceiban$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "text", "label": "Dicitura fissa fattura", "name": "diciturafissafattura", "required": 0, "class": "", "value": "$diciturafissafattura$", "extra": "" }+</div>+</div>++<div class="row">+<div class="col-md-3">+{ "type": "text", "label": "Foro di competenza", "name": "foro_competenza", "required": 0, "class": "", "value": "$foro_competenza$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "text", "label": "Settore merceologico", "name": "settore", "required": 0, "class": "", "value": "$settore$", "extra": "" }+</div>++<div class="col-md-6">+{ "type": "text", "label": "Marche trattate", "name": "marche", "required": 0, "class": "", "value": "$marche$", "extra": "" }+</div>+</div>++<div class="row">+<div class="col-md-3">+{ "type": "text", "label": "N<sup>o</sup> dipendenti", "name": "dipendenti", "required": 0, "class": "", "value": "$dipendenti$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "text", "label": "N<sup>o</sup> macchine", "name": "macchine", "required": 0, "class": "", "value": "$macchine$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "text", "label": "N<sup>o</sup> iscr. tribunale", "name": "iscrizione_tribunale", "required": 0, "class": "", "value": "$iscrizione_tribunale$", "extra": "" }+</div>++<div class="col-md-3">+{ "type": "text", "label": "N<sup>o</sup> iscr. albo artigiani", "name": "n_alboartigiani", "required": 0, "class": "", "value": "$n_alboartigiani$", "extra": "" }+</div>+</div>++<?php+if( in_array( 'Cliente', explode(',', $records[0]['tipianagrafica']) ) ){+?>+<div class="row">+<div class="col-md-4">+{ "type": "select", "label": "Agente di riferimento", "name": "idagente", "required": 0, "class": "", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, ragione_sociale AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE descrizione='Agente' ORDER BY ragione_sociale", "value": "$idagente$", "extra": "" }+</div>++<div class="col-md-4">+{ "type": "select", "label": "Relazione con il cliente", "name": "idrelazione", "required": 0, "class": "", "values": "query=SELECT id, descrizione, colore AS _bgcolor_ FROM an_relazioni ORDER BY descrizione", "value": "$idrelazione$", "extra": "" }+</div>+</div>+<?php } ?>+++<div class="row">+<div class="col-md-12">+{ "type": "textarea", "label": "Note", "name": "note", "required": 0, "class": "", "value": "$note$", "extra": "" }+</div>+</div>+</div>+</div>+Modified: new_trunk/openstamanager/share/themes/default/css/style.css===================================================================--- new_trunk/openstamanager/share/themes/default/css/style.css2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/share/themes/default/css/style.css2014-07-05 13:03:23 UTC (rev 927)@@ -56,4 +56,5 @@ #main_loading{ position:fixed; top:0; left:0; width:100%; height:100%; background:#fff; z-index:9999; text-align:center; } #main_loading > div{ position:relative; top:35%; color: #333; } #main_loading > div > i{ font-size:300px; color:#e24e1e; }+.form-control{ background:#fafafa; } Added: new_trunk/openstamanager/share/themes/default/img/bodybg.png===================================================================(Binary files differ)Index: new_trunk/openstamanager/share/themes/default/img/bodybg.png===================================================================--- new_trunk/openstamanager/share/themes/default/img/bodybg.png2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/share/themes/default/img/bodybg.png2014-07-05 13:03:23 UTC (rev 927)Property changes on: new_trunk/openstamanager/share/themes/default/img/bodybg.png___________________________________________________________________Added: svn:mime-type## -0,0 +1 ##+application/octet-stream\ No newline at end of propertyModified: new_trunk/openstamanager/update/update_2.0.sql===================================================================--- new_trunk/openstamanager/update/update_2.0.sql2014-06-26 14:28:54 UTC (rev 926)+++ new_trunk/openstamanager/update/update_2.0.sql2014-07-05 13:03:23 UTC (rev 927)@@ -11,35 +11,312 @@ UPDATE `zz_modules` SET `icon`='fa fa-truck' WHERE `name`='Magazzino'; UPDATE `zz_modules` SET `icon`='fa fa-puzzle-piece' WHERE `name`='MyImpianti'; +-- Elimino un campo non più utilizzato+ALTER TABLE `zz_modules` DROP `link`;+ -- Recupero il campo `description` mai usato per metterci delle opzioni ALTER TABLE `zz_modules` CHANGE `description` `options` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; -- Anagrafiche-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"fields\": \"Ragione sociale, Tipologia, Città, Telefono, color_Rel.\",\"query\": \"SELECT `idanagrafica` AS `id`, ragione_sociale AS `Ragione sociale`, (SELECT GROUP_CONCAT(descrizione SEPARATOR ', ') FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica GROUP BY idanagrafica HAVING idanagrafica=an_anagrafiche.idanagrafica ORDER BY descrizione) AS `Tipologia`, citta AS `Città`, telefono AS `Telefono`, an_relazioni.colore AS `color_Rel.` FROM an_anagrafiche LEFT OUTER JOIN an_relazioni ON an_anagrafiche.idrelazione=an_relazioni.id WHERE deleted=0 ORDER BY `ragione_sociale`\"}]}" WHERE name='Anagrafiche';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Ragione sociale, Tipologia, Città, Telefono, color_Rel.\",\"query\": \"SELECT `idanagrafica` AS `id`, ragione_sociale AS `Ragione sociale`, (SELECT GROUP_CONCAT(descrizione SEPARATOR ', ') FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica GROUP BY idanagrafica HAVING idanagrafica=an_anagrafiche.idanagrafica) AS `Tipologia`, citta AS `Città`, telefono AS `Telefono`, an_relazioni.colore AS `color_Rel.`, an_relazioni.descrizione AS `color_title_Rel.` FROM an_anagrafiche LEFT OUTER JOIN an_relazioni ON an_anagrafiche.idrelazione=an_relazioni.id WHERE deleted=0 ORDER BY `ragione_sociale`\"}]}" WHERE name='Anagrafiche'; -- Tipi di anagrafiche UPDATE `zz_modules` SET `enabled`=0 WHERE name='Tipi di anagrafiche'; -- Zone-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"fields\": \"Nome, Descrizione\",\"query\": \"SELECT `id`, `nome` AS `Nome`, `descrizione` AS `Descrizione` FROM `an_zone` ORDER BY `id`\"}]}" WHERE name='Zone';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Nome, Descrizione\",\"query\": \"SELECT `id`, `nome` AS `Nome`, `descrizione` AS `Descrizione` FROM `an_zone` ORDER BY `id`\"}]}" WHERE name='Zone'; -- Interventi-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"fields\": \"ID intervento, Ragione sociale, Data, _print_\",\"query\": \"SELECT `idintervento` AS `id`, `idintervento` AS `ID intervento`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`in_interventi`.`idanagrafica`) AS `Ragione sociale`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `colore` FROM `in_statiintervento` WHERE `idstatointervento`=`in_interventi`.`idstatointervento`) AS `_bg_`, 'pdfgen.php?idintervento=$id$&mode=single' AS `_print_` FROM `in_interventi` ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Interventi';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"ID intervento, Ragione sociale, Data, _print_\",\"query\": \"SELECT `idintervento` AS `id`, `idintervento` AS `ID intervento`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`in_interventi`.`idanagrafica`) AS `Ragione sociale`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `colore` FROM `in_statiintervento` WHERE `idstatointervento`=`in_interventi`.`idstatointervento`) AS `_bg_`, 'pdfgen.php?idintervento=$id$&mode=single' AS `_print_` FROM `in_interventi` ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Interventi'; -- Tipi di intervento-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"fields\": \"Codice, Descrizione, Costo orario, Costo al km, Diritto di chiamata, Costo orario tecnico, Costo al km tecnico, Diritto di chiamata tecnico\",\"query\": \"SELECT `idtipointervento` AS `id`, `idtipointervento` AS `Codice`, `descrizione` AS `Descrizione`, REPLACE( FORMAT(`costo_orario`,2), '.', ',' ) AS `Costo orario`, REPLACE( FORMAT(`costo_km`,2), '.', ',' ) AS `Costo al km`, REPLACE( FORMAT(`costo_diritto_chiamata`,2), '.', ',' ) AS `Diritto di chiamata`, REPLACE( FORMAT(`costo_orario_tecnico`,2), '.', ',' ) AS `Costo orario tecnico`, REPLACE( FORMAT(`costo_km_tecnico`,2), '.', ',' ) AS `Costo al km tecnico`, REPLACE( FORMAT(`costo_diritto_chiamata_tecnico`,2), '.', ',' ) AS `Diritto di chiamata tecnico` FROM `in_tipiintervento`\"}]}" WHERE name='Tipi di intervento';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Codice, Descrizione, Costo orario, Costo al km, Diritto di chiamata, Costo orario tecnico, Costo al km tecnico, Diritto di chiamata tecnico\",\"query\": \"SELECT `idtipointervento` AS `id`, `idtipointervento` AS `Codice`, `descrizione` AS `Descrizione`, REPLACE( FORMAT(`costo_orario`,2), '.', ',' ) AS `Costo orario`, REPLACE( FORMAT(`costo_km`,2), '.', ',' ) AS `Costo al km`, REPLACE( FORMAT(`costo_diritto_chiamata`,2), '.', ',' ) AS `Diritto di chiamata`, REPLACE( FORMAT(`costo_orario_tecnico`,2), '.', ',' ) AS `Costo orario tecnico`, REPLACE( FORMAT(`costo_km_tecnico`,2), '.', ',' ) AS `Costo al km tecnico`, REPLACE( FORMAT(`costo_diritto_chiamata_tecnico`,2), '.', ',' ) AS `Diritto di chiamata tecnico` FROM `in_tipiintervento`\"}]}" WHERE name='Tipi di intervento'; -- Stati intervento-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"fields\": \"Codice, Descrizione, color_Colore\",\"query\": \"SELECT `idstatointervento` AS `Codice`, `idstatointervento` AS `id`, `descrizione` AS `Descrizione`, `colore` AS `color_Colore` FROM `in_statiintervento`\"}]}" WHERE name='Stati di intervento';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Codice, Descrizione, color_Colore\",\"query\": \"SELECT `idstatointervento` AS `Codice`, `idstatointervento` AS `id`, `descrizione` AS `Descrizione`, `colore` AS `color_Colore` FROM `in_statiintervento`\"}]}" WHERE name='Stati di intervento'; -- Tecnici e tariffe-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"fields\": \"Ragione sociale, Costo orario, Costo al km, Diritto di chiamata, Costo orario tecnico, Costo al km tecnico, Diritto di chiamata tecnico\",\"query\": \"SELECT `id`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`idtecnico`) AS `Ragione sociale`, REPLACE( FORMAT(`costo_ore`,2), '.', ',' ) AS `Costo orario`, REPLACE( FORMAT(`costo_km`,2), '.', ',' ) AS `Costo al km`, REPLACE( FORMAT(`costo_dirittochiamata`,2), '.', ',' ) AS `Diritto di chiamata`, REPLACE( FORMAT(`costo_ore_tecnico`,2), '.', ',' ) AS `Costo orario tecnico`, REPLACE( FORMAT(`costo_km_tecnico`,2), '.', ',' ) AS `Costo al km tecnico`, REPLACE( FORMAT(`costo_dirittochiamata_tecnico`,2), '.', ',' ) AS `Diritto di chiamata tecnico` FROM `in_tariffe`\"}]}" WHERE name='Tecnici e tariffe';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Ragione sociale, Costo orario, Costo al km, Diritto di chiamata, Costo orario tecnico, Costo al km tecnico, Diritto di chiamata tecnico\",\"query\": \"SELECT `id`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`idtecnico`) AS `Ragione sociale`, REPLACE( FORMAT(`costo_ore`,2), '.', ',' ) AS `Costo orario`, REPLACE( FORMAT(`costo_km`,2), '.', ',' ) AS `Costo al km`, REPLACE( FORMAT(`costo_dirittochiamata`,2), '.', ',' ) AS `Diritto di chiamata`, REPLACE( FORMAT(`costo_ore_tecnico`,2), '.', ',' ) AS `Costo orario tecnico`, REPLACE( FORMAT(`costo_km_tecnico`,2), '.', ',' ) AS `Costo al km tecnico`, REPLACE( FORMAT(`costo_dirittochiamata_tecnico`,2), '.', ',' ) AS `Diritto di chiamata tecnico` FROM `in_tariffe`\"}]}" WHERE name='Tecnici e tariffe'; -- Voci di servizio-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"fields\": \"Descrizione, Categoria\",\"query\": \"SELECT `id`, `descrizione` AS `Descrizione`, `categoria` AS `Categoria` FROM `in_vociservizio` ORDER BY `id`\"}]}" WHERE name='Voci di servizio';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Descrizione, Categoria\",\"query\": \"SELECT `id`, `descrizione` AS `Descrizione`, `categoria` AS `Categoria` FROM `in_vociservizio` ORDER BY `id`\"}]}" WHERE name='Voci di servizio'; +-- Magazzino, articoli+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Codice, Descrizione, Categoria, Q.tà\",\"query\": \"SELECT `id`, `codice` AS `Codice`, `descrizione` AS `Descrizione`, CONCAT_WS( ' &raquo; ', `categoria`, `subcategoria` ) AS `Categoria`, CONCAT_WS( ' ', REPLACE( FORMAT( `qta`, 2 ), '.', ',' ), (SELECT `valore` FROM `mg_unitamisura` WHERE `id`=`idum`) ) AS `Q.tà` FROM `mg_articoli` ORDER BY `descrizione`\"}]}" WHERE name='Articoli'; +-- Voci non cliccabili+UPDATE `zz_modules` SET `options`="" WHERE name IN('Contabilit&agrave;', 'Magazzino'); --- Magazzino, articoli-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"fields\": \"Codice, Descrizione, Categoria, Q.tà\",\"query\": \"SELECT `id`, `codice` AS `Codice`, `descrizione` AS `Descrizione`, CONCAT_WS( ' &raquo; ', `categoria`, `subcategoria` ) AS `Categoria`, CONCAT_WS( ' ', REPLACE( FORMAT( `qta`, 2 ), '.', ',' ), (SELECT `valore` FROM `mg_unitamisura` WHERE `id`=`idum`) ) AS `Q.tà` FROM `mg_articoli` ORDER BY `descrizione`\"}]}" WHERE name='Articoli';+-- Preventivi+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Nome, Cliente, icon_Stato\",\"query\": \"SELECT `id`, `numero` AS `Numero`, `nome` AS `Nome`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_preventivi`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statipreventivi` WHERE `id`=`idstato`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statipreventivi` WHERE `id`=`idstato`) AS `icon_title_Stato` FROM `co_preventivi` ORDER BY `id` DESC\"}]}" WHERE name='Preventivi';++-- Contratti+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Nome, Cliente, icon_Stato\",\"query\": \"SELECT `id`, `numero` AS `Numero`, `nome` AS `Nome`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_contratti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_staticontratti` WHERE `id`=`idstato`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_staticontratti` WHERE `id`=`idstato`) AS `icon_title_Stato` FROM `co_contratti` ORDER BY `id` DESC\"}]}" WHERE name='Contratti';++-- Ordini cliente+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `or_ordini`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`or_ordini`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_Stato`, (SELECT `descrizione` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_title_Stato` FROM `or_ordini` INNER JOIN `or_tipiordine` ON `or_ordini`.`idtipoordine`=`or_tipiordine`.`id` WHERE `dir`='entrata' ORDER BY `id` DESC\"}]}" WHERE name='Ordini cliente';++-- Ordini fornitore+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `or_ordini`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`or_ordini`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_Stato`, (SELECT `descrizione` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_title_Stato` FROM `or_ordini` INNER JOIN `or_tipiordine` ON `or_ordini`.`idtipoordine`=`or_tipiordine`.`id` WHERE `dir`='uscita' ORDER BY `id` DESC\"}]}" WHERE name='Ordini fornitore';++-- Fatture di vendita+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `co_documenti`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_documenti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_title_Stato` FROM `co_documenti` INNER JOIN `co_tipidocumento` ON `co_documenti`.`idtipodocumento`=`co_tipidocumento`.`id` WHERE `dir`='entrata' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Fatture di vendita';++-- Fatture di acquisto+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `co_documenti`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_documenti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_title_Stato` FROM `co_documenti` INNER JOIN `co_tipidocumento` ON `co_documenti`.`idtipodocumento`=`co_tipidocumento`.`id` WHERE `dir`='uscita' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Fatture di acquisto';++-- Prima nota+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `co_documenti`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_documenti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_title_Stato` FROM `co_documenti` INNER JOIN `co_tipidocumento` ON `co_documenti`.`idtipodocumento`=`co_tipidocumento`.`id` WHERE `dir`='entrata' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Prima nota';++++-- Aggiornamento icone Preventivi+UPDATE `co_statipreventivi` SET `icona` = 'fa fa-2x fa-file-text-o text-muted' WHERE `descrizione` = 'Bozza';+UPDATE `co_statipreventivi` SET `icona` = 'fa fa-2x fa-clock-o text-warning' WHERE `descrizione` = 'In attesa di conferma';+UPDATE `co_statipreventivi` SET `icona` = 'fa fa-2x fa-thumbs-up text-success' WHERE `descrizione` = 'Accettato';+UPDATE `co_statipreventivi` SET `icona` = 'fa fa-2x fa-thumbs-down text-danger' WHERE `descrizione` = 'Rifiutato';+UPDATE `co_statipreventivi` SET `icona` = 'fa fa-2x fa-gear text-warning' WHERE `descrizione` = 'In lavorazione';+UPDATE `co_statipreventivi` SET `icona` = 'fa fa-2x fa-money text-primary' WHERE `descrizione` = 'In attesa di pagamento';+UPDATE `co_statipreventivi` SET `icona` = 'fa fa-2x fa-check-circle text-success' WHERE `descrizione` = 'Pagato';+UPDATE `co_statipreventivi` SET `icona` = 'fa fa-2x fa-check text-success' WHERE `descrizione` = 'Concluso';+++-- Aggiornamento icone Contratti+UPDATE `co_staticontratti` SET `icona` = 'fa fa-2x fa-file-text-o text-muted' WHERE `descrizione` = 'Bozza';+UPDATE `co_staticontratti` SET `icona` = 'fa fa-2x fa-clock-o text-warning' WHERE `descrizione` = 'In attesa di conferma';+UPDATE `co_staticontratti` SET `icona` = 'fa fa-2x fa-thumbs-up text-success' WHERE `descrizione` = 'Accettato';+UPDATE `co_staticontratti` SET `icona` = 'fa fa-2x fa-thumbs-down text-danger' WHERE `descrizione` = 'Rifiutato';+UPDATE `co_staticontratti` SET `icona` = 'fa fa-2x fa-gear text-warning' WHERE `descrizione` = 'In lavorazione';+UPDATE `co_staticontratti` SET `icona` = 'fa fa-2x fa-money text-primary' WHERE `descrizione` = 'In attesa di pagamento';+UPDATE `co_staticontratti` SET `icona` = 'fa fa-2x fa-check-circle text-success' WHERE `descrizione` = 'Pagato';+UPDATE `co_staticontratti` SET `icona` = 'fa fa-2x fa-check text-success' WHERE `descrizione` = 'Concluso';+++-- Aggiornamento icone fatture+UPDATE `co_statidocumento` SET `icona` = 'fa fa-2x fa-file-text-o text-muted' WHERE `descrizione` = 'Bozza';+UPDATE `co_statidocumento` SET `icona` = 'fa fa-2x fa-clock-o text-info' WHERE `descrizione` = 'Emessa';+UPDATE `co_statidocumento` SET `icona` = 'fa fa-2x fa-check-circle text-success' WHERE `descrizione` = 'Pagato';+UPDATE `co_statidocumento` SET `icona` = 'fa fa-2x fa-times text-danger' WHERE `descrizione` = 'Annullata';+++-- Aggiunta icone agli stati ordine+ALTER TABLE `or_statiordine` ADD `icona` VARCHAR( 100 ) NOT NULL;++UPDATE `or_statiordine` SET `icona` = 'fa fa-2x fa-file-text-o text-muted' WHERE `descrizione` = 'Non evaso';+UPDATE `or_statiordine` SET `icona` = 'fa fa-2x fa-gear text-warning' WHERE `descrizione` = 'Parzialmente evaso';+UPDATE `or_statiordine` SET `icona` = 'fa fa-2x fa-check-circle text-success' WHERE `descrizione` = 'Evaso';++++--+-- Aggiornamento directory modulo per ogni modulo che non aveva la sottocartella+--+UPDATE `zz_modules` SET `module_dir`='tipi_intervento' WHERE `name`='Tipi di intervento';+UPDATE `zz_modules` SET `module_dir`='stati_intervento' WHERE `name`='Stati di intervento';+UPDATE `zz_modules` SET `module_dir`='tipi_anagrafiche' WHERE `name`='Tipi di anagrafiche';+UPDATE `zz_modules` SET `module_dir`='zone' WHERE `name`='Zone';+UPDATE `zz_modules` SET `module_dir`='tecnici_tariffe' WHERE `name`='Tecnici e tariffe';+UPDATE `zz_modules` SET `module_dir`='voci_servizio' WHERE `name`='Voci di servizio';++++-- Elenco nazioni su database+DROP TABLE IF EXISTS `an_nazioni`;+CREATE TABLE IF NOT EXISTS `an_nazioni` (+ `id` int(11) NOT NULL AUTO_INCREMENT,+ `nome` varchar(255) NOT NULL,+ PRIMARY KEY (`id`)+) ENGINE=InnoDB;++INSERT INTO `an_nazioni` (`id`, `nome`) VALUES+(2, 'ALGERIA'),+(3, 'ANDORRA'),+(4, 'ANGOLA'),+(5, 'ANGUILLA'),+(6, 'ANTIGUA AND BARBUDA'),+(7, 'ARGENTINA'),+(8, 'ARMENIA'),+(9, 'ARUBA'),+(10, 'AUSTRALIA'),+(11, 'AUSTRIA'),+(12, 'AZERBAIJAN REPUBLIC'),+(13, 'BAHAMAS'),+(14, 'BAHRAIN'),+(15, 'BARBADOS'),+(16, 'BELGIO'),+(17, 'BELIZE'),+(18, 'BENIN'),+(19, 'BERMUDA'),+(20, 'BHUTAN'),+(21, 'BOLIVIA'),+(22, 'BOSNIA AND HERZEGOVINA'),+(23, 'BOTSWANA'),+(24, 'BRASILE'),+(25, 'BRITISH VIRGIN ISLANDS'),+(26, 'BRUNEI'),+(27, 'BULGARIA'),+(28, 'BURKINA FASO'),+(29, 'BURUNDI'),+(30, 'CAMBOGIA'),+(31, 'CANADA'),+(32, 'CAPO VERDE'),+(33, 'CAYMAN ISLANDS'),+(34, 'CHAD'),+(35, 'CHILE'),+(36, 'CHINA WORLDWIDE'),+(37, 'COLOMBIA'),+(38, 'COMOROS'),+(39, 'COOK ISLANDS'),+(40, 'COSTA RICA'),+(41, 'CROAZIA'),+(42, 'CIPRO'),+(43, 'REPUBBLICA CECA'),+(44, 'DEMOCRATIC REPUBLIC OF THE CONGO'),+(45, 'DANIMARCA'),+(46, 'DJIBOUTI'),+(47, 'DOMINICA'),+(48, 'REPUBBLICA DOMINICANA'),+(49, 'ECUADOR'),+(50, 'EL SALVADOR'),+(51, 'ERITREA'... [truncated message content]

[osm-devel] SF.net SVN: openstamanager:[928]new_trunk/openstamanager

From: <lo...@us...> - 2014-07-07 13:24:55

Revision: 928 http://sourceforge.net/p/openstamanager/code/928Author: loviuzDate: 2014-07-07 13:24:49 +0000 (Mon, 07 Jul 2014)Log Message:-----------[ANAGRAFICHE]completata schermata di modifica anagrafiche[CORE]predisposto motore per gestione template sia a livello strutturale che graficoModified Paths:-------------- new_trunk/openstamanager/controller.php new_trunk/openstamanager/core.php new_trunk/openstamanager/include/bottom.php new_trunk/openstamanager/include/top.php new_trunk/openstamanager/lib/dbo.class.php new_trunk/openstamanager/lib/htmlbuilder.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/lib/permissions_check.php new_trunk/openstamanager/modules/anagrafiche/actions.php new_trunk/openstamanager/modules/anagrafiche/init.php new_trunk/openstamanager/modules/anagrafiche/template.html new_trunk/openstamanager/share/themes/default/css/style.cssAdded Paths:----------- new_trunk/openstamanager/share/themes/default/img/chosen-sprite.pngModified: new_trunk/openstamanager/controller.php===================================================================--- new_trunk/openstamanager/controller.php2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/controller.php2014-07-07 13:24:49 UTC (rev 928)@@ -4,7 +4,7 @@ include($docroot."/lib/user_check.php"); include($docroot."/include/top.php"); -echo "<h3>".$module."</h3><hr>\n";+echo "<h3><i class='".$modules[ $id_module ]['icon']."'></i> ".$modules[$id_module]['name']."</h3><hr>\n"; /** * TODO: Futuro include di widget prima di datatables@@ -44,6 +44,7 @@ //Data (larghezza fissa) else if( preg_match( "/^Data/", trim($fields[$c]) ) ){ $attr_td .= " width='100'";+$label = $fields[$c]; } //Icona di stampaModified: new_trunk/openstamanager/core.php===================================================================--- new_trunk/openstamanager/core.php2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/core.php2014-07-07 13:24:49 UTC (rev 928)@@ -41,8 +41,9 @@ $lang = "it"; $jscript_modules = array(); $css_modules = array();-$infos = array();-$errors = array();++if( !isset($_SESSION['infos']) ){ $_SESSION['infos']=array(); }+if( !isset($_SESSION['errors']) ){ $_SESSION['errors']=array(); } include($docroot."/lib/dbo.class.php"); include($docroot."/lib/functions.php");@@ -59,7 +60,6 @@ array_push($css_modules, $theme_path."/css/AdminLTE.css"); array_push($css_modules, $theme_path."/css/jQueryUI/jquery-ui-1.10.3.custom.min.css"); array_push($css_modules, $theme_path."/css/datatables/dataTables.bootstrap.css");-array_push($css_modules, $theme_path."/css/datatables/dataTables.fixedHeader.min.css"); array_push($css_modules, $theme_path."/css/chosen.css"); array_push($css_modules, $theme_path."/css/style.css"); Modified: new_trunk/openstamanager/include/bottom.php===================================================================--- new_trunk/openstamanager/include/bottom.php2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/include/bottom.php2014-07-07 13:24:49 UTC (rev 928)@@ -19,19 +19,6 @@ echo "setInterval( \"session_keep_alive()\", 5*60*1000 );\n";//5 minuti echo "</script>\n"; }---echo "<div id='alerts'>\n";--for( $i=0; $i<sizeof($infos); $i++ ){-echo "<div class='alert alert-success'>".$infos[$i]."</div>";-}--for( $i=0; $i<sizeof($errors); $i++ ){-echo "<div class='alert alert-danger'>".$errors[$i]."</div>";-}--echo "</div>\n"; ?> <div id="main_loading">@@ -44,4 +31,6 @@ </html><?php $dbo->close(); ob_end_flush();+unset( $_SESSION['infos'] );+unset( $_SESSION['errors'] ); ?>Modified: new_trunk/openstamanager/include/top.php===================================================================--- new_trunk/openstamanager/include/top.php2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/include/top.php2014-07-07 13:24:49 UTC (rev 928)@@ -17,13 +17,16 @@ $id_module = $html->form('id_module'); $id_record = $html->form('id_record');++$rs = $dbo->fetchArray("SELECT name FROM zz_modules WHERE id=\"".$id_module."\"");+$module_name = $rs[0]['name']." - "; } ?><!DOCTYPE html> <html class="bg-black"> <head> <meta charset="UTF-8">- <title><?php echo $module ?> - OpenSTAManager</title>+ <title><?php echo $module_name ?>OpenSTAManager</title> <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> <?php loadCSSModules($css_modules);@@ -206,5 +209,12 @@ <section class="content"> <div class="row"> <div class="col-md-10">- <div id="main-alerts"></div>- + <?php+for( $i=0; $i<sizeof($_SESSION['infos']); $i++ ){+echo "<div class='alert alert-success'><i class='fa fa-check'></i> ".$_SESSION['infos'][$i]."</div>";+}++for( $i=0; $i<sizeof($_SESSION['errors']); $i++ ){+echo "<div class='alert alert-danger'><i class='fa fa-warning'></i> ".$_SESSION['errors'][$i]."</div>";+}+ ?>Modified: new_trunk/openstamanager/lib/dbo.class.php===================================================================--- new_trunk/openstamanager/lib/dbo.class.php2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/lib/dbo.class.php2014-07-07 13:24:49 UTC (rev 928)@@ -22,9 +22,6 @@ //query on the table function query($sql, $hide_errors=0){-global $infos;-global $errors;- if( @mysql_query($sql) ){ $id = mysql_insert_id(); if( $id==0 )@@ -42,14 +39,14 @@ //fetch row function fetchRow($sql){-$rows = @mysql_fetch_row( mysql_query($sql) ) or write_error( mysql_error(),"300px" );+$rows = @mysql_fetch_row( mysql_query($sql) ) or array_push( $errors, mysql_error() ); return $rows; } //record count function fetchNum($sql, $hide_error=0){ if( $hide_error==0 )-$num = @mysql_num_rows( mysql_query($sql) ) or write_error( mysql_error(),"300px" );+$num = @mysql_num_rows( mysql_query($sql) ) or array_push( $errors, mysql_error() ); else $num = @mysql_num_rows( mysql_query($sql) ); return $num;@@ -57,9 +54,6 @@ //fetch records function fetchArray($sql){-global $infos;-global $errors;- $i=0; if( $q=@mysql_query($sql) ) while( $rs=mysql_fetch_array( $q, MYSQL_ASSOC ) ){@@ -74,9 +68,6 @@ //fetch records (numero al posto del nome del campo) function fetchRows($sql){-global $infos;-global $errors;- $i=0; if( $q=@mysql_query($sql) ) while( $rs=mysql_fetch_row($q) ){Modified: new_trunk/openstamanager/lib/htmlbuilder.php===================================================================--- new_trunk/openstamanager/lib/htmlbuilder.php2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/lib/htmlbuilder.php2014-07-07 13:24:49 UTC (rev 928)@@ -8,13 +8,13 @@ /** * Genera una porzione di codice html a partire da una stringa nei seguenti formati: * campo <input> generico:- * {"type": "text", "required": 1, "class": "", "value": "$idintervento$", "extra": ""}+ * {[ "type": "text", "required": 1, "class": "", "value": "$idintervento$", "extra": "" ]} * * campo di testo normale e non modificabile- * {"type": "span", "value": "$testo$"}+ * {[ "type": "span", "value": "$testo$" ]} * * <select>- * {"type": "select", "required": 1, "class": "", "values": "[query='SELECT id, descrizione FROM co_contratti WHERE idanagrafica=$idanagrafica$"]', "default_value": "$idcontratto$", "extra": ""}+ * {[ "type": "select", "required": 1, "class": "", "values": "[query='SELECT id, descrizione FROM co_contratti WHERE idanagrafica=$idanagrafica$"]', "default_value": "$idcontratto$", "extra": "" ]} * * Il parametro $records contiene il risultato della query di selezione record per fare i vari replace delle variabili racchiuse tra $$ nel template */@@ -22,8 +22,10 @@ global $dbo; global $id_module; global $id_record;-+ $str = mb_convert_encoding( $str, "utf-8", "iso-8859-1" );+$str = str_replace( "{[", "{", $str );+$str = str_replace( "]}", "}", $str ); $json = json_decode( $str, true ); //Attributi particolari@@ -74,7 +76,7 @@ $value = ""; } }-$html .= "<input class='form-control ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$attr." value=\"".$value."\">";+$html .= "<input class='form-control ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$attr." ".$json['extra']." value=\"".$value."\">"; break; @@ -85,12 +87,19 @@ eval( "\$query = \"".$m[1][0]."\";" ); $rs = $dbo->fetchArray( $query ); +if( $json['multiple'] ){+$attr .= "multiple";+} -$html .= "<select class='form-control ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$attr.">\n";-$html .= "<option value=''>- Seleziona un valore -</option>\n"; +$html .= "<select class='form-control chosen ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$json['extra']." ".$attr.">\n";++if( !$json['multiple'] ){+$html .= "<option value=''>- Seleziona un valore -</option>\n";+}+ for( $i=0; $i<sizeof($rs); $i++ ){-( $rs[$i]['id'] == $value ) ? $this_attr=' selected="true"' : $this_attr='';+( in_array( $rs[$i]['id'], explode(',', $value) ) ) ? $this_attr=' selected="true"' : $this_attr=''; ( $rs[$i]['_bgcolor_'] != '' ) ? $this_attr.=' style="background:'.$rs[$i]['_bgcolor_'].';"' : $this_attr.=''; $html .= "<option value=\"".$rs[$i]['id']."\"".$this_attr.">".$rs[$i]['descrizione']."</option>\n";@@ -102,7 +111,7 @@ case 'textarea':-$html .= "<textarea class='form-control ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$attr.">".$value."</textarea>";+$html .= "<textarea class='form-control ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$json['extra']." ".$attr.">".$value."</textarea>"; break; } Modified: new_trunk/openstamanager/lib/jscripts/functionsjs.php===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-07 13:24:49 UTC (rev 928)@@ -7,6 +7,12 @@ $('#main-alerts').html( $('#alerts').html() ); $('#alerts').html('');+$('.chosen').chosen({+no_results_text: "<?php echo _("Nessun risultato trovato...") ?>",+placeholder_text_single: "<?php echo _("Seleziona un'opzione...") ?>",+placeholder_text_multiple: "<?php echo _("Seleziona una o più opzioni...") ?>"+});+$('.chzn-drop').css({'width': '100%'}); $('.date-picker').datepicker(); Modified: new_trunk/openstamanager/lib/permissions_check.php===================================================================--- new_trunk/openstamanager/lib/permissions_check.php2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/lib/permissions_check.php2014-07-07 13:24:49 UTC (rev 928)@@ -2,18 +2,13 @@ /* Controllo permessi modulo su utente (se non è is_admin) */-//Se il nome modulo non è impostato leggo dalla URL il nome del file php e lo estraggo-if( $nome_modulo=='' )-$nome_modulo = get_module_name();-- //Il modulo "Info" è visibile da tutti-if( $nome_modulo=='Info' ){-$permessi[$nome_modulo] = 'r';+if( $module_name=='Info' ){+$permessi[$module_name] = 'r'; } else{-$query = "SELECT *, (SELECT idanagrafica FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AS idanagrafica FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule=(SELECT id FROM zz_modules WHERE name='".$nome_modulo."')";+$query = "SELECT *, (SELECT idanagrafica FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AS idanagrafica FROM zz_permessi WHERE idgruppo=(SELECT idgruppo FROM zz_utenti WHERE idutente='".$_SESSION['idutente']."') AND idmodule=(SELECT id FROM zz_modules WHERE name='".$module_name."')"; $rs = $dbo->fetchArray($query); $user_idanagrafica = $rs[0]['idanagrafica']; @@ -21,25 +16,25 @@ if( sizeof($rs)<=0 ){ //Ultimo tentativo: se non ci sono i permessi ma sono l'amministratore posso comunque leggere il modulo if( $_SESSION['is_admin']==1 ){-$permessi[$nome_modulo] = 'rw';+$permessi[$module_name] = 'rw'; } else{ echo "<div style='clear:both;'></div><br/><br/><br/><br/><br/><p>Non hai i permessi per accedere a questo modulo.</p>\n";-$permessi[$nome_modulo] = '-';+$permessi[$module_name] = '-'; exit; } } else{ if( $rs[0]['permessi']=='-' ){ echo "<div style='clear:both;'></div><br/><br/><br/><br/><br/><p>Non hai i permessi per accedere a questo modulo.</p>\n";-$permessi[$nome_modulo] = '-';+$permessi[$module_name] = '-'; exit; } else if( $rs[0]['permessi']=='r' ){-$permessi[$nome_modulo] = 'r';+$permessi[$module_name] = 'r'; } else if( $rs[0]['permessi']=='rw' ){-$permessi[$nome_modulo] = 'rw';+$permessi[$module_name] = 'rw'; } } Modified: new_trunk/openstamanager/modules/anagrafiche/actions.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/actions.php2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/modules/anagrafiche/actions.php2014-07-07 13:24:49 UTC (rev 928)@@ -3,5 +3,159 @@ die( _("Accesso negato!") ); } -+$op = $html->form('op', 'post');+switch($op){+case "update":+$idanagrafica = $_POST['idanagrafica'];+if( $permessi[$module_name] == 'rw' ){++//leggo tutti i valori passati dal POST e li salvo in un array+$html_post = array();+foreach ($_POST as $key => $value) {+$html_post[$key] = $value;+}++if( isset($_POST['idanagrafica']) ){+$data_nascita = saveDate($html_post['data_nascita']);+if( $data_nascita == '' ){+$data_nascita = '';+}++$query = "UPDATE an_anagrafiche SET ".+ "ragione_sociale=\"".$html_post['ragione_sociale']."\",".+"piva=\"".$html_post['piva']."\",".+"codice_fiscale=\"".$html_post['codice_fiscale']."\",".+"data_nascita=\"".$data_nascita."\",".+"luogo_nascita=\"".$html_post['luogo_nascita']."\",".+"capitale_sociale=\"".$html_post['capitale_sociale']."\",".+"indirizzo=\"".$html_post['indirizzo']."\",".+"indirizzo2=\"".$html_post['indirizzo2']."\",".+"citta=\"".$html_post['citta']."\",".+"cap=\"".$html_post['cap']."\",".+"provincia=\"".$html_post['provincia']."\",".+"nazione=\"".$html_post['nazione']."\",".+"telefono=\"".$html_post['telefono']."\",".+"cellulare=\"".$html_post['cellulare']."\",".+"fax=\"".$html_post['fax']."\",".+"email=\"".$html_post['email']."\",".+"idsede_fatturazione=\"".$html_post['idsede_fatturazione']."\",".+"note=\"".$html_post['note']."\",".+"codiceri=\"".$html_post['codiceri']."\",".+"codicerea=\"".$html_post['codicerea']."\",".+"appoggiobancario=\"".$html_post['appoggiobancario']."\",".+"filiale=\"".$html_post['filiale']."\",".+"codiceiban=\"".$html_post['codiceiban']."\",".+"diciturafissafattura=\"".$html_post['diciturafissafattura']."\",".+"idpagamento=\"".$html_post['idpagamento']."\",".+"idlistino=\"".$html_post['idlistino']."\",".+"idiva=\"".$html_post['idiva']."\",".+"settore=\"".$html_post['settore']."\",".+"marche=\"".$html_post['marche']."\",".+"dipendenti=\"".$html_post['dipendenti']."\",".+"macchine=\"".$html_post['macchine']."\",".+"idagente=\"".$html_post['idagente']."\",".+"idrelazione=\"".$html_post['idrelazione']."\",".+"sitoweb=\"".$html_post['sitoweb']."\",".+"idzona=\"".$html_post['idzona']."\",".+"nome_cognome=\"".$html_post['nome_cognome']."\",".+"iscrizione_tribunale=\"".$html_post['iscrizione_tribunale']."\",".+"cciaa=\"".$html_post['cciaa']."\",".+"cciaa_citta=\"".$html_post['cciaa_citta']."\",".+"n_alboartigiani=\"".$html_post['n_alboartigiani']."\",".+"foro_competenza=\"".$html_post['foro_competenza']."\"".+"WHERE idanagrafica='$idanagrafica' ".$additional_where['Anagrafiche'];++$rs = $dbo->query( $query );++array_push( $_SESSION['infos'], "Informazioni salvate correttamente!");++//Aggiorno il codice anagrafica se non è già presente, altrimenti lo ignoro+$esiste = $dbo->fetchNum("SELECT idanagrafica FROM an_anagrafiche WHERE codice=\"".$html_post['codice']."\" AND NOT idanagrafica=\"".$idanagrafica."\"", 1);+++//Aggiorno le tipologie di anagrafica+$dbo->query("DELETE FROM an_tipianagrafiche_anagrafiche WHERE idanagrafica=\"".$idanagrafica."\"");++foreach( $_POST['idtipoanagrafica'] as $idtipoanagrafica ){+$dbo->query("INSERT INTO an_tipianagrafiche_anagrafiche(idtipoanagrafica,idanagrafica) VALUES( \"".$idtipoanagrafica."\", \"".$idanagrafica."\" )");+}++if( $esiste ){+array_push( $_SESSION['errors'], "Il codice anagrafica inserito esiste già! Inserirne un'altro...");+}+else{+$dbo->query("UPDATE an_anagrafiche SET codice=\"".$html_post['codice']."\" WHERE idanagrafica=\"".$idanagrafica."\"");+}++}+}++else{+array_push( $_SESSION['errors'], "Permesso negato!");+}+break;++case "add":+if( $permessi[$module_name] == 'rw' ){+$idtipoanagrafica = $html->form( 'idtipoanagrafica', 'post' );+$ragione_sociale = $html->form( 'ragione_sociale', 'post' );+++/*+Se ad aggiungere un cliente è un agente, lo imposto come agente di quel cliente+*/+//Lettura tipologia della nuova anagrafica+$rs = $dbo->fetchArray("SELECT descrizione FROM an_tipianagrafiche WHERE idtipoanagrafica='".$idtipoanagrafica."'");+$tipoanagrafica_dst = $rs[0]['descrizione'];++//Lettura tipologia dell'utente loggato+$rs = $dbo->fetchArray("SELECT descrizione FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica='".$user_idanagrafica."'");+$agente_is_logged = false;+for( $i=0; $i<sizeof($rs); $i++ ){+if( $rs[$i]['descrizione']=='Agente' ){+$agente_is_logged = true;+$i = sizeof($rs);+}+}++( $agente_is_logged && $tipoanagrafica_dst=='Cliente' ) ? $idagente=$user_idanagrafica : $idagente=0;+++//Se sto inserendo un cliente per un agente+if( ($idtipoanagrafica==1) and ($_POST['idagente']!="") ){+$idagente = $_POST['idagente'];+}++//Inserisco l'anagrafica solo se l'idtipoanagrafica esiste+if( $idtipoanagrafica!='' ){+if( $dbo->fetchNum("SELECT idtipoanagrafica FROM an_tipianagrafiche WHERE idtipoanagrafica='$idtipoanagrafica'" )==1 ){+//Leggo l'ultimo codice anagrafica per calcolare il successivo+$rs = $dbo->fetchArray("SELECT codice FROM an_anagrafiche ORDER BY CAST(codice AS SIGNED) DESC LIMIT 0,1");+$codice = get_next_code( $rs[0]['codice'], 1, get_var("Formato codice anagrafica") );++//Inserisco l'anagrafica+$query = "INSERT INTO an_anagrafiche( ragione_sociale, codice, idagente ) VALUES ( \"".$ragione_sociale."\", \"".$codice."\", \"".$idagente."\" )";+$dbo->query($query);+$idanagrafica = $dbo->last_inserted_id();++//Inserisco il rapporto dell'anagrafica con la tipologia scelta+$query = "INSERT INTO an_tipianagrafiche_anagrafiche(idanagrafica, idtipoanagrafica) VALUES ($idanagrafica, $idtipoanagrafica)";+$dbo->query($query);+array_push( $_SESSION['infos'], "Aggiunta una nuova anagrafica!" );+}+}+}++break;+++case "delete":+if( $permessi[$module_name] == 'rw' ){+//Disattivo solamente l'anagrafica+$dbo->query("UPDATE an_anagrafiche SET deleted=1 WHERE idanagrafica=\"".$id_record."\" ".$additional_where['Anagrafiche']);+array_push( $_SESSION['infos'], "Anagrafica eliminata!" );+}++break;+} ?>Modified: new_trunk/openstamanager/modules/anagrafiche/init.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/init.php2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/modules/anagrafiche/init.php2014-07-07 13:24:49 UTC (rev 928)@@ -3,5 +3,5 @@ die( _("Accesso negato!") ); } -$records = $dbo->fetchArray("SELECT *, (SELECT GROUP_CONCAT(descrizione) FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica=an_anagrafiche.idanagrafica) AS tipianagrafica FROM an_anagrafiche GROUP BY idanagrafica HAVING idanagrafica=\"".$id_record."\"");+$records = $dbo->fetchArray("SELECT *, (SELECT GROUP_CONCAT(an_tipianagrafiche.idtipoanagrafica) FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica=an_anagrafiche.idanagrafica) AS idtipianagrafica, (SELECT GROUP_CONCAT(descrizione) FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica=an_anagrafiche.idanagrafica) AS tipianagrafica FROM an_anagrafiche GROUP BY idanagrafica HAVING idanagrafica=\"".$id_record."\""); ?>Modified: new_trunk/openstamanager/modules/anagrafiche/template.html===================================================================--- new_trunk/openstamanager/modules/anagrafiche/template.html2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/modules/anagrafiche/template.html2014-07-07 13:24:49 UTC (rev 928)@@ -1,221 +1,258 @@-<div class="panel panel-primary">-<div class="panel-heading">-<h3 class="panel-title">Dati anagrafici</h3>-</div>+<form action="" method="post" role="form">+<input type="hidden" name="backto" value="record-edit">+<input type="hidden" name="op" value="update">+<input type="hidden" name="idanagrafica" value="<?php echo $id_record ?>">++<!-- DATI ANAGRAFICI -->+<div class="panel panel-primary">+<div class="panel-heading">+<h3 class="panel-title">Dati anagrafici</h3>+</div> -<div class="panel-body">-<div class="row">-<div class="col-md-12">-{ "type": "text", "label": "Ragione sociale", "name": "ragione_sociale", "required": 1, "class": "", "value": "$ragione_sociale$", "extra": "" }+<div class="panel-body">+<div class="pull-right">+<button type="submit" class="btn btn-success"><i class="fa fa-check"></i> Salva modifiche</button> </div>-</div>+<div class="clearfix"></div>++++<div class="row">+<div class="col-md-12">+{[ "type": "text", "label": "Ragione sociale", "name": "ragione_sociale", "required": 1, "class": "", "value": "$ragione_sociale$", "extra": "" ]}+</div>+</div> -<div class="row">-<div class="col-md-4">-{ "type": "text", "label": "Partita iva", "maxlength": 13, "name": "piva", "required": 1, "class": "text-center", "value": "$piva$", "extra": "" }-</div>+<div class="row">+<div class="col-md-4">+{[ "type": "text", "label": "Partita iva", "maxlength": 13, "name": "piva", "required": 1, "class": "text-center", "value": "$piva$", "extra": "" ]}+</div> -<div class="col-md-4">-{ "type": "text", "label": "Codice fiscale", "maxlength": 16, "name": "codice_fiscale", "required": 0, "class": "text-center", "value": "$codice_fiscale$", "extra": "" }-</div>+<div class="col-md-4">+{[ "type": "text", "label": "Codice fiscale", "maxlength": 16, "name": "codice_fiscale", "required": 0, "class": "text-center", "value": "$codice_fiscale$", "extra": "" ]}+</div> -<div class="col-md-4">-{ "type": "text", "label": "Codice anagrafica", "name": "codice", "required": 1, "class": "text-center", "value": "$codice$", "extra": "" }+<div class="col-md-4">+{[ "type": "text", "label": "Codice anagrafica", "name": "codice", "required": 1, "class": "text-center", "value": "$codice$", "extra": "" ]}+</div> </div>-</div> -<div class="row">-<div class="col-md-6">-{ "type": "text", "label": "Luogo di nascita", "name": "luogo_nascita", "required": 0, "class": "", "value": "$luogo_nascita$", "extra": "" }-</div>+<div class="row">+<div class="col-md-6">+{[ "type": "text", "label": "Luogo di nascita", "name": "luogo_nascita", "required": 0, "class": "", "value": "$luogo_nascita$", "extra": "" ]}+</div> -<div class="col-md-6">-{ "type": "date", "label": "Data di nascita", "maxlength": 10, "name": "data_nascita", "required": 0, "class": "text-center date-mask", "value": "$data_nascita$", "extra": "" }+<div class="col-md-6">+{[ "type": "date", "label": "Data di nascita", "maxlength": 10, "name": "data_nascita", "required": 0, "class": "text-center date-mask", "value": "$data_nascita$", "extra": "" ]}+</div> </div>-</div> -<div class="row">-<div class="col-md-6">-{ "type": "text", "label": "Indirizzo", "name": "indirizzo", "required": 0, "class": "", "value": "$indirizzo$", "extra": "" }-</div>+<div class="row">+<div class="col-md-6">+{[ "type": "text", "label": "Indirizzo", "name": "indirizzo", "required": 0, "class": "", "value": "$indirizzo$", "extra": "" ]}+</div> -<div class="col-md-6">-{ "type": "text", "label": "Indirizzo2", "name": "indirizzo2", "required": 0, "class": "", "value": "$indirizzo2$", "extra": "" }+<div class="col-md-6">+{[ "type": "text", "label": "Indirizzo2", "name": "indirizzo2", "required": 0, "class": "", "value": "$indirizzo2$", "extra": "" ]}+</div> </div>-</div> -<div class="row">-<div class="col-md-4">-{ "type": "select", "label": "Nazione", "name": "nazione", "required": 0, "class": "", "values": "query=SELECT nome AS id, nome AS descrizione FROM an_nazioni ORDER BY nome ASC", "value": "$nazione$", "extra": "" }-</div>+<div class="row">+<div class="col-md-4">+{[ "type": "select", "label": "Nazione", "name": "nazione", "required": 0, "class": "", "values": "query=SELECT nome AS id, nome AS descrizione FROM an_nazioni ORDER BY nome ASC", "value": "$nazione$", "extra": "" ]}+</div> -<div class="col-md-2">-{ "type": "text", "label": "C.A.P.", "name": "cap", "maxlength": 5, "required": 0, "class": "text-center", "value": "$cap$", "extra": "" }-</div>+<div class="col-md-2">+{[ "type": "text", "label": "C.A.P.", "name": "cap", "maxlength": 5, "required": 0, "class": "text-center", "value": "$cap$", "extra": "" ]}+</div> -<div class="col-md-4">-{ "type": "text", "label": "Città", "name": "citta", "required": 0, "class": "text-center", "value": "$citta$", "extra": "" }-</div>+<div class="col-md-4">+{[ "type": "text", "label": "Città", "name": "citta", "required": 0, "class": "text-center", "value": "$citta$", "extra": "" ]}+</div> -<div class="col-md-2">-{ "type": "text", "label": "Provincia", "name": "provincia", "maxlength": 2, "required": 0, "class": "text-center", "value": "$provincia$", "extra": "" }+<div class="col-md-2">+{[ "type": "text", "label": "Provincia", "name": "provincia", "maxlength": 2, "required": 0, "class": "text-center", "value": "$provincia$", "extra": "" ]}+</div> </div> </div> </div>-</div> -<div class="panel panel-primary">-<div class="panel-heading">-<h3 class="panel-title">Contatti</h3>-</div>++<!-- CONTATTI -->+<div class="panel panel-primary">+<div class="panel-heading">+<h3 class="panel-title">Contatti</h3>+</div> -<div class="panel-body">-<div class="row">-<div class="col-md-4">-{ "type": "text", "label": "Telefono", "name": "telefono", "required": 0, "class": "text-center", "value": "$telefono$", "extra": "", "icon-before": "<i class='fa fa-phone'></i>" }+<div class="panel-body">+<div class="pull-right">+<button type="submit" class="btn btn-success"><i class="fa fa-check"></i> Salva modifiche</button> </div>+<div class="clearfix"></div>++<div class="row">+<div class="col-md-4">+{[ "type": "text", "label": "Telefono", "name": "telefono", "required": 0, "class": "text-center", "value": "$telefono$", "extra": "", "icon-before": "<i class='fa fa-phone'></i>" ]}+</div> -<div class="col-md-4">-{ "type": "text", "label": "Fax", "name": "fax", "required": 0, "class": "text-center", "value": "$fax$", "extra": "", "icon-before": "<i class='fa fa-fax'></i>" }-</div>+<div class="col-md-4">+{[ "type": "text", "label": "Fax", "name": "fax", "required": 0, "class": "text-center", "value": "$fax$", "extra": "", "icon-before": "<i class='fa fa-fax'></i>" ]}+</div> -<div class="col-md-4">-{ "type": "text", "label": "Cellulare", "name": "cellulare", "required": 0, "class": "text-center", "value": "$cellulare$", "extra": "", "icon-before": "<i class='fa fa-mobile'></i>" }+<div class="col-md-4">+{[ "type": "text", "label": "Cellulare", "name": "cellulare", "required": 0, "class": "text-center", "value": "$cellulare$", "extra": "", "icon-before": "<i class='fa fa-mobile'></i>" ]}+</div> </div>-</div> -<div class="row">-<div class="col-md-4">-{ "type": "text", "label": "Email", "name": "email", "required": 0, "class": "", "value": "$email$", "extra": "", "icon-before": "<i class='fa fa-envelope'></i>" }-</div>+<div class="row">+<div class="col-md-4">+{[ "type": "text", "label": "Email", "name": "email", "required": 0, "class": "", "value": "$email$", "extra": "", "icon-before": "<i class='fa fa-envelope'></i>" ]}+</div> -<div class="col-md-4">-{ "type": "text", "label": "Sito web", "name": "sitoweb", "required": 0, "class": "", "value": "$sitoweb$", "extra": "", "icon-before": "<i class='fa fa-globe'></i>" }-</div>+<div class="col-md-4">+{[ "type": "text", "label": "Sito web", "name": "sitoweb", "required": 0, "class": "", "value": "$sitoweb$", "extra": "", "icon-before": "<i class='fa fa-globe'></i>" ]}+</div> -<div class="col-md-4">-{ "type": "select", "label": "Zona", "name": "idzona", "required": 0, "class": "", "values": "query=SELECT id, CONCAT_WS( ' - ', nome, descrizione) AS descrizione FROM an_zone ORDER BY descrizione ASC", "value": "$idzona$", "extra": "" }+<div class="col-md-4">+{[ "type": "select", "label": "Zona", "name": "idzona", "required": 0, "class": "", "values": "query=SELECT id, CONCAT_WS( ' - ', nome, descrizione) AS descrizione FROM an_zone ORDER BY descrizione ASC", "value": "$idzona$", "extra": "" ]}+</div> </div> </div> </div>-</div> -<div class="panel panel-primary">-<div class="panel-heading">-<h3 class="panel-title">Informazioni aggiuntive</h3>-</div>+<div class="panel panel-primary">+<div class="panel-heading">+<h3 class="panel-title">Informazioni aggiuntive</h3>+</div> -<div class="panel-body">-<div class="row">-<div class="col-md-3">-{ "type": "select", "label": "Pagamento preferito", "name": "idpagamento", "required": 0, "class": "", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento$", "extra": "" }+<div class="panel-body">+<div class="pull-right">+<button type="submit" class="btn btn-success"><i class="fa fa-check"></i> Salva modifiche</button> </div>+<div class="clearfix"></div>++<div class="row">+<div class="col-md-3">+{[ "type": "select", "label": "Pagamento preferito", "name": "idpagamento", "required": 0, "class": "", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "select", "label": "Iva predefinita", "name": "idiva", "required": 0, "class": "", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva$", "extra": "" }-</div>+<div class="col-md-3">+{[ "type": "select", "label": "Iva predefinita", "name": "idiva", "required": 0, "class": "", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "select", "label": "Listino articoli", "name": "idlistino", "required": 0, "class": "", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino$", "extra": "" }-</div>+<div class="col-md-3">+{[ "type": "select", "label": "Listino articoli", "name": "idlistino", "required": 0, "class": "", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "select", "label": "Indirizzo di fatturazione", "name": "idsede_fatturazione", "required": 0, "class": "", "values": "query=SELECT id, CONCAT_WS(', ', nomesede, citta) AS descrizione FROM an_sedi WHERE idanagrafica='$id_record' UNION SELECT '0' AS id, 'Sede legale' AS descrizione ORDER BY descrizione", "value": "$idsede_fatturazione$", "extra": "" }+<div class="col-md-3">+{[ "type": "select", "label": "Indirizzo di fatturazione", "name": "idsede_fatturazione", "required": 0, "class": "", "values": "query=SELECT id, CONCAT_WS(', ', nomesede, citta) AS descrizione FROM an_sedi WHERE idanagrafica='$id_record' UNION SELECT '0' AS id, 'Sede legale' AS descrizione ORDER BY descrizione", "value": "$idsede_fatturazione$", "extra": "" ]}+</div> </div>-</div> -<div class="row">-<div class="col-md-3">-{ "type": "text", "label": "Codice registro imprese", "name": "codiceri", "required": 0, "class": "", "value": "$codiceri$", "extra": "" }-</div>+<div class="row">+<div class="col-md-3">+{[ "type": "text", "label": "Codice registro imprese", "name": "codiceri", "required": 0, "class": "", "value": "$codiceri$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "text", "label": "Codice R.E.A. <small>(provincia/C.C.I.A.A.)</small>", "name": "codicerea", "required": 0, "class": "", "value": "$codicerea$", "extra": "" }-</div>+<div class="col-md-3">+{[ "type": "text", "label": "Codice R.E.A. <small>(provincia/C.C.I.A.A.)</small>", "name": "codicerea", "required": 0, "class": "", "value": "$codicerea$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "text", "label": "N<sup>o</sup> iscr. C.C.I.A.A.", "name": "cciaa", "required": 0, "class": "", "value": "$cciaa$", "extra": "" }-</div>+<div class="col-md-3">+{[ "type": "text", "label": "N<sup>o</sup> iscr. C.C.I.A.A.", "name": "cciaa", "required": 0, "class": "", "value": "$cciaa$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "text", "label": "Città iscr. C.C.I.A.A.", "name": "cciaa_citta", "required": 0, "class": "", "value": "$cciaa_citta$", "extra": "" }+<div class="col-md-3">+{[ "type": "text", "label": "Città iscr. C.C.I.A.A.", "name": "cciaa_citta", "required": 0, "class": "", "value": "$cciaa_citta$", "extra": "" ]}+</div> </div>-</div> -<div class="row">-<div class="col-md-3">-{ "type": "text", "label": "Appoggio bancario", "name": "appoggiobancario", "required": 0, "class": "", "value": "$appoggiobancario$", "extra": "" }-</div>+<div class="row">+<div class="col-md-3">+{[ "type": "text", "label": "Appoggio bancario", "name": "appoggiobancario", "required": 0, "class": "", "value": "$appoggiobancario$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "text", "label": "Filiale banca", "name": "filiale", "required": 0, "class": "", "value": "$filiale$", "extra": "" }-</div>+<div class="col-md-3">+{[ "type": "text", "label": "Filiale banca", "name": "filiale", "required": 0, "class": "", "value": "$filiale$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "text", "label": "Codice IBAN", "name": "codiceiban", "required": 0, "class": "", "value": "$codiceiban$", "extra": "" }-</div>+<div class="col-md-3">+{[ "type": "text", "label": "Codice IBAN", "name": "codiceiban", "required": 0, "class": "", "value": "$codiceiban$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "text", "label": "Dicitura fissa fattura", "name": "diciturafissafattura", "required": 0, "class": "", "value": "$diciturafissafattura$", "extra": "" }+<div class="col-md-3">+{[ "type": "text", "label": "Dicitura fissa fattura", "name": "diciturafissafattura", "required": 0, "class": "", "value": "$diciturafissafattura$", "extra": "" ]}+</div> </div>-</div> -<div class="row">-<div class="col-md-3">-{ "type": "text", "label": "Foro di competenza", "name": "foro_competenza", "required": 0, "class": "", "value": "$foro_competenza$", "extra": "" }-</div>+<div class="row">+<div class="col-md-3">+{[ "type": "text", "label": "Foro di competenza", "name": "foro_competenza", "required": 0, "class": "", "value": "$foro_competenza$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "text", "label": "Settore merceologico", "name": "settore", "required": 0, "class": "", "value": "$settore$", "extra": "" }-</div>+<div class="col-md-3">+{[ "type": "text", "label": "Settore merceologico", "name": "settore", "required": 0, "class": "", "value": "$settore$", "extra": "" ]}+</div> -<div class="col-md-6">-{ "type": "text", "label": "Marche trattate", "name": "marche", "required": 0, "class": "", "value": "$marche$", "extra": "" }+<div class="col-md-6">+{[ "type": "text", "label": "Marche trattate", "name": "marche", "required": 0, "class": "", "value": "$marche$", "extra": "" ]}+</div> </div>-</div> -<div class="row">-<div class="col-md-3">-{ "type": "text", "label": "N<sup>o</sup> dipendenti", "name": "dipendenti", "required": 0, "class": "", "value": "$dipendenti$", "extra": "" }-</div>+<div class="row">+<div class="col-md-3">+{[ "type": "text", "label": "N<sup>o</sup> dipendenti", "name": "dipendenti", "required": 0, "class": "", "value": "$dipendenti$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "text", "label": "N<sup>o</sup> macchine", "name": "macchine", "required": 0, "class": "", "value": "$macchine$", "extra": "" }-</div>+<div class="col-md-3">+{[ "type": "text", "label": "N<sup>o</sup> macchine", "name": "macchine", "required": 0, "class": "", "value": "$macchine$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "text", "label": "N<sup>o</sup> iscr. tribunale", "name": "iscrizione_tribunale", "required": 0, "class": "", "value": "$iscrizione_tribunale$", "extra": "" }-</div>+<div class="col-md-3">+{[ "type": "text", "label": "N<sup>o</sup> iscr. tribunale", "name": "iscrizione_tribunale", "required": 0, "class": "", "value": "$iscrizione_tribunale$", "extra": "" ]}+</div> -<div class="col-md-3">-{ "type": "text", "label": "N<sup>o</sup> iscr. albo artigiani", "name": "n_alboartigiani", "required": 0, "class": "", "value": "$n_alboartigiani$", "extra": "" }+<div class="col-md-3">+{[ "type": "text", "label": "N<sup>o</sup> iscr. albo artigiani", "name": "n_alboartigiani", "required": 0, "class": "", "value": "$n_alboartigiani$", "extra": "" ]}+</div> </div>-</div> -<?php-if( in_array( 'Cliente', explode(',', $records[0]['tipianagrafica']) ) ){-?>+ <div class="row"> <div class="col-md-4">-{ "type": "select", "label": "Agente di riferimento", "name": "idagente", "required": 0, "class": "", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, ragione_sociale AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE descrizione='Agente' ORDER BY ragione_sociale", "value": "$idagente$", "extra": "" }+{[ "type": "select", "multiple": "1", "label": "Tipo di anagrafica", "name": "idtipoanagrafica[]", "required": 0, "class": "", "values": "query=SELECT idtipoanagrafica AS id, descrizione FROM an_tipianagrafiche ORDER BY descrizione", "value": "$idtipianagrafica$", "extra": "" ]} </div>++<?php+if( in_array( 'Cliente', explode(',', $records[0]['tipianagrafica']) ) ){+?>+<div class="col-md-4">+{[ "type": "select", "label": "Agente di riferimento", "name": "idagente", "required": 0, "class": "", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, ragione_sociale AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE descrizione='Agente' ORDER BY ragione_sociale", "value": "$idagente$", "extra": "" ]}+</div> -<div class="col-md-4">-{ "type": "select", "label": "Relazione con il cliente", "name": "idrelazione", "required": 0, "class": "", "values": "query=SELECT id, descrizione, colore AS _bgcolor_ FROM an_relazioni ORDER BY descrizione", "value": "$idrelazione$", "extra": "" }-</div>+<div class="col-md-4">+{[ "type": "select", "label": "Relazione con il cliente", "name": "idrelazione", "required": 0, "class": "", "values": "query=SELECT id, descrizione, colore AS _bgcolor_ FROM an_relazioni ORDER BY descrizione", "value": "$idrelazione$", "extra": "" ]}+</div>+<?php } ?> </div>-<?php } ?> -<div class="row">-<div class="col-md-12">-{ "type": "textarea", "label": "Note", "name": "note", "required": 0, "class": "", "value": "$note$", "extra": "" }+<div class="row">+<div class="col-md-12">+{[ "type": "textarea", "label": "Note", "name": "note", "required": 0, "class": "", "value": "$note$", "extra": "" ]}+</div> </div> </div> </div>-</div>+</form> +<form action="" method="post" role="form" id="form-delete">+<input type="hidden" name="backto" value="record-list">+<input type="hidden" name="op" value="delete">+<button type="button" class="btn-link" onclick="if( confirm('Eliminare questa anagrafica?') ){ $('#form-delete').submit(); }"><span class="text-danger"><i class="fa fa-trash-o"></i> Elimina anagrafica</span></button>+</form>+Modified: new_trunk/openstamanager/share/themes/default/css/style.css===================================================================--- new_trunk/openstamanager/share/themes/default/css/style.css2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/share/themes/default/css/style.css2014-07-07 13:24:49 UTC (rev 928)@@ -1,3 +1,5 @@+body{ background:#555 url(../img/bodybg.png) top left repeat; }+ .pagination-centered { text-align: center; }@@ -58,3 +60,20 @@ #main_loading > div > i{ font-size:300px; color:#e24e1e; } .form-control{ background:#fafafa; } +.table{ background:#fff; }+.skin-black .logo{ background:#222; }+.skin-black .right-side > .content{ background:#555 url(../img/bodybg.png) top left repeat; }+.skin-black .navbar{ background:#222; border:none; }+.skin-black .left-side{ background:#333; }+.skin-black .navbar .sidebar-toggle .icon-bar{ background:#fff; }++/* Jquery Chosen*/+.chzn-container, .chzn-container .chzn-single{ font-size:14px; border-radius:0; -webkit-border-radius:0; height:34px; line-height:32px; box-shadow:none; -webkit-box-shadow:none; background:#fafafa; }+.chzn-container-single .chzn-single div{ top:4px; }+.chzn-container-multi .chzn-choices{ background:#fafafa; }+.chzn-container-multi .chzn-choices .search-field .default{ font-size:14px; height:30px; padding:6px 12px; background:#fafafa; }+.chzn-container-multi .chzn-choices .search-choice{ background:#ddd; border-radius:0; -webkit-border-radius:0; font-size:14px; height:26px; line-height:16px; }+.chzn-container-multi .chzn-choices .search-choice .search-choice-close{ top:6px; }++#supersearch{ color:#eee; }+Added: new_trunk/openstamanager/share/themes/default/img/chosen-sprite.png===================================================================(Binary files differ)Index: new_trunk/openstamanager/share/themes/default/img/chosen-sprite.png===================================================================--- new_trunk/openstamanager/share/themes/default/img/chosen-sprite.png2014-07-05 13:03:23 UTC (rev 927)+++ new_trunk/openstamanager/share/themes/default/img/chosen-sprite.png2014-07-07 13:24:49 UTC (rev 928)Property changes on: new_trunk/openstamanager/share/themes/default/img/chosen-sprite.png___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: svn:mime-type## -0,0 +1 ##+application/octet-stream\ No newline at end of propertyThis was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[932]new_trunk/openstamanager

From: <lo...@us...> - 2014-07-10 15:52:08

Revision: 932 http://sourceforge.net/p/openstamanager/code/932Author: loviuzDate: 2014-07-10 15:52:00 +0000 (Thu, 10 Jul 2014)Log Message:-----------[CORE]corretta procedura di installazione (graficamente e progress bar)corretta visualizzazione ed evidenziazione voci di menu a sinistraModified Paths:-------------- new_trunk/openstamanager/README new_trunk/openstamanager/core.php new_trunk/openstamanager/include/top.php new_trunk/openstamanager/share/themes/default/css/style.css new_trunk/openstamanager/update/create_updates.sqlAdded Paths:----------- new_trunk/openstamanager/lib/jscripts/jquery/jquery-ui.min.js new_trunk/openstamanager/share/themes/default/img/pbar-ani.gifRemoved Paths:------------- new_trunk/openstamanager/lib/jscripts/jquery/jquery-ui-1.10.3.min.js new_trunk/openstamanager/lib/jscripts/jquery/jquery-ui-1.10.4.min.jsModified: new_trunk/openstamanager/README===================================================================--- new_trunk/openstamanager/README2014-07-10 15:28:52 UTC (rev 931)+++ new_trunk/openstamanager/README2014-07-10 15:52:00 UTC (rev 932)@@ -17,10 +17,13 @@ .:: INSTALLAZIONE ::.-E' necessario disporre di un server web con supporto al PHP e di un database-MySQL.+E' necessario disporre di:+ - Php5 o superiore con estensione gettext e short_open_tag su On+ - database MySQL 5 o superiore+ - server web Apache 2 o superiore + -- GNU/Linux -- Testato su Apache2 e MySQL > 5.0 su distribuzioni basate su Debian e ArchLinux Modified: new_trunk/openstamanager/core.php===================================================================--- new_trunk/openstamanager/core.php2014-07-10 15:28:52 UTC (rev 931)+++ new_trunk/openstamanager/core.php2014-07-10 15:52:00 UTC (rev 932)@@ -11,7 +11,7 @@ ini_set("magic_quotes","Off"); ini_set("register_globals","Off"); ini_set( 'date.timezone', 'Europe/Rome' );-//error_reporting( "E_ALL & ~E_NOTICE" );+error_reporting( "E_ALL & ~E_NOTICE" ); $script_filename = str_replace( "\\", "/", __FILE__ );//fix for Windows@@ -65,7 +65,7 @@ array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/bootstrap.min.js");-array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery-ui-1.10.4.min.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery-ui.min.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/jquery.ui.datepicker-".$lang.".js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/dataTables.bootstrap.js");Modified: new_trunk/openstamanager/include/top.php===================================================================--- new_trunk/openstamanager/include/top.php2014-07-10 15:28:52 UTC (rev 931)+++ new_trunk/openstamanager/include/top.php2014-07-10 15:52:00 UTC (rev 932)@@ -19,14 +19,14 @@ $id_record = $html->form('id_record'); $rs = $dbo->fetchArray("SELECT name FROM zz_modules WHERE id=\"".$id_module."\"");-$module_name = $rs[0]['name']." - ";+$module_name = $rs[0]['name']; } ?><!DOCTYPE html> <html class="bg-black"> <head> <meta charset="UTF-8">- <title><?php echo $module_name ?>OpenSTAManager</title>+ <title><?php echo $module_name ?> - OpenSTAManager</title> <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> <?php loadCSSModules($css_modules);@@ -143,7 +143,7 @@ if( $show ){ //Evidenzio il modulo principale anche se sono dentro ad un sottomodulo $submodules = explode( ',', $rs[$i]['submodules'] );-( $module == $rs[$i]['name'] || (in_array($nome_modulo, $submodules) && $rs[$i]['submodules']!='') ) ? $class="active" : $class="";+( $module_name == $rs[$i]['name'] || (in_array($nome_modulo, $submodules) && $rs[$i]['submodules']!='') ) ? $class="active" : $class=""; ( $rs[$i]['options']!="" ) ? $link=$rootdir."/controller.php?id_module=".$rs[$i]['id'] : $link="javascript:;"; @@ -175,8 +175,7 @@ echo "<ul class='treeview-menu'>\n"; for( $j=0; $j<sizeof($rs2); $j++ ){-( $rs2[$j]['module_dir']!='' ) ? $subdir=$rs2[$j]['module_dir']."/" : $subdir='';-( $module == $rs2[$j]['name'] ) ? $attr='class="active"' : $attr='';+( $module_name == $rs2[$j]['name'] ) ? $attr='class="active"' : $attr=''; echo "<li $attr><a href='".$rootdir."/controller.php?id_module=".$rs2[$j]['id']."'>".$rs2[$j]['name']."</a></li>\n"; $modules[ $rs2[$i]['id'] ]['name'] = $rs2[$i]['name'];Deleted: new_trunk/openstamanager/lib/jscripts/jquery/jquery-ui-1.10.3.min.js===================================================================--- new_trunk/openstamanager/lib/jscripts/jquery/jquery-ui-1.10.3.min.js2014-07-10 15:28:52 UTC (rev 931)+++ new_trunk/openstamanager/lib/jscripts/jquery/jquery-ui-1.10.3.min.js2014-07-10 15:52:00 UTC (rev 932)@@ -1,6 +0,0 @@-/*! jQuery UI - v1.10.3 - 2013-12-25-* http://jqueryui.com-* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.autocomplete.js, jquery.ui.menu.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js-* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */-@@ Diff output truncated at 100000 characters. @@This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[935]new_trunk/openstamanager

From: <lo...@us...> - 2014-07-10 18:04:36

Revision: 935 http://sourceforge.net/p/openstamanager/code/935Author: loviuzDate: 2014-07-10 18:04:33 +0000 (Thu, 10 Jul 2014)Log Message:-----------[CORE]aggiunta gestione inclusione plugins moduli[ANAGRAFICHE]iniziata inclusione pluginsModified Paths:-------------- new_trunk/openstamanager/editor.php new_trunk/openstamanager/index.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/share/themes/default/css/style.cssAdded Paths:----------- new_trunk/openstamanager/modules/anagrafiche/plugins/ new_trunk/openstamanager/modules/anagrafiche/plugins/statistiche.phpModified: new_trunk/openstamanager/editor.php===================================================================--- new_trunk/openstamanager/editor.php2014-07-10 16:13:11 UTC (rev 934)+++ new_trunk/openstamanager/editor.php2014-07-10 18:04:33 UTC (rev 935)@@ -78,8 +78,37 @@ } +//Lettura eventuali plugins modulo da inserire come tab+echo "<div>\n";+echo "<ul class=\"nav nav-pills\" role=\"tablist\">\n";+echo "<li class='active'>\n";+echo "<a href='#tab_1'>"._("Generale")."</a>\n";+echo "</li>\n";++$rsp = $dbo->fetchArray("SELECT *, (SELECT module_dir FROM zz_modules WHERE id=idmodule_from) AS module_dir FROM zz_modules_plugins WHERE idmodule_to=\"".$id_module."\" AND position=\"tab\"");+for( $p=0; $p<sizeof($rsp); $p++ ){+echo "<li>\n";+echo "<a href='#tab_".($p+2)."'>".$rsp[$p]['name']."</a>\n";+echo "</li>\n";+}++echo "</ul>\n";++echo "<div class='tab-content'>\n";+echo "<div id='tab_1' class='tab-pane active'>\n"; eval( ' ?>'.$template.'<?php ' );+echo "</div>\n"; +for( $p=0; $p<sizeof($rsp); $p++ ){+echo "<div id='tab_".($p+2)."' class='tab-pane'>\n";+include( $docroot."/modules/".$rsp[$p]['module_dir']."/plugins/".$rsp[$p]['script'] );+echo "</div>\n";+}++echo "</div>\n";+echo "</div>\n";++ Modified: new_trunk/openstamanager/index.php===================================================================--- new_trunk/openstamanager/index.php2014-07-10 16:13:11 UTC (rev 934)+++ new_trunk/openstamanager/index.php2014-07-10 18:04:33 UTC (rev 935)@@ -42,11 +42,11 @@ $rs = $dbo->fetchArray( $query ); if( sizeof($rs) <= 0 ){-array_push( $errors, _("Autenticazione fallita!") );+array_push( $_SESSION['errors'], _("Autenticazione fallita!") ); } else if( $rs[0]['enabled']==0 ){-array_push( $errors, _("Utente non abilitato!") );+array_push( $_SESSION['errors'], _("Utente non abilitato!") ); } else{@@ -78,7 +78,7 @@ $rs = $dbo->fetchArray($q); if( sizeof($rs) <= 0 && !$_SESSION['is_admin'] ){-array_push( $errors, _("L'utente non ha nessun permesso impostato!") );+array_push( $_SESSION['errors'], _("L'utente non ha nessun permesso impostato!") ); } else if( $rs[0]['link'] != '#' ){@@ -146,26 +146,26 @@ <form action="?op=login" method="post"> <div class="body bg-gray">+ <?php+ show_messages( $_SESSION['infos'], 'alert-success' );+show_messages( $_SESSION['errors'], 'alert-danger' );+unset( $_SESSION['infos'] );+unset( $_SESSION['errors'] );+?> <div class="form-group input-group"> <span class="input-group-addon"><i class="fa fa-user"></i> </span>- <input type="text" name="username" class="form-control" placeholder="<?php echo _("Nome utente") ?>"/>+ <input type="text" name="username" class="form-control" placeholder="<?php echo _("Nome utente") ?>"> </div> <div class="form-group input-group"> <span class="input-group-addon"><i class="fa fa-lock"></i> </span>- <input type="password" name="password" class="form-control" placeholder="<?php echo _("Password") ?>"/>+ <input type="password" name="password" class="form-control" placeholder="<?php echo _("Password") ?>"> </div> <div class="form-group"> <input type="checkbox" name="remember_me"/> <?php echo _("Mantieni attiva la sessione") ?> </div> </div> <div class="footer"> - <button type="submit" class="btn btn-warning btn-block"><?php echo _("Accedi") ?></button> - <br>- <?php- show_messages( $ok, 'alert-success' );-show_messages( $warning, 'alert-warning' );-show_messages( $errors, 'alert-danger' );-?>+ <button type="submit" class="btn btn-danger btn-block"><?php echo _("Accedi") ?></button> </div> </form> </div>Modified: new_trunk/openstamanager/lib/jscripts/functionsjs.php===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-10 16:13:11 UTC (rev 934)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-10 18:04:33 UTC (rev 935)@@ -16,7 +16,12 @@ $('.date-picker').datepicker(); +$('.nav-pills a').click(function (e) {+e.preventDefault();+$(this).tab('show');+}) + //Input mask $(".date-mask").inputmask( "dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"} ); $("[data-mask]").inputmask();@@ -64,7 +69,7 @@ /*-Open submenu on mouseover+Open submenu on click */ $('.sidebar-menu > li.treeview i.fa-angle-left').click( function(e){ e.preventDefault();Added: new_trunk/openstamanager/modules/anagrafiche/plugins/statistiche.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/plugins/statistiche.php (rev 0)+++ new_trunk/openstamanager/modules/anagrafiche/plugins/statistiche.php2014-07-10 18:04:33 UTC (rev 935)@@ -0,0 +1,152 @@+<h3>Interventi</h3>+<?php+$rsi = $dbo->fetchArray("SELECT data, ragione_sociale, (SELECT SUM(prezzo_ore_consuntivo+prezzo_km_consuntivo+prezzo_dirittochiamata) FROM in_interventi_tecnici WHERE idintervento=in_interventi.idintervento) AS totale FROM in_interventi INNER JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica WHERE in_interventi.idanagrafica=\"".$idanagrafica."\"");++$totale_interventi = 0;+$data_start = date("Ymd");+$search_datastart = date("d/m/Y");++for( $i=0; $i<sizeof($rsi); $i++ ){+$totale_interventi += $rsi[$i]['totale'];++//Calcolo data più bassa per la ricerca+if( date("Ymd", strtotime($rsi[$i]['data'])) < $data_start ){+$data_start = date("Ymd", strtotime($rsi[$i]['data']));+$search_datastart = date("d/m/Y", strtotime($rsi[$i]['data']));+}+}++if( sizeof($rsi) > 0 ){+echo "Svolti <b>".sizeof($rsi)." interventi</b> per un totale di ".number_format( $totale_interventi, 2, ",", "." )." &euro;<br/>\n";+echo "<a href='".$rootdir."/modules/interventi/interventi.php?search_ragione_sociale=".$rsi[0]['ragione_sociale']."&search_datastart=".$search_datastart."'>Visualizza tutti &raquo;</a><br/>\n";+}++else{+echo "Nessun intervento.<br/>\n";+}+?>+<br/>++++<h3>Preventivi</h3>+<?php+$rsi = $dbo->fetchArray("SELECT data_accettazione AS data, ragione_sociale, budget FROM co_preventivi INNER JOIN an_anagrafiche ON co_preventivi.idanagrafica=an_anagrafiche.idanagrafica WHERE co_preventivi.idanagrafica=\"".$idanagrafica."\"");++$totale_preventivi = 0;+$data_start = date("Ymd");+$search_datastart = date("d/m/Y");++for( $i=0; $i<sizeof($rsi); $i++ ){+$totale_preventivi += $rsi[$i]['budget'];++//Calcolo data più bassa per la ricerca+if( date("Ymd", strtotime($rsi[$i]['data'])) < $data_start ){+$data_start = date("Ymd", strtotime($rsi[$i]['data']));+$search_datastart = date("d/m/Y", strtotime($rsi[$i]['data']));+}+}++if( sizeof($rsi) > 0 ){+echo "Lavorato per <b>".sizeof($rsi)." preventivi</b> per un totale di ".number_format( $totale_preventivi, 2, ",", "." )." &euro;<br/>\n";+echo "<a href='".$rootdir."/modules/contabilita/preventivi/preventivi.php?search_ragione_sociale=".$rsi[0]['ragione_sociale']."&search_datastart=".$search_datastart."'>Visualizza tutti &raquo;</a><br/>\n";+}++else{+echo "Nessun preventivo.<br/>\n";+}+?>+<br/>++++<h3>Contratti</h3>+<?php+$rsi = $dbo->fetchArray("SELECT data_accettazione AS data, ragione_sociale, budget FROM co_contratti INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica WHERE co_contratti.idanagrafica=\"".$idanagrafica."\"");++$totale_contratti = 0;+$data_start = date("Ymd");+$search_datastart = date("d/m/Y");++for( $i=0; $i<sizeof($rsi); $i++ ){+$totale_contratti += $rsi[$i]['budget'];++//Calcolo data più bassa per la ricerca+if( date("Ymd", strtotime($rsi[$i]['data'])) < $data_start ){+$data_start = date("Ymd", strtotime($rsi[$i]['data']));+$search_datastart = date("d/m/Y", strtotime($rsi[$i]['data']));+}+}++if( sizeof($rsi) > 0 ){+echo "Lavorato per <b>".sizeof($rsi)." contratti</b> per un totale di ".number_format( $totale_contratti, 2, ",", "." )." &euro;<br/>\n";+echo "<a href='".$rootdir."/modules/contabilita/contratti/contratti.php?search_ragione_sociale=".$rsi[0]['ragione_sociale']."&search_datastart=".$search_datastart."'>Visualizza tutti &raquo;</a><br/>\n";+}++else{+echo "Nessun contratto.<br/>\n";+}+?>+<br/>+++++<h3>Fatture</h3>+<?php+//Fatture di vendita+$rsi = $dbo->fetchArray("SELECT data, ragione_sociale, (SELECT SUM(subtotale+iva) FROM co_righe_documenti WHERE iddocumento=co_documenti.id) AS totale FROM co_documenti INNER JOIN an_anagrafiche ON co_documenti.idanagrafica=an_anagrafiche.idanagrafica WHERE idtipodocumento IN(SELECT id FROM co_tipidocumento WHERE dir='entrata') AND co_documenti.idanagrafica=\"".$idanagrafica."\"");++$totale_fatture_vendita = 0;+$data_start = date("Ymd");+$search_datastart = date("d/m/Y");++for( $i=0; $i<sizeof($rsi); $i++ ){+$totale_fatture_vendita += $rsi[$i]['totale'];++//Calcolo data più bassa per la ricerca+if( date("Ymd", strtotime($rsi[$i]['data'])) < $data_start ){+$data_start = date("Ymd", strtotime($rsi[$i]['data']));+$search_datastart = date("d/m/Y", strtotime($rsi[$i]['data']));+}+}++if( sizeof($rsi) > 0 ){+echo "Emesse <b>".sizeof($rsi)." fatture di vendita</b> per un totale di ".number_format( $totale_fatture_vendita, 2, ",", "." )." &euro;<br/>\n";+echo "<a href='".$rootdir."/modules/contabilita/documenti/documenti.php?dir=entrata&search_ragione_sociale=".$rsi[0]['ragione_sociale']."&search_datastart=".$search_datastart."'>Visualizza fatture di vendita &raquo;</a><br/><br/>\n";+}++else{+echo "Nessuna fattura di vendita.<br/><br/>\n";+}++++//Fatture di acquisto+$rsi = $dbo->fetchArray("SELECT data, ragione_sociale, (SELECT SUM(subtotale+iva) FROM co_righe_documenti WHERE iddocumento=co_documenti.id) AS totale FROM co_documenti INNER JOIN an_anagrafiche ON co_documenti.idanagrafica=an_anagrafiche.idanagrafica WHERE idtipodocumento IN(SELECT id FROM co_tipidocumento WHERE dir='uscita') AND co_documenti.idanagrafica=\"".$idanagrafica."\"");++$totale_fatture_acquisto = 0;+$data_start = date("Ymd");+$search_datastart = date("d/m/Y");++for( $i=0; $i<sizeof($rsi); $i++ ){+$totale_fatture_acquisto += $rsi[$i]['totale'];++//Calcolo data più bassa per la ricerca+if( date("Ymd", strtotime($rsi[$i]['data'])) < $data_start ){+$data_start = date("Ymd", strtotime($rsi[$i]['data']));+$search_datastart = date("d/m/Y", strtotime($rsi[$i]['data']));+}+}++if( sizeof($rsi) > 0 ){+echo "Registrate <b>".sizeof($rsi)." fatture di acquisto</b> per un totale di ".number_format( $totale_fatture_acquisto, 2, ",", "." )." &euro;<br/>\n";+echo "<a href='".$rootdir."/modules/contabilita/documenti/documenti.php?dir=uscita&search_ragione_sociale=".$rsi[0]['ragione_sociale']."&search_datastart=".$search_datastart."'>Visualizza fatture di acquisto &raquo;</a><br/>\n";+}++else{+echo "Nessuna fattura di acquisto.<br/>\n";+}+?>++Property changes on: new_trunk/openstamanager/modules/anagrafiche/plugins/statistiche.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyModified: new_trunk/openstamanager/share/themes/default/css/style.css===================================================================--- new_trunk/openstamanager/share/themes/default/css/style.css2014-07-10 16:13:11 UTC (rev 934)+++ new_trunk/openstamanager/share/themes/default/css/style.css2014-07-10 18:04:33 UTC (rev 935)@@ -96,3 +96,7 @@ #supersearch{ color:#eee; } +.panel-primary > .panel-heading {+ border-bottom: 2px solid #57a;+}+This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[936]new_trunk/openstamanager

From: <lo...@us...> - 2014-07-18 08:21:09

Revision: 936 http://sourceforge.net/p/openstamanager/code/936Author: loviuzDate: 2014-07-18 08:21:06 +0000 (Fri, 18 Jul 2014)Log Message:-----------[CORE]aggiornamenti alcuni stiliModified Paths:-------------- new_trunk/openstamanager/lib/photo.class.php new_trunk/openstamanager/share/themes/default/css/AdminLTE.cssModified: new_trunk/openstamanager/lib/photo.class.php===================================================================--- new_trunk/openstamanager/lib/photo.class.php2014-07-10 18:04:33 UTC (rev 935)+++ new_trunk/openstamanager/lib/photo.class.php2014-07-18 08:21:06 UTC (rev 936)@@ -1,255 +1,255 @@-<?php -/*-By Joyce Johnston-http://www.uncontentio.us-April 18, 2009-http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/-*/-class Photo {- - private $tmp_name;- private $name;- private $error;- private $max_size = 500000;- private $accepted_mime_types = array('image/jpeg','image/png','image/gif');- private $tmp;- private $src;- private $directory;- private $src_x;- private $src_y;- private $dst_x;- private $dst_y;- private $orig_width;- private $orig_height;- private $src_width;- private $src_height;- private $dst_width;- private $dst_height;- - function __construct($file_info, $max_size='') {- - $this->tmp_name = $file_info['tmp_name'];- $this->name = $file_info['name'];- $this->size = $file_info['size'];- $this->error = $file_info['error'];- $info = getimagesize($this->tmp_name);- $this->mime = $info['mime'];- $this->orig_width = $info[0];- $this->orig_height = $info[1];- if($max_size != '') { $this->max_size = $max_size; }- - }- - function validate() {- - $errors = array();- if(!isset($error) || $this->error == 0 ) {- if (!in_array($this->mime,$this->accepted_mime_types)) {- $errors[] = 'Hold it! You may upload files of type .jpg, .jpeg, .gif, or .png. What you tried to upload was something else.'; - }- if($photo->size > $photo->max_size) {- $errors[] = 'Whoa! Your photo is too big. File size cannot exceed '.($this->max_size/1000).'KB.'; - }- }- else {- $errors[] = "There was a problem uploading your photo. - It may be that your photo is too big or that - something bad happened during upload. If your photo is less - than ".($this->max_size/1000)." in size, please try again.";- }- return $errors;- }- - function getFileType() {- return $this->mime;- }- - function getWidth() {- return $this->orig_width; - }- - function getHeight() {- return $this->orig_height; - }- - function getDimensionRatio() {- return $this->orig_width/$this->orig_height; - }- - public function doResize($max_dimension,$directory) {- - $errors = array();- $this->setDimensions($max_dimension);- $success = $this->resize($directory);- if(!$success) { $errors[] = 'Sorry! I couldn\'t resize your photo. Please try again later.'; }- return $errors; - }- - public function doThumb($thumb_size,$directory) {- - $errors = array();- $this->setThumbDimensions($thumb_size);- $success = $this->resize($directory);- if(!$success) { $errors[] = 'Sorry! I couldn\'t make a thumbnail for your image. Please try again later.'; }- return $errors;- }- - public function doCenterCrop($x,$y,$directory='') {- - $errors = array();- $success = $this->setCenterCropDimensions($x,$y);- $success = $success && $this->resize($directory);- if(!$success) { $errors[] = 'Sorry! I couldn\'t crop your image. Check your image dimensions.- If it is less than '.$x.'px by '.$y.'px, it is too small to crop.'; }- return $errors;- }- - public function doFullCrop($x,$y,$width,$height,$directory='') {- - $errors = array();- $success = $this->setFullCropDimensions($x,$y,$width,$height);- $success = $success && $this->resize($directory);- if(!$success) { $errors[] = 'Sorry! I couldn\'t crop your image. Check your image dimensions.- If it is less than '.$x.'px by '.$y.'px, it is too small to crop.'; }- return $errors;- }- - - public function move($directory) {- $errors = array();- $success = @move_uploaded_file($this->tmp_name, $directory.$this->name); - if(!$success) { $errors[] = 'Sorry! I couldn\'t store your image. Please try again later.'; }- return $errors;- }- - private function setDimensions($max_dimension) {- if($this->getDimensionRatio() > 1) {- //our image is wider than it is tall- $this->dst_width = $max_dimension;- $this->dst_height=($this->orig_height/$this->orig_width)*$this->dst_width;- }- else {- $this->dst_height = $max_dimension;- $this->dst_width = ($this->orig_width*$this->dst_height)/$this->orig_height;- - }- $this->src_width = $this->orig_width;- $this->src_height = $this->orig_height;- $this->src_x = 0;- $this->src_y = 0;- $this->dst_x = 0;- $this->dst_y = 0; - }- - private function setThumbDimensions($thumb_size) {- - //find the larger dimension, height or width- if($this->getDimensionRatio() > 1) {- //our src image is wider than it is tall - $this->src_x = 0 + (($this->orig_width-$this->orig_height)/2);- $this->src_y = 0;- $this->src_width = $this->orig_height;- $this->src_height = $this->orig_height;- - }- else {- $this->src_x = 0;- $this->src_y = 0 + (($this->orig_height-$this->orig_width)/2);- $this->src_height = $this->orig_width;- $this->src_width = $this->orig_width;- }- $this->dst_width = $thumb_size;- $this->dst_height = $thumb_size;- $this->dst_x = 0;- $this->dst_y = 0;- - }- - private function setCenterCropDimensions($x,$y) {- - //if the image is smaller than crop size- //if($this->orig_width < $x || $this->orig_height < $y) {- // return false;- // exit;- //}- //we're always going to crop from center- $this->src_x = 0 + (($this->orig_width-$x)/2);- $this->src_y = 0 + (($this->orig_height-$y)/2);- $this->dst_x = 0;- $this->dst_y = 0;- $this->dst_width = $x;- $this->dst_height = $y;- $this->src_width = $x;- $this->src_height = $y;- return true;- }- - private function setFullCropDimensions($x,$y,$width,$height) {- - $this->src_x = $x;- $this->src_y = $y;- $this->dst_x = 0;- $this->dst_y = 0;- $this->dst_width = $width;- $this->dst_height = $height;- $this->src_width = $width;- $this->src_height = $height;- return true;- }- - private function resize($directory) {- - - // create an Image to resize- //$this->src = imagecreatefromjpeg($this->tmp_name);- $this->createImage();- - // get all of the sizes- $width=$this->src_width;- $height=$this->src_height;- $newheight=$this->dst_height;- $newwidth=$this->dst_width;- $src_x = $this->src_x;- $src_y = $this->src_y;- $this->tmp= @imagecreatetruecolor($newwidth,$newheight);- $whiteimg = @imagecreatetruecolor($newwidth,$newheight);- - $white = imagecolorallocate($whiteimg, 255, 255, 255); - - //Make the background white- imagefill($this->tmp, 0, 0, $white); -- // resize image- - $success = @imagecopyresampled($this->tmp,$this->src,0,0,$src_x,$src_y,$newwidth,$newheight,$width,$height);- - // write the resized image to disk. - $filename = $directory.$this->name;- $success = @imagejpeg($this->tmp,$filename, 90);- // clean up- imagedestroy($this->src);- imagedestroy($this->tmp); - return $success;- }- - - - private function createImage() {- - switch ($this->mime) {- case 'image/jpeg':- $this->src = @imagecreatefromjpeg($this->tmp_name);- break;- case 'image/gif':- $this->src = @imagecreatefromgif($this->tmp_name);- break;- case 'image/png':- $this->src = @imagecreatefrompng($this->tmp_name);- break;- }- - }- - -}-?>+<?php +/*+By Joyce Johnston+http://www.uncontentio.us+April 18, 2009+http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/+*/+class Photo {+ + private $tmp_name;+ private $name;+ private $error;+ private $max_size = 500000;+ private $accepted_mime_types = array('image/jpeg','image/png','image/gif');+ private $tmp;+ private $src;+ private $directory;+ private $src_x;+ private $src_y;+ private $dst_x;+ private $dst_y;+ private $orig_width;+ private $orig_height;+ private $src_width;+ private $src_height;+ private $dst_width;+ private $dst_height;+ + function __construct($file_info, $max_size='') {+ + $this->tmp_name = $file_info['tmp_name'];+ $this->name = $file_info['name'];+ $this->size = $file_info['size'];+ $this->error = $file_info['error'];+ $info = getimagesize($this->tmp_name);+ $this->mime = $info['mime'];+ $this->orig_width = $info[0];+ $this->orig_height = $info[1];+ if($max_size != '') { $this->max_size = $max_size; }+ + }+ + function validate() {+ + $errors = array();+ if(!isset($error) || $this->error == 0 ) {+ if (!in_array($this->mime,$this->accepted_mime_types)) {+ $errors[] = 'Hold it! You may upload files of type .jpg, .jpeg, .gif, or .png. What you tried to upload was something else.'; + }+ if($photo->size > $photo->max_size) {+ $errors[] = 'Whoa! Your photo is too big. File size cannot exceed '.($this->max_size/1000).'KB.'; + }+ }+ else {+ $errors[] = "There was a problem uploading your photo. + It may be that your photo is too big or that + something bad happened during upload. If your photo is less + than ".($this->max_size/1000)." in size, please try again.";+ }+ return $errors;+ }+ + function getFileType() {+ return $this->mime;+ }+ + function getWidth() {+ return $this->orig_width; + }+ + function getHeight() {+ return $this->orig_height; + }+ + function getDimensionRatio() {+ return $this->orig_width/$this->orig_height; + }+ + public function doResize($max_dimension,$directory) {+ + $errors = array();+ $this->setDimensions($max_dimension);+ $success = $this->resize($directory);+ if(!$success) { $errors[] = 'Sorry! I couldn\'t resize your photo. Please try again later.'; }+ return $errors; + }+ + public function doThumb($thumb_size,$directory) {+ + $errors = array();+ $this->setThumbDimensions($thumb_size);+ $success = $this->resize($directory);+ if(!$success) { $errors[] = 'Sorry! I couldn\'t make a thumbnail for your image. Please try again later.'; }+ return $errors;+ }+ + public function doCenterCrop($x,$y,$directory='') {+ + $errors = array();+ $success = $this->setCenterCropDimensions($x,$y);+ $success = $success && $this->resize($directory);+ if(!$success) { $errors[] = 'Sorry! I couldn\'t crop your image. Check your image dimensions.+ If it is less than '.$x.'px by '.$y.'px, it is too small to crop.'; }+ return $errors;+ }+ + public function doFullCrop($x,$y,$width,$height,$directory='') {+ + $errors = array();+ $success = $this->setFullCropDimensions($x,$y,$width,$height);+ $success = $success && $this->resize($directory);+ if(!$success) { $errors[] = 'Sorry! I couldn\'t crop your image. Check your image dimensions.+ If it is less than '.$x.'px by '.$y.'px, it is too small to crop.'; }+ return $errors;+ }+ + + public function move($directory) {+ $errors = array();+ $success = @move_uploaded_file($this->tmp_name, $directory.$this->name); + if(!$success) { $errors[] = 'Sorry! I couldn\'t store your image. Please try again later.'; }+ return $errors;+ }+ + private function setDimensions($max_dimension) {+ if($this->getDimensionRatio() > 1) {+ //our image is wider than it is tall+ $this->dst_width = $max_dimension;+ $this->dst_height=($this->orig_height/$this->orig_width)*$this->dst_width;+ }+ else {+ $this->dst_height = $max_dimension;+ $this->dst_width = ($this->orig_width*$this->dst_height)/$this->orig_height;+ + }+ $this->src_width = $this->orig_width;+ $this->src_height = $this->orig_height;+ $this->src_x = 0;+ $this->src_y = 0;+ $this->dst_x = 0;+ $this->dst_y = 0; + }+ + private function setThumbDimensions($thumb_size) {+ + //find the larger dimension, height or width+ if($this->getDimensionRatio() > 1) {+ //our src image is wider than it is tall + $this->src_x = 0 + (($this->orig_width-$this->orig_height)/2);+ $this->src_y = 0;+ $this->src_width = $this->orig_height;+ $this->src_height = $this->orig_height;+ + }+ else {+ $this->src_x = 0;+ $this->src_y = 0 + (($this->orig_height-$this->orig_width)/2);+ $this->src_height = $this->orig_width;+ $this->src_width = $this->orig_width;+ }+ $this->dst_width = $thumb_size;+ $this->dst_height = $thumb_size;+ $this->dst_x = 0;+ $this->dst_y = 0;+ + }+ + private function setCenterCropDimensions($x,$y) {+ + //if the image is smaller than crop size+ //if($this->orig_width < $x || $this->orig_height < $y) {+ // return false;+ // exit;+ //}+ //we're always going to crop from center+ $this->src_x = 0 + (($this->orig_width-$x)/2);+ $this->src_y = 0 + (($this->orig_height-$y)/2);+ $this->dst_x = 0;+ $this->dst_y = 0;+ $this->dst_width = $x;+ $this->dst_height = $y;+ $this->src_width = $x;+ $this->src_height = $y;+ return true;+ }+ + private function setFullCropDimensions($x,$y,$width,$height) {+ + $this->src_x = $x;+ $this->src_y = $y;+ $this->dst_x = 0;+ $this->dst_y = 0;+ $this->dst_width = $width;+ $this->dst_height = $height;+ $this->src_width = $width;+ $this->src_height = $height;+ return true;+ }+ + private function resize($directory) {+ + + // create an Image to resize+ //$this->src = imagecreatefromjpeg($this->tmp_name);+ $this->createImage();+ + // get all of the sizes+ $width=$this->src_width;+ $height=$this->src_height;+ $newheight=$this->dst_height;+ $newwidth=$this->dst_width;+ $src_x = $this->src_x;+ $src_y = $this->src_y;+ $this->tmp= @imagecreatetruecolor($newwidth,$newheight);+ $whiteimg = @imagecreatetruecolor($newwidth,$newheight);+ + $white = imagecolorallocate($whiteimg, 255, 255, 255); + + //Make the background white+ imagefill($this->tmp, 0, 0, $white); ++ // resize image+ + $success = @imagecopyresampled($this->tmp,$this->src,0,0,$src_x,$src_y,$newwidth,$newheight,$width,$height);+ + // write the resized image to disk. + $filename = $directory.$this->name;+ $success = @imagejpeg($this->tmp,$filename, 90);+ // clean up+ imagedestroy($this->src);+ imagedestroy($this->tmp); + return $success;+ }+ + + + private function createImage() {+ + switch ($this->mime) {+ case 'image/jpeg':+ $this->src = @imagecreatefromjpeg($this->tmp_name);+ break;+ case 'image/gif':+ $this->src = @imagecreatefromgif($this->tmp_name);+ break;+ case 'image/png':+ $this->src = @imagecreatefrompng($this->tmp_name);+ break;+ }+ + }+ + +}+?>Modified: new_trunk/openstamanager/share/themes/default/css/AdminLTE.css===================================================================--- new_trunk/openstamanager/share/themes/default/css/AdminLTE.css2014-07-10 18:04:33 UTC (rev 935)+++ new_trunk/openstamanager/share/themes/default/css/AdminLTE.css2014-07-18 08:21:06 UTC (rev 936)@@ -2303,7 +2303,7 @@ border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0;- background: #e24d1e;+ background: #333; box-shadow: inset 0px -3px 0px rgba(0, 0, 0, 0.2); padding: 20px 10px; text-align: center;This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[937]new_trunk/openstamanager

From: <lo...@us...> - 2014-07-18 15:18:10

Revision: 937 http://sourceforge.net/p/openstamanager/code/937Author: loviuzDate: 2014-07-18 15:18:06 +0000 (Fri, 18 Jul 2014)Log Message:-----------[CORE]predisposti moduli per la visualizzazione dei vari plugin all'interno di ogni record[ANAGRAFICHE]adeguati plugin moduloModified Paths:-------------- new_trunk/openstamanager/editor.php new_trunk/openstamanager/include/bottom.php new_trunk/openstamanager/lib/htmlbuilder.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/modules/anagrafiche/plugins/statistiche.phpAdded Paths:----------- new_trunk/openstamanager/lib/jscripts/jquery/jquery.form.js new_trunk/openstamanager/modules/anagrafiche/plugins/add_referente.php new_trunk/openstamanager/modules/anagrafiche/plugins/add_sede.php new_trunk/openstamanager/modules/anagrafiche/plugins/ajax_referente.php new_trunk/openstamanager/modules/anagrafiche/plugins/ajax_sedi.php new_trunk/openstamanager/modules/anagrafiche/plugins/update_referente.php new_trunk/openstamanager/modules/anagrafiche/plugins/update_sedi.php new_trunk/openstamanager/modules/marketing/ new_trunk/openstamanager/modules/marketing/plugins/ new_trunk/openstamanager/modules/marketing/plugins/add_attivita.php new_trunk/openstamanager/modules/marketing/plugins/add_email.php new_trunk/openstamanager/modules/marketing/plugins/ajax_attivita.php new_trunk/openstamanager/modules/marketing/plugins/ajax_email.php new_trunk/openstamanager/modules/marketing/plugins/email_testo.php new_trunk/openstamanager/modules/marketing/plugins/firmaemail.htm new_trunk/openstamanager/modules/marketing/plugins/form_attivita.php new_trunk/openstamanager/modules/marketing/plugins/form_email.php new_trunk/openstamanager/modules/marketing/plugins/send_email.php new_trunk/openstamanager/modules/marketing/plugins/update_attivita.php new_trunk/openstamanager/modules/my_impianti/ new_trunk/openstamanager/modules/my_impianti/plugins/ new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.anagrafiche.php new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.interventi.phpModified: new_trunk/openstamanager/editor.php===================================================================--- new_trunk/openstamanager/editor.php2014-07-18 08:21:06 UTC (rev 936)+++ new_trunk/openstamanager/editor.php2014-07-18 15:18:06 UTC (rev 937)@@ -79,16 +79,16 @@ //Lettura eventuali plugins modulo da inserire come tab-echo "<div>\n";-echo "<ul class=\"nav nav-pills\" role=\"tablist\">\n";-echo "<li class='active'>\n";-echo "<a href='#tab_1'>"._("Generale")."</a>\n";+echo "<div class=\"nav-tabs-custom\">\n";+echo "<ul class=\"nav nav-tabs pull-right\" role=\"tablist\">\n";+echo "<li class='pull-left active header'>\n";+echo "<a data-toggle='tab' href='#tab_1'><i class='".$modules[ $id_module ]['icon']."'></i> ".$modules[$id_module]['name']."</a>\n"; echo "</li>\n"; -$rsp = $dbo->fetchArray("SELECT *, (SELECT module_dir FROM zz_modules WHERE id=idmodule_from) AS module_dir FROM zz_modules_plugins WHERE idmodule_to=\"".$id_module."\" AND position=\"tab\"");-for( $p=0; $p<sizeof($rsp); $p++ ){+$rsplugins = $dbo->fetchArray("SELECT *, (SELECT module_dir FROM zz_modules WHERE id=idmodule_from) AS module_dir FROM zz_modules_plugins WHERE idmodule_to=\"".$id_module."\" AND position=\"tab\"");+for( $p=0; $p<sizeof($rsplugins); $p++ ){ echo "<li>\n";-echo "<a href='#tab_".($p+2)."'>".$rsp[$p]['name']."</a>\n";+echo "<a data-toggle='tab' href='#tab_".($p+2)."'>".$rsplugins[$p]['name']."</a>\n"; echo "</li>\n"; } @@ -99,9 +99,9 @@ eval( ' ?>'.$template.'<?php ' ); echo "</div>\n"; -for( $p=0; $p<sizeof($rsp); $p++ ){+for( $p=0; $p<sizeof($rsplugins); $p++ ){ echo "<div id='tab_".($p+2)."' class='tab-pane'>\n";-include( $docroot."/modules/".$rsp[$p]['module_dir']."/plugins/".$rsp[$p]['script'] );+include( $docroot."/modules/".$rsplugins[$p]['module_dir']."/plugins/".$rsplugins[$p]['script'] ); echo "</div>\n"; } Modified: new_trunk/openstamanager/include/bottom.php===================================================================--- new_trunk/openstamanager/include/bottom.php2014-07-18 08:21:06 UTC (rev 936)+++ new_trunk/openstamanager/include/bottom.php2014-07-18 15:18:06 UTC (rev 937)@@ -27,6 +27,26 @@ </div> </div> ++<div class="modal fade" id="bs-popup" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">+<!--div class="modal-dialog">+<div class="modal-content">+<div class="modal-header">+<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only"><?php echo _("Chiudi") ?></span></button>+<h4 class="modal-title">Modal title</h4>+</div>+<div class="modal-body">+A+</div>++<div class="modal-footer">+<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>+<button type="button" class="btn btn-primary">Save changes</button>+</div>+</div>+</div-->+</div>+ </body> </html><?php $dbo->close();Modified: new_trunk/openstamanager/lib/htmlbuilder.php===================================================================--- new_trunk/openstamanager/lib/htmlbuilder.php2014-07-18 08:21:06 UTC (rev 936)+++ new_trunk/openstamanager/lib/htmlbuilder.php2014-07-18 15:18:06 UTC (rev 937)@@ -128,4 +128,236 @@ return $html; }++++/**+ * Questa classe serve per costruire pezzi di html ripetitivi, in modo da non ripetere+ * porzioni di codice con copia-incolla+*/+++/**+ * Crea l'elemento <select> a partire da una query e alcuni valori+ * $querystringQuery da cui generare la scelta+ * $idnamestringid da assegnare al <select>+ * $default_valuestringValore di default in base a cui impostare una <option> come selezionata, Se non+ c'è, non la mostra come <option>+ * $unselected_labelstringStringa da visualizzare nella prima <option> quando non è selezionata+ * $condition_rwbooleanCondizione da indicare per rendere il campo un <select>. Se false, rende il campo+ un semplice campo di testo (ad esempio se i permessi sono sola lettura). Si deve+ avere anche il permesso rw del modulo+ * $otherstringAltri attributi da aggiungere al <select> (tipo eventi onchange, ecc)+ */+function html_select( $query, $idname, $default_value, $unselected_label, $other='', $condition_rw=true ){+global $dbo;+global $permessi;+global $module_name;+++$rs = $dbo->fetchArray($query);++//Verifico a cascata i permessi per scegliere se visualizzare il <select> o lo <span>+$can_edit = false;++if( $permessi[$module_name]=='rw' ){+if( $condition_rw )+$can_edit = true;+else+$can_edit = false;+}+else{+$can_edit = false;+}++++if( $can_edit ){+echo "<select name=\"".$idname."\" id=\"".$idname."\" class='form-control' $other >\n";+if( $unselected_label!='' )+echo "<option value=\"0\">".$unselected_label."</option>\n";+for( $i=0; $i<sizeof($rs); $i++ ){+( $rs[$i]['id'] == $default_value ) ? $attr='selected="true"' : $attr='';+echo "<option value=\"".$rs[$i]['id']."\" $attr>".$rs[$i]['descrizione']."</option>\n";+}+echo "</select>\n";+}++//Se non ci sono i permessi in scrittura mostro uno span+else{+//Se non c'è un valore predefinito non mostro niente...+if( $default_value == '0' ){+//echo "<span>".$rs[0]['descrizione']."</span>\n";+//echo "<input type='hidden' name=\"".$idname."\" value=\"".$rs[0]['id']."\" />\n";+echo "<input type='hidden' name=\"".$idname."\" value=\"\">\n";+}++//...altrimenti mostro come testo il valore selezionato+else{+$descrizione = '';+for( $i=0; $i<sizeof($rs); $i++ )+if( $rs[$i]['id'] == $default_value )+$descrizione = $rs[$i]['descrizione'];++echo "<span>".$descrizione."</span>\n";+echo "<input type='hidden' name=\"".$idname."\" value=\"".$default_value."\">\n";+}+}+}+++++/**+ * Funzione per generare i campi <input> di tipo testo. I nomi dei campi devono avere lo stesso nome dei campi+ di database per far funzionare correttamente l'UPDATE+ *+ *$namestringNome del campo+ * $valuestringValore del campo+ * $default_valuestringValore di default+ * $condition_rwbooleanCondizione da indicare per rendere il campo un <input>. Se false, rende il campo+ un semplice campo di testo (ad esempio se i permessi sono sola lettura). Si deve+ avere anche il permesso rw del modulo+ * $otherstringAltri attributi da aggiungere all'<input> (tipo eventi onchange, ecc)+ *+*/+function html_inputtext( $name, $title='', $value='', $default_value='', $condition_rw=true, $other='' ){+global $dbo;+global $permessi;+global $module_name;+++//Verifico a cascata i permessi per scegliere se visualizzare il <select> o lo <span>+$can_edit = false;++if( $permessi[$module_name]=='rw' ){+if( $condition_rw )+$can_edit = true;+else+$can_edit = false;+}+else{+$can_edit = false;+}++++if( $can_edit ){+if( $default_value!='' && $default_value==$value )+$attr = 'class="default_value" start_value="'.$default_value.'"';+else+$attr = '';+echo "<input type='text' name=\"".$name."\" id=\"".$name."\" title=\"".htmlentities($title)."\" value=\"".$value."\" class='form-control' $attr $other />\n";+}++//Se non ci sono i permessi in scrittura mostro uno span+else{+echo "<span>".$value."</span>\n";+echo "<input type='hidden' name=\"".$name."\" id=\"".$name."\" value=\"".$value."\">\n";+}+}+++++/**+ * Visualizza una tabella con $n_cols colonne in base alla tabella di database, mostrando solo i campi con un Comment+ * Se viene specificata anche la $query, ripete il form in base al numero di risultati della query e la popola con i record+ */+function html_table4input( $table, $n_cols, $query='', $other='' ){+global $dbo;+global $permessi;+global $module_name;++$q = "SHOW FULL COLUMNS FROM $table";+$rs = $dbo->fetchArray($q);+++//Popolamento campi+if( $query!='' ){+$rs2 = $dbo->fetchArray($query);++for( $j=0; $j<sizeof($rs2); $j++ ){+echo "<div class='row' $other>\n";++for( $i=0; $i<sizeof($rs); $i++ ){+if( $rs[$i]['Comment']!='' ){+echo "<div class='col-md-6'>\n";++//Se nel commento c'è una query di selezione, la tolgo dall'etichetta e mostro il <select> popolandolo con+//i risultati della query (es. Comment = "Zona (query=SELECT....)"+if( preg_match( "/(.+?) \{(.+?)\}/", $rs[$i]['Comment'], $m ) ){+$label = $m[1];+$query = str_replace( "query=", "", $m[2] );+}++else{+$label = $rs[$i]['Comment'];+$query = "";+}++if( $query=="" ){+html_inputtext( $rs[$i]['Field'], $rs[$i]['Comment'], $rs2[$j][ $rs[$i]['Field'] ] );+}++//Campo query, quindi mostro un select+else{+$rs3 = $dbo->fetchArray($query);++echo "<select name='".$rs[$i]['Field']."' class='form-control'>\n";+echo "<option value=''>- Seleziona un valore -</option>\n";+for( $x=0; $x<sizeof($rs3); $x++ ){+echo "<option value='".$rs3[$x]['id']."'>".$rs3[$x]['descrizione']."</option>\n";+}+echo "</select>\n";+}+echo "</div>\n";+}+}+echo "</div>\n";+}+}++//Una tabella vuota+else{+echo "<div class='row' $other>\n";++for( $i=0; $i<sizeof($rs); $i++ ){+if( $rs[$i]['Comment']!='' ){+//Se nel commento c'è una query di selezione, la tolgo dall'etichetta e mostro il <select> popolandolo con+//i risultati della query (es. Comment = "Zona (query=SELECT....)"+if( preg_match( "/(.+?) \{(.+?)\}/", $rs[$i]['Comment'], $m ) ){+$label = $m[1];+$query = str_replace( "query=", "", $m[2] );+}++else{+$label = $rs[$i]['Comment'];+$query = "";+}++echo "<div class='col-md-6'>\n";+echo "<label>".$label.":</label>\n";++if( $query=="" ){+html_inputtext( $rs[$i]['Field'], $rs[$i]['Comment'], $rs2[$j][ $rs[$i]['Field'] ] );+}++//Campo query, quindi mostro un select+else{+$rs3 = $dbo->fetchArray($query);++echo "<select name='".$rs[$i]['Field']."' class='form-control'>\n";+echo "<option value=''>- Seleziona un valore -</option>\n";+for( $x=0; $x<sizeof($rs3); $x++ ){+echo "<option value='".$rs3[$x]['id']."'>".$rs3[$x]['descrizione']."</option>\n";+}+echo "</select>\n";+}+echo "</div>\n";+}+}+echo "</div>\n";+}+} ?>Modified: new_trunk/openstamanager/lib/jscripts/functionsjs.php===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-18 08:21:06 UTC (rev 936)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-18 15:18:06 UTC (rev 937)@@ -93,20 +93,34 @@ - /*-Creo la finestra di dialogo+Crezione layout modal */-$('.thickbox').click( function(e){-e.preventDefault();-var href = $(this).attr('href');-var title = $(this).attr('title');-var content = '';+$('[data-href]').click( function(){+data_title = $(this).data('title');++$.get( $(this).data('href'), function(data, response){+if( response == 'success' ){ -ui_dialog( href, title );-} );+$('#bs-popup').html(+'<div class="modal-dialog modal-lg">' ++'<div class="modal-content">' ++'<div class="modal-header">' ++'<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only"><?php echo _("Chiudi") ?></span></button>' ++'<h4 class="modal-title">' + data_title + '</h4>' ++'</div>' ++'<div class="modal-body">' + data + '</div>'+);+}+});+}); +$('#bs-popup').on('hidden', function(){+$(this).data('modal', null);+}); ++ /* Datepicker agli elementi con classe "datepicker" */Added: new_trunk/openstamanager/lib/jscripts/jquery/jquery.form.js===================================================================--- new_trunk/openstamanager/lib/jscripts/jquery/jquery.form.js (rev 0)+++ new_trunk/openstamanager/lib/jscripts/jquery/jquery.form.js2014-07-18 15:18:06 UTC (rev 937)@@ -0,0 +1,1076 @@+/*!+ * jQuery Form Plugin+ * version: 3.09 (16-APR-2012)+ * @requires jQuery v1.3.2 or later+ *+ * Examples and documentation at: http://malsup.com/jquery/form/+ * Project repository: https://github.com/malsup/form+ * Dual licensed under the MIT and GPL licenses:+ * http://malsup.github.com/mit-license.txt+ * http://malsup.github.com/gpl-license-v2.txt+ */+/*global ActiveXObject alert */+;(function($) {+"use strict";++/*+ Usage Note:+ -----------+ Do not use both ajaxSubmit and ajaxForm on the same form. These+ functions are mutually exclusive. Use ajaxSubmit if you want+ to bind your own submit handler to the form. For example,++ $(document).ready(function() {+ $('#myForm').on('submit', function(e) {+ e.preventDefault(); // <-- important+ $(this).ajaxSubmit({+ target: '#output'+ });+ });+ });++ Use ajaxForm when you want the plugin to manage all the event binding+ for you. For example,++ $(document).ready(function() {+ $('#myForm').ajaxForm({+ target: '#output'+ });+ });+ + You can also use ajaxForm with delegation (requires jQuery v1.7+), so the+ form does not have to exist when you invoke ajaxForm:++ $('#myForm').ajaxForm({+ delegation: true,+ target: '#output'+ });+ + When using ajaxForm, the ajaxSubmit function will be invoked for you+ at the appropriate time.+*/++/**+ * Feature detection+ */+var feature = {};+feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;+feature.formdata = window.FormData !== undefined;++/**+ * ajaxSubmit() provides a mechanism for immediately submitting+ * an HTML form using AJAX.+ */+$.fn.ajaxSubmit = function(options) {+ /*jshint scripturl:true */++ // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)+ if (!this.length) {+ log('ajaxSubmit: skipping submit process - no element selected');+ return this;+ }+ + var method, action, url, $form = this;++ if (typeof options == 'function') {+ options = { success: options };+ }++ method = this.attr('method');+ action = this.attr('action');+ url = (typeof action === 'string') ? $.trim(action) : '';+ url = url || window.location.href || '';+ if (url) {+ // clean url (don't include hash vaue)+ url = (url.match(/^([^#]+)/)||[])[1];+ }++ options = $.extend(true, {+ url: url,+ success: $.ajaxSettings.success,+ type: method || 'GET',+ iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'+ }, options);++ // hook for manipulating the form data before it is extracted;+ // convenient for use with rich editors like tinyMCE or FCKEditor+ var veto = {};+ this.trigger('form-pre-serialize', [this, options, veto]);+ if (veto.veto) {+ log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');+ return this;+ }++ // provide opportunity to alter form data before it is serialized+ if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {+ log('ajaxSubmit: submit aborted via beforeSerialize callback');+ return this;+ }++ var traditional = options.traditional;+ if ( traditional === undefined ) {+ traditional = $.ajaxSettings.traditional;+ }+ + var elements = [];+ var qx, a = this.formToArray(options.semantic, elements);+ if (options.data) {+ options.extraData = options.data;+ qx = $.param(options.data, traditional);+ }++ // give pre-submit callback an opportunity to abort the submit+ if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {+ log('ajaxSubmit: submit aborted via beforeSubmit callback');+ return this;+ }++ // fire vetoable 'validate' event+ this.trigger('form-submit-validate', [a, this, options, veto]);+ if (veto.veto) {+ log('ajaxSubmit: submit vetoed via form-submit-validate trigger');+ return this;+ }++ var q = $.param(a, traditional);+ if (qx) {+ q = ( q ? (q + '&' + qx) : qx );+ } + if (options.type.toUpperCase() == 'GET') {+ options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;+ options.data = null; // data is null for 'get'+ }+ else {+ options.data = q; // data is the query string for 'post'+ }++ var callbacks = [];+ if (options.resetForm) {+ callbacks.push(function() { $form.resetForm(); });+ }+ if (options.clearForm) {+ callbacks.push(function() { $form.clearForm(options.includeHidden); });+ }++ // perform a load on the target only if dataType is not provided+ if (!options.dataType && options.target) {+ var oldSuccess = options.success || function(){};+ callbacks.push(function(data) {+ var fn = options.replaceTarget ? 'replaceWith' : 'html';+ $(options.target)[fn](data).each(oldSuccess, arguments);+ });+ }+ else if (options.success) {+ callbacks.push(options.success);+ }++ options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg+ var context = options.context || options; // jQuery 1.4+ supports scope context + for (var i=0, max=callbacks.length; i < max; i++) {+ callbacks[i].apply(context, [data, status, xhr || $form, $form]);+ }+ };++ // are there files to upload?+ var fileInputs = $('input:file:enabled[value]', this); // [value] (issue #113)+ var hasFileInputs = fileInputs.length > 0;+ var mp = 'multipart/form-data';+ var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);++ var fileAPI = feature.fileapi && feature.formdata;+ log("fileAPI :" + fileAPI);+ var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;++ // options.iframe allows user to force iframe mode+ // 06-NOV-09: now defaulting to iframe mode if file input is detected+ if (options.iframe !== false && (options.iframe || shouldUseFrame)) {+ // hack to fix Safari hang (thanks to Tim Molendijk for this)+ // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d+ if (options.closeKeepAlive) {+ $.get(options.closeKeepAlive, function() {+ fileUploadIframe(a);+ });+ }+ else {+ fileUploadIframe(a);+ }+ }+ else if ((hasFileInputs || multipart) && fileAPI) {+ fileUploadXhr(a);+ }+ else {+ $.ajax(options);+ }++ // clear element array+ for (var k=0; k < elements.length; k++)+ elements[k] = null;++ // fire 'notify' event+ this.trigger('form-submit-notify', [this, options]);+ return this;++ // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)+ function fileUploadXhr(a) {+ var formdata = new FormData();++ for (var i=0; i < a.length; i++) {+ formdata.append(a[i].name, a[i].value);+ }++ if (options.extraData) {+ for (var p in options.extraData)+ if (options.extraData.hasOwnProperty(p))+ formdata.append(p, options.extraData[p]);+ }++ options.data = null;++ var s = $.extend(true, {}, $.ajaxSettings, options, {+ contentType: false,+ processData: false,+ cache: false,+ type: 'POST'+ });+ + if (options.uploadProgress) {+ // workaround because jqXHR does not expose upload property+ s.xhr = function() {+ var xhr = jQuery.ajaxSettings.xhr();+ if (xhr.upload) {+ xhr.upload.onprogress = function(event) {+ var percent = 0;+ var position = event.loaded || event.position; /*event.position is deprecated*/+ var total = event.total;+ if (event.lengthComputable) {+ percent = Math.ceil(position / total * 100);+ }+ options.uploadProgress(event, position, total, percent);+ };+ }+ return xhr;+ };+ }++ s.data = null;+ var beforeSend = s.beforeSend;+ s.beforeSend = function(xhr, o) {+ o.data = formdata;+ if(beforeSend)+ beforeSend.call(o, xhr, options);+ };+ $.ajax(s);+ }++ // private function for handling file uploads (hat tip to YAHOO!)+ function fileUploadIframe(a) {+ var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;+ var useProp = !!$.fn.prop;++ if ($(':input[name=submit],:input[id=submit]', form).length) {+ // if there is an input with a name or id of 'submit' then we won't be+ // able to invoke the submit fn on the form (at least not x-browser)+ alert('Error: Form elements must not have name or id of "submit".');+ return;+ }+ + if (a) {+ // ensure that every serialized input is still enabled+ for (i=0; i < elements.length; i++) {+ el = $(elements[i]);+ if ( useProp )+ el.prop('disabled', false);+ else+ el.removeAttr('disabled');+ }+ }++ s = $.extend(true, {}, $.ajaxSettings, options);+ s.context = s.context || s;+ id = 'jqFormIO' + (new Date().getTime());+ if (s.iframeTarget) {+ $io = $(s.iframeTarget);+ n = $io.attr('name');+ if (!n)+ $io.attr('name', id);+ else+ id = n;+ }+ else {+ $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');+ $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });+ }+ io = $io[0];+++ xhr = { // mock object+ aborted: 0,+ responseText: null,+ responseXML: null,+ status: 0,+ statusText: 'n/a',+ getAllResponseHeaders: function() {},+ getResponseHeader: function() {},+ setRequestHeader: function() {},+ abort: function(status) {+ var e = (status === 'timeout' ? 'timeout' : 'aborted');+ log('aborting upload... ' + e);+ this.aborted = 1;+ $io.attr('src', s.iframeSrc); // abort op in progress+ xhr.error = e;+ if (s.error)+ s.error.call(s.context, xhr, e, status);+ if (g)+ $.event.trigger("ajaxError", [xhr, s, e]);+ if (s.complete)+ s.complete.call(s.context, xhr, e);+ }+ };++ g = s.global;+ // trigger ajax global events so that activity/block indicators work like normal+ if (g && 0 === $.active++) {+ $.event.trigger("ajaxStart");+ }+ if (g) {+ $.event.trigger("ajaxSend", [xhr, s]);+ }++ if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {+ if (s.global) {+ $.active--;+ }+ return;+ }+ if (xhr.aborted) {+ return;+ }++ // add submitting element to data if we know it+ sub = form.clk;+ if (sub) {+ n = sub.name;+ if (n && !sub.disabled) {+ s.extraData = s.extraData || {};+ s.extraData[n] = sub.value;+ if (sub.type == "image") {+ s.extraData[n+'.x'] = form.clk_x;+ s.extraData[n+'.y'] = form.clk_y;+ }+ }+ }+ + var CLIENT_TIMEOUT_ABORT = 1;+ var SERVER_ABORT = 2;++ function getDoc(frame) {+ var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document;+ return doc;+ }+ + // Rails CSRF hack (thanks to Yvan Barthelemy)+ var csrf_token = $('meta[name=csrf-token]').attr('content');+ var csrf_param = $('meta[name=csrf-param]').attr('content');+ if (csrf_param && csrf_token) {+ s.extraData = s.extraData || {};+ s.extraData[csrf_param] = csrf_token;+ }++ // take a breath so that pending repaints get some cpu time before the upload starts+ function doSubmit() {+ // make sure form attrs are set+ var t = $form.attr('target'), a = $form.attr('action');++ // update form attrs in IE friendly way+ form.setAttribute('target',id);+ if (!method) {+ form.setAttribute('method', 'POST');+ }+ if (a != s.url) {+ form.setAttribute('action', s.url);+ }++ // ie borks in some cases when setting encoding+ if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {+ $form.attr({+ encoding: 'multipart/form-data',+ enctype: 'multipart/form-data'+ });+ }++ // support timout+ if (s.timeout) {+ timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);+ }+ + // look for server aborts+ function checkState() {+ try {+ var state = getDoc(io).readyState;+ log('state = ' + state);+ if (state && state.toLowerCase() == 'uninitialized')+ setTimeout(checkState,50);+ }+ catch(e) {+ log('Server abort: ' , e, ' (', e.name, ')');+ cb(SERVER_ABORT);+ if (timeoutHandle)+ clearTimeout(timeoutHandle);+ timeoutHandle = undefined;+ }+ }++ // add "extra" data to form if provided in options+ var extraInputs = [];+ try {+ if (s.extraData) {+ for (var n in s.extraData) {+ if (s.extraData.hasOwnProperty(n)) {+ extraInputs.push(+ $('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n])+ .appendTo(form)[0]);+ }+ }+ }++ if (!s.iframeTarget) {+ // add iframe to doc and submit the form+ $io.appendTo('body');+ if (io.attachEvent)+ io.attachEvent('onload', cb);+ else+ io.addEventListener('load', cb, false);+ }+ setTimeout(checkState,15);+ form.submit();+ }+ finally {+ // reset attrs and remove "extra" input elements+ form.setAttribute('action',a);+ if(t) {+ form.setAttribute('target', t);+ } else {+ $form.removeAttr('target');+ }+ $(extraInputs).remove();+ }+ }++ if (s.forceSync) {+ doSubmit();+ }+ else {+ setTimeout(doSubmit, 10); // this lets dom updates render+ }++ var data, doc, domCheckCount = 50, callbackProcessed;++ function cb(e) {+ if (xhr.aborted || callbackProcessed) {+ return;+ }+ try {+ doc = getDoc(io);+ }+ catch(ex) {+ log('cannot access response document: ', ex);+ e = SERVER_ABORT;+ }+ if (e === CLIENT_TIMEOUT_ABORT && xhr) {+ xhr.abort('timeout');+ return;+ }+ else if (e == SERVER_ABORT && xhr) {+ xhr.abort('server abort');+ return;+ }++ if (!doc || doc.location.href == s.iframeSrc) {+ // response not received yet+ if (!timedOut)+ return;+ }+ if (io.detachEvent)+ io.detachEvent('onload', cb);+ else + io.removeEventListener('load', cb, false);++ var status = 'success', errMsg;+ try {+ if (timedOut) {+ throw 'timeout';+ }++ var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);+ log('isXml='+isXml);+ if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {+ if (--domCheckCount) {+ // in some browsers (Opera) the iframe DOM is not always traversable when+ // the onload callback fires, so we loop a bit to accommodate+ log('requeing onLoad callback, DOM not available');+ setTimeout(cb, 250);+ return;+ }+ // let this fall through because server response could be an empty document+ //log('Could not access iframe DOM after mutiple tries.');+ //throw 'DOMException: not available';+ }++ //log('response detected');+ var docRoot = doc.body ? doc.body : doc.documentElement;+ xhr.responseText = docRoot ? docRoot.innerHTML : null;+ xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;+ if (isXml)+ s.dataType = 'xml';+ xhr.getResponseHeader = function(header){+ var headers = {'content-type': s.dataType};+ return headers[header];+ };+ // support for XHR 'status' & 'statusText' emulation :+ if (docRoot) {+ xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;+ xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;+ }++ var dt = (s.dataType || '').toLowerCase();+ var scr = /(json|script|text)/.test(dt);+ if (scr || s.textarea) {+ // see if user embedded response in textarea+ var ta = doc.getElementsByTagName('textarea')[0];+ if (ta) {+ xhr.responseText = ta.value;+ // support for XHR 'status' & 'statusText' emulation :+ xhr.status = Number( ta.getAttribute('status') ) || xhr.status;+ xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;+ }+ else if (scr) {+ // account for browsers injecting pre around json response+ var pre = doc.getElementsByTagName('pre')[0];+ var b = doc.getElementsByTagName('body')[0];+ if (pre) {+ xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;+ }+ else if (b) {+ xhr.responseText = b.textContent ? b.textContent : b.innerText;+ }+ }+ }+ else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {+ xhr.responseXML = toXml(xhr.responseText);+ }++ try {+ data = httpData(xhr, dt, s);+ }+ catch (e) {+ status = 'parsererror';+ xhr.error = errMsg = (e || status);+ }+ }+ catch (e) {+ log('error caught: ',e);+ status = 'error';+ xhr.error = errMsg = (e || status);+ }++ if (xhr.aborted) {+ log('upload aborted');+ status = null;+ }++ if (xhr.status) { // we've set xhr.status+ status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';+ }++ // ordering of these callbacks/triggers is odd, but that's how $.ajax does it+ if (status === 'success') {+ if (s.success)+ s.success.call(s.context, data, 'success', xhr);+ if (g)+ $.event.trigger("ajaxSuccess", [xhr, s]);+ }+ else if (status) {+ if (errMsg === undefined)+ errMsg = xhr.statusText;+ if (s.error)+ s.error.call(s.context, xhr, status, errMsg);+ if (g)+ $.event.trigger("ajaxError", [xhr, s, errMsg]);+ }++ if (g)+ $.event.trigger("ajaxComplete", [xhr, s]);++ if (g && ! --$.active) {+ $.event.trigger("ajaxStop");+ }++ if (s.complete)+ s.complete.call(s.context, xhr, status);++ callbackProcessed = true;+ if (s.timeout)+ clearTimeout(timeoutHandle);++ // clean up+ setTimeout(function() {+ if (!s.iframeTarget)+ $io.remove();+ xhr.responseXML = null;+ }, 100);+ }++ var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)+ if (window.ActiveXObject) {+ doc = new ActiveXObject('Microsoft.XMLDOM');+ doc.async = 'false';+ doc.loadXML(s);+ }+ else {+ doc = (new DOMParser()).parseFromString(s, 'text/xml');+ }+ return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;+ };+ var parseJSON = $.parseJSON || function(s) {+ /*jslint evil:true */+ return window['eval']('(' + s + ')');+ };++ var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4++ var ct = xhr.getResponseHeader('content-type') || '',+ xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,+ data = xml ? xhr.responseXML : xhr.responseText;++ if (xml && data.documentElement.nodeName === 'parsererror') {+ if ($.error)+ $.error('parsererror');+ }+ if (s && s.dataFilter) {+ data = s.dataFilter(data, type);+ }+ if (typeof data === 'string') {+ if (type === 'json' || !type && ct.indexOf('json') >= 0) {+ data = parseJSON(data);+ } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {+ $.globalEval(data);+ }+ }+ return data;+ };+ }+};++/**+ * ajaxForm() provides a mechanism for fully automating form submission.+ *+ * The advantages of using this method instead of ajaxSubmit() are:+ *+ * 1: This method will include coordinates for <input type="image" /> elements (if the element+ * is used to submit the form).+ * 2. This method will include the submit element's name/value data (for the element that was+ * used to submit the form).+ * 3. This method binds the submit() method to the form for you.+ *+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely+ * passes the options argument along after properly binding events for submit elements and+ * the form itself.+ */+$.fn.ajaxForm = function(options) {+ options = options || {};+ options.delegation = options.delegation && $.isFunction($.fn.on);+ + // in jQuery 1.3+ we can fix mistakes with the ready state+ if (!options.delegation && this.length === 0) {+ var o = { s: this.selector, c: this.context };+ if (!$.isReady && o.s) {+ log('DOM not ready, queuing ajaxForm');+ $(function() {+ $(o.s,o.c).ajaxForm(options);+ });+ return this;+ }+ // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()+ log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));+ return this;+ }++ if ( options.delegation ) {+ $(document)+ .off('submit.form-plugin', this.selector, doAjaxSubmit)+ .off('click.form-plugin', this.selector, captureSubmittingElement)+ .on('submit.form-plugin', this.selector, options, doAjaxSubmit)+ .on('click.form-plugin', this.selector, options, captureSubmittingElement);+ return this;+ }++ return this.ajaxFormUnbind()+ .bind('submit.form-plugin', options, doAjaxSubmit)+ .bind('click.form-plugin', options, captureSubmittingElement);+};++// private event handlers +function doAjaxSubmit(e) {+ /*jshint validthis:true */+ var options = e.data;+ if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed+ e.preventDefault();+ $(this).ajaxSubmit(options);+ }+}+ +function captureSubmittingElement(e) {+ /*jshint validthis:true */+ var target = e.target;+ var $el = $(target);+ if (!($el.is(":submit,input:image"))) {+ // is this a child element of the submit el? (ex: a span within a button)+ var t = $el.closest(':submit');+ if (t.length === 0) {+ return;+ }+ target = t[0];+ }+ var form = this;+ form.clk = target;+ if (target.type == 'image') {+ if (e.offsetX !== undefined) {+ form.clk_x = e.offsetX;+ form.clk_y = e.offsetY;+ } else if (typeof $.fn.offset == 'function') {+ var offset = $el.offset();+ form.clk_x = e.pageX - offset.left;+ form.clk_y = e.pageY - offset.top;+ } else {+ form.clk_x = e.pageX - target.offsetLeft;+ form.clk_y = e.pageY - target.offsetTop;+ }+ }+ // clear form vars+ setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);+}+++// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm+$.fn.ajaxFormUnbind = function() {+ return this.unbind('submit.form-plugin click.form-plugin');+};++/**+ * formToArray() gathers form element data into an array of objects that can+ * be passed to any of the following ajax functions: $.get, $.post, or load.+ * Each object in the array has both a 'name' and 'value' property. An example of+ * an array for a simple login form might be:+ *+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]+ *+ * It is this array that is passed to pre-submit callback functions provided to the+ * ajaxSubmit() and ajaxForm() methods.+ */+$.fn.formToArray = function(semantic, elements) {+ var a = [];+ if (this.length === 0) {+ return a;+ }++ var form = this[0];+ var els = semantic ? form.getElementsByTagName('*') : form.elements;+ if (!els) {+ return a;+ }++ var i,j,n,v,el,max,jmax;+ for(i=0, max=els.length; i < max; i++) {+ el = els[i];+ n = el.name;+ if (!n) {+ continue;+ }++ if (semantic && form.clk && el.type == "image") {+ // handle image inputs on the fly when semantic == true+ if(!el.disabled && form.clk == el) {+ a.push({name: n, value: $(el).val(), type: el.type });+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});+ }+ continue;+ }++ v = $.fieldValue(el, true);+ if (v && v.constructor == Array) {+ if (elements) + elements.push(el);+ for(j=0, jmax=v.length; j < jmax; j++) {+ a.push({name: n, value: v[j]});+ }+ }+ else if (feature.fileapi && el.type == 'file' && !el.disabled) {+ if (elements) + elements.push(el);+ var files = el.files;+ if (files.length) {+ for (j=0; j < files.length; j++) {+ a.push({name: n, value: files[j], type: el.type});+ }+ }+ else {+ // #180+ a.push({ name: n, value: '', type: el.type });+ }+ }+ else if (v !== null && typeof v != 'undefined') {+ if (elements) + elements.push(el);+ a.push({name: n, value: v, type: el.type, required: el.required});+ }+ }++ if (!semantic && form.clk) {+ // input type=='image' are not found in elements array! handle it here+ var $input = $(form.clk), input = $input[0];+ n = input.name;+ if (n && !input.disabled && input.type == 'image') {+ a.push({name: n, value: $input.val()});+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});+ }+ }+ return a;+};++/**+ * Serializes form data into a 'submittable' string. This method will return a string+ * in the format: name1=value1&amp;name2=value2+ */+$.fn.formSerialize = function(semantic) {+ //hand off to jQuery.param for proper encoding+ return $.param(this.formToArray(semantic));+};++/**+ * Serializes all field elements in the jQuery object into a query string.+ * This method will return a string in the format: name1=value1&amp;name2=value2+ */+$.fn.fieldSerialize = function(successful) {+ var a = [];+ this.each(function() {+ var n = this.name;+ if (!n) {+ return;+ }+ var v = $.fieldValue(this, successful);+ if (v && v.constructor == Array) {+ for (var i=0,max=v.length; i < max; i++) {+ a.push({name: n, value: v[i]});+ }+ }+ else if (v !== null && typeof v != 'undefined') {+ a.push({name: this.name, value: v});+ }+ });+ //hand off to jQuery.param for proper encoding+ return $.param(a);+};++/**+ * Returns the value(s) of the element in the matched set. For example, consider the following form:+ *+ * <form><fieldset>+ * <input name="A" type="text" />+ * <input name="A" type="text" />+ * <input name="B" type="checkbox" value="B1" />+ * <input name="B" type="checkbox" value="B2"/>+ * <input name="C" type="radio" value="C1" />+ * <input name="C" type="radio" value="C2" />+ * </fieldset></form>+ *+ * var v = $(':text').fieldValue();+ * // if no values are entered into the text inputs+ * v == ['','']+ * // if values entered into the text inputs are 'foo' and 'bar'+ * v == ['foo','bar']+ *+ * var v = $(':checkbox').fieldValue();+ * // if neither checkbox is checked+ * v === undefined+ * // if both checkboxes are checked+ * v == ['B1', 'B2']+ *+ * var v = $(':radio').fieldValue();+ * // if neither radio is checked+ * v === undefined+ * // if first radio is checked+ * v == ['C1']+ *+ * The successful argument controls whether or not the field element must be 'successful'+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).+ * The default value of the successful argument is true. If this value is false the value(s)+ * for each element is returned.+ *+ * Note: This method *always* returns an array. If no valid value can be determined the+ * array will be empty, otherwise it will contain one or more values.+ */+$.fn.fieldValue = function(successful) {+ for (var val=[], i=0, max=this.length; i < max; i++) {+ var el = this[i];+ var v = $.fieldValue(el, successful);+ if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {+ continue;+ }+ if (v.constructor == Array)+ $.merge(val, v);+ else+ val.push(v);+ }+ return val;+};++/**+ * Returns the value of the field element.+ */+$.fieldValue = function(el, successful) {+ var n = el.name, t = el.type, tag = el.tagName.toLowerCase();+ if (successful === undefined) {+ successful = true;+ }++ if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||+ (t == 'checkbox' || t == 'radio') && !el.checked ||+ (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||+ tag == 'select' && el.selectedIndex == -1)) {+ return null;+ }++ if (tag == 'select') {+ var index = el.selectedIndex;+ if (index < 0) {+ return null;+ }+ var a = [], ops = el.options;+ var one = (t == 'select-one');+ var max = (one ? index+1 : ops.length);+ for(var i=(one ? index : 0); i < max; i++) {+ var op = ops[i];+ if (op.selected) {+ var v = op.value;+ if (!v) { // extra pain for IE...+ v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;+ }+ if (one) {+ return v;+ }+ a.push(v);+ }+ }+ return a;+ }+ return $(el).val();+};++/**+ * Clears the form data. Takes the following actions on the form's input fields:+ * - input text fields will have their 'value' property set to the empty string+ * - select elements will have their 'selectedIndex' property set to -1+ * - checkbox and radio inputs will have their 'checked' property set to false+ * - inputs of type submit, button, reset, and hidden will *not* be effected+ * - button elements will *not* be effected+ */+$.fn.clearForm = function(includeHidden) {+ return this.each(function() {+ $('input,select,textarea', this).clearFields(includeHidden);+ });+};++/**+ * Clears the selected form elements.+ */+$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {+ var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list+ return this.each(function() {+ var t = this.type, tag = this.tagName.toLowerCase();+ if (re.test(t) || tag == 'textarea') {+ this.value = '';+ }+ else if (t == 'checkbox' || t == 'radio') {+ this.checked = false;+ }+ else if (tag == 'select') {+ this.selectedIndex = -1;+ }+ else if (includeHidden) {+ // includeHidden can be the valud true, or it can be a selector string+ // indicating a special test; for example:+ // $('#myForm').clearForm('.special:hidden')+ // the above would clean hidden inputs that have the class of 'special'+ if ( (includeHidden === true && /hidden/.test(t)) ||+ (typeof includeHidden == 'string' && $(this).is(includeHidden)) )+ this.value = '';+ }+ });+};++/**+ * Resets the form data. Causes all form elements to be reset to their original value.+ */+$.fn.resetForm = function() {+ return this.each(function() {+ // guard against an input with the name of 'reset'+ // note that IE reports the reset function as an 'object'+ if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {+ this.reset();+ }+ });+};++/**+ * Enables or disables any matching elements.+ */+$.fn.enable = function(b) {+ if (b === undefined) {+ b = true;+ }+ return this.each(function() {+ this.disabled = !b;+ });+};++/**+ * Checks/unchecks any matching checkboxes or radio buttons and+ * selects/deselects and matching option elements.+ */+$.fn.selected = function(select) {+ if (select === undefined) {+ select = true;+ }+ return this.each(function() {+ var t = this.type;+ if (t == 'checkbox' || t == 'radio') {+ this.checked = select;+ }+ else if (this.tagName.toLowerCase() == 'option') {+ var $sel = $(this).parent('select');+ if (select && $sel[0] && $sel[0].type == 'select-one') {+ // deselect all other options+ $sel.find('option').selected(false);+ }+ this.selected = select;+ }+ });+};++// expose debug var+$.fn.ajaxSubmit.debug = false;++// helper fn for console logging+function log() {+ if (!$.fn.ajaxSubmit.debug) + return;+ var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');+ if (window.console && window.console.log) {+ window.console.log(msg);+ }+ else if (window.opera && window.opera.postError) {+ window.opera.postError(msg);+ }+}++})(jQuery);Property changes on: new_trunk/openstamanager/lib/jscripts/jquery/jquery.form.js___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/modules/anagrafiche/plugins/add_referente.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/plugins/add_referente.php (rev 0)+++ new_trunk/openstamanager/modules/anagrafiche/plugins/add_referente.php2014-07-18 15:18:06 UTC (rev 937)@@ -0,0 +1,120 @@+<?php+include_once("../../../config.inc.php");+include_once($docroot."/core.php");+include($docroot."/lib/user_check.php");++$nome_modulo = 'Anagrafiche';+include($docroot."/lib/permissions_check.php");++if( isset($_GET['id_record']) )+$id_record = $_GET['id_record'];++if ($_POST['op_referente']!="")+$op_referente = $_POST['op_referente'];+++echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".$rootdir."/lib/jscripts/bootstrap.min.js\"></script>\n";+echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".$rootdir."/lib/jscripts/jquery/jquery.js\"></script>\n";+echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".$rootdir."/lib/jscripts/jquery/jquery.form.js\"></script>\n";++if ($op_referente=='add'){+$nome = save( $_POST['nome'] );+$mansione = save( $_POST['mansione'] );+$telefono = save( $_POST['telefono'] );+$email = save( $_POST['email'] );+$idanagrafica = save( $_POST['idanagrafica'] );+$idsede = save( $_POST['idsede'] );++//Inserisco il nuovo referente+$query = "INSERT INTO an_referenti (nome, mansione, telefono, email, idanagrafica, idsede) VALUES ('$nome', '$mansione', '$telefono', '$email', '$idanagrafica', '$idsede' )";+$dbo->query($query);+}++++++echo "<form id=\"addFormReferenti\" action=\"".$rootdir."/modules/anagrafiche/plugins/add_referente.php\" method=\"post\">\n";+echo "<input type=\"hidden\" name=\"idanagrafica\" value=\"".$id_record."\">\n";+++//Inserimento nuovo referente+echo "<div class='row'>\n";+echo "<div class='col-md-6'>\n";+echo "<label>Nominativo:</label>\n";+echo "<input type=\"text\" id=\"nome\" name=\"nome\" maxlength=\"255\" class=\"form-control\" required=\"true\">\n";+echo "</div>\n";+++//Mansione+echo "<div class='col-md-6'>\n";+echo "<label>Mansione:</label>\n";+echo "<input type=\"text\" id=\"mansione\" name=\"mansione\" maxlength=\"255\" class=\"form-control\">\n";+echo "</div>\n";+++//Email+echo "<div class='col-md-6'>\n";+echo "<label>Email:</label>\n";+echo "<input type=\"email\" id=\"email\" name=\"email\" maxlength=\"255\" class=\"form-control\">\n";+echo "</div>\n";+++//Telefono+echo "<div class='col-md-6'>\n";+echo "<label>Nominativo:</label>\n";+echo "<input type=\"text\" id=\"telefono\" name=\"telefono\" maxlength=\"255\" class=\"form-control\">\n";+echo "</div>\n";+++//Sede+echo "<div class='col-md-6'>\n";+echo "<label>Sede:</label>\n";+html_select( "SELECT id, nomesede AS descrizione FROM an_sedi WHERE idanagrafica='".$id_record."'", 'idsede', '', 'Sede legale' );+echo "</div>\n";+echo "</div><br>\n";++++//Pulsante+echo "<button type='submit' class='btn btn-primary' onmouseover=\"$('#op_referente').prop('value','add');\"><i class='fa fa-plus'></i> Aggiungi</button>\n";+echo "<input type=\"hidden\" id=\"op_referente\" name=\"op_referente\" value=\"\">\n";++echo "</form>\n";+?>+++<script type="text/javascript">+$(document).ready(function() {+var options = {++beforeSubmit:function(){+if ( $('#op_referente').val()=='add' ){+var campi = new Array('nome','mansione');+var valori = new Array('Inserisci nominativo...','Inserisci mansione...');++if( !confirm('Inserire un nuovo referente ?') ){ return false; }+}++if ( $('#op_referente').val()=='reset' ){+if( !confirm('Chiudere il form referente?') ){ return false; }+}++},++success:function(){++$('#main_loading').show();++var op = $('#op_referente').prop('value');++$('#an_referenti').load('<?php echo $rootdir ?>/modules/anagrafiche/plugins/ajax_referente.php?id_record=<?php echo $id_record; ?>&operazione='+op, function(){+$('.modal').modal('hide');+$('#main_loading').hide();+});+}+}+$('#addFormReferenti').ajaxForm( options );+});+</script>+Property changes on: new_trunk/openstamanager/modules/anagrafiche/plugins/add_referente.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/modules/anagrafiche/plugins/add_sede.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/plugins/add_sede.php (rev 0)+++ new_trunk/openstamanager/modules/anagrafiche/plugins/add_sede.php2014-07-18 15:18:06 UTC (rev 937)@@ -0,0 +1,90 @@+<?php+include_once("../../../config.inc.php");+include_once($docroot."/core.php");+include($docroot."/lib/user_check.php");+$nome_modulo = 'Anagrafiche';+include($docroot."/lib/permissions_check.php");++if( isset($_GET['idanagrafica']) )+$idanagrafica = $_GET['idanagrafica'];++if ($_POST['op_sede']!="")+$op_sede = $_POST['op_sede'];++//Aggiunta nuova sede+if ($op_sede=='add'){+echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".$rootdir."/lib/jscripts/jquery/jquery.js\"></script>\n";+echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".$rootdir."/lib/jscripts/jquery/jquery.form.js\"></script>\n";++$names = array();+$values = array();+foreach( $_POST as $name=>$value ){+if( $name!='op_sede' ){+array_push( $names, $name );++if( substr($value, 0, 8)=='Inserisci' )+$value = '';+array_push( $values, "\"".save($value)."\"" );+}+}++//Inserisco la nuova sede+$query = "INSERT INTO an_sedi(".implode($names,',').") VALUES (".implode($values, ',').")";+$dbo->query($query);+array_push( $infos, "Aggiunta una nuova sede!" );+}+++++echo "<form id=\"addFormSedi\" action=\"".$rootdir."/modules/anagrafiche/plugins/add_sede.php?operazione=add\" method=\"post\">\n";+echo "<input type=\"hidden\" name=\"idanagrafica\" value=\"$idanagrafica\" />\n";+++/*+INSERIMENTO DATI NUOVA SEDE+*/+html_table4input( 'an_sedi', 2, '' );+++echo "<br>\n";+echo "<button type='submit' class='btn btn-primary' onmouseover=\"$('#op_sede').prop('value','add');\"><i class='fa fa-plus'></i> Aggiungi</button>\n";+echo "<input type=\"hidden\" id=\"op_sede\" name=\"op_sede\" value=\"add\">\n";+echo "</form>\n";+?>++<script type="text/javascript">+$(document).ready(function() {+var options = {++beforeSubmit:function(){++if ( $('#op_sede').val()=='add' ){+var campi = new Array('nomesede', 'indirizzo');+var valori = new Array('Inserisci un nome alla sede...', 'Inserisci la città della sede...');++if( confirm('Inserire una nuova sede?') ){+controlla_campi( campi, valori );+return true;+}+else{+... [truncated message content]

[osm-devel] SF.net SVN: openstamanager:[939]new_trunk/openstamanager

From: <lo...@us...> - 2014-07-18 16:45:17

Revision: 939 http://sourceforge.net/p/openstamanager/code/939Author: loviuzDate: 2014-07-18 16:45:14 +0000 (Fri, 18 Jul 2014)Log Message:-----------[CORE]aggiunta periodo di visualizzazione record con jquery.daterangepickerModified Paths:-------------- new_trunk/openstamanager/controller.php new_trunk/openstamanager/core.php new_trunk/openstamanager/include/top.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/lib/jscripts/jquery/plugins/daterangepicker/daterangepicker.js new_trunk/openstamanager/update/update_2.0.sqlModified: new_trunk/openstamanager/controller.php===================================================================--- new_trunk/openstamanager/controller.php2014-07-18 15:34:42 UTC (rev 938)+++ new_trunk/openstamanager/controller.php2014-07-18 16:45:14 UTC (rev 939)@@ -3,7 +3,13 @@ include($docroot."/config.inc.php"); include($docroot."/lib/user_check.php"); include($docroot."/include/top.php");-+?>+<form class="pull-right">+ <div class="input-group">+ <button id="daterange" class="btn btn-default"><i class="fa fa-calendar"></i> <?php echo _("Periodo di lavoro") ?> <i class="fa fa-caret-down"></i></button>+ </div>+ </form>+<?php echo "<h3><i class='".$modules[ $id_module ]['icon']."'></i> ".$modules[$id_module]['name']."</h3><hr>\n"; /**@@ -40,6 +46,9 @@ $module_options = json_decode( $module_options, true ); $module_query = $module_options['main_query'][0]['query'];+$module_query = str_replace( "|period_start|", $_SESSION['period_start'], $module_query );+$module_query = str_replace( "|period_end|", $_SESSION['period_end'], $module_query );+ $module_fields = $module_options['main_query'][0]['fields']; $fields = explode( ",", $module_fields ); Modified: new_trunk/openstamanager/core.php===================================================================--- new_trunk/openstamanager/core.php2014-07-18 15:34:42 UTC (rev 938)+++ new_trunk/openstamanager/core.php2014-07-18 16:45:14 UTC (rev 939)@@ -60,6 +60,7 @@ array_push($css_modules, $theme_path."/css/AdminLTE.css"); array_push($css_modules, $theme_path."/css/jQueryUI/jquery-ui-1.10.3.custom.min.css"); array_push($css_modules, $theme_path."/css/datatables/dataTables.bootstrap.css");+array_push($css_modules, $theme_path."/css/daterangepicker/daterangepicker-bs3.css"); array_push($css_modules, $theme_path."/css/chosen.css"); array_push($css_modules, $theme_path."/css/style.css"); @@ -70,6 +71,7 @@ array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/dataTables.bootstrap.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/chosen.jquery.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/daterangepicker//daterangepicker.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.date.extensions.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.extensions.js");@@ -79,4 +81,15 @@ $dbo = new Dbo(); $dbo->Connect();++//Imposto il periodo di visualizzazione record dal 01-01-yyy al 31-12-yyyy+if( !isset($_SESSION['period_start']) ){+$_SESSION['period_start'] = date("Y")."-01-01";+$_SESSION['period_end'] = date("Y")."-12-31";+}++if( isset($_GET['period_start']) ){+$_SESSION['period_start'] = $html->form('period_start');+$_SESSION['period_end'] = $html->form('period_end');+} ?>Modified: new_trunk/openstamanager/include/top.php===================================================================--- new_trunk/openstamanager/include/top.php2014-07-18 15:34:42 UTC (rev 938)+++ new_trunk/openstamanager/include/top.php2014-07-18 16:45:14 UTC (rev 939)@@ -82,7 +82,7 @@ </div> <div class="pull-left info"> <p><?php echo $_SESSION['username'] ?></p>- <a href="#"><i class="fa fa-circle text-success"></i> <?php echo _("online") ?></a>+ <a href="javascript:;"><i class="fa fa-circle text-success"></i> <?php echo _("online") ?></a> </div> <div class="clearfix"></div> @@ -95,6 +95,7 @@ </div> </form> <!-- /.search form -->+ <!-- sidebar menu: : style can be found in sidebar.less --> <ul class="sidebar-menu"> <?phpModified: new_trunk/openstamanager/lib/jscripts/functionsjs.php===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-18 15:34:42 UTC (rev 938)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-18 16:45:14 UTC (rev 939)@@ -15,6 +15,28 @@ $('.chzn-drop').css({'width': '100%'}); $('.date-picker').datepicker();+$('#daterange').daterangepicker(+{+ranges: {+'<?php echo _("Oggi") ?>': [moment(), moment()],+'<?php echo _("Ieri") ?>': [moment().subtract('days',1), moment().subtract('days',1)],+'<?php echo _("Ultimi 7 giorni") ?>': [moment().subtract('days', 6), moment()],+'<?php echo _("Ultimi 30 giorni") ?>': [moment().subtract('days', 29), moment()],+'<?php echo _("Questo mese") ?>': [moment().startOf('month'), moment().endOf('month')],+'<?php echo _("Mese scorso") ?>': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')],+'<?php echo _("Quest\\'anno") ?>': [moment().startOf('year'), moment().endOf('year')],+'<?php echo _("Anno scorso") ?>': [moment().subtract('year',1).startOf('year'), moment().subtract('year',1).endOf('year')]+},+startDate: '<?php echo date("d/m/Y", strtotime($_SESSION['period_start'])) ?>',+endDate: '<?php echo date("d/m/Y", strtotime($_SESSION['period_end'])) ?>',+applyClass: 'btn btn-success btn-sm',+cancelClass: 'btn btn-danger btn-sm',+},+function( start, end ){+//Submit period and refresh page+$.get( globals.rootdir+'/core.php?period_start='+start.format('YYYY-MM-DD')+'&period_end='+end.format('YYYY-MM-DD'), function(){ location.href=location.href; });+}+); $('.nav-pills a').click(function (e) { e.preventDefault();Modified: new_trunk/openstamanager/lib/jscripts/jquery/plugins/daterangepicker/daterangepicker.js===================================================================--- new_trunk/openstamanager/lib/jscripts/jquery/plugins/daterangepicker/daterangepicker.js2014-07-18 15:34:42 UTC (rev 938)+++ new_trunk/openstamanager/lib/jscripts/jquery/plugins/daterangepicker/daterangepicker.js2014-07-18 16:45:14 UTC (rev 939)@@ -39,18 +39,20 @@ this.applyClass = 'btn-success'; this.cancelClass = 'btn-default'; - this.format = 'MM/DD/YYYY';+ this.format = 'DD/MM/YYYY'; this.separator = ' - '; this.locale = {- applyLabel: 'Apply',- cancelLabel: 'Cancel',- fromLabel: 'From',- toLabel: 'To',+ applyLabel: 'Applica',+ cancelLabel: 'Annulla',+ fromLabel: 'Da',+ toLabel: 'A', weekLabel: 'W',- customRangeLabel: 'Custom Range',- daysOfWeek: moment()._lang._weekdaysMin.slice(),- monthNames: moment()._lang._monthsShort.slice(),+ customRangeLabel: 'Personalizzato',+ //daysOfWeek: moment()._lang._weekdaysMin.slice(),+ daysOfWeek: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa'],+ //monthNames: moment()._lang._monthsShort.slice(),+ monthNames: ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic'], firstDay: 0 }; Modified: new_trunk/openstamanager/update/update_2.0.sql===================================================================--- new_trunk/openstamanager/update/update_2.0.sql2014-07-18 15:34:42 UTC (rev 938)+++ new_trunk/openstamanager/update/update_2.0.sql2014-07-18 16:45:14 UTC (rev 939)@@ -27,7 +27,7 @@ UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Nome, Descrizione\",\"query\": \"SELECT `id`, `nome` AS `Nome`, `descrizione` AS `Descrizione` FROM `an_zone` ORDER BY `id`\"}]}" WHERE name='Zone'; -- Interventi-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"ID intervento, Ragione sociale, Data, _print_\",\"query\": \"SELECT `idintervento` AS `id`, `idintervento` AS `ID intervento`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`in_interventi`.`idanagrafica`) AS `Ragione sociale`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `colore` FROM `in_statiintervento` WHERE `idstatointervento`=`in_interventi`.`idstatointervento`) AS `_bg_`, 'pdfgen.php?idintervento=$id$&mode=single' AS `_print_` FROM `in_interventi` ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Interventi';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"ID intervento, Ragione sociale, Data, _print_\",\"query\": \"SELECT `idintervento` AS `id`, `idintervento` AS `ID intervento`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`in_interventi`.`idanagrafica`) AS `Ragione sociale`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `colore` FROM `in_statiintervento` WHERE `idstatointervento`=`in_interventi`.`idstatointervento`) AS `_bg_`, 'pdfgen.php?idintervento=$id$&mode=single' AS `_print_` FROM `in_interventi` WHERE `data` >= '|period_start|' AND `data` <= '|period_end|' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Interventi'; -- Tipi di intervento UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Codice, Descrizione, Costo orario, Costo al km, Diritto di chiamata, Costo orario tecnico, Costo al km tecnico, Diritto di chiamata tecnico\",\"query\": \"SELECT `idtipointervento` AS `id`, `idtipointervento` AS `Codice`, `descrizione` AS `Descrizione`, REPLACE( FORMAT(`costo_orario`,2), '.', ',' ) AS `Costo orario`, REPLACE( FORMAT(`costo_km`,2), '.', ',' ) AS `Costo al km`, REPLACE( FORMAT(`costo_diritto_chiamata`,2), '.', ',' ) AS `Diritto di chiamata`, REPLACE( FORMAT(`costo_orario_tecnico`,2), '.', ',' ) AS `Costo orario tecnico`, REPLACE( FORMAT(`costo_km_tecnico`,2), '.', ',' ) AS `Costo al km tecnico`, REPLACE( FORMAT(`costo_diritto_chiamata_tecnico`,2), '.', ',' ) AS `Diritto di chiamata tecnico` FROM `in_tipiintervento`\"}]}" WHERE name='Tipi di intervento';@@ -45,34 +45,34 @@ UPDATE `zz_modules` SET `options`="" WHERE name IN('Contabilit&agrave;', 'Magazzino'); -- Preventivi-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Nome, Cliente, icon_Stato\",\"query\": \"SELECT `id`, `numero` AS `Numero`, `nome` AS `Nome`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_preventivi`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statipreventivi` WHERE `id`=`idstato`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statipreventivi` WHERE `id`=`idstato`) AS `icon_title_Stato` FROM `co_preventivi` ORDER BY `id` DESC\"}]}" WHERE name='Preventivi';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Nome, Cliente, icon_Stato\",\"query\": \"SELECT `id`, `numero` AS `Numero`, `nome` AS `Nome`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_preventivi`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statipreventivi` WHERE `id`=`idstato`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statipreventivi` WHERE `id`=`idstato`) AS `icon_title_Stato` FROM `co_preventivi` WHERE `data_bozza` >= '|period_start|' AND `data_conclusione` <= '|period_end|' ORDER BY `id` DESC\"}]}" WHERE name='Preventivi'; -- Contratti-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Nome, Cliente, icon_Stato\",\"query\": \"SELECT `id`, `numero` AS `Numero`, `nome` AS `Nome`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_contratti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_staticontratti` WHERE `id`=`idstato`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_staticontratti` WHERE `id`=`idstato`) AS `icon_title_Stato` FROM `co_contratti` ORDER BY `id` DESC\"}]}" WHERE name='Contratti';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Nome, Cliente, icon_Stato\",\"query\": \"SELECT `id`, `numero` AS `Numero`, `nome` AS `Nome`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_contratti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_staticontratti` WHERE `id`=`idstato`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_staticontratti` WHERE `id`=`idstato`) AS `icon_title_Stato` FROM `co_contratti` WHERE `data_bozza` >= '|period_start|' AND `data_conclusione` <= '|period_end|' ORDER BY `id` DESC\"}]}" WHERE name='Contratti'; -- Ordini cliente-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `or_ordini`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`or_ordini`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_Stato`, (SELECT `descrizione` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_title_Stato` FROM `or_ordini` INNER JOIN `or_tipiordine` ON `or_ordini`.`idtipoordine`=`or_tipiordine`.`id` WHERE `dir`='entrata' ORDER BY `id` DESC\"}]}" WHERE name='Ordini cliente';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `or_ordini`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`or_ordini`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_Stato`, (SELECT `descrizione` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_title_Stato` FROM `or_ordini` INNER JOIN `or_tipiordine` ON `or_ordini`.`idtipoordine`=`or_tipiordine`.`id` WHERE `dir`='entrata' AND `data` >= '|period_start|' AND `data` <= '|period_end|' ORDER BY `id` DESC\"}]}" WHERE name='Ordini cliente'; -- Ordini fornitore-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `or_ordini`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`or_ordini`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_Stato`, (SELECT `descrizione` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_title_Stato` FROM `or_ordini` INNER JOIN `or_tipiordine` ON `or_ordini`.`idtipoordine`=`or_tipiordine`.`id` WHERE `dir`='uscita' ORDER BY `id` DESC\"}]}" WHERE name='Ordini fornitore';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `or_ordini`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`or_ordini`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_Stato`, (SELECT `descrizione` FROM `or_statiordine` WHERE `id`=`idstatoordine`) AS `icon_title_Stato` FROM `or_ordini` INNER JOIN `or_tipiordine` ON `or_ordini`.`idtipoordine`=`or_tipiordine`.`id` WHERE `dir`='uscita' `data` >= '|period_start|' AND `data` <= '|period_end|' ORDER BY `id` DESC\"}]}" WHERE name='Ordini fornitore'; -- Fatture di vendita-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `co_documenti`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_documenti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_title_Stato` FROM `co_documenti` INNER JOIN `co_tipidocumento` ON `co_documenti`.`idtipodocumento`=`co_tipidocumento`.`id` WHERE `dir`='entrata' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Fatture di vendita';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `co_documenti`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_documenti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_title_Stato` FROM `co_documenti` INNER JOIN `co_tipidocumento` ON `co_documenti`.`idtipodocumento`=`co_tipidocumento`.`id` WHERE `dir`='entrata' AND `data` >= '|period_start|' AND `data` <= '|period_end|' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Fatture di vendita'; -- Fatture di acquisto-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `co_documenti`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_documenti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_title_Stato` FROM `co_documenti` INNER JOIN `co_tipidocumento` ON `co_documenti`.`idtipodocumento`=`co_tipidocumento`.`id` WHERE `dir`='uscita' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Fatture di acquisto';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `co_documenti`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_documenti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_title_Stato` FROM `co_documenti` INNER JOIN `co_tipidocumento` ON `co_documenti`.`idtipodocumento`=`co_tipidocumento`.`id` WHERE `dir`='uscita' AND `data` >= '|period_start|' AND `data` <= '|period_end|' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Fatture di acquisto'; -- Prima nota-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `co_documenti`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_documenti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_title_Stato` FROM `co_documenti` INNER JOIN `co_tipidocumento` ON `co_documenti`.`idtipodocumento`=`co_tipidocumento`.`id` WHERE `dir`='entrata' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Prima nota';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `co_documenti`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`co_documenti`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_Stato`, (SELECT `descrizione` FROM `co_statidocumento` WHERE `id`=`idstatodocumento`) AS `icon_title_Stato` FROM `co_documenti` INNER JOIN `co_tipidocumento` ON `co_documenti`.`idtipodocumento`=`co_tipidocumento`.`id` WHERE `dir`='entrata' AND `data` >= '|period_start|' AND `data` <= '|period_end|' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Prima nota'; -- Articoli UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Codice, Descrizione, Categoria, Q.tà\",\"query\": \"SELECT `id`, `codice` AS `Codice`, `descrizione` AS `Descrizione`, CONCAT_WS( ' &raquo; ', `categoria`, `subcategoria` ) AS `Categoria`, CONCAT_WS( ' ', REPLACE( FORMAT( `qta`, 2 ), '.', ',' ), (SELECT `valore` FROM `mg_unitamisura` WHERE `id`=`idum`) ) AS `Q.tà` FROM `mg_articoli` ORDER BY `descrizione`\"}]}" WHERE name='Articoli'; -- Ddt di vendita-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `dt_ddt`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`dt_ddt`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `dt_statiddt` WHERE `id`=`idstatoddt`) AS `icon_Stato`, (SELECT `descrizione` FROM `dt_statiddt` WHERE `id`=`idstatoddt`) AS `icon_title_Stato` FROM `dt_ddt` INNER JOIN `dt_tipiddt` ON `dt_ddt`.`idtipoddt`=`dt_tipiddt`.`id` WHERE `dir`='entrata' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Ddt di vendita';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `dt_ddt`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`dt_ddt`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `dt_statiddt` WHERE `id`=`idstatoddt`) AS `icon_Stato`, (SELECT `descrizione` FROM `dt_statiddt` WHERE `id`=`idstatoddt`) AS `icon_title_Stato` FROM `dt_ddt` INNER JOIN `dt_tipiddt` ON `dt_ddt`.`idtipoddt`=`dt_tipiddt`.`id` WHERE `dir`='entrata' AND `data` >= '|period_start|' AND `data` <= '|period_end|' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Ddt di vendita'; -- Ddt di acquisto-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `dt_ddt`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`dt_ddt`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `dt_statiddt` WHERE `id`=`idstatoddt`) AS `icon_Stato`, (SELECT `descrizione` FROM `dt_statiddt` WHERE `id`=`idstatoddt`) AS `icon_title_Stato` FROM `dt_ddt` INNER JOIN `dt_tipiddt` ON `dt_ddt`.`idtipoddt`=`dt_tipiddt`.`id` WHERE `dir`='uscita' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Ddt di acquisto';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Numero, Data, Cliente, icon_Stato\",\"query\": \"SELECT `dt_ddt`.`id`, IF(`numero_esterno`='', `numero`, `numero_esterno`) AS `Numero`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`dt_ddt`.`idanagrafica`) AS `Cliente`, (SELECT `icona` FROM `dt_statiddt` WHERE `id`=`idstatoddt`) AS `icon_Stato`, (SELECT `descrizione` FROM `dt_statiddt` WHERE `id`=`idstatoddt`) AS `icon_title_Stato` FROM `dt_ddt` INNER JOIN `dt_tipiddt` ON `dt_ddt`.`idtipoddt`=`dt_tipiddt`.`id` WHERE `dir`='uscita' AND `data` >= '|period_start|' AND `data` <= '|period_end|' ORDER BY DATE_FORMAT( `data`, '%Y%m%d' ) DESC\"}]}" WHERE name='Ddt di acquisto'; -- My Impianti UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Matricola, Nome, Cliente, Data, Tecnico\", \"query\": \"SELECT `matricola` AS `id`, `matricola` AS `Matricola`, `nome` AS `Nome`, DATE_FORMAT( `data`, '%d/%m/%Y' ) AS `Data`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`my_impianti`.`idanagrafica`) AS `Cliente`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`my_impianti`.`idtecnico`) AS `Tecnico` FROM `my_impianti` ORDER BY `matricola`\"}]}" WHERE name='MyImpianti';This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[940]new_trunk/openstamanager

From: <lo...@us...> - 2014-07-21 09:34:01

Revision: 940 http://sourceforge.net/p/openstamanager/code/940Author: loviuzDate: 2014-07-21 09:33:57 +0000 (Mon, 21 Jul 2014)Log Message:-----------[CORE]integrata possibilit?\195?\160 di gestire le popup di inserimento record per tutti i moduliModified Paths:-------------- new_trunk/openstamanager/include/bottom.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/modules/anagrafiche/actions.php new_trunk/openstamanager/modules/anagrafiche/template.htmlAdded Paths:----------- new_trunk/openstamanager/add.php new_trunk/openstamanager/modules/anagrafiche/add.htmlAdded: new_trunk/openstamanager/add.php===================================================================--- new_trunk/openstamanager/add.php (rev 0)+++ new_trunk/openstamanager/add.php2014-07-21 09:33:57 UTC (rev 940)@@ -0,0 +1,24 @@+<?php+include("core.php");+include($docroot."/config.inc.php");+include($docroot."/lib/user_check.php");+++$id_module = $html->form('id_module');++$rs = $dbo->fetchArray("SELECT module_dir FROM zz_modules WHERE id=\"".$id_module."\"");++$template = file_get_contents( $docroot."/modules/".$rs[0]['module_dir']."/add.html" );++//Interpretazione stringhe input+preg_match_all( '/\{\[(.+?)\]\}/i', $template, $m );++for( $i=0; $i<sizeof($m[0]); $i++ ){+$template = str_replace( $m[0][$i], build_html_element($m[0][$i], $records), $template );+}++$template = str_replace( '$id_module$', $id_module, $template);++eval( ' ?>'.$template.'<?php ' );+?>+Modified: new_trunk/openstamanager/include/bottom.php===================================================================--- new_trunk/openstamanager/include/bottom.php2014-07-18 16:45:14 UTC (rev 939)+++ new_trunk/openstamanager/include/bottom.php2014-07-21 09:33:57 UTC (rev 940)@@ -28,24 +28,7 @@ </div> -<div class="modal fade" id="bs-popup" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">-<!--div class="modal-dialog">-<div class="modal-content">-<div class="modal-header">-<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only"><?php echo _("Chiudi") ?></span></button>-<h4 class="modal-title">Modal title</h4>-</div>-<div class="modal-body">-A-</div>--<div class="modal-footer">-<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>-<button type="button" class="btn btn-primary">Save changes</button>-</div>-</div>-</div-->-</div>+<div class="modal fade" id="bs-popup" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> </body> </html><?phpModified: new_trunk/openstamanager/lib/jscripts/functionsjs.php===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-18 16:45:14 UTC (rev 939)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-21 09:33:57 UTC (rev 940)@@ -7,12 +7,7 @@ $('#main-alerts').html( $('#alerts').html() ); $('#alerts').html('');-$('.chosen').chosen({-no_results_text: "<?php echo _("Nessun risultato trovato...") ?>",-placeholder_text_single: "<?php echo _("Seleziona un'opzione...") ?>",-placeholder_text_multiple: "<?php echo _("Seleziona una o più opzioni...") ?>"-});-$('.chzn-drop').css({'width': '100%'});+start_jquerychosen(); $('.date-picker').datepicker(); $('#daterange').daterangepicker(@@ -137,7 +132,7 @@ }); }); -$('#bs-popup').on('hidden', function(){+$('#bs-popup').on('hidden.bs.modal', function(){ $(this).data('modal', null); }); @@ -168,6 +163,19 @@ +function start_jquerychosen(){+//$('.chosen').chosen('destroy');++$('.chosen').chosen({+no_results_text: "<?php echo _("Nessun risultato trovato...") ?>",+placeholder_text_single: "<?php echo _("Seleziona un'opzione...") ?>",+placeholder_text_multiple: "<?php echo _("Seleziona una o più opzioni...") ?>"+});+$('.chzn-drop, .chzn-container, .chzn-container input, .chzn-container .search-field input').css({'width': '100%'});+}+++ //Aggiunta main loading all'unload del body window.onbeforeunload = function(){ $('#main_loading').show();@@ -179,52 +187,6 @@ /*-Funzione per mostrare la popup di JQueryUI-*/-function ui_dialog( href, title ){-$('#dialog').dialog({-open: function(){-$("#dialog").html('');--//Carico nella dialog-ui il contenuto di un div se inizia con #...-if( href.substr(0,1)=="#" ){-divid = href.substr( 0, href.indexOf('?') );-$("#dialog").html( $(divid).html() );-}--//...o di una url-else{-$.get(href, function(data,response){-if( response=="success" ){-$("#dialog").html(data);-$(".datepicker").datepicker();-$('.chosen').chosen({no_results_text: "Nessun risultato trovato"});-}-});-}---container = $(this).parent();-$(this).dialog( 'option', 'position', 'center' );-$(this).dialog( 'option', 'position', ['middle',100] );-},-resizable: false,-title: title || ' ',-width: getUrlVars(href)["width"],-height: getUrlVars(href)["height"],-modal: true,-closeText: 'Chiudi',-close: function(){-$("#dialog").html('');-}-});--$('.ui-dialog').css('top', '100px').css('position','fixed');-setTimeout( "$('.ui-dialog').css('top', '100px').css('position','fixed');", 100 );-}---/* Funzione per far scrollare la pagina fino a un id + focus e offset es: ScrollToAndFocus ('id',0,'','Attenzione'); */Modified: new_trunk/openstamanager/modules/anagrafiche/actions.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/actions.php2014-07-18 16:45:14 UTC (rev 939)+++ new_trunk/openstamanager/modules/anagrafiche/actions.php2014-07-21 09:33:57 UTC (rev 940)@@ -97,53 +97,49 @@ case "add": if( $permessi[$module_name] == 'rw' ){-$idtipoanagrafica = $html->form( 'idtipoanagrafica', 'post' );+$idtipoanagrafica = $_POST['idtipoanagrafica']; $ragione_sociale = $html->form( 'ragione_sociale', 'post' ); --/*-Se ad aggiungere un cliente è un agente, lo imposto come agente di quel cliente-*/-//Lettura tipologia della nuova anagrafica-$rs = $dbo->fetchArray("SELECT descrizione FROM an_tipianagrafiche WHERE idtipoanagrafica='".$idtipoanagrafica."'");-$tipoanagrafica_dst = $rs[0]['descrizione'];+//Inserimento anagrafica base+if( sizeof($idtipoanagrafica) > 0 && $ragione_sociale != '' ){+//Leggo l'ultimo codice anagrafica per calcolare il successivo+$rs = $dbo->fetchArray("SELECT codice FROM an_anagrafiche ORDER BY CAST(codice AS SIGNED) DESC LIMIT 0,1");+$codice = get_next_code( $rs[0]['codice'], 1, get_var("Formato codice anagrafica") );++//Se ad aggiungere un cliente è un agente, lo imposto come agente di quel cliente+//Lettura tipologia della nuova anagrafica+$rs = $dbo->fetchArray("SELECT descrizione FROM an_tipianagrafiche WHERE idtipoanagrafica='".$idtipoanagrafica."'");+$tipoanagrafica_dst = $rs[0]['descrizione']; -//Lettura tipologia dell'utente loggato-$rs = $dbo->fetchArray("SELECT descrizione FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica='".$user_idanagrafica."'");-$agente_is_logged = false;-for( $i=0; $i<sizeof($rs); $i++ ){-if( $rs[$i]['descrizione']=='Agente' ){-$agente_is_logged = true;-$i = sizeof($rs);+//Lettura tipologia dell'utente loggato+$agente_is_logged = false;+$rs = $dbo->fetchArray("SELECT descrizione FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica='".$user_idanagrafica."'");++for( $i=0; $i<sizeof($rs); $i++ ){+if( $rs[$i]['descrizione']=='Agente' ){+$agente_is_logged = true;+$i = sizeof($rs);+} }-} -( $agente_is_logged && $tipoanagrafica_dst=='Cliente' ) ? $idagente=$user_idanagrafica : $idagente=0;---//Se sto inserendo un cliente per un agente-if( ($idtipoanagrafica==1) and ($_POST['idagente']!="") ){-$idagente = $_POST['idagente'];+( $agente_is_logged && $tipoanagrafica_dst=='Cliente' ) ? $idagente=$user_idanagrafica : $idagente=0;++//Inserisco l'anagrafica+$query = "INSERT INTO an_anagrafiche( ragione_sociale, codice, idagente ) VALUES ( \"".$ragione_sociale."\", \"".$codice."\", \"".$idagente."\" )";+$dbo->query($query);+$idanagrafica = $dbo->last_inserted_id(); } -//Inserisco l'anagrafica solo se l'idtipoanagrafica esiste-if( $idtipoanagrafica!='' ){-if( $dbo->fetchNum("SELECT idtipoanagrafica FROM an_tipianagrafiche WHERE idtipoanagrafica='$idtipoanagrafica'" )==1 ){-//Leggo l'ultimo codice anagrafica per calcolare il successivo-$rs = $dbo->fetchArray("SELECT codice FROM an_anagrafiche ORDER BY CAST(codice AS SIGNED) DESC LIMIT 0,1");-$codice = get_next_code( $rs[0]['codice'], 1, get_var("Formato codice anagrafica") );--//Inserisco l'anagrafica-$query = "INSERT INTO an_anagrafiche( ragione_sociale, codice, idagente ) VALUES ( \"".$ragione_sociale."\", \"".$codice."\", \"".$idagente."\" )";-$dbo->query($query);-$idanagrafica = $dbo->last_inserted_id();--//Inserisco il rapporto dell'anagrafica con la tipologia scelta-$query = "INSERT INTO an_tipianagrafiche_anagrafiche(idanagrafica, idtipoanagrafica) VALUES ($idanagrafica, $idtipoanagrafica)";-$dbo->query($query);-array_push( $_SESSION['infos'], "Aggiunta una nuova anagrafica!" );-}++//Inserisco il rapporto dell'anagrafica (cliente, tecnico, ecc)+for( $t=0; $t<sizeof($idtipoanagrafica); $t++ ){+$query = "INSERT INTO an_tipianagrafiche_anagrafiche(idanagrafica, idtipoanagrafica) VALUES (\"".$idanagrafica."\", \"".$idtipoanagrafica[$t]."\")";+$dbo->query($query); }+++$id_record = $idanagrafica;+array_push( $_SESSION['infos'], "Aggiunta una nuova anagrafica!" ); } break;Added: new_trunk/openstamanager/modules/anagrafiche/add.html===================================================================--- new_trunk/openstamanager/modules/anagrafiche/add.html (rev 0)+++ new_trunk/openstamanager/modules/anagrafiche/add.html2014-07-21 09:33:57 UTC (rev 940)@@ -0,0 +1,18 @@+<form action="editor.php?id_module=$id_module$" method="post">+<input type="hidden" name="op" value="add">+<input type="hidden" name="backto" value="record-edit">++{[ "type": "text", "label": "Ragione sociale", "name": "ragione_sociale", "required": 1, "class": "", "value": "", "extra": "" ]}+<br>++{[ "type": "select", "multiple": "1", "label": "Tipo di anagrafica", "name": "idtipoanagrafica[]", "required": 0, "class": "col-md-12", "values": "query=SELECT idtipoanagrafica AS id, descrizione FROM an_tipianagrafiche ORDER BY descrizione", "value": "", "extra": "" ]}+<br>++<button type="submit" class="btn btn-primary pull-right"><i class="fa fa-plus"></i> Inserisci</button>+<div class="clearfix"></div>+</form>+<script>+$(document).ready( function(){+start_jquerychosen();+});+</script>Modified: new_trunk/openstamanager/modules/anagrafiche/template.html===================================================================--- new_trunk/openstamanager/modules/anagrafiche/template.html2014-07-18 16:45:14 UTC (rev 939)+++ new_trunk/openstamanager/modules/anagrafiche/template.html2014-07-21 09:33:57 UTC (rev 940)@@ -1,7 +1,7 @@ <form action="" method="post" role="form"> <input type="hidden" name="backto" value="record-edit"> <input type="hidden" name="op" value="update">-<input type="hidden" name="idanagrafica" value="<?php echo $id_record ?>">+<input type="hidden" name="id_record" value="<?php echo $id_record ?>"> <!-- DATI ANAGRAFICI --> <div class="panel panel-primary">This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[941]new_trunk/openstamanager

From: <lo...@us...> - 2014-07-25 13:18:24

Revision: 941 http://sourceforge.net/p/openstamanager/code/941Author: loviuzDate: 2014-07-25 13:18:09 +0000 (Fri, 25 Jul 2014)Log Message:-----------[CORE]aggiunti alcuni plugin jQuery (controllo campi "required", fullcalendar)miglioramento file motore (controller.php e editor.php)[INTERVENTI]riprodotte funzionalit?\195?\160 base del modulo (senza plugins)[DASHBOARD]riprodotte funzionalit?\195?\160 base del modulo (senza plugins)Modified Paths:-------------- new_trunk/openstamanager/add.php new_trunk/openstamanager/controller.php new_trunk/openstamanager/core.php new_trunk/openstamanager/editor.php new_trunk/openstamanager/index.php new_trunk/openstamanager/lib/htmlbuilder.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/modules/anagrafiche/actions.php new_trunk/openstamanager/modules/anagrafiche/add.html new_trunk/openstamanager/modules/anagrafiche/init.php new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.interventi.php new_trunk/openstamanager/share/themes/default/css/fullcalendar/fullcalendar.css new_trunk/openstamanager/share/themes/default/css/style.css new_trunk/openstamanager/update/update_2.0.sqlAdded Paths:----------- new_trunk/openstamanager/lib/jscripts/jquery/plugins/autogrow/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/autogrow/autogrow.min.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/parsley/ new_trunk/openstamanager/lib/jscripts/jquery/plugins/parsley/parsley.it.js new_trunk/openstamanager/lib/jscripts/jquery/plugins/parsley/parsley.min.js new_trunk/openstamanager/modules/anagrafiche/edit.html new_trunk/openstamanager/modules/dashboard/ new_trunk/openstamanager/modules/dashboard/actions.php new_trunk/openstamanager/modules/dashboard/ajaxreq.php new_trunk/openstamanager/modules/dashboard/edit.html new_trunk/openstamanager/modules/dashboard/init.php new_trunk/openstamanager/modules/dashboard/modutil.php new_trunk/openstamanager/modules/dashboard/plugins/ new_trunk/openstamanager/modules/interventi/ new_trunk/openstamanager/modules/interventi/actions.php new_trunk/openstamanager/modules/interventi/add.html new_trunk/openstamanager/modules/interventi/ajax_tecnici.php new_trunk/openstamanager/modules/interventi/edit.html new_trunk/openstamanager/modules/interventi/init.php new_trunk/openstamanager/modules/interventi/js/ new_trunk/openstamanager/modules/interventi/js/interventi_helper.js new_trunk/openstamanager/share/themes/default/css/parsley/ new_trunk/openstamanager/share/themes/default/css/parsley/parsley.cssRemoved Paths:------------- new_trunk/openstamanager/modules/anagrafiche/template.htmlModified: new_trunk/openstamanager/add.php===================================================================--- new_trunk/openstamanager/add.php2014-07-21 09:33:57 UTC (rev 940)+++ new_trunk/openstamanager/add.php2014-07-25 13:18:09 UTC (rev 941)@@ -5,10 +5,18 @@ $id_module = $html->form('id_module');-+ $rs = $dbo->fetchArray("SELECT module_dir FROM zz_modules WHERE id=\"".$id_module."\""); -$template = file_get_contents( $docroot."/modules/".$rs[0]['module_dir']."/add.html" );+//Caricamento template popup+if( file_exists($docroot."/modules/".$module_dir."/custom/add.html") ){+$template = file_get_contents( $docroot."/modules/".$rs[0]['module_dir']."/custom/add.html" );+}+else{+$template = file_get_contents( $docroot."/modules/".$rs[0]['module_dir']."/add.html" );+}++ //Interpretazione stringhe input preg_match_all( '/\{\[(.+?)\]\}/i', $template, $m );Modified: new_trunk/openstamanager/controller.php===================================================================--- new_trunk/openstamanager/controller.php2014-07-21 09:33:57 UTC (rev 940)+++ new_trunk/openstamanager/controller.php2014-07-25 13:18:09 UTC (rev 941)@@ -10,8 +10,24 @@ </div> </form> <?php-echo "<h3><i class='".$modules[ $id_module ]['icon']."'></i> ".$modules[$id_module]['name']."</h3><hr>\n";+//Lettura parametri modulo+$rs = $dbo->fetchArray("SELECT `options` FROM zz_modules WHERE id=\"".$id_module."\"");+$module_options = mb_convert_encoding( $rs[0]['options'], "utf-8", "iso-8859-1" );+$module_options = json_decode( $module_options, true );+$module_query = $module_options['main_query'][0]['query'];+$module_query = str_replace( "|period_start|", $_SESSION['period_start'], $module_query );+$module_query = str_replace( "|period_end|", $_SESSION['period_end'], $module_query ); +$module_fields = $module_options['main_query'][0]['fields'];+$fields = explode( ",", $module_fields );++if( $module_options['main_query'][0]['type'] == 'table' ){+echo "<button type='button' class='btn btn-primary' data-toggle='modal' data-title='Aggiungi' data-target='#bs-popup' data-href='add.php?id_module=".$id_module."'><i class='fa fa-plus'></i> "._("Aggiungi")."</button><hr>\n";+}+else{+echo "<div class=\"clearfix\"></div><br>\n";+}+ /** * TODO: Futuro include di widget prima di datatables */@@ -40,115 +56,169 @@ /** * Datatables con record */-//Lettura parametri modulo-$rs = $dbo->fetchArray("SELECT `options` FROM zz_modules WHERE id=\"".$id_module."\"");-$module_options = mb_convert_encoding( $rs[0]['options'], "utf-8", "iso-8859-1" );-$module_options = json_decode( $module_options, true );+if( $module_options['main_query'][0]['type'] == 'table' ){+$rs = $dbo->fetchArray( $module_query ); -$module_query = $module_options['main_query'][0]['query'];-$module_query = str_replace( "|period_start|", $_SESSION['period_start'], $module_query );-$module_query = str_replace( "|period_end|", $_SESSION['period_end'], $module_query ); -$module_fields = $module_options['main_query'][0]['fields'];-$fields = explode( ",", $module_fields );+echo "<table id='main-records' class='datatables table table-striped table-hover table-condensed table-bordered'>\n"; -$rs = $dbo->fetchArray( $module_query );+echo "<thead>\n";+echo "<tr>\n"; --echo "<table id='main-records' class='datatables table table-striped table-hover table-condensed table-bordered'>\n";+for( $c=0; $c<sizeof($fields); $c++ ){+$attr_td = '';++//Check per tipologie di campi particolari+if( preg_match( "/^color_/", trim($fields[$c]) ) ){+$attr_td .= " width='30'";+$label = str_replace( "color_", "", $fields[$c] );+}++//Data (larghezza fissa)+else if( preg_match( "/^Data/", trim($fields[$c]) ) ){+$attr_td .= " width='100'";+$label = $fields[$c];+}++//Icona di stampa+else if( trim($fields[$c]) == '_print_' ){+$attr_td .= " width='30'";+$label = str_replace( "_print_", "", $fields[$c] );+}++//Icona+else if( preg_match( "/^icon_/", trim($fields[$c]) ) ){+$attr_td .= " width='30'";+$label = str_replace( "icon_", "", $fields[$c] );+}++else{+$label = $fields[$c];+} -echo "<thead>\n";-echo "<tr>\n";+echo "<th".$attr_td.">".$label."</th>\n";+} -for( $c=0; $c<sizeof($fields); $c++ ){-$attr_td = '';+echo "</tr>\n";+echo "</thead>\n";+++//Loop record+echo "<tbody>";+for( $r=0; $r<sizeof($rs); $r++ ){+$attr_tr = '';+$attr_td = ''; -//Check per tipologie di campi particolari-if( preg_match( "/^color_/", trim($fields[$c]) ) ){-$attr_td .= " width='30'";-$label = str_replace( "color_", "", $fields[$c] );-}+if( $rs[$r]['_bg_'] != '' ){+$attr_td .= ' style="background:'.$rs[$r]['_bg_'].';"';+} -//Data (larghezza fissa)-else if( preg_match( "/^Data/", trim($fields[$c]) ) ){-$attr_td .= " width='100'";-$label = $fields[$c];-} -//Icona di stampa-else if( trim($fields[$c]) == '_print_' ){-$attr_td .= " width='30'";-$label = str_replace( "_print_", "", $fields[$c] );-}+echo "<tr class=\"clickable\" onclick=\"location.href='editor.php?id_module=".$id_module."&id_record=".$rs[$r]['id']."';\" ".$attr_tr.">"; -//Icona-else if( preg_match( "/^icon_/", trim($fields[$c]) ) ){-$attr_td .= " width='30'";-$label = str_replace( "icon_", "", $fields[$c] );-}+for( $c=0; $c<sizeof($fields); $c++ ){+//Check per tipologie di campi particolari+if( preg_match( "/^color_(.+?)$/", trim($fields[$c]), $m ) ){+$value = "<div class='img-circle square' style='background:".$rs[$r][ trim($fields[$c]) ].";' data-toggle=\"tooltip\" title=\"".htmlentities($rs[$r][ "color_title_".$m[1] ])."\">&nbsp;</div>";+}++//Icona di stampa+else if( trim($fields[$c]) == '_print_' ){+$print_url = $rs[$r]['_print_'];+$print_url = preg_replace( '/\$(.+?)\$/', $rs[$r][${1}], $print_url );++$value = "<a href='".$rootdir."/templates/".$print_url."' target='_blank'><i class='fa fa-2x fa-print'></i></a>";+}++//Data+else if( preg_match( "/^Data/", trim($fields[$c]) ) ){+$value = "<div class='text-center'>".$rs[$r][ trim($fields[$c]) ]."</div>";+}++//Icona+else if( preg_match( "/^icon_(.+?)$/", trim($fields[$c]), $m ) ){+$value = "<div class='text-center'><i class='".$rs[$r][ trim($fields[$c]) ]."' data-toggle=\"tooltip\" title=\"".htmlentities($rs[$r][ "icon_title_".$m[1] ])."\"></i></div>";+}++else{+$value = $rs[$r][ trim($fields[$c]) ];+}++echo "<td".$attr_td.">".$value."</td>\n";+} -else{-$label = $fields[$c];+echo "</tr>\n"; }--echo "<th".$attr_td.">".$label."</th>\n";+echo "</tbody>\n";+echo "</table>\n"; } -echo "</tr>\n";-echo "</thead>\n"; +/**+ * Inclusione modulo personalizzato+ */+else if( $module_options['main_query'][0]['type'] == 'custom' ){+//Lettura parametri iniziali modulo+$rs = $dbo->fetchArray( "SELECT module_dir FROM zz_modules WHERE id=\"".$id_module."\"" ); -//Loop record-echo "<tbody>";-for( $r=0; $r<sizeof($rs); $r++ ){-$attr_tr = '';-$attr_td = '';+if( sizeof($rs) == 1 ){+$module_dir = $rs[0]['module_dir']; -if( $rs[$r]['_bg_'] != '' ){-$attr_td .= ' style="background:'.$rs[$r]['_bg_'].';"';-} +//Caricamento helper modulo (verifico se ci sono helper personalizzati)+if( file_exists($docroot."/modules/".$module_dir."/custom/modutil.php") ){+include( $docroot."/modules/".$module_dir."/custom/modutil.php" );+}+else{+include( $docroot."/modules/".$module_dir."/modutil.php" );+}+ -echo "<tr class=\"clickable\" onclick=\"location.href='editor.php?id_module=".$id_module."&id_record=".$rs[$r]['id']."';\" ".$attr_tr.">"; -for( $c=0; $c<sizeof($fields); $c++ ){-//Check per tipologie di campi particolari-if( preg_match( "/^color_(.+?)$/", trim($fields[$c]), $m ) ){-$value = "<div class='img-circle square' style='background:".$rs[$r][ trim($fields[$c]) ].";' data-toggle=\"tooltip\" title=\"".htmlentities($rs[$r][ "color_title_".$m[1] ])."\">&nbsp;</div>";+if( file_exists($docroot."/modules/".$module_dir."/custom/actions.php") ){+include( $docroot."/modules/".$module_dir."/custom/actions.php" ); }--//Icona di stampa-else if( trim($fields[$c]) == '_print_' ){-$print_url = $rs[$r]['_print_'];-$print_url = preg_replace( '/\$(.+?)\$/', $rs[$r][${1}], $print_url );--$value = "<a href='".$rootdir."/templates/".$print_url."' target='_blank'><i class='fa fa-2x fa-print'></i></a>";+else{+include( $docroot."/modules/".$module_dir."/actions.php" ); }--//Data-else if( preg_match( "/^Data/", trim($fields[$c]) ) ){-$value = "<div class='text-center'>".$rs[$r][ trim($fields[$c]) ]."</div>";++++//Lettura template modulo (verifico se ci sono template personalizzati, altrimenti uso quello base)+if( file_exists($docroot."/modules/".$module_dir."/custom/edit.html") ){+$template = file_get_contents( $docroot."/modules/".$module_dir."/custom/edit.html" ); }--//Icona-else if( preg_match( "/^icon_(.+?)$/", trim($fields[$c]), $m ) ){-$value = "<div class='text-center'><i class='".$rs[$r][ trim($fields[$c]) ]."' data-toggle=\"tooltip\" title=\"".htmlentities($rs[$r][ "icon_title_".$m[1] ])."\"></i></div>";+else{+$template = file_get_contents( $docroot."/modules/".$module_dir."/edit.html" ); }-+++++//Lettura risultato query del modulo+if( file_exists($docroot."/modules/".$module_dir."/custom/init.php") ){+include( $docroot."/modules/".$module_dir."/custom/init.php" );+} else{-$value = $rs[$r][ trim($fields[$c]) ];+include( $docroot."/modules/".$module_dir."/init.php" ); }+++//Interpretazione stringhe input+preg_match_all( '/\{\[(.+?)\]\}/i', $template, $m );++for( $i=0; $i<sizeof($m[0]); $i++ ){+$template = str_replace( $m[0][$i], build_html_element($m[0][$i], $records), $template );+} -echo "<td".$attr_td.">".$value."</td>\n";+eval( ' ?>'.$template.'<?php ' ); }--echo "</tr>\n"; }-echo "</tbody>\n";-echo "</table>\n";-+ echo "</div>\n"; ++//Inclusione contenuti varie tab dei plugin for( $p=0; $p<sizeof($rsplugins); $p++ ){ echo "<div id='tab_".($p+2)."' class='tab-pane'>\n"; include( $docroot."/modules/".$rsplugins[$p]['module_dir']."/plugins/".$rsplugins[$p]['script'] );Modified: new_trunk/openstamanager/core.php===================================================================--- new_trunk/openstamanager/core.php2014-07-21 09:33:57 UTC (rev 940)+++ new_trunk/openstamanager/core.php2014-07-25 13:18:09 UTC (rev 941)@@ -61,6 +61,7 @@ array_push($css_modules, $theme_path."/css/jQueryUI/jquery-ui-1.10.3.custom.min.css"); array_push($css_modules, $theme_path."/css/datatables/dataTables.bootstrap.css"); array_push($css_modules, $theme_path."/css/daterangepicker/daterangepicker-bs3.css");+array_push($css_modules, $theme_path."/css/parsley/parsley.css"); array_push($css_modules, $theme_path."/css/chosen.css"); array_push($css_modules, $theme_path."/css/style.css"); @@ -71,10 +72,14 @@ array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/jquery.dataTables.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/datatables/dataTables.bootstrap.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/chosen.jquery.js");-array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/daterangepicker//daterangepicker.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/parsley/parsley.min.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/parsley/parsley.it.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/daterangepicker/daterangepicker.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.extensions.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.date.extensions.js");-array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.extensions.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/input-mask/jquery.inputmask.numeric.extensions.js");+array_push($jscript_modules, $rootdir."/lib/jscripts/jquery/plugins/autogrow/autogrow.min.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/app.js"); array_push($jscript_modules, $rootdir."/lib/jscripts/functionsjs.php"); Modified: new_trunk/openstamanager/editor.php===================================================================--- new_trunk/openstamanager/editor.php2014-07-21 09:33:57 UTC (rev 940)+++ new_trunk/openstamanager/editor.php2014-07-25 13:18:09 UTC (rev 941)@@ -4,11 +4,17 @@ include($docroot."/lib/user_check.php"); include($docroot."/include/top.php"); include($docroot."/lib/permissions_check.php");+?>+<form class="pull-right">+ <div class="input-group">+ <button id="daterange" class="btn btn-default"><i class="fa fa-calendar"></i> <?php echo _("Periodo di lavoro") ?> <i class="fa fa-caret-down"></i></button>+ </div>+ </form>++<?php+echo "<a href='controller.php?id_module=".$id_module."'><i class='fa fa-chevron-left'></i> "._("Indietro")."</a><hr>\n"; -echo "<h3><i class='".$modules[ $id_module ]['icon']."'></i> ".$modules[$id_module]['name']."</h3><hr>\n";-- //Lettura parametri iniziali modulo $rs = $dbo->fetchArray( "SELECT module_dir FROM zz_modules WHERE id=\"".$id_module."\"" ); @@ -32,30 +38,16 @@ else{ include( $docroot."/modules/".$module_dir."/actions.php" ); }--//Scelta del redirect dopo un submit-if( sizeof($_POST) > 0 ){-if( $html->form('backto', 'post') == 'record-edit' ){-header("Location: ".$rootdir."/editor.php?id_module=".$id_module."&id_record=".$id_record);-exit;-}--else{-header("Location: ".$rootdir."/controller.php?id_module=".$id_module);-exit;-}-exit;-} //Lettura template modulo (verifico se ci sono template personalizzati, altrimenti uso quello base)-if( file_exists($docroot."/modules/".$module_dir."/custom/template.html") ){-$template = file_get_contents( $docroot."/modules/".$module_dir."/custom/template.html" );+if( file_exists($docroot."/modules/".$module_dir."/custom/edit.html") ){+$template = file_get_contents( $docroot."/modules/".$module_dir."/custom/edit.html" ); } else{-$template = file_get_contents( $docroot."/modules/".$module_dir."/template.html" );+$template = file_get_contents( $docroot."/modules/".$module_dir."/edit.html" ); } @@ -120,6 +112,18 @@ } +//Scelta del redirect dopo un submit+if( sizeof($_POST) > 0 ){+if( $html->form('backto', 'post') == 'record-edit' ){+header("Location: ".$rootdir."/editor.php?id_module=".$id_module."&id_record=".$id_record);+}++else{+header("Location: ".$rootdir."/controller.php?id_module=".$id_module);+}+exit;+}+ include($docroot."/include/bottom.php"); ?> Modified: new_trunk/openstamanager/index.php===================================================================--- new_trunk/openstamanager/index.php2014-07-21 09:33:57 UTC (rev 940)+++ new_trunk/openstamanager/index.php2014-07-25 13:18:09 UTC (rev 941)@@ -6,35 +6,7 @@ $password = save($_POST['password']); $op = $_GET['op']; --//Redirect al primo modulo su cui l'utente ha accesso se l'utente è già loggato-if( isset($_SESSION['idutente']) ){-if( $_SESSION['is_admin'] )-$q = "SELECT name, module_dir, link FROM zz_modules WHERE level='0' ORDER BY `order` ASC";-else-$q = "SELECT name, module_dir, link FROM zz_modules WHERE level='0' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT id FROM zz_gruppi WHERE nome='".$rs[0]['gruppo']."') AND permessi IN ('r', 'rw') ) ORDER BY `order` ASC"; -$rs = $dbo->fetchArray($q);--if( sizeof($rs) <= 0 && !$_SESSION['is_admin'] ){-if ($op!='logout')-array_push( $errors, _("L'utente non ha nessun permesso impostato!") );-else-array_push( $infos, _("Arrivederci!") );-}--else if( $rs[0]['link']!='#' ){-redirect( $rootdir."/controller.php?module=".$rs[0]['name'], "js" );-}--else{-redirect( $rootdir."/controller.php?module=dashboard", "js" );-}-}---- //LOGIN switch ( $op ){ case 'login':@@ -68,25 +40,27 @@ //Redirect al primo modulo su cui l'utente ha accesso if( $_SESSION['is_admin'] ){-$q = "SELECT name, module_dir, link FROM zz_modules WHERE level='0' ORDER BY `order` ASC";+$q = "SELECT id, module_dir, options FROM zz_modules WHERE level='0' ORDER BY `order` ASC"; } else{-$q = "SELECT name, module_dir, link FROM zz_modules WHERE level='0' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT id FROM zz_gruppi WHERE nome='".$rs[0]['gruppo']."') AND permessi IN ('r', 'rw') ) ORDER BY `order` ASC";+$q = "SELECT id, module_dir, options FROM zz_modules WHERE level='0' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT id FROM zz_gruppi WHERE nome='".$rs[0]['gruppo']."') AND permessi IN ('r', 'rw') ) ORDER BY `order` ASC"; } + $rs = $dbo->fetchArray($q); if( sizeof($rs) <= 0 && !$_SESSION['is_admin'] ){ array_push( $_SESSION['errors'], _("L'utente non ha nessun permesso impostato!") ); } -else if( $rs[0]['link'] != '#' ){-redirect( $rootdir."/controller.php?module=".$rs[0]['name'], "js" );-}- else{-redirect( $rootdir."/controller.php?module=dashboard", "js" );+for( $i=0; $i<sizeof($rs); $i++ ){+if( $rs[$i]['options'] != '' ){+redirect( $rootdir."/controller.php?id_module=".$rs[0]['id'], "js" );+exit;+}+} } } break;@@ -104,6 +78,35 @@ break; }+++//Redirect al primo modulo su cui l'utente ha accesso se l'utente è già loggato+if( isset($_SESSION['idutente']) ){+if( $_SESSION['is_admin'] )+$q = "SELECT id, module_dir, options FROM zz_modules WHERE level='0' ORDER BY `order` ASC";+else+$q = "SELECT id, module_dir, options FROM zz_modules WHERE level='0' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT id FROM zz_gruppi WHERE nome='".$rs[0]['gruppo']."') AND permessi IN ('r', 'rw') ) ORDER BY `order` ASC";++$rs = $dbo->fetchArray($q);++if( sizeof($rs) <= 0 && !$_SESSION['is_admin'] ){+if ($op!='logout')+array_push( $errors, _("L'utente non ha nessun permesso impostato!") );+else+array_push( $infos, _("Arrivederci!") );+}++else{+for( $i=0; $i<sizeof($rs); $i++ ){+if( $rs[$i]['options'] != '' ){+redirect( $rootdir."/controller.php?id_module=".$rs[0]['id'], "js" );+exit;+}+}+}+}++ ?><!DOCTYPE html> <html class="bg-black"> <head>@@ -154,7 +157,7 @@ ?> <div class="form-group input-group"> <span class="input-group-addon"><i class="fa fa-user"></i> </span>- <input type="text" name="username" class="form-control" placeholder="<?php echo _("Nome utente") ?>">+ <input type="text" name="username" class="form-control" placeholder="<?php echo _("Nome utente") ?>" value="<?php echo $html->form('username','post') ?>"> </div> <div class="form-group input-group"> <span class="input-group-addon"><i class="fa fa-lock"></i> </span>@@ -172,7 +175,13 @@ <script type="text/javascript"> $(document).ready( function(){-$('input[name=username]').focus();+if( $('input[name=username]').val() == '' ){+$('input[name=username]').focus();+}++else{+$('input[name=password]').focus();+} }); </script> Modified: new_trunk/openstamanager/lib/htmlbuilder.php===================================================================--- new_trunk/openstamanager/lib/htmlbuilder.php2014-07-21 09:33:57 UTC (rev 940)+++ new_trunk/openstamanager/lib/htmlbuilder.php2014-07-25 13:18:09 UTC (rev 941)@@ -20,6 +20,7 @@ */ function build_html_element( $str, $records ){ global $dbo;+global $records; global $id_module; global $id_record; @@ -50,10 +51,38 @@ } +//Conversione variabili con campi di database+$values = $json['values'];++if( preg_match_all('/<\?php(.+?)\?>/i', $values, $m) ){+for( $i=0; $i<sizeof($m[0]); $i++ ){+$val = $m[0][$i];+$val = str_replace( '<?php', '', $val );+$val = str_replace( '?>', '', $val );++eval( '$values = str_replace( $m[0][$i], '.$val.', $values );' );+}+}++if( preg_match_all('/\$([^\$]+)\$/', $values, $m) ){+for( $i=0; $i<sizeof($m[0]); $i++ ){+$db_field_name = str_replace( "$", "", $m[0][$i] );+$values = str_replace( $m[0][$i], $records[0][ $db_field_name ], $values );+}+}++++//Label+$label = $json['label'];++if( $json['required'] == '1' ){+$label .= "*";+} $html = "<div class='form-group'>\n";-$html .= "<label for='".$json['name']."'>".mb_convert_encoding( $json['label'], "iso-8859-1", "utf-8" )."</label>\n";+$html .= "<label for='".$json['name']."'>".mb_convert_encoding( $label, "iso-8859-1", "utf-8" )."</label>\n"; if( $json['icon-before'] != '' || $json['icon-after'] != '' ){ $html .= "<div class='input-group'>\n";@@ -83,7 +112,7 @@ case 'select': //Generazione <select> da query-if( preg_match_all( "/^query=(.+?)$/", $json['values'], $m) ){+if( preg_match_all( "/^query=(.+?)$/", $values, $m) ){ eval( "\$query = \"".$m[1][0]."\";" ); $rs = $dbo->fetchArray( $query ); @@ -95,7 +124,7 @@ $html .= "<select class='form-control chosen ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$json['extra']." ".$attr.">\n"; if( !$json['multiple'] ){-$html .= "<option value=''>- Seleziona un valore -</option>\n";+$html .= "<option value=''>- Seleziona un'opzione -</option>\n"; } for( $i=0; $i<sizeof($rs); $i++ ){@@ -107,6 +136,14 @@ $html .= "</select>\n"; }++else{+$values = explode('|', $values);++$html .= "<select class='form-control chosen ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$json['extra']." ".$attr.">\n";+$html .= "<option value=''>".$json['value']."</option>\n";+$html .= "</select>\n";+} break; Modified: new_trunk/openstamanager/lib/jscripts/functionsjs.php===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-21 09:33:57 UTC (rev 940)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-07-25 13:18:09 UTC (rev 941)@@ -7,6 +7,8 @@ $('#main-alerts').html( $('#alerts').html() ); $('#alerts').html('');+$('.autogrow').autogrow();+$('form').parsley(); start_jquerychosen(); $('.date-picker').datepicker();@@ -41,10 +43,11 @@ //Input mask $(".date-mask").inputmask( "dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"} );+$(".time-mask").inputmask( "hh:mm", {"placeholder": "hh:mm"} ); $("[data-mask]").inputmask();+ $('.inputmask-decimal').inputmask("decimal", { "radixPoint": ",", "digits": 2 }); - // Setup - add a text input to each footer cell var table = $('.datatables').dataTable({ "oLanguage": { "sUrl": "<?php echo $rootdir ?>/lib/jscripts/jquery/plugins/datatables/jquery.datatables.lang-<?php echo $lang ?>.js" },@@ -114,22 +117,7 @@ Crezione layout modal */ $('[data-href]').click( function(){-data_title = $(this).data('title');--$.get( $(this).data('href'), function(data, response){-if( response == 'success' ){--$('#bs-popup').html(-'<div class="modal-dialog modal-lg">' +-'<div class="modal-content">' +-'<div class="modal-header">' +-'<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only"><?php echo _("Chiudi") ?></span></button>' +-'<h4 class="modal-title">' + data_title + '</h4>' +-'</div>' +-'<div class="modal-body">' + data + '</div>'-);-}-});+launch_modal( $(this).data('title'), $(this).data('href') ); }); $('#bs-popup').on('hidden.bs.modal', function(){@@ -163,9 +151,28 @@ +function launch_modal( title, href, init_modal=0 ){+$.get( href, function(data, response){+if( response == 'success' ){++$('#bs-popup').html(+'<div class="modal-dialog modal-lg">' ++'<div class="modal-content">' ++'<div class="modal-header">' ++'<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only"><?php echo _("Chiudi") ?></span></button>' ++'<h4 class="modal-title">' + title + '</h4>' ++'</div>' ++'<div class="modal-body">' + data + '</div>'+);+if( init_modal == 1 ){+$('#bs-popup').modal('show');+}+}+});+}++ function start_jquerychosen(){-//$('.chosen').chosen('destroy');- $('.chosen').chosen({ no_results_text: "<?php echo _("Nessun risultato trovato...") ?>", placeholder_text_single: "<?php echo _("Seleziona un'opzione...") ?>",@@ -374,3 +381,12 @@ e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); }+++function update_jchosen(id){+$(id).removeClass('chzn-done');+$(id+'_chzn').remove();+$(id).val('').change();+start_jquerychosen();+}+Added: new_trunk/openstamanager/lib/jscripts/jquery/plugins/autogrow/autogrow.min.js===================================================================--- new_trunk/openstamanager/lib/jscripts/jquery/plugins/autogrow/autogrow.min.js (rev 0)+++ new_trunk/openstamanager/lib/jscripts/jquery/plugins/autogrow/autogrow.min.js2014-07-25 13:18:09 UTC (rev 941)@@ -0,0 +1,18 @@+/*+autogrow.js - Copyright (C) 2014, Jason Edelman <ede...@gm...>++Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or+sell copies of the Software, and to permit persons to whom the Software is furnished to +do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE.+*/+;(function(e){e.fn.autogrow=function(t){function s(n){var r=e(this),i=r.innerHeight(),s=this.scrollHeight,o=r.data("autogrow-start-height")||0,u;if(i<s){this.scrollTop=0;t.animate?r.stop().animate({height:s},t.speed):r.innerHeight(s)}else if(!n||n.which==8||n.which==46||n.ctrlKey&&n.which==88){if(i>o){u=r.clone().addClass(t.cloneClass).css({position:"absolute",zIndex:-10,height:""}).val(r.val());r.after(u);do{s=u[0].scrollHeight-1;u.innerHeight(s)}while(s===u[0].scrollHeight);s++;u.remove();r.focus();s<o&&(s=o);i>s&&t.animate?r.stop().animate({height:s},t.speed):r.innerHeight(s)}else{r.innerHeight(o)}}}var n=e(this).css({overflow:"hidden",resize:"none"}),r=n.selector,i={context:e(document),animate:true,speed:200,fixMinHeight:true,cloneClass:"autogrowclone",onInitialize:false};t=e.isPlainObject(t)?t:{context:t?t:e(document)};t=e.extend({},i,t);n.each(function(n,r){var i,o;r=e(r);if(r.is(":visible")||parseInt(r.css("height"),10)>0){i=parseInt(r.css("height"),10)||r.innerHeight()}else{o=r.clone().addClass(t.cloneClass).val(r.val()).css({position:"absolute",visibility:"hidden",display:"block"});e("body").append(o);i=o.innerHeight();o.remove()}if(t.fixMinHeight){r.data("autogrow-start-height",i)}r.css("height",i);if(t.onInitialize){s.call(r)}});t.context.on("keyup paste",r,s);return n}})(jQuery);Added: new_trunk/openstamanager/lib/jscripts/jquery/plugins/parsley/parsley.it.js===================================================================--- new_trunk/openstamanager/lib/jscripts/jquery/plugins/parsley/parsley.it.js (rev 0)+++ new_trunk/openstamanager/lib/jscripts/jquery/plugins/parsley/parsley.it.js2014-07-25 13:18:09 UTC (rev 941)@@ -0,0 +1,33 @@+// ParsleyConfig definition if not already set+window.ParsleyConfig = window.ParsleyConfig || {};+window.ParsleyConfig.i18n = window.ParsleyConfig.i18n || {};++// Define then the messages+window.ParsleyConfig.i18n.it = $.extend(window.ParsleyConfig.i18n.it || {}, {+ defaultMessage: "Questo valore sembra essere non valido.",+ type: {+ email: "Questo valore deve essere un indirizzo email valido.",+ url: "Questo valore deve essere un URL valido.",+ number: "Questo valore deve essere un numero valido.",+ integer: "Questo valore deve essere un numero valido.",+ digits: "Questo valore deve essere di tipo numerico.",+ alphanum: "Questo valore deve essere di tipo alfanumerico."+ },+ notblank: "Questo valore non deve essere vuoto.",+ required: "Questo valore è richiesto.",+ pattern: "Questo valore non è corretto.",+ min: "Questo valore deve essere maggiore di %s.",+ max: "Questo valore deve essere minore di %s.",+ range: "Questo valore deve essere compreso tra %s e %s.",+ minlength: "Questo valore è troppo corto. La lunghezza minima è di %s caratteri.",+ maxlength: "Questo valore è troppo lungo. La lunghezza massima è di %s caratteri.",+ length: "La lunghezza di questo valore deve essere compresa fra %s e %s caratteri.",+ mincheck: "Devi scegliere almeno %s opzioni.",+ maxcheck: "Devi scegliere al più %s opzioni.",+ check: "Devi scegliere tra %s e %s opzioni.",+ equalto: "Questo valore deve essere identico."+});++// If file is loaded after Parsley main file, auto-load locale+if ('undefined' !== typeof window.ParsleyValidator)+ window.ParsleyValidator.addCatalog('it', window.ParsleyConfig.i18n.it, true);Added: new_trunk/openstamanager/lib/jscripts/jquery/plugins/parsley/parsley.min.js===================================================================--- new_trunk/openstamanager/lib/jscripts/jquery/plugins/parsley/parsley.min.js (rev 0)+++ new_trunk/openstamanager/lib/jscripts/jquery/plugins/parsley/parsley.min.js2014-07-25 13:18:09 UTC (rev 941)@@ -0,0 +1,9 @@+/*!+* Parsleyjs+* Guillaume Potier - <gui...@wi...>+* Version 2.0.3 - built Mon Jul 21 2014 11:58:33+* MIT Licensed+*+*/+!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"undefined"==typeof a&&"undefined"!=typeof window.jQuery&&(a=window.jQuery);var b={attr:function(a,b,c){var d,e={},f=this.msieversion(),g=new RegExp("^"+b,"i");if("undefined"==typeof a||"undefined"==typeof a[0])return{};for(var h in a[0].attributes)if(d=a[0].attributes[h],"undefined"!=typeof d&&null!==d&&(!f||f>=8||d.specified)&&g.test(d.name)){if("undefined"!=typeof c&&new RegExp(c+"$","i").test(d.name))return!0;e[this.camelize(d.name.replace(b,""))]=this.deserializeValue(d.value)}return"undefined"==typeof c?e:!1},setAttr:function(a,b,c,d){a[0].setAttribute(this.dasherize(b+c),String(d))},get:function(a,b){for(var c=0,d=(b||"").split(".");this.isObject(a)||this.isArray(a);)if(a=a[d[c++]],c===d.length)return a;return void 0},hash:function(a){return String(Math.random()).substring(2,a?a+2:9)},isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},isObject:function(a){return a===Object(a)},deserializeValue:function(b){var c;try{return b?"true"==b||("false"==b?!1:"null"==b?null:isNaN(c=Number(b))?/^[\[\{]/.test(b)?a.parseJSON(b):b:c):b}catch(d){return b}},camelize:function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},dasherize:function(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()},msieversion:function(){var a=window.navigator.userAgent,b=a.indexOf("MSIE ");return b>0||navigator.userAgent.match(/Trident.*rv\:11\./)?parseInt(a.substring(b+5,a.indexOf(".",b)),10):0}},c={namespace:"data-parsley-",inputs:"input, textarea, select",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden]",priorityEnabled:!0,uiEnabled:!0,validationThreshold:3,focus:"first",trigger:!1,errorClass:"parsley-error",successClass:"parsley-success",classHandler:function(){},errorsContainer:function(){},errorsWrapper:'<ul class="parsley-errors-list"></ul>',errorTemplate:"<li></li>"},d=function(){};d.prototype={asyncSupport:!1,actualizeOptions:function(){return this.options=this.OptionsFactory.get(this),this},validateThroughValidator:function(a,b,c){return window.ParsleyValidator.validate.apply(window.ParsleyValidator,[a,b,c])},subscribe:function(b,c){return a.listenTo(this,b.toLowerCase(),c),this},unsubscribe:function(b){return a.unsubscribeTo(this,b.toLowerCase()),this},reset:function(){if("ParsleyForm"!==this.__class__)return a.emit("parsley:field:reset",this);for(var b=0;b<this.fields.length;b++)a.emit("parsley:field:reset",this.fields[b]);a.emit("parsley:form:reset",this)},destroy:function(){if("ParsleyForm"!==this.__class__)return this.$element.removeData("Parsley"),this.$element.removeData("ParsleyFieldMultiple"),void a.emit("parsley:field:destroy",this);for(var b=0;b<this.fields.length;b++)this.fields[b].destroy();this.$element.removeData("Parsley"),a.emit("parsley:form:destroy",this)}},function(a){var b=function(a){return this.__class__="Validator",this.__version__="0.5.8",this.options=a||{},this.bindingKey=this.options.bindingKey||"_validatorjsConstraint",this};b.prototype={constructor:b,validate:function(a,b,c){if("string"!=typeof a&&"object"!=typeof a)throw new Error("You must validate an object or a string");return"string"==typeof a||g(a)?this._validateString(a,b,c):this.isBinded(a)?this._validateBindedObject(a,b):this._validateObject(a,b,c)},bind:function(a,b){if("object"!=typeof a)throw new Error("Must bind a Constraint to an object");return a[this.bindingKey]=new c(b),this},unbind:function(a){return"undefined"==typeof a._validatorjsConstraint?this:(delete a[this.bindingKey],this)},isBinded:function(a){return"undefined"!=typeof a[this.bindingKey]},getBinded:function(a){return this.isBinded(a)?a[this.bindingKey]:null},_validateString:function(a,b,c){var f,h=[];g(b)||(b=[b]);for(var i=0;i<b.length;i++){if(!(b[i]instanceof e))throw new Error("You must give an Assert or an Asserts array to validate a string");f=b[i].check(a,c),f instanceof d&&h.push(f)}return h.length?h:!0},_validateObject:function(a,b,d){if("object"!=typeof b)throw new Error("You must give a constraint to validate an object");return b instanceof c?b.check(a,d):new c(b).check(a,d)},_validateBindedObject:function(a,b){return a[this.bindingKey].check(a,b)}},b.errorCode={must_be_a_string:"must_be_a_string",must_be_an_array:"must_be_an_array",must_be_a_number:"must_be_a_number",must_be_a_string_or_array:"must_be_a_string_or_array"};var c=function(a,b){if(this.__class__="Constraint",this.options=b||{},this.nodes={},a)try{this._bootstrap(a)}catch(c){throw new Error("Should give a valid mapping object to Constraint",c,a)}return this};c.prototype={constructor:c,check:function(a,b){var c,d={};for(var h in this.options.strict?this.nodes:a)if(this.options.strict?this.has(h,a):this.has(h))c=this._check(h,a[h],b),(g(c)&&c.length>0||!g(c)&&!f(c))&&(d[h]=c);else if(this.options.strict)try{(new e).HaveProperty(h).validate(a)}catch(i){d[h]=i}return f(d)?!0:d},add:function(a,b){if(b instanceof e||g(b)&&b[0]instanceof e)return this.nodes[a]=b,this;if("object"==typeof b&&!g(b))return this.nodes[a]=b instanceof c?b:new c(b),this;throw new Error("Should give an Assert, an Asserts array, a Constraint",b)},has:function(a,b){return b="undefined"!=typeof b?b:this.nodes,"undefined"!=typeof b[a]},get:function(a,b){return this.has(a)?this.nodes[a]:b||null},remove:function(a){var b=[];for(var c in this.nodes)c!==a&&(b[c]=this.nodes[c]);return this.nodes=b,this},_bootstrap:function(a){if(a instanceof c)return this.nodes=a.nodes;for(var b in a)this.add(b,a[b])},_check:function(a,b,d){if(this.nodes[a]instanceof e)return this._checkAsserts(b,[this.nodes[a]],d);if(g(this.nodes[a]))return this._checkAsserts(b,this.nodes[a],d);if(this.nodes[a]instanceof c)return this.nodes[a].check(b,d);throw new Error("Invalid node",this.nodes[a])},_checkAsserts:function(a,b,c){for(var d,e=[],f=0;f<b.length;f++)d=b[f].check(a,c),"undefined"!=typeof d&&!0!==d&&e.push(d);return e}};var d=function(a,b,c){if(this.__class__="Violation",!(a instanceof e))throw new Error("Should give an assertion implementing the Assert interface");this.assert=a,this.value=b,"undefined"!=typeof c&&(this.violation=c)};d.prototype={show:function(){var a={assert:this.assert.__class__,value:this.value};return this.violation&&(a.violation=this.violation),a},__toString:function(){return"undefined"!=typeof this.violation&&(this.violation='", '+this.getViolation().constraint+" expected was "+this.getViolation().expected),this.assert.__class__+' assert failed for "'+this.value+this.violation||""},getViolation:function(){var a,b;for(a in this.violation)b=this.violation[a];return{constraint:a,expected:b}}};var e=function(a){return this.__class__="Assert",this.__parentClass__=this.__class__,this.groups=[],"undefined"!=typeof a&&this.addGroup(a),this};e.prototype={construct:e,check:function(a,b){if(!(b&&!this.hasGroup(b)||!b&&this.hasGroups()))try{return this.validate(a,b)}catch(c){return c}},hasGroup:function(a){return g(a)?this.hasOneOf(a):"Any"===a?!0:this.hasGroups()?-1!==this.groups.indexOf(a):"Default"===a},hasOneOf:function(a){for(var b=0;b<a.length;b++)if(this.hasGroup(a[b]))return!0;return!1},hasGroups:function(){return this.groups.length>0},addGroup:function(a){return g(a)?this.addGroups(a):(this.hasGroup(a)||this.groups.push(a),this)},removeGroup:function(a){for(var b=[],c=0;c<this.groups.length;c++)a!==this.groups[c]&&b.push(this.groups[c]);return this.groups=b,this},addGroups:function(a){for(var b=0;b<a.length;b++)this.addGroup(a[b]);return this},HaveProperty:function(a){return this.__class__="HaveProperty",this.node=a,this.validate=function(a){if("undefined"==typeof a[this.node])throw new d(this,a,{value:this.node});return!0},this},Blank:function(){return this.__class__="Blank",this.validate=function(a){if("string"!=typeof a)throw new d(this,a,{value:b.errorCode.must_be_a_string});if(""!==a.replace(/^\s+/g,"").replace(/\s+$/g,""))throw new d(this,a);return!0},this},Callback:function(a){if(this.__class__="Callback",this.arguments=Array.prototype.slice.call(arguments),1===this.arguments.length?this.arguments=[]:this.arguments.splice(0,1),"function"!=typeof a)throw new Error("Callback must be instanciated with a function");return this.fn=a,this.validate=function(a){var b=this.fn.apply(this,[a].concat(this.arguments));if(!0!==b)throw new d(this,a,{result:b});return!0},this},Choice:function(a){if(this.__class__="Choice",!g(a)&&"function"!=typeof a)throw new Error("Choice must be instanciated with an array or a function");return this.list=a,this.validate=function(a){for(var b="function"==typeof this.list?this.list():this.list,c=0;c<b.length;c++)if(a===b[c])return!0;throw new d(this,a,{choices:b})},this},Collection:function(a){return this.__class__="Collection",this.constraint="undefined"!=typeof a?new c(a):!1,this.validate=function(a,c){var e,h=new b,i=0,j={},k=this.groups.length?this.groups:c;if(!g(a))throw new d(this,array,{value:b.errorCode.must_be_an_array});for(var l=0;l<a.length;l++)e=this.constraint?h.validate(a[l],this.constraint,k):h.validate(a[l],k),f(e)||(j[i]=e),i++;return f(j)?!0:j},this},Count:function(a){return this.__class__="Count",this.count=a,this.validate=function(a){if(!g(a))throw new d(this,a,{value:b.errorCode.must_be_an_array});var c="function"==typeof this.count?this.count(a):this.count;if(isNaN(Number(c)))throw new Error("Count must be a valid interger",c);if(c!==a.length)throw new d(this,a,{count:c});return!0},this},Email:function(){return this.__class__="Email",this.validate=function(a){var c=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;if("string"!=typeof a)throw new d(this,a,{value:b.errorCode.must_be_a_string});if(!c.test(a))throw new d(this,a);return!0},this},Eql:function(a){if(this.__class__="Eql","undefined"==typeof a)throw new Error("Equal must be instanciated with an Array or an Object");return this.eql=a,this.validate=function(a){var b="function"==typeof this.eql?this.eql(a):this.eql;if(!h.eql(b,a))throw new d(this,a,{eql:b});return!0},this},EqualTo:function(a){if(this.__class__="EqualTo","undefined"==typeof a)throw new Error("EqualTo must be instanciated with a value or a function");return this.reference=a,this.validate=function(a){var b="function"==typeof this.reference?this.reference(a):this.reference;if(b!==a)throw new d(this,a,{value:b});return!0},this},GreaterThan:function(a){if(this.__class__="GreaterThan","undefined"==typeof a)throw new Error("Should give a threshold value");return this.threshold=a,this.validate=function(a){if(""===a||isNaN(Number(a)))throw new d(this,a,{value:b.errorCode.must_be_a_number});if(this.threshold>=a)throw new d(this,a,{threshold:this.threshold});return!0},this},GreaterThanOrEqual:function(a){if(this.__class__="GreaterThanOrEqual","undefined"==typeof a)throw new Error("Should give a threshold value");return this.threshold=a,this.validate=function(a){if(""===a||isNaN(Number(a)))throw new d(this,a,{value:b.errorCode.must_be_a_number});if(this.threshold>a)throw new d(this,a,{threshold:this.threshold});return!0},this},InstanceOf:function(a){if(this.__class__="InstanceOf","undefined"==typeof a)throw new Error("InstanceOf must be instanciated with a value");return this.classRef=a,this.validate=function(a){if(!0!=a instanceof this.classRef)throw new d(this,a,{classRef:this.classRef});return!0},this},IPv4:function(){return this.__class__="IPv4",this.validate=function(a){var c=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;if("string"!=typeof a)throw new d(this,a,{value:b.errorCode.must_be_a_string});if(!c.test(a))throw new d(this,a);return!0},this},Length:function(a){if(this.__class__="Length",!a.min&&!a.max)throw new Error("Lenth assert must be instanciated with a { min: x, max: y } object");return this.min=a.min,this.max=a.max,this.validate=function(a){if("string"!=typeof a&&!g(a))throw new d(this,a,{value:b.errorCode.must_be_a_string_or_array});if("undefined"!=typeof this.min&&this.min===this.max&&a.length!==this.min)throw new d(this,a,{min:this.min,max:this.max});if("undefined"!=typeof this.max&&a.length>this.max)throw new d(this,a,{max:this.max});if("undefined"!=typeof this.min&&a.length<this.min)throw new d(this,a,{min:this.min});return!0},this},LessThan:function(a){if(this.__class__="LessThan","undefined"==typeof a)throw new Error("Should give a threshold value");return this.threshold=a,this.validate=function(a){if(""===a||isNaN(Number(a)))throw new d(this,a,{value:b.errorCode.must_be_a_number});if(this.threshold<=a)throw new d(this,a,{threshold:this.threshold});return!0},this},LessThanOrEqual:function(a){if(this.__class__="LessThanOrEqual","undefined"==typeof a)throw new Error("Should give a threshold value");return this.threshold=a,this.validate=function(a){if(""===a||isNaN(Number(a)))throw new d(this,a,{value:b.errorCode.must_be_a_number});if(this.threshold<a)throw new d(this,a,{threshold:this.threshold});return!0},this},Mac:function(){return this.__class__="Mac",this.validate=function(a){var c=/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i;if("string"!=typeof a)throw new d(this,a,{value:b.errorCode.must_be_a_string});if(!c.test(a))throw new d(this,a);return!0},this},NotNull:function(){return this.__class__="NotNull",this.validate=function(a){if(null===a||"undefined"==typeof a)throw new d(this,a);return!0},this},NotBlank:function(){return this.__class__="NotBlank",this.validate=function(a){if("string"!=typeof a)throw new d(this,a,{value:b.errorCode.must_be_a_string});if(""===a.replace(/^\s+/g,"").replace(/\s+$/g,""))throw new d(this,a);return!0},this},Null:function(){return this.__class__="Null",this.validate=function(a){if(null!==a)throw new d(this,a);return!0},this},Range:function(a,b){if(this.__class__="Range","undefined"==typeof a||"undefined"==typeof b)throw new Error("Range assert expects min and max values");return this.min=a,this.max=b,this.validate=function(a){try{return"string"==typeof a&&isNaN(Number(a))||g(a)?(new e).Length({min:this.min,max:this.max}).validate(a):(new e).GreaterThanOrEqual(this.min).validate(a)&&(new e).LessThanOrEqual(this.max).validate(a),!0}catch(b){throw new d(this,a,b.violation)}return!0},this},Regexp:function(a,c){if(this.__class__="Regexp","undefined"==typeof a)throw new Error("You must give a regexp");return this.regexp=a,this.flag=c||"",this.validate=function(a){if("string"!=typeof a)throw new d(this,a,{value:b.errorCode.must_be_a_string});if(!new RegExp(this.regexp,this.flag).test(a))throw new d(this,a,{regexp:this.regexp,flag:this.flag});return!0},this},Required:function(){return this.__class__="Required",this.validate=function(a){if("undefined"==typeof a)throw new d(this,a);try{"string"==typeof a?(new e).NotNull().validate(a)&&(new e).NotBlank().validate(a):!0===g(a)&&(new e).Length({min:1}).validate(a)}catch(b){throw new d(this,a)}return!0},this},Unique:function(a){return this.__class__="Unique","object"==typeof a&&(this.key=a.key),this.validate=function(a){var c,e=[];if(!g(a))throw new d(this,a,{value:b.errorCode.must_be_an_array});for(var f=0;f<a.length;f++)if(c="object"==typeof a[f]?a[f][this.key]:a[f],"undefined"!=typeof c){if(-1!==e.indexOf(c))throw new d(this,a,{value:c});e.push(c)}return!0},this}},a.Assert=e,a.Validator=b,a.Violation=d,a.Constraint=c,Array.prototype.indexOf||(Array.prototype.indexOf=function(a){if(null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!=d?d=0:0!==d&&1/0!=d&&d!=-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1});var f=function(a){for(var b in a)return!1;return!0},g=function(a){return"[object Array]"===Object.prototype.toString.call(a)},h={eql:function(a,b){if(a===b)return!0;if("undefined"!=typeof Buffer&&Buffer.isBuffer(a)&&Buffer.isBuffer(b)){if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}return a instanceof Date&&b instanceof Date?a.getTime()===b.getTime():"object"!=typeof a&&"object"!=typeof b?a==b:this.objEquiv(a,b)},isUndefinedOrNull:function(a){return null===a||"undefined"==typeof a},isArguments:function(a){return"[object Arguments]"==Object.prototype.toString.call(a)},keys:function(a){if(Object.keys)return Object.keys(a);var b=[];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c);return b},objEquiv:function(a,b){if(this.isUndefinedOrNull(a)||this.isUndefinedOrNull(b))return!1;if(a.prototype!==b.prototype)return!1;if(this.isArguments(a))return this.isArguments(b)?eql(pSlice.call(a),pSlice.call(b)):!1;try{var c,d,e=this.keys(a),f=this.keys(b);if(e.length!==f.length)return!1;for(e.sort(),f.sort(),d=e.length-1;d>=0;d--)if(e[d]!=f[d])return!1;for(d=e.length-1;d>=0;d--)if(c=e[d],!this.eql(a[c],b[c]))return!1;return!0}catch(g){return!1}}};"function"==typeof define&&define.amd&&define("validator",[],function(){return a})}("undefined"==typeof exports?this["undefined"!=typeof validatorjs_ns?validatorjs_ns:"Validator"]={}:exports);var e=function(a,b){this.__class__="ParsleyValidator",this.Validator=Validator,this.locale="en",this.init(a||{},b||{})};e.prototype={init:function(b,c){this.catalog=c;for(var d in b)this.addValidator(d,b[d].fn,b[d].priority,b[d].requirementsTransformer);a.emit("parsley:validator:init")},setLocale:function(a){if("undefined"==typeof this.catalog[a])throw new Error(a+" is not available in the catalog");return this.locale=a,this},addCatalog:function(a,b,c){return"object"==typeof b&&(this.catalog[a]=b),!0===c?this.setLocale(a):this},addMessage:function(a,b,c){return"undefined"==typeof this.catalog[a]&&(this.catalog[a]={}),this.catalog[a][b.toLowerCase()]=c,this},validate:function(){return(new this.Validator.Validator).validate.apply(new Validator.Validator,arguments)},addValidator:function(b,c,d,e){return this.validators[b.toLowerCase()]=function(b){return a.extend((new Validator.Assert).Callback(c,b),{priority:d,requirementsTransformer:e})},this},updateValidator:function(a,b,c,d){return this.addValidator(a,b,c,d)},removeValidator:function(a){return delete this.validators[a],this},getErrorMessage:function(a){var b;return b="type"===a.name?this.catalog[this.locale][a.name][a.requirements]:this.formatMessage(this.catalog[this.locale][a.name],a.requirements),""!==b?b:this.catalog[this.locale].defaultMessage},formatMessage:function(a,b){if("object"==typeof b){for(var c in b)a=this.formatMessage(a,b[c]);return a}return"string"==typeof a?a.replace(new RegExp("%s","i"),b):""},validators:{notblank:function(){return a.extend((new Validator.Assert).NotBlank(),{priority:2})},required:function(){return a.extend((new Validator.Assert).Required(),{priority:512})},type:function(b){var c;switch(b){case"email":c=(new Validator.Assert).Email();break;case"range":case"number":c=(new Validator.Assert).Regexp("^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)?(?:\\.\\d+)?$");break;case"integer":c=(new Validator.Assert).Regexp("^-?\\d+$");break;case"digits":c=(new Validator.Assert).Regexp("^\\d+$");break;case"alphanum":c=(new Validator.Assert).Regexp("^\\w+$","i");break;case"url":c=(new Validator.Assert).Regexp("(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)","i");break;default:throw new Error("validator type `"+b+"` is not supported")}return a.extend(c,{priority:256})},pattern:function(b){var c="";return/^\/.*\/(?:[gimy]*)$/.test(b)&&(c=b.replace(/.*\/([gimy]*)$/,"$1"),b=b.replace(new RegExp("^/(.*?)/"+c+"$"),"$1")),a.extend((new Validator.Assert).Regexp(b,c),{priority:64})},minlength:function(b){return a.extend((new Validator.Assert).Length({min:b}),{priority:30,requirementsTransformer:function(){return"string"!=typeof b||isNaN(b)?b:parseInt(b,10)}})},maxlength:function(b){return a.extend((new Validator.Assert).Length({max:b}),{priority:30,requirementsTransformer:function(){return"string"!=typeof b||isNaN(b)?b:parseInt(b,10)}})},length:function(b){return a.extend((new Validator.Assert).Length({min:b[0],max:b[1]}),{priority:32})},mincheck:function(a){return this.minlength(a)},maxcheck:function(a){return this.maxlength(a)},check:function(a){return this.length(a)},min:function(b){return a.extend((new Validator.Assert).GreaterThanOrEqual(b),{priority:30,requirementsTransformer:function(){return"string"!=typeof b||isNaN(b)?b:parseInt(b,10)}})},max:function(b){return a.extend((new Validator.Assert).LessThanOrEqual(b),{priority:30,requirementsTransformer:function(){return"string"!=typeof b||isNaN(b)?b:parseInt(b,10)}})},range:function(b){return a.extend((new Validator.Assert).Range(b[0],b[1]),{priority:32,requirementsTransformer:function(){for(var a=0;a<b.length;a++)b[a]="string"!=typeof b[a]||isNaN(b[a])?b[a]:parseInt(b[a],10);return b}})},equalto:function(b){return a.extend((new Validator.Assert).EqualTo(b),{priority:256,requirementsTransformer:function(){return a(b).length?a(b).val():b}})}}};var f=function(){this.__class__="ParsleyUI"};f.prototype={listen:function(){return a.listen("parsley:form:init",this,this.setupForm),a.listen("parsley:field:init",this,this.setupField),a.listen("parsley:field:validated",this,this.reflow),a.listen("parsley:form:validated",this,this.focus),a.listen("parsley:field:reset",this,this.reset),a.listen("parsley:form:destroy",this,this.destroy),a.listen("parsley:field:destroy",this,this.destroy),this},reflow:function(a){if("undefined"!=typeof a._ui&&!1!==a._ui.active){var b=this._diff(a.validationResult,a._ui.lastValidationResult);a._ui.lastValidationResult=a.validationResult,a._ui.validatedOnce=!0,this.manageStatusClass(a),this.manageErrorsMessages(a,b),this.actualizeTriggers(a),(b.kept.length||b.added.length)&&"undefined"==typeof a._ui.failedOnce&&this.manageFailingFieldTrigger(a)}},getErrorsMessages:function(a){if(!0===a.validationResult)return[];for(var b=[],c=0;c<a.validationResult.length;c++)b.push(this._getErrorMessage(a,a.validationResult[c].assert));return b},manageStatusClass:function(a){!0===a.validationResult?this._successClass(a):a.validationResult.length>0?this._errorClass(a):this._resetClass(a)},manageErrorsMessages:function(b,c){if("undefined"==typeof b.options.errorsMessagesDisabled){if("undefined"!=typeof b.options.errorMessage)return c.added.length||c.kept.length?(0===b._ui.$errorsWrapper.find(".parsley-custom-error-message").length&&b._ui.$errorsWrapper.append(a(b.options.errorTemplate).addClass("parsley-custom-error-message")),b._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(b.options.errorMessage)):b._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove();for(var d=0;d<c.removed.length;d++)this.removeError(b,c.removed[d].assert.name,!0);for(d=0;d<c.added.length;d++)this.addError(b,c.added[d].assert.name,void 0,c.added[d].assert,!0);for(d=0;d<c.kept.length;d++)this.updateError(b,c.kept[d].assert.name,void 0,c.kept[d].assert,!0)}},addError:function(b,c,d,e,f){b._ui.$errorsWrapper.addClass("filled").append(a(b.options.errorTemplate).addClass("parsley-"+c).html(d||this._getErrorMessage(b,e))),!0!==f&&this._errorClass(b)},updateError:function(a,b,c,d,e){a._ui.$errorsWrapper.addClass("filled").find(".parsley-"+b).html(c||this._getErrorMessage(a,d)),!0!==e&&this._errorClass(a)},removeError:function(a,b,c){a._ui.$errorsWrapper.removeClass("filled").find(".parsley-"+b).remove(),!0!==c&&this.manageStatusClass(a)},focus:function(a){if(!0===a.validationResult||"none"===a.options.focus)return a._focusedField=null;a._focusedField=null;for(var b=0;b<a.fields.length;b++)if(!0!==a.fields[b].validationResult&&a.fields[b].validationResult.length>0&&"undefined"==typeof a.fields[b].options.noFocus){if("first"===a.options.focus)return a._focusedField=a.fields[b].$element,a._focusedField.focus();a._focusedField=a.fields[b].$element}return null===a._focusedField?null:a._focusedField.focus()},_getErrorMessage:function(a,b){var c=b.name+"Message";return"undefined"!=typeof a.options[c]?window.ParsleyValidator.formatMessage(a.options[c],b.requirements):window.ParsleyValidator.getErrorMessage(b)},_diff:function(a,b,c){for(var d=[],e=[],f=0;f<a.length;f++){for(var g=!1,h=0;h<b.length;h++)if(a[f].assert.name===b[h].assert.name){g=!0;break}g?e.push(a[f]):d.push(a[f])}return{kept:e,added:d,removed:c?[]:this._diff(b,a,!0).added}},setupForm:function(b){b.$element.on("submit.Parsley",!1,a.proxy(b.onSubmitValidate,b)),!1!==b.options.uiEnabled&&b.$element.attr("novalidate","")},setupField:function(b){var c={active:!1};!1!==b.options.uiEnabled&&(c.active=!0,b.$element.attr(b.options.namespace+"id",b.__id__),c.$errorClassHandler=this._manageClassHandler(b),c.errorsWrapperId="parsley-id-"+("undefined"!=typeof b.options.multiple?"multiple-"+b.options.multiple:b.__id__),c.$errorsWrapper=a(b.options.errorsWrapper).attr("id",c.errorsWrapperId),c.lastValidationResult=[],c.validatedOnce=!1,c.validationInformationVisible=!1,b._ui=c,this._insertErrorWrapper(b),this.actualizeTriggers(b))},_manageClassHandler:function(b){if("string"==typeof b.optio... [truncated message content]

[osm-devel] SF.net SVN: openstamanager:[943]new_trunk/openstamanager

From: <lo...@us...> - 2014-07-28 19:12:01

Revision: 943 http://sourceforge.net/p/openstamanager/code/943Author: loviuzDate: 2014-07-28 19:11:52 +0000 (Mon, 28 Jul 2014)Log Message:-----------[CORE]bugfix variaggiunta libreria html2pdf[INTERVENTI]sistemate stampe[TIPI_INTERVENTO]aggiunto modulo completo[STATI_INTERVENTO]aggiunto modulo completoModified Paths:-------------- new_trunk/openstamanager/controller.php new_trunk/openstamanager/editor.php new_trunk/openstamanager/include/top.php new_trunk/openstamanager/lib/htmlbuilder.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/modules/interventi/edit.html new_trunk/openstamanager/share/themes/default/css/parsley/parsley.css new_trunk/openstamanager/share/themes/default/css/style.css new_trunk/openstamanager/update/update_2.0.sqlAdded Paths:----------- new_trunk/openstamanager/lib/html2pdf/ new_trunk/openstamanager/lib/html2pdf/_LGPL.txt new_trunk/openstamanager/lib/html2pdf/_changelog.txt new_trunk/openstamanager/lib/html2pdf/_class/ new_trunk/openstamanager/lib/html2pdf/_class/exception.class.php new_trunk/openstamanager/lib/html2pdf/_class/locale.class.php new_trunk/openstamanager/lib/html2pdf/_class/myPdf.class.php new_trunk/openstamanager/lib/html2pdf/_class/parsingCss.class.php new_trunk/openstamanager/lib/html2pdf/_class/parsingHtml.class.php new_trunk/openstamanager/lib/html2pdf/_class/tcpdfConfig.php new_trunk/openstamanager/lib/html2pdf/_lisez_moi.txt new_trunk/openstamanager/lib/html2pdf/_read_me.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/2dbarcodes.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/CHANGELOG.TXT new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/LICENSE.TXT new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/README.TXT new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/barcodes.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/cache/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/cache/chapter_demo_1.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/cache/chapter_demo_2.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/cache/table_data_demo.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/cache/utf8test.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/config/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/config/lang/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/config/lang/bra.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/config/lang/eng.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/config/lang/ger.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/config/lang/ita.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/config/tcpdf_config.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/config/tcpdf_config_alt.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/doc/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/doc/read_me.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/examples/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/examples/read_me.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/README.TXT new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/ZarBold.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/ZarBold.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/almohanad.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/almohanad.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/almohanad.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/arialunicid0.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/courier.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/AUTHORS new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/BUGS new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/LICENSE new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/NEWS new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/README new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/langcover.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/status.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavu-fonts-ttf-2.30/unicover.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusans.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusans.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusans.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansb.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansb.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansb.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansbi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansbi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansbi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensed.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensed.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensed.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedb.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedb.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedb.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedbi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedbi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedbi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusanscondensedi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmono.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmono.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmono.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonob.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonob.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonob.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonobi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonobi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonobi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonoi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonoi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavusansmonoi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserif.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserif.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserif.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifb.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifb.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifb.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifbi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifbi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifbi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensed.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensed.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensed.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedb.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedb.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedb.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedbi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedbi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedbi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifcondensedi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/dejavuserifi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/AUTHORS new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/COPYING new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/CREDITS new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/ChangeLog new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/INSTALL new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freefont-20090104/README new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemono.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemono.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemono.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemonob.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemonob.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemonob.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemonobi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemonobi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemonobi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemonoi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemonoi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freemonoi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesans.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesans.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesans.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesansb.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesansb.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesansb.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesansbi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesansbi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesansbi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesansi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesansi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freesansi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserif.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserif.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserif.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifb.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifb.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifb.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifbi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifbi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifbi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifi.ctg.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/freeserifi.z new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/helvetica.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/helveticab.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/helveticabi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/helveticai.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/hysmyeongjostdmedium.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/kozgopromedium.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/kozminproregular.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/msungstdlight.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/stsongstdlight.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/symbol.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/times.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/timesb.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/timesbi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/timesi.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/uni2cid_ac15.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/uni2cid_ag15.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/uni2cid_aj16.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/uni2cid_ak12.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/README.TXT new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1250.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1251.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1252.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1253.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1254.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1255.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1257.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp1258.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/cp874.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-1.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-11.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-15.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-16.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-2.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-4.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-5.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-7.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/iso-8859-9.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/koi8-r.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/enc/koi8-u.map new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/freetype6.dll new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/makeallttffonts.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/makefont.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/pfm2afm new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/pfm2afm.exe new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/src/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/src/pfm2afm-src.tar.gz new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/src/readme.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/src/ttf2ufm-src.tar.gz new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/ttf2ufm new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/ttf2ufm.exe new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/utils/zlib1.dll new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/zapfdingbats.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/fonts/zarbold.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/htmlcolors.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/images/ new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/images/read_me.txt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/qrcode.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/tcpdf.crt new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/tcpdf.fdf new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/tcpdf.php new_trunk/openstamanager/lib/html2pdf/_tcpdf_5.0.002/unicode_data.php new_trunk/openstamanager/lib/html2pdf/html2pdf.class.php new_trunk/openstamanager/lib/html2pdf/locale/ new_trunk/openstamanager/lib/html2pdf/locale/ca.csv new_trunk/openstamanager/lib/html2pdf/locale/cs.csv new_trunk/openstamanager/lib/html2pdf/locale/da.csv new_trunk/openstamanager/lib/html2pdf/locale/de.csv new_trunk/openstamanager/lib/html2pdf/locale/en.csv new_trunk/openstamanager/lib/html2pdf/locale/es.csv new_trunk/openstamanager/lib/html2pdf/locale/fr.csv new_trunk/openstamanager/lib/html2pdf/locale/it.csv new_trunk/openstamanager/lib/html2pdf/locale/nl.csv new_trunk/openstamanager/lib/html2pdf/locale/pt.csv new_trunk/openstamanager/lib/html2pdf/locale/tr.csv new_trunk/openstamanager/modules/stati_intervento/ new_trunk/openstamanager/modules/stati_intervento/actions.php new_trunk/openstamanager/modules/stati_intervento/add.html new_trunk/openstamanager/modules/stati_intervento/edit.html new_trunk/openstamanager/modules/stati_intervento/init.php new_trunk/openstamanager/modules/tipi_intervento/ new_trunk/openstamanager/modules/tipi_intervento/actions.php new_trunk/openstamanager/modules/tipi_intervento/add.html new_trunk/openstamanager/modules/tipi_intervento/edit.html new_trunk/openstamanager/modules/tipi_intervento/init.phpModified: new_trunk/openstamanager/controller.php===================================================================--- new_trunk/openstamanager/controller.php2014-07-25 13:43:56 UTC (rev 942)+++ new_trunk/openstamanager/controller.php2014-07-28 19:11:52 UTC (rev 943)@@ -38,7 +38,11 @@ echo "<div class=\"nav-tabs-custom\">\n"; echo "<ul class=\"nav nav-tabs pull-right\" role=\"tablist\">\n"; echo "<li class='pull-left active header'>\n";-echo "<a data-toggle='tab' href='#tab_1'><i class='".$modules[ $id_module ]['icon']."'></i> ".$modules[$id_module]['name']."</a>\n";++//Verifico se ho impostato un nome modulo personalizzato+( $modules[$id_module]['name2'] != '' ) ? $name=$modules[$id_module]['name2'] : $name=$modules[$id_module]['name'];++echo "<a data-toggle='tab' href='#tab_1'><i class='".$modules[ $id_module ]['icon']."'></i> ".$name."</a>\n"; echo "</li>\n"; $rsplugins = $dbo->fetchArray("SELECT *, (SELECT module_dir FROM zz_modules WHERE id=idmodule_from) AS module_dir FROM zz_modules_plugins WHERE idmodule_to=\"".$id_module."\" AND position=\"tab_main\"");@@ -125,7 +129,12 @@ //Icona di stampa else if( trim($fields[$c]) == '_print_' ){ $print_url = $rs[$r]['_print_'];-$print_url = preg_replace( '/\$(.+?)\$/', $rs[$r][${1}], $print_url );++preg_match_all( '/\$(.+?)\$/', $print_url, $matches );++for( $m=0; $m<sizeof($matches[0]); $m++ ){+$print_url = str_replace( $matches[0][$m], $rs[$r][ $matches[1][$m] ], $print_url );+} $value = "<a href='".$rootdir."/templates/".$print_url."' target='_blank'><i class='fa fa-2x fa-print'></i></a>"; }Modified: new_trunk/openstamanager/editor.php===================================================================--- new_trunk/openstamanager/editor.php2014-07-25 13:43:56 UTC (rev 942)+++ new_trunk/openstamanager/editor.php2014-07-28 19:11:52 UTC (rev 943)@@ -27,7 +27,7 @@ include( $docroot."/modules/".$module_dir."/custom/modutil.php" ); } else{-include( $docroot."/modules/".$module_dir."/modutil.php" );+@include( $docroot."/modules/".$module_dir."/modutil.php" ); } @@ -36,7 +36,7 @@ include( $docroot."/modules/".$module_dir."/custom/actions.php" ); } else{-include( $docroot."/modules/".$module_dir."/actions.php" );+@include( $docroot."/modules/".$module_dir."/actions.php" ); } @@ -74,7 +74,11 @@ echo "<div class=\"nav-tabs-custom\">\n"; echo "<ul class=\"nav nav-tabs pull-right\" role=\"tablist\">\n"; echo "<li class='pull-left active header'>\n";-echo "<a data-toggle='tab' href='#tab_1'><i class='".$modules[ $id_module ]['icon']."'></i> ".$modules[$id_module]['name']."</a>\n";++//Verifico se ho impostato un nome modulo personalizzato+( $modules[$id_module]['name2'] != '' ) ? $name=$modules[$id_module]['name2'] : $name=$modules[$id_module]['name'];++echo "<a data-toggle='tab' href='#tab_1'><i class='".$modules[ $id_module ]['icon']."'></i> ".$name."</a>\n"; echo "</li>\n"; $rsplugins = $dbo->fetchArray("SELECT *, (SELECT module_dir FROM zz_modules WHERE id=idmodule_from) AS module_dir FROM zz_modules_plugins WHERE idmodule_to=\"".$id_module."\" AND position=\"tab\"");Modified: new_trunk/openstamanager/include/top.php===================================================================--- new_trunk/openstamanager/include/top.php2014-07-25 13:43:56 UTC (rev 942)+++ new_trunk/openstamanager/include/top.php2014-07-28 19:11:52 UTC (rev 943)@@ -148,11 +148,15 @@ ( $rs[$i]['options']!="" ) ? $link=$rootdir."/controller.php?id_module=".$rs[$i]['id'] : $link="javascript:;"; +//Verifico se ho impostato un nome modulo personalizzato+( $rs[$i]['name2'] != '' ) ? $name=$rs[$i]['name2'] : $name=$rs[$i]['name'];+ echo "<li class='treeview ".$class."'>\n"; echo "<a href=\"".$link."\">\n";-echo "<i class=\"".$rs[$i]['icon']."\"></i> <span>".$rs[$i]['name']."</span>\n";+echo "<i class=\"".$rs[$i]['icon']."\"></i> <span>".$name."</span>\n"; $modules[ $rs[$i]['id'] ]['name'] = $rs[$i]['name'];+$modules[ $rs[$i]['id'] ]['name2'] = $rs[$i]['name2']; $modules[ $rs[$i]['id'] ]['icon'] = $rs[$i]['icon']; } @@ -177,10 +181,15 @@ for( $j=0; $j<sizeof($rs2); $j++ ){ ( $module_name == $rs2[$j]['name'] ) ? $attr='class="active"' : $attr='';-echo "<li $attr><a href='".$rootdir."/controller.php?id_module=".$rs2[$j]['id']."'>".$rs2[$j]['name']."</a></li>\n";++//Verifico se ho impostato un nome modulo personalizzato+( $rs2[$j]['name2'] != '' ) ? $name=$rs2[$j]['name2'] : $name=$rs2[$j]['name']; -$modules[ $rs2[$i]['id'] ]['name'] = $rs2[$i]['name'];-$modules[ $rs2[$i]['id'] ]['icon'] = $rs2[$i]['icon'];+echo "<li $attr><a href='".$rootdir."/controller.php?id_module=".$rs2[$j]['id']."'>".$name."</a></li>\n";++$modules[ $rs2[$j]['id'] ]['name'] = $rs2[$j]['name'];+$modules[ $rs2[$j]['id'] ]['name2'] = $rs2[$j]['name2'];+$modules[ $rs2[$j]['id'] ]['icon'] = $rs2[$j]['icon']; } echo "</ul>\n";Added: new_trunk/openstamanager/lib/html2pdf/_LGPL.txt===================================================================--- new_trunk/openstamanager/lib/html2pdf/_LGPL.txt (rev 0)+++ new_trunk/openstamanager/lib/html2pdf/_LGPL.txt2014-07-28 19:11:52 UTC (rev 943)@@ -0,0 +1,165 @@+ GNU LESSER GENERAL PUBLIC LICENSE+ Version 3, 29 June 2007++ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>+ Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.+++ This version of the GNU Lesser General Public License incorporates+the terms and conditions of version 3 of the GNU General Public+License, supplemented by the additional permissions listed below.++ 0. Additional Definitions.++ As used herein, "this License" refers to version 3 of the GNU Lesser+General Public License, and the "GNU GPL" refers to version 3 of the GNU+General Public License.++ "The Library" refers to a covered work governed by this License,+other than an Application or a Combined Work as defined below.++ An "Application" is any work that makes use of an interface provided+by the Library, but which is not otherwise based on the Library.+Defining a subclass of a class defined by the Library is deemed a mode+of using an interface provided by the Library.++ A "Combined Work" is a work produced by combining or linking an+Application with the Library. The particular version of the Library+with which the Combined Work was made is also called the "Linked+Version".++ The "Minimal Corresponding Source" for a Combined Work means the+Corresponding Source for the Combined Work, excluding any source code+for portions of the Combined Work that, considered in isolation, are+based on the Application, and not on the Linked Version.++ The "Corresponding Application Code" for a Combined Work means the+object code and/or source code for the Application, including any data+and utility programs needed for reproducing the Combined Work from the+Application, but excluding the System Libraries of the Combined Work.++ 1. Exception to Section 3 of the GNU GPL.++ You may convey a covered work under sections 3 and 4 of this License+without being bound by section 3 of the GNU GPL.++ 2. Conveying Modified Versions.++ If you modify a copy of the Library, and, in your modifications, a+facility refers to a function or data to be supplied by an Application+that uses the facility (other than as an argument passed when the+facility is invoked), then you may convey a copy of the modified+version:++ a) under this License, provided that you make a good faith effort to+ ensure that, in the event an Application does not supply the+ function or data, the facility still operates, and performs+ whatever part of its purpose remains meaningful, or++ b) under the GNU GPL, with none of the additional permissions of+ this License applicable to that copy.++ 3. Object Code Incorporating Material from Library Header Files.++ The object code form of an Application may incorporate material from+a header file that is part of the Library. You may convey such object+code under terms of your choice, provided that, if the incorporated+material is not limited to numerical parameters, data structure+layouts and accessors, or small macros, inline functions and templates+(ten or fewer lines in length), you do both of the following:++ a) Give prominent notice with each copy of the object code that the+ Library is used in it and that the Library and its use are+ covered by this License.++ b) Accompany the object code with a copy of the GNU GPL and this license+ document.++ 4. Combined Works.++ You may convey a Combined Work under terms of your choice that,+taken together, effectively do not restrict modification of the+portions of the Library contained in the Combined Work and reverse+engineering for debugging such modifications, if you also do each of+the following:++ a) Give prominent notice with each copy of the Combined Work that+ the Library is used in it and that the Library and its use are+ covered by this License.++ b) Accompany the Combined Work with a copy of the GNU GPL and this license+ document.++ c) For a Combined Work that displays copyright notices during+ execution, include the copyright notice for the Library among+ these notices, as well as a reference directing the user to the+ copies of the GNU GPL and this license document.++ d) Do one of the following:++ 0) Convey the Minimal Corresponding Source under the terms of this+ License, and the Corresponding Application Code in a form+ suitable for, and under terms that permit, the user to+ recombine or relink the Application with a modified version of+ the Linked Version to produce a modified Combined Work, in the+ manner specified by section 6 of the GNU GPL for conveying+ Corresponding Source.++ 1) Use a suitable shared library mechanism for linking with the+ Library. A suitable mechanism is one that (a) uses at run time+ a copy of the Library already present on the user's computer+ system, and (b) will operate properly with a modified version+ of the Library that is interface-compatible with the Linked+ Version.++ e) Provide Installation Information, but only if you would otherwise+ be required to provide such information under section 6 of the+ GNU GPL, and only to the extent that such information is+ necessary to install and execute a modified version of the+ Combined Work produced by recombining or relinking the+ Application with a modified version of the Linked Version. (If+ you use option 4d0, the Installation Information must accompany+ the Minimal Corresponding Source and Corresponding Application+ Code. If you use option 4d1, you must provide the Installation+ Information in the manner specified by section 6 of the GNU GPL+ for conveying Corresponding Source.)++ 5. Combined Libraries.++ You may place library facilities that are a work based on the+Library side by side in a single library together with other library+facilities that are not Applications and are not covered by this+License, and convey such a combined library under terms of your+choice, if you do both of the following:++ a) Accompany the combined library with a copy of the same work based+ on the Library, uncombined with any other library facilities,+ conveyed under the terms of this License.++ b) Give prominent notice with the combined library that part of it+ is a work based on the Library, and explaining where to find the+ accompanying uncombined form of the same work.++ 6. Revised Versions of the GNU Lesser General Public License.++ The Free Software Foundation may publish revised and/or new versions+of the GNU Lesser General Public License from time to time. Such new+versions will be similar in spirit to the present version, but may+differ in detail to address new problems or concerns.++ Each version is given a distinguishing version number. If the+Library as you received it specifies that a certain numbered version+of the GNU Lesser General Public License "or any later version"+applies to it, you have the option of following the terms and+conditions either of that published version or of any later version+published by the Free Software Foundation. If the Library as you+received it does not specify a version number of the GNU Lesser+General Public License, you may choose any version of the GNU Lesser+General Public License ever published by the Free Software Foundation.++ If the Library as you received it specifies that a proxy can decide+whether future versions of the GNU Lesser General Public License shall+apply, that proxy's public statement of acceptance of any version is+permanent authorization for you to choose that version for the+Library.Property changes on: new_trunk/openstamanager/lib/html2pdf/_LGPL.txt___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/lib/html2pdf/_changelog.txt===================================================================--- new_trunk/openstamanager/lib/html2pdf/_changelog.txt (rev 0)+++ new_trunk/openstamanager/lib/html2pdf/_changelog.txt2014-07-28 19:11:52 UTC (rev 943)@@ -0,0 +1,314 @@+4.03 (2011-05-27)+ correction de l'exemple "form.php" : vulnérabilité cross-site scripting corrigée+ correction sur la gestion des retours à la ligne automatique+ correction sur le calcul de la hauteur des balises H1->H6+ amélioration de la gestion des exceptions++4.02 (2011-04-29)+ ATTENTION : beaucoup de changements dans la structure du projet. version 3.xx abandonnée+ uniformisation des fichiers du projet (standard Zend)+ conversion des fichiers de langue en CSV, déplacement dans le répertoire "locale". création d'une classe spécifique à la gestion des locales+ amélioration de la gestion de certaines erreurs+ modification du nom de toutes les sous classes+ déplacement de toutes les sous classes+ modification du nom de toutes les méthodes protected+ correction sur la gestion des tables+ correction sur la lecture des path des SVG+ premiere version de text-align:justify+ correction sur la gestion de la balise BLOCKQUOTE+ correction sur la gestion de la balise P+ gestion des styles CSS pour les balises TEXTAREA, SELECT, INPUT+ ajout de la propriété pagegroup="new" sur la balise PAGE+ correction pour la balise INPUT de type radio : checked au lieu de selected++3.30 / 4.01 (2010-05-07)+ correction sur la gestion des textes+ correction sur le parseur HTML+ correction sur la gestion de border-collapse+ correction sur la gestion des TDs, H1->H6+ ajout des balises fieldset et legend (cf exemple 4)+ ajout de la langue CS+ nombreuses améliorations+ v4.01 uniquement : Utilisation de TCPDF 5.0.002+ v4.01 uniquement : Utilisation des QR-code de TCPDF, il n'y a plus besoin d'une librairie externe+ v4.01 uniquement : Utilisation des exceptions PHP pour les erreurs. Tous les exemples ont été mis à jour en consequence+ (merci à Pavel Kochman pour ses sugestions et ses ajouts)++3.29 / 4.00 (2010-03-17)+ modification des barcodes. ATTENTION : bar_w et bar_h n'existent plus !+ correction sur la gestion de page_footer+ correction sur la gestion des html entities+ correction sur le positionnement des textes+ correction sur le positionnement des tableaux+ nombreuses corrections sur les positionnements, les couleurs, ...+ amélioration de la partie SVG (balise G, ...)+ amélioration sur createIndex+ harmonisation des noms des méthodes+ correction sur la gestion des textes+ v4.00 uniquement : HTML2PDF est maintenant écrit en PHP5 et basé sur TCPDF (=> unicode, utf8, ...)+ v4.00 uniquement : utilisation de TCPDF pour les formulaires et les barcodes+ v4.00 uniquement : amélioration de la partie SVG (alpha)++3.28 (2010-01-18)+ ajout de la gestion de la balise label+ correction pour compatibilité PHP4++3.27 (2010-01-11)+ correction sur page_header et page_footer+ ajout de la possibilité de pouvoir mettre l'index automatique dans la page que l'on veut+ correction sur la gestion du canal alpha pour les PNGs+ correction sur la gestion des border-radius (cf exemple radius) conforme au CSS3+ correction sur la gestion du background-color+ correction sur la gestion de thead, tfoot, et tbody+ ajout du dessin verctoriel (cf exemples draw, tigre, sapin)+ ajout de la propriété label="none/label" pour la balise <barcode>+ nombreux petit* correctifs++3.26 (2009-11-16)+ correction pour support des images générés en CGI+ ajout de la gestion du canal alpha pour les PNGs (nécessite GD2)+ ajout de la méthode setDefaultFont permettant de spécifier une fonte par défaut+ ajout de la propriété format pour la balise <page> (cf exemple 4)+ amélioration de la gestion des couleurs css RGB (cf exemple 2)+ ajout de la gestion des couleurs css CMYK (cf exemple 2)+ ajout de la propriété css overflow:hidden pour la balise <div> (cf exemple 2)+ correction sur page_header et page_footer+ ajout de la possibilité de pouvoir directement convertir le résultat d'une vraie page HTML+ nombreux petit* correctifs sur les styles++3.25 (2009-10-07)+ correctif sur le calcul des tableaux dans le page_footer+ correctif sur l'interprétation des espaces entre certaines balises+ correction sur la gestion des balises H1, H2, H3, H4, H5, H6+ correction sur la gestion de la balise table+ support des balises xhtml du type <span />+ ajout des balises COL (cf exemple 5), DEL, INS, et QRCODE (cf exemple 13)+ ajout de la propriété css text-transform+ ajout de la propriété css rotate (uniquement sur les DIV, cf exemple 8)+ ne plus rendre obligatoire l'existence d'une image (nouvelle méthode setTestIsImage)+ ajout d'un mode DEBUG - les anciennes fonction d'analyse des ressources ont été supprimées+ ajout de la méthode setEncoding+ ajout de la langue danoise DA (merci à Daniel K.)++3.24 (2009-08-05)+ correction sur le calcul de la largeur des divs+ modification pour compatibilité avec la localisation PHP+ modification pour compatibilité avec PHP 5.3.0++3.23 (2009-07-30)+ correction sur le calcul des DIVs+ correction sur l'interpretation de certains styles CSS+ correction de la fonction de creation d'index automatique CreateIndex+ ATTENTION : la methode d'appel de CreateIndex a changé. Regardez l'exemple About !!!!++3.22a (2009-06-16)+ redistribution de HTML2PDF sous la licence LGPL !!! (au lieu de GPL)++3.22 (2009-06-08)+ correction sur le background-color+ refonte totale de la gestion de text-align. les valeurs center et right marchent maintenant meme en cas de contenu riche++3.21 (2009-05-05)+ ajout de la propriété css FLOAT pour la balise IMG+ correction sur la gestion des TFOOT+ correction sur le positionnement des images++3.20 (2009-04-06)+ ajout de la gestion des margins pour la balise DIV+ ajout de la gestion de la propriete css LINE-HEIGHT+ correction sur l'interpretation de la valeur de certains styles CSS (background-image, background-position, ...)+ correction sur la reconnaissance des balises thead et tfoot+ correction sur la balise select+ correction sur les fichiers de langue (merci à Sinan)++3.19 (2009-03-11)+ optimisation du parseur HTML - merci à Jezelinside+ ajout de la balise TFOOT+ amélioration de la gestion des tableaux : les contenus des balises THEAD et TFOOT sont maintenant répétés sur chaque page.+ ajout de la balise spécifique BOOKMARK afin de créer des "marques-page"+ possibilité de rajouter un index automatique en fin de fichier+ ajout de la langue turque TR (merci à Hidayet)+ amélioration de la méthode Output. Elle est maintenant également utilisable comme celle de FPDF++3.18 (2009-02-22)+ correction sur les sauts de page automatique pour les balises TABLE, UL, OL+ correction sur l'interpretation des styles pour la balise HR+ correction sur l'interpretation du style border-collapse pour la balise TABLE+ prise en compte de margin:auto pour les tables et les divs+ les commentaires dans les CSS sont acceptés++3.17 (2008-12-30)+ ajout de la gestion des balises INPUT (text, radio, checkbox, button, hidden, ...), SELECT, OPTION, TEXTAREA (cf exemple 14)+ ajout de la possibilité de mettre des scripts dans le pdf, via $html2pdf->pdf->IncludeJS(...); (cf exemples JS)+ correction sur le saut de page automatique pour les images+ correction sur les sauts de lignes automatiques pour certaines balises (UL, P, ...)+ ajout de la langue NL (merci à Roland)++3.16 (2008-12-09)+ ajout de la gestion de list-style: none (cf exemple 13)+ correction dans la gestion des fontes ajoutées à fpdf (via la méthode AddFont)+ nombreuses corrections sur le calcul des largeurs des éléments table, div, hr, td, th+ ajout de l'exemple about.php+ (pour info, les PDF générés à partir des exemples sont maintenant dans le répertoire /exemples/pdf/, et sont supprimables)++3.15 (2008-12-01)+ correction sur l'identification des styles en cas de valeurs multiples dans la propriete class+ prise en compte de border-radius pour la limite des backgrounds (color et image)+ ajout des proprietes CSS border-top-*, border-right-*, border-bottom-*, border-left-*+ ajout de la propriété CSS list-style-image (cf exemple 12)+ pour la balise table, ajout de l'interprétation de align="center" et align="right" (cf exemple 1)+ correction dans le positionnement des images+ correction de quelques bugs+ ajout d'une fonction d'analyse des ressources HTML2PDFgetTimerDebug (cf début du fichier html2pdf.class.php)++3.14 (2008-11-17)+ ajout d'une langue (pt : Brazilian Portuguese language) et amelioration de la methode vueHTML (merci à Rodrigo)+ correction du positionnement du contenu des DIVs. gestion des proprietes valign et align+ ajout de la propriete CSS border-collapse (cf exemple 0)+ ajout de la propriete CSS border-radius (cf exemple 1)+ correction de quelques bugs++3.13 (2008-09-24)+ reecriture de la balise hr, avec prise en compte des styles (cf exemple 0)+ ajout de la propriete backcolor pour la balise page (cf exemple 9)+ ajout des proprietes backleft et backright pour la balise page afin de pouvoir changer les marges des pages (cf exemple 8)+ nombreuses corrections sur les balises et les styles++3.12 (2008-09-16)+ ajout des balises ol, ul, li (cf exemple 12)+ correction sur le calcul de la taille des td en cas de colspan et rowspan+ ajout de la méthode setTestTdInOnePage afin de pouvoir desactiver le test sur la taille des TD (cf exemple 11)+ correction de quelques bugs++3.11 (2008-08-29)+ ajout des balises div, p, pre, s+ gestion des styles CSS position (relative, absolute), left, top, right, bottom (cf exemple 10)+ meilleur gestion des border : border-style, border-color, border-width (cf exemple 10)+ possibilité d'indiquer les marges par défault, via le constructeur (cf exemple 2)++3.10a (2008-08-26)+ correction pour compatibilité php4 / php5++3.10 (2008-08-25)+ ajout des liens internes (cf exemple 7)+ gestion complete des background : image, repeat, position, color (cf exemple 1)+ gestion de underline, overline, linethrough (cf exemple 2)+ correction de quelques bugs++3.09+ mise à jour vers fpdf version 1.6, ajout de barcode, correction de l'affichage de certains caractères spéciaux+ correction du calcul de la hauteur de ligne de la balise br+ detection en cas de contenu trop grand dans un TD+ amélioration de la balise page (ajout de l'attribue pageset, avec les valeurs new et old)+ ajout de FPDF_PROTECTION, accesible via $pdf->pdf->SetProtection(...)++3.08+ version opérationnelle de page_header+ ajout de page_footer+ correction des borders des tableaux++3.07+ correction de l'interpretation de cellspacing,+ amélioration de la balise page_header++3.06+ première gestion de la balise page_header+ correction des dimensions des tableaux++3.05+ ajout de la propriété vertical-align+ ajout de la gestion des fichiers de langue++3.04+ correction du saut de page automatique pour les tableaux+ Ajout de propriétés à la balise PAGE++3.03+ correction de bugs au niveau de la gestion des images PHP par FPDF+ meilleure gestion des erreurs++3.02+ ajout de la gestion des noms des couleurs+ correction de la gestion des images générées par php+ correction de quelques bugs++3.01+ correction de quelques bugs+ ajout d'une protection pour les balises non existantes++3.00+ refonte totale du calcul des tableaux+ Prise en compte des colspan et rowspan+ +2.85+ ajout de la propriété cellspacing+ nouvelle gestion des padding des tableaux++2.80+ ajout des types de border dotted et dasheds++2.75+ ajout des top, left, right, bottom pour padding et border++2.70+ correction de la balise HR, ajout de la propriété padding pour les table, th, td+ correction des dimensions, les unités px, mm, in, pt sont enfin réellement reproduites, correction de font-size, border, ...+ ajout d'une propriété à la balise page : footer+ correction dans l'affichage et le calcul des tables++2.55+ vérification de la validité du code (ouverture / fermeture)+ ajout des unités mm, in, pt++2.50+ correction de nobreak+ correction des marges+ ajout de nombreuses balises++2.40+ refonte totale de l'identification des styles CSS (Les héritages marchent)++2.39+ corrections diverses+ ajout de certaines propriétés (bgcolor, ...)++2.38+ meilleur identification des propriétés border et color++2.37+ nombreuses corrections :+ balise A+ couleur de fond+ retour à la ligne+ gestion des images dans un texte++2.36+ ajout de la balises STRONG+ ajout de la balise EM++2.35+ amélioration de la gestion des feuilles de style++2.31+ correction de quelques bugs++2.30+ première version opérationnel des feuilles de style++2.25+ ajout de la balise LINK pour le type text/css++2.20+ premier jet de la gestion des feuilles de style, ajout de la balise STYLE++2.15+ n'interpréte plus l'HTML en commentaire <!-- -->++2.10+ ajout des balises H1 -> H6++2.01+ correction de quelques bugs++2.00+ première version diffusée\ No newline at end of fileProperty changes on: new_trunk/openstamanager/lib/html2pdf/_changelog.txt___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/lib/html2pdf/_class/exception.class.php===================================================================--- new_trunk/openstamanager/lib/html2pdf/_class/exception.class.php (rev 0)+++ new_trunk/openstamanager/lib/html2pdf/_class/exception.class.php2014-07-28 19:11:52 UTC (rev 943)@@ -0,0 +1,169 @@+<?php+/**+ * HTML2PDF Librairy - HTML2PDF Exception+ *+ * HTML => PDF convertor+ * distributed under the LGPL License+ *+ * @author Laurent MINGUET <web...@ht...>+ * @version 4.03+ */++class HTML2PDF_exception extends exception+{+ protected $_tag = null;+ protected $_html = null;+ protected $_other = null;+ protected $_image = null;+ protected $_messageHtml = '';++ /**+ * generate a HTML2PDF exception+ *+ * @param int $err error number+ * @param mixed $other additionnal informations+ * @return string $html optionnal code HTML associated to the error+ */+ final public function __construct($err = 0, $other = null, $html = '')+ {+ // read the error+ switch($err)+ {+ case 1: // Unsupported tag+ $msg = (HTML2PDF_locale::get('err01'));+ $msg = str_replace('[[OTHER]]', $other, $msg);+ $this->_tag = $other;+ break;++ case 2: // too long sentence+ $msg = (HTML2PDF_locale::get('err02'));+ $msg = str_replace('[[OTHER_0]]', $other[0], $msg);+ $msg = str_replace('[[OTHER_1]]', $other[1], $msg);+ $msg = str_replace('[[OTHER_2]]', $other[2], $msg);+ break;++ case 3: // closing tag in excess+ $msg = (HTML2PDF_locale::get('err03'));+ $msg = str_replace('[[OTHER]]', $other, $msg);+ $this->_tag = $other;+ break;++ case 4: // tags closed in the wrong order+ $msg = (HTML2PDF_locale::get('err04'));+ $msg = str_replace('[[OTHER]]', print_r($other, true), $msg);+ break;++ case 5: // unclosed tag+ $msg = (HTML2PDF_locale::get('err05'));+ $msg = str_replace('[[OTHER]]', print_r($other, true), $msg);+ break;++ case 6: // image can not be loaded+ $msg = (HTML2PDF_locale::get('err06'));+ $msg = str_replace('[[OTHER]]', $other, $msg);+ $this->_image = $other;+ break;++ case 7: // too big TD content+ $msg = (HTML2PDF_locale::get('err07'));+ break;++ case 8: // SVG tag not in DRAW tag+ $msg = (HTML2PDF_locale::get('err08'));+ $msg = str_replace('[[OTHER]]', $other, $msg);+ $this->_tag = $other;+ break;++ case 9: // deprecated+ $msg = (HTML2PDF_locale::get('err09'));+ $msg = str_replace('[[OTHER_0]]', $other[0], $msg);+ $msg = str_replace('[[OTHER_1]]', $other[1], $msg);+ $this->_tag = $other[0];+ break;++ case 0: // specific error+ default:+ $msg = $other;+ break;+ }++ // create the HTML message+ $this->_messageHtml = '<span style="color: #AA0000; font-weight: bold;">'.HTML2PDF_locale::get('txt01', 'error: ').$err.'</span><br>';+ $this->_messageHtml.= HTML2PDF_locale::get('txt02', 'file:').' '.$this->file.'<br>';+ $this->_messageHtml.= HTML2PDF_locale::get('txt03', 'line:').' '.$this->line.'<br>';+ $this->_messageHtml.= '<br>';+ $this->_messageHtml.= $msg;++ // create the text message+ $msg = HTML2PDF_locale::get('txt01', 'error: ').$err.' : '.strip_tags($msg);++ // add the optionnal html content+ if ($html) {+ $this->_messageHtml.= "<br><br>HTML : ...".trim(htmlentities($html)).'...';+ $this->_html = $html;+ $msg.= ' HTML : ...'.trim($html).'...';+ }++ // save the other informations+ $this->_other = $other;++ // construct the exception+ parent::__construct($msg, $err);+ }++ /**+ * get the message as string+ *+ * @access public+ * @return string $messageHtml+ */+ public function __toString()+ {+ return $this->_messageHtml;+ }++ /**+ * get the html tag name+ *+ * @access public+ * @return string $tagName+ */+ public function getTAG()+ {+ return $this->_tag;+ }++ /**+ * get the optional html code+ *+ * @access public+ * @return string $html+ */+ public function getHTML()+ {+ return $this->_html;+ }++ /**+ * get the optional other informations+ *+ * @access public+ * @return mixed $other+ */+ public function getOTHER()+ {+ return $this->_other;+ }++ /**+ * get the image source+ *+ * @access public+ * @return string $imageSrc+ */+ public function getIMAGE()+ {+ return $this->_image;+ }+}+?>Property changes on: new_trunk/openstamanager/lib/html2pdf/_class/exception.class.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/lib/html2pdf/_class/locale.class.php===================================================================--- new_trunk/openstamanager/lib/html2pdf/_class/locale.class.php (rev 0)+++ new_trunk/openstamanager/lib/html2pdf/_class/locale.class.php2014-07-28 19:11:52 UTC (rev 943)@@ -0,0 +1,97 @@+<?php+/**+ * HTML2PDF Librairy - HTML2PDF Locale+ *+ * HTML => PDF convertor+ * distributed under the LGPL License+ *+ * @author Laurent MINGUET <web...@ht...>+ * @version 4.03+ */++class HTML2PDF_locale+{+ /**+ * code of the current used locale+ * @var string+ */+ static protected $_code = null;++ /**+ * texts of the current used locale+ * @var array+ */+ static protected $_list = array();++ /**+ * directory where locale files are+ * @var string+ */+ static protected $_directory = null;++ /**+ * load the locale+ *+ * @access public+ * @param string $code+ */+ static public function load($code)+ {+ if (self::$_directory===null) {+ self::$_directory = dirname(dirname(__FILE__)).'/locale/';+ }++ // must be in lower case+ $code = strtolower($code);++ // must be [a-z-0-9]+ if (!preg_match('/^([a-z0-9]+)$/isU', $code)) {+ throw new HTML2PDF_exception(0, 'invalid language code ['.self::$_code.']');+ }++ // save the code+ self::$_code = $code;++ // get the name of the locale file+ $file = self::$_directory.self::$_code.'.csv';++ // the file must exist+ if (!is_file($file)) {+ throw new HTML2PDF_exception(0, 'language code ['.self::$_code.'] unknown. You can create the translation file ['.$file.'] and send it to the webmaster of html2pdf in order to integrate it into a future release');+ }++ // load the file+ self::$_list = array();+ $handle = fopen($file, 'r');+ while (!feof($handle)) {+ $line = fgetcsv($handle);+ if (count($line)!=2) continue;+ self::$_list[trim($line[0])] = trim($line[1]);+ }+ fclose($handle);+ }++ /**+ * clean the locale+ *+ * @access public static+ */+ static public function clean()+ {+ self::$_code = null;+ self::$_list = array();+ }++ /**+ * get a text+ *+ * @access public static+ * @param string $key+ * @return string+ */+ static public function get($key, $default='######')+ {+ return (isset(self::$_list[$key]) ? self::$_list[$key] : $default);+ }+}+?>Property changes on: new_trunk/openstamanager/lib/html2pdf/_class/locale.class.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/lib/html2pdf/_class/myPdf.class.php===================================================================--- new_trunk/openstamanager/lib/html2pdf/_class/myPdf.class.php (rev 0)+++ new_trunk/openstamanager/lib/html2pdf/_class/myPdf.class.php2014-07-28 19:11:52 UTC (rev 943)@@ -0,0 +1,1416 @@+<?php+/**+ * HTML2PDF Librairy - myPdf class+ *+ * HTML => PDF convertor+ * distributed under the LGPL License+ *+ * @author Laurent MINGUET <web...@ht...>+ * @version 4.03+ */++require_once(dirname(__FILE__).'/tcpdfConfig.php');+require_once(dirname(__FILE__).'/../_tcpdf_'.HTML2PDF_USED_TCPDF_VERSION.'/tcpdf.php');++class HTML2PDF_myPdf extends TCPDF+{+ protected $_footerParam = array();+ protected $_transf = array();+ protected $_myLastPageGroup = null;+ protected $_myLastPageGroupNb = 0;++ // used to make a radius with bezier : (4/3 * (sqrt(2) - 1))+ const MY_ARC = 0.5522847498;++ // nb of segment to build a arc with bezier curv+ const ARC_NB_SEGMENT = 8;++ /**+ * class constructor+ *+ * @param string $orientation page orientation, same as TCPDF+ * @param string $unit User measure unit, same as TCPDF+ * @param mixed $format The format used for pages, same as TCPDF+ * @param boolean $unicode TRUE means that the input text is unicode (default = true)+ * @param String $encoding charset encoding; default is UTF-8+ * @param boolean $diskcache if TRUE reduce the RAM memory usage by caching temporary data on filesystem (slower).+ * @access public+ */+ public function __construct(+ $orientation='P',+ $unit='mm',+ $format='A4',+ $unicode=true,+ $encoding='UTF-8',+ $diskcache=false)+ {+ // call the parent constructor+ parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache);++ // init the specific parameters used by HTML2PDF+ $this->SetCreator(PDF_CREATOR);+ $this->SetAutoPageBreak(false, 0);+ $this->linestyleCap = '2 J';+ $this->setPrintHeader(false);+ $this->jpeg_quality = 90;++ // prepare the automatic footer+ $this->SetMyFooter();++ $this->cMargin = 0;+ }++ /**+ * Set the parameters for the automatic footer+ *+ * @param boolean $page display the page number+ * @param boolean $date display the date+ * @param boolean $hour display the hour+ * @param boolean $form display a warning abour forms+ * @access public+ */+ public function SetMyFooter($page = false, $date = false, $hour = false, $form = false)+ {+ $page = ($page ? true : false);+ $date = ($date ? true : false);+ $hour = ($hour ? true : false);+ $form = ($form ? true : false);++ $this->_footerParam = array('page' => $page, 'date' => $date, 'hour' => $hour, 'form' => $form);+ }++ /**+ * This function is call automatically by TCPDF at the end of a page+ * It takes no parameters+ *+ * @access public+ */+ public function Footer()+ {+ // prepare the text from the tranlated text+ $txt = '';+ if ($this->_footerParam['form']) {+ $txt = (HTML2PDF_locale::get('pdf05'));+ }+ if ($this->_footerParam['date'] && $this->_footerParam['hour']) {+ $txt.= ($txt ? ' - ' : '').(HTML2PDF_locale::get('pdf03'));+ }+ if ($this->_footerParam['date'] && !$this->_footerParam['hour']) {+ $txt.= ($txt ? ' - ' : '').(HTML2PDF_locale::get('pdf01'));+ }+ if (!$this->_footerParam['date'] && $this->_footerParam['hour']) {+ $txt.= ($txt ? ' - ' : '').(HTML2PDF_locale::get('pdf02'));+ }+ if ($this->_footerParam['page']) {+ $txt.= ($txt ? ' - ' : '').(HTML2PDF_locale::get('pdf04'));+ }++ if (strlen($txt)>0) {+ // replace some values+ $toReplace = array(+ '[[date_d]]' => date('d'),+ '[[date_m]]' => date('m'),+ '[[date_y]]' => date('Y'),+ '[[date_h]]' => date('H'),+ '[[date_i]]' => date('i'),+ '[[date_s]]' => date('s'),+ '[[page_cu]]' => $this->getMyNumPage(),+ '[[page_nb]]' => $this->getMyAliasNbPages(),+ );+ $txt = str_replace(array_keys($toReplace), array_values($toReplace), $txt);++ // draw the footer+ parent::SetY(-11);+ $this->SetFont('helvetica', 'I', 8);+ $this->Cell(0, 10, $txt, 0,... [truncated message content]

[osm-devel] SF.net SVN: openstamanager:[944]new_trunk/openstamanager

From: <lo...@us...> - 2014-08-01 18:47:23

Revision: 944 http://sourceforge.net/p/openstamanager/code/944Author: loviuzDate: 2014-08-01 18:47:16 +0000 (Fri, 01 Aug 2014)Log Message:-----------COREbugfix: visualizzazione e modifica recordMY_IMPIANTIaggiunto modulo con relativi pluginANAGRAFICHEmodifica procedura di salvataggio che dava erroreModified Paths:-------------- new_trunk/openstamanager/controller.php new_trunk/openstamanager/core.php new_trunk/openstamanager/editor.php new_trunk/openstamanager/lib/htmlbuilder.php new_trunk/openstamanager/modules/anagrafiche/actions.php new_trunk/openstamanager/modules/interventi/edit.html new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.anagrafiche.php new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.interventi.php new_trunk/openstamanager/modules/stati_intervento/actions.php new_trunk/openstamanager/update/update_2.0.sqlAdded Paths:----------- new_trunk/openstamanager/modules/interventi/plugins/ new_trunk/openstamanager/modules/interventi/plugins/my_impianti.interventi.php new_trunk/openstamanager/modules/my_impianti/actions.php new_trunk/openstamanager/modules/my_impianti/edit.html new_trunk/openstamanager/modules/my_impianti/init.php new_trunk/openstamanager/modules/my_impianti/modutil.php new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.componenti.phpModified: new_trunk/openstamanager/controller.php===================================================================--- new_trunk/openstamanager/controller.php2014-07-28 19:11:52 UTC (rev 943)+++ new_trunk/openstamanager/controller.php2014-08-01 18:47:16 UTC (rev 944)@@ -230,7 +230,16 @@ //Inclusione contenuti varie tab dei plugin for( $p=0; $p<sizeof($rsplugins); $p++ ){ echo "<div id='tab_".($p+2)."' class='tab-pane'>\n";-include( $docroot."/modules/".$rsplugins[$p]['module_dir']."/plugins/".$rsplugins[$p]['script'] );++//Inclusione di eventuale plugin personalizzato+if( file_exists($docroot."/modules/".$rsplugins[$p]['module_dir']."/plugins/custom/".$rsplugins[$p]['script']) ){+include( $docroot."/modules/".$rsplugins[$p]['module_dir']."/plugins/custom/".$rsplugins[$p]['script'] );+}++else{+include( $docroot."/modules/".$rsplugins[$p]['module_dir']."/plugins/".$rsplugins[$p]['script'] );+}+ echo "</div>\n"; } Modified: new_trunk/openstamanager/core.php===================================================================--- new_trunk/openstamanager/core.php2014-07-28 19:11:52 UTC (rev 943)+++ new_trunk/openstamanager/core.php2014-08-01 18:47:16 UTC (rev 944)@@ -97,4 +97,20 @@ $_SESSION['period_start'] = $html->form('period_start'); $_SESSION['period_end'] = $html->form('period_end'); }++++/*+Creazione array con l'elenco dei moduli+es.+$modules['Anagrafiche']['nome_campo'];+*/+$rs = $dbo->fetchArray("SELECT * FROM zz_modules");+$modules_info = array();++for( $i=0; $i<sizeof($rs); $i++ ){+foreach( $rs[$i] as $idx => $value ){+$modules_info[ $rs[$i]['name'] ][$idx] = $value;+}+} ?>Modified: new_trunk/openstamanager/editor.php===================================================================--- new_trunk/openstamanager/editor.php2014-07-28 19:11:52 UTC (rev 943)+++ new_trunk/openstamanager/editor.php2014-08-01 18:47:16 UTC (rev 944)@@ -70,7 +70,10 @@ } -//Lettura eventuali plugins modulo da inserire come tab++/*+Lettura eventuali plugins modulo da inserire come tab+*/ echo "<div class=\"nav-tabs-custom\">\n"; echo "<ul class=\"nav nav-tabs pull-right\" role=\"tablist\">\n"; echo "<li class='pull-left active header'>\n";@@ -97,7 +100,16 @@ for( $p=0; $p<sizeof($rsplugins); $p++ ){ echo "<div id='tab_".($p+2)."' class='tab-pane'>\n";-include( $docroot."/modules/".$rsplugins[$p]['module_dir']."/plugins/".$rsplugins[$p]['script'] );++//Inclusione di eventuale plugin personalizzato+if( file_exists($docroot."/modules/".$rsplugins[$p]['module_dir']."/plugins/custom/".$rsplugins[$p]['script']) ){+include( $docroot."/modules/".$rsplugins[$p]['module_dir']."/plugins/custom/".$rsplugins[$p]['script'] );+}++else{+include( $docroot."/modules/".$rsplugins[$p]['module_dir']."/plugins/".$rsplugins[$p]['script'] );+}+ echo "</div>\n"; } Modified: new_trunk/openstamanager/lib/htmlbuilder.php===================================================================--- new_trunk/openstamanager/lib/htmlbuilder.php2014-07-28 19:11:52 UTC (rev 943)+++ new_trunk/openstamanager/lib/htmlbuilder.php2014-08-01 18:47:16 UTC (rev 944)@@ -21,6 +21,9 @@ function build_html_element( $str, $records ){ global $dbo; global $records;+global $rootdir;+global $docroot;+global $modules_info; global $id_module; global $id_record; @@ -28,48 +31,25 @@ $str = str_replace( "{[", "{", $str ); $str = str_replace( "]}", "}", $str ); $json = json_decode( $str, true );- //Attributi particolari ( $json['required'] == 1 ) ? $attr='required="true"' : $attr=''; ( $json['maxlength'] != '' ) ? $attr.=' maxlength="'.$json['maxlength'].'"' : $attr.=''; -//Lettura valore di default-if( $json['value'] != '' ){-if( preg_match('/^\$(.+?)\$$/', $json['value']) ){-$db_field_name = str_replace( "$", "", $json['value'] );-$value = $records[0][ $db_field_name ];+//Conversione variabili con campi di database+foreach( $json as $name => $value ){+//Sostituzione delle variabili $nome$ col relativo valore da database+if( preg_match_all('/\$([a-z0-9\_]+)\$/i', $json[$name], $m) ){+for( $i=0; $i<sizeof($m[0]); $i++ ){+$json[$name] = str_replace( $m[0][$i], $records[0][ $m[1][$i] ], $json[$name] );+} }--else{-$value = $json['value'];-} } -else{-$value = "";-}---//Conversione variabili con campi di database+$value = $json['value']; $values = $json['values']; -if( preg_match_all('/<\?php(.+?)\?>/i', $values, $m) ){-for( $i=0; $i<sizeof($m[0]); $i++ ){-$val = $m[0][$i];-$val = str_replace( '<?php', '', $val );-$val = str_replace( '?>', '', $val );--eval( '$values = str_replace( $m[0][$i], '.$val.', $values );' );-}-} -if( preg_match_all('/\$([^\$]+)\$/', $values, $m) ){-for( $i=0; $i<sizeof($m[0]); $i++ ){-$db_field_name = str_replace( "$", "", $m[0][$i] );-$values = str_replace( $m[0][$i], $records[0][ $db_field_name ], $values );-}-} @@ -92,7 +72,6 @@ $html .= "<span class='input-group-addon'>".$json['icon-before']."</span>\n"; } - switch( $json['type'] ){ case 'text': case 'date':@@ -151,6 +130,10 @@ $html .= "<textarea class='form-control ".$json['class']."' name='".$json['name']."' id='".$json['name']."' ".$json['extra']." ".$attr.">".$value."</textarea>\n"; break; +case 'link':+$html .= "<a href='".$json['href']."' class='".$json['class']."' id='".$json['name']."' ".$attr." ".$json['extra'].">".$value."</a>\n";+break;+ default: $html .= "<span class='form-control ".$json['class']."' id='".$json['name']."' ".$attr." ".$json['extra'].">".$value."</span>\n"; break;Modified: new_trunk/openstamanager/modules/anagrafiche/actions.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/actions.php2014-07-28 19:11:52 UTC (rev 943)+++ new_trunk/openstamanager/modules/anagrafiche/actions.php2014-08-01 18:47:16 UTC (rev 944)@@ -5,7 +5,7 @@ switch( $html->form('op', 'post') ){ case "update":-$idanagrafica = $_POST['idanagrafica'];+$idanagrafica = $_POST['id_record']; if( $permessi[$module_name] == 'rw' ){ //leggo tutti i valori passati dal POST e li salvo in un arrayModified: new_trunk/openstamanager/modules/interventi/edit.html===================================================================--- new_trunk/openstamanager/modules/interventi/edit.html2014-07-28 19:11:52 UTC (rev 943)+++ new_trunk/openstamanager/modules/interventi/edit.html2014-08-01 18:47:16 UTC (rev 944)@@ -73,11 +73,11 @@ </div> <div class="col-md-3">-{[ "type": "text", "label": "Data richiesta", "name": "data_richiesta", "required": 1, "class": "datepicker text-center", "value": "<?php echo date('d/m/Y') ?>", "extra": "" ]}+{[ "type": "text", "label": "Data richiesta", "name": "data_richiesta", "required": 1, "class": "datepicker text-center", "value": "<?php echo date('d/m/Y', strtotime($records[0]['data_richiesta'])) ?>", "extra": "" ]} </div> <div class="col-md-3">-{[ "type": "text", "label": "Data intervento", "name": "data", "required": 1, "class": "datepicker text-center", "value": "<?php echo date('d/m/Y') ?>", "extra": "" ]}+{[ "type": "text", "label": "Data intervento", "name": "data", "required": 1, "class": "datepicker text-center", "value": "<?php echo date('d/m/Y', strtotime($records[0]['data'])) ?>", "extra": "" ]} </div> <div class="col-md-3">Added: new_trunk/openstamanager/modules/interventi/plugins/my_impianti.interventi.php===================================================================--- new_trunk/openstamanager/modules/interventi/plugins/my_impianti.interventi.php (rev 0)+++ new_trunk/openstamanager/modules/interventi/plugins/my_impianti.interventi.php2014-08-01 18:47:16 UTC (rev 944)@@ -0,0 +1,24 @@+<?php+//INTERVENTI ESEGUITI SU QUESTO IMPIANTO+echo "<h3>Interventi eseguiti su ".$id_record."</h3>\n";++$rs2 = $dbo->fetchArray("SELECT in_interventi.idintervento, descrizione, data FROM my_impianti_interventi INNER JOIN in_interventi ON my_impianti_interventi.idintervento=in_interventi.idintervento WHERE matricola=\"".$id_record."\" ORDER BY data DESC");++if( sizeof($rs2)<=0 ){+echo "... Nessun intervento su questo impianto ...<br>\n";+}++else{+echo "<table class='table table-striped table-hover'>\n";+echo "<tr><th width='25%'>Intervento</th>\n";+echo "<th>Descrizione</th></tr>\n";++for( $j=0; $j<sizeof($rs2); $j++ ){+echo "<tr><td><a href=\"".$rootdir."/editor.php?id_module=".$modules_info['Interventi']['id']."&id_record=".$rs2[$j]['idintervento']."\" title=\"Clicca per aprire l'intervento su una nuova finestra\" target=\"_blank\">Intervento ".$rs2[$j]['idintervento']." del ".date( "d/m/Y", strtotime($rs2[$j]['data']) )."</a></td>\n";+echo "<td>".nl2br($rs2[$j]['descrizione'])."</td></tr>\n";+}++echo "</table>\n";+}++?>Added: new_trunk/openstamanager/modules/my_impianti/actions.php===================================================================--- new_trunk/openstamanager/modules/my_impianti/actions.php (rev 0)+++ new_trunk/openstamanager/modules/my_impianti/actions.php2014-08-01 18:47:16 UTC (rev 944)@@ -0,0 +1,113 @@+<?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}++$op = $html->form('op', 'post');++switch($op){++//Aggiorno informazioni di base impianto+case "update":++if( isset($_POST['matricola']) ){+$old_matricola = save( $_POST['old_matricola'] );+$new_matricola = save( $_POST['matricola'] ); $matricola=$new_matricola;+$idanagrafica = save( $_POST['idanagrafica'] );+$data = saveDate( $_POST['data'] );+$idtecnico = save( $_POST['idtecnico'] );+$idsede = save( $_POST['idsede'] );+$nome = save( $_POST['nome'] );+$descrizione = save( $_POST['descrizione'] );++$proprietario = save( $_POST['proprietario'] );+$palazzo = save( $_POST['palazzo'] );+$ubicazione = save( $_POST['ubicazione'] );+$scala = save( $_POST['scala'] );+$piano = save( $_POST['piano'] );+$interno = save( $_POST['interno'] );+$occupante = save( $_POST['occupante'] );++$query = "UPDATE my_impianti SET idanagrafica=\"$idanagrafica\",".+"nome=\"$nome\",".+"descrizione=\"$descrizione\",".+"idsede=\"$idsede\",".+"data=\"$data\",".+"proprietario=\"$proprietario\",".+"palazzo=\"$palazzo\",".+"ubicazione=\"$ubicazione\",".+"idtecnico=\"$idtecnico\",".+"scala=\"$scala\",".+"piano=\"$piano\",".+"interno=\"$interno\",".+"occupante=\"$occupante\"".+"WHERE matricola=\"".$old_matricola."\"";+$dbo->query( $query );+array_push( $_SESSION['infos'], "Informazioni salvate correttamente!" );+++//Verifico se posso modificare la matricola se è stata aggiornata+if( $old_matricola != $new_matricola ){+$rs = $dbo->fetchArray("SELECT matricola FROM my_impianti WHERE matricola=\"".$new_matricola."\" AND NOT matricola=\"".$old_matricola."\"");+if( sizeof($rs)==0 ){+$dbo->query("UPDATE my_impianti SET matricola=\"".$new_matricola."\" WHERE matricola=\"".$old_matricola."\"");++//Aggiorno la matricola anche nel collegamento tra impianti e interventi+$dbo->query("UPDATE my_impianti_interventi SET matricola=\"".$new_matricola."\" WHERE matricola=\"".$old_matricola."\"");++//Aggiorno la matricola anche nel collegamento tra impianti e componenti+$dbo->query("UPDATE my_impianto_componenti SET matricola=\"".$new_matricola."\" WHERE matricola=\"".$old_matricola."\"");++$matricola = $new_matricola;+}+else{+array_push( $_SESSION['errors'], "La matricola $new_matricola esiste già!" );+$matricola = $old_matricola;+}+}+}+break;++//Aggiungo impianto+case "add":++$matricola = save( $_POST['matricola'] );+$idanagrafica = save( $_POST['idanagrafica'] );+$nome = save( $_POST['nome'] );+$idtecnico = save( $_POST['idtecnico'] );+++if( is_id_ok( $matricola ) ){+if( isset($_POST['matricola']) ){+//matricola duplicate check+$query = "SELECT matricola FROM my_impianti WHERE matricola=\"$matricola\"";+$n = $dbo->fetchNum( $query );++//if this matricola doesn't exists yet, add it+if( $n==0 ){+$query = "INSERT INTO my_impianti( matricola, idanagrafica, nome, data, idtecnico ) VALUES ( \"".$matricola."\", \"".$idanagrafica."\", \"".$nome."\", NOW(), \"".$idtecnico."\" )";+$rs = $dbo->query( $query );+array_push( $_SESSION['infos'], "Aggiunto nuovo impianto!" );+}+else{+array_push( $_SESSION['errors'], "Questa matricola esiste gi&agrave;!" );+$matricola = '';+}+}+}+else{+$matricola = '';+array_push( $_SESSION['errors'], "La matricola inserita non &eacute; valida!" );+}+break;++//Rimuuovo impianto e scollego tutti i suoi componenti+case "delete":+$dbo->query("DELETE FROM my_impianti WHERE matricola=\"$matricola\"");+$dbo->query("DELETE FROM my_impianto_componenti WHERE matricola=\"$matricola\"");+$dbo->query("DELETE FROM my_impianti_interventi WHERE matricola=\"$matricola\"");+array_push( $_SESSION['infos'], "Impianto e relativi componenti eliminati!" );+break;+}++?>Property changes on: new_trunk/openstamanager/modules/my_impianti/actions.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/modules/my_impianti/edit.html===================================================================--- new_trunk/openstamanager/modules/my_impianti/edit.html (rev 0)+++ new_trunk/openstamanager/modules/my_impianti/edit.html2014-08-01 18:47:16 UTC (rev 944)@@ -0,0 +1,101 @@+<form action="" method="post" role="form">+<input type="hidden" name="backto" value="record-edit">+<input type="hidden" name="op" value="update">+<input type="hidden" name="matricola" value="<?php echo $id_record ?>">++<!-- DATI ANAGRAFICI -->+<div class="panel panel-primary">+<div class="panel-heading">+<h3 class="panel-title">Dati impianto</h3>+</div>++<div class="panel-body">+<div class="pull-right">+<button type="submit" class="btn btn-success"><i class="fa fa-check"></i> Salva modifiche</button>+</div>+<div class="clearfix"></div>++++<div class="row">+<div class="col-md-3">+{[ "type": "text", "label": "Matricola", "name": "matricola", "required": 1, "class": "", "value": "$matricola$", "extra": "" ]}+<input type="hidden" name="old_matricola" value="<?php echo $records[0]['matricola']; ?>">+</div>+<div class="col-md-5">+{[ "type": "text", "label": "Nome", "name": "nome", "required": 1, "class": "", "value": "$nome$", "extra": "" ]}+</div>++<div class="col-md-4">+{[ "type": "link", "label": "Installato a nome di", "href": "<?php echo $rootdir ?>/editor.php?id_module=<?php echo $modules_info['Anagrafiche']['id'] ?>&id_record=$idanagrafica$", "name": "cliente", "value": "<i class='fa fa-external-link'></i> $cliente$", "class": "btn btn-primary btn-block", "extra": "" ]}+<input type="hidden" name="idanagrafica" value="<?php echo $records[0]['idanagrafica']; ?>">+</div>+</div>+++<div class="row">+<div class="col-md-12">+{[ "type": "text", "label": "Proprietario", "name": "proprietario", "required": 0, "value": "$proprietario$", "extra": "" ]}+</div>++</div>++<div class="row">+<div class="col-md-4">+{[ "type": "text", "label": "Ubicazione", "name": "ubicazione", "required": 0, "class": "", "value": "$ubicazione$", "extra": "" ]}+</div>++<div class="col-md-4">+{[ "type": "text", "label": "Palazzo", "name": "palazzo", "required": 0, "class": "", "value": "$palazzo$", "extra": "" ]}+</div>++<div class="col-md-4">+{[ "type": "text", "label": "Scala", "name": "scala", "required": 0, "class": "", "value": "$scala$", "extra": "" ]}+</div>+</div>++<div class="row">+<div class="col-md-4">+{[ "type": "text", "label": "Piano", "name": "piano", "required": 0, "class": "", "value": "$piano$", "extra": "" ]}+</div>++<div class="col-md-4">+{[ "type": "text", "label": "Interno", "name": "interno", "required": 0, "class": "", "value": "$interno$", "extra": "" ]}+</div>++<div class="col-md-4">+{[ "type": "text", "label": "Occupante", "name": "occupante", "required": 0, "class": "", "value": "$occupante$", "extra": "" ]}+</div>+</div>+++<div class="row">+<div class="col-md-4">+{[ "type": "select", "label": "Tecnico assegnato", "name": "idtecnico", "required": 0, "class": "", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, ragione_sociale AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE descrizione='Tecnico' AND deleted=0 ORDER BY ragione_sociale ASC", "value": "$idtecnico$", "extra": "" ]}+</div>++<div class="col-md-4">+{[ "type": "text", "label": "Data", "name": "data", "required": 0, "class": "datepicker text-center", "value": "<?php echo date('d/m/Y', strtotime($records[0]['data']) ) ?>", "extra": "" ]}+</div>++<div class="col-md-4">+{[ "type": "text", "label": "Occupante", "name": "occupante", "required": 0, "class": "", "value": "$occupante$", "extra": "" ]}+</div>+</div>+++<div class="row">+<div class="col-md-12">+{[ "type": "textarea", "label": "Descrizione", "name": "descrizione", "required": 0, "class": "", "value": "$descrizione$", "extra": "" ]}+</div>+</div>+</div>+</div>+</form>++<form action="" method="post" role="form" id="form-delete">+<input type="hidden" name="backto" value="record-list">+<input type="hidden" name="op" value="delete">+<button type="button" class="btn-link" onclick="if( confirm('Eliminare questo impianto?') ){ $('#form-delete').submit(); }"><span class="text-danger"><i class="fa fa-trash-o"></i> Elimina impianto</span></button>+</form>+Property changes on: new_trunk/openstamanager/modules/my_impianti/edit.html___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/modules/my_impianti/init.php===================================================================--- new_trunk/openstamanager/modules/my_impianti/init.php (rev 0)+++ new_trunk/openstamanager/modules/my_impianti/init.php2014-08-01 18:47:16 UTC (rev 944)@@ -0,0 +1,9 @@+<?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}+++$records = $dbo->fetchArray("SELECT *, (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=my_impianti.idanagrafica) AS cliente FROM my_impianti WHERE matricola=\"$id_record\"");++?>Property changes on: new_trunk/openstamanager/modules/my_impianti/init.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/modules/my_impianti/modutil.php===================================================================--- new_trunk/openstamanager/modules/my_impianti/modutil.php (rev 0)+++ new_trunk/openstamanager/modules/my_impianti/modutil.php2014-08-01 18:47:16 UTC (rev 944)@@ -0,0 +1,194 @@+<?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}+++/** +* dir = cartella dove pescare i file .ini+* id_list = componenti già applicati+*/+function get_componenti( $dir, $id_list='' ){ +global $theme_path;++//lettura dei files della cartella dove risiede il file con lo script+$file_trovati = array();+$componenti_trovati = array();+$cmp = array();++if ($id_list=='0' || $id_list==''){+$gia_installati = array();+}else{+$gia_installati = array();+$gia_installati = explode(',',$id_list);+}++if (is_dir($dir)) {+ if ($dh = opendir($dir)) {+ while( ($file = readdir($dh)) !== false ){+if( $file<>"." && $file<>".." ){+$ext = estensione_del_file($file);++if ($ext == "ini") { // vengono accettati solo i files con estensione ini+ $file_trovati[] = $file;+ $ini_array = parse_ini_file( $dir.$file, true );+ $componenti_trovati[] = $ini_array['Nome']['valore'];+}+}+}++closedir($dh);+ }+}++//Ordino alfabeticamente il <select>+array_multisort( $componenti_trovati, $file_trovati );+++//visualizzazione di quanto è stato letto+if( is_array($file_trovati) && sizeof($file_trovati) > 0 ){++//controllo se ho già aggiunto tutti i componenti+if( sizeof($file_trovati) > sizeof($gia_installati) ){++//per tutti i componenti di possibile installazione+for( $i=0; $i<sizeof($file_trovati); $i++ ){+$found = false;++// controllo che non siano già stati installati+for( $j=0; $j<sizeof($gia_installati); $j++ ){+if( $file_trovati[$i] == $gia_installati[$j] ){+$found = true;+$j = sizeof($gia_installati);+}+}++if( !$found )+array_push( $cmp, array($file_trovati[$i], $componenti_trovati[$i]) );+}+}+}++return $cmp;+}++++/**+ * Legge il nome del componente del file .ini+ */+function get_nome_componente( $ini ){+global $docroot;++$ini_array = parse_ini_file( $docroot."/files/my_impianti/".$ini, true );+return $ini_array['Nome']['valore'];+}+++++/**+ * + */+function write_ini_file($assoc_arr, $path, $has_sections=FALSE) { + $content = ""; + if ($has_sections) { + foreach ($assoc_arr as $key=>$elem) { + $content .= "[".$key."]\n"; + foreach ($elem as $key2=>$elem2) { + if(is_array($elem2)){+ for($i=0;$i<count($elem2);$i++){+ //$content .= $key2."[] = \"".$elem2[$i]."\"\n";+ $content .= $key2."[] = ".$elem2[$i]."\n"; + }+ }+ else if($elem2=="")+ $content .= $key2." = \n"; + else+ $content .= $key2." = &quot;".$elem2."&quot;\n"; + }+ }+ }++ else { + foreach ($assoc_arr as $key=>$elem) { + if(is_array($elem)) + { + for($i=0;$i<count($elem);$i++) + { + $content .= $key2."[] = &quot;".$elem[$i]."&quot;\n"; + } + } + else if($elem=="")+ $content .= $key2." = \n"; + else+ $content .= $key2." = &quot;".$elem."&quot;\n"; + } + } +++ if (!$handle = fopen($path, 'w')) { + return false; + }+++ if (!fwrite($handle, $content)) { + return false; + }+++ fclose($handle); + return true; +}++++++function genera_campo( $nome, $tipo, $valore, $opzioni ){+$opzione[] = array();++//rimuovo gli spazi vuoti prima o dopo la virgola di ciascuna opzione+$opzione = array_map('trim', explode(',', $opzioni)); ++++if ($tipo=='span'){+echo "<span>".$valore."</span>\n";+echo "<input type=\"hidden\" id=\"$nome\" name=\"$nome\" value=\"".$valore."\">\n";+}++else if ($tipo=='input'){+echo "<input type=\"text\" id=\"$nome\" name=\"$nome\" value=\"".$valore."\" class=\"form-control\">\n";+}++else if ($tipo=='date'){+echo "<input type=\"text\" id=\"$nome\" name=\"$nome\" class=\"form-control datepicker text-center\" value=\"".$valore."\">\n";+}++else if ($tipo=='textarea'){+$valore = str_replace( "<br/>", "\n", $valore );+$valore = str_replace( "&lt;br/&gt;", "\n", $valore );+echo "<textarea id=\"$nome\" name=\"$nome\" class=\"form-control\" style=\"width:95%; height: 100px;\">".$valore."</textarea>\n";+}++else if ($tipo=='select'){+echo "<select id=\"".$nome."\" name=\"".$nome."\" class=\"form-control\">\n";+echo "<option value=\"0\">".$opzione[0]."</option>";++for($i=1;$i<count($opzione);$i++) {++if ($opzione[$i]==$valore){+$sel = "selected='selected'";+}else{+$sel = '';+}++echo "<option $sel value=\"".$opzione[$i]."\">".$opzione[$i]."</option>";+}++echo "</select>\n";+}+}++?>Property changes on: new_trunk/openstamanager/modules/my_impianti/modutil.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyModified: new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.anagrafiche.php===================================================================--- new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.anagrafiche.php2014-07-28 19:11:52 UTC (rev 943)+++ new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.anagrafiche.php2014-08-01 18:47:16 UTC (rev 944)@@ -1,4 +1,8 @@ <?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}+ $matricola = $_GET['matricola']; //Rimuove il collegamento dell'impianto dall'anagraficaAdded: new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.componenti.php===================================================================--- new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.componenti.php (rev 0)+++ new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.componenti.php2014-08-01 18:47:16 UTC (rev 944)@@ -0,0 +1,387 @@+<?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}++switch( $html->form('op') ){+case "updatecomponente":+$idcomponente = save( $_GET['id'] );+$matricola = $id_record;+$data = savedate( $_POST['data'] );++$post_array = array();+foreach( $_POST as $impostazione_post=>$valore_impostazione_post ){+//Creo l'array con tutti i valori passati dal POST+$impostazione_post = str_replace( "_", " ", $impostazione_post);+$impostazione_post = htmlentities( $impostazione_post, ENT_QUOTES, "UTF-8" );+$post_array[$impostazione_post] = save ($valore_impostazione_post);+}+$nome = $post_array['Nome'];++// mi ricavo il valore di contenuto leggendolo dal db+$query = "SELECT * FROM my_impianto_componenti WHERE matricola=\"$matricola\" AND id=\"$idcomponente\" ";+$rs = $dbo->fetchArray( $query );+$contenuto = $rs[0]['contenuto'];+$contenuto = read( $contenuto );++++//Converto 'contenuto' di questo componente in un array+$ini_array = parse_ini_string( $contenuto, true );++//Creo variabile contenuto temporaneo+$contenuto_tmp = array();++//Resetto il valore di contenuto+$contenuto = '';++//Per ogni sezione dell'array estratto dal file ini+foreach ($ini_array as $sezione => $array_impostazioni){+$sezione = str_replace( "\r\n", "\n", $sezione );+$sezione = str_replace( "\n", "<br/>", $sezione );+$contenuto .= "[&quot;".$sezione."&quot;]\n";++//Per ogni impostazione +foreach ($array_impostazioni as $impostazione => $valore_impostazione){++//Quando trovo l'impostazione 'valore' la sostituisco con il valore passato dal post+if ($impostazione=='valore'){++$da = array($impostazione => $valore_impostazione);+$a = array($impostazione => $post_array[$sezione]);++$contenuto_tmp = array_replace($ini_array[$sezione], $da, $a);++foreach ($contenuto_tmp as $impostazione_tmp => $valore_impostazione_tmp){+$valore = $valore_impostazione_tmp;+$valore = str_replace( "\r\n", "\n", $valore );+$valore = str_replace( "\n", "<br/>", $valore );++$contenuto .= save($impostazione_tmp)." = &quot;".save($valore)."&quot;\n";+}+}+}+}+++$query = "UPDATE my_impianto_componenti SET data=\"".$data."\", contenuto=\"".$contenuto."\" WHERE matricola=\"$matricola\" AND id=\"$idcomponente\" ";++$dbo->query( $query );+array_push( $_SESSION['infos'], "Informazioni componente aggiornate correttamente!" );++break;+++case "linkcomponente":+$filename = save( $_GET['filename'] );+$matricola = $id_record;++$contenuto = file_get_contents($docroot."/files/my_impianti/".$filename);+$contenuto = str_replace( ".", " ", $contenuto );+++$values = parse_ini_string( $contenuto, true );+$nome = mb_convert_encoding( $values['Nome']['valore'], "iso-8859-1", "utf-8" );++$query = "INSERT INTO my_impianto_componenti( filename, matricola, contenuto, nome, data ) VALUES( \"$filename\", \"$matricola\", \"".save( $contenuto )."\", \"$nome\", NOW() )";+$dbo->query( $query );++$idcomponente = $dbo->last_inserted_id();+array_push( $_SESSION['infos'], "Aggiunto un nuovo componente all'impianto!" );++break;++case "sostituiscicomponente":+$filename = save( $_GET['filename'] );+$matricola = $id_record;+$id = save( $_GET['id'] );++$contenuto = file_get_contents($docroot."/files/my_impianti/".$filename);+$contenuto = str_replace( ".", " ", $contenuto );+$contenuto = mb_convert_encoding( $contenuto, "UTF-8", "ISO-8859-1" );++$values = parse_ini_string( $contenuto, true );+$nome = $values['Nome']['valore'];++// Verifico che questo componente non sia già stato sostituito+$query = "SELECT * FROM my_impianto_componenti WHERE idsostituto = $id";+$rs = $dbo->fetchArray( $query );+$n = sizeof($rs);++if ($n==0){+//Inserisco il nuovo componente in sostituzione+$query = "INSERT INTO my_impianto_componenti( idsostituto, filename, matricola, contenuto, nome, data ) VALUES( $id, \"$filename\", \"$matricola\", \"".save( $contenuto )."\", \"$nome\", NOW() )";+$dbo->query( $query );+$idcomponente = $dbo->last_inserted_id();++//Aggiorno la data di sostituzione del componente precedente+$query = "UPDATE my_impianto_componenti SET data_sostituzione = NOW() WHERE matricola=\"$matricola\" AND id = $id ";+$dbo->query( $query );++array_push( $_SESSION['infos'], "Aggiunto un nuovo componente in sostituzione al precedente!" );++}else{++array_push( $_SESSION['errors'], "Questo componente &egrave; gi&agrave; stato sostituito. Nessuna modifica applicata." );++}+++break;+++case "unlinkcomponente":+$idcomponente = save( $_GET['id'] );+$matricola = $id_record;+$query = "DELETE FROM my_impianto_componenti WHERE id=\"".$idcomponente."\" AND matricola=\"$matricola\"";+$dbo->query( $query );+array_push( $_SESSION['infos'], "Rimosso componente dall'impianto!" );+break;++++//Carica i campi da compilare del componente+case "load_componente":+$filename = save( $_GET['filename'] );+$idarticolo = save( $_GET['idarticolo'] );+++//Se è stato specificato un idarticolo, carico il file .ini dal campo `contenuto` di quell'idarticolo+$rs = $dbo->fetchArray("SELECT contenuto, componente_filename FROM mg_articoli WHERE id=\"".$idarticolo."\"");+++//Se i campi da caricare sono del componente già salvato leggo dal campo `contenuto`...+if( $rs[0]['componente_filename'] == $filename )+$contenuto = read($rs[0]['contenuto']);++//...altrimenti carico dal file .ini+else{+if( file_exists( $docroot."/files/my_impianti/".$filename ) )+$contenuto = file_get_contents( $docroot."/files/my_impianti/".$filename );+}++$contenuto = str_replace( "`", "\"", $contenuto );+$ini_array = parse_ini_string( read($contenuto), true );+++//Caricamento form per attributi componente+if( is_array($ini_array) && $ini_array['Nome']['valore']!='' ){+echo "<h3 class='fascia'>Attributi ".$ini_array['Nome']['valore']."</h3>\n";+echo "<input type='hidden' name='Nome' value=\"".$ini_array['Nome']['valore']."\" />\n";++echo "<table cellspacing=\"0\">\n";+++//per ogni sezione+$i = 0;+foreach ($ini_array as $sezione => $array_impostazioni){+if( $sezione!='Nome' ){+if ( ($i==0) || ($i%2==0) ){+echo "<tr>\n";+}++$i++;++echo "<td align=\"right\" class=\"first_cell\" valign=\"middle\" style=\"width:170px;\">\n";+echo "<span><b>".$sezione.": </b></span>";+echo "</td>\n";+++$nome = htmlentities($sezione, ENT_QUOTES, "UTF-8");+$tipo = $ini_array[$sezione]['tipo'];+$valore = $ini_array[$sezione]['valore'];+$opzioni = $ini_array[$sezione]['opzioni'];++( $tipo=='textarea' ) ? $valign="top" : $valign="middle";+echo "<td align=\"left\" class=\"table_cell\" valign=\"".$valign."\" >\n";+genera_campo( $nome, $tipo, $valore, $opzioni );+echo "</td>\n";++if ($i%2==0){+echo "</tr>\n";+}+}+}++echo "</table>\n";+}+exit;+}++++//Componenti non ancora collegati+if( $id_list=='' )+$id_list='0';++//Funzione per elencare i componenti disponibili+$cmp = get_componenti( $docroot."/files/my_impianti/", $id_list );++echo "<div class='row'>\n";+echo "<div class='col-md-4'>\n";++echo "<select class=\"chosen\" id=\"filename\" name=\"filename\">\n";+echo "<option value=\"0\">- Aggiungi un componente -</option>\n";++if( sizeof($cmp)>0 ){+for( $c=0; $c<sizeof($cmp); $c++ ){+echo "<option value=\"".$cmp[$c][0]."\">".$cmp[$c][1]."</option>\n";+}+}++else{+echo "<option value=\"0\">- Hai gi&agrave; aggiunto tutti i componenti -</option>\n";+}++echo "</select>\n";+echo "</div>\n";++echo "<div class='col-md-2'>\n";+echo "<a class=\"btn btn-primary\" id=\"addta\" href=\"javascript:;\" onclick=\"location.href='".$rootdir."/editor.php?id_module=".$id_module."&id_record=".$id_record."&op=linkcomponente&matricola=".$id_record."&filename='+$('#filename').val();\"><i class='fa fa-plus'></i> Aggiungi</a>\n";+echo "</div>\n";+echo "</div>\n";+echo "<br>\n";++++//Mostro tutti i componenti utilizzati elencando quelli attualmente installati per primi.+$q2 = "SELECT *, (SELECT data FROM in_interventi WHERE idintervento=my_impianto_componenti.idintervento) AS data_intervento FROM my_impianto_componenti WHERE matricola = \"".$id_record."\" ORDER by nome ASC, data DESC, idsostituto DESC";+$rs2 = $dbo->fetchArray($q2);+$n2 = sizeof($rs2);++++if( $n2 > 0 ){+$prev_componente = '';++echo "<h3>Componenti gi&agrave; installati</h3>\n";+++echo "<div class=\"panel-group\" id=\"accordion\">\n";++//Ciclo tra tutti i componenti+for( $j=0; $j<$n2; $j++ ){+$contenuto = $rs2[$j]['contenuto'];+$contenuto = str_replace( "`", "\"", $contenuto );+++$ini_array = parse_ini_string( read($contenuto), true );+$nome_componente = $rs2[$j]['nome'];+$filename = $rs2[$j]['filename'];++if( $idcomponente==$rs2[$j]['id'] ){+$display = "";+}++if ($rs2[$j]['data_sostituzione']=='0000-00-00 00:00:00'){+$statocomponente = "INSTALLATO in data ".date("d/m/Y", strtotime($rs2[$j]['data']) );+}else{+$statocomponente = "SOSTITUITO in data ".date("d/m/Y", strtotime($rs2[$j]['data_sostituzione']) );+}++++++//Per più "versioni" dello stesso componente mostro un riga meno evidente+//per non confonderlo come componente in uso in questo momento+if( $prev_componente == $nome_componente ){+echo "<div class=\"panel panel-default\">\n";+echo "<div class=\"panel-heading mini\">\n";+echo "<h4 class=\"panel-title mini\">\n";+echo "<a data-toggle='collapse' data-parent='#accordion' href='#collapse_".$j."'><small>".$nome_componente." (".$statocomponente.")</small></a>\n";+echo "</h4>\n";+echo "</div>\n";++}++else{+echo "<div class=\"panel panel-primary\">\n";+echo "<div class=\"panel-heading\">\n";+echo "<h4 class=\"panel-title\">\n";+echo "<a data-toggle='collapse' data-parent='#accordion' href='#collapse_".$j."'>".$nome_componente." (".$statocomponente.")</a>\n";+echo "</h4>\n";+echo "</div>\n";+}++echo "<div id='collapse_".$j."' class='panel-collapse collapse'>\n";+echo "<div class=\"panel-body\">\n";+echo "<form method=\"post\" action=\"".$rootdir."/editor.php?id_module=".$id_module."&id_record=".$id_record."&op=updatecomponente&matricola=".$id_record."&id=".$rs2[$j]['id']."\">\n";+echo "<input type='hidden' name='backto' value='record-edit'>\n";++echo "<div class='row'>\n";++//Nome+echo "<div class='col-md-6'>\n";+echo "<label>Nome:</label><br>\n";+echo "".$rs2[$j]['nome']."\n";+echo "</div>\n";++//Data+echo "<div class='col-md-6'>\n";+echo "<label>Data:</label>\n";+echo "<input type='text' class='form-control datepicker text-center' name='data' value=\"".date("d/m/Y", strtotime($rs2[$j]['data']) )."\">\n";+echo "</div>\n";+++//per ogni sezione+foreach ($ini_array as $sezione => $array_impostazioni){+//$sezione = html_entity_decode( $sezione, ENT_QUOTES, "UTF-8" );+if( $sezione!='Nome' ){+$sezione = $sezione;+$tipo = $ini_array[$sezione]['tipo'];+$valore = $ini_array[$sezione]['valore'];+$opzioni = $ini_array[$sezione]['opzioni'];++( $tipo=='textarea' ) ? $valign="top" : $valign="middle";++echo "<div class='col-md-6'>\n";+echo "<label>".$sezione.":</label>\n";+genera_campo( $sezione, $tipo, $valore, $opzioni );+echo "</div>\n";+}+}++++//Collegamento a intervento se c'è+echo "<div class='col-md-6'>\n";+echo "<b>Interventi collegati:</b>\n";+echo "</div>\n";++if( $rs2[$j]['idintervento'] ){+echo "<a href=\"".$rootdir."/modules/interventi/interventi.php?idintervento=".$rs2[$j]['idintervento']."\" target=\"_blank\" title=\"Clicca per aprire l'intervento su una nuova finestra\">Intervento ".$rs2[$j]['idintervento']." del ".date( "d/m/Y", strtotime($rs2[$j]['data_intervento']) )."</a><br>\n";+}++echo "<div class='clearfix'></div><br>\n";++++//Pulsante Salva/Elimina+echo "<div class='col-md-12'>\n";+echo "<button type=\"submit\" class=\"btn btn-success\"><i class='fa fa-check'></i> Salva modifiche</button>\n";+echo "<button type=\"button\" class=\"btn btn-danger\" onclick=\"location.href='".$rootdir."/editor.php?id_module=".$id_module."&id_record=".$id_record."&op=unlinkcomponente&matricola=$matricola&id=".$rs2[$j]['id']."';\"><i class='fa fa-trash-o'></i> Elimina</button>\n";+++//Sostituisci componente con un altro dello stesso tipo, posso sostituire solo i componenti installati+if ($rs2[$j]['data_sostituzione']=='0000-00-00 00:00:00'){+echo "<br><br><a href=\"javascript:;\" class=\"text-warning\" onclick=\"if( confirm('Vuoi sostituire questo componente con un altro dello stesso tipo?') ){ location.href='".$rootdir."/editor.php?id_module=".$id_module."&id_record=".$id_record."&op=sostituiscicomponente&filename=".$filename."&id=".$rs2[$j]['id']."'; }\"><i class='fa fa-refresh'></i> Sostituisci questo componente</a><br><br>\n";+}++else{+echo "<br><br><p class='text-danger'>Componente gi&agrave; sostituito</p>\n";+}++echo "</div>\n";+echo "</div>\n";+echo "</form>\n";+echo "</div>\n";+echo "</div>\n";+echo "</div>\n";++$prev_componente = $nome_componente;+}++echo "</div>\n";+}+?>Modified: new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.interventi.php===================================================================--- new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.interventi.php2014-07-28 19:11:52 UTC (rev 943)+++ new_trunk/openstamanager/modules/my_impianti/plugins/my_impianti.interventi.php2014-08-01 18:47:16 UTC (rev 944)@@ -1,4 +1,8 @@ <?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}+ $matricole = $_POST['matricole']; //Salvo gli impianti selezionatiModified: new_trunk/openstamanager/modules/stati_intervento/actions.php===================================================================--- new_trunk/openstamanager/modules/stati_intervento/actions.php2014-07-28 19:11:52 UTC (rev 943)+++ new_trunk/openstamanager/modules/stati_intervento/actions.php2014-08-01 18:47:16 UTC (rev 944)@@ -16,7 +16,7 @@ //Aggiorna descrizione solo se non è uno stato di default $query = "UPDATE in_statiintervento SET descrizione=\"$descrizione\" WHERE idstatointervento=\"".$id_record."\" AND `default`=0"; $rs = $dbo->query( $query );-array_push( $_SESSION['infos'], $query1."<br>".$query2."<br>Informazioni salvate correttamente!" );+array_push( $_SESSION['infos'], "Informazioni salvate correttamente!" ); } break; Modified: new_trunk/openstamanager/update/update_2.0.sql===================================================================--- new_trunk/openstamanager/update/update_2.0.sql2014-07-28 19:11:52 UTC (rev 943)+++ new_trunk/openstamanager/update/update_2.0.sql2014-08-01 18:47:16 UTC (rev 944)@@ -343,3 +343,10 @@ -- Nome modulo personalizzabile ALTER TABLE `zz_modules` ADD `name2` VARCHAR( 255 ) NOT NULL AFTER `name`; ++-- Aggiunta elenco interventi presso impianto come plugin+INSERT INTO `zz_modules_plugins`( `name`, `idmodule_from`, `idmodule_to`, `position`, `script` ) VALUES( 'Interventi svolti', (SELECT `id` FROM `zz_modules` WHERE `name`='Interventi'), (SELECT `id` FROM `zz_modules` WHERE `name`='MyImpianti'), 'tab', 'my_impianti.interventi.php' );++-- Aggiunta componenti come plugin+INSERT INTO `zz_modules_plugins`( `name`, `idmodule_from`, `idmodule_to`, `position`, `script` ) VALUES( 'Componenti', (SELECT `id` FROM `zz_modules` WHERE `name`='MyImpianti'), (SELECT `id` FROM `zz_modules` WHERE `name`='MyImpianti'), 'tab', 'my_impianti.componenti.php' );+This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[946]new_trunk/openstamanager

From: <lo...@us...> - 2014-08-04 17:18:11

Revision: 946 http://sourceforge.net/p/openstamanager/code/946Author: loviuzDate: 2014-08-04 17:18:01 +0000 (Mon, 04 Aug 2014)Log Message:-----------COREaggiunta pulsante "Aggiungi" su ogni modulo solo se il modulo ?\195?\168 di tipo "table" e se ?\195?\168 presente il template per la popup (add.html)aggiunti nuovi moduli riscritti: voci di servizio, zone, tecnici e tariffe.Modified Paths:-------------- new_trunk/openstamanager/controller.php new_trunk/openstamanager/lib/jscripts/functionsjs.php new_trunk/openstamanager/update/update_2.0.sqlAdded Paths:----------- new_trunk/openstamanager/modules/tecnici_tariffe/ new_trunk/openstamanager/modules/tecnici_tariffe/actions.php new_trunk/openstamanager/modules/tecnici_tariffe/edit.html new_trunk/openstamanager/modules/tecnici_tariffe/init.php new_trunk/openstamanager/modules/voci_servizio/ new_trunk/openstamanager/modules/voci_servizio/actions.php new_trunk/openstamanager/modules/voci_servizio/add.html new_trunk/openstamanager/modules/voci_servizio/edit.html new_trunk/openstamanager/modules/voci_servizio/init.php new_trunk/openstamanager/modules/zone/ new_trunk/openstamanager/modules/zone/actions.php new_trunk/openstamanager/modules/zone/add.html new_trunk/openstamanager/modules/zone/edit.html new_trunk/openstamanager/modules/zone/init.phpModified: new_trunk/openstamanager/controller.php===================================================================--- new_trunk/openstamanager/controller.php2014-08-01 18:56:27 UTC (rev 945)+++ new_trunk/openstamanager/controller.php2014-08-04 17:18:01 UTC (rev 946)@@ -11,7 +11,7 @@ </form> <?php //Lettura parametri modulo-$rs = $dbo->fetchArray("SELECT `options` FROM zz_modules WHERE id=\"".$id_module."\"");+$rs = $dbo->fetchArray("SELECT * FROM zz_modules WHERE id=\"".$id_module."\""); $module_options = mb_convert_encoding( $rs[0]['options'], "utf-8", "iso-8859-1" ); $module_options = json_decode( $module_options, true ); $module_query = $module_options['main_query'][0]['query'];@@ -21,7 +21,9 @@ $module_fields = $module_options['main_query'][0]['fields']; $fields = explode( ",", $module_fields ); -if( $module_options['main_query'][0]['type'] == 'table' ){++//Pulsante "Aggiungi" solo se il modulo è di tipo "table" e se esiste il template per la popup+if( $module_options['main_query'][0]['type'] == 'table' && file_exists($docroot."/modules/".$rs[0]['module_dir']."/add.html") ){ echo "<button type='button' class='btn btn-primary' data-toggle='modal' data-title='Aggiungi' data-target='#bs-popup' data-href='add.php?id_module=".$id_module."'><i class='fa fa-plus'></i> "._("Aggiungi")."</button><hr>\n"; } else{Modified: new_trunk/openstamanager/lib/jscripts/functionsjs.php===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-08-01 18:56:27 UTC (rev 945)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2014-08-04 17:18:01 UTC (rev 946)@@ -41,13 +41,8 @@ }) -//Input mask-$(".date-mask").inputmask( "dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"} );-$(".time-mask").inputmask( "hh:mm", {"placeholder": "hh:mm"} );- $("[data-mask]").inputmask();- $('.inputmask-decimal').inputmask("decimal", { "radixPoint": ",", "digits": 2 });- - //Inizializzazione cifre decimali a 2 decimali++//Inizializzazione cifre decimali a 2 decimali $('.inputmask-decimal').each( function(){ new_value = parseFloat( $(this).val() ); new_value = new_value.toFixed(2);@@ -57,6 +52,13 @@ }); +//Input mask+$(".date-mask").inputmask( "dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"} );+$(".time-mask").inputmask( "hh:mm", {"placeholder": "hh:mm"} );+ $("[data-mask]").inputmask();+$('.inputmask-decimal').inputmask("decimal", { "radixPoint": ",", "digits": 2 });++ // Setup - add a text input to each footer cell var table = $('.datatables').dataTable({ "oLanguage": { "sUrl": "<?php echo $rootdir ?>/lib/jscripts/jquery/plugins/datatables/jquery.datatables.lang-<?php echo $lang ?>.js" },Added: new_trunk/openstamanager/modules/tecnici_tariffe/actions.php===================================================================--- new_trunk/openstamanager/modules/tecnici_tariffe/actions.php (rev 0)+++ new_trunk/openstamanager/modules/tecnici_tariffe/actions.php2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,76 @@+<?php+include_once("../../core.php");+include_once($docroot."/config.inc.php");+include_once($docroot."/lib/user_check.php");+include_once($docroot."/lib/permissions_check.php");++switch( $html->form('op', 'post') ){+case "update":+if( $permessi[$module_name] == 'rw' ){+$idtipointervento = $html->form('idtipointervento', 'post');+$idtecnico = $html->form('idtecnico', 'post');++if( $idtipointervento!='0' && $idtecnico!='0' ){+$costo_ore = str_replace( ",", ".", $html->form('costo_ore', 'post') );+$costo_km = str_replace( ",", ".", $html->form('costo_km', 'post') );+$costo_dirittochiamata = str_replace( ",", ".", $html->form('costo_dirittochiamata', 'post') );+++$costo_ore_tecnico = str_replace( ",", ".", $html->form('costo_ore_tecnico', 'post') );+$costo_km_tecnico = str_replace( ",", ".", $html->form('costo_km_tecnico', 'post') );+$costo_dirittochiamata_tecnico = str_replace( ",", ".", $html->form('costo_dirittochiamata_tecnico', 'post') );+++//Se c'è già un record idtecnico-idtipointervento lo aggiorno, altrimenti lo creo (retrocompatibilità quanto i costi erano legati ai tipi di intervento)+$rs = $dbo->fetchArray("SELECT id FROM in_tariffe WHERE idtecnico=\"".$idtecnico."\" AND idtipointervento=\"".$idtipointervento."\"");++//Aggiorno il record+if( sizeof($rs)==1 ){+$query = "UPDATE in_tariffe SET costo_ore=\"".$costo_ore."\", costo_km=\"".$costo_km."\", costo_dirittochiamata=\"".$costo_dirittochiamata."\", costo_ore_tecnico=\"".$costo_ore_tecnico."\", costo_km_tecnico=\"".$costo_km_tecnico."\", costo_dirittochiamata_tecnico=\"".$costo_dirittochiamata_tecnico."\" WHERE idtipointervento=\"".$idtipointervento."\" AND idtecnico=\"".$idtecnico."\"";+}++//Nuovo record+else{+$query = "INSERT INTO in_tariffe(idtecnico, idtipointervento, costo_ore, costo_km, costo_dirittochiamata, costo_ore_tecnico, costo_km_tecnico, costo_dirittochiamata_tecnico) VALUES( \"".$idtecnico."\", \"".$idtipointervento."\", \"".$costo_ore."\", \"".$costo_km."\", \"".$costo_dirittochiamata."\", \"".$costo_ore_tecnico."\", \"".$costo_km_tecnico."\", \"".$costo_dirittochiamata_tecnico."\" )";+}++if( $dbo->query($query) ){+array_push( $_SESSION['infos'], "Informazioni salvate correttamente!" );+}++else{+array_push( $_SESSION['errors'], mysql_error() );+}+}+}+break;++//Imposta i costi predefiniti al tecnico scelto+case "import":+$idtecnico = $html->form('idtecnico', 'post');+$idtipointervento = $html->form('idtipointervento', 'post');+++//Carico i costi standard della tipologia di intervento scelta+$rs = $dbo->fetchArray("SELECT * FROM in_tipiintervento WHERE idtipointervento=\"".$idtipointervento."\"");++for( $i=0; $i<sizeof($rs); $i++ ){+//Se esiste la coppia tecnico <=> tipo_intervento faccio UPDATE, altrimenti INSERT+$rs2 = $dbo->fetchArray("SELECT id FROM in_tariffe WHERE idtecnico=\"".$idtecnico."\" AND idtipointervento=\"".$rs[$i]['idtipointervento']."\"");++//Manca il record: lo inserisco+if( sizeof($rs2)==0 ){+$query = "INSERT INTO in_tariffe( idtecnico, idtipointervento, costo_ore, costo_km, costo_dirittochiamata, costo_ore_tecnico, costo_km_tecnico, costo_dirittochiamata_tecnico ) VALUES( \"".$idtecnico."\", \"".$rs[$i]['idtipointervento']."\", \"".$rs[$i]['costo_orario']."\", \"".$rs[$i]['costo_km']."\", \"".$rs[$i]['costo_diritto_chiamata']."\", \"".$rs[$i]['costo_orario_tecnico']."\", \"".$rs[$i]['costo_km_tecnico']."\", \"".$rs[$i]['costo_diritto_chiamata_tecnico']."\" )";+}++else{+$query = "UPDATE in_tariffe SET costo_ore=\"".$rs[$i]['costo_orario']."\", costo_km=\"".$rs[$i]['costo_km']."\", costo_dirittochiamata=\"".$rs[$i]['costo_diritto_chiamata']."\", costo_ore_tecnico=\"".$rs[$i]['costo_orario_tecnico']."\", costo_km_tecnico=\"".$rs[$i]['costo_km_tecnico']."\", costo_ore_tecnico=\"".$rs[$i]['costo_orario_tecnico']."\" WHERE id=\"".$rs2[0]['id']."\"";+}++$dbo->query($query);++array_push( $_SESSION['infos'], "Costi predefiniti impostati!" );+}+break;+}+?>Added: new_trunk/openstamanager/modules/tecnici_tariffe/edit.html===================================================================--- new_trunk/openstamanager/modules/tecnici_tariffe/edit.html (rev 0)+++ new_trunk/openstamanager/modules/tecnici_tariffe/edit.html2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,80 @@+<form action="" method="post" id="add-form">+<input type="hidden" name="op" value="update">+<input type="hidden" name="backto" value="record-edit">+<input type="hidden" name="id_record" value="<?php echo $id_record ?>">+<input type="hidden" name="idtecnico" value="<?php echo $records[0]['idtecnico'] ?>">+<input type="hidden" name="idtipointervento" value="<?php echo $records[0]['idtipointervento'] ?>">+++<div class="pull-right">+<button type="submit" class="btn btn-success"><i class="fa fa-check"></i> Salva modifiche</button>+</div>+<div class="clearfix"></div>++<div class="row">+<div class="col-md-4">+{[ "type": "span", "label": "Tipo intervento", "name": "descrizione", "required": 0, "class": "", "value": "$descrizione$", "extra": "" ]}+</div>++<div class="col-md-4">+{[ "type": "span", "label": "Tecnico", "name": "descrizione", "required": 0, "class": "", "value": "$ragione_sociale$", "extra": "" ]}+</div>+</div>+++<div class="panel panel-primary">+<div class="panel-heading">+<h3 class="panel-title">Costi unitari</h3>+</div>++<div class="panel-body">+<div class="row">+<div class="col-md-4">+{[ "type": "text", "label": "Costo orario", "name": "costo_ore", "required": 1, "class": "inputmask-decimal text-center", "value": "$costo_ore$", "extra": "", "icon-after": "<i class='fa fa-euro'></i>" ]}+</div>++<div class="col-md-4">+{[ "type": "text", "label": "Costo al km", "name": "costo_km", "required": 1, "class": "inputmask-decimal text-center", "value": "$costo_km$", "extra": "", "icon-after": "<i class='fa fa-euro'></i>" ]}+</div>++<div class="col-md-4">+{[ "type": "text", "label": "Diritto di chiamata", "name": "costo_dirittochiamata", "required": 1, "class": "inputmask-decimal text-center", "value": "$costo_dirittochiamata$", "extra": "", "icon-after": "<i class='fa fa-euro'></i>" ]}+</div>+</div>+</div>+</div>+++<div class="panel panel-primary">+<div class="panel-heading">+<h3 class="panel-title">Costi riconosciuti al tecnico</h3>+</div>++<div class="panel-body">+<div class="row">+<div class="col-md-4">+{[ "type": "text", "label": "Costo orario", "name": "costo_ore_tecnico", "required": 1, "class": "inputmask-decimal text-center", "value": "$costo_ore_tecnico$", "extra": "", "icon-after": "<i class='fa fa-euro'></i>" ]}+</div>++<div class="col-md-4">+{[ "type": "text", "label": "Costo al km", "name": "costo_km_tecnico", "required": 1, "class": "inputmask-decimal text-center", "value": "$costo_km_tecnico$", "extra": "", "icon-after": "<i class='fa fa-euro'></i>" ]}+</div>++<div class="col-md-4">+{[ "type": "text", "label": "Diritto di chiamata", "name": "costo_dirittochiamata_tecnico", "required": 1, "class": "inputmask-decimal text-center", "value": "$costo_dirittochiamata_tecnico$", "extra": "", "icon-after": "<i class='fa fa-euro'></i>" ]}+</div>+</div>+</div>+</div>+</form>+++<form action="" method="post" id="import-form">+<input type="hidden" name="op" value="import">+<input type="hidden" name="backto" value="record-edit">+<input type="hidden" name="id_record" value="<?php echo $id_record ?>">+<input type="hidden" name="idtecnico" value="<?php echo $records[0]['idtecnico'] ?>">+<input type="hidden" name="idtipointervento" value="<?php echo $records[0]['idtipointervento'] ?>">++<button type="button" class="btn btn-primary" onclick="if( confirm('Importare i costi standard per la coppia tecnico/tipo di intervento?') ){ $('#import-form').submit(); }"><i class="fa fa-download"></i> Importa costi standard per "<?php echo $records[0]['descrizione'] ?>"</button>+</form>Added: new_trunk/openstamanager/modules/tecnici_tariffe/init.php===================================================================--- new_trunk/openstamanager/modules/tecnici_tariffe/init.php (rev 0)+++ new_trunk/openstamanager/modules/tecnici_tariffe/init.php2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,7 @@+<?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}++$records = $dbo->fetchArray("SELECT in_tipiintervento.idtipointervento, idtecnico, ragione_sociale, descrizione, in_tariffe.costo_ore, in_tariffe.costo_km, in_tariffe.costo_dirittochiamata, in_tariffe.costo_ore_tecnico, in_tariffe.costo_km_tecnico, in_tariffe.costo_dirittochiamata_tecnico FROM ((in_tariffe INNER JOIN an_anagrafiche ON in_tariffe.idtecnico=an_anagrafiche.idanagrafica) INNER JOIN in_tipiintervento ON in_tariffe.idtipointervento=in_tipiintervento.idtipointervento) WHERE in_tariffe.id=\"".$id_record."\"");+?>Added: new_trunk/openstamanager/modules/voci_servizio/actions.php===================================================================--- new_trunk/openstamanager/modules/voci_servizio/actions.php (rev 0)+++ new_trunk/openstamanager/modules/voci_servizio/actions.php2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,39 @@+<?php+include_once("../../core.php");+include_once($docroot."/config.inc.php");+include_once($docroot."/lib/user_check.php");+include_once($docroot."/lib/permissions_check.php");++switch( $html->form('op', 'post') ){+case "update":+if( $permessi[$module_name] == 'rw' ){+$descrizione = $html->form( 'descrizione', 'post' );+$categoria = $html->form( 'categoria', 'post' );++$query = "UPDATE in_vociservizio SET descrizione=\"".$descrizione."\", categoria=\"".$categoria."\" WHERE id=\"".$id_record."\"";++$rs = $dbo->query( $query );+array_push( $_SESSION['infos'], "Informazioni salvate correttamente!" );+}+break;++case "add":+if( $permessi[$module_name] == 'rw' ){+$descrizione = $html->form( 'descrizione', 'post' );+$categoria = $html->form( 'categoria', 'post' );++$query = "INSERT INTO in_vociservizio( descrizione, categoria ) VALUES ( \"".$descrizione."\", \"".$categoria."\" )";+$rs = $dbo->query($query);+$id_record = $dbo->last_inserted_id();+array_push( $_SESSION['infos'], "Nuova voce di servizio aggiunta!" );+}+break;++case "delete":+if( $permessi[$module_name] == 'rw' ){+$query="DELETE FROM in_vociservizio WHERE id=\"".$id_record."\"";+$rs = $dbo->query($query);+}+break;+}+?>Added: new_trunk/openstamanager/modules/voci_servizio/add.html===================================================================--- new_trunk/openstamanager/modules/voci_servizio/add.html (rev 0)+++ new_trunk/openstamanager/modules/voci_servizio/add.html2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,21 @@+<form action="editor.php?id_module=$id_module$" method="post" id="add-form">+<input type="hidden" name="op" value="add">+<input type="hidden" name="backto" value="record-edit">++<div class="row">+<div class="col-md-4">+{[ "type": "text", "label": "Categoria", "name": "categoria", "required": 1, "class": "", "value": "", "extra": "" ]}+</div>++<div class="col-md-6">+{[ "type": "text", "label": "Descrizione", "name": "descrizione", "required": 1, "class": "", "value": "", "extra": "" ]}+</div>+</div>++<!-- PULSANTI -->+<div class="row">+<div class="col-md-12 text-right">+<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> Aggiungi</button>+</div>+</div>+</form>Added: new_trunk/openstamanager/modules/voci_servizio/edit.html===================================================================--- new_trunk/openstamanager/modules/voci_servizio/edit.html (rev 0)+++ new_trunk/openstamanager/modules/voci_servizio/edit.html2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,27 @@+<form action="" method="post" id="add-form">+<input type="hidden" name="op" value="update">+<input type="hidden" name="backto" value="record-edit">+<input type="hidden" name="id_record" value="<?php echo $id_record ?>">+++<div class="pull-right">+<button type="submit" class="btn btn-success"><i class="fa fa-check"></i> Salva modifiche</button>+</div>+<div class="clearfix"></div>++<div class="row">+<div class="col-md-4">+{[ "type": "text", "label": "Categoria", "name": "categoria", "required": 1, "class": "", "value": "$categoria$", "extra": "" ]}+</div>++<div class="col-md-6">+{[ "type": "text", "label": "Descrizione", "name": "descrizione", "required": 1, "class": "", "value": "$descrizione$", "extra": "" ]}+</div>+</div>+</form>++<form action="" method="post" role="form" id="form-delete">+<input type="hidden" name="backto" value="record-list">+<input type="hidden" name="op" value="delete">+<button type="button" class="btn-link" onclick="if( confirm('Eliminare questa voce di servizio?') ){ $('#form-delete').submit(); }"><span class="text-danger"><i class="fa fa-trash-o"></i> Elimina voce di servizio</span></button>+</form>Added: new_trunk/openstamanager/modules/voci_servizio/init.php===================================================================--- new_trunk/openstamanager/modules/voci_servizio/init.php (rev 0)+++ new_trunk/openstamanager/modules/voci_servizio/init.php2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,7 @@+<?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}++$records = $dbo->fetchArray("SELECT * FROM in_vociservizio WHERE id=\"".$id_record."\"");+?>Added: new_trunk/openstamanager/modules/zone/actions.php===================================================================--- new_trunk/openstamanager/modules/zone/actions.php (rev 0)+++ new_trunk/openstamanager/modules/zone/actions.php2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,66 @@+<?php+include_once("../../core.php");+include_once($docroot."/config.inc.php");+include_once($docroot."/lib/user_check.php");+include_once($docroot."/lib/permissions_check.php");++switch( $html->form('op', 'post') ){+case "update":+if( $permessi[$module_name] == 'rw' ){+$idzona = $html->form('id_record', 'post');+$nome = $html->form('nome', 'post');+$descrizione = $html->form('descrizione', 'post');++//Verifico che il nome o la descrizione non esistano già+$q = "SELECT id FROM an_zone WHERE (nome=\"".$nome."\" OR descrizione=\"".$descrizione."\") AND NOT id=\"".$idzona."\"";+$n = $dbo->fetchNum($q);++//Zona già esistente+if( $n>0 ){+array_push( $_SESSION['errors'], "Zona gi&agrave; esistente!" );+}++//Zona ok+else{+$query = "UPDATE an_zone SET nome=\"".$nome."\", descrizione=\"".$descrizione."\" WHERE id=\"".$idzona."\" AND `default`=0";+$rs = $dbo->query( $query );+array_push( $_SESSION['infos'], "Informazioni salvate correttamente!" );+}+}+break;++case "add":+if( $permessi[$module_name] == 'rw' ){+$nome = $html->form('nome', 'post');+$descrizione = $html->form('descrizione', 'post');++//Verifico che il nome non sia duplicato+$q = "SELECT id FROM an_zone WHERE nome=\"".$nome."\" OR descrizione=\"".$descrizione."\"";+$n = $dbo->fetchNum($q);++if( $n>0 ){+array_push( $_SESSION['errors'], "Nome gi&agrave; esistente!" );+}++else{+$query = "INSERT INTO an_zone( `nome`, `descrizione`, `default` ) VALUES ( \"".$nome."\", \"".$descrizione."\", 0 )";+$rs = $dbo->query($query);+$id_record = $dbo->last_inserted_id();+array_push( $_SESSION['infos'], "Aggiunta una nuova zona!" );+}+}+break;++case "delete":+if( $permessi[$module_name] == 'rw' ){+$dbo->query( "DELETE FROM an_zone WHERE id=\"".$id_record."\" AND `default`=0" );++//Reimposto a 0 tutti gli idzona su an_anagrafiche+//(scollego in pratica la zona eliminata da tutte le anagrafiche associate)+$dbo->query( "UPDATE an_anagrafiche SET idzona=0 WHERE id=\"".$id_record."\"" );++array_push( $_SESSION['infos'], "Zona eliminata!" );+}+break;+}+?>Added: new_trunk/openstamanager/modules/zone/add.html===================================================================--- new_trunk/openstamanager/modules/zone/add.html (rev 0)+++ new_trunk/openstamanager/modules/zone/add.html2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,21 @@+<form action="editor.php?id_module=$id_module$" method="post" id="add-form">+<input type="hidden" name="op" value="add">+<input type="hidden" name="backto" value="record-edit">++<div class="row">+<div class="col-md-2">+{[ "type": "text", "label": "Codice", "name": "nome", "required": 1, "class": "", "value": "", "extra": "" ]}+</div>++<div class="col-md-6">+{[ "type": "text", "label": "Descrizione", "name": "descrizione", "required": 1, "class": "", "value": "", "extra": "" ]}+</div>+</div>++<!-- PULSANTI -->+<div class="row">+<div class="col-md-12 text-right">+<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> Aggiungi</button>+</div>+</div>+</form>Added: new_trunk/openstamanager/modules/zone/edit.html===================================================================--- new_trunk/openstamanager/modules/zone/edit.html (rev 0)+++ new_trunk/openstamanager/modules/zone/edit.html2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,27 @@+<form action="" method="post" id="add-form">+<input type="hidden" name="op" value="update">+<input type="hidden" name="backto" value="record-edit">+<input type="hidden" name="id_record" value="<?php echo $id_record ?>">+++<div class="pull-right">+<button type="submit" class="btn btn-success"><i class="fa fa-check"></i> Salva modifiche</button>+</div>+<div class="clearfix"></div>++<div class="row">+<div class="col-md-2">+{[ "type": "text", "label": "Codice", "name": "nome", "required": 1, "class": "", "value": "$nome$", "extra": "" ]}+</div>++<div class="col-md-6">+{[ "type": "text", "label": "Descrizione", "name": "descrizione", "required": 1, "class": "", "value": "$descrizione$", "extra": "" ]}+</div>+</div>+</form>++<form action="" method="post" role="form" id="form-delete">+<input type="hidden" name="backto" value="record-list">+<input type="hidden" name="op" value="delete">+<button type="button" class="btn-link" onclick="if( confirm('Eliminare questa zona?') ){ $('#form-delete').submit(); }"><span class="text-danger"><i class="fa fa-trash-o"></i> Elimina zona</span></button>+</form>Added: new_trunk/openstamanager/modules/zone/init.php===================================================================--- new_trunk/openstamanager/modules/zone/init.php (rev 0)+++ new_trunk/openstamanager/modules/zone/init.php2014-08-04 17:18:01 UTC (rev 946)@@ -0,0 +1,7 @@+<?php+if( $docroot == '' ){+die( _("Accesso negato!") );+}++$records = $dbo->fetchArray("SELECT * FROM an_zone WHERE id=\"".$id_record."\"");+?>Modified: new_trunk/openstamanager/update/update_2.0.sql===================================================================--- new_trunk/openstamanager/update/update_2.0.sql2014-08-01 18:56:27 UTC (rev 945)+++ new_trunk/openstamanager/update/update_2.0.sql2014-08-04 17:18:01 UTC (rev 946)@@ -39,10 +39,10 @@ UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Codice, Descrizione, color_Colore\",\"query\": \"SELECT `idstatointervento` AS `Codice`, `idstatointervento` AS `id`, `descrizione` AS `Descrizione`, `colore` AS `color_Colore` FROM `in_statiintervento`\"}]}" WHERE name='Stati di intervento'; -- Tecnici e tariffe-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Ragione sociale, Costo orario, Costo al km, Diritto di chiamata, Costo orario tecnico, Costo al km tecnico, Diritto di chiamata tecnico\",\"query\": \"SELECT `id`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`idtecnico`) AS `Ragione sociale`, REPLACE( FORMAT(`costo_ore`,2), '.', ',' ) AS `Costo orario`, REPLACE( FORMAT(`costo_km`,2), '.', ',' ) AS `Costo al km`, REPLACE( FORMAT(`costo_dirittochiamata`,2), '.', ',' ) AS `Diritto di chiamata`, REPLACE( FORMAT(`costo_ore_tecnico`,2), '.', ',' ) AS `Costo orario tecnico`, REPLACE( FORMAT(`costo_km_tecnico`,2), '.', ',' ) AS `Costo al km tecnico`, REPLACE( FORMAT(`costo_dirittochiamata_tecnico`,2), '.', ',' ) AS `Diritto di chiamata tecnico` FROM `in_tariffe`\"}]}" WHERE name='Tecnici e tariffe';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Tipo intervento, Tecnico, Costo orario, Costo al km, Diritto di chiamata, Costo orario tecnico, Costo al km tecnico, Diritto di chiamata tecnico\",\"query\": \"SELECT `id`, (SELECT descrizione FROM in_tipiintervento WHERE idtipointervento=in_tariffe.idtipointervento) AS `Tipo intervento`, (SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica`=`idtecnico`) AS `Tecnico`, REPLACE( FORMAT(`costo_ore`,2), '.', ',' ) AS `Costo orario`, REPLACE( FORMAT(`costo_km`,2), '.', ',' ) AS `Costo al km`, REPLACE( FORMAT(`costo_dirittochiamata`,2), '.', ',' ) AS `Diritto di chiamata`, REPLACE( FORMAT(`costo_ore_tecnico`,2), '.', ',' ) AS `Costo orario tecnico`, REPLACE( FORMAT(`costo_km_tecnico`,2), '.', ',' ) AS `Costo al km tecnico`, REPLACE( FORMAT(`costo_dirittochiamata_tecnico`,2), '.', ',' ) AS `Diritto di chiamata tecnico` FROM `in_tariffe` ORDER BY idtipointervento, idtecnico\"}]}" WHERE name='Tecnici e tariffe'; -- Voci di servizio-UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Descrizione, Categoria\",\"query\": \"SELECT `id`, `descrizione` AS `Descrizione`, `categoria` AS `Categoria` FROM `in_vociservizio` ORDER BY `id`\"}]}" WHERE name='Voci di servizio';+UPDATE `zz_modules` SET `options`="{\"main_query\": [{\"type\": \"table\", \"fields\": \"Categoria, Descrizione\",\"query\": \"SELECT `id`, `descrizione` AS `Descrizione`, `categoria` AS `Categoria` FROM `in_vociservizio` ORDER BY `categoria`, `descrizione`\"}]}" WHERE name='Voci di servizio'; -- Voci non cliccabili UPDATE `zz_modules` SET `options`="" WHERE name IN('Contabilit&agrave;', 'Magazzino');This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[947]new_trunk/openstamanager

From: <lo...@us...> - 2014-08-05 10:19:14

Revision: 947 http://sourceforge.net/p/openstamanager/code/947Author: loviuzDate: 2014-08-05 10:19:05 +0000 (Tue, 05 Aug 2014)Log Message:-----------COREaggiunte precedenti schermate "Info" e "Impostazioni", riscritteeliminata directory inutile su themesModified Paths:-------------- new_trunk/openstamanager/include/top.phpAdded Paths:----------- new_trunk/openstamanager/info.php new_trunk/openstamanager/settings.phpRemoved Paths:------------- new_trunk/openstamanager/share/themes/default/modules/Modified: new_trunk/openstamanager/include/top.php===================================================================--- new_trunk/openstamanager/include/top.php2014-08-04 17:18:01 UTC (rev 946)+++ new_trunk/openstamanager/include/top.php2014-08-05 10:19:05 UTC (rev 947)@@ -19,7 +19,10 @@ $id_record = $html->form('id_record'); $rs = $dbo->fetchArray("SELECT name FROM zz_modules WHERE id=\"".$id_module."\"");-$module_name = $rs[0]['name'];++if( sizeof($rs) > 0 ){+$module_name = $rs[0]['name'];+} } ?><!DOCTYPE html>Added: new_trunk/openstamanager/info.php===================================================================--- new_trunk/openstamanager/info.php (rev 0)+++ new_trunk/openstamanager/info.php2014-08-05 10:19:05 UTC (rev 947)@@ -0,0 +1,152 @@+<?php+include("core.php");+include($docroot."/config.inc.php");+include($docroot."/lib/user_check.php");+$module_name = "Info";+include($docroot."/include/top.php");+?>+<div class="box box-solid">+<div class="box-body">+<?php+if( file_exists("assistenza.html") )+include("assistenza.html");+else{+?>+<img src="<?php echo $theme_path ?>/img/logo.png"><br>++<h3>OpenSTAManager</h3>+<b>Sito web: </b><a href="http://www.openstamanager.com" target="_blank">http://www.openstamanager.com</a><br>+<b>Versione:</b> <? echo getVersion(); ?><br>+<b>Licenza: <a href="http://www.gnu.org/licenses/gpl-3.0.txt" target="_blank" title="Vai al sito per leggere la licenza">GPLv3</a></b>+<div class="clearfix"></div>+<br>++<h3><i class="fa fa-question-circle"></i> COS&rsquo;&Eacute;</h3>+<p>+<b>OpenSTAManager</b> &eacute; un <b>software libero</b> ideato e sviluppato da <a href="mailto:in...@op...">Fabio Lovato</a>.<br>+Il nome significa &quot;Gestore di STA (<b>Servizio Tecnico Assistenza</b>) aperto&quot; ed &eacute; stato creato per gestire e archiviare l&rsquo;assistenza tecnica fornita ai propri clienti.+</p>+<hr>+++<div class="row-fluid">+<div class="col-md-6">+<div class="box box-primary">+<div class="box-header">+<h3 class="box-title"><i class="fa fa-globe"></i> PERCH&Eacute; SOFTWARE LIBERO</h3>+</div>++<div class="box-body">+&Eacute; software libero perch&eacute; permette a tutti di conoscere come funziona avendo il codice sorgente del programma e fornisce cos&igrave; la possibilit&agrave; di studiare come funziona, modificarlo, adattarlo alle proprie esigenze e, in ambito commerciale, non obbliga l&rsquo;utilizzatore ad essere legato allo stesso fornitore di assistenza.<br>+&Eacute; altrettanto importante sapere come funziona per conoscere come vengono trattati i VOSTRI dati, proteggendo cos&igrave; la vostra <b>privacy</b>.<br><br>++<h4>SOFTWARE LIBERO UTILIZZATO</h4>+<p>+OpenSTAManager &eacute; scritto utilizzando altro software libero tra cui principalmente:<br>+<a href="http://www.php.net" target="_blank"><i class="fa fa-circle-o-notch"></i> PHP</a><br>+<a href="http://www.mysql.com" target="_blank"><i class="fa fa-circle-o-notch"></i> MySQL</a><br>+<a href="http://jquery.com" target="_blank"><i class="fa fa-circle-o-notch"></i> JQuery</a><br>+<a href="http://getbootstrap.com" target="_blank"><i class="fa fa-circle-o-notch"></i> Bootstrap</a><br>+<a href="http://fortawesome.github.io/Font-Awesome" target="_blank"><i class="fa fa-circle-o-notch"></i> FontAwesome</a><br>+<a href="http://html2pdf.fr/it/default" target="_blank"><i class="fa fa-circle-o-notch"></i> HTML2PDF</a>+</p>+</div>+</div>+</div>+++<div class="col-md-6">+<div class="box box-danger">+<div class="box-header">+<h3 class="box-title"><i class="fa fa-group"></i> COMMUNITY</h3>+</div>++<div class="box-body">+La community &egrave; un componente importante in un progetto open source perch&egrave; mette in contatto le persone tra di loro, utenti e programmatori.<br><br>++Con OpenSTAManager siamo presenti su:<br>+<div class="well">+<div class="row">+<div class="col-md-4 text-center">+<a href="http://www.openstamanager.com/forum/" target="_blank"><i class="fa fa-2x fa-edit"></i><br>Forum</b></a>+</div>+<div class="col-md-4 text-center">+<a href="http://sourceforge.net/p/openstamanager/mailman/" target="_blank"><i class="fa fa-2x fa-envelope"></i><br>Mailing list</a>+</div>+<div class="col-md-4 text-center">+<a href="https://www.facebook.com/openstamanager" target="_blank"><i class="fa fa-2x fa-facebook-square"></i><br>Pagina Facebook</a>+</div>+</div>+</div>+<div class="clearfix"></div>+</div>+</div>+++<div class="box box-default">+<div class="box-header">+<h3 class="box-title"><i class="fa fa-download"></i> AGGIORNAMENTI E NUOVE VERSIONI</h3>+</div>++<div class="box-body">+Tutti gli aggiornamenti e le nuove versioni sono disponibili all&rsquo;indirizzo:<br>+<a href="http://www.openstamanager.com/downloads/" target="_blank"><i class="fa fa-external-link"></i> www.openstamanager.com/downloads/</a>+</div>+</div>+</div>+</div>+<div class="clearfix"></div>+++++<div class="row">+<div class="col-md-6">+<div class="box box-warning">+<div class="box-header">+<h3 class="box-title"><i class="fa fa-money"></i> SUPPORTA IL PROGETTO</h3>+</div>++<div class="box-body">+OpenSTAManager &egrave; software libero ed è nato e cresciuto con il lavoro volontario di alcuni programmatori.<br><br>++La filosofia del software libero fa s&igrave; che il progetto sia <b>accessibile a tutti</b> e nel nostro caso specifico lo &egrave;, anche dal punto di vista della gratuit&agrave;.+Offriamo supporto a pagamento professionale a chi fosse interessato, ma a chi non interessa il supporto a pagamento e sta comunque utilizzando il software chiediamo una donazione+per il lavoro svolto finora e per la possibilità di continuare questo progetto con lo stesso spirito con cui &egrave; nato. Con le donazioni non diventiamo ricchi, ma &egrave; un <b>grande+simbolo di apprezzamento</b>.+<br><br>++<a href="http://sourceforge.net/donate/index.php?group_id=236538" target="_blank"> <img src="http://images.sourceforge.net/images/project-support.jpg" width="88" height="32" border="0" alt="Supporta questo progetto" /></a>+</div>+</div>+</div>+++<div class="col-md-6">+<div class="box box-success">+<div class="box-header">+<h3 class="box-title"><i class="fa fa-euro"></i> SERVIZI A PAGAMENTO</h3>+</div>++<div class="box-body">+Per le aziende che hanno necessit&agrave; di essere seguite da <b>supporto professionale</b> &egrave; disponibile un servizio di assistenza e supporto a pagamento.<br><br>+&Egrave; disponibile anche un <b>servizio cloud</b> su cui poter installare OpenSTAManager, in modo da non doverti pi&ugrave; preoccupare di backup e gestione dei dati.<br><br><br>++Tutte le informazioni su servizi e prezzi le potete trovare qui:<br><br>++<a href="http://www.openstamanager.com/per-le-aziende/" class="btn btn-lg btn-success" target="_blank"><i class="fa fa-thumbs-up"></i> Ottieni supporto professionale</a>+</div>+</div>+</div>+</div>++<?php+}+?>+</div>+</div>+++<?php+include($docroot."/include/bottom.php");+?>Property changes on: new_trunk/openstamanager/info.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/settings.php===================================================================--- new_trunk/openstamanager/settings.php (rev 0)+++ new_trunk/openstamanager/settings.php2014-08-05 10:19:05 UTC (rev 947)@@ -0,0 +1,175 @@+<?php+include("core.php");+include($docroot."/config.inc.php");+include($docroot."/lib/user_check.php");+$module_name = "Info";++$op = $html->form('op');+$idutente = $_SESSION['idutente'];++switch( $op ){+case "updatesettings":+foreach( $_POST as $name => $value ){+$nome = str_replace( "_", " ", $name );+$nome = str_replace( "`", "'", $nome );+$valore = save($value);++//controllo del formato+$q = "SELECT * FROM zz_impostazioni WHERE nome=\"".$nome."\" AND editable=1";+$rs = $dbo->fetchArray( $q );+$sezione = makeid( $rs[0]['sezione'] );++//integer+if( $rs[0]['tipo'] == 'integer' ){+if( preg_match( '/^\d*$/', $valore ) )+$dbo->query( "UPDATE zz_impostazioni SET valore=\"$valore\" WHERE nome=\"$nome\"" );+else+array_push( $_SESSION['errors'], "Il valore inserito del parametro &quot;".$nome."&quot; deve essere un numero intero!" );+}++//list+//verifico che il valore scelto sia nella lista enumerata nel db+else if( preg_match( "/list\[(.+?)\]/", $rs[0]['tipo'], $m ) ){+$m = explode( ",", $m[1] );+for( $i=0; $i<sizeof($m); $i++ )+if( $m[$i] == $valore )+$dbo->query( "UPDATE zz_impostazioni SET valore=\"$valore\" WHERE nome=\"$nome\"" );+}++//Boolean (checkbox)+else if( $rs[0]['tipo']=='boolean' ){+$dbo->query( "UPDATE zz_impostazioni SET valore=\"$valore\" WHERE nome=\"$nome\"" );+}++//string+else{+$dbo->query( "UPDATE zz_impostazioni SET valore=\"$valore\" WHERE nome=\"$nome\"" );+}++if( ( sizeof($_SESSION['errors'])<=0 ) AND (sizeof($_SESSION['infos'])<=0) ){+array_push( $_SESSION['infos'], "Parametri aggiornati correttamente!" );+}+}+break;+}++include($docroot."/include/top.php");+++++echo "<h3><i class=\"fa fa-cog\"></i> Impostazioni</h3><hr>\n";++/*+ALTRI PARAMETRI+*/+$q = "SELECT * FROM zz_impostazioni WHERE editable=1 ORDER BY sezione ASC, nome ASC";+$rs = $dbo->fetchArray( $q );+$n = sizeof($rs);++if( $n>0 ){+$prev_sezione = "";+echo "<div class='box'>\n";+echo "<div class='box-group' id='accordion'>\n";++for( $i=0; $i<$n; $i++ ){+//Titolo sezione quando cambia+if( $prev_sezione != $rs[$i]['sezione'] ){++if( $i != 0 ){+echo "<br><br>";+echo "<button type=\"submit\" class=\"btn btn-success\"><i class=\"fa fa-check\"></i> Salva</button>\n";+echo "</form>\n";+echo "</div>\n";+echo "</div>\n";+echo "</div>\n";+}++$prev_i = $i;++echo "<div class=\"panel box box-primary\">\n";+echo "<div class=\"box-header\">\n";+echo "<h4 class=\"box-title\"><a class=\"collapsed\" href=\"#collapse".$i."\" data-parent=\"#accordion\" data-toggle=\"collapse\">".$rs[$i]['sezione']."</a></h4>\n";+echo "</div>\n";++( $i == $html->form('section') ) ? $class="in": $class="";++echo "<div id=\"collapse".$i."\" class=\"panel-collapse collapse ".$class."\">\n";+echo "<div class=\"box-body\">\n";+echo "<form id=\"save_form_settings_$i\" action=\"settings.php?op=updatesettings&amp;section=".$i."\" method=\"post\">\n";+}+?>++<label><? echo $rs[$i]['nome'] ?>:</label>++<?php+//Scelta fra più valori+if( preg_match("/list\[(.+?)\]/", $rs[$i]['tipo'], $m) ){+echo "<select class=\"form-control chosen\" name=\"".$rs[$i]['nome']."\">\n";+$m = explode( ",", $m[1] );++for( $j=0; $j<sizeof($m); $j++ ){+( $m[$j] == $rs[$i]['valore'] ) ? $checked='selected="selected"' : $checked='';+echo "<option value=\"".$m[$j]."\" $checked>".$m[$j]."</option>\n";+}++echo "</select>\n";+}++//query+else if( preg_match("/^query=(.+?)$/", $rs[$i]['tipo'], $m) ){+$query = $m[1];+$rsq = $dbo->fetchRows($query);+echo "<select name=\"".$rs[$i]['nome']."\" class='form-control chosen'>\n";+echo "<option value=''>- Seleziona un valore -</option>\n";+for( $r=0; $r<sizeof($rsq); $r++ ){+( $rs[$i]['valore']==$rsq[$r][0] ) ? $sel=' selected="selected"' : $sel='';+echo "<option value='".$rsq[$r][0]."' $sel>".$rsq[$r][1]."</option>\n";+}+echo "</select>\n";+}++//Boolean (checkbox)+else if( $rs[$i]['tipo']=='boolean' ){+if( $rs[$i]['valore']==1 ){+$attr1 = ' checked="checked"';+$attr2 = '';+}+else{+$attr1 = '';+$attr2 = ' checked="checked"';+}++echo "<label for='".$rs[$i]['idimpostazione']."_1'>s&igrave; <input id='".$rs[$i]['idimpostazione']."_1' type=\"radio\" name=\"".$rs[$i]['nome']."\" value=\"1\" $attr1 /></label>&nbsp;&nbsp;&nbsp;";+echo "<label for='".$rs[$i]['idimpostazione']."_2'>no <input id='".$rs[$i]['idimpostazione']."_2' type=\"radio\" name=\"".$rs[$i]['nome']."\" value=\"0\" $attr2 /></label>\n";+}++//Campo di testo normale+else{+echo "<input type=\"text\" name=\"".$rs[$i]['nome']."\" class=\"form-control\" value=\"".$rs[$i]['valore']."\" />\n";+}+++//ULTIMO PULSANTE SALVA, CHIUDO IL FORM E CHIUDO IL DIV+if ($i==($n-1)){+echo "<br><br>\n";+echo "<button type=\"submit\" class=\"btn btn-success\"><i class=\"fa fa-check\"></i> Salva</button>\n";+echo "</form>\n";+echo "</div>\n";+echo "</div>\n";+echo "</div>\n";+}++echo "<div class='clearfix'></div><br>\n";+++$prev_sezione = $rs[$i]['sezione'];+}++echo "</div>\n";+echo "</div>\n";+}++include($docroot."/include/bottom.php");+?>+Property changes on: new_trunk/openstamanager/settings.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyThis was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[1164]new_trunk/openstamanager

From: <luc...@us...> - 2015-02-27 17:27:41

Revision: 1164 http://sourceforge.net/p/openstamanager/code/1164Author: lucasalvaDate: 2015-02-27 17:27:38 +0000 (Fri, 27 Feb 2015)Log Message:-----------[core][fix] risolto problema errore mysql generato dal controllo del Backup automaticoModified Paths:-------------- new_trunk/openstamanager/include/top.php new_trunk/openstamanager/index.phpModified: new_trunk/openstamanager/include/top.php===================================================================--- new_trunk/openstamanager/include/top.php2015-02-27 17:00:20 UTC (rev 1163)+++ new_trunk/openstamanager/include/top.php2015-02-27 17:27:38 UTC (rev 1164)@@ -2,7 +2,8 @@ include_once("core.php"); //PARAMETRI PER PAGINAZIONE-$is_db_installed = $dbo->fetchNum( "DESCRIBE an_anagrafiche", 1 );+//$is_db_installed = $dbo->fetchNum( "DESCRIBE an_anagrafiche", 1 );+$is_db_installed = $dbo->fetchNum("SHOW TABLES LIKE 'zz_modules'"); if( $is_db_installed ){ //Ordinamento moduli di primo livelloModified: new_trunk/openstamanager/index.php===================================================================--- new_trunk/openstamanager/index.php2015-02-27 17:00:20 UTC (rev 1163)+++ new_trunk/openstamanager/index.php2015-02-27 17:27:38 UTC (rev 1164)@@ -174,14 +174,16 @@ <br> <?php+ include($docroot."/update/update_checker.php");- ?>+$is_db_installed = $dbo->fetchNum("SHOW TABLES LIKE 'zz_modules'"); - <script>+?>+<script> $(document).ready(function() { $('#login').click(function(){ <?php-if( $is_db_installed == "1" || $is_db_installed == "" ){+if( $is_db_installed == 1 ){ if( get_var("Backup automatico") ){ $str = _("Backup automatico in corso..."); }This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[1209]new_trunk/openstamanager

From: <lo...@us...> - 2015-06-15 09:18:16

Revision: 1209 http://sourceforge.net/p/openstamanager/code/1209Author: loviuzDate: 2015-06-15 09:18:13 +0000 (Mon, 15 Jun 2015)Log Message:-----------[core][fix] aggiunti nuovi file per aggiornamento e forzatura logout durante l'aggiornamentoModified Paths:-------------- new_trunk/openstamanager/REVISION new_trunk/openstamanager/VERSION new_trunk/openstamanager/update/create_updates.sql new_trunk/openstamanager/update/update_checker.phpModified: new_trunk/openstamanager/REVISION===================================================================--- new_trunk/openstamanager/REVISION2015-06-15 09:14:01 UTC (rev 1208)+++ new_trunk/openstamanager/REVISION2015-06-15 09:18:13 UTC (rev 1209)@@ -1 +1 @@-1182+1209Modified: new_trunk/openstamanager/VERSION===================================================================--- new_trunk/openstamanager/VERSION2015-06-15 09:14:01 UTC (rev 1208)+++ new_trunk/openstamanager/VERSION2015-06-15 09:18:13 UTC (rev 1209)@@ -1 +1 @@-2.1+2.2Modified: new_trunk/openstamanager/update/create_updates.sql===================================================================--- new_trunk/openstamanager/update/create_updates.sql2015-06-15 09:14:01 UTC (rev 1208)+++ new_trunk/openstamanager/update/create_updates.sql2015-06-15 09:18:13 UTC (rev 1209)@@ -11,5 +11,6 @@ INSERT INTO updates( `version`, `filename`, `script` ) VALUES ( 'base','null','' ), ( '2.0','install_2.0.sql','' ),-( '2.1','update_2.1.sql','update_2.1.php' );+( '2.1','update_2.1.sql','update_2.1.php' ),+( '2.2','update_2.2.sql','update_2.2.php' ); Modified: new_trunk/openstamanager/update/update_checker.php===================================================================--- new_trunk/openstamanager/update/update_checker.php2015-06-15 09:14:01 UTC (rev 1208)+++ new_trunk/openstamanager/update/update_checker.php2015-06-15 09:18:13 UTC (rev 1209)@@ -382,6 +382,9 @@ Aggiornamento tramite ajax */ if( $action=='do_update' ){+//Logout se non eseguito dall'utente+unset( $_SESSION['idutente'] );+ //Seleziono tutti gli aggiornamenti successivi all'attuale e nel ciclo for() eseguo gli script ad uno ad uno $qm = "SELECT * FROM updates WHERE `done`=0 ORDER BY idupdate ASC"; $rsm = $dbo->fetchArray( $qm );This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[1341]new_trunk/openstamanager

From: <luc...@us...> - 2016-02-18 10:44:16

Revision: 1341 http://sourceforge.net/p/openstamanager/code/1341Author: lucasalvaDate: 2016-02-18 10:44:13 +0000 (Thu, 18 Feb 2016)Log Message:-----------[fatture][edit] aggiunta possibilit?\195?\160 di ordinare righe in fattura[contratti] [fix] corretto bug che resettava campo budget ogni volta che si salvava il contratto[impianti] [fix] uniformato campo idintervento nella tabella componenti con varchar (25) come in tutte le altre tabelle[anagrafiche] [edit] aggiunta possibilit?\195?\160 di inserire codice BIC (o SWIFT) Modified Paths:-------------- new_trunk/openstamanager/modules/anagrafiche/actions.php new_trunk/openstamanager/modules/anagrafiche/edit.html new_trunk/openstamanager/modules/contratti/actions.php new_trunk/openstamanager/modules/fatture/actions.php new_trunk/openstamanager/modules/fatture/row-list.php new_trunk/openstamanager/templates/fatture/pdfgen.fatture.php new_trunk/openstamanager/update/update_2.2.sqlModified: new_trunk/openstamanager/modules/anagrafiche/actions.php===================================================================--- new_trunk/openstamanager/modules/anagrafiche/actions.php2016-02-16 11:15:11 UTC (rev 1340)+++ new_trunk/openstamanager/modules/anagrafiche/actions.php2016-02-18 10:44:13 UTC (rev 1341)@@ -48,6 +48,7 @@ "appoggiobancario=\"".$html_post['appoggiobancario']."\",". "filiale=\"".$html_post['filiale']."\",". "codiceiban=\"".$html_post['codiceiban']."\",".+"bic=\"".$html_post['bic']."\",". "diciturafissafattura=\"".$html_post['diciturafissafattura']."\",". "idpagamento=\"".$html_post['idpagamento']."\",". "idlistino=\"".$html_post['idlistino']."\",".Modified: new_trunk/openstamanager/modules/anagrafiche/edit.html===================================================================--- new_trunk/openstamanager/modules/anagrafiche/edit.html2016-02-16 11:15:11 UTC (rev 1340)+++ new_trunk/openstamanager/modules/anagrafiche/edit.html2016-02-18 10:44:13 UTC (rev 1341)@@ -216,15 +216,19 @@ {[ "type": "text", "label": "Appoggio bancario", "name": "appoggiobancario", "required": 0, "class": "", "value": "$appoggiobancario$", "extra": "" ]} </div> -<div class="col-md-3">+<div class="col-md-2"> {[ "type": "text", "label": "Filiale banca", "name": "filiale", "required": 0, "class": "", "value": "$filiale$", "extra": "" ]} </div> <div class="col-md-3"> {[ "type": "text", "label": "Codice IBAN", "name": "codiceiban", "required": 0, "class": "", "value": "$codiceiban$", "extra": "" ]} </div>--<div class="col-md-3">++<div class="col-md-2">+{[ "type": "text", "label": "Codice BIC", "name": "bic", "required": 0, "class": "", "value": "$bic$", "extra": "" ]}+</div>++<div class="col-md-2"> {[ "type": "text", "label": "Dicitura fissa fattura", "name": "diciturafissafattura", "required": 0, "class": "", "value": "$diciturafissafattura$", "extra": "" ]} </div> </div>Modified: new_trunk/openstamanager/modules/contratti/actions.php===================================================================--- new_trunk/openstamanager/modules/contratti/actions.php2016-02-16 11:15:11 UTC (rev 1340)+++ new_trunk/openstamanager/modules/contratti/actions.php2016-02-18 10:44:13 UTC (rev 1341)@@ -40,8 +40,17 @@ $idagente = save( $_POST['idagente'] ); $idpagamento = save( $_POST['idpagamento'] ); $numero = save( $_POST['numero'] );-$budget = save($_POST['budget']);-$budget = str_replace( ",", ".", $budget );++//Se non specifico un budget me lo vado a ricalcolare+if ($budget != ""){+$budget = save($_POST['budget']);+$budget = str_replace( ",", ".", $budget );+}else{+$q = "SELECT (SELECT SUM(subtotale) FROM co_righe2_contratti GROUP BY idcontratto HAVING idcontratto=co_contratti.id) AS 'budget' FROM co_contratti WHERE id=$idcontratto";+$rs = $dbo->fetchArray($q);+$budget = $rs[0]['budget'];+}+ $data_bozza = saveDate( $_POST['data_bozza'] ); $data_accettazione = saveDate( $_POST['data_accettazione'] ); $data_rifiuto = saveDate( $_POST['data_rifiuto'] );Modified: new_trunk/openstamanager/modules/fatture/actions.php===================================================================--- new_trunk/openstamanager/modules/fatture/actions.php2016-02-16 11:15:11 UTC (rev 1340)+++ new_trunk/openstamanager/modules/fatture/actions.php2016-02-18 10:44:13 UTC (rev 1341)@@ -1236,6 +1236,17 @@ } } break;++//ordino righe in fattura+case "sortrows":+$id= $html->form('id', 'post');+$iddocumento= $html->form('iddocumento', 'post');+$ordine= $html->form('ordine', 'post');+$dbo->query("UPDATE co_righe_documenti SET ordine=".$ordine." WHERE id=".$id."");+array_push( $_SESSION['infos'], "Ordine aggiornato!" );+exit;+break;+ } ?>Modified: new_trunk/openstamanager/modules/fatture/row-list.php===================================================================--- new_trunk/openstamanager/modules/fatture/row-list.php2016-02-16 11:15:11 UTC (rev 1340)+++ new_trunk/openstamanager/modules/fatture/row-list.php2016-02-18 10:44:13 UTC (rev 1341)@@ -15,7 +15,7 @@ /* Righe fattura */-$q = "SELECT *, IFNULL((SELECT codice FROM mg_articoli WHERE id=idarticolo),'') AS codice_articolo FROM `co_righe_documenti` WHERE iddocumento='".$id_record."'";+$q = "SELECT *, IFNULL((SELECT codice FROM mg_articoli WHERE id=idarticolo),'') AS codice_articolo FROM `co_righe_documenti` WHERE iddocumento='".$id_record."' ORDER BY ordine"; $rs = $dbo->fetchArray( $q ); $tot = sizeof($rs); $imponibile = 0.0;@@ -81,6 +81,15 @@ echo "</div>\n"; echo "</form>\n"; }++//Frecce per orinare righe della fattura+echo "<a href='javascript:;' onclick=\"$.post( '".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."', { op: 'sortrows', id: '".$rs[$i]['id']."', ordine: '".($rs[$i]['ordine']-1)."' }, function(response){ location.href='".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."'; });\" >\n";+echo "<i class='fa fa-arrow-up text-success' data-toggle='tooltip' title=\"Clicca per spostare in su la riga...\"></i>";+echo "</a>\n";++echo "<a href='javascript:;' onclick=\"$.post( '".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."', { op: 'sortrows', id: '".$rs[$i]['id']."', ordine: '".($rs[$i]['ordine']+1)."' }, function(response){ location.href='".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."'; });\" >\n";+echo "<i class='fa fa-arrow-down text-success' data-toggle='tooltip' title=\"Clicca per spostare in giù la riga...\"></i>";+echo "</a>\n"; echo "</td></tr>\n"; @@ -148,7 +157,16 @@ echo "</div>\n"; echo "</form>\n"; }-++//Frecce per orinare righe della fattura+echo "<a href='javascript:;' onclick=\"$.post( '".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."', { op: 'sortrows', id: '".$rs[$i]['id']."', ordine: '".($rs[$i]['ordine']-1)."' }, function(response){ location.href='".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."'; });\" >\n";+echo "<i class='fa fa-arrow-up text-success' data-toggle='tooltip' title=\"Clicca per spostare in su la riga...\"></i>";+echo "</a>\n";++echo "<a href='javascript:;' onclick=\"$.post( '".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."', { op: 'sortrows', id: '".$rs[$i]['id']."', ordine: '".($rs[$i]['ordine']+1)."' }, function(response){ location.href='".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."'; });\" >\n";+echo "<i class='fa fa-arrow-down text-success' data-toggle='tooltip' title=\"Clicca per spostare in giù la riga...\"></i>";+echo "</a>\n";+ echo "</td></tr>\n"; $imponibile_pre += $rs[$i]['subtotale'];@@ -215,6 +233,15 @@ echo "</div>\n"; echo "</form>\n"; }++//Frecce per orinare righe della fattura+echo "<a href='javascript:;' onclick=\"$.post( '".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."', { op: 'sortrows', id: '".$rs[$i]['id']."', ordine: '".($rs[$i]['ordine']-1)."' }, function(response){ location.href='".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."'; });\" >\n";+echo "<i class='fa fa-arrow-up text-success' data-toggle='tooltip' title=\"Clicca per spostare in su la riga...\"></i>";+echo "</a>\n";++echo "<a href='javascript:;' onclick=\"$.post( '".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."', { op: 'sortrows', id: '".$rs[$i]['id']."', ordine: '".($rs[$i]['ordine']+1)."' }, function(response){ location.href='".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."'; });\" >\n";+echo "<i class='fa fa-arrow-down text-success' data-toggle='tooltip' title=\"Clicca per spostare in giù la riga...\"></i>";+echo "</a>\n"; echo "</td></tr>\n"; @@ -303,6 +330,16 @@ echo "</form>\n"; } +//Frecce per orinare righe della fattura+echo "<a href='javascript:;' onclick=\"$.post( '".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."', { op: 'sortrows', id: '".$rs[$i]['id']."', ordine: '".($rs[$i]['ordine']-1)."' }, function(response){ location.href='".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."'; });\" >\n";+echo "<i class='fa fa-arrow-up text-success' data-toggle='tooltip' title=\"Clicca per spostare in su la riga...\"></i>";+echo "</a>\n";++echo "<a href='javascript:;' onclick=\"$.post( '".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."', { op: 'sortrows', id: '".$rs[$i]['id']."', ordine: '".($rs[$i]['ordine']+1)."' }, function(response){ location.href='".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."'; });\" >\n";+echo "<i class='fa fa-arrow-down text-success' data-toggle='tooltip' title=\"Clicca per spostare in giù la riga...\"></i>";+echo "</a>\n";++ echo "</td></tr>\n"; $imponibile_art += $rs[$i]['subtotale'];@@ -385,6 +422,15 @@ echo "</div>\n"; echo "</form>\n"; }++//Frecce per orinare righe della fattura+echo "<a href='javascript:;' onclick=\"$.post( '".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."', { op: 'sortrows', id: '".$rs[$i]['id']."', ordine: '".($rs[$i]['ordine']-1)."' }, function(response){ location.href='".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."'; });\" >\n";+echo "<i class='fa fa-arrow-up text-success' data-toggle='tooltip' title=\"Clicca per spostare in su la riga...\"></i>";+echo "</a>\n";++echo "<a href='javascript:;' onclick=\"$.post( '".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."', { op: 'sortrows', id: '".$rs[$i]['id']."', ordine: '".($rs[$i]['ordine']+1)."' }, function(response){ location.href='".$rootdir."/editor.php?id_module=".$modules_info[$name]['id']."&id_record=".$id_record."'; });\" >\n";+echo "<i class='fa fa-arrow-down text-success' data-toggle='tooltip' title=\"Clicca per spostare in giù la riga...\"></i>";+echo "</a>\n"; echo "</td></tr>\n"; Modified: new_trunk/openstamanager/templates/fatture/pdfgen.fatture.php===================================================================--- new_trunk/openstamanager/templates/fatture/pdfgen.fatture.php2016-02-16 11:15:11 UTC (rev 1340)+++ new_trunk/openstamanager/templates/fatture/pdfgen.fatture.php2016-02-18 10:44:13 UTC (rev 1341)@@ -95,7 +95,7 @@ /* Righe fattura */-$qr = "SELECT * FROM `co_righe_documenti` WHERE iddocumento='$iddocumento'";+$qr = "SELECT * FROM `co_righe_documenti` WHERE iddocumento='$iddocumento' ORDER BY ordine"; $rsr = $dbo->fetchArray( $qr ); $tot = sizeof($rsr); $imponibile_int = 0.00;Modified: new_trunk/openstamanager/update/update_2.2.sql===================================================================--- new_trunk/openstamanager/update/update_2.2.sql2016-02-16 11:15:11 UTC (rev 1340)+++ new_trunk/openstamanager/update/update_2.2.sql2016-02-18 10:44:13 UTC (rev 1341)@@ -122,3 +122,11 @@ -- Aggiunto filtro per visualizzare lo scadenzario delle sole fatture UPDATE `zz_modules` SET `options` = '{"main_query": [{"type": "table", "fields": "Documento, Anagrafica, Tipo di pagamento, Data emissione, Data scadenza, Importo, Pagato", "query": "SELECT co_scadenziario.id AS id, ragione_sociale AS `Anagrafica`, tipo, co_pagamenti.descrizione AS `Tipo di pagamento`, CONCAT( co_tipidocumento.descrizione, CONCAT( '' numero '', IF(numero_esterno<>'''', numero_esterno, numero) ) ) AS `Documento`, DATE_FORMAT(data_emissione, ''%d/%m/%Y'') AS `Data emissione`, DATE_FORMAT(scadenza, ''%d/%m/%Y'') AS `Data scadenza`, REPLACE( REPLACE( REPLACE( FORMAT(da_pagare, 2), '','', ''#''), ''.'', '',''), ''#'', ''.'') AS `Importo`, REPLACE( REPLACE( REPLACE( FORMAT(pagato, 2), '','', ''#''), ''.'', '',''), ''#'', ''.'') AS `Pagato`, IF(scadenza<NOW(), ''#ff7777'', '''') AS _bg_, da_pagare, pagato, co_statidocumento.descrizione FROM (co_scadenziario INNER JOIN (((co_documenti INNER JOIN an_anagrafiche ON co_documenti.idanagrafica=an_anagrafiche.idanagrafica) INNER JOIN co_pagamenti ON co_documenti.idpagamento=co_pagamenti.id) INNER JOIN co_tipidocumento ON co_documenti.idtipodocumento=co_tipidocumento.id) ON co_scadenziario.iddocumento=co_documenti.id) INNER JOIN co_statidocumento ON co_documenti.idstatodocumento=co_statidocumento.id HAVING 1=1 AND (ABS(pagato) < ABS(da_pagare) AND co_statidocumento.descrizione IN(''Emessa'',''Parzialmente pagato'')) AND tipo=''documento'' ORDER BY scadenza ASC"}]}' WHERE `zz_modules`.`name` = 'Scadenzario'; +-- Aggiunto campo bic per l'anagrafica+ALTER TABLE `an_anagrafiche` ADD `bic` VARCHAR( 25 ) NOT NULL AFTER `codiceiban` ;++-- Uniformo lunghezza varchar per idintervento in my_impianto_componenti - prima era varchar (20)+ALTER TABLE `my_impianto_componenti` CHANGE `idintervento` `idintervento` VARCHAR( 25 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ;++-- Aggiunto campo ordine per poter ordinare le righe in fattura+ALTER TABLE `co_righe_documenti` ADD `ordine` INT( 11 ) NOT NULL AFTER `altro` ;\ No newline at end of fileThis was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[1354]new_trunk/openstamanager

From: <luc...@us...> - 2016-03-02 13:48:18

Revision: 1354 http://sourceforge.net/p/openstamanager/code/1354Author: lucasalvaDate: 2016-03-02 13:48:15 +0000 (Wed, 02 Mar 2016)Log Message:-----------[core][fix] corretta query per il redirect al primo modulo attivo una volta effettuato il loginModified Paths:-------------- new_trunk/openstamanager/index.php new_trunk/openstamanager/lib/jscripts/functionsjs.phpModified: new_trunk/openstamanager/index.php===================================================================--- new_trunk/openstamanager/index.php2016-02-29 18:45:03 UTC (rev 1353)+++ new_trunk/openstamanager/index.php2016-03-02 13:48:15 UTC (rev 1354)@@ -102,14 +102,13 @@ //Redirect al primo modulo abilitato su cui l'utente ha accesso if( $_SESSION['is_admin'] ){-$q = "SELECT id, module_dir, options FROM zz_modules WHERE level='0' AND enabled='1' AND type='menu' ORDER BY `order` ASC";+$q = "SELECT id as idmodulo, IF(options IS NULL or options = '', (SELECT id FROM zz_modules WHERE level='1' AND enabled='1' AND type='menu' AND parent = idmodulo ORDER BY `order` ASC LIMIT 0,1), id) AS id, module_dir, options FROM zz_modules WHERE level='0' AND enabled='1' AND type='menu' ORDER BY `order` ASC"; } else{-$q = "SELECT id, module_dir, options FROM zz_modules WHERE level='0' AND enabled='1' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT id FROM zz_gruppi WHERE nome='".$rs[0]['gruppo']."') AND permessi IN ('r', 'rw') ) AND type='menu' ORDER BY `order` ASC";+$q = "SELECT id as idmodulo, IF(options IS NULL or options = '', (SELECT id FROM zz_modules WHERE level='1' AND enabled='1' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT id FROM zz_gruppi WHERE nome='".$rs[0]['gruppo']."') AND permessi IN ('r', 'rw') ) AND type='menu' AND parent = idmodulo ORDER BY `order` ASC LIMIT 0,1), id) AS id, module_dir, options FROM zz_modules WHERE level='0' AND enabled='1' AND id IN (SELECT idmodule FROM zz_permessi WHERE idgruppo=(SELECT id FROM zz_gruppi WHERE nome='".$rs[0]['gruppo']."') AND permessi IN ('r', 'rw') ) AND type='menu' ORDER BY `order` ASC"; } - $rs = $dbo->fetchArray($q); if( sizeof($rs) <= 0 && !$_SESSION['is_admin'] ){Modified: new_trunk/openstamanager/lib/jscripts/functionsjs.php===================================================================--- new_trunk/openstamanager/lib/jscripts/functionsjs.php2016-02-29 18:45:03 UTC (rev 1353)+++ new_trunk/openstamanager/lib/jscripts/functionsjs.php2016-03-02 13:48:15 UTC (rev 1354)@@ -861,8 +861,12 @@ } -function update_jchosen(id, start = '', readonly = ''){+function update_jchosen(id, start, readonly){ +if (typeof(start)==='undefined') start = '';+if (typeof(readonly)==='undefined') readonly = '';+ + $(id).on('chosen:updated', function () { if ($(id).attr('readonly')) { var wasDisabled = $(id).is(':disabled');This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[osm-devel] SF.net SVN: openstamanager:[948]new_trunk/openstamanager

From: <lo...@us...> - 2014-08-05 15:00:19

Revision: 948 http://sourceforge.net/p/openstamanager/code/948Author: loviuzDate: 2014-08-05 15:00:03 +0000 (Tue, 05 Aug 2014)Log Message:-----------COREAggiunte schermate del menu in alto a destra (Info, Impostazioni, Permessi)Modified Paths:-------------- new_trunk/openstamanager/lib/dbo.class.php new_trunk/openstamanager/settings.phpAdded Paths:----------- new_trunk/openstamanager/addgroup.php new_trunk/openstamanager/adduser.php new_trunk/openstamanager/change_pwd.phpAdded: new_trunk/openstamanager/addgroup.php===================================================================--- new_trunk/openstamanager/addgroup.php (rev 0)+++ new_trunk/openstamanager/addgroup.php2014-08-05 15:00:03 UTC (rev 948)@@ -0,0 +1,17 @@+<?php+include("core.php");+include($docroot."/config.inc.php");+include($docroot."/lib/user_check.php");++/*+Form di inserimento+*/+echo "<h3>Crea un nuovo gruppo</h3>\n";+echo "<form id=\"link_form\" action=\"permissions.php?op=addgroup\" method=\"post\" onsubmit=\"return ( \$('#nome').val()!='' );\">\n";+echo "<label>Nome:</label>\n";+echo "<input type='text' class='form-control' name='nome' id='nome' value=''><br><br>\n";++echo "<button type=\"submit\" class=\"btn btn-primary\"><i class=\"fa fa-plus\"></i> Aggiungi</button>\n";+echo "</form>\n";+?>+Property changes on: new_trunk/openstamanager/addgroup.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/adduser.php===================================================================--- new_trunk/openstamanager/adduser.php (rev 0)+++ new_trunk/openstamanager/adduser.php2014-08-05 15:00:03 UTC (rev 948)@@ -0,0 +1,50 @@+<?php+include("core.php");+include($docroot."/config.inc.php");+include($docroot."/lib/user_check.php");++/*+Form di inserimento+*/+$idgruppo = intval($_GET['idgruppo']);+echo "<h3>Crea nuovo utente</h3>\n";+echo "<form id=\"link_form\" action=\"permissions.php?op=add&idgruppo=".$idgruppo."\" method=\"post\" onsubmit=\"return ( \$('#username').val()!='' && \$('#password').val()!='0' );\">\n";++echo "<label>Username:</label>\n";+echo "<input type='text' class='form-control' name='username' id='username' value=''><br><br>\n";++echo "<label>Password:</label>\n";+echo "<input type='password' class='form-control' name='password' id='password' value=''><br><br>\n";++//Seleziona anagrafica+echo "<label>Collega ad una anagrafica:</label><br>\n";+$query = "SELECT * FROM an_tipianagrafiche ORDER BY descrizione ASC";+$rs = $dbo->fetchArray( $query );+$n = sizeof( $rs );++echo "<select name=\"idanag\" class=\"chosen\">\n";+echo "<option value=\"0-0\">- Seleziona un'anagrafica -</option>";+for( $i=0; $i<$n; $i++ ){+echo "<optgroup label=\"".htmlentities($rs[$i]['descrizione'])."\">\n";++$query2 = "SELECT an_anagrafiche.idanagrafica, ragione_sociale FROM an_anagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE idtipoanagrafica='".$rs[$i]['idtipoanagrafica']."' ORDER BY ragione_sociale ASC";+$rs2 = $dbo->fetchArray( $query2 );+$n2 = sizeof( $rs2 );++for( $j=0; $j<$n2; $j++ ){+echo "<option value=\"".$rs[$i]['idtipoanagrafica']."-".$rs2[$j]['idanagrafica']."\">".$rs2[$j]['ragione_sociale']."</option>\n";+}+echo "</optgroup>\n";+}+echo "</select><br><br>\n";+++echo "<button type=\"submit\" class=\"btn btn-primary\"><i class=\"fa fa-plus\"></i> Aggiungi</button>\n";+echo "</form>\n";+?>++<script>+$(document).ready( function(){+start_jquerychosen();+});+</script>Property changes on: new_trunk/openstamanager/adduser.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyAdded: new_trunk/openstamanager/change_pwd.php===================================================================--- new_trunk/openstamanager/change_pwd.php (rev 0)+++ new_trunk/openstamanager/change_pwd.php2014-08-05 15:00:03 UTC (rev 948)@@ -0,0 +1,47 @@+<?php+include("core.php");+include($docroot."/config.inc.php");+include($docroot."/lib/user_check.php");++/*+Form di aggiornamento+*/+$idutente = intval($_GET['idutente']);+$idgruppo = intval($_GET['idgruppo']);+$query = "SELECT * FROM zz_utenti WHERE idutente='".$idutente."'";+$rs = $dbo->fetchArray( $query );++echo "<h3>Cambia password</h3>\n";+++echo "<label>Username:</label><br>\n";+echo $rs[0]['username']."<br><br>\n";+++echo "<form id=\"link_form\" action=\"permissions.php?op=change_pwd&idgruppo=".$idgruppo."\" method=\"post\">\n";+echo "<input type='hidden' name='idutente' value='".$idutente."'>\n";++echo "<label>Password:</label><br>\n";+echo "<input type='password' class='form-control' name='password1' id='password1' value=''><br><br>\n";++echo "<label>Ripeti password:</label><br>\n";+echo "<input type='password' class='form-control' name='password2' id='password2' value=''><br><br>\n";+++echo "<button type=\"button\" onclick=\"do_submit()\" class=\"btn btn-warning\"><i class=\"fa fa-lock\"></i> Modifica</button>\n";+echo "</form>\n";+?>+<script type="text/javascript">+min_length = 8;+function do_submit(){+if( $('#password1').val()=='' || $('#password2').val()=='' )+alert( "Inserire una password valida!" );+else if( $('#password1').val() != $('#password2').val() )+alert( "Le password non coincidono!" );+else if( $('#password1').val().length < min_length )+alert( "La password deve essere lunga minimo "+min_length+" caratteri!" );+else+$('#link_form').submit();+}+</script>+Property changes on: new_trunk/openstamanager/change_pwd.php___________________________________________________________________Added: svn:executable## -0,0 +1 ##+*\ No newline at end of propertyModified: new_trunk/openstamanager/lib/dbo.class.php===================================================================--- new_trunk/openstamanager/lib/dbo.class.php2014-08-05 10:19:05 UTC (rev 947)+++ new_trunk/openstamanager/lib/dbo.class.php2014-08-05 15:00:03 UTC (rev 948)@@ -10,6 +10,7 @@ global $db_username; global $db_password; global $db_name;+global $_SESSION; if( $conn = @mysql_connect( $db_host, $db_username, $db_password ) ) if( @mysql_select_db($db_name, $conn) )@@ -22,6 +23,8 @@ //query on the table function query($sql, $hide_errors=0){+global $_SESSION;+ if( @mysql_query($sql) ){ $id = mysql_insert_id(); if( $id==0 )@@ -31,7 +34,7 @@ } else{ if( $hide_errors==0 )-array_push( $errors, mysql_error() );+array_push( $_SESSION['errors'], mysql_error() ); else return false; }@@ -39,14 +42,17 @@ //fetch row function fetchRow($sql){-$rows = @mysql_fetch_row( mysql_query($sql) ) or array_push( $errors, mysql_error() );+global $_SESSION;+$rows = @mysql_fetch_row( mysql_query($sql) ) or array_push( $_SESSION['errors'], mysql_error() ); return $rows; } //record count function fetchNum($sql, $hide_error=0){+global $_SESSION;+ if( $hide_error==0 )-$num = @mysql_num_rows( mysql_query($sql) ) or array_push( $errors, mysql_error() );+$num = @mysql_num_rows( mysql_query($sql) ); else $num = @mysql_num_rows( mysql_query($sql) ); return $num;@@ -54,6 +60,8 @@ //fetch records function fetchArray($sql){+global $_SESSION;+ $i=0; if( $q=@mysql_query($sql) ) while( $rs=mysql_fetch_array( $q, MYSQL_ASSOC ) ){@@ -62,12 +70,14 @@ } else if( $hide_error==0 )-array_push( $errors, mysql_error() );+array_push( $_SESSION['errors'], mysql_error() ); return $array; } //fetch records (numero al posto del nome del campo) function fetchRows($sql){+global $_SESSION;+ $i=0; if( $q=@mysql_query($sql) ) while( $rs=mysql_fetch_row($q) ){@@ -76,7 +86,7 @@ } else if( $hide_error==0 )-array_push( $errors, mysql_error() );+array_push( $_SESSION['errors'], mysql_error() ); return $array; } Modified: new_trunk/openstamanager/settings.php===================================================================--- new_trunk/openstamanager/settings.php2014-08-05 10:19:05 UTC (rev 947)+++ new_trunk/openstamanager/settings.php2014-08-05 15:00:03 UTC (rev 948)@@ -92,11 +92,11 @@ echo "<h4 class=\"box-title\"><a class=\"collapsed\" href=\"#collapse".$i."\" data-parent=\"#accordion\" data-toggle=\"collapse\">".$rs[$i]['sezione']."</a></h4>\n"; echo "</div>\n"; -( $i == $html->form('section') ) ? $class="in": $class="";+( $i == $html->form('section') && $html->form('section')!='' ) ? $class="in": $class=""; echo "<div id=\"collapse".$i."\" class=\"panel-collapse collapse ".$class."\">\n"; echo "<div class=\"box-body\">\n";-echo "<form id=\"save_form_settings_$i\" action=\"settings.php?op=updatesettings&amp;section=".$i."\" method=\"post\">\n";+echo "<form id=\"save_form_settings_$i\" action=\"settings.php?op=updatesettings&amp;section=".$i."\" method=\"post\" class=\"col-md-6\" style=\"float:none;\">\n"; } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

1 2 3 .. 9 > >> (Page 1 of 9)

Thread: [osm-devel] SF.net SVN: openstamanager:[920]
	new_trunk/openstamanager (2024)

References

Top Articles
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 5255

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.