From eb4ff7f73c5d4bdf74a3472448b5a195598ff4cd Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 1 Aug 2007 22:26:52 +0000 Subject: [PATCH] event refactor, landing on HEAD! --- ANNOUNCE.1.5 | 54 -- CREDITS | 3 + FS/FS/AccessRight.pm | 331 +++++---- FS/FS/Conf.pm | 58 ++ FS/FS/Cron/bill.pm | 141 ++-- FS/FS/Cron/expire_user_pref.pm | 17 + FS/FS/Record.pm | 11 +- FS/FS/Schema.pm | 113 +++- FS/FS/Setup.pm | 91 +-- FS/FS/access_group.pm | 2 +- FS/FS/access_user.pm | 20 +- FS/FS/access_user_pref.pm | 20 +- FS/FS/agent.pm | 1 + FS/FS/cust_bill.pm | 82 ++- FS/FS/cust_credit.pm | 33 + FS/FS/cust_event.pm | 407 +++++++++++ FS/FS/cust_main.pm | 750 +++++++++++++++++---- FS/FS/cust_pay.pm | 30 + FS/FS/cust_pay_batch.pm | 37 +- FS/FS/cust_pkg.pm | 197 +++++- FS/FS/cust_refund.pm | 33 +- FS/FS/m2name_Common.pm | 106 ++- FS/FS/option_Common.pm | 29 +- FS/FS/part_bill_event.pm | 22 +- FS/FS/part_event.pm | 427 ++++++++++++ FS/FS/part_event/Action.pm | 224 ++++++ FS/FS/part_event/Action/addpost.pm | 24 + FS/FS/part_event/Action/apply.pm | 28 + FS/FS/part_event/Action/bill.pm | 30 + FS/FS/part_event/Action/cancel.pm | 35 + FS/FS/part_event/Action/collect.pm | 30 + FS/FS/part_event/Action/cust_bill_batch.pm | 31 + FS/FS/part_event/Action/cust_bill_comp.pm | 34 + FS/FS/part_event/Action/cust_bill_fee_percent.pm | 40 ++ FS/FS/part_event/Action/cust_bill_realtime_card.pm | 32 + .../part_event/Action/cust_bill_realtime_check.pm | 32 + FS/FS/part_event/Action/cust_bill_realtime_lec.pm | 32 + FS/FS/part_event/Action/cust_bill_send.pm | 27 + FS/FS/part_event/Action/cust_bill_send_agent.pm | 44 ++ .../part_event/Action/cust_bill_send_alternate.pm | 35 + FS/FS/part_event/Action/cust_bill_send_csv_ftp.pm | 56 ++ .../part_event/Action/cust_bill_send_if_newest.pm | 40 ++ FS/FS/part_event/Action/cust_bill_spool_csv.pm | 64 ++ .../Action/cust_bill_suspend_if_balance.pm | 48 ++ FS/FS/part_event/Action/fee.pm | 33 + FS/FS/part_event/Action/suspend.pm | 36 + FS/FS/part_event/Action/suspend_if_pkgpart.pm | 42 ++ FS/FS/part_event/Action/suspend_unless_pkgpart.pm | 42 ++ FS/FS/part_event/Condition.pm | 268 ++++++++ FS/FS/part_event/Condition/agent.pm | 37 + FS/FS/part_event/Condition/agent_type.pm | 40 ++ FS/FS/part_event/Condition/balance.pm | 48 ++ FS/FS/part_event/Condition/balance_age.pm | 83 +++ FS/FS/part_event/Condition/balance_under.pm | 42 ++ FS/FS/part_event/Condition/cust_bill_age.pm | 83 +++ FS/FS/part_event/Condition/cust_bill_owed.pm | 48 ++ FS/FS/part_event/Condition/cust_bill_owed_under.pm | 49 ++ .../Condition/cust_pay_batch_declined.pm | 51 ++ FS/FS/part_event/Condition/cust_status.pm | 32 + FS/FS/part_event/Condition/every.pm | 67 ++ FS/FS/part_event/Condition/once.pm | 48 ++ FS/FS/part_event/Condition/payby.pm | 50 ++ FS/FS/part_event/Condition/pkg_class.pm | 38 ++ FS/FS/part_event/Condition/pkg_status.pm | 37 + FS/FS/part_event_condition.pm | 343 ++++++++++ FS/FS/part_event_condition_option.pm | 151 +++++ FS/FS/part_event_condition_option_option.pm | 129 ++++ FS/FS/part_event_option.pm | 213 ++++++ FS/FS/part_export/textradius.pm | 2 +- FS/FS/part_pkg/flat.pm | 14 +- FS/FS/part_pkg/flat_delayed.pm | 17 + FS/FS/part_pkg/prorate.pm | 2 +- FS/FS/part_pkg/prorate_delayed.pm | 61 ++ FS/FS/part_pkg/subscription.pm | 2 - FS/FS/pay_batch.pm | 52 +- FS/FS/payby.pm | 10 - FS/FS/pkg_referral.pm | 126 ++++ FS/FS/svc_Common.pm | 39 +- FS/FS/svc_acct.pm | 8 +- FS/FS/svc_domain.pm | 4 +- FS/FS/svc_forward.pm | 4 +- FS/FS/svc_www.pm | 4 +- FS/MANIFEST | 15 +- FS/README | 6 - FS/bin/freeside-daily | 13 +- FS/bin/freeside-monthly | 2 +- FS/t/cust_event.t | 5 + FS/t/part_event-Action.t | 5 + FS/t/part_event-Condition.t | 5 + FS/t/part_event.t | 5 + FS/t/part_event_condition.t | 5 + FS/t/part_event_condition_option.t | 5 + FS/t/part_event_condition_option_option.t | 5 + FS/t/part_event_option.t | 5 + FS/t/pkg_referral.t | 5 + bin/freeside-migrate-events | 217 ++++++ eg/part_event-Action-template.pm | 55 ++ eg/part_event-Condition-template.pm | 57 ++ fs_selfservice/DEPLOY | 2 + htetc/handler.pl | 29 +- httemplate/browse/access_group.html | 56 +- httemplate/browse/access_user.html | 81 +-- httemplate/browse/agent.cgi | 39 +- httemplate/browse/invoice_template.html | 124 ++++ httemplate/browse/part_bill_event.cgi | 2 +- httemplate/browse/part_event.html | 157 +++++ httemplate/browse/part_pkg.cgi | 68 +- httemplate/browse/part_referral.html | 163 +++-- httemplate/browse/pkg_class.html | 1 + httemplate/browse/reason.html | 19 +- httemplate/config/config-process.cgi | 3 +- httemplate/config/config-view.cgi | 16 +- httemplate/config/config.cgi | 8 +- httemplate/edit/access_group.html | 122 ++-- httemplate/edit/agent.cgi | 114 ++-- httemplate/edit/cust_main.cgi | 3 +- httemplate/edit/elements/edit.html | 630 ++++++++++++----- httemplate/edit/invoice_logo.html | 136 ++++ httemplate/edit/invoice_template.html | 80 +++ httemplate/edit/part_bill_event.cgi | 18 +- httemplate/edit/part_event.html | 642 ++++++++++++++++++ httemplate/edit/part_pkg.cgi | 7 +- httemplate/edit/part_referral.html | 9 +- httemplate/edit/process/access_group.html | 1 + httemplate/edit/process/elements/process.html | 312 ++++++--- httemplate/edit/process/invoice_logo.html | 26 + httemplate/edit/process/invoice_template.html | 15 + httemplate/edit/process/part_event.html | 86 +++ httemplate/edit/process/quick-cust_pkg.cgi | 26 +- httemplate/edit/reason.html | 4 +- httemplate/elements/checkboxes-table-name.html | 144 ++-- .../editor/css/behaviors/disablehandles.htc | 15 + .../editor/css/behaviors/showtableborders.htc | 36 + .../fckeditor/editor/css/fck_editorarea.css | 91 +++ .../elements/fckeditor/editor/css/fck_internal.css | 111 +++ .../editor/css/fck_showtableborders_gecko.css | 42 ++ .../fckeditor/editor/css/images/fck_anchor.gif | Bin 0 -> 184 bytes .../fckeditor/editor/css/images/fck_flashlogo.gif | Bin 0 -> 599 bytes .../editor/css/images/fck_hiddenfield.gif | Bin 0 -> 105 bytes .../fckeditor/editor/css/images/fck_pagebreak.gif | Bin 0 -> 54 bytes .../editor/dialog/common/fck_dialog_common.css | 83 +++ .../editor/dialog/common/fck_dialog_common.js | 154 +++++ .../editor/dialog/common/fcknumericfield.htc | 24 + .../editor/dialog/common/images/locked.gif | Bin 0 -> 74 bytes .../editor/dialog/common/images/reset.gif | Bin 0 -> 104 bytes .../editor/dialog/common/images/unlocked.gif | Bin 0 -> 75 bytes .../editor/dialog/common/moz-bindings.xml | 30 + .../fckeditor/editor/dialog/fck_about.html | 155 +++++ .../editor/dialog/fck_about/logo_fckeditor.gif | Bin 0 -> 2044 bytes .../editor/dialog/fck_about/logo_fredck.gif | Bin 0 -> 920 bytes .../fckeditor/editor/dialog/fck_anchor.html | 236 +++++++ .../fckeditor/editor/dialog/fck_button.html | 107 +++ .../fckeditor/editor/dialog/fck_checkbox.html | 107 +++ .../fckeditor/editor/dialog/fck_colorselector.html | 171 +++++ .../fckeditor/editor/dialog/fck_docprops.html | 600 +++++++++++++++++ .../dialog/fck_docprops/fck_document_preview.html | 113 ++++ .../elements/fckeditor/editor/dialog/fck_find.html | 173 +++++ .../fckeditor/editor/dialog/fck_flash.html | 146 ++++ .../fckeditor/editor/dialog/fck_flash/fck_flash.js | 286 ++++++++ .../editor/dialog/fck_flash/fck_flash_preview.html | 46 ++ .../elements/fckeditor/editor/dialog/fck_form.html | 105 +++ .../fckeditor/editor/dialog/fck_hiddenfield.html | 116 ++++ .../fckeditor/editor/dialog/fck_image.html | 252 +++++++ .../fckeditor/editor/dialog/fck_image/fck_image.js | 493 ++++++++++++++ .../editor/dialog/fck_image/fck_image_preview.html | 66 ++ .../elements/fckeditor/editor/dialog/fck_link.html | 293 ++++++++ .../fckeditor/editor/dialog/fck_link/fck_link.js | 698 +++++++++++++++++++ .../fckeditor/editor/dialog/fck_listprop.html | 116 ++++ .../fckeditor/editor/dialog/fck_paste.html | 285 ++++++++ .../fckeditor/editor/dialog/fck_radiobutton.html | 107 +++ .../fckeditor/editor/dialog/fck_replace.html | 156 +++++ .../fckeditor/editor/dialog/fck_select.html | 176 +++++ .../editor/dialog/fck_select/fck_select.js | 194 ++++++ .../fckeditor/editor/dialog/fck_smiley.html | 105 +++ .../fckeditor/editor/dialog/fck_source.html | 65 ++ .../fckeditor/editor/dialog/fck_specialchar.html | 113 ++++ .../fckeditor/editor/dialog/fck_spellerpages.html | 64 ++ .../fck_spellerpages/spellerpages/blank.html | 0 .../fck_spellerpages/spellerpages/controlWindow.js | 87 +++ .../fck_spellerpages/spellerpages/controls.html | 153 +++++ .../spellerpages/server-scripts/spellchecker.pl | 180 +++++ .../fck_spellerpages/spellerpages/spellChecker.js | 462 +++++++++++++ .../spellerpages/spellchecker.html | 71 ++ .../fck_spellerpages/spellerpages/spellerStyle.css | 49 ++ .../fck_spellerpages/spellerpages/wordWindow.js | 272 ++++++++ .../fckeditor/editor/dialog/fck_table.html | 291 ++++++++ .../fckeditor/editor/dialog/fck_tablecell.html | 255 +++++++ .../fckeditor/editor/dialog/fck_template.html | 242 +++++++ .../dialog/fck_template/images/template1.gif | Bin 0 -> 375 bytes .../dialog/fck_template/images/template2.gif | Bin 0 -> 333 bytes .../dialog/fck_template/images/template3.gif | Bin 0 -> 422 bytes .../fckeditor/editor/dialog/fck_textarea.html | 94 +++ .../fckeditor/editor/dialog/fck_textfield.html | 139 ++++ httemplate/elements/fckeditor/editor/fckdebug.html | 153 +++++ .../elements/fckeditor/editor/fckdialog.html | 324 +++++++++ .../elements/fckeditor/editor/fckeditor.html | 227 +++++++ .../fckeditor/editor/fckeditor.original.html | 319 +++++++++ .../editor/filemanager/browser/default/browser.css | 88 +++ .../filemanager/browser/default/browser.html | 154 +++++ .../browser/default/connectors/perl/basexml.pl | 63 ++ .../browser/default/connectors/perl/commands.pl | 158 +++++ .../browser/default/connectors/perl/connector.cgi | 137 ++++ .../browser/default/connectors/perl/io.pl | 131 ++++ .../browser/default/connectors/perl/upload_fck.pl | 667 ++++++++++++++++++ .../browser/default/connectors/perl/util.pl | 60 ++ .../browser/default/frmactualfolder.html | 67 ++ .../browser/default/frmcreatefolder.html | 113 ++++ .../filemanager/browser/default/frmfolders.html | 196 ++++++ .../browser/default/frmresourceslist.html | 160 +++++ .../browser/default/frmresourcetype.html | 65 ++ .../filemanager/browser/default/frmupload.html | 113 ++++ .../browser/default/images/ButtonArrow.gif | Bin 0 -> 138 bytes .../filemanager/browser/default/images/Folder.gif | Bin 0 -> 128 bytes .../browser/default/images/Folder32.gif | Bin 0 -> 281 bytes .../browser/default/images/FolderOpened.gif | Bin 0 -> 132 bytes .../browser/default/images/FolderOpened32.gif | Bin 0 -> 264 bytes .../browser/default/images/FolderUp.gif | Bin 0 -> 132 bytes .../browser/default/images/icons/32/ai.gif | Bin 0 -> 1140 bytes .../browser/default/images/icons/32/avi.gif | Bin 0 -> 454 bytes .../browser/default/images/icons/32/bmp.gif | Bin 0 -> 709 bytes .../browser/default/images/icons/32/cs.gif | Bin 0 -> 224 bytes .../default/images/icons/32/default.icon.gif | Bin 0 -> 177 bytes .../browser/default/images/icons/32/dll.gif | Bin 0 -> 258 bytes .../browser/default/images/icons/32/doc.gif | Bin 0 -> 260 bytes .../browser/default/images/icons/32/exe.gif | Bin 0 -> 170 bytes .../browser/default/images/icons/32/fla.gif | Bin 0 -> 946 bytes .../browser/default/images/icons/32/gif.gif | Bin 0 -> 704 bytes .../browser/default/images/icons/32/htm.gif | Bin 0 -> 1527 bytes .../browser/default/images/icons/32/html.gif | Bin 0 -> 1527 bytes .../browser/default/images/icons/32/jpg.gif | Bin 0 -> 463 bytes .../browser/default/images/icons/32/js.gif | Bin 0 -> 274 bytes .../browser/default/images/icons/32/mdb.gif | Bin 0 -> 274 bytes .../browser/default/images/icons/32/mp3.gif | Bin 0 -> 454 bytes .../browser/default/images/icons/32/pdf.gif | Bin 0 -> 567 bytes .../browser/default/images/icons/32/png.gif | Bin 0 -> 464 bytes .../browser/default/images/icons/32/ppt.gif | Bin 0 -> 254 bytes .../browser/default/images/icons/32/rdp.gif | Bin 0 -> 1493 bytes .../browser/default/images/icons/32/swf.gif | Bin 0 -> 725 bytes .../browser/default/images/icons/32/swt.gif | Bin 0 -> 724 bytes .../browser/default/images/icons/32/txt.gif | Bin 0 -> 213 bytes .../browser/default/images/icons/32/vsd.gif | Bin 0 -> 277 bytes .../browser/default/images/icons/32/xls.gif | Bin 0 -> 271 bytes .../browser/default/images/icons/32/xml.gif | Bin 0 -> 408 bytes .../browser/default/images/icons/32/zip.gif | Bin 0 -> 368 bytes .../browser/default/images/icons/ai.gif | Bin 0 -> 403 bytes .../browser/default/images/icons/avi.gif | Bin 0 -> 249 bytes .../browser/default/images/icons/bmp.gif | Bin 0 -> 126 bytes .../browser/default/images/icons/cs.gif | Bin 0 -> 128 bytes .../browser/default/images/icons/default.icon.gif | Bin 0 -> 113 bytes .../browser/default/images/icons/dll.gif | Bin 0 -> 132 bytes .../browser/default/images/icons/doc.gif | Bin 0 -> 140 bytes .../browser/default/images/icons/exe.gif | Bin 0 -> 109 bytes .../browser/default/images/icons/fla.gif | Bin 0 -> 382 bytes .../browser/default/images/icons/gif.gif | Bin 0 -> 125 bytes .../browser/default/images/icons/htm.gif | Bin 0 -> 621 bytes .../browser/default/images/icons/html.gif | Bin 0 -> 621 bytes .../browser/default/images/icons/jpg.gif | Bin 0 -> 125 bytes .../browser/default/images/icons/js.gif | Bin 0 -> 139 bytes .../browser/default/images/icons/mdb.gif | Bin 0 -> 146 bytes .../browser/default/images/icons/mp3.gif | Bin 0 -> 249 bytes .../browser/default/images/icons/pdf.gif | Bin 0 -> 230 bytes .../browser/default/images/icons/png.gif | Bin 0 -> 125 bytes .../browser/default/images/icons/ppt.gif | Bin 0 -> 139 bytes .../browser/default/images/icons/rdp.gif | Bin 0 -> 606 bytes .../browser/default/images/icons/swf.gif | Bin 0 -> 388 bytes .../browser/default/images/icons/swt.gif | Bin 0 -> 388 bytes .../browser/default/images/icons/txt.gif | Bin 0 -> 122 bytes .../browser/default/images/icons/vsd.gif | Bin 0 -> 136 bytes .../browser/default/images/icons/xls.gif | Bin 0 -> 138 bytes .../browser/default/images/icons/xml.gif | Bin 0 -> 231 bytes .../browser/default/images/icons/zip.gif | Bin 0 -> 235 bytes .../filemanager/browser/default/images/spacer.gif | Bin 0 -> 43 bytes .../filemanager/browser/default/js/common.js | 55 ++ .../filemanager/browser/default/js/fckxml.js | 129 ++++ .../fckeditor/editor/filemanager/upload/test.html | 133 ++++ .../elements/fckeditor/editor/images/anchor.gif | Bin 0 -> 184 bytes .../elements/fckeditor/editor/images/arrow_ltr.gif | Bin 0 -> 49 bytes .../elements/fckeditor/editor/images/arrow_rtl.gif | Bin 0 -> 49 bytes .../editor/images/smiley/msn/angel_smile.gif | Bin 0 -> 445 bytes .../editor/images/smiley/msn/angry_smile.gif | Bin 0 -> 453 bytes .../editor/images/smiley/msn/broken_heart.gif | Bin 0 -> 423 bytes .../fckeditor/editor/images/smiley/msn/cake.gif | Bin 0 -> 453 bytes .../editor/images/smiley/msn/confused_smile.gif | Bin 0 -> 322 bytes .../editor/images/smiley/msn/cry_smile.gif | Bin 0 -> 473 bytes .../editor/images/smiley/msn/devil_smile.gif | Bin 0 -> 444 bytes .../editor/images/smiley/msn/embaressed_smile.gif | Bin 0 -> 1077 bytes .../editor/images/smiley/msn/envelope.gif | Bin 0 -> 1030 bytes .../fckeditor/editor/images/smiley/msn/heart.gif | Bin 0 -> 1012 bytes .../fckeditor/editor/images/smiley/msn/kiss.gif | Bin 0 -> 978 bytes .../editor/images/smiley/msn/lightbulb.gif | Bin 0 -> 303 bytes .../editor/images/smiley/msn/omg_smile.gif | Bin 0 -> 342 bytes .../editor/images/smiley/msn/regular_smile.gif | Bin 0 -> 1036 bytes .../editor/images/smiley/msn/sad_smile.gif | Bin 0 -> 1039 bytes .../editor/images/smiley/msn/shades_smile.gif | Bin 0 -> 1059 bytes .../editor/images/smiley/msn/teeth_smile.gif | Bin 0 -> 1064 bytes .../editor/images/smiley/msn/thumbs_down.gif | Bin 0 -> 992 bytes .../editor/images/smiley/msn/thumbs_up.gif | Bin 0 -> 989 bytes .../editor/images/smiley/msn/tounge_smile.gif | Bin 0 -> 1055 bytes .../smiley/msn/whatchutalkingabout_smile.gif | Bin 0 -> 1034 bytes .../editor/images/smiley/msn/wink_smile.gif | Bin 0 -> 1041 bytes .../elements/fckeditor/editor/images/spacer.gif | Bin 0 -> 43 bytes .../fckeditor/editor/js/fckeditorcode_gecko.js | 98 +++ .../fckeditor/editor/js/fckeditorcode_ie.js | 99 +++ .../fckeditor/editor/lang/_getfontformat.html | 85 +++ .../fckeditor/editor/lang/_translationstatus.txt | 76 +++ httemplate/elements/fckeditor/editor/lang/af.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/ar.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/bg.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/bn.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/bs.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/ca.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/cs.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/da.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/de.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/el.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/en-au.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/en-ca.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/en-uk.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/en.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/eo.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/es.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/et.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/eu.js | 505 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/fa.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/fi.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/fo.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/fr.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/gl.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/he.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/hi.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/hr.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/hu.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/it.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/ja.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/km.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/ko.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/lt.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/lv.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/mn.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/ms.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/nb.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/nl.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/no.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/pl.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/pt-br.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/pt.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/ro.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/ru.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/sk.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/sl.js | 504 ++++++++++++++ .../elements/fckeditor/editor/lang/sr-latn.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/sr.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/sv.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/th.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/tr.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/uk.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/vi.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/zh-cn.js | 504 ++++++++++++++ httemplate/elements/fckeditor/editor/lang/zh.js | 504 ++++++++++++++ .../fckeditor/editor/plugins/autogrow/fckplugin.js | 92 +++ .../plugins/placeholder/fck_placeholder.html | 100 +++ .../editor/plugins/placeholder/fckplugin.js | 187 +++++ .../editor/plugins/placeholder/lang/de.js | 27 + .../editor/plugins/placeholder/lang/en.js | 27 + .../editor/plugins/placeholder/lang/fr.js | 27 + .../editor/plugins/placeholder/lang/it.js | 27 + .../editor/plugins/placeholder/lang/pl.js | 27 + .../editor/plugins/placeholder/placeholder.gif | Bin 0 -> 96 bytes .../editor/plugins/simplecommands/fckplugin.js | 29 + .../editor/plugins/tablecommands/fckplugin.js | 32 + .../fckeditor/editor/skins/_fckviewstrips.html | 121 ++++ .../fckeditor/editor/skins/default/fck_dialog.css | 137 ++++ .../fckeditor/editor/skins/default/fck_editor.css | 464 +++++++++++++ .../fckeditor/editor/skins/default/fck_strip.gif | Bin 0 -> 4578 bytes .../skins/default/images/toolbar.arrowright.gif | Bin 0 -> 53 bytes .../skins/default/images/toolbar.buttonarrow.gif | Bin 0 -> 46 bytes .../skins/default/images/toolbar.collapse.gif | Bin 0 -> 152 bytes .../editor/skins/default/images/toolbar.end.gif | Bin 0 -> 43 bytes .../editor/skins/default/images/toolbar.expand.gif | Bin 0 -> 152 bytes .../skins/default/images/toolbar.separator.gif | Bin 0 -> 58 bytes .../editor/skins/default/images/toolbar.start.gif | Bin 0 -> 105 bytes .../editor/skins/office2003/fck_dialog.css | 138 ++++ .../editor/skins/office2003/fck_editor.css | 476 +++++++++++++ .../editor/skins/office2003/fck_strip.gif | Bin 0 -> 9030 bytes .../skins/office2003/images/toolbar.arrowright.gif | Bin 0 -> 53 bytes .../editor/skins/office2003/images/toolbar.bg.gif | Bin 0 -> 73 bytes .../office2003/images/toolbar.buttonarrow.gif | Bin 0 -> 46 bytes .../skins/office2003/images/toolbar.collapse.gif | Bin 0 -> 152 bytes .../editor/skins/office2003/images/toolbar.end.gif | Bin 0 -> 124 bytes .../skins/office2003/images/toolbar.expand.gif | Bin 0 -> 152 bytes .../skins/office2003/images/toolbar.separator.gif | Bin 0 -> 67 bytes .../skins/office2003/images/toolbar.start.gif | Bin 0 -> 99 bytes .../fckeditor/editor/skins/silver/fck_dialog.css | 141 ++++ .../fckeditor/editor/skins/silver/fck_editor.css | 473 +++++++++++++ .../fckeditor/editor/skins/silver/fck_strip.gif | Bin 0 -> 4578 bytes .../skins/silver/images/toolbar.arrowright.gif | Bin 0 -> 53 bytes .../skins/silver/images/toolbar.buttonarrow.gif | Bin 0 -> 46 bytes .../skins/silver/images/toolbar.buttonbg.gif | Bin 0 -> 829 bytes .../skins/silver/images/toolbar.collapse.gif | Bin 0 -> 152 bytes .../editor/skins/silver/images/toolbar.end.gif | Bin 0 -> 43 bytes .../editor/skins/silver/images/toolbar.expand.gif | Bin 0 -> 152 bytes .../skins/silver/images/toolbar.separator.gif | Bin 0 -> 58 bytes .../editor/skins/silver/images/toolbar.start.gif | Bin 0 -> 105 bytes httemplate/elements/fckeditor/fckconfig.js | 245 +++++++ httemplate/elements/fckeditor/fckeditor.js | 214 ++++++ httemplate/elements/fckeditor/fckpackager.xml | 237 +++++++ httemplate/elements/fckeditor/fckstyles.xml | 53 ++ httemplate/elements/fckeditor/fcktemplates.xml | 103 +++ httemplate/elements/freeside.css | 1 + httemplate/elements/hidden.html | 11 + httemplate/elements/menu.html | 37 +- httemplate/elements/select-agent.html | 16 +- httemplate/elements/select-agent_type.html | 21 + httemplate/elements/select-cust_main-status.html | 30 + httemplate/elements/select-cust_pkg-status.html | 27 +- httemplate/elements/select-part_referral.html | 16 +- httemplate/elements/select-pkg_class.html | 16 +- httemplate/elements/select-table.html | 100 +-- httemplate/elements/selectlayers.html | 201 ++++++ httemplate/elements/table-grid.html | 20 +- httemplate/elements/tr-checkbox-multiple.html | 40 ++ httemplate/elements/tr-checkbox.html | 25 + httemplate/elements/tr-fixed.html | 15 + httemplate/elements/tr-freq.html | 54 ++ httemplate/elements/tr-input-money.html | 13 + httemplate/elements/tr-input-text.html | 31 + httemplate/elements/tr-password.html | 4 + httemplate/elements/tr-select-agent.html | 41 +- httemplate/elements/tr-select-agent_type.html | 39 ++ .../elements/tr-select-cust_main-status.html | 29 + httemplate/elements/tr-select-cust_pkg-status.html | 39 +- .../elements/tr-select-invoice_template.html | 39 ++ httemplate/elements/tr-select-part_pkg.html | 29 + httemplate/elements/tr-select-part_referral.html | 37 +- httemplate/elements/tr-select-pkg_class.html | 23 +- httemplate/elements/tr-select-reason.html | 100 +-- httemplate/elements/tr-select-taxclass.html | 2 +- httemplate/elements/tr-select.html | 61 ++ httemplate/elements/tr-selectlayers.html | 25 + .../elements/tr-selectmultiple-part_pkg.html | 11 +- httemplate/elements/tr-td-label.html | 17 + httemplate/elements/tr-title.html | 15 + httemplate/graph/report_cust_bill_pkg.html | 2 +- httemplate/graph/report_money_time.html | 2 +- httemplate/misc/cancel_cust.html | 75 +++ httemplate/misc/cancel_pkg.html | 9 +- httemplate/misc/cust_main-cancel.cgi | 75 ++- httemplate/misc/cust_main-import.cgi | 3 +- httemplate/misc/email_events.cgi | 4 + httemplate/misc/fax_events.cgi | 4 + httemplate/misc/order_pkg.html | 67 ++ httemplate/misc/print_events.cgi | 4 + httemplate/misc/process/cancel_pkg.html | 66 +- httemplate/pref/pref-process.html | 10 +- httemplate/search/cust_bill.html | 31 +- httemplate/search/cust_bill_event.cgi | 16 +- httemplate/search/cust_bill_event.html | 3 + httemplate/search/cust_event.html | 282 ++++++++ httemplate/search/elements/search.html | 225 ++++--- httemplate/search/report_cust_bill.html | 4 +- httemplate/search/report_cust_credit.html | 4 +- httemplate/search/report_cust_event.html | 65 ++ httemplate/search/report_cust_main-zip.html | 4 +- httemplate/search/report_cust_pay.html | 4 +- httemplate/search/report_cust_pay_batch.html | 4 +- httemplate/search/report_cust_pkg.html | 6 +- httemplate/search/svc_acct.cgi | 4 +- httemplate/search/svc_broadband.cgi | 13 +- httemplate/search/svc_domain.cgi | 4 +- httemplate/search/svc_forward.cgi | 5 +- httemplate/search/svc_phone.cgi | 4 +- httemplate/search/svc_www.cgi | 4 +- httemplate/view/cust_bill-logo.cgi | 3 +- httemplate/view/cust_bill.cgi | 59 +- httemplate/view/cust_main.cgi | 78 ++- httemplate/view/cust_main/order_pkg.html | 41 -- httemplate/view/cust_main/packages.html | 407 ++++++----- httemplate/view/cust_main/payment_history.html | 12 +- httemplate/view/logo.cgi | 47 ++ httemplate/view/svc_Common.html | 12 +- test/cgi-test | 2 - 481 files changed, 53570 insertions(+), 1977 deletions(-) delete mode 100644 ANNOUNCE.1.5 create mode 100644 FS/FS/Cron/expire_user_pref.pm create mode 100644 FS/FS/cust_event.pm create mode 100644 FS/FS/part_event.pm create mode 100644 FS/FS/part_event/Action.pm create mode 100644 FS/FS/part_event/Action/addpost.pm create mode 100644 FS/FS/part_event/Action/apply.pm create mode 100644 FS/FS/part_event/Action/bill.pm create mode 100644 FS/FS/part_event/Action/cancel.pm create mode 100644 FS/FS/part_event/Action/collect.pm create mode 100644 FS/FS/part_event/Action/cust_bill_batch.pm create mode 100644 FS/FS/part_event/Action/cust_bill_comp.pm create mode 100644 FS/FS/part_event/Action/cust_bill_fee_percent.pm create mode 100644 FS/FS/part_event/Action/cust_bill_realtime_card.pm create mode 100644 FS/FS/part_event/Action/cust_bill_realtime_check.pm create mode 100644 FS/FS/part_event/Action/cust_bill_realtime_lec.pm create mode 100644 FS/FS/part_event/Action/cust_bill_send.pm create mode 100644 FS/FS/part_event/Action/cust_bill_send_agent.pm create mode 100644 FS/FS/part_event/Action/cust_bill_send_alternate.pm create mode 100644 FS/FS/part_event/Action/cust_bill_send_csv_ftp.pm create mode 100644 FS/FS/part_event/Action/cust_bill_send_if_newest.pm create mode 100644 FS/FS/part_event/Action/cust_bill_spool_csv.pm create mode 100644 FS/FS/part_event/Action/cust_bill_suspend_if_balance.pm create mode 100644 FS/FS/part_event/Action/fee.pm create mode 100644 FS/FS/part_event/Action/suspend.pm create mode 100644 FS/FS/part_event/Action/suspend_if_pkgpart.pm create mode 100644 FS/FS/part_event/Action/suspend_unless_pkgpart.pm create mode 100644 FS/FS/part_event/Condition.pm create mode 100644 FS/FS/part_event/Condition/agent.pm create mode 100644 FS/FS/part_event/Condition/agent_type.pm create mode 100644 FS/FS/part_event/Condition/balance.pm create mode 100644 FS/FS/part_event/Condition/balance_age.pm create mode 100644 FS/FS/part_event/Condition/balance_under.pm create mode 100644 FS/FS/part_event/Condition/cust_bill_age.pm create mode 100644 FS/FS/part_event/Condition/cust_bill_owed.pm create mode 100644 FS/FS/part_event/Condition/cust_bill_owed_under.pm create mode 100644 FS/FS/part_event/Condition/cust_pay_batch_declined.pm create mode 100644 FS/FS/part_event/Condition/cust_status.pm create mode 100644 FS/FS/part_event/Condition/every.pm create mode 100644 FS/FS/part_event/Condition/once.pm create mode 100644 FS/FS/part_event/Condition/payby.pm create mode 100644 FS/FS/part_event/Condition/pkg_class.pm create mode 100644 FS/FS/part_event/Condition/pkg_status.pm create mode 100644 FS/FS/part_event_condition.pm create mode 100644 FS/FS/part_event_condition_option.pm create mode 100644 FS/FS/part_event_condition_option_option.pm create mode 100644 FS/FS/part_event_option.pm create mode 100644 FS/FS/part_pkg/prorate_delayed.pm create mode 100644 FS/FS/pkg_referral.pm delete mode 100644 FS/README create mode 100644 FS/t/cust_event.t create mode 100644 FS/t/part_event-Action.t create mode 100644 FS/t/part_event-Condition.t create mode 100644 FS/t/part_event.t create mode 100644 FS/t/part_event_condition.t create mode 100644 FS/t/part_event_condition_option.t create mode 100644 FS/t/part_event_condition_option_option.t create mode 100644 FS/t/part_event_option.t create mode 100644 FS/t/pkg_referral.t create mode 100644 bin/freeside-migrate-events create mode 100644 eg/part_event-Action-template.pm create mode 100644 eg/part_event-Condition-template.pm create mode 100644 httemplate/browse/invoice_template.html create mode 100644 httemplate/browse/part_event.html create mode 100644 httemplate/edit/invoice_logo.html create mode 100644 httemplate/edit/invoice_template.html create mode 100644 httemplate/edit/part_event.html create mode 100644 httemplate/edit/process/invoice_logo.html create mode 100644 httemplate/edit/process/invoice_template.html create mode 100644 httemplate/edit/process/part_event.html create mode 100644 httemplate/elements/fckeditor/editor/css/behaviors/disablehandles.htc create mode 100644 httemplate/elements/fckeditor/editor/css/behaviors/showtableborders.htc create mode 100644 httemplate/elements/fckeditor/editor/css/fck_editorarea.css create mode 100644 httemplate/elements/fckeditor/editor/css/fck_internal.css create mode 100644 httemplate/elements/fckeditor/editor/css/fck_showtableborders_gecko.css create mode 100644 httemplate/elements/fckeditor/editor/css/images/fck_anchor.gif create mode 100644 httemplate/elements/fckeditor/editor/css/images/fck_flashlogo.gif create mode 100644 httemplate/elements/fckeditor/editor/css/images/fck_hiddenfield.gif create mode 100644 httemplate/elements/fckeditor/editor/css/images/fck_pagebreak.gif create mode 100644 httemplate/elements/fckeditor/editor/dialog/common/fck_dialog_common.css create mode 100644 httemplate/elements/fckeditor/editor/dialog/common/fck_dialog_common.js create mode 100644 httemplate/elements/fckeditor/editor/dialog/common/fcknumericfield.htc create mode 100644 httemplate/elements/fckeditor/editor/dialog/common/images/locked.gif create mode 100644 httemplate/elements/fckeditor/editor/dialog/common/images/reset.gif create mode 100644 httemplate/elements/fckeditor/editor/dialog/common/images/unlocked.gif create mode 100644 httemplate/elements/fckeditor/editor/dialog/common/moz-bindings.xml create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_about.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_about/logo_fckeditor.gif create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_about/logo_fredck.gif create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_anchor.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_button.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_checkbox.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_colorselector.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_docprops.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_find.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_flash.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_flash/fck_flash.js create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_form.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_hiddenfield.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_image.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_image/fck_image.js create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_image/fck_image_preview.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_link.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_link/fck_link.js create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_listprop.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_paste.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_radiobutton.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_replace.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_select.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_select/fck_select.js create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_smiley.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_source.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_specialchar.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_spellerpages.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_table.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_tablecell.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_template.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_template/images/template1.gif create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_template/images/template2.gif create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_template/images/template3.gif create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_textarea.html create mode 100644 httemplate/elements/fckeditor/editor/dialog/fck_textfield.html create mode 100644 httemplate/elements/fckeditor/editor/fckdebug.html create mode 100644 httemplate/elements/fckeditor/editor/fckdialog.html create mode 100644 httemplate/elements/fckeditor/editor/fckeditor.html create mode 100644 httemplate/elements/fckeditor/editor/fckeditor.original.html create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.css create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.html create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/frmactualfolder.html create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/frmfolders.html create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourceslist.html create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourcetype.html create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/frmupload.html create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/Folder.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/Folder32.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/png.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/html.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/js.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/png.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/images/spacer.gif create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/js/common.js create mode 100644 httemplate/elements/fckeditor/editor/filemanager/browser/default/js/fckxml.js create mode 100644 httemplate/elements/fckeditor/editor/filemanager/upload/test.html create mode 100644 httemplate/elements/fckeditor/editor/images/anchor.gif create mode 100644 httemplate/elements/fckeditor/editor/images/arrow_ltr.gif create mode 100644 httemplate/elements/fckeditor/editor/images/arrow_rtl.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/angel_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/angry_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/broken_heart.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/cake.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/confused_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/cry_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/devil_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/embaressed_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/envelope.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/heart.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/kiss.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/lightbulb.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/omg_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/regular_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/sad_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/shades_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/teeth_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/thumbs_down.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/thumbs_up.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/tounge_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/smiley/msn/wink_smile.gif create mode 100644 httemplate/elements/fckeditor/editor/images/spacer.gif create mode 100644 httemplate/elements/fckeditor/editor/js/fckeditorcode_gecko.js create mode 100644 httemplate/elements/fckeditor/editor/js/fckeditorcode_ie.js create mode 100644 httemplate/elements/fckeditor/editor/lang/_getfontformat.html create mode 100644 httemplate/elements/fckeditor/editor/lang/_translationstatus.txt create mode 100644 httemplate/elements/fckeditor/editor/lang/af.js create mode 100644 httemplate/elements/fckeditor/editor/lang/ar.js create mode 100644 httemplate/elements/fckeditor/editor/lang/bg.js create mode 100644 httemplate/elements/fckeditor/editor/lang/bn.js create mode 100644 httemplate/elements/fckeditor/editor/lang/bs.js create mode 100644 httemplate/elements/fckeditor/editor/lang/ca.js create mode 100644 httemplate/elements/fckeditor/editor/lang/cs.js create mode 100644 httemplate/elements/fckeditor/editor/lang/da.js create mode 100644 httemplate/elements/fckeditor/editor/lang/de.js create mode 100644 httemplate/elements/fckeditor/editor/lang/el.js create mode 100644 httemplate/elements/fckeditor/editor/lang/en-au.js create mode 100644 httemplate/elements/fckeditor/editor/lang/en-ca.js create mode 100644 httemplate/elements/fckeditor/editor/lang/en-uk.js create mode 100644 httemplate/elements/fckeditor/editor/lang/en.js create mode 100644 httemplate/elements/fckeditor/editor/lang/eo.js create mode 100644 httemplate/elements/fckeditor/editor/lang/es.js create mode 100644 httemplate/elements/fckeditor/editor/lang/et.js create mode 100644 httemplate/elements/fckeditor/editor/lang/eu.js create mode 100644 httemplate/elements/fckeditor/editor/lang/fa.js create mode 100644 httemplate/elements/fckeditor/editor/lang/fi.js create mode 100644 httemplate/elements/fckeditor/editor/lang/fo.js create mode 100644 httemplate/elements/fckeditor/editor/lang/fr.js create mode 100644 httemplate/elements/fckeditor/editor/lang/gl.js create mode 100644 httemplate/elements/fckeditor/editor/lang/he.js create mode 100644 httemplate/elements/fckeditor/editor/lang/hi.js create mode 100644 httemplate/elements/fckeditor/editor/lang/hr.js create mode 100644 httemplate/elements/fckeditor/editor/lang/hu.js create mode 100644 httemplate/elements/fckeditor/editor/lang/it.js create mode 100644 httemplate/elements/fckeditor/editor/lang/ja.js create mode 100644 httemplate/elements/fckeditor/editor/lang/km.js create mode 100644 httemplate/elements/fckeditor/editor/lang/ko.js create mode 100644 httemplate/elements/fckeditor/editor/lang/lt.js create mode 100644 httemplate/elements/fckeditor/editor/lang/lv.js create mode 100644 httemplate/elements/fckeditor/editor/lang/mn.js create mode 100644 httemplate/elements/fckeditor/editor/lang/ms.js create mode 100644 httemplate/elements/fckeditor/editor/lang/nb.js create mode 100644 httemplate/elements/fckeditor/editor/lang/nl.js create mode 100644 httemplate/elements/fckeditor/editor/lang/no.js create mode 100644 httemplate/elements/fckeditor/editor/lang/pl.js create mode 100644 httemplate/elements/fckeditor/editor/lang/pt-br.js create mode 100644 httemplate/elements/fckeditor/editor/lang/pt.js create mode 100644 httemplate/elements/fckeditor/editor/lang/ro.js create mode 100644 httemplate/elements/fckeditor/editor/lang/ru.js create mode 100644 httemplate/elements/fckeditor/editor/lang/sk.js create mode 100644 httemplate/elements/fckeditor/editor/lang/sl.js create mode 100644 httemplate/elements/fckeditor/editor/lang/sr-latn.js create mode 100644 httemplate/elements/fckeditor/editor/lang/sr.js create mode 100644 httemplate/elements/fckeditor/editor/lang/sv.js create mode 100644 httemplate/elements/fckeditor/editor/lang/th.js create mode 100644 httemplate/elements/fckeditor/editor/lang/tr.js create mode 100644 httemplate/elements/fckeditor/editor/lang/uk.js create mode 100644 httemplate/elements/fckeditor/editor/lang/vi.js create mode 100644 httemplate/elements/fckeditor/editor/lang/zh-cn.js create mode 100644 httemplate/elements/fckeditor/editor/lang/zh.js create mode 100644 httemplate/elements/fckeditor/editor/plugins/autogrow/fckplugin.js create mode 100644 httemplate/elements/fckeditor/editor/plugins/placeholder/fck_placeholder.html create mode 100644 httemplate/elements/fckeditor/editor/plugins/placeholder/fckplugin.js create mode 100644 httemplate/elements/fckeditor/editor/plugins/placeholder/lang/de.js create mode 100644 httemplate/elements/fckeditor/editor/plugins/placeholder/lang/en.js create mode 100644 httemplate/elements/fckeditor/editor/plugins/placeholder/lang/fr.js create mode 100644 httemplate/elements/fckeditor/editor/plugins/placeholder/lang/it.js create mode 100644 httemplate/elements/fckeditor/editor/plugins/placeholder/lang/pl.js create mode 100644 httemplate/elements/fckeditor/editor/plugins/placeholder/placeholder.gif create mode 100644 httemplate/elements/fckeditor/editor/plugins/simplecommands/fckplugin.js create mode 100644 httemplate/elements/fckeditor/editor/plugins/tablecommands/fckplugin.js create mode 100644 httemplate/elements/fckeditor/editor/skins/_fckviewstrips.html create mode 100644 httemplate/elements/fckeditor/editor/skins/default/fck_dialog.css create mode 100644 httemplate/elements/fckeditor/editor/skins/default/fck_editor.css create mode 100644 httemplate/elements/fckeditor/editor/skins/default/fck_strip.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/default/images/toolbar.arrowright.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/default/images/toolbar.buttonarrow.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/default/images/toolbar.collapse.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/default/images/toolbar.end.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/default/images/toolbar.expand.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/default/images/toolbar.separator.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/default/images/toolbar.start.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/fck_dialog.css create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/fck_editor.css create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/fck_strip.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/images/toolbar.arrowright.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/images/toolbar.bg.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/images/toolbar.buttonarrow.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/images/toolbar.collapse.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/images/toolbar.end.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/images/toolbar.expand.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/images/toolbar.separator.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/office2003/images/toolbar.start.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/fck_dialog.css create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/fck_editor.css create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/fck_strip.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/images/toolbar.arrowright.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/images/toolbar.buttonarrow.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/images/toolbar.buttonbg.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/images/toolbar.collapse.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/images/toolbar.end.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/images/toolbar.expand.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/images/toolbar.separator.gif create mode 100644 httemplate/elements/fckeditor/editor/skins/silver/images/toolbar.start.gif create mode 100644 httemplate/elements/fckeditor/fckconfig.js create mode 100644 httemplate/elements/fckeditor/fckeditor.js create mode 100644 httemplate/elements/fckeditor/fckpackager.xml create mode 100644 httemplate/elements/fckeditor/fckstyles.xml create mode 100644 httemplate/elements/fckeditor/fcktemplates.xml create mode 100644 httemplate/elements/hidden.html create mode 100644 httemplate/elements/select-agent_type.html create mode 100644 httemplate/elements/select-cust_main-status.html create mode 100644 httemplate/elements/selectlayers.html create mode 100644 httemplate/elements/tr-checkbox-multiple.html create mode 100644 httemplate/elements/tr-checkbox.html create mode 100644 httemplate/elements/tr-fixed.html create mode 100644 httemplate/elements/tr-freq.html create mode 100644 httemplate/elements/tr-input-money.html create mode 100644 httemplate/elements/tr-input-text.html create mode 100644 httemplate/elements/tr-password.html create mode 100644 httemplate/elements/tr-select-agent_type.html create mode 100644 httemplate/elements/tr-select-cust_main-status.html create mode 100644 httemplate/elements/tr-select-invoice_template.html create mode 100644 httemplate/elements/tr-select-part_pkg.html create mode 100644 httemplate/elements/tr-select.html create mode 100644 httemplate/elements/tr-selectlayers.html create mode 100644 httemplate/elements/tr-td-label.html create mode 100644 httemplate/elements/tr-title.html create mode 100644 httemplate/misc/cancel_cust.html create mode 100644 httemplate/misc/email_events.cgi create mode 100644 httemplate/misc/fax_events.cgi create mode 100644 httemplate/misc/order_pkg.html create mode 100644 httemplate/misc/print_events.cgi create mode 100644 httemplate/search/cust_event.html create mode 100644 httemplate/search/report_cust_event.html delete mode 100644 httemplate/view/cust_main/order_pkg.html create mode 100644 httemplate/view/logo.cgi diff --git a/ANNOUNCE.1.5 b/ANNOUNCE.1.5 deleted file mode 100644 index 36c78e102..000000000 --- a/ANNOUNCE.1.5 +++ /dev/null @@ -1,54 +0,0 @@ -- broadband (dsl/wireless) tracking, etc etc -- Extended description on invoice for time/data charges -- Multiple, named taxes -- */*FIX -- extended reported and graphing -- integrated RT ticketing system -- one-time payments (in signup server too). DCRD and DCHK on-demand payment types -- credit report -- reseller interface - -1.5.0pre6: -- RADIUS session viewing -- Major updates for reseller interface -- Credit card and ACH refunds (w/supported processor module) -- Proper email payment receipts (not invoice copies) -- modular price plans, rewrote package add/edit page -- fixed up tax report - should be correct for edge cases with named taxes, - tax classes, etc. -- Documentation updates - -1.5.7: -- version numbering change, now even/odd like Perl or Linux -- fix bug that could cause mis-billing on upgrades! (new installs ok) -- updated install documentation -- historical late notice viewing in web interface -- VoIP billing for CDRs from RADIUS -- promotional codes for signup -- lots of RT integration, integrated RT upgraded to 3.2.2, preliminary RT - add-on docs -- one-time referral credits -- invoices now use history records (don't lose details) -- option to credit for remaining service upon package cancel/change - (peter bowen) -- one-time registration codes -- "selfservice_server-session_module" config value can be set to - "Cache::FileCache" on FreeBSD or elsewhere IPC::ShareLite has trouble. -- package changes don't re-charge setup fee -- per-agent payment and credit reports -- CSV and Excel export of most reports, others to be migrated to new report template -- prepaid card support updated: now includes a web generator, agent-specific - prepaid cards, and creates *payments*, not credits -- preliminary setup for Slony-1 PostgreSQL replication -- reformatted latex invoice templates w/Text::Template (khoff) and removed - some useless fields (quantity/unit price) -- simplified upgrade instructions -- add export to vpopmail SQL -- html invoices -- big self-service updates (recharge w/prepaid card, change info, more) -- significant freeside-daily speedup - -notyet (1.5.8?): -- account merging UI in exports (for example, to consolidate passwd files from - multiple servers) - diff --git a/CREDITS b/CREDITS index b3ae26512..768a27c44 100644 --- a/CREDITS +++ b/CREDITS @@ -171,5 +171,8 @@ by Erik Arvidsson, licensed under the terms of the GNU GPL. Contains public domain artwork from openclipart.org by mimooh and other authors. +Contains FCKeditor by Frederico Caldeira Knabben, licensed under the terms of +the GNU GPL. + Everything else is my (Ivan Kohler ) fault. diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm index de3423a49..fb7e538c2 100644 --- a/FS/FS/AccessRight.pm +++ b/FS/FS/AccessRight.pm @@ -12,6 +12,14 @@ FS::AccessRight - Access control rights. use FS::AccessRight; + my @rights = FS::AccessRight->rights; + + #my %rights = FS::AccessRight->rights_categorized; + tie my %rights, 'Tie::IxHash', FS::AccessRight->rights_categorized; + foreach my $category ( keys %rights ) { + my @category_rights = @{ $rights{$category} }; + } + =head1 DESCRIPTION Access control rights - Permission to perform specific actions that can be @@ -75,131 +83,202 @@ assigned to users and/or groups. # ##turn it into a more hash-like structure, but ordered via IxHash -#well, this is what we have for now. could be ordered better, could be lots of -# things better, but this ACL system does 99% of what folks need and the UI -# isn't *that* bad -# -# okay, well it *really* needs some catgorization in the UI. badly. -@rights = ( - -## -# basic customer rights -## - 'New customer', - 'View customer', - #'View Customer | View tickets', - 'Edit customer', - 'Cancel customer', - 'Complimentary customer', #aka users-allow_comp - 'Delete customer', #aka. deletecustomers #Enable customer deletions. Be very careful! Deleting a customer will remove all traces that this customer ever existed! It should probably only be used when auditing a legacy database. Normally, you cancel all of a customers' packages if they cancel service. - 'Add customer note', #NEW - 'Edit customer note', #NEW - -### -# customer package rights -### - 'View customer packages', #NEW - 'Order customer package', - 'One-time charge', - 'Change customer package', - 'Bulk change customer packages', - 'Edit customer package dates', - 'Customize customer package', - 'Suspend customer package', - 'Suspend customer package later', - 'Unsuspend customer package', - 'Cancel customer package immediately', - 'Cancel customer package later', - 'Add on-the-fly cancel reason', #NEW - 'Add on-the-fly suspend reason', #NEW - -### -# customer service rights -### - 'Edit usage', #NEW - 'Edit home dir', #NEW - 'Edit www config', #NEW - 'View customer services', #NEW - 'Provision customer service', - 'Recharge customer service', #NEW - 'Unprovision customer service', - - 'View/link unlinked services', #not agent-virtualizable without more work - -### -# customer invoice/financial info rights -### - 'View invoices', - 'View customer tax exemptions', #yow - 'View customer batched payments', #NEW - -### -# customer payment rights -### - 'Post payment', - 'Post payment batch', - 'Unapply payment', #aka. unapplypayments Enable "unapplication" of unclosed payments. - 'Process payment', - 'Refund payment', - - 'Delete payment', #aka. deletepayments - Enable deletion of unclosed payments. Be very careful! Only delete payments that were data-entry errors, not adjustments. Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted. - - 'Delete refund', #NEW - -### -# customer credit rights -### - 'Post credit', - #'Apply credit', - 'Unapply credit', #aka unapplycredits Enable "unapplication" of unclosed credits. - 'Delete credit', #aka. deletecredits Enable deletion of unclosed credits. Be very careful! Only delete credits that were data-entry errors, not adjustments. Optionally specify one or more comma-separated email addresses to be notified when a credit is deleted. - -### -# customer voiding rights.. -### - 'Credit card void', #aka. cc-void #Enable local-only voiding of echeck payments in addition to refunds against the payment gateway - 'Echeck void', #aka. echeck-void #Enable local-only voiding of echeck payments in addition to refunds against the payment gateway - 'Regular void', - 'Unvoid', #aka. unvoid #Enable unvoiding of voided payments - -### -# report/listing rights... -### - 'List customers', - 'List zip codes', #NEW - 'List invoices', - 'List packages', - 'List services', - - 'List rating data', # 'Usage reports', - 'Billing event reports', - 'Financial reports', - -### -# misc rights -### - 'Job queue', # these are not currently agent-virtualized - 'Process batches', # NEW - 'Reprocess batches', # NEW - 'Import', # - 'Export', # - -### -# misc misc rights -### - 'Raw SQL', #NEW - -### -# setup/config rights -### - 'Edit advertising sources', - 'Edit global advertising sources', - - 'Configuration', #most of the rest of the configuraiton is not - # agent-virtualized -); - -sub rights { - @rights; +#well, this is what we have for now. getting better. +tie my %rights, 'Tie::IxHash', + + ### + # basic customer rights + ### + 'Customer rights' => [ + 'New customer', + 'View customer', + #'View Customer | View tickets', + 'Edit customer', + 'Cancel customer', + 'Complimentary customer', #aka users-allow_comp + { rightname=>'Delete customer', desc=>"Enable customer deletions. Be very careful! Deleting a customer will remove all traces that this customer ever existed! It should probably only be used when auditing a legacy database. Normally, you cancel all of a customer's packages if they cancel service." }, #aka. deletecustomers + 'Add customer note', #NEW + 'Edit customer note', #NEW + ], + + ### + # customer package rights + ### + 'Customer package rights' => [ + 'View customer packages', #NEW + 'Order customer package', + 'One-time charge', + 'Change customer package', + 'Bulk change customer packages', + 'Edit customer package dates', + 'Customize customer package', + 'Suspend customer package', + 'Suspend customer package later', + 'Unsuspend customer package', + 'Cancel customer package immediately', + 'Cancel customer package later', + 'Add on-the-fly cancel reason', #NEW + 'Add on-the-fly suspend reason', #NEW + ], + + ### + # customer service rights + ### + 'Customer service rights' => [ + 'Edit usage', #NEW + 'Edit home dir', #NEW + 'Edit www config', #NEW + 'View customer services', #NEW + 'Provision customer service', + 'Recharge customer service', #NEW + 'Unprovision customer service', + + { rightname=>'View/link unlinked services', global=>1 }, #not agent-virtualizable without more work + ], + + ### + # customer invoice/financial info rights + ### + 'Customer invoice / financial info rights' => [ + 'View invoices', + 'View customer tax exemptions', #yow + 'View customer batched payments', #NEW + 'View customer billing events', #NEW + ], + + ### + # customer payment rights + ### + 'Customer payment rights' => [ + 'Post payment', + 'Post payment batch', + { rightname=>'Unapply payment', desc=>'Enable "unapplication" of unclosed payments from specific invoices.' }, #aka. unapplypayments + 'Process payment', + 'Refund payment', + + { rightname=>'Delete payment', desc=>'Enable deletion of unclosed payments. Be very careful! Only delete payments that were data-entry errors, not adjustments.' }, #aka. deletepayments Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted. + + ], + + ### + # customer credit rights + ### + 'Customer credit and refund rights' => [ + 'Post credit', + #'Apply credit', + { rightname=>'Unapply credit', desc=>'Enable "unapplication" of unclosed credits.' }, #aka unapplycredits + { rightname=>'Delete credit', desc=>'Enable deletion of unclosed credits. Be very careful! Only delete credits that were data-entry errors, not adjustments.' }, #aka. deletecredits Optionally specify one or more comma-separated email addresses to be notified when a credit is deleted. + 'Delete refund', #NEW + ], + + ### + # customer voiding rights.. + ### + 'Customer void rights' => [ + { rightname=>'Credit card void', desc=>'Enable local-only voiding of echeck payments in addition to refunds against the payment gateway.' }, #aka. cc-void + { rightname=>'Echeck void', desc=>'Enable local-only voiding of echeck payments in addition to refunds against the payment gateway.' }, #aka. echeck-void + 'Regular void', + { rightname=>'Unvoid', desc=>'Enable unvoiding of voided payments' }, #aka. unvoid + + + ], + + ### + # report/listing rights... + ### + 'Reprting/listing rights' => [ + 'List customers', + 'List zip codes', #NEW + 'List invoices', + 'List packages', + 'List services', + + { rightname=> 'List rating data', desc=>'Usage reports', global=>1 }, + 'Billing event reports', + 'Financial reports', + ], + + ### + # misc rights + ### + 'Miscellaneous rights' => [ + { rightname=>'Job queue', global=>1 }, + { rightname=>'Process batches', global=>1 }, + { rightname=>'Reprocess batches', global=>1 }, + { rightname=>'Import', global=>1 }, #some of these are ag-virt'ed now? give em their own ACLs + { rightname=>'Export', global=>1 }, + #], + # + ### + # misc misc rights + ### + #'Database access rights' => [ + { rightname=>'Raw SQL', global=>1 }, #NEW + ], + + ### + # setup/config rights + ### + 'Configuration rights' => [ + 'Edit advertising sources', + { rightname=>'Edit global advertising sources', global=>1 }, + + 'Edit billing events', + { rightname=>'Edit global billing events', global=>1 }, + + { rightname=>'Configuration', global=>1 }, #most of the rest of the configuraiton is not agent-virtualized + ], + +; + +=head1 CLASS METHODS + +=over 4 + +=item rights + +Returns a list of right names. + +=cut + + sub rights { + #my $class = shift; + map { ref($_) ? $_->{'rightname'} : $_ } map @{ $rights{$_} }, keys %rights; + } + +=item rights_info + +Returns a list of key-value pairs suitable for assigning to a hash. Keys are +category names and values are list references of rights. Each element of the +list reference scalar right name or a hashref with the following keys: + +=over 4 + +=item rightname - Right name + +=item desc - Extended right description + +=item global - Global flag, indicates that this access right provides access to global data which is shared among all agents. + +=back + +=cut + +sub rights_info { + %rights; } +=back + +=head1 BUGS + +Damn those infernal six-legged creatures! + +=head1 SEE ALSO + +L, L, L + +=cut + +1; + diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index f797f275c..7f64058b8 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -171,6 +171,30 @@ sub config_orbase { } } +=item invoice_templatenames + +Returns all possible invoice template names. + +=cut + +sub invoice_templatenames { + my( $self ) = @_; + + my %templatenames = (); + foreach my $item ( $self->config_items ) { + foreach my $base ( @base_items ) { + my( $main, $ext) = split(/\./, $base); + $ext = ".$ext" if $ext; + if ( $item->key =~ /^${main}_(.+)$ext$/ ) { + $templatenames{$1}++; + } + } + } + + sort keys %templatenames; + +} + =item touch KEY [ AGENT ]; Creates the specified configuration key if it does not exist. @@ -498,6 +522,21 @@ httemplate/docs/config.html logo.eps ); +@base_items = qw ( + invoice_template + invoice_latex + invoice_latexreturnaddress + invoice_latexfooter + invoice_latexsmallfooter + invoice_latexnotes + invoice_html + invoice_htmlreturnaddress + invoice_htmlfooter + invoice_htmlnotes + logo.png + logo.eps + ); + @config_items = map { new FS::ConfItem $_ } ( { @@ -1912,6 +1951,25 @@ httemplate/docs/config.html }, { + 'key' => 'disable-fuzzy', + 'section' => 'UI', + 'description' => 'Disable fuzzy searching. Speeds up searching for large sites, but only shows exact matches.', + 'type' => 'checkbox', + }, + + { 'key' => 'pkg_referral', + 'section' => '', + 'description' => 'Enable package-specific advertising sources.', + 'type' => 'checkbox', + }, + + { 'key' => 'pkg_referral-multiple', + 'section' => '', + 'description' => 'In addition, allow multiple advertising sources to be associated with a single package.', + 'type' => 'checkbox', + }, + + { 'key' => 'dashboard-toplist', 'section' => 'UI', 'description' => 'List of items to display on the top of the front page', diff --git a/FS/FS/Cron/bill.pm b/FS/FS/Cron/bill.pm index 3ba1b53d4..1576edcb4 100644 --- a/FS/FS/Cron/bill.pm +++ b/FS/FS/Cron/bill.pm @@ -6,6 +6,8 @@ use Exporter; use Date::Parse; use FS::Record qw(qsearch qsearchs); use FS::cust_main; +use FS::part_event; +use FS::part_event_condition; @ISA = qw( Exporter ); @EXPORT_OK = qw ( bill ); @@ -14,7 +16,11 @@ sub bill { my %opt = @_; + my $check_freq = $opt{'check_freq'} || '1d'; + $FS::cust_main::DEBUG = 1 if $opt{'v'}; + $FS::cust_main::DEBUG = $opt{'l'} if $opt{'l'}; + #$FS::cust_event::DEBUG = $opt{'l'} if $opt{'l'}; my %search = (); $search{'payby'} = $opt{'p'} if $opt{'p'}; @@ -38,91 +44,76 @@ sub bill { ) ) END - - # or - my $where_bill_event = <<"END"; - 0 < ( select count(*) from cust_bill - where cust_main.custnum = cust_bill.custnum - and 0 < charged - - coalesce( - ( select sum(amount) from cust_bill_pay - where cust_bill.invnum = cust_bill_pay.invnum ) - ,0 - ) - - coalesce( - ( select sum(amount) from cust_credit_bill - where cust_bill.invnum = cust_credit_bill.invnum ) - ,0 - ) - and 0 < ( select count(*) from part_bill_event - where payby = cust_main.payby - and ( disabled is null or disabled = '' ) - and seconds <= $time - cust_bill._date - and 0 = ( select count(*) from cust_bill_event - where cust_bill.invnum = cust_bill_event.invnum - and part_bill_event.eventpart = cust_bill_event.eventpart - and status = 'done' - ) - - ) - ) -END - - my $extra_sql = ( scalar(%search) ? ' AND ' : ' WHERE ' ). "( $where_pkg OR $where_bill_event )"; - + + my $where_event = join(' OR ', map { + my $eventtable = $_; + + my $join = FS::part_event_condition->join_conditions_sql( $eventtable ); + my $where = FS::part_event_condition->where_conditions_sql( $eventtable, + 'time'=>$time, + ); + + my $are_part_event = + "0 < ( SELECT COUNT(*) FROM part_event $join + WHERE check_freq = '$check_freq' + AND eventtable = '$eventtable' + AND ( disabled = '' OR disabled IS NULL ) + AND $where + ) + "; + + if ( $eventtable eq 'cust_main' ) { + $are_part_event; + } else { + "0 < ( SELECT COUNT(*) FROM $eventtable + WHERE cust_main.custnum = $eventtable.custnum + AND $are_part_event + ) + "; + } + + } FS::part_event->eventtables); + + my $extra_sql = ( scalar(%search) ? ' AND ' : ' WHERE ' ). + "( $where_pkg OR $where_event )"; + my @cust_main; if ( @ARGV ) { @cust_main = map { qsearchs('cust_main', { custnum => $_, %search } ) } @ARGV } else { - @cust_main = qsearch('cust_main', \%search, '', $extra_sql ); + + warn "searching for customers:\n". + join("\n", map " $_ => ".$search{$_}, keys %search). "\n". + " $extra_sql\n" + if $opt{'v'} || $opt{'l'}; + + @cust_main = qsearch({ + 'table' => 'cust_main', + 'hashref' => \%search, + 'extra_sql' => $extra_sql, + }); + } - ; my($cust_main,%saw); foreach $cust_main ( @cust_main ) { - my $custnum = $cust_main->custnum; - - # $^T not $time because -d is for pre-printing invoices - foreach my $cust_pkg ( - grep { $_->expire && $_->expire <= $^T } $cust_main->ncancelled_pkgs - ) { - my $error = $cust_pkg->cancel; - warn "Error cancelling expired pkg ". $cust_pkg->pkgnum. - " for custnum $custnum: $error" - if $error; - } - # $^T not $time because -d is for pre-printing invoices - foreach my $cust_pkg ( - grep { ( $_->part_pkg->is_prepaid && $_->bill && $_->bill < $^T - || $_->adjourn && $_->adjourn <= $^T - ) - && ! $_->susp - } - $cust_main->ncancelled_pkgs - ) { - my $action = $cust_pkg->part_pkg->option('recur_action') || 'suspend'; - my $error = $cust_pkg->$action(); - warn "Error suspending package ". $cust_pkg->pkgnum. - " for custnum $custnum: $error" - if $error; + if ( $opt{'m'} ) { + + die "XXX multi-process mode not yet completed"; + #add job to queue that calls bill_and_collect with options + + } else { + + $cust_main->bill_and_collect( + 'time' => $time, + 'invoice_time' => $invoice_time, + 'check_freq' => $check_freq, + 'resetup' => $opt{'s'}, + ); + } - - my $error = $cust_main->bill( 'time' => $time, - 'invoice_time' => $invoice_time, - 'resetup' => $opt{'s'}, - ); - warn "Error billing, custnum $custnum: $error" if $error; - - $error = $cust_main->apply_payments_and_credits; - warn "Error applying payments and credits, custnum $custnum: $error" - if $error; - - $error = $cust_main->collect( 'invoice_time' => $time, - 'freq' => $opt{'freq'}, - ); - warn "Error collecting, custnum $custnum: $error" if $error; - + } } diff --git a/FS/FS/Cron/expire_user_pref.pm b/FS/FS/Cron/expire_user_pref.pm new file mode 100644 index 000000000..7ab73d280 --- /dev/null +++ b/FS/FS/Cron/expire_user_pref.pm @@ -0,0 +1,17 @@ +package FS::Cron::expire_user_pref; + +use vars qw( @ISA @EXPORT_OK); +use Exporter; +use FS::UID qw(dbh); + +@ISA = qw( Exporter ); +@EXPORT_OK = qw( expire_user_pref ); + +sub expire_user_pref { + my $sql = "DELETE FROM access_user_pref WHERE expiration IS NOT NULL". + " AND expiration < ?"; + my $sth = dbh->prepare($sql) or die dbh->errstr; + $sth->execute(time) or die $sth->errstr; +} + +1; diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index d14762cee..f8711d021 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -213,6 +213,7 @@ The preferred usage is to pass a hash reference of named parameters: #these are optional... 'select' => '*', 'extra_sql' => 'AND field ', + 'order_by' => 'ORDER BY something', #'cache_obj' => '', #optional 'addl_from' => 'LEFT JOIN othtable USING ( field )', } @@ -235,13 +236,14 @@ fine in the common case where there are only two parameters: =cut sub qsearch { - my($stable, $record, $select, $extra_sql, $cache, $addl_from ); + my($stable, $record, $select, $extra_sql, $order_by, $cache, $addl_from ); if ( ref($_[0]) ) { #hashref for now, eventually maybe accept a list too my $opt = shift; $stable = $opt->{'table'} or die "table name is required"; $record = $opt->{'hashref'} || {}; $select = $opt->{'select'} || '*'; $extra_sql = $opt->{'extra_sql'} || ''; + $order_by = $opt->{'order_by'} || ''; $cache = $opt->{'cache_obj'} || ''; $addl_from = $opt->{'addl_from'} || ''; } else { @@ -362,6 +364,7 @@ sub qsearch { } $statement .= " $extra_sql" if defined($extra_sql); + $statement .= " $order_by" if defined($order_by); warn "[debug]$me $statement\n" if $DEBUG > 1; my $sth = $dbh->prepare($statement) @@ -2143,7 +2146,7 @@ sub loadRSA { $rsa_module = 'Crypt::OpenSSL::RSA'; # The Default my $conf = new FS::Conf; - if ($conf->exists('encryptionmodule') && $conf->config('encryptionmodule') ne '') { + if ($conf->exists('encryptionmodule') && $conf->config_binary('encryptionmodule') ne '') { $rsa_module = $conf->config('encryptionmodule'); } @@ -2152,13 +2155,13 @@ sub loadRSA { $rsa_loaded++; } # Initialize Encryption - if ($conf->exists('encryptionpublickey') && $conf->config('encryptionpublickey') ne '') { + if ($conf->exists('encryptionpublickey') && $conf->config_binary('encryptionpublickey') ne '') { my $public_key = join("\n",$conf->config('encryptionpublickey')); $rsa_encrypt = $rsa_module->new_public_key($public_key); } # Intitalize Decryption - if ($conf->exists('encryptionprivatekey') && $conf->config('encryptionprivatekey') ne '') { + if ($conf->exists('encryptionprivatekey') && $conf->config_binary('encryptionprivatekey') ne '') { my $private_key = join("\n",$conf->config('encryptionprivatekey')); $rsa_decrypt = $rsa_module->new_private_key($private_key); } diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index cddc520e6..bcfe907a5 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -265,15 +265,17 @@ sub tables_hashref { 'agent' => { 'columns' => [ - 'agentnum', 'serial', '', '', '', '', - 'agent', 'varchar', '', $char_d, '', '', - 'typenum', 'int', '', '', '', '', - 'freq', 'int', 'NULL', '', '', '', - 'prog', @perl_type, '', '', - 'disabled', 'char', 'NULL', 1, '', '', - 'username', 'varchar', 'NULL', $char_d, '', '', - '_password','varchar', 'NULL', $char_d, '', '', - 'ticketing_queueid', 'int', 'NULL', '', '', '', + 'agentnum', 'serial', '', '', '', '', + 'agent', 'varchar', '', $char_d, '', '', + 'typenum', 'int', '', '', '', '', + 'disabled', 'char', 'NULL', 1, '', '', + 'ticketing_queueid', 'int', 'NULL', '', '', '', + 'invoice_template', 'varchar', 'NULL', $char_d, '', '', + 'username', 'varchar', 'NULL', $char_d, '', '', #deprecated + '_password', 'varchar', 'NULL', $char_d, '', '', #deprecated + 'freq', 'int', 'NULL', '', '', '', #deprecated (never used) + 'prog', @perl_type, '', '', #deprecated (never used) + ], 'primary_key' => 'agentnum', 'unique' => [], @@ -349,6 +351,84 @@ sub tables_hashref { 'index' => [ ['payby'], ['disabled'], ], }, + 'part_event' => { + 'columns' => [ + 'eventpart', 'serial', '', '', '', '', + 'agentnum', 'int', 'NULL', '', '', '', + 'event', 'varchar', '', $char_d, '', '', + 'eventtable', 'varchar', '', $char_d, '', '', + 'check_freq', 'varchar', 'NULL', $char_d, '', '', + 'weight', 'int', '', '', '', '', + 'action', 'varchar', '', $char_d, '', '', + 'disabled', 'char', 'NULL', 1, '', '', + ], + 'primary_key' => 'eventpart', + 'unique' => [], + 'index' => [ ['agentnum'], ['eventtable'], ['check_freq'], ['disabled'], ], + }, + + 'part_event_option' => { + 'columns' => [ + 'optionnum', 'serial', '', '', '', '', + 'eventpart', 'int', '', '', '', '', + 'optionname', 'varchar', '', $char_d, '', '', + 'optionvalue', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'optionnum', + 'unique' => [], + 'index' => [ [ 'eventpart' ], [ 'optionname' ] ], + }, + + 'part_event_condition' => { + 'columns' => [ + 'eventconditionnum', 'serial', '', '', '', '', + 'eventpart', 'int', '', '', '', '', + 'conditionname', 'varchar', '', $char_d, '', '', + ], + 'primary_key' => 'eventconditionnum', + 'unique' => [], + 'index' => [ [ 'eventpart' ], [ 'conditionname' ] ], + }, + + 'part_event_condition_option' => { + 'columns' => [ + 'optionnum', 'serial', '', '', '', '', + 'eventconditionnum', 'int', '', '', '', '', + 'optionname', 'varchar', '', $char_d, '', '', + 'optionvalue', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'optionnum', + 'unique' => [], + 'index' => [ [ 'eventconditionnum' ], [ 'optionname' ] ], + }, + + 'part_event_condition_option_option' => { + 'columns' => [ + 'optionoptionnum', 'serial', '', '', '', '', + 'optionnum', 'int', '', '', '', '', + 'optionname', 'varchar', '', $char_d, '', '', + 'optionvalue', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'optionoptionnum', + 'unique' => [], + 'index' => [ [ 'optionnum' ], [ 'optionname' ] ], + }, + + 'cust_event' => { + 'columns' => [ + 'eventnum', 'serial', '', '', '', '', + 'eventpart', 'int', '', '', '', '', + 'tablenum', 'int', '', '', '', '', + '_date', @date_type, '', '', + 'status', 'varchar', '', $char_d, '', '', + 'statustext', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'eventnum', + #no... there are retries now #'unique' => [ [ 'eventpart', 'invnum' ] ], + 'unique' => [], + 'index' => [ ['eventpart'], ['tablenum'], ['status'] ], + }, + 'cust_bill_pkg' => { 'columns' => [ 'billpkgnum', 'serial', '', '', '', '', @@ -681,7 +761,10 @@ sub tables_hashref { ], 'primary_key' => 'pkgnum', 'unique' => [], - 'index' => [ ['custnum'], ['pkgpart'] ], + 'index' => [ ['custnum'], ['pkgpart'], + ['setup'], ['last_bill'], ['bill'], ['susp'], ['adjourn'], + ['expire'], ['cancel'] + ], }, 'cust_pkg_option' => { @@ -1731,6 +1814,16 @@ sub tables_hashref { 'index' => [], }, + 'pkg_referral' => { + 'columns' => [ + 'pkgrefnum', 'serial', '', '', '', '', + 'pkgnum', 'int', '', '', '', '', + 'refnum', 'int', '', '', '', '', + ], + 'primary_key' => 'pkgrefnum', + 'unique' => [ [ 'pkgnum', 'refnum' ] ], + 'index' => [ [ 'pkgnum' ], [ 'refnum' ] ], + }, # name type nullability length default local #'new_table' => { diff --git a/FS/FS/Setup.pm b/FS/FS/Setup.pm index 17101a745..55984d4c7 100644 --- a/FS/FS/Setup.pm +++ b/FS/FS/Setup.pm @@ -161,51 +161,52 @@ sub initial_data { { 'groupname' => 'Superuser' }, ], - #billing events - 'part_bill_event' => [ - { 'payby' => 'CARD', - 'event' => 'Batch card', - 'seconds' => 0, - 'eventcode' => '$cust_bill->batch_card(%options);', - 'weight' => 40, - 'plan' => 'batch-card', - }, - { 'payby' => 'BILL', - 'event' => 'Send invoice', - 'seconds' => 0, - 'eventcode' => '$cust_bill->send();', - 'weight' => 50, - 'plan' => 'send', - }, - { 'payby' => 'DCRD', - 'event' => 'Send invoice', - 'seconds' => 0, - 'eventcode' => '$cust_bill->send();', - 'weight' => 50, - 'plan' => 'send', - }, - { 'payby' => 'DCHK', - 'event' => 'Send invoice', - 'seconds' => 0, - 'eventcode' => '$cust_bill->send();', - 'weight' => 50, - 'plan' => 'send', - }, - { 'payby' => 'DCLN', - 'event' => 'Suspend', - 'seconds' => 0, - 'eventcode' => '$cust_bill->suspend();', - 'weight' => 40, - 'plan' => 'suspend', - }, - #{ 'payby' => 'DCLN', - # 'event' => 'Retriable', - # 'seconds' => 0, - # 'eventcode' => '$cust_bill_event->retriable();', - # 'weight' => 60, - # 'plan' => 'retriable', - #}, - ], +#XXX need default new-style billing events +# #billing events +# 'part_bill_event' => [ +# { 'payby' => 'CARD', +# 'event' => 'Batch card', +# 'seconds' => 0, +# 'eventcode' => '$cust_bill->batch_card(%options);', +# 'weight' => 40, +# 'plan' => 'batch-card', +# }, +# { 'payby' => 'BILL', +# 'event' => 'Send invoice', +# 'seconds' => 0, +# 'eventcode' => '$cust_bill->send();', +# 'weight' => 50, +# 'plan' => 'send', +# }, +# { 'payby' => 'DCRD', +# 'event' => 'Send invoice', +# 'seconds' => 0, +# 'eventcode' => '$cust_bill->send();', +# 'weight' => 50, +# 'plan' => 'send', +# }, +# { 'payby' => 'DCHK', +# 'event' => 'Send invoice', +# 'seconds' => 0, +# 'eventcode' => '$cust_bill->send();', +# 'weight' => 50, +# 'plan' => 'send', +# }, +# { 'payby' => 'DCLN', +# 'event' => 'Suspend', +# 'seconds' => 0, +# 'eventcode' => '$cust_bill->suspend();', +# 'weight' => 40, +# 'plan' => 'suspend', +# }, +# #{ 'payby' => 'DCLN', +# # 'event' => 'Retriable', +# # 'seconds' => 0, +# # 'eventcode' => '$cust_bill_event->retriable();', +# # 'weight' => 60, +# # 'plan' => 'retriable', +# #}, +# ], #you must create a service definition. An example of a service definition #would be a dial-up account or a domain. First, it is necessary to create a diff --git a/FS/FS/access_group.pm b/FS/FS/access_group.pm index 25190406f..b5b693a8f 100644 --- a/FS/FS/access_group.pm +++ b/FS/FS/access_group.pm @@ -140,7 +140,7 @@ test if this group has the given RIGHTNAME. =cut sub access_right { - my( $self, $name ) = shift; + my( $self, $name ) = @_; qsearchs('access_right', { 'righttype' => 'FS::access_group', 'rightobjnum' => $self->groupnum, 'rightname' => $name, diff --git a/FS/FS/access_user.pm b/FS/FS/access_user.pm index cb43b37e9..8e4ad46bd 100644 --- a/FS/FS/access_user.pm +++ b/FS/FS/access_user.pm @@ -308,22 +308,34 @@ Returns a hashref of agentnums this user can view. sub agentnums_href { my $self = shift; - { map { $_ => 1 } $self->agentnums }; + scalar( { map { $_ => 1 } $self->agentnums } ); } -=item agentnums_sql +=item agentnums_sql [ HASHREF | OPTION => VALUE ... ] Returns an sql fragement to select only agentnums this user can view. +Options are passed as a hashref or a list. Available options are: + +=over 4 + +=item null - The frament will also allow the selection of null agentnums. + +=item null_right - The fragment will also allow the selection of null agentnums if the current user has the provided access right + +=back + =cut sub agentnums_sql { - my $self = shift; + my( $self ) = shift; + my %opt = ref($_[0]) ? %{$_[0]} : @_; my @agentnums = map { "agentnum = $_" } $self->agentnums; push @agentnums, 'agentnum IS NULL' - if $self->access_right('View/link unlinked services'); + if $opt{'null'} + || ( $opt{'null_right'} && $self->access_right($opt{'null_right'}) ); return ' 1 = 0 ' unless scalar(@agentnums); '( '. join( ' OR ', @agentnums ). ' )'; diff --git a/FS/FS/access_user_pref.pm b/FS/FS/access_user_pref.pm index ff957f2a1..31cd4b362 100644 --- a/FS/FS/access_user_pref.pm +++ b/FS/FS/access_user_pref.pm @@ -27,19 +27,22 @@ FS::access_user_pref - Object methods for access_user_pref records =head1 DESCRIPTION -An FS::access_user_pref object represents an example. FS::access_user_pref inherits from -FS::Record. The following fields are currently supported: +An FS::access_user_pref object represents an per-user preference. Preferenaces +are also used to store transient state information (server-side "cookies"). +FS::access_user_pref inherits from FS::Record. The following fields are +currently supported: =over 4 =item prefnum - primary key -=item usernum - +=item usernum - Internal access user (see L) =item prefname - =item prefvalue - +=item expiration - =back @@ -49,7 +52,7 @@ FS::Record. The following fields are currently supported: =item new HASHREF -Creates a new example. To add the example to the database, see L<"insert">. +Creates a new preference. To add the example to the database, see L<"insert">. Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the I method. @@ -88,7 +91,7 @@ returns the error, otherwise returns false. =item check -Checks all fields to make sure this is a valid example. If there is +Checks all fields to make sure this is a valid preference. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods. @@ -104,7 +107,8 @@ sub check { $self->ut_numbern('prefnum') || $self->ut_number('usernum') || $self->ut_text('prefname') - || $self->ut_textn('prefvalue') + #|| $self->ut_textn('prefvalue') + || $self->ut_anything('prefvalue') ; return $error if $error; @@ -115,11 +119,9 @@ sub check { =head1 BUGS -The author forgot to customize this manpage. - =head1 SEE ALSO -L, schema.html from the base documentation. +L, L, schema.html from the base documentation. =cut diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index e40ef09db..57cc94563 100644 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@ -117,6 +117,7 @@ sub check { || $self->ut_number('typenum') || $self->ut_numbern('freq') || $self->ut_textn('prog') + || $self->ut_textn('invoice_template') ; return $error if $error; diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 82023f6b5..f6dbc3df0 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -24,6 +24,7 @@ use FS::cust_credit_bill; use FS::pay_batch; use FS::cust_pay_batch; use FS::cust_bill_event; +use FS::cust_event; use FS::part_pkg; use FS::cust_bill_pay; use FS::cust_bill_pay_batch; @@ -271,8 +272,7 @@ sub open_cust_bill_pkg { =item cust_bill_event -Returns the completed invoice events (see L) for this -invoice. +Returns the completed invoice events (deprecated, old-style events - see L) for this invoice. =cut @@ -281,6 +281,54 @@ sub cust_bill_event { qsearch( 'cust_bill_event', { 'invnum' => $self->invnum } ); } +=item num_cust_bill_event + +Returns the number of completed invoice events (deprecated, old-style events - see L) for this invoice. + +=cut + +sub num_cust_bill_event { + my $self = shift; + my $sql = + "SELECT COUNT(*) FROM cust_bill_event WHERE invnum = ?"; + my $sth = dbh->prepare($sql) or die dbh->errstr. " preparing $sql"; + $sth->execute($self->invnum) or die $sth->errstr. " executing $sql"; + $sth->fetchrow_arrayref->[0]; +} + +=item cust_event + +Returns the new-style customer billing events (see L) for this invoice. + +=cut + +#false laziness w/cust_pkg.pm +sub cust_event { + my $self = shift; + qsearch({ + 'table' => 'cust_event', + 'addl_from' => 'JOIN part_event USING ( eventpart )', + 'hashref' => { 'tablenum' => $self->invnum }, + 'extra_sql' => " AND eventtable = 'cust_bill' ", + }); +} + +=item num_cust_event + +Returns the number of new-style customer billing events (see L) for this invoice. + +=cut + +#false laziness w/cust_pkg.pm +sub num_cust_event { + my $self = shift; + my $sql = + "SELECT COUNT(*) FROM cust_event JOIN part_event USING ( eventpart ) ". + " WHERE tablenum = ? AND eventtable = 'cust_bill'"; + my $sth = dbh->prepare($sql) or die dbh->errstr. " preparing $sql"; + $sth->execute($self->invnum) or die $sth->errstr. " executing $sql"; + $sth->fetchrow_arrayref->[0]; +} =item cust_main @@ -2577,6 +2625,8 @@ sub _items_payments { =back + + =head1 SUBROUTINES =over 4 @@ -2698,6 +2748,34 @@ sub re_X { =back +=head1 CLASS METHODS + +=over 4 + +=item owed_sql + +Returns an SQL fragment to retreived the amount owed. + +=cut + +sub owed_sql { + #my $class = shift; + + "charged + - COALESCE( + ( SELECT SUM(amount) FROM cust_bill_pay + WHERE cust_bill.invnum = cust_bill_pay.invnum ) + ,0 + ) + - COALESCE( + ( SELECT SUM(amount) FROM cust_credit_bill + WHERE cust_bill.invnum = cust_credit_bill.invnum ) + ,0 + ) + "; + +} + =head1 BUGS The delete method. diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm index 84ca79dbf..e07461d58 100644 --- a/FS/FS/cust_credit.pm +++ b/FS/FS/cust_credit.pm @@ -333,10 +333,43 @@ sub cust_main { =back +=head1 CLASS METHODS + +=over 4 + +=item credited_sql + +Returns an SQL fragment to retreive the unapplied amount. + +=cut + +sub credited_sql { + #my $class = shift; + + "amount + - COALESCE( + ( SELECT SUM(amount) FROM cust_credit_refund + WHERE cust_credit.crednum = cust_credit_refund.crednum ) + ,0 + ) + - COALESCE( + ( SELECT SUM(amount) FROM cust_credit_bill + WHERE cust_credit.crednum = cust_credit_bill.crednum ) + ,0 + ) + "; + +} + +=back + =head1 BUGS The delete method. The replace method. +B and B should probably be called B and +B. + =head1 SEE ALSO L, L, L, diff --git a/FS/FS/cust_event.pm b/FS/FS/cust_event.pm new file mode 100644 index 000000000..bebd72a10 --- /dev/null +++ b/FS/FS/cust_event.pm @@ -0,0 +1,407 @@ +package FS::cust_event; + +use strict; +use vars qw( @ISA $DEBUG ); +use Carp qw( croak confess ); +use FS::Record qw( qsearch qsearchs dbdef ); +use FS::cust_main_Mixin; +use FS::part_event; +#for cust_X +use FS::cust_main; +use FS::cust_pkg; +use FS::cust_bill; + +@ISA = qw(FS::cust_main_Mixin FS::Record); + +$DEBUG = 0; + +=head1 NAME + +FS::cust_event - Object methods for cust_event records + +=head1 SYNOPSIS + + use FS::cust_event; + + $record = new FS::cust_event \%hash; + $record = new FS::cust_event { 'column' => 'value' }; + + $error = $record->insert; + + $error = $new_record->replace($old_record); + + $error = $record->delete; + + $error = $record->check; + +=head1 DESCRIPTION + +An FS::cust_event object represents an completed event. FS::cust_event +inherits from FS::Record. The following fields are currently supported: + +=over 4 + +=item eventnum - primary key + +=item eventpart - event definition (see L) + +=item tablenum - customer, package or invoice, depending on the value of part_event.eventtable (see L, L, and L) + +=item _date - specified as a UNIX timestamp; see L. Also see +L and L for conversion functions. + +=item status - event status: B, B, B or B. Note: B indicates the event is complete and should not be retried (statustext may still be set to an optional message), while B indicates the event failed and should be retried. + +=item statustext - additional status detail (i.e. error or progress message) + +=back + +=head1 METHODS + +=over 4 + +=item new HASHREF + +Creates a new completed invoice event. To add the compelted invoice event to +the database, see L<"insert">. + +Note that this stores the hash reference, not a distinct copy of the hash it +points to. You can ask the object for a copy with the I method. + +=cut + +# the new method can be inherited from FS::Record, if a table method is defined + +sub table { 'cust_event'; } + +sub cust_linked { $_[0]->cust_main_custnum; } +sub cust_unlinked_msg { + my $self = shift; + "WARNING: can't find cust_main.custnum ". $self->custnum; + #' (cust_bill.invnum '. $self->invnum. ')'; +} +sub custnum { + my $self = shift; + $self->cust_main_custnum(@_) || $self->SUPER::custnum(@_); +} + +=item insert + +Adds this record to the database. If there is an error, returns the error, +otherwise returns false. + +=cut + +# the insert method can be inherited from FS::Record + +=item delete + +Delete this record from the database. + +=cut + +# the delete method can be inherited from FS::Record + +=item replace OLD_RECORD + +Replaces the OLD_RECORD with this one in the database. If there is an error, +returns the error, otherwise returns false. + +=cut + +# the replace method can be inherited from FS::Record + +=item check + +Checks all fields to make sure this is a valid completed invoice event. If +there is an error, returns the error, otherwise returns false. Called by the +insert and replace methods. + +=cut + +# the check method should currently be supplied - FS::Record contains some +# data checking routines + +sub check { + my $self = shift; + + my $error = $self->ut_numbern('eventnum') + || $self->ut_foreign_key('eventpart', 'part_event', 'eventpart') + ; + return $error if $error; + + my $eventtable = $self->part_event->eventtable; + my $dbdef_eventtable = dbdef->table( $eventtable ); + + $error = + $self->ut_foreign_key( 'tablenum', + $eventtable, + $dbdef_eventtable->primary_key + ) + || $self->ut_number('_date') + || $self->ut_enum('status', [qw( new locked done failed )]) + || $self->ut_textn('statustext') + ; + return $error if $error; + + $self->SUPER::check; +} + +=item part_event + +Returns the event definition (see L) for this completed event. + +=cut + +sub part_event { + my $self = shift; + qsearchs( 'part_event', { 'eventpart' => $self->eventpart } ); +} + +=item cust_X + +Returns the customer, package, invoice or batched payment (see +L, L, L or L) +for this completed invoice event. + +=cut + +sub cust_bill { + croak "FS::cust_event::cust_bill called"; +} + +sub cust_X { + my $self = shift; + my $eventtable = $self->part_event->eventtable; + my $dbdef_table = dbdef->table( $eventtable ); + my $primary_key = $dbdef_table->primary_key; + qsearchs( $eventtable, { $primary_key => $self->tablenum } ); +} + +=item test_conditions [ OPTION => VALUE ... ] + +Tests conditions for this event, returns true if all conditions are satisfied, +false otherwise. + +=cut + +sub test_conditions { + my( $self, %opt ) = @_; + my $part_event = $self->part_event; + my $object = $self->cust_X; + my @conditions = $part_event->part_event_condition; + + #no unsatisfied conditions + #! grep ! $_->condition( $object, %opt ), @conditions; + my @unsatisfied = grep ! $_->condition( $object, %opt ), @conditions; + + if ( $opt{'stats_hashref'} ) { + foreach my $unsat (@unsatisfied) { + $opt{'stats_hashref'}->{$unsat->conditionname}++; + } + } + + ! @unsatisfied; +} + +=item do_event + +Runs the event action. + +=cut + +sub do_event { + my $self = shift; + + my $part_event = $self->part_event; + + my $object = $self->cust_X; + my $obj_pkey = $object->primary_key; + my $for = "for ". $object->table. " ". $object->$obj_pkey(); + warn "running cust_event ". $self->eventnum. + " (". $part_event->action. ") $for\n" + if $DEBUG; + + my $oldAutoCommit = $FS::UID::AutoCommit; + local $FS::UID::AutoCommit = 0; + + my $error; + { + local $SIG{__DIE__}; # don't want Mason __DIE__ handler active + $error = eval { $part_event->do_action($object); }; + } + + my $status = ''; + my $statustext = ''; + if ( $@ ) { + $status = 'failed'; + #$statustext = $@; + $statustext = "Error running ". $part_event->action. " action: $@"; + } elsif ( $error ) { + $status = 'done'; + $statustext = $error; + } else { + $status = 'done'; + } + + #replace or add myself + $self->_date(time); + $self->status($status); + $self->statustext($statustext); + + $error = $self->eventnum ? $self->replace : $self->insert; + if ( $error ) { + #this is why we need that locked state... + my $e = 'WARNING: Event run but database not updated - '. + 'error replacing or inserting cust_event '. $self->eventnum. + " $for: $error\n"; + warn $e; + return $e; + } + + ''; + +} + +=item retry + +Changes the status of this event from B to B, allowing it to be +retried. + +=cut + +sub retry { + my $self = shift; + return '' unless $self->status eq 'done'; + my $old = ref($self)->new( { $self->hash } ); + $self->status('failed'); + $self->replace($old); +} + +#=item retryable +# +#Changes the statustext of this event to B, rendering it +#retriable (should retry be called). +# +#=cut + +sub retriable { + confess "cust_event->retriable called"; + my $self = shift; + return '' unless $self->status eq 'done'; + my $old = ref($self)->new( { $self->hash } ); + $self->statustext('retriable'); + $self->replace($old); +} + +=back + +=head1 SUBROUTINES + +=over 4 + +=item reprint + +=cut + +sub process_reprint { + process_re_X('print', @_); +} + +=item reemail + +=cut + +sub process_reemail { + process_re_X('email', @_); +} + +=item refax + +=cut + +sub process_refax { + process_re_X('fax', @_); +} + +use Storable qw(thaw); +use Data::Dumper; +use MIME::Base64; +sub process_re_X { + my( $method, $job ) = ( shift, shift ); + + my $param = thaw(decode_base64(shift)); + warn Dumper($param) if $DEBUG; + + re_X( + $method, + $param->{'beginning'}, + $param->{'ending'}, + $param->{'failed'}, + $job, + ); + +} + +sub re_X { + my($method, $beginning, $ending, $failed, $job) = @_; + + my $from = 'LEFT JOIN part_event USING ( eventpart )'; + + # yuck! hardcoed *AND* sequential scans! + my $where = " WHERE action LIKE 'cust_bill_send%'". + " AND cust_event._date >= $beginning". + " AND cust_event._date <= $ending"; + $where .= " AND statustext != '' AND statustext IS NOT NULL" + if $failed; + + my @cust_event = qsearch({ + 'table' => 'cust_event', + 'addl_from' => $from, + 'hashref' => {}, + 'extra_sql' => $where, + }); + + my( $num, $last, $min_sec ) = (0, time, 5); #progresbar foo + foreach my $cust_event ( @cust_event ) { + + # XXX + $cust_event->cust_bill->$method( + $cust_event->part_event->templatename + || $cust_event->cust_main->agent_template + ); + + if ( $job ) { #progressbar foo + $num++; + if ( time - $min_sec > $last ) { + my $error = $job->update_statustext( + int( 100 * $num / scalar(@cust_event) ) + ); + die $error if $error; + $last = time; + } + } + + } + + #this doesn't work, but it would be nice + #if ( $job ) { #progressbar foo + # my $error = $job->update_statustext( + # scalar(@cust_event). " invoices re-${method}ed" + # ); + # die $error if $error; + #} + +} + +=back + +=head1 SEE ALSO + +L, L, L, schema.html from the +base documentation. + +=cut + +1; + diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 7238e97f3..fb64fa3ad 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1,5 +1,6 @@ package FS::cust_main; +require 5.006; use strict; use vars qw( @ISA @EXPORT_OK $DEBUG $me $conf @encrypted_fields $import $skip_fuzzyfiles $ignore_expired_card @paytypes); @@ -7,13 +8,9 @@ use vars qw( $realtime_bop_decline_quiet ); #ugh use Safe; use Carp; use Exporter; -BEGIN { - eval "use Time::Local;"; - die "Time::Local minimum version 1.05 required with Perl versions before 5.6" - if $] < 5.006 && !defined($Time::Local::VERSION); - #eval "use Time::Local qw(timelocal timelocal_nocheck);"; - eval "use Time::Local qw(timelocal_nocheck);"; -} +use Time::Local qw(timelocal_nocheck); +use Data::Dumper; +use Tie::IxHash; use Digest::MD5 qw(md5_base64); use Date::Format; use Date::Parse; @@ -32,6 +29,7 @@ use FS::cust_bill; use FS::cust_bill_pkg; use FS::cust_pay; use FS::cust_pay_void; +use FS::cust_pay_batch; use FS::cust_credit; use FS::cust_refund; use FS::part_referral; @@ -43,8 +41,9 @@ use FS::cust_bill_pay; use FS::prepay_credit; use FS::queue; use FS::part_pkg; -use FS::part_bill_event qw(due_events); -use FS::cust_bill_event; +use FS::part_event; +use FS::part_event_condition; +#use FS::cust_event; use FS::cust_tax_exempt; use FS::cust_tax_exempt_pkg; use FS::type_pkgs; @@ -1423,11 +1422,10 @@ sub check { $payinfo =~ s/[^\d\@]//g; if ( $conf->exists('echeck-nonus') ) { $payinfo =~ /^(\d+)\@(\d+)$/ or return 'invalid echeck account@aba'; - $payinfo = "$1\@$2"; } else { $payinfo =~ /^(\d+)\@(\d{9})$/ or return 'invalid echeck account@aba'; - $payinfo = "$1\@$2"; } + $payinfo = "$1\@$2"; $self->payinfo($payinfo); $self->paycvv(''); @@ -1547,6 +1545,16 @@ sub all_pkgs { sort sort_packages @cust_pkg; } +=item cust_pkg + +Synonym for B. + +=cut + +sub cust_pkg { + shift->all_pkgs(@_); +} + =item ncancelled_pkgs Returns all non-cancelled packages (see L) for this customer. @@ -1561,11 +1569,18 @@ sub ncancelled_pkgs { my @cust_pkg = (); if ( $self->{'_pkgnum'} ) { + warn "$me ncancelled_pkgs: returning cached objects" + if $DEBUG > 1; + @cust_pkg = grep { ! $_->getfield('cancel') } values %{ $self->{'_pkgnum'}->cache }; } else { + warn "$me ncancelled_pkgs: searching for packages for custnum ". + $self->custnum + if $DEBUG > 1; + @cust_pkg = qsearch( 'cust_pkg', { 'custnum' => $self->custnum, @@ -1683,10 +1698,20 @@ sub suspend { grep { $_->suspend(@_) } $self->unsuspended_pkgs; } -=item suspend_if_pkgpart PKGPART [ , PKGPART ... ] +=item suspend_if_pkgpart HASHREF | PKGPART [ , PKGPART ... ] Suspends all unsuspended packages (see L) matching the listed -PKGPARTs (see L). +PKGPARTs (see L). Preferred usage is to pass a hashref instead +of a list of pkgparts; the hashref has the following keys: + +=over 4 + +=item pkgparts - listref of pkgparts + +=item (other options are passed to the suspend method) + +=back + Returns a list: an empty list on success or a list of errors. @@ -1706,10 +1731,19 @@ sub suspend_if_pkgpart { $self->unsuspended_pkgs; } -=item suspend_unless_pkgpart PKGPART [ , PKGPART ... ] +=item suspend_unless_pkgpart HASHREF | PKGPART [ , PKGPART ... ] Suspends all unsuspended packages (see L) unless they match the -listed PKGPARTs (see L). +given PKGPARTs (see L). Preferred usage is to pass a hashref +instead of a list of pkgparts; the hashref has the following keys: + +=over 4 + +=item pkgparts - listref of pkgparts + +=item (other options are passed to the suspend method) + +=back Returns a list: an empty list on success or a list of errors. @@ -1733,22 +1767,31 @@ sub suspend_unless_pkgpart { Cancels all uncancelled packages (see L) for this customer. -Available options are: I, I, and I +Available options are: -I can be set true to supress email cancellation notices. +=over 4 -# I can be set to a cancellation reason (see L) +=item quiet - can be set true to supress email cancellation notices. -I can be set true to ban this customer's credit card or ACH information, -if present. +=item reason - can be set to a cancellation reason (see L), either a reasonnum of an existing reason, or passing a hashref will create a new reason. The hashref should have the following keys: typenum - Reason type (see L, reason - Text of the new reason. + +=item ban - can be set true to ban this customer's credit card or ACH information, if present. + +=back Always returns a list: an empty list on success or a list of errors. =cut sub cancel { - my $self = shift; - my %opt = @_; + my( $self, %opt ) = @_; + + warn "$me cancel called on customer ". $self->custnum. " with options ". + join(', ', map { "$_: $opt{$_}" } keys %opt ). "\n" + if $DEBUG; + + return ( 'access denied' ) + unless $FS::CurrentUser::CurrentUser->access_right('Cancel customer'); if ( $opt{'ban'} && $self->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) { @@ -1763,7 +1806,13 @@ sub cancel { } - grep { $_ } map { $_->cancel(@_) } $self->ncancelled_pkgs; + my @pkgs = $self->ncancelled_pkgs; + + warn "$me cancelling ". scalar($self->ncancelled_pkgs). "/". + scalar(@pkgs). " packages for customer ". $self->custnum. "\n" + if $DEBUG; + + grep { $_ } map { $_->cancel(%opt) } $self->ncancelled_pkgs; } sub _banned_pay_hashref { @@ -1810,10 +1859,87 @@ sub agent { qsearchs( 'agent', { 'agentnum' => $self->agentnum } ); } +=item bill_and_collect + +Cancels and suspends any packages due, generates bills, applies payments and +cred + +Warns on errors (Does not currently: If there is an error, returns the error, otherwise returns false.) + +Options are passed as name-value pairs. Currently available options are: + +=over 4 + +=item time - bills the customer as if it were that time. Specified as a UNIX timestamp; see L). Also see L and L for conversion functions. For example: + + use Date::Parse; + ... + $cust_main->bill( 'time' => str2time('April 20th, 2001') ); + +=item invoice_time - used in conjunction with the I