Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit

  • Loading branch information...
commit 19352b9ea16dc4890f5a2b778abd3a48bea0dee9 0 parents
DJ Tarazona djtarazona authored
Showing with 23,578 additions and 0 deletions.
  1. +74 −0 .gitignore
  2. +674 −0 COPYING.txt
  3. +14 −0 LICENSE.txt
  4. +147 −0 admin.php
  5. +107 −0 admin/admin/ad_about.php
  6. +727 −0 admin/admin/ad_home.php
  7. +287 −0 admin/admin/ad_settings.php
  8. +2 −0  admin/admin/index.html
  9. +2 −0  admin/index.html
  10. +263 −0 admin/look/ad_emails.php
  11. +856 −0 admin/look/ad_langs.php
  12. +1,105 −0 admin/look/ad_skins.php
  13. +2 −0  admin/look/index.html
  14. +1,206 −0 admin/manage/ad_articles.php
  15. +864 −0 admin/manage/ad_categories.php
  16. +801 −0 admin/manage/ad_cdfields.php
  17. +811 −0 admin/manage/ad_cpfields.php
  18. +903 −0 admin/manage/ad_departs.php
  19. +718 −0 admin/manage/ad_flags.php
  20. +1,203 −0 admin/manage/ad_groups.php
  21. +1,051 −0 admin/manage/ad_news.php
  22. +509 −0 admin/manage/ad_pages.php
  23. +861 −0 admin/manage/ad_priorities.php
  24. +506 −0 admin/manage/ad_rtemplates.php
  25. +620 −0 admin/manage/ad_statuses.php
  26. +3,775 −0 admin/manage/ad_tickets.php
  27. +1,504 −0 admin/manage/ad_users.php
  28. +2 −0  admin/manage/index.html
  29. +367 −0 admin/tools/ad_backup.php
  30. +210 −0 admin/tools/ad_cache.php
  31. +366 −0 admin/tools/ad_logs.php
  32. +1,310 −0 admin/tools/ad_maint.php
  33. +557 −0 admin/tools/ad_settings.php
  34. +81 −0 admin/tools/ad_stats.php
  35. +2 −0  admin/tools/index.html
  36. +11 −0 config.php.dist
  37. +2 −0  data/cache/htmlpurifier/index.html
  38. +2 −0  data/cache/index.html
  39. +2 −0  data/cache/trellis/index.html
  40. +2 −0  data/logs/index.html
  41. +2 −0  data/skin_compile/index.html
  42. +2 −0  data/temp/index.html
  43. +2 −0  data/uploads/index.html
  44. BIN  images/classic/arrow_down.gif
  45. BIN  images/classic/arrow_right.gif
  46. BIN  images/classic/arrow_up.gif
  47. BIN  images/classic/content_bkg.jpg
  48. BIN  images/classic/delete_icon.gif
  49. BIN  images/classic/edit_icon.gif
  50. BIN  images/classic/header.jpg
  51. BIN  images/classic/header_acp.jpg
  52. BIN  images/classic/header_bg.jpg
  53. BIN  images/classic/header_lower.jpg
  54. +2 −0  images/classic/index.html
  55. BIN  images/classic/kb_icon.gif
  56. BIN  images/classic/loading.gif
  57. BIN  images/classic/logos/feed.png
  58. +2 −0  images/classic/logos/index.html
  59. BIN  images/classic/logos/mysql.png
  60. BIN  images/classic/logos/php.png
  61. BIN  images/classic/logos/tinymce.png
  62. BIN  images/classic/logos/vcss.png
  63. BIN  images/classic/logos/vrss.png
  64. BIN  images/classic/logos/xhtml10.png
  65. BIN  images/classic/logos/zend.png
  66. BIN  images/classic/menu_bg.jpg
  67. BIN  images/classic/menu_left.jpg
  68. BIN  images/classic/menu_right.jpg
  69. BIN  images/classic/rate_half.gif
  70. BIN  images/classic/rate_hover.gif
  71. BIN  images/classic/rate_off.gif
  72. BIN  images/classic/rate_on.gif
  73. BIN  images/classic/revert_icon.gif
  74. BIN  images/classic/thumbs_down.gif
  75. BIN  images/classic/thumbs_down_hover.gif
  76. BIN  images/classic/thumbs_up.gif
  77. BIN  images/classic/thumbs_up_hover.gif
  78. BIN  images/classic/ticket_icon.gif
  79. BIN  images/flags/flag_blue.png
  80. BIN  images/flags/flag_green.png
  81. BIN  images/flags/flag_orange.png
  82. BIN  images/flags/flag_pink.png
  83. BIN  images/flags/flag_purple.png
  84. BIN  images/flags/flag_red.png
  85. BIN  images/flags/flag_yellow.png
  86. +2 −0  images/flags/index.html
  87. +2 −0  images/index.html
  88. +2 −0  images/priorities/index.html
  89. BIN  images/priorities/priority_blue.gif
  90. BIN  images/priorities/priority_blue_dot.gif
  91. BIN  images/priorities/priority_green.gif
  92. BIN  images/priorities/priority_orange.gif
  93. BIN  images/priorities/priority_orange_dot.gif
  94. BIN  images/priorities/priority_pink.gif
  95. BIN  images/priorities/priority_pink_dot.gif
  96. BIN  images/priorities/priority_purple.gif
  97. BIN  images/priorities/priority_purple_dot.gif
  98. BIN  images/priorities/priority_red.gif
  99. BIN  images/priorities/priority_red_dot.gif
  100. BIN  images/priorities/priority_yellow.gif
  101. BIN  images/priorities/priority_yellow_dot.gif
  102. +392 −0 includes/akismet/Akismet.class.php
  103. +108 −0 includes/classes/class_akismet.php
  104. +556 −0 includes/classes/class_asession.php
Sorry, we could not display the entire diff because too many files (1,116) changed.
74 .gitignore
@@ -0,0 +1,74 @@
+# Max OS X
+.DS_Store
+Icon?
+
+# Windows
+Thumbs.db
+
+# Thumbnails
+._*
+
+# Files that might appear on external disk
+.Spotlight-V100
+.Trashes
+
+# It's better to unpack these files and commit the raw source because
+# git has its own built in compression methods.
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.tar.gz
+*.zip
+*.bzip
+
+# Eclipse
+*.pydevproject
+.project
+.metadata
+local.properties
+.classpath
+.settings/
+.loadpath
+
+# CDT-specific
+.cproject
+
+# PHP
+error_log
+
+# Other
+*.log
+*.tmp
+*.bak
+*.swp
+*~.nib
+
+# Trellis Desk
+/config.php
+/data/*
+!/data/cache
+/data/cache/*
+!/data/cache/index.html
+!/data/cache/htmlpurifier
+!/data/cache/trellis
+/data/cache/htmlpurifier/*
+!/data/cache/htmlpurifier/index.html
+/data/cache/trellis/*
+!/data/cache/trellis/index.html
+!/data/logs
+/data/logs/*
+!/data/logs/index.html
+!/data/skin_compile
+/data/skin_compile/*
+!/data/skin_compile/index.html
+!/data/temp
+/data/temp/*
+!/data/temp/index.html
+!/data/uploads
+/data/uploads/*
+!/data/uploads/index.html
+/install/install.lock
674 COPYING.txt
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
14 LICENSE.txt
@@ -0,0 +1,14 @@
+This file is part of Trellis Desk.
+
+Trellis Desk is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Trellis Desk is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Trellis Desk. If not, see <http://www.gnu.org/licenses/>.
147 admin.php
@@ -0,0 +1,147 @@
+<?php
+
+/**
+ * Trellis Desk
+ *
+ * @copyright Copyright (C) 2009-2011 ACCORD5. All rights reserved.
+ * @license GNU General Public License version 3 or later; see LICENSE.txt
+ */
+
+define( 'IN_TD', true );
+define( 'IN_TDA', true );
+
+#=============================
+# Lets Play Nice With Output
+#=============================
+
+ob_end_clean();
+ob_start();
+
+#=============================
+# Safe and Secure
+#=============================
+
+if ( function_exists('date_default_timezone_get') )
+{
+ date_default_timezone_set( date_default_timezone_get() );
+}
+
+ini_set( 'register_globals', 0 );
+
+if ( @ini_get( 'register_globals' ) )
+{
+ foreach ( $_REQUEST as $key => $value )
+ {
+ unset( $$key );
+ }
+}
+
+#=============================
+# Define Our Paths
+#=============================
+
+define( "TD_PATH", str_replace( '//', '/', dirname(__FILE__).'/' ) );
+define( 'TD_INC', TD_PATH ."includes/" );
+define( 'TD_CLASS', TD_PATH ."includes/classes/class_" );
+define( 'TD_FUNC', TD_PATH ."includes/functions/func_" );
+define( 'TD_SRC', TD_PATH ."sources/" );
+define( 'TD_SKIN', TD_PATH ."skins/" );
+define( 'TD_ADMIN', TD_PATH ."admin/" );
+
+#=============================
+# Main Class
+#=============================
+
+require_once TD_INC . "trellis.php";
+require_once TD_INC . "trellis_admin.php";
+$trellis = new trellis_admin();
+$trellis->initialize();
+
+#=============================
+# Other Junk
+#=============================
+
+$choice = array(
+ 'admin' => array(
+ 'about',
+ 'home',
+ 'settings',
+ ),
+
+ 'manage' => array(
+ 'articles',
+ 'categories',
+ 'cdfields',
+ 'cpfields',
+ 'departs',
+ 'flags',
+ 'groups',
+ 'news',
+ 'pages',
+ 'priorities',
+ 'rtemplates',
+ 'statuses',
+ 'tickets',
+ 'users',
+ ),
+
+ 'look' => array(
+ 'emails',
+ 'langs',
+ 'skins',
+ ),
+
+ 'tools' => array(
+ 'backup',
+ 'cache',
+ 'logs',
+ 'maint',
+ 'settings',
+ 'stats',
+ ),
+ );
+
+#=============================
+# Require & Run
+#=============================
+
+$folder = $trellis->input['section'];
+
+if ( $folder && in_array( $trellis->input['page'], $choice[ $folder ] ) ) $required = $trellis->input['page'];
+
+if ( ! isset( $required ) )
+{
+ if ( $trellis->input['section'] == 'manage' )
+ {
+ $folder = 'manage';
+ $required = 'tickets';
+ }
+ elseif ( $trellis->input['section'] == 'look' )
+ {
+ $folder = 'look';
+ $required = 'skins';
+ }
+ elseif ( $trellis->input['section'] == 'tools' )
+ {
+ $folder = 'tools';
+ $required = 'settings';
+ }
+ else
+ {
+ $folder = 'admin';
+ $required = 'home';
+ }
+}
+
+$required = "ad_". $required;
+
+require_once TD_ADMIN . $folder ."/". $required .".php";
+
+$required = 'td_'. $required;
+
+$run = new $required();
+$run->trellis =& $trellis;
+
+$run->auto_run();
+
+?>
107 admin/admin/ad_about.php
@@ -0,0 +1,107 @@
+<?php
+
+/**
+ * Trellis Desk
+ *
+ * @copyright Copyright (C) 2009-2011 ACCORD5. All rights reserved.
+ * @license GNU General Public License version 3 or later; see LICENSE.txt
+ */
+
+class td_ad_about {
+
+ private $output = "";
+
+ #=======================================
+ # @ Auto Run
+ #=======================================
+
+ public function auto_run()
+ {
+ $this->trellis->load_functions('admin');
+ $this->trellis->load_lang('home');
+
+ #=============================
+ # Version Check
+ #=============================
+
+ $version_check = $this->trellis->func->admin->version_check();
+
+ if ( $version_check == 1 )
+ {
+ $version_img_url = '<! IMG_DIR !>/vc_update_available.jpg';
+ }
+ elseif ( $version_check == 2 )
+ {
+ $version_img_url = '<! IMG_DIR !>/vc_up_to_date.jpg';
+ }
+ else
+ {
+ $version_img_url = '<! IMG_DIR !>/vc_unable_to_check.jpg';
+ }
+
+ #=============================
+ # Sidebar Menu
+ #=============================
+
+ $mysql_version = mysql_get_server_info();
+
+ if ( strpos( $mysql_version, '-' ) )
+ {
+ $mysql_version = substr( $mysql_version, 0, strpos( $mysql_version, '-' ) );
+ }
+
+ if ( $this->trellis->cache->data['misc']['vcheck_time'] )
+ {
+ $vcheck_date = $this->trellis->td_timestamp( array( 'time' => $this->trellis->cache->data['misc']['vcheck_time'], 'format' => 'date' ) );
+ }
+ else
+ {
+ $vcheck_date = '{lang.check_now}';
+ }
+
+ $system_status_html = "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='blockstatus'>
+ <tr>
+ <td colspan='2' class='statusbadge'><a href='http://www.accord5.com/trellis/latest' target='_blank'><img src='{$version_img_url}' alt='{lang.version_check}' /></a></td>
+ </tr>
+ <tr>
+ <td class='statusleft'><strong>{lang.version_check}</strong></td>
+ <td class='statusright'><a href='<! TD_URL !>/admin.php?section=admin&amp;page=about&amp;vcheck=1' title='{lang.check_now}'>". $vcheck_date ."</a></td>
+ </tr>
+ <tr>
+ <td class='statusleft'><strong>{lang.product_version}</strong></td>
+ <td class='statusright'>{$this->trellis->version_short} ({$this->trellis->version_number})</td>
+ </tr>
+ <td class='statusleft'><strong>{lang.php_version}</strong></td>
+ <td class='statusright'>". phpversion() ."</td>
+
+ </tr>
+ <tr>
+ <td class='statusleft'><strong>{lang.mysql_version}</strong></td>
+ <td class='statusright'>". $mysql_version ."</td>
+ </tr>
+ </table>";
+
+ $this->trellis->skin->add_sidebar_block( 'System Status', $system_status_html );
+
+ #=============================
+ # Do Output
+ #=============================
+
+ $this->output .= "<div id='ticketroll'>
+ <div class='acpwelcome'><img src='<! IMG_DIR !>/td_welcome_acphome.png' alt='Welcome to Trellis Desk 2' /></div>
+ ". $this->trellis->skin->group_title( 'About Trellis Desk' ) ."
+ <div class='option1' style='font-weight: normal; margin-bottom: 8px;'><strong>Help is on the way.</strong> Trellis Desk is a powerful and robust help desk solution for your business. Improve your company's service by allowing your customers to quickly and easily submit support tickets to your team. Trellis Desk sports a range of advanced features that enable your business to handle customer support more efficiently. Plus, it's completely free &mdash; you'll never have to pay any license fees to use Trellis Desk.<br /><br />Show your appreciation and support by helping out your Lead Trellis Desk Developer, DJ, with a <a href='http://www.djtarazona.com/index.php?page=donate' target='_blank'><strong>donation</strong></a>.</div>
+ ". $this->trellis->skin->group_title( 'Credits' ) ."
+ <div class='option1' style='font-weight: normal;'>Thanks to everyone who has contributed to Trellis Desk. We will have a full, up-to-date list of appropriate credits here soon.</div>
+ </div>";
+
+ $this->trellis->skin->add_sidebar_general( 'Icon Usage', 'We tip our hats to Yusuke Kamiyamane (<a href="http://www.pinvoke.com" target="_blank">pinvoke.com</a>) for graciously giving away his Fugue iconset to the world. Also, much thanks to Mark James (<a href="http://www.famfamfam.com" target="_blank">famfamfam.com</a>) for sharing his Silk iconset. These icons help make Trellis Desk look pretty.' );
+
+ $this->trellis->skin->add_output( $this->output );
+
+ $this->trellis->skin->do_output();
+ }
+
+}
+
+?>
727 admin/admin/ad_home.php
@@ -0,0 +1,727 @@
+<?php
+
+/**
+ * Trellis Desk
+ *
+ * @copyright Copyright (C) 2009-2011 ACCORD5. All rights reserved.
+ * @license GNU General Public License version 3 or later; see LICENSE.txt
+ */
+
+class td_ad_home {
+
+ #=======================================
+ # @ Auto Run
+ # Function that is run automatically
+ # when the file is required.
+ #=======================================
+
+ public function auto_run()
+ {
+ $this->trellis->load_functions('admin');
+ $this->trellis->load_functions('tickets');
+ $this->trellis->load_lang('home');
+
+ switch( $this->trellis->input['act'] )
+ {
+ case 'donotes':
+ $this->ajax_save_notes();
+ break;
+
+ default:
+ $this->show_home();
+ break;
+ }
+ }
+
+ #=======================================
+ # @ Show Home
+ #=======================================
+
+ public function show_home()
+ {
+ #=============================
+ # Security Check
+ #=============================
+
+ if ( file_exists( TD_PATH .'install/install.lock' ) )
+ {
+ $this->trellis->send_message( 'alert', $this->trellis->lang['alert_install_locked'] );
+ }
+ elseif ( is_dir( TD_PATH .'install' ) )
+ {
+ $this->trellis->send_message( 'error', $this->trellis->lang['alert_install_dir_exists'] );
+ }
+
+ #=============================
+ # Table Columns
+ #=============================
+
+ $columns = unserialize( $this->trellis->user['columns_tm'] );
+
+ if ( empty( $columns ) )
+ {
+ $columns = array( 'id' => '3%', 'mask' => '6%', 'subject' => '30%', 'priority' => '13%', 'department' => '18%', 'reply' => '17%', 'status' => '13%' );
+ }
+
+ $dark_columns = array( 'subject', 'date', 'last_reply' );
+ $normal_columns = array( 'dname', 'date', 'last_reply' );
+
+ $sql_select = array();
+ $sql_columns = array();
+ $sql_join = array();
+
+ #=============================
+ # Default Sort
+ #=============================
+
+ if ( ! $this->trellis->input['sort'] )
+ {
+ if ( isset( $columns[ $this->trellis->user['sort_tm'] ] ) ) $this->trellis->input['sort'] = $this->trellis->user['sort_tm'];
+ }
+
+ $column_sort = array( 'reply', 'date', 'mask', 'replystaff', 'subject', 'priority', 'department', 'mname', 'lastuname', 'email', 'status', 'replies' );
+
+ for ( $i = 0; ! $this->trellis->input['sort'] && $i < count( $column_sort ); $i++ )
+ {
+ if ( $columns[ $column_sort[ $i ] ] ) $this->trellis->input['sort'] = $column_sort[ $i ];
+ }
+
+ if ( ! $this->trellis->input['sort'] ) $this->trellis->input['sort'] = 'id';
+
+ if ( ! $this->trellis->input['order'] )
+ {
+ ( $this->trellis->user['order_tm'] ) ? $this->trellis->input['order'] = 'desc' : $this->trellis->input['order'] = 'asc';
+ }
+
+ #=============================
+ # Sort
+ #=============================
+
+ foreach( $columns as $name => $width )
+ {
+ if ( $name == $this->trellis->input['sort'] )
+ {
+ if ( $this->trellis->input['order'] == 'desc' )
+ {
+ $link_order = 'asc';
+ $img_order = '&nbsp;<img src="<! IMG_DIR !>/arrow_up.gif" alt="{lang.up}" />';
+ $sql_order = 'desc';
+ }
+ else
+ {
+ $link_order = 'desc';
+ $img_order = '&nbsp;<img src="<! IMG_DIR !>/arrow_down.gif" alt="{lang.down}" />';
+ $sql_order = 'asc';
+ }
+
+ if ( $name == 'department' )
+ {
+ $sql_sort_table = 'd';
+ $sql_sort_field = 'name';
+ }
+ elseif ( $name == 'priority' )
+ {
+ $sql_sort_table = 'p';
+ $sql_sort_field = 'position';
+ }
+ elseif ( $name == 'reply' )
+ {
+ $sql_sort_table = 't';
+ $sql_sort_field = 'last_reply';
+ }
+ elseif ( $name == 'replystaff' )
+ {
+ $sql_sort_table = 't';
+ $sql_sort_field = 'last_reply_staff';
+ }
+ elseif ( $name == 'lastuname' )
+ {
+ $sql_sort_table = 'ulr';
+ $sql_sort_field = 'name';
+ }
+ elseif ( $name == 'status' )
+ {
+ $sql_sort_table = 's';
+ $sql_sort_field = 'name_staff';
+ }
+ elseif ( $name == 'submitter' )
+ {
+ $sql_sort_table = 'u';
+ $sql_sort_field = 'name';
+ }
+ elseif ( strpos( $name, 'cfd' ) === 0 || strpos( $name, 'cfp' ) === 0 )
+ {
+ $sql_sort_table = $name;
+ $sql_sort_field = 'data';
+ }
+ else
+ {
+ $sql_sort_table = 't';
+ $sql_sort_field = $name;
+ }
+ }
+ else
+ {
+ $link_order = 'asc';
+ $img_order = '';
+ }
+
+ if ( $name == 'department' )
+ {
+ $sql_columns[] = 'did';
+ $sql_select['d'] = array( array( 'name' => 'dname' ) );
+
+ $sql_join[] = array( 'from' => array( 'd' => 'departments' ), 'where' => array( 't' => 'did', '=', 'd' => 'id' ) );
+ }
+ elseif ( $name == 'priority' )
+ {
+ $sql_columns[] = 'priority';
+ $sql_select['p'] = array( array( 'name' => 'pname' ), 'icon_regular', 'icon_assigned' );
+
+ $sql_join[] = array( 'from' => array( 'p' => 'priorities' ), 'where' => array( 't' => 'priority', '=', 'p' => 'id' ) );
+ }
+ elseif ( $name == 'status' )
+ {
+ $sql_columns[] = 'status';
+ $sql_select['s'] = array( 'name_staff', 'abbr_staff' );
+
+ $sql_join[] = array( 'from' => array( 's' => 'statuses' ), 'where' => array( 't' => 'status', '=', 's' => 'id' ) );
+ }
+ elseif ( $name == 'submitter' )
+ {
+ $sql_select['u'][] = array( 'name' => 'uname' );
+ $sql_select['g'][] = 'gname';
+ $sql_columns[] = 'email';
+
+ $sql_join[] = array( 'from' => array( 'g' => 'tickets_guests' ), 'where' => array( 't' => 'id', '=', 'g' => 'id' ) );
+
+ if ( ! $user_table_join )
+ {
+ $sql_join[] = array( 'from' => array( 'u' => 'users' ), 'where' => array( 't' => 'uid', '=', 'u' => 'id' ) );
+
+ $sql_columns[] = 'uid';
+ }
+
+ $user_table_join = 1;
+ }
+ elseif ( $name == 'lastuname' )
+ {
+ $sql_select['ulr'] = array( array( 'name' => 'last_uname' ) );
+ $sql_select['g'][] = 'gname';
+ $sql_columns[] = 'email';
+
+ $sql_join[] = array( 'from' => array( 'g' => 'tickets_guests' ), 'where' => array( 't' => 'id', '=', 'g' => 'id' ) );
+ $sql_join[] = array( 'from' => array( 'ulr' => 'users' ), 'where' => array( 't' => 'last_uid', '=', 'ulr' => 'id' ) );
+
+ $sql_columns[] = 'last_uid';
+ }
+ elseif ( $name == 'uemail' )
+ {
+ $sql_select['u'][] = array( 'email' => 'uemail' );
+
+ if ( ! $user_table_join )
+ {
+ $sql_join[] = array( 'from' => array( 'u' => 'users' ), 'where' => array( 't' => 'uid', '=', 'u' => 'id' ) );
+
+ $sql_columns[] = 'uid';
+ }
+
+ $user_table_join = 1;
+ }
+ elseif ( strpos( $name, 'cfd' ) === 0 )
+ {
+ $sql_select[ $name ] = array( array( 'data' => $name ) );
+
+ $sql_join[] = array( 'from' => array( $name => 'depart_fields_data' ), 'where' => array( array( 't' => 'id', '=', $name => 'tid' ), array( $name => 'fid', '=', substr( $name, 3 ) ) ) );
+ }
+ elseif ( strpos( $name, 'cfp' ) === 0 )
+ {
+ $sql_select[ $name ] = array( array( 'data' => $name ) );
+
+ $sql_join[] = array( 'from' => array( $name => 'profile_fields_data' ), 'where' => array( array( 't' => 'uid', '=', $name => 'uid' ), array( $name => 'fid', '=', substr( $name, 3 ) ) ) );
+ }
+ else
+ {
+ if ( $name == 'reply' )
+ {
+ $name = 'last_reply';
+ }
+ elseif ( $name == 'replystaff' )
+ {
+ $name = 'last_reply_staff';
+ }
+
+ $sql_columns[] = $name;
+ }
+ }
+
+ #=============================
+ # Filter
+ #=============================
+
+ if ( ! $this->trellis->input['cf'] )
+ {
+ if ( ! is_array( $this->trellis->input['fstatus'] ) )
+ {
+ $this->trellis->input['fstatus'] = unserialize( $this->trellis->user['dfilters_status'] );
+ }
+
+ if ( ! is_array( $this->trellis->input['fdepart'] ) )
+ {
+ $this->trellis->input['fdepart'] = unserialize( $this->trellis->user['dfilters_depart'] );
+ }
+
+ if ( ! is_array( $this->trellis->input['fpriority'] ) )
+ {
+ $this->trellis->input['fpriority'] = unserialize( $this->trellis->user['dfilters_priority'] );
+ }
+
+ if ( ! is_array( $this->trellis->input['fflag'] ) )
+ {
+ $this->trellis->input['fflag'] = unserialize( $this->trellis->user['dfilters_flag'] );
+ }
+
+ if ( ! $this->trellis->input['assigned'] && $this->trellis->user['dfilters_assigned'] ) $this->trellis->input['assigned'] = $this->trellis->user['id'];
+ }
+
+ $filters = array();
+ $sql_where = array();
+
+ $sql_select['a'] = array( array( 'uid' => 'auid' ) ); // Get Assigned
+
+ if ( $this->trellis->input['assigned'] )
+ {
+ $sql_join[] = array( 'from' => array( 'a' => 'assign_map' ), 'where' => array( array( 't' => 'id', '=', 'a' => 'tid' ), array( $this->trellis->input['assigned'], '=', 'a' => 'uid', 'and' ) ) );
+
+ $filters[] = array( array( 'a' => 'uid' ), '=', $this->trellis->input['assigned'] );
+ }
+ else
+ {
+ $sql_join[] = array( 'from' => array( 'a' => 'assign_map' ), 'where' => array( array( 't' => 'id', '=', 'a' => 'tid' ), array( $this->trellis->user['id'], '=', 'a' => 'uid', 'and' ) ) );
+ }
+
+ if ( is_array( $this->trellis->input['fstatus'] ) )
+ {
+ $filters[] = array( array( 't' => 'status' ), 'in', $this->trellis->input['fstatus'] );
+ }
+
+ if ( is_array( $this->trellis->input['fdepart'] ) )
+ {
+ $filters[] = array( array( 't' => 'did' ), 'in', $this->trellis->input['fdepart'] );
+ }
+
+ if ( is_array( $this->trellis->input['fpriority'] ) )
+ {
+ $filters[] = array( array( 't' => 'priority' ), 'in', $this->trellis->input['fpriority'] );
+ }
+
+ if ( is_array( $this->trellis->input['fflag'] ) )
+ {
+ foreach ( $this->trellis->input['fflag'] as $fid => $ff )
+ {
+ $sql_join[] = array( 'from' => array( 'f'. $fid => 'flags_map' ), 'where' => array( array( 't' => 'id', '=', 'f'. $fid => 'tid' ), array( $ff, '=', 'f'. $fid => 'fid', 'and' ) ) );
+
+ $filters[] = array( array( 'f'. $fid => 'fid' ), '=', $ff );
+ }
+ }
+
+ #=============================
+ # Permissions
+ #=============================
+
+ if ( $this->trellis->user['id'] != 1 )
+ {
+ $perms = array();
+
+ if( is_array( $this->trellis->user['g_acp_depart_perm'] ) )
+ {
+ foreach( $this->trellis->user['g_acp_depart_perm'] as $did => $dperm )
+ {
+ if ( $dperm['v'] ) $perms[] = $did;
+ }
+ }
+
+ if ( empty( $perms ) ) $perms[] = 0;
+
+ $filters[] = array( array( array( 't' => 'did' ), 'in', $perms ), array( array( 'a' => 'uid' ), '=', $this->trellis->user['id'], 'or' ) );
+ }
+
+ #=============================
+ # Grab Tickets
+ #=============================
+
+ foreach( $filters as $fdata )
+ {
+ if ( ! empty( $sql_where ) ) $fdata[] = 'and';
+
+ $sql_where[] = $fdata;
+ }
+
+ $sql_columns[] = 'escalated';
+
+ if ( ! in_array( 'id', $sql_columns ) ) $sql_columns[] = 'id';
+
+ // Tracking
+ if ( $this->trellis->cache->data['settings']['ticket']['track'] )
+ {
+ $sql_columns[] = 'last_reply_all';
+ $sql_select['tt'] = array( array( 'date' => 'track_date' ) );
+ $sql_join[] = array( 'from' => array( 'tt' => 'tickets_track' ), 'where' => array( array( 'tt' => 'uid', '=', $this->trellis->user['id'] ), array( 'tt' => 'tid', '=', 't' => 'id', 'and' ) ) );
+ }
+
+ $sql_select['t'] = $sql_columns;
+
+ $ticket_rows = '';
+
+ $tickets = $this->trellis->func->tickets->get( array(
+ 'select' => $sql_select,
+ 'from' => array( 't' => 'tickets' ),
+ 'join' => $sql_join,
+ 'where' => $sql_where,
+ 'order' => array( $sql_sort_field => array( $sql_sort_table => $sql_order ) ),
+ 'limit' => array( $this->trellis->input['st'], 8 ),
+ ) );
+
+ if ( count( $tickets ) && $this->trellis->input['field'] == 'id' )
+ {
+ $this->trellis->input['id'] = $tickets[0]['id'];
+
+ $this->show_ticket();
+ }
+
+ if ( count( $tickets ) == 1 && $this->trellis->input['field'] == 'mask' )
+ {
+ $this->trellis->input['id'] = $tickets[0]['id'];
+
+ $this->show_ticket();
+ }
+
+ if ( ! $tickets )
+ {
+ $ticket_rows .= "<tr><td class='bluecell-light' colspan='". ( count( $columns ) + 1 ) ."'><strong><a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;act=add'>{lang.no_tickets}</a></strong></td></tr>";
+ }
+ else
+ {
+ foreach( $tickets as $t )
+ {
+ if ( $t['date'] ) $t['date'] = $this->trellis->td_timestamp( array( 'time' => $t['date'], 'format' => 'short' ) );
+ if ( $t['last_reply'] ) $t['last_reply'] = $this->trellis->td_timestamp( array( 'time' => $t['last_reply'], 'format' => 'short' ) );
+ ( $t['last_reply_staff'] ) ? $t['last_reply_staff'] = $this->trellis->td_timestamp( array( 'time' => $t['last_reply_staff'], 'format' => 'short' ) ) : $t['last_reply_staff'] = '';
+
+ if ( $t['uname'] ) $t['uname'] = "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=users&amp;act=view&amp;id={$t['uid']}'>{$t['uname']}</a>";
+ if ( $t['gname'] ) $t['uname'] = "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;search=". urlencode( $t['email'] ) ."&amp;field=email'>{$t['gname']} ({lang.guest})</a>";
+ if ( $t['last_uname'] ) $t['last_uname'] = "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=users&amp;act=view&amp;id={$t['last_uid']}'>{$t['last_uname']}</a>";
+ if ( isset( $t['last_uid'] ) && ! $t['last_uid'] ) $t['last_uname'] = "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;search=". urlencode( $t['email'] ) ."&amp;field=email'>{$t['gname']} ({lang.guest})</a>";
+
+ if ( $t['email'] ) $t['email'] = "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;search=". urlencode( $t['email'] ) ."&amp;field=email'>{$t['email']}</a>";
+ if ( $t['uemail'] ) $t['uemail'] = "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;search=". urlencode( $t['uemail'] ) ."&amp;field=uemail'>{$t['uemail']}</a>";
+
+ if ( $t['dname'] ) $t['dname'] = "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;fdepart[]={$t['did']}'>{$t['dname']}</a>";
+
+ $ticket_rows .= "<tr>";
+
+ foreach( $columns as $name => $width )
+ {
+ if ( $name == 'department' )
+ {
+ $name = 'dname';
+ }
+ elseif ( $name == 'priority' )
+ {
+ $name = 'pname';
+ }
+ elseif ( $name == 'reply' )
+ {
+ $name = 'last_reply';
+ }
+ elseif ( $name == 'replystaff' )
+ {
+ $name = 'last_reply_staff';
+ }
+ elseif ( $name == 'submitter' )
+ {
+ $name = 'uname';
+ }
+ elseif ( $name == 'lastuname' )
+ {
+ $name = 'last_uname';
+ }
+ elseif ( $name == 'status' )
+ {
+ ( $t['abbr_staff'] ) ? $name = 'abbr_staff' : $name = 'name_staff';
+ }
+
+ ( in_array( $name, $dark_columns ) ) ? $dark = 1 : $dark = 0;
+ ( in_array( $name, $normal_columns ) ) ? $normal = 1 : $normal = 0;
+
+ $ticket_rows .= "<td class='bluecellthin-";
+
+ if ( $dark )
+ {
+ $ticket_rows .= "dark";
+ }
+ else
+ {
+ $ticket_rows .= "light";
+ }
+
+ $ticket_rows .= "'";
+
+ if ( $normal ) $ticket_rows .= " style='font-weight: normal'";
+
+ $ticket_rows .= ">";
+
+ if ( $name == 'id' || $name == 'mask' ) $ticket_rows .= "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;act=view&amp;id={$t['id']}'>";
+
+ if ( $name == 'id' ) $ticket_rows .= "<strong>";
+
+ if ( $name == 'subject' )
+ {
+ if ( $this->trellis->cache->data['settings']['ticket']['track'] && ( $t['track_date'] < $t['last_reply_all'] ) ) $ticket_rows .= "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;act=view&amp;id={$t['id']}#unread'><img src='<! IMG_DIR !>/icons/balloon_small.png' alt='*' title='{lang.unread}' style='vertical-align:middle;margin-bottom:2px' /></a>&nbsp;"; // NULL < 0
+ $ticket_rows .= "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;act=view&amp;id={$t['id']}'>";
+ if ( $t['escalated'] ) $ticket_rows .= "<img src='<! IMG_DIR !>/icons/escalate.png' alt='E' style='vertical-align:middle;margin-bottom:2px' />&nbsp;";
+ }
+
+ if ( $name == 'pname' )
+ {
+ if ( $t['auid'] == $this->trellis->user['id'] )
+ {
+ $ticket_rows .= "<img src='<! TD_URL !>/images/priorities/{$t['icon_assigned']}' alt='{$t['pname']}' class='prioritybox' />&nbsp;&nbsp;";
+ }
+ else
+ {
+ $ticket_rows .= "<img src='<! TD_URL !>/images/priorities/{$t['icon_regular']}' alt='{$t['pname']}' class='prioritybox' />&nbsp;&nbsp;";
+ }
+
+ $ticket_rows .= "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;fpriority[]={$t['priority']}'>";
+ }
+
+ if ( $name == 'abbr_staff' || $name == 'name_staff' ) $ticket_rows .= "<a href='<! TD_URL !>/admin.php?section=manage&amp;page=tickets&amp;fstatus[]={$t['status']}'>";
+
+ if ( strpos( $name, 'cfd' ) === 0 || strpos( $name, 'cfp' ) === 0 )
+ {
+ if ( strpos( $name, 'cfd' ) === 0 )
+ {
+ $f = $this->trellis->cache->data['dfields'][ substr( $name, 3 ) ];
+ }
+ elseif ( strpos( $name, 'cfp' ) === 0 )
+ {
+ $f = $this->trellis->cache->data['pfields'][ substr( $name, 3 ) ];
+ }
+
+ if ( $f['type'] == 'dropdown' || $f['type'] == 'radio' )
+ {
+ $f['extra'] = unserialize( $f['extra'] );
+
+ $t[ $name ] = $f['extra'][ $t[ $name ] ];
+ }
+ }
+
+ $ticket_rows .= $t[ $name ];
+
+ if ( $name == 'id' ) $ticket_rows .= "</strong>";
+
+ if ( $name == 'id' || $name == 'subject' ) $ticket_rows .= "</a>";
+
+ $ticket_rows .= "</td>";
+ }
+
+ $ticket_rows .= "</tr>";
+ }
+ }
+
+ #=============================
+ # Grab Logs
+ #=============================
+
+ $this->trellis->db->construct( array(
+ 'select' => array(
+ 'l' => 'all',
+ 'u' => array( array( 'name' => 'uname' ) ),
+ ),
+ 'from' => array( 'l' => 'logs' ),
+ 'join' => array( array( 'from' => array( 'u' => 'users' ), 'where' => array( 'l' => 'uid', '=', 'u' => 'id' ) ) ),
+ 'where' => array( array( 'l' => 'admin' ), '=', 1 ),
+ 'order' => array( 'date' => array( 'l' => 'desc' ), 'id' => array( 'l' => 'desc' ) ),
+ 'limit' => array( 0, 5 ),
+ ) );
+
+ $this->trellis->db->execute();
+
+ $log_rows = "";
+
+ while( $l = $this->trellis->db->fetch_row() )
+ {
+ $l['date'] = $this->trellis->td_timestamp( array( 'time' => $l['date'], 'format' => 'short' ) );
+
+ if ( $l['level'] == 2 )
+ {
+ $fontcolor_start = "<font color='#790000'>";
+ $fontcolor_end = "<font color='#790000'>";
+ }
+ else
+ {
+ $fontcolor_start = "";
+ $fontcolor_end = "";
+ }
+
+ $known_types = array(
+ 'kb' => '{lang.log_type_kb}',
+ 'news' => '{lang.log_type_news}',
+ 'other' => '{lang.log_type_other}',
+ 'security' => '{lang.log_type_security}',
+ 'settings' => '{lang.log_type_settings}',
+ 'ticket' => '{lang.log_type_ticket}',
+ 'user' => '{lang.log_type_user}',
+ );
+
+ $type = ( $known_types[ $l['type'] ] ) ? $known_types[ $l['type'] ] : $l['type'];
+
+ $log_rows .= "<tr>
+ <td class='bluecell-light' width='44%'>{$fontcolor_start}{$l['action']}{$fontcolor_end}</td>
+ <td class='bluecell-light' width='11%'>{$fontcolor_start}{$type}{$fontcolor_end}</td>
+ <td class='bluecell-dark' width='15%' style='font-weight:normal'>{$fontcolor_start}{$l['date']}{$fontcolor_end}</td>
+ <td class='bluecell-light' width='15%'><a href='<! TD_URL !>/admin.php?section=manage&amp;page=users&amp;act=view&amp;id={$l['uid']}'>{$fontcolor_start}{$l['uname']}{$fontcolor_end}</a></td>
+ <td class='bluecell-light' width='15%' style='font-weight:normal'>{$fontcolor_start}{$l['ipadd']}{$fontcolor_end}</td>
+ </tr>";
+ }
+
+ #=============================
+ # Version Check
+ #=============================
+
+ $version_check = $this->trellis->func->admin->version_check();
+
+ if ( $version_check == 1 )
+ {
+ $version_img_url = '<! IMG_DIR !>/vc_update_available.jpg';
+ }
+ elseif ( $version_check == 2 )
+ {
+ $version_img_url = '<! IMG_DIR !>/vc_up_to_date.jpg';
+ }
+ else
+ {
+ $version_img_url = '<! IMG_DIR !>/vc_unable_to_check.jpg';
+ }
+
+ #=============================
+ # Sidebar Menu
+ #=============================
+
+ $mysql_version = mysql_get_server_info();
+
+ if ( strpos( $mysql_version, '-' ) )
+ {
+ $mysql_version = substr( $mysql_version, 0, strpos( $mysql_version, '-' ) );
+ }
+
+ if ( $this->trellis->cache->data['misc']['vcheck_time'] )
+ {
+ $vcheck_date = $this->trellis->td_timestamp( array( 'time' => $this->trellis->cache->data['misc']['vcheck_time'], 'format' => 'date' ) );
+ }
+ else
+ {
+ $vcheck_date = '{lang.check_now}';
+ }
+
+ $system_status_html = "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='blockstatus'>
+ <tr>
+ <td colspan='2' class='statusbadge'><a href='http://www.accord5.com/trellis/latest' target='_blank'><img src='{$version_img_url}' alt='{lang.version_check}' /></a></td>
+ </tr>
+ <tr>
+ <td class='statusleft'><strong>{lang.version_check}</strong></td>
+ <td class='statusright'><a href='<! TD_URL !>/admin.php?section=admin&amp;vcheck=1' title='{lang.check_now}'>". $vcheck_date ."</a></td>
+ </tr>
+ <tr>
+ <td class='statusleft'><strong>{lang.product_version}</strong></td>
+ <td class='statusright'>{$this->trellis->version_short} ({$this->trellis->version_number})</td>
+ </tr>
+ <td class='statusleft'><strong>{lang.php_version}</strong></td>
+ <td class='statusright'>". phpversion() ."</td>
+
+ </tr>
+ <tr>
+ <td class='statusleft'><strong>{lang.mysql_version}</strong></td>
+ <td class='statusright'>". $mysql_version ."</td>
+ </tr>
+ </table>";
+
+ $this->trellis->skin->add_sidebar_block( '{lang.system_status}', $system_status_html );
+
+ $notes_items = array(
+ "<textarea id='notes' name='notes' cols='4' rows='8' style='width:99%' class='notesbox'>{$this->trellis->cache->data['misc']['acp_notes']}</textarea>",
+ "<input name='save_notes' id='save_notes' type='submit' value='{lang.button_save_notes}' class='buttonmini' /> <span id='save_notes_status' class='ajax_update_button'>{lang.saved}</span>",
+ );
+
+ $this->trellis->skin->add_sidebar_list( '{lang.admin_notepad}', $notes_items );
+
+ #=============================
+ # Do Output
+ #=============================
+
+ $acp_content = "<div id='ticketroll'>
+ <div class='orangebox'>{lang.common_acp_sections}</div>
+ <div class='rolldefault'>
+ <table width='100%' cellspacing='0' cellpadding='0'>
+ <tr>
+ <td class='orangecell-light' width='25%'><a href='<! TD_URL !>/admin.php?section=manage'><img src='<! IMG_DIR !>/icons/buoy.png' width='16' height='16' alt='{lang.tickets}' />{lang.tickets}</a></td>
+ <td class='orangecell-dark' width='25%'><a href='<! TD_URL !>/admin.php?section=manage&amp;page=news'><img src='<! IMG_DIR !>/icons/balloon.png' width='16' height='16' alt='{lang.news}' />{lang.news}</a></td>
+ <td class='orangecell-light' width='25%'><a href='<! TD_URL !>/admin.php?section=look'><img src='<! IMG_DIR !>/icons/color.png' width='16' height='16' alt='{lang.skins}' />{lang.skins}</a></td>
+ <td class='orangecell-dark' width='25%'><a href='<! TD_URL !>/admin.php?section=tools'><img src='<! IMG_DIR !>/icons/settings.png' width='16' height='16' alt='{lang.settings}' />{lang.settings}</a></td>
+ </tr>
+ <tr>
+ <td class='orangecell-light' width='25%'><a href='<! TD_URL !>/admin.php?section=manage&amp;page=users'><img src='<! IMG_DIR !>/icons/addressbook.png' width='16' height='16' alt='{lang.users}' />{lang.users}</a></td>
+ <td class='orangecell-dark' width='25%'><a href='<! TD_URL !>/admin.php?section=manage&amp;page=articles'><img src='<! IMG_DIR !>/icons/book.png' width='16' height='16' alt='{lang.kb_articles}' />{lang.kb_articles}</a></td>
+ <td class='orangecell-light' width='25%'><a href='<! TD_URL !>/admin.php?section=look&amp;page=langs'><img src='<! IMG_DIR !>/icons/alphabet.png' width='16' height='16' alt='{lang.languages}' />{lang.languages}</a></td>
+ <td class='orangecell-dark' width='25%'><a href='http://docs.accord5.com/' target='_blank'><img src='<! IMG_DIR !>/icons/question.png' width='16' height='16' alt='{lang.documentation}' />{lang.documentation}</a></td>
+ </tr>
+ </table>
+ </div>
+ <div class='groupbox'><a href='<! TD_URL !>/admin.php?section=manage'>{lang.recent_tickets}</a></div>
+ <div class='rolldefault'>
+ <table width='100%' cellpadding='0' cellspacing='0'>
+ ". $ticket_rows ."
+ </table>
+ </div>
+
+ <div class='groupbox'><a href='<! TD_URL !>/admin.php?section=tools&amp;page=logs'>{lang.recent_acp_actions}</a></div>
+ <div class='rolldefault'>
+ <table width='100%' cellpadding='0' cellspacing='0'>
+ ". $log_rows ."
+ </table>
+ </div>
+ </div>
+ <script type='text/javascript'>
+ //<![CDATA[
+ $('#save_notes').bind('click', function () {
+ $.post('admin.php?section=admin&act=donotes',
+ { notes: $('#notes').val() },
+ function(data) {
+ if (data != 0) $('#save_notes_status').stop(true).fadeIn().animate({opacity: 1.0}, {duration: 2000}).fadeOut('slow');
+ });
+ });
+ //]]>
+ </script>";
+
+ $this->trellis->skin->add_sidebar_help( '{lang.td_latest_news}', '{lang.td_latest_news_msg}' );
+
+ $this->trellis->skin->add_output( $acp_content );
+
+ $this->trellis->skin->do_output( array( 'title' => 'System Overview' ) );
+ }
+
+ #=======================================
+ # @ AJAX Save Notes
+ #=======================================
+
+ function ajax_save_notes()
+ {
+ $this->trellis->cache->add( 'misc', array( 'acp_notes' => $this->trellis->input['notes'] ) );
+
+ $this->trellis->skin->ajax_output( '1' );
+ }
+
+}
+
+?>
287 admin/admin/ad_settings.php
@@ -0,0 +1,287 @@
+<?php
+
+/**
+ * Trellis Desk
+ *
+ * @copyright Copyright (C) 2009-2011 ACCORD5. All rights reserved.
+ * @license GNU General Public License version 3 or later; see LICENSE.txt
+ */
+
+class td_ad_settings {
+
+ private $output = "";
+
+ #=======================================
+ # @ Auto Run
+ #=======================================
+
+ public function auto_run()
+ {
+ $this->trellis->load_lang('settings');
+
+ $this->trellis->skin->set_active_link( 1 );
+
+ switch( $this->trellis->input['act'] )
+ {
+ case 'edit':
+ $this->edit_settings();
+ break;
+
+ case 'doedit':
+ $this->do_edit();
+ break;
+
+ default:
+ $this->edit_settings();
+ break;
+ }
+ }
+
+ #=======================================
+ # @ Edit Settings
+ #=======================================
+
+ private function edit_settings()
+ {
+ #=============================
+ # Do Output
+ #=============================
+
+ if ( $this->trellis->user['rte_enable'] && $this->trellis->cache->data['settings']['ticket']['rte'] )
+ {
+ $this->output .= $this->trellis->skin->tinymce_js( 'signature' );
+
+ $sig_html = 1;
+ }
+ else
+ {
+ $sig_html = 0;
+ }
+
+ $this->trellis->load_functions('drop_downs');
+
+ $this->output .= "<div id='ticketroll'>
+ ". $this->trellis->skin->start_form( "<! TD_URL !>/admin.php?section=admin&amp;page=settings&amp;act=doedit", 'edit_settings', 'post' ) ."
+ <input type='hidden' id='sig_html' name='sig_html' value='{$sig_html}' />
+ ". $this->trellis->skin->start_group_table( '{lang.my_acp_settings}', 'a' ) ."
+ ". $this->trellis->skin->group_table_row( 'Paint It Black', $this->trellis->skin->yes_no_radio( 'paint_it_black' ),'a','25%','75%' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.time_zone}', "<select name='time_zone' id='time_zone'>". $this->trellis->func->drop_downs->time_zone_drop( $this->trellis->user['time_zone'] ) ."</select>", 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.dst}', $this->trellis->skin->custom_radio( 'time_dst', array( 0 => '{lang.inactive}', 1 => '{lang.active}', 2 => '{lang.auto}' ), $this->trellis->user['time_dst'] ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.language}', "<select name='lang' id='lang'>". $this->trellis->func->drop_downs->lang_drop( $this->trellis->user['lang'] ) ."</select>", 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.rich_text_editor}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'rte_enable', 'value' => $this->trellis->user['rte_enable'] ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_sub( '{lang.ticket_column_layout}' );
+
+ $columns = unserialize( $this->trellis->user['columns_tm'] );
+
+ $lang_columns = array(
+ 'id' => '{lang.id}',
+ 'mask' => '{lang.mask}',
+ 'subject' => '{lang.subject}',
+ 'priority' => '{lang.priority}',
+ 'department' => '{lang.department}',
+ 'date' => '{lang.submitted}',
+ 'reply' => '{lang.last_reply}',
+ 'replystaff' => '{lang.last_staff_reply}',
+ 'lastuname' => '{lang.last_replier}',
+ 'submitter' => '{lang.submitter}',
+ 'email' => '{lang.ticket_email}',
+ 'uemail' => '{lang.user_email}',
+ 'replies' => '{lang.replies}',
+ 'status' => '{lang.status}',
+ );
+
+ foreach( $this->trellis->cache->data['dfields'] as $cf )
+ {
+ if ( $cf['type'] != 'checkbox' ) $lang_columns[ 'cfd'. $cf['id'] ] = $cf['name'];
+ }
+
+ foreach( $this->trellis->cache->data['pfields'] as $cf )
+ {
+ if ( $cf['type'] != 'checkbox' ) $lang_columns[ 'cfp'. $cf['id'] ] = $cf['name'];
+ }
+
+ $columns_current = '';
+ $columns_available = '';
+ $cc_empty = '';
+ $ca_empty = '';
+
+ if ( empty( $columns ) )
+ {
+ $cc_empty = " style='height:10px'";
+ }
+ else
+ {
+ foreach( $columns as $key => $width )
+ {
+ ( $this->trellis->user['sort_tm'] == $key ) ? $stm_radio = " checked='checked'" : $stm_radio = "";
+
+ $columns_current .= "<li id='c_". $key ."'>". $lang_columns[ $key ] ."<input type='text' id='cw_". $key ."' name='cw_". $key ."' value='". $width ."' size='3' style='float:right;margin-left:10px;text-align:right' /><input type='radio' id='sort_tm_". $key ."' name='sort_tm' value='". $key ."'". $stm_radio ." style='float:right;margin-top:5px;margin-left:10px;' /></li>";
+
+ unset( $lang_columns[ $key ] );
+ }
+ }
+
+ if ( empty( $lang_columns ) )
+ {
+ $ca_empty = " style='height:10px'";
+ }
+ else
+ {
+ foreach( $lang_columns as $key => $name )
+ {
+ $columns_available .= "<li id='c_". $key ."'>". $name ."<input type='text' id='cw_". $key ."' name='cw_". $key ."' value='". $columns[ $key ] ."' size='3' style='float:right;margin-left:10px;text-align:right' /><input type='radio' id='sort_tm_". $key ."' name='sort_tm' value='". $key ."' style='float:right;margin-top:5px;margin-left:10px;' /></li>";
+ }
+ }
+
+ $column_layout .= "<div style='width:49%;float:left'>
+ <fieldset>
+ <legend>{lang.current_columns}</legend>
+ <input type='hidden' id='cc_serialized' name='cc_serialized' value='' />
+ <ul id='columns_current' class='colblocks'{$cc_empty}>{$columns_current}</ul>
+ </fieldset>
+ </div>
+ <div style='width:49%;float:right'>
+ <fieldset>
+ <legend>{lang.available_columns}</legend>
+ <input type='hidden' id='ac_serialized' name='ac_serialized' value='' />
+ <ul id='columns_available' class='colblocks'{$cc_empty}>{$columns_available}</ul>
+ </fieldset>
+ </div>";
+
+ $this->output .= $this->trellis->skin->group_table_full_row( $column_layout ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.default_sort_order}', $this->trellis->skin->custom_radio( array( 'name' => 'order_tm', 'options' => array( 0 => '{lang.ascending}', 1 => '{lang.descending}' ), 'value' => $this->trellis->user['order_tm'] ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_sub( '{lang.staff_email_preferences}' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_notifications}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_enable', 'value' => $this->trellis->user['email_staff_enable'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['enable'], 'for' => 1, 'msg' => '{lang.warn_email_enable}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_user_approve}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_user_approve', 'value' => $this->trellis->user['email_staff_user_approve'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['user_approve'], 'for' => 1, 'msg' => '{lang.warn_email_user_approve}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_ticket}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_ticket', 'value' => $this->trellis->user['email_staff_ticket'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['ticket'], 'for' => 1, 'msg' => '{lang.warn_email_ticket}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_reply}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_reply', 'value' => $this->trellis->user['email_staff_reply'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['reply'], 'for' => 1, 'msg' => '{lang.warn_email_reply}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_assign}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_assign', 'value' => $this->trellis->user['email_staff_assign'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['assign'], 'for' => 1, 'msg' => '{lang.warn_email_assign}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_escalate}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_escalate', 'value' => $this->trellis->user['email_staff_escalate'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['escalate'], 'for' => 1, 'msg' => '{lang.warn_email_escalate}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_hold}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_hold', 'value' => $this->trellis->user['email_staff_hold'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['hold'], 'for' => 1, 'msg' => '{lang.warn_email_hold}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_move_to}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_move_to', 'value' => $this->trellis->user['email_staff_move_to'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['move_to'], 'for' => 1, 'msg' => '{lang.warn_email_move_to}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_move_away}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_move_away', 'value' => $this->trellis->user['email_staff_move_away'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['move_away'], 'for' => 1, 'msg' => '{lang.warn_email_move_away}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_close}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_close', 'value' => $this->trellis->user['email_staff_close'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['close'], 'for' => 1, 'msg' => '{lang.warn_email_close}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_reopen}', $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'email_staff_reopen', 'value' => $this->trellis->user['email_staff_reopen'], 'alert' => array( 'check' => $this->trellis->cache->data['settings']['esnotify']['reopen'], 'for' => 1, 'msg' => '{lang.warn_email_reopen}' ) ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.receive_for}', $this->trellis->skin->checkbox( array( 'name' => 'esn_unassigned', 'title' => '{lang.unassigned_tickets}', 'value' => $this->trellis->user['esn_unassigned'] ) ) ."<br />". $this->trellis->skin->checkbox( array( 'name' => 'esn_assigned', 'title' => '{lang.assigned_tickets}', 'value' => $this->trellis->user['esn_assigned'] ) ) ."<br />". $this->trellis->skin->checkbox( array( 'name' => 'esn_assigned_to_me', 'title' => '{lang.tickets_assigned_to_me}', 'value' => $this->trellis->user['esn_assigned_to_me'] ) ), 'a' ) ."
+ ". $this->trellis->skin->group_table_sub( '{lang.email_preferences}' ) ."
+ ". $this->trellis->skin->group_table_row( '{lang.email_type}', $this->trellis->skin->custom_radio( 'email_type', array( 1 => '{lang.html}', 2 => '{lang.plain_text}' ), $this->trellis->user['email_type'] ), 'a' ) ."
+ ". $this->trellis->skin->group_table_sub( '{lang.ticket_preferences}' ) ."
+ ". $this->trellis->skin->end_group_table() ."
+ ". $this->trellis->skin->group_row( $this->trellis->skin->checkbox( 'auto_assign', '{lang.auto_assign}', $this->trellis->user['auto_assign'] ), 'a' ) ."
+ ". $this->trellis->skin->group_row( $this->trellis->skin->checkbox( 'dfilters_assigned', '{lang.dfilters_assigned}', $this->trellis->user['dfilters_assigned'] ), 'a' ) ."
+ ". $this->trellis->skin->group_title( '{lang.my_signature}' ) ."
+ ". $this->trellis->skin->group_row( $this->trellis->skin->textarea( array( 'name' => 'signature', 'value' => $this->trellis->user['signature'], 'cols' => 80, 'rows' => 6, 'width' => '98%', 'height' => '160px' ) ), 'a' ) ."
+ ". $this->trellis->skin->group_row( $this->trellis->skin->checkbox( 'sig_auto', '{lang.auto_append_sig}', $this->trellis->user['sig_auto'] ), 'a' ) ."
+ ". $this->trellis->skin->end_form( $this->trellis->skin->submit_button( 'edit', '{lang.button_edit_settings}' ) ) ."
+ </div>";
+
+ $this->trellis->skin->end_group( 'a' );
+
+ $this->output .= "<script type='text/javascript'>
+ $('#columns_current, #columns_available').sortable({
+ connectWith: '.colblocks',
+ stop: function() { $('#cc_serialized').val( $('#columns_current').sortable('serialize') ); }
+ });
+ $('#cc_serialized').val( $('#columns_current').sortable('serialize') );
+ </script>";
+
+ $this->trellis->skin->add_sidebar_general( '{lang.hey_you_title}', '{lang.hey_you_msg}' );
+
+ $this->trellis->skin->add_output( $this->output );
+
+ $this->trellis->skin->do_output();
+ }
+
+ #=======================================
+ # @ Do Edit Settings
+ #=======================================
+
+ private function do_edit()
+ {
+ #=============================
+ # Update User
+ #=============================
+
+ $db_array = array(
+ 'signature' => $this->trellis->input['signature'],
+ 'sig_html' => $this->trellis->input['sig_html'],
+ 'sig_auto' => $this->trellis->input['sig_auto'],
+ 'lang' => $this->trellis->input['lang'],
+ 'time_zone' => $this->trellis->input['time_zone'],
+ 'time_dst' => $this->trellis->input['time_dst'],
+ 'rte_enable' => $this->trellis->input['rte_enable'],
+ 'email_type' => $this->trellis->input['email_type'],
+ );
+
+ $this->trellis->db->construct( array(
+ 'update' => 'users',
+ 'set' => $db_array,
+ 'where' => array( 'id', '=', $this->trellis->user['id'] ),
+ 'limit' => array( 1 ),
+ ) );
+
+ $this->trellis->db->execute();
+
+ $db_array_old = $db_array;
+
+ $db_array = array(
+ 'email_staff_enable' => $this->trellis->input['email_staff_enable'],
+ 'email_staff_user_approve' => $this->trellis->input['email_staff_user_approve'],
+ 'email_staff_ticket' => $this->trellis->input['email_staff_ticket'],
+ 'email_staff_reply' => $this->trellis->input['email_staff_reply'],
+ 'email_staff_assign' => $this->trellis->input['email_staff_assign'],
+ 'email_staff_escalate' => $this->trellis->input['email_staff_escalate'],
+ 'email_staff_hold' => $this->trellis->input['email_staff_hold'],
+ 'email_staff_move_to' => $this->trellis->input['email_staff_move_to'],
+ 'email_staff_move_away' => $this->trellis->input['email_staff_move_away'],
+ 'email_staff_close' => $this->trellis->input['email_staff_close'],
+ 'email_staff_reopen' => $this->trellis->input['email_staff_reopen'],
+ 'esn_unassigned' => $this->trellis->input['esn_unassigned'],
+ 'esn_assigned' => $this->trellis->input['esn_assigned'],
+ 'esn_assigned_to_me' => $this->trellis->input['esn_assigned_to_me'],
+ 'sort_tm' => $this->trellis->input['sort_tm'],
+ 'order_tm' => $this->trellis->input['order_tm'],
+ 'dfilters_assigned' => $this->trellis->input['dfilters_assigned'],
+ 'auto_assign' => $this->trellis->input['auto_assign'],
+ );
+
+ parse_str( str_replace( '&amp;', '&', $this->trellis->input['cc_serialized'] ), $order );
+
+ if ( ! empty( $order['c'] ) )
+ {
+ $columns = array();
+
+ foreach( $order['c'] as $column )
+ {
+ $columns[ $column ] = $this->trellis->input[ 'cw_'. $column ];
+ }
+
+ $db_array['columns_tm'] = serialize( $columns );
+ }
+
+ $this->trellis->db->construct( array(
+ 'update' => 'users_staff',
+ 'set' => $db_array,
+ 'where' => array( 'uid', '=', $this->trellis->user['id'] ),
+ 'limit' => array( 1 ),
+ ) );
+
+ $this->trellis->db->execute();
+
+ $this->trellis->log( array( 'msg' => 'acpset_updated', 'type' => 'other' ) );
+
+ $this->trellis->user = array_merge( $this->trellis->user, $db_array );
+ $this->trellis->user = array_merge( $this->trellis->user, $db_array_old );
+
+ #=============================
+ # Redirect
+ #=============================
+
+ $this->trellis->send_message( 'alert', $this->trellis->lang['alert_settings_updated'] );
+
+ $this->trellis->skin->redirect( array( 'act' => null ) );
+ }
+
+}
+
+?>
2  admin/admin/index.html
@@ -0,0 +1,2 @@
+<h1>Oops!</h1>
+<p>You are not allowed to access this directory.</p>
2  admin/index.html
@@ -0,0 +1,2 @@
+<h1>Oops!</h1>
+<p>You are not allowed to access this directory.</p>
263 admin/look/ad_emails.php
@@ -0,0 +1,263 @@
+<?php
+
+/**