see ChangeLog

Monotone-Revision: 9054022ef1ca8aeba6e34842d27d9b94ce002b89

Monotone-Author: dev-unix.inverse.qc.ca
Monotone-Date: 2006-06-15T19:34:10
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
dev-unix.inverse.qc.ca
2006-06-15 19:34:10 +00:00
commit f18c764ffa
965 changed files with 99196 additions and 0 deletions
+482
View File
@@ -0,0 +1,482 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "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
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY 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
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey 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 library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
+4
View File
@@ -0,0 +1,4 @@
Copyright (C) 2004 SKYRIX Software AG
Contact: info@skyrix.com
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,221 @@
/* this file is in UTF-8 format! */
/* Day */
"Sunday" = "Sunday";
"Monday" = "Monday";
"Tuesday" = "Tuesday";
"Wednesday" = "Wednesday";
"Thursday" = "Thursday";
"Friday" = "Friday";
"Saturday" = "Saturday";
"a2_Sunday" = "Su";
"a2_Monday" = "Mo";
"a2_Tuesday" = "Tu";
"a2_Wednesday" = "We";
"a2_Thursday" = "Th";
"a2_Friday" = "Fr";
"a2_Saturday" = "Sa";
"dayLabelFormat" = "%Y-%m-%d";
"today" = "today";
/* Week */
"Week" = "Week";
"this week" = "this week";
/* Month */
"this month" = "this month";
"January" = "January";
"February" = "February";
"March" = "March";
"April" = "April";
"May" = "May";
"June" = "June";
"July" = "July";
"August" = "August";
"September" = "September";
"October" = "October";
"November" = "November";
"December" = "December";
"a3_January" = "Jan";
"a3_February" = "Feb";
"a3_March" = "Mar";
"a3_April" = "Apr";
"a3_May" = "May";
"a3_June" = "Jun";
"a3_July" = "Jul";
"a3_August" = "Aug";
"a3_September" = "Sep";
"a3_October" = "Oct";
"a3_November" = "Nov";
"a3_December" = "Dec";
/* Year */
"this year" = "this year";
/* Menu */
"Calendar" = "Calendar";
"Contacts" = "Contacts";
/* Misc */
"OpenGroupware.org" = "OpenGroupware.org";
"Forbidden" = "Forbidden";
/* Button titles */
"new" = "new";
"printview" = "printview";
"edit" = "edit";
"delete" = "delete";
"proposal" = "proposal";
"Save" = "Save";
"Cancel" = "Cancel";
"show_rejected_apts" = "Show rejected appointments";
"hide_rejected_apts" = "Hide rejected appointments";
/* Schedule */
"Schedule" = "Appointment propositions";
"No appointments found" = "You don't have any appointments in the near future.";
"Meetings proposed by you" = "Meetings proposed by you";
"Meetings proposed to you" = "Meetings proposed to you";
"sched_startDateFormat" = "%d.%m. %H:%M";
"action" = "Action";
"accept" = "Accept";
"decline" = "Decline";
"more participants" = "more participants";
"Hide already accepted and rejected appointments" = "Hide already accepted and rejected appointments";
"Show already accepted and rejected appointments" = "Show already accepted and rejected appointments";
/* Appointments */
"Appointment viewer" = "Appointment Viewer";
"Appointment editor" = "Appointment Editor";
"Appointment proposal" = "Appointment Proposal";
"Appointment on" = "Appointment on";
"Start time" = "Start time";
"End time" = "End time";
"Start date" = "Start date";
"End date" = "End date";
"Earliest start time" = "Earliest start time";
"Latest end time" = "Latest end time";
"browse start date" = "browse start date";
"browse end date" = "browse end date";
"Title" = "Title";
"Name" = "Name";
"Email" = "Email";
"Status" = "Status";
"Location" = "Location";
"Priority" = "Priority";
"Cycle" = "Cycle";
"Cycle End" = "End";
"Categories" = "Categories";
"Classification" = "Classification";
"Duration" = "Duration";
"Participants" = "Participants";
"Resources" = "Resources";
"Organizer" = "Organizer";
"Comment" = "Comment";
"attributes" = "Attributes";
"participants" = "Participants";
/* checkbox title */
"is private" = "is private";
/* classification */
"Public" = "Public";
"Private" = "Private";
/* text used in overviews and tooltips */
"empty title" = "Empty title";
"private appointment" = "Private appointment";
/* Appointments (participation state) */
"partStat_NEEDS-ACTION" = "Not decided, yet";
"partStat_ACCEPTED" = "Accepted";
"partStat_DECLINED" = "Declined";
"partStat_TENTATIVE" = "Tentative";
"partStat_DELEGATED" = "Delegated";
"partStat_OTHER" = "???";
/* Appointments (error messages) */
"Conflicts found!" = "One or more conflicts were found.";
"Invalid iCal data!" = "Invalid iCalendar data ...";
"Could not create iCal data!" = "Could not create iCalendar data ...";
/* Searching */
"Search" = "Search";
"Search participants" = "Search participants";
"Search resources" = "Search resources";
"Search appointments" = "Search appointments";
"Search in Anais" = "Search in Anaïs";
"check for conflicts" = "check for conflicts";
/* calendar modes */
"Overview" = "Overview";
"Chart" = "Chart";
"List" = "List";
"Columns" = "Columns";
/* Priorities */
"prio_0" = "Undefined";
"prio_1" = "High";
"prio_2" = "High";
"prio_3" = "High";
"prio_4" = "High";
"prio_5" = "Normal";
"prio_6" = "Low";
"prio_7" = "Low";
"prio_8" = "Low";
"prio_9" = "Low";
/* Cycles */
"cycle_once" = "once";
"cycle_daily" = "daily";
"cycle_weekly" = "weekly";
"cycle_2weeks" = "all 2 weeks";
"cycle_4weeks" = "all 4 weeks";
"cycle_monthly" = "monthly";
"cycle_weekday" = "weekday";
"cycle_yearly" = "yearly";
"cycle_end_never" = "never";
"cycle_end_until" = "on date";
/* Appointment categories */
"APPOINTMENT" = "Appointment";
"NOT IN OFFICE" = "Outside";
"MEETING" = "Meeting";
"HOLIDAY" = "Holiday";
"PHONE CALL" = "Phone";
/* validation errors */
validate_notitle = "No title is set, continue?";
validate_invalid_startdate = "Incorrect startdate field!";
validate_invalid_enddate = "Incorrect enddate field!";
validate_endbeforestart = "Enddate is before startdate!";
+160
View File
@@ -0,0 +1,160 @@
<!--
Title: Tigra Calendar
Description: See the demo at url
URL: http://www.softcomplex.com/products/tigra_calendar/
Version: 3.1
Date: 08-08-2002 (mm-dd-yyyy)
Feedback: feedback@softcomplex.com (specify product title in the subject)
Note: Permission given to use this script in ANY kind of applications if
header lines are left unchanged.
Note: Script consists of two files: calendar?.js and calendar.html
About us: Our company provides offshore IT consulting services.
Contact us at sales@softcomplex.com if you have any programming task you
want to be handled by professionals. Our typical hourly rate is $20.
modified by Martin Hoerning, mh@skyrix.com, 2002-12-05
-->
<html>
<head>
<title>Select Date, Please.</title>
<style>
td {font-family: Tahoma, Verdana, sans-serif; font-size: 12px;}
</style>
<script language="JavaScript">
// months as they appear in the calendar's title
var ARR_MONTHS = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
// week day titles as they appear on the calendar
var ARR_WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
// day week starts from (normally 0-Mo or 1-Su)
var NUM_WEEKSTART = 1;
// path to the directory where calendar images are stored. trailing slash req.
var STR_ICONPATH = '';
var re_url = new RegExp('datetime=(\\-?\\d+)');
var dt_current = (re_url.exec(String(window.location))
? new Date(new Number(RegExp.$1)) : new Date());
var re_id = new RegExp('id=(\\d+)');
var num_id = (re_id.exec(String(window.location))
? new Number(RegExp.$1) : 0);
var obj_caller = (window.opener ? window.opener.calendars[num_id] : null);
if (obj_caller && obj_caller.year_scroll) {
// get same date in the previous year
var dt_prev_year = new Date(dt_current);
dt_prev_year.setFullYear(dt_prev_year.getFullYear() - 1);
if (dt_prev_year.getDate() != dt_current.getDate())
dt_prev_year.setDate(0);
// get same date in the next year
var dt_next_year = new Date(dt_current);
dt_next_year.setFullYear(dt_next_year.getFullYear() + 1);
if (dt_next_year.getDate() != dt_current.getDate())
dt_next_year.setDate(0);
}
// get same date in the previous month
var dt_prev_month = new Date(dt_current);
dt_prev_month.setMonth(dt_prev_month.getMonth() - 1);
if (dt_prev_month.getDate() != dt_current.getDate())
dt_prev_month.setDate(0);
// get same date in the next month
var dt_next_month = new Date(dt_current);
dt_next_month.setMonth(dt_next_month.getMonth() + 1);
if (dt_next_month.getDate() != dt_current.getDate())
dt_next_month.setDate(0);
// get first day to display in the grid for current month
var dt_firstday = new Date(dt_current);
dt_firstday.setDate(1);
dt_firstday.setDate(1 - (7 + dt_firstday.getDay() - NUM_WEEKSTART) % 7);
// function passing selected date to calling window
function set_datetime(n_datetime, b_close) {
if (!obj_caller) return;
var dt_datetime = new Date(n_datetime);
if (!dt_datetime) {
alert('failed to generate date string');
return;
}
if (b_close) { // only set value when closing window
obj_caller.target.value = (document.cal
? obj_caller.gen_tsmp(dt_datetime)
: obj_caller.gen_date(dt_datetime)
);
}
if (b_close) window.close();
else obj_caller.popup(dt_datetime.valueOf());
}
</script>
</head>
<body bgcolor="#FFFFFF" marginheight="5" marginwidth="5" topmargin="5" leftmargin="5" rightmargin="5">
<table class="clsOTable" cellspacing="0" border="0" width="100%">
<tr><td bgcolor="#E8E8E0">
<table cellspacing="1" cellpadding="3" border="0" width="100%">
<tr><td colspan="7" bgcolor="#D0D0D0"><table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<script language="JavaScript">
document.write(
'<td>'+(obj_caller&&obj_caller.year_scroll?'<a href="javascript:set_datetime('+dt_prev_year.valueOf()+')"><img src="'+STR_ICONPATH+'first.gif" width="15" height="15" border="0" alt="previous year" title="previous year"></a>&nbsp;':'')+'<a href="javascript:set_datetime('+dt_prev_month.valueOf()+')"><img src="'+STR_ICONPATH+'previous.gif" width="15" height="15" border="0" alt="previous month" title="previous month"></a></td>'+
'<td align="center" width="100%"><font color="#000000">'+ARR_MONTHS[dt_current.getMonth()]+' '+dt_current.getFullYear() + '</font></td>'+
'<td><a href="javascript:set_datetime('+dt_next_month.valueOf()+')"><img src="'+STR_ICONPATH+'next.gif" width="15" height="15" border="0" alt="next month" title="next month"></a>'+(obj_caller && obj_caller.year_scroll?'&nbsp;<a href="javascript:set_datetime('+dt_next_year.valueOf()+')"><img src="'+STR_ICONPATH+'last.gif" width="15" height="15" border="0" alt="next year" title="next year"></a>':'')+'</td>'
);
</script>
</tr>
</table></td></tr>
<tr>
<script language="JavaScript">
// print weekdays titles
for (var n=0; n<7; n++)
document.write('<td bgcolor="#D0D0D0" align="center"><font color="#000000">'+ARR_WEEKDAYS[(NUM_WEEKSTART+n)%7]+'</font></td>');
document.write('</tr>');
// print calendar table
var dt_current_day = new Date(dt_firstday);
while (dt_current_day.getMonth() == dt_current.getMonth() ||
dt_current_day.getMonth() == dt_firstday.getMonth()) {
// print row heder
document.write('<tr>');
for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
if (dt_current_day.getDate() == dt_current.getDate() &&
dt_current_day.getMonth() == dt_current.getMonth())
// print current date
document.write('<td bgcolor="#F18D39" align="center" width="14%">');
//else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
else if (dt_current_day.getMonth() != dt_current.getMonth())
// old: weekend days // new: other month
document.write('<td bgcolor="#D0D0D0" align="center" width="14%">');
else
// print working days of current month
document.write('<td bgcolor="#E0E0E0" align="center" width="14%">');
document.write('<a href="javascript:set_datetime('+dt_current_day.valueOf() +', true);">');
if (dt_current_day.getMonth() == this.dt_current.getMonth())
// print days of current month
document.write('<font color="#000000">');
else
// print days of other months
document.write('<font color="#555555">');
document.write(dt_current_day.getDate()+'</font></a></td>');
dt_current_day.setDate(dt_current_day.getDate()+1);
}
// print row footer
document.write('</tr>');
}
//if (obj_caller && obj_caller.time_comp)
// document.write('<form onsubmit="javascript:set_datetime('+dt_current.valueOf()+', true)" name="cal"><tr><td colspan="7" bgcolor="#87CEFA"><font color="White" face="tahoma, verdana" size="2">Time: <input type="text" name="time" value="'+obj_caller.gen_time(this.dt_current)+'" size="8" maxlength="8"></font></td></tr></form>');
</script>
</table></tr></td>
</table>
</body>
</html>
+190
View File
@@ -0,0 +1,190 @@
// Title: Tigra Calendar
// Description: See the demo at url
// URL: http://www.softcomplex.com/products/tigra_calendar/
// Version: 3.1 (European date format)
// Date: 08-08-2002 (mm-dd-yyyy)
// Feedback: feedback@softcomplex.com (specify product title in the subject)
// Note: Permission given to use this script in ANY kind of applications if
// header lines are left unchanged.
// Note: Script consists of two files: calendar?.js and calendar.html
// About us: Our company provides offshore IT consulting services.
// Contact us at sales@softcomplex.com if you have any programming task you
// want to be handled by professionals. Our typical hourly rate is $20.
// modified by Martin Hoerning, mh@skyrix.com, 2002-12-05
// 2003-01-23 added date format support (Martin Hoerning)
// if two digit year input dates after this year considered 20 century.
var NUM_CENTYEAR = 30;
// are year scrolling buttons required by default
var BUL_YEARSCROLL = true;
var DEF_CALPAGE = 'skycalendar.html';
var calendars = [];
var RE_NUM = /^\-?\d+$/;
var dateFormat = "yyyy-mm-dd";
function skycalendar(obj_target) {
// assing methods
this.gen_date = cal_gen_date1;
this.gen_tsmp = cal_gen_tsmp1;
this.prs_date = cal_prs_date1;
this.prs_tsmp = cal_prs_tsmp1;
this.popup = cal_popup1;
this.setCalendarPage = cal_setcalpage1;
this.setDateFormat = cal_setdateformat1;
// validate input parameters
if (!obj_target)
return cal_error("Error calling the calendar: no target control specified");
if (obj_target.value == null)
return cal_error("Error calling the calendar: parameter specified is not valid tardet control");
this.target = obj_target;
this.year_scroll = BUL_YEARSCROLL;
this.calpage = DEF_CALPAGE;
// register in global collections
this.id = calendars.length;
calendars[this.id] = this;
}
function cal_setcalpage1(str_page) {
this.calpage = str_page;
}
function cal_setdateformat1(str_dateformat) {
this.dateFormat = str_dateformat;
}
function cal_popup1(str_datetime) {
this.dt_current = this.prs_tsmp(str_datetime ? str_datetime : this.target.value);
if (!this.dt_current) return;
var obj_calwindow = window.open(
this.calpage+'?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,
'Calendar', 'width=200,height=190'+
',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
);
obj_calwindow.opener = window;
obj_calwindow.focus();
}
// timestamp generating function
function cal_gen_tsmp1(dt_datetime) {
return this.gen_date(dt_datetime);
}
// date generating function
function cal_gen_date1(dt_datetime) {
var out = this.dateFormat;
var idx;
if (out.indexOf("yyyy") != 1) {
t = out.split("yyyy");
out = t.join(dt_datetime.getFullYear());
}
else {
return cal_error("Missing year-part 'yyyy' in format: '"+this.dateFormat);
}
if (out.indexOf("mm") != 1) {
t = out.split("mm");
out = t.join((dt_datetime.getMonth() < 9 ? '0' : '')+
(dt_datetime.getMonth()+1));
}
else {
return cal_error("Missing month-part 'mm' in format: '"+this.dateFormat);
}
if (out.indexOf("dd") != 1) {
t = out.split("dd");
out = t.join((dt_datetime.getDate() < 10 ? '0' : '')+
dt_datetime.getDate());
}
else {
return cal_error("Missing day-part 'dd' in format: '"+this.dateFormat);
}
return out;
}
// timestamp parsing function
function cal_prs_tsmp1(str_datetime) {
// if no parameter specified return current timestamp
if (!str_datetime)
return (new Date());
// if positive integer treat as milliseconds from epoch
if (RE_NUM.exec(str_datetime))
return new Date(str_datetime);
return this.prs_date(str_datetime);
}
// date parsing function
function cal_prs_date1(str_date) {
var idx;
var year = null;
var month = null;
var day = null;
if (str_date.length != this.dateFormat.length) {
return cal_error ("Invalid date format: '"+str_date+
"'.\nFormat accepted is '"+this.dateFormat+"'.");
}
if ((idx = this.dateFormat.indexOf("yyyy")) != 1) {
year = str_date.substring(idx, idx+4);
}
else {
return cal_error("Missing year-part 'yyyy' in format: '"+this.dateFormat);
}
if ((idx = this.dateFormat.indexOf("mm")) != 1) {
month = str_date.substring(idx, idx+2);
}
else {
return cal_error("Missing month-part 'mm' in format: '"+this.dateFormat);
}
if ((idx = this.dateFormat.indexOf("dd")) != 1) {
day = str_date.substring(idx, idx+2);
}
else {
return cal_error("Missing day-part 'dd' in format: '"+this.dateFormat);
}
if (!day) return cal_error("Invalid date format: '"+str_date+
"'.\nNo day of month value can be found.");
if (!RE_NUM.exec(day))
return cal_error("Invalid day of month value: '"+day+
"'.\nAllowed values are unsigned integers.");
if (!month) return cal_error("Invalid date format: '"+str_date+
"'.\nNo month of year value can be found.");
if (!RE_NUM.exec(month))
return cal_error("Invalid month of year value: '"+month+
"'.\nAllowed values are unsigned integers.");
if (!year) return cal_error("Invalid date format: '"+str_date+
"'.\nNo year value can be found.");
if (!RE_NUM.exec(year))
return cal_error("Invalid year value: '"+year+
"'.\nAllowed values are unsigned integers.");
var dt_date = new Date();
dt_date.setDate(1);
if (month < 1 || month > 12)
return cal_error("Invalid month value: '"+month+
"'.\nAllowed range is 01-12.");
dt_date.setMonth(month-1);
if (year < 100) year = Number(year)+(year < NUM_CENTYEAR ? 2000 : 1900);
dt_date.setFullYear(year);
var dt_numdays = new Date(year, month, 0);
dt_date.setDate(day);
if (dt_date.getMonth() != (month-1))
return cal_error("Invalid day of month value: '"+day+
"'.\nAllowed range is 01-"+dt_numdays.getDate()+".");
return (dt_date);
}
function cal_error(str_message) {
alert (str_message);
return null;
}
@@ -0,0 +1,222 @@
/* this file is in UTF-8 format! */
/* Day */
"Sunday" = "Dimanche";
"Monday" = "Lundi";
"Tuesday" = "Mardi";
"Wednesday" = "Mercredi";
"Thursday" = "Jeudi";
"Friday" = "Vendredi";
"Saturday" = "Samedi";
"a2_Sunday" = "Di";
"a2_Monday" = "Lu";
"a2_Tuesday" = "Ma";
"a2_Wednesday" = "Me";
"a2_Thursday" = "Je";
"a2_Friday" = "Ve";
"a2_Saturday" = "Sa";
"dayLabelFormat" = "%d/%m/%Y";
"today" = "Aujourd'hui";
/* Week */
"Week" = "Semaine";
"this week" = "cette semaine";
/* Month */
"this month" = "ce mois";
"January" = "Janvier";
"February" = "Février";
"March" = "Mars";
"April" = "Avril";
"May" = "Mai";
"June" = "Juin";
"July" = "Juillet";
"August" = "Août";
"September" = "Septembre";
"October" = "Octobre";
"November" = "Novembre";
"December" = "Décembre";
"a3_January" = "Jan";
"a3_February" = "Fev";
"a3_March" = "Mar";
"a3_April" = "Avr";
"a3_May" = "Mai";
"a3_June" = "Jun";
"a3_July" = "Jul";
"a3_August" = "Aou";
"a3_September" = "Sep";
"a3_October" = "Oct";
"a3_November" = "Nov";
"a3_December" = "Dec";
/* Year */
"this year" = "Cette année";
/* Menu */
"Calendar" = "Agenda";
"Contacts" = "Contacts";
/* Misc */
"OpenGroupware.org" = "OpenGroupware.org";
"Forbidden" = "Accès non autorisée";
/* Button Titles */
"new" = "Nouveau";
"printview" = "Version imprimable";
"edit" = "Editer";
"delete" = "Supprimer";
"proposal" = "Recherche de plages horaires";
"Save" = "Sauvegarder";
"Cancel" = "Annuler";
"show_rejected_apts" = "Afficher les rendez-vous refusés";
"hide_rejected_apts" = "Cacher les rendez-vous refusés";
/* Schedule */
"Schedule" = "Suivi de rendez-vous";
"No appointments found" = "Aucun rendez-vous";
"Meetings proposed by you" = "Rendez-vous que vous proposez";
"Meetings proposed to you" = "Rendez-vous qui vous sont proposés";
"sched_startDateFormat" = "%d/%m %H:%M";
"action" = "Action";
"accept" = "Accepter";
"decline" = "Refuser";
"more participants" = "Autres participants";
"Hide already accepted and rejected appointments" = "Cacher les invitations refusées";
"Show already accepted and rejected appointments" = "Montrer aussi les invitations refusées";
/* Appointments */
"Appointment viewer" = "Visualisation de rendez-vous";
"Appointment editor" = "Edition de rendez-vous";
"Appointment proposal" = "Proposition de rendez-vous";
"Appointment on" = "Rendez-vous le";
"Start time" = "Heure de début";
"End time" ="Heure de fin";
"Start date" = "Date de début";
"End date" = "Date de fin";
"Earliest start time" = "Au plus tôt";
"Latest end time" = "Au plus tard";
"browse start date" = "Sélection Date de début";
"browse end date" = "Sélection Date de fin";
"Title" ="Titre";
"Name" = "Nom";
"Email" = "Email";
"Status" = "Status";
"Location" ="Lieu";
"Priority" = "Priorité";
"Cycle" = "Récurence";
"Cycle End" = "s'arreter";
"Categories" = "Categories";
"Classification" = "Classification";
"Duration" = "Durée";
"Participants" = "Participants";
"Resources" = "Ressources";
"Organizer" = "Organisateur";
"Comment" ="Notes";
"attributes" = "Attributs";
"participants" = "Participants";
/* checkbox title */
"is private" = "Rendez-vous privé";
/* classification */
"Public" = "Public";
"Private" = "Privé";
/* text used in overviews and tooltips */
"empty title" = "Titre vide";
"private appointment" = "Rendez-vous privé";
/* Appointments (participation state) */
"partStat_NEEDS-ACTION" = "Décision attendue";
"partStat_ACCEPTED" = "Accepté";
"partStat_DECLINED" = "Refusé";
"partStat_TENTATIVE" = "Tentative";
"partStat_DELEGATED" = "Delegué";
"partStat_OTHER" = "???";
/* Appointments (error messages) */
"Conflicts found!" = "Un ou plusieurs conflicts ont été détectés";
"Invalid iCal data!" = "Données iCal non valides ...";
"Could not create iCal data!" = "Les données iCal n'ont pu être crées ...";
/* Searching */
"Search" = "Rechercher";
"Search participants" ="Recherche de participants";
"Search resources" ="Recherche de ressources";
"Search appointments" = "Recherche de rendez-vous";
"Search in Anais" = "Recherche par Anaïs";
"check for conflicts" = "Vérifier les conflits";
/* calendar modes */
"Overview" = "Vue synthétique";
"Chart" = "Vue avec repères horaires";
"List" = "Vue multi-agenda";
"Columns" = "Vue avec repères mensuels";
/* Priorities */
"prio_0" = "Non précisée";
"prio_1" = "Haute";
"prio_2" = "Haute";
"prio_3" = "Haute";
"prio_4" = "Haute";
"prio_5" = "Normale";
"prio_6" = "Basse";
"prio_7" = "Basse";
"prio_8" = "Basse";
"prio_9" = "Basse";
/* Cycles */
"cycle_once" = "Sans récurence";
"cycle_daily" = "Chaque jour";
"cycle_weekly" = "Chaque semaine";
"cycle_2weeks" = "Toutes les deux semaines";
"cycle_4weeks" = "Toutes les quatre semaines ";
"cycle_monthly" = "Tous les mois";
"cycle_weekday" = "A chaque même jour de la semaine";
"cycle_yearly" = "Chaque année";
"cycle_end_never" = "Jamais";
"cycle_end_until" = "A la date :";
/* Appointment categories */
"APPOINTMENT" = "Rendez-vous";
"NOT IN OFFICE" = "A l'exterieur";
"MEETING" = "Réunion";
"HOLIDAY" = "Vacances";
"PHONE CALL" = "Rendez-vous téléphonique";
/* validation errors */
validate_notitle = "Le titre n'est pas rempli. Continuer quand-même ?";
validate_invalid_startdate = "La date de début est invalide !";
validate_invalid_enddate = "La date de fin est invalide !";
validate_endbeforestart = "La date de fin est avant la date de début !";
+160
View File
@@ -0,0 +1,160 @@
<!--
Title: Tigra Calendar
Description: See the demo at url
URL: http://www.softcomplex.com/products/tigra_calendar/
Version: 3.1
Date: 08-08-2002 (mm-dd-yyyy)
Feedback: feedback@softcomplex.com (specify product title in the subject)
Note: Permission given to use this script in ANY kind of applications if
header lines are left unchanged.
Note: Script consists of two files: calendar?.js and calendar.html
About us: Our company provides offshore IT consulting services.
Contact us at sales@softcomplex.com if you have any programming task you
want to be handled by professionals. Our typical hourly rate is $20.
modified by Martin Hoerning, mh@skyrix.com, 2002-12-05
-->
<html>
<head>
<title>Select Date, Please.</title>
<style>
td {font-family: Tahoma, Verdana, sans-serif; font-size: 12px;}
</style>
<script language="JavaScript">
// months as they appear in the calendar's title
var ARR_MONTHS = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
// week day titles as they appear on the calendar
var ARR_WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
// day week starts from (normally 0-Mo or 1-Su)
var NUM_WEEKSTART = 1;
// path to the directory where calendar images are stored. trailing slash req.
var STR_ICONPATH = '';
var re_url = new RegExp('datetime=(\\-?\\d+)');
var dt_current = (re_url.exec(String(window.location))
? new Date(new Number(RegExp.$1)) : new Date());
var re_id = new RegExp('id=(\\d+)');
var num_id = (re_id.exec(String(window.location))
? new Number(RegExp.$1) : 0);
var obj_caller = (window.opener ? window.opener.calendars[num_id] : null);
if (obj_caller && obj_caller.year_scroll) {
// get same date in the previous year
var dt_prev_year = new Date(dt_current);
dt_prev_year.setFullYear(dt_prev_year.getFullYear() - 1);
if (dt_prev_year.getDate() != dt_current.getDate())
dt_prev_year.setDate(0);
// get same date in the next year
var dt_next_year = new Date(dt_current);
dt_next_year.setFullYear(dt_next_year.getFullYear() + 1);
if (dt_next_year.getDate() != dt_current.getDate())
dt_next_year.setDate(0);
}
// get same date in the previous month
var dt_prev_month = new Date(dt_current);
dt_prev_month.setMonth(dt_prev_month.getMonth() - 1);
if (dt_prev_month.getDate() != dt_current.getDate())
dt_prev_month.setDate(0);
// get same date in the next month
var dt_next_month = new Date(dt_current);
dt_next_month.setMonth(dt_next_month.getMonth() + 1);
if (dt_next_month.getDate() != dt_current.getDate())
dt_next_month.setDate(0);
// get first day to display in the grid for current month
var dt_firstday = new Date(dt_current);
dt_firstday.setDate(1);
dt_firstday.setDate(1 - (7 + dt_firstday.getDay() - NUM_WEEKSTART) % 7);
// function passing selected date to calling window
function set_datetime(n_datetime, b_close) {
if (!obj_caller) return;
var dt_datetime = new Date(n_datetime);
if (!dt_datetime) {
alert('failed to generate date string');
return;
}
if (b_close) { // only set value when closing window
obj_caller.target.value = (document.cal
? obj_caller.gen_tsmp(dt_datetime)
: obj_caller.gen_date(dt_datetime)
);
}
if (b_close) window.close();
else obj_caller.popup(dt_datetime.valueOf());
}
</script>
</head>
<body bgcolor="#FFFFFF" marginheight="5" marginwidth="5" topmargin="5" leftmargin="5" rightmargin="5">
<table class="clsOTable" cellspacing="0" border="0" width="100%">
<tr><td bgcolor="#E8E8E0">
<table cellspacing="1" cellpadding="3" border="0" width="100%">
<tr><td colspan="7" bgcolor="#D0D0D0"><table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<script language="JavaScript">
document.write(
'<td>'+(obj_caller&&obj_caller.year_scroll?'<a href="javascript:set_datetime('+dt_prev_year.valueOf()+')"><img src="'+STR_ICONPATH+'first.gif" width="15" height="15" border="0" alt="previous year" title="previous year"></a>&nbsp;':'')+'<a href="javascript:set_datetime('+dt_prev_month.valueOf()+')"><img src="'+STR_ICONPATH+'previous.gif" width="15" height="15" border="0" alt="previous month" title="previous month"></a></td>'+
'<td align="center" width="100%"><font color="#000000">'+ARR_MONTHS[dt_current.getMonth()]+' '+dt_current.getFullYear() + '</font></td>'+
'<td><a href="javascript:set_datetime('+dt_next_month.valueOf()+')"><img src="'+STR_ICONPATH+'next.gif" width="15" height="15" border="0" alt="next month" title="next month"></a>'+(obj_caller && obj_caller.year_scroll?'&nbsp;<a href="javascript:set_datetime('+dt_next_year.valueOf()+')"><img src="'+STR_ICONPATH+'last.gif" width="15" height="15" border="0" alt="next year" title="next year"></a>':'')+'</td>'
);
</script>
</tr>
</table></td></tr>
<tr>
<script language="JavaScript">
// print weekdays titles
for (var n=0; n<7; n++)
document.write('<td bgcolor="#D0D0D0" align="center"><font color="#000000">'+ARR_WEEKDAYS[(NUM_WEEKSTART+n)%7]+'</font></td>');
document.write('</tr>');
// print calendar table
var dt_current_day = new Date(dt_firstday);
while (dt_current_day.getMonth() == dt_current.getMonth() ||
dt_current_day.getMonth() == dt_firstday.getMonth()) {
// print row heder
document.write('<tr>');
for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
if (dt_current_day.getDate() == dt_current.getDate() &&
dt_current_day.getMonth() == dt_current.getMonth())
// print current date
document.write('<td bgcolor="#F18D39" align="center" width="14%">');
//else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
else if (dt_current_day.getMonth() != dt_current.getMonth())
// old: weekend days // new: other month
document.write('<td bgcolor="#D0D0D0" align="center" width="14%">');
else
// print working days of current month
document.write('<td bgcolor="#E0E0E0" align="center" width="14%">');
document.write('<a href="javascript:set_datetime('+dt_current_day.valueOf() +', true);">');
if (dt_current_day.getMonth() == this.dt_current.getMonth())
// print days of current month
document.write('<font color="#000000">');
else
// print days of other months
document.write('<font color="#555555">');
document.write(dt_current_day.getDate()+'</font></a></td>');
dt_current_day.setDate(dt_current_day.getDate()+1);
}
// print row footer
document.write('</tr>');
}
//if (obj_caller && obj_caller.time_comp)
// document.write('<form onsubmit="javascript:set_datetime('+dt_current.valueOf()+', true)" name="cal"><tr><td colspan="7" bgcolor="#87CEFA"><font color="White" face="tahoma, verdana" size="2">Time: <input type="text" name="time" value="'+obj_caller.gen_time(this.dt_current)+'" size="8" maxlength="8"></font></td></tr></form>');
</script>
</table></tr></td>
</table>
</body>
</html>
+190
View File
@@ -0,0 +1,190 @@
// Title: Tigra Calendar
// Description: See the demo at url
// URL: http://www.softcomplex.com/products/tigra_calendar/
// Version: 3.1 (European date format)
// Date: 08-08-2002 (mm-dd-yyyy)
// Feedback: feedback@softcomplex.com (specify product title in the subject)
// Note: Permission given to use this script in ANY kind of applications if
// header lines are left unchanged.
// Note: Script consists of two files: calendar?.js and calendar.html
// About us: Our company provides offshore IT consulting services.
// Contact us at sales@softcomplex.com if you have any programming task you
// want to be handled by professionals. Our typical hourly rate is $20.
// modified by Martin Hoerning, mh@skyrix.com, 2002-12-05
// 2003-01-23 added date format support (Martin Hoerning)
// if two digit year input dates after this year considered 20 century.
var NUM_CENTYEAR = 30;
// are year scrolling buttons required by default
var BUL_YEARSCROLL = true;
var DEF_CALPAGE = 'skycalendar.html';
var calendars = [];
var RE_NUM = /^\-?\d+$/;
var dateFormat = "yyyy-mm-dd";
function skycalendar(obj_target) {
// assing methods
this.gen_date = cal_gen_date1;
this.gen_tsmp = cal_gen_tsmp1;
this.prs_date = cal_prs_date1;
this.prs_tsmp = cal_prs_tsmp1;
this.popup = cal_popup1;
this.setCalendarPage = cal_setcalpage1;
this.setDateFormat = cal_setdateformat1;
// validate input parameters
if (!obj_target)
return cal_error("Error calling the calendar: no target control specified");
if (obj_target.value == null)
return cal_error("Error calling the calendar: parameter specified is not valid tardet control");
this.target = obj_target;
this.year_scroll = BUL_YEARSCROLL;
this.calpage = DEF_CALPAGE;
// register in global collections
this.id = calendars.length;
calendars[this.id] = this;
}
function cal_setcalpage1(str_page) {
this.calpage = str_page;
}
function cal_setdateformat1(str_dateformat) {
this.dateFormat = str_dateformat;
}
function cal_popup1(str_datetime) {
this.dt_current = this.prs_tsmp(str_datetime ? str_datetime : this.target.value);
if (!this.dt_current) return;
var obj_calwindow = window.open(
this.calpage+'?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,
'Calendar', 'width=200,height=190'+
',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
);
obj_calwindow.opener = window;
obj_calwindow.focus();
}
// timestamp generating function
function cal_gen_tsmp1(dt_datetime) {
return this.gen_date(dt_datetime);
}
// date generating function
function cal_gen_date1(dt_datetime) {
var out = this.dateFormat;
var idx;
if (out.indexOf("yyyy") != 1) {
t = out.split("yyyy");
out = t.join(dt_datetime.getFullYear());
}
else {
return cal_error("Missing year-part 'yyyy' in format: '"+this.dateFormat);
}
if (out.indexOf("mm") != 1) {
t = out.split("mm");
out = t.join((dt_datetime.getMonth() < 9 ? '0' : '')+
(dt_datetime.getMonth()+1));
}
else {
return cal_error("Missing month-part 'mm' in format: '"+this.dateFormat);
}
if (out.indexOf("dd") != 1) {
t = out.split("dd");
out = t.join((dt_datetime.getDate() < 10 ? '0' : '')+
dt_datetime.getDate());
}
else {
return cal_error("Missing day-part 'dd' in format: '"+this.dateFormat);
}
return out;
}
// timestamp parsing function
function cal_prs_tsmp1(str_datetime) {
// if no parameter specified return current timestamp
if (!str_datetime)
return (new Date());
// if positive integer treat as milliseconds from epoch
if (RE_NUM.exec(str_datetime))
return new Date(str_datetime);
return this.prs_date(str_datetime);
}
// date parsing function
function cal_prs_date1(str_date) {
var idx;
var year = null;
var month = null;
var day = null;
if (str_date.length != this.dateFormat.length) {
return cal_error ("Invalid date format: '"+str_date+
"'.\nFormat accepted is '"+this.dateFormat+"'.");
}
if ((idx = this.dateFormat.indexOf("yyyy")) != 1) {
year = str_date.substring(idx, idx+4);
}
else {
return cal_error("Missing year-part 'yyyy' in format: '"+this.dateFormat);
}
if ((idx = this.dateFormat.indexOf("mm")) != 1) {
month = str_date.substring(idx, idx+2);
}
else {
return cal_error("Missing month-part 'mm' in format: '"+this.dateFormat);
}
if ((idx = this.dateFormat.indexOf("dd")) != 1) {
day = str_date.substring(idx, idx+2);
}
else {
return cal_error("Missing day-part 'dd' in format: '"+this.dateFormat);
}
if (!day) return cal_error("Invalid date format: '"+str_date+
"'.\nNo day of month value can be found.");
if (!RE_NUM.exec(day))
return cal_error("Invalid day of month value: '"+day+
"'.\nAllowed values are unsigned integers.");
if (!month) return cal_error("Invalid date format: '"+str_date+
"'.\nNo month of year value can be found.");
if (!RE_NUM.exec(month))
return cal_error("Invalid month of year value: '"+month+
"'.\nAllowed values are unsigned integers.");
if (!year) return cal_error("Invalid date format: '"+str_date+
"'.\nNo year value can be found.");
if (!RE_NUM.exec(year))
return cal_error("Invalid year value: '"+year+
"'.\nAllowed values are unsigned integers.");
var dt_date = new Date();
dt_date.setDate(1);
if (month < 1 || month > 12)
return cal_error("Invalid month value: '"+month+
"'.\nAllowed range is 01-12.");
dt_date.setMonth(month-1);
if (year < 100) year = Number(year)+(year < NUM_CENTYEAR ? 2000 : 1900);
dt_date.setFullYear(year);
var dt_numdays = new Date(year, month, 0);
dt_date.setDate(day);
if (dt_date.getMonth() != (month-1))
return cal_error("Invalid day of month value: '"+day+
"'.\nAllowed range is 01-"+dt_numdays.getDate()+".");
return (dt_date);
}
function cal_error(str_message) {
alert (str_message);
return null;
}
+93
View File
@@ -0,0 +1,93 @@
# GNUstep makefile
include ../common.make
BUNDLE_NAME = SchedulerUI
SchedulerUI_PRINCIPAL_CLASS = SchedulerUIProduct
SchedulerUI_LANGUAGES = English French German
SchedulerUI_OBJC_FILES = \
SchedulerUIProduct.m \
iCalPerson+UIx.m \
NSCalendarDate+UIx.m \
SOGoAppointment+UIx.m \
UIxComponent+Agenor.m \
\
UIxCalView.m \
UIxCalDayView.m \
UIxCalWeekView.m \
UIxCalMonthView.m \
UIxAptTableView.m \
\
UIxCalDayOverview.m \
UIxCalDayChartview.m \
UIxCalDayListview.m \
UIxCalDayPrintview.m \
UIxCalWeekOverview.m \
UIxCalWeekChartview.m \
UIxCalWeekListview.m \
UIxCalWeekColumnsview.m \
UIxCalWeekPrintview.m \
UIxCalMonthOverview.m \
UIxCalMonthPrintview.m \
UIxCalYearOverview.m \
UIxCalInlineMonthOverview.m \
UIxAppointmentView.m \
UIxAppointmentPrintview.m \
UIxAppointmentEditor.m \
UIxCalSelectTab.m \
UIxCalDateLabel.m \
UIxCalBackForthNavView.m \
UIxAppointmentProposal.m \
UIxDatePicker.m \
UIxDatePickerScript.m \
UIxTimeSelector.m \
UIxTimeDateControl.m \
UIxCalInlineAptView.m \
UIxCalScheduleOverview.m \
UIxCalParticipationStatusView.m \
\
iCalRecurrenceRule+SOGo.m \
SchedulerUI_RESOURCE_FILES += \
Version \
product.plist
SchedulerUI_RESOURCE_FILES += \
images/next_week.gif \
images/previous_week.gif \
images/icon_view_overview.gif \
images/icon_view_overview_inactive.gif \
images/icon_view_chart.gif \
images/icon_view_chart_inactive.gif \
images/icon_view_list.gif \
images/icon_view_list_inactive.gif \
images/icon_view_columns.gif \
images/icon_view_columns_inactive.gif \
images/icon_popupcalendar.gif \
images/first.gif \
images/previous.gif \
images/next.gif \
images/last.gif \
images/green_corner.gif \
images/invisible_space_2.gif \
images/apt_icon_private.gif \
SchedulerUI_LOCALIZED_RESOURCE_FILES += \
Localizable.strings \
# if SoProduct is fixed to enable localized resources, add this to
# SchedulerUI_LOCALIZED_RESOURCE_FILES instead
SchedulerUI_RESOURCE_FILES += \
skycalendar.html \
skycalendar.js \
cycles.plist \
# make
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/bundle.make
-include GNUmakefile.postamble
include ../../fhsbundle.make
+21
View File
@@ -0,0 +1,21 @@
# postprocessing
ifeq ($(bundlewox),yes)
validate-wox:
xmllint --noout *.wox
before-all :: validate-wox
endif
ifneq ($(GNUSTEP_BUILD_DIR),)
after-all ::
@(cp bundle-info.plist \
$(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION))
else
after-all ::
@(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\
cp ../bundle-info.plist .)
endif
+5
View File
@@ -0,0 +1,5 @@
# compile settings
ADDITIONAL_INCLUDE_DIRS += \
-I.. -I../.. -I../../..
@@ -0,0 +1,221 @@
/* this file is in UTF-8 format! */
// TODO: add umlauts!
/* Day */
"Sunday" = "Sonntag";
"Monday" = "Montag";
"Tuesday" = "Dienstag";
"Wednesday" = "Mittwoch";
"Thursday" = "Donnerstag";
"Friday" = "Freitag";
"Saturday" = "Samstag";
"a2_Sunday" = "So";
"a2_Monday" = "Mo";
"a2_Tuesday" = "Di";
"a2_Wednesday" = "Mi";
"a2_Thursday" = "Do";
"a2_Friday" = "Fr";
"a2_Saturday" = "Sa";
"dayLabelFormat" = "%Y-%m-%d";
"today" = "heute";
/* Week */
"Week" = "Woche";
"this week" = "aktuelle Woche";
/* Month */
"this month" = "aktueller Monat";
"January" = "Januar";
"February" = "Februar";
"March" = "Maerz"; // TODO: umlaut
"April" = "April";
"May" = "Mai";
"June" = "Juni";
"July" = "Juli";
"August" = "August";
"September" = "September";
"October" = "Oktober";
"November" = "November";
"December" = "Dezember";
"a3_January" = "Jan";
"a3_February" = "Feb";
"a3_March" = "Mae"; // TODO: umlaut
"a3_April" = "Apr";
"a3_May" = "Mai";
"a3_June" = "Jun";
"a3_July" = "Jul";
"a3_August" = "Aug";
"a3_September" = "Sep";
"a3_October" = "Okt";
"a3_November" = "Nov";
"a3_December" = "Dez";
/* Year */
"this year" = "aktuelles Jahr";
/* Menu */
"Calendar" = "Kalendar";
"Contacts" = "Kontakte";
/* Misc */
"OpenGroupware.org" = "OpenGroupware.org";
"Forbidden" = "Verboten";
/* Button titles */
"new" = "neu";
"printview" = "Druckansicht";
"edit" = "bearbeiten";
"delete" = "loeschen"; // TODO: umlauts
"proposal" = "Terminvorschlag";
"Save" = "Speichern";
"Cancel" = "Abbrechen";
"show_rejected_apts" = "Abgelehnte Termine anzeigen";
"hide_rejected_apts" = "Abgelehnte Termine ausblenden";
/* Schedule */
"Schedule" = "Terminvorschlaege"; // TODO: umlaut
"No appointments found" = "Es stehen keine Termine an.";
"Meetings proposed by you" = "Ihre Terminvorschlaege"; // TODO: umlaut
"Meetings proposed to you" = "Terminvorschlaege fuer Sie"; // TODO: umlaut
"sched_startDateFormat" = "%d.%m. %H:%M";
"action" = "Aktion";
"accept" = "Annehmen";
"decline" = "Ablehnen";
"more participants" = "mehr Teilnehmer";
"Hide already accepted and rejected appointments" = "Akzeptierte und abgelehnte Termine ausblenden";
"Show already accepted and rejected appointments" = "Akzeptierte und abgelehnte Termine anzeigen";
/* Appointments */
"Appointment viewer" = "Terminansicht";
"Appointment editor" = "Termineditor";
"Appointment proposal" = "Terminvorschlag";
"Appointment on" = "Termin am";
"Start time" = "Startzeit";
"End time" = "Endzeit";
"Start date" = "Startdatum";
"End date" = "Enddatum";
"Earliest start time" = "Frueheste Startzeit"; // TODO: Umlaut
"Latest end time" = "Spaeteste Endzeit"; // TODO: Umlaut
"browse start date" = "browse start date"; // TODO
"browse end date" = "browse end date"; // TODO
"Title" = "Titel";
"Name" = "Name";
"Email" = "Email";
"Status" = "Status";
"Location" = "Ort";
"Priority" = "Prioritaet"; // TODO: Umlaut
"Cycle" = "Zyklus";
"Cycle End" = "Ende";
"Categories" = "Kategorien";
"Classification" = "Klassifizierung";
"Duration" = "Dauer";
"Participants" = "Teilnehmer";
"Resources" = "Ressourcen";
"Organizer" = "Organisator";
"Comment" = "Kommentar";
"attributes" = "Attribute";
"participants" = "Teilnehmer";
/* checkbox title */
"is private" = "ist privat";
/* classification */
"Public" = "Oeffentlich"; // TODO: Umlaut
"Private" = "Privat";
/* text used in overviews and tooltips */
"empty title" = "Ohne Titel";
"private appointment" = "Privater Termin";
/* Appointments (participation state) */
"partStat_NEEDS-ACTION" = "Noch nicht entschieden";
"partStat_ACCEPTED" = "Akzeptiert";
"partStat_DECLINED" = "Abgelehnt";
"partStat_TENTATIVE" = "Offen";
"partStat_DELEGATED" = "Delegiert";
"partStat_OTHER" = "???";
/* Appointments (error messages) */
"Conflicts found!" = "Einer oder mehrere Konflikte wurden erkannt.";
"Invalid iCal data!" = "Fehlerhafte iCalendar-Daten ...";
"Could not create iCal data!" = "Konnte iCalendar-Daten nicht erzeugen ...";
/* Searching */
"Search" = "Suchen";
"Search participants" = "Teilnehmer suchen";
"Search resources" = "Ressourcen suchen";
"Search appointments" = "Termine suchen";
"Search in Anais" = "In Anaïs suchen";
/* calendar modes */
"Overview" = "Uebersicht"; // TODO: Umlaut
"Chart" = "Chart";
"List" = "Liste";
"Columns" = "Spalten";
/* Priorities */
"prio_0" = "-";
"prio_1" = "Hoch";
"prio_2" = "Hoch";
"prio_3" = "Hoch";
"prio_4" = "Hoch";
"prio_5" = "Normal";
"prio_6" = "Niedrig";
"prio_7" = "Niedrig";
"prio_8" = "Niedrig";
"prio_9" = "Niedrig";
/* Cycles */
"cycle_once" = "einmal";
"cycle_daily" = "taeglich"; // TODO: Umlaut
"cycle_weekly" = "woechentlich"; // TODO: Umlaut
"cycle_2weeks" = "alle 2 Wochen";
"cycle_4weeks" = "alle 4 Wochen";
"cycle_monthly" = "monatlich";
"cycle_weekday" = "an Arbeitstagen";
"cycle_yearly" = "jaehrlich"; // TODO: Umlaut
"cycle_end_never" = "niemals";
"cycle_end_until" = "zum Datum";
/* Appointment categories */
"APPOINTMENT" = "Termin";
"NOT IN OFFICE" = "Ausserhalb";
"MEETING" = "Meeting";
"HOLIDAY" = "Urlaub";
"PHONE CALL" = "Telefon";
/* validation errors */
validate_notitle = "Termintitel fehlt, fortfahren?";
validate_invalid_startdate = "Startdatum ist fehlerhaft!";
validate_invalid_enddate = "Enddatum ist fehlerhaft!";
validate_endbeforestart = "Enddatum liegt vor dem Startdatum!";
+61
View File
@@ -0,0 +1,61 @@
// $Id: NOTES,v 1.1 2003/11/24 01:24:40 helge Exp $
Scheduler
=========
SOPE based interface for scheduler.
Class Hierarchy
===============
[WOComponent]
[SoComponent]
UIxAppointmentView
UIxCalView
UIxCalMonthView
UIxCalMonthOverview
UIxCalWeekView
UIxCalWeekOverview
UIxCalWeekPrintview
UIxCalWeekColumnsview
UIxCalWeekListview
UIxCalWeekChartview
UIxCalDayView
UIxCalDayOverview
UIxCalDayChartview
UIxAptTableView
SchedulerUIProduct
TBD:
UIxCalDayHChart?
UIxCalWeekHChart?
OGoYearOverview - should use aggressive caching in the long run
- editor page (which comes up in a new window)
- delete page
- print views
Notes
=====
editor pages need to use JavaScript to trigger reloads in the parent window
=> find out how to do that
URLs
====
/zidestore/ControlPanel/ => SoControlPanel
/zidestore/ControlPanel/Products => SoProductRegistry
/zidestore/ControlPanel/Products/ZideStoreUI => SoProduct
/zidestore/ControlPanel/Products/ZideStoreUI/Resources/
=> SoProductResourceManager
/zidestore/ControlPanel/Products/ZideStoreUI/Resources/calendar.css
=> resource
Defaults
========
Name Type Synopsis
SOGoShouldDisplayWeekend BOOL Display weekends in week related views.
Default is NO.
+35
View File
@@ -0,0 +1,35 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $
#ifndef __NSCalendarDate_UIx_H__
#define __NSCalendarDate_UIx_H__
#import <Foundation/NSCalendarDate.h>
@interface NSCalendarDate(UIx)
- (NSCalendarDate *)dayOfWeeK:(unsigned)_day offsetFromSunday:(unsigned)_off;
- (NSCalendarDate *)sundayOfWeek;
@end
#endif /* __NSCalendarDate_UIx_H__ */
+50
View File
@@ -0,0 +1,50 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $
#include "NSCalendarDate+UIx.h"
#include "common.h"
@implementation NSCalendarDate(UIx)
- (NSCalendarDate *)dayOfWeeK:(unsigned)_day
offsetFromSunday:(unsigned)_offset
{
unsigned dayOfWeek, distance;
/* perform "locale" correction */
dayOfWeek = (7 + [self dayOfWeek] - _offset) % 7;
_day = (_day % 7);
if(_day == dayOfWeek)
return self;
distance = _day - dayOfWeek;
return [self dateByAddingYears:0 months:0 days:distance];
}
/* this implies that monday is the start of week! */
- (NSCalendarDate *)sundayOfWeek {
return [self dayOfWeeK:6 offsetFromSunday:1];
}
@end /* NSCalendarDate(UIx) */
+31
View File
@@ -0,0 +1,31 @@
/*
Copyright (C) 2000-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#ifndef __SOGoAppointment_UIx_H_
#define __SOGoAppointment_UIx_H_
#include <SOGo/SOGoAppointment.h>
@interface SOGoAppointment (UIx)
- (NSString *)priorityLabelKey;
@end
#endif /* __SOGoAppointment_UIx_H_ */
+47
View File
@@ -0,0 +1,47 @@
/*
Copyright (C) 2000-2004 SKYRIX Software AG
This file is part of OGo
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: SOGoAppointment+UIx.m 365 2004-10-06 10:53:34Z znek $
#include "SOGoAppointment+UIx.h"
#include "common.h"
@implementation SOGoAppointment (UIx)
- (NSString *)priorityLabelKey {
NSString *prio;
prio = [self priority];
if(!prio) {
prio = @"0";
}
else {
NSRange r;
r = [prio rangeOfString:@";"];
if(r.length > 0) {
prio = [prio substringToIndex:r.location];
}
}
return [NSString stringWithFormat:@"prio_%@", prio];
}
@end
+34
View File
@@ -0,0 +1,34 @@
/*
Copyright (C) 2000-2003 SKYRIX Software AG
This file is part of OGo
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: SchedulerUIProduct.m 904 2005-07-22 15:00:36Z helge $
#import <Foundation/NSObject.h>
@interface SchedulerUIProduct : NSObject
{
}
@end
#include "common.h"
@implementation SchedulerUIProduct
@end /* SchedulerUIProduct */
File diff suppressed because it is too large Load Diff
+62
View File
@@ -0,0 +1,62 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include "UIxAppointmentView.h"
@interface UIxAppointmentPrintview : UIxAppointmentView
{
}
- (BOOL)isMyApt;
@end
#include "common.h"
#include <SOGoUI/SOGoDateFormatter.h>
#include <SOGo/SOGoAppointment.h>
#include "UIxComponent+Agenor.h"
@implementation UIxAppointmentPrintview
- (NSString *)title {
return [[self dateFormatter] stringForObjectValue:[self startTime]];
}
- (BOOL)isMyApt {
id apt;
NSString *myEmail;
apt = [self appointment];
myEmail = [self emailForUser];
#if 0 /* ZNeK 20041208 - Maxime says this isn't relevant to agenor */
if ([apt isOrganizer:myEmail])
return YES;
#endif
return [apt isParticipant:myEmail];
}
- (NSString *)aptStyle {
if (![self isMyApt])
return @"aptprintview_apt_other";
return nil;
}
@end /* UIxAppointmentPrintview */
+488
View File
@@ -0,0 +1,488 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $
#include <SOGoUI/UIxComponent.h>
@interface UIxAppointmentProposal : UIxComponent
{
id item;
id currentDay;
/* individual values */
id startDateHour;
id startDateMinute;
id endDateHour;
id endDateMinute;
id startDateDay;
id startDateMonth;
id startDateYear;
id endDateDay;
id endDateMonth;
id endDateYear;
NSArray *participants; /* array of iCalPerson's */
NSArray *resources; /* array of iCalPerson's */
id duration;
NSArray *blockedRanges;
NSMutableDictionary *currentQueryParameters;
}
- (NSMutableDictionary *)currentQueryParameters;
- (NSDictionary *)currentHourQueryParametersForFirstHalf:(BOOL)_first;
- (void)setICalPersons:(NSArray *)_ps asQueryParameter:(NSString *)_qp;
@end
#include <SoObjects/Appointments/SOGoAppointmentFolder.h>
#include <SoObjects/Appointments/SOGoFreeBusyObject.h>
#include <NGExtensions/NGCalendarDateRange.h>
#include <NGiCal/NGiCal.h>
#include "common.h"
@implementation UIxAppointmentProposal
- (void)dealloc {
[self->blockedRanges release];
[self->startDateHour release];
[self->startDateMinute release];
[self->startDateDay release];
[self->startDateMonth release];
[self->startDateYear release];
[self->endDateHour release];
[self->endDateMinute release];
[self->endDateDay release];
[self->endDateMonth release];
[self->endDateYear release];
[self->duration release];
[self->participants release];
[self->resources release];
[self->currentQueryParameters release];
[super dealloc];
}
/* notifications */
- (void)sleep {
[self->currentDay release]; self->currentDay = nil;
[self->item release]; self->item = nil;
[super sleep];
}
/* accessors */
- (void)setItem:(id)_item {
ASSIGN(self->item, _item);
}
- (id)item {
return self->item;
}
- (void)setStartDateHour:(id)_startDateHour {
ASSIGN(self->startDateHour, _startDateHour);
}
- (id)startDateHour {
return self->startDateHour;
}
- (void)setStartDateMinute:(id)_startDateMinute {
ASSIGN(self->startDateMinute, _startDateMinute);
}
- (id)startDateMinute {
return self->startDateMinute;
}
- (void)setStartDateDay:(id)_startDateDay {
ASSIGN(self->startDateDay, _startDateDay);
}
- (id)startDateDay {
return self->startDateDay;
}
- (void)setStartDateMonth:(id)_startDateMonth {
ASSIGN(self->startDateMonth, _startDateMonth);
}
- (id)startDateMonth {
return self->startDateMonth;
}
- (void)setStartDateYear:(id)_startDateYear {
ASSIGN(self->startDateYear, _startDateYear);
}
- (id)startDateYear {
return self->startDateYear;
}
- (void)setEndDateHour:(id)_endDateHour {
ASSIGN(self->endDateHour, _endDateHour);
}
- (id)endDateHour {
return self->endDateHour;
}
- (void)setEndDateMinute:(id)_endDateMinute {
ASSIGN(self->endDateMinute, _endDateMinute);
}
- (id)endDateMinute {
return self->endDateMinute;
}
- (void)setEndDateDay:(id)_endDateDay {
ASSIGN(self->endDateDay, _endDateDay);
}
- (id)endDateDay {
return self->endDateDay;
}
- (void)setEndDateMonth:(id)_endDateMonth {
ASSIGN(self->endDateMonth, _endDateMonth);
}
- (id)endDateMonth {
return self->endDateMonth;
}
- (void)setEndDateYear:(id)_endDateYear {
ASSIGN(self->endDateYear, _endDateYear);
}
- (id)endDateYear {
return self->endDateYear;
}
- (void)setStartDate:(NSCalendarDate *)_date {
[self setStartDateHour:[NSNumber numberWithInt:[_date hourOfDay]]];
[self setStartDateMinute:[NSNumber numberWithInt:[_date minuteOfHour]]];
[self setStartDateDay:[NSNumber numberWithInt:[_date dayOfMonth]]];
[self setStartDateMonth:[NSNumber numberWithInt:[_date monthOfYear]]];
[self setStartDateYear:[NSNumber numberWithInt:[_date yearOfCommonEra]]];
}
- (NSCalendarDate *)startDate {
return [NSCalendarDate dateWithYear:[[self startDateYear] intValue]
month:[[self startDateMonth] intValue]
day:[[self startDateDay] intValue]
hour:[[self startDateHour] intValue]
minute:[[self startDateMinute] intValue]
second:0
timeZone:[self viewTimeZone]];
}
- (void)setEndDate:(NSCalendarDate *)_date {
[self setEndDateHour:[NSNumber numberWithInt:[_date hourOfDay]]];
[self setEndDateMinute:[NSNumber numberWithInt:[_date minuteOfHour]]];
[self setEndDateDay:[NSNumber numberWithInt:[_date dayOfMonth]]];
[self setEndDateMonth:[NSNumber numberWithInt:[_date monthOfYear]]];
[self setEndDateYear:[NSNumber numberWithInt:[_date yearOfCommonEra]]];
}
- (NSCalendarDate *)endDate {
return [NSCalendarDate dateWithYear:[[self endDateYear] intValue]
month:[[self endDateMonth] intValue]
day:[[self endDateDay] intValue]
hour:[[self endDateHour] intValue]
minute:[[self endDateMinute] intValue]
second:59
timeZone:[self viewTimeZone]];
}
- (void)setDuration:(id)_duration {
ASSIGN(self->duration, _duration);
}
- (id)duration {
return self->duration;
}
- (int)durationInMinutes {
return [[self duration] intValue];
}
- (NSTimeInterval)durationAsTimeInterval {
return [self durationInMinutes] * 60;
}
- (NSString *)itemDurationText {
// TODO: use a formatter
// TODO: localize
switch ([[self item] intValue]) {
case 30: return @"30 minutes";
case 60: return @"1 hour";
case 120: return @"2 hours";
case 240: return @"4 hours";
case 480: return @"8 hours";
default:
return [NSString stringWithFormat:@"%@ minutes", [self item]];
}
}
- (void)setParticipants:(NSArray *)_parts {
ASSIGN(self->participants, _parts);
}
- (NSArray *)participants {
return self->participants;
}
- (void)setResources:(NSArray *)_res {
ASSIGN(self->resources, _res);
}
- (NSArray *)resources {
return self->resources;
}
- (NSArray *)attendees {
NSArray *a, *b;
a = [self participants];
b = [self resources];
if ([b count] == 0) return a;
if ([a count] == 0) return b;
return [a arrayByAddingObjectsFromArray:b];
}
- (void)setCurrentDay:(id)_day {
ASSIGN(self->currentDay, _day);
}
- (id)currentDay {
return self->currentDay;
}
- (NSArray *)hours {
// TODO: from 'earliest start' to 'latest endtime'
unsigned lStartHour = 9, lEndHour = 17, i;
NSMutableArray *ma;
lStartHour = [[self startDateHour] intValue];
lEndHour = [[self endDateHour] intValue];
if (lStartHour < 1) lStartHour = 1;
if (lEndHour < lStartHour) lEndHour = lStartHour + 1;
ma = [NSMutableArray arrayWithCapacity:lEndHour - lStartHour + 2];
for (i = lStartHour; i <= lEndHour; i++)
[ma addObject:[NSNumber numberWithInt:i]];
return ma;
}
- (NSArray *)days {
// TODO: from startdate to enddate
NSMutableArray *ma;
NSCalendarDate *base, *stop, *current;
base = [NSCalendarDate dateWithYear:[[self startDateYear] intValue]
month:[[self startDateMonth] intValue]
day:[[self startDateDay] intValue]
hour:12 minute:0 second:0
timeZone:[self viewTimeZone]];
stop = [NSCalendarDate dateWithYear:[[self endDateYear] intValue]
month:[[self endDateMonth] intValue]
day:[[self endDateDay] intValue]
hour:12 minute:0 second:0
timeZone:[self viewTimeZone]];
ma = [NSMutableArray arrayWithCapacity:16];
current = base;
while ([current compare:stop] != NSOrderedDescending) {
[current setTimeZone:[self viewTimeZone]];
[ma addObject:current];
/* Note: remember the timezone behaviour of the method below! */
current = [current dateByAddingYears:0 months:0 days:1];
}
return ma;
}
- (NSArray *)durationSteps {
// TODO: make configurable
return [NSArray arrayWithObjects:
@"30", @"60", @"120", @"240", @"480", nil];
}
/* slots */
- (BOOL)isRangeGreen:(NGCalendarDateRange *)_range {
unsigned idx;
idx = [self->blockedRanges indexOfFirstIntersectingDateRange:_range];
if (idx != NSNotFound) {
[self debugWithFormat:@"blocked range:\n range: %@\n block: %@\nintersection:%@",
_range,
[self->blockedRanges objectAtIndex:idx],
[_range intersectionDateRange:[self->blockedRanges objectAtIndex:idx]]];
}
return idx == NSNotFound ? YES : NO;
}
- (BOOL)isSlotRangeGreen:(NGCalendarDateRange *)_slotRange {
NGCalendarDateRange *aptRange;
NSCalendarDate *aptStartDate, *aptEndDate;
if (_slotRange == nil)
return NO;
/* calculate the interval requested by the user (can be larger) */
aptStartDate = [_slotRange startDate];
// TODO: gives warning on MacOSX
aptEndDate = [[NSCalendarDate alloc] initWithTimeIntervalSince1970:
[aptStartDate timeIntervalSince1970]
+ [self durationAsTimeInterval]];
[aptStartDate setTimeZone:[self viewTimeZone]];
[aptEndDate setTimeZone:[self viewTimeZone]];
aptRange = [NGCalendarDateRange calendarDateRangeWithStartDate:aptStartDate
endDate:aptEndDate];
[aptEndDate release]; aptEndDate = nil;
return [self isRangeGreen:aptRange];
}
- (BOOL)isFirstHalfGreen {
/* currentday is the date, self->item the hour */
NSCalendarDate *from, *to;
NGCalendarDateRange *range;
from = [self->currentDay hour:[[self item] intValue] minute:0];
to = [self->currentDay hour:[[self item] intValue] minute:30];
range = [NGCalendarDateRange calendarDateRangeWithStartDate:from endDate:to];
return [self isSlotRangeGreen:range];
}
- (BOOL)isSecondHalfGreen {
/* currentday is the date, self->item the hour */
NSCalendarDate *from, *to;
NGCalendarDateRange *range;
from = [self->currentDay hour:[[self item] intValue] minute:30];
to = [self->currentDay hour:[[self item] intValue] + 1 minute:0];
range = [NGCalendarDateRange calendarDateRangeWithStartDate:from endDate:to];
return [self isSlotRangeGreen:range];
}
- (BOOL)isFirstHalfBlocked {
return [self isFirstHalfGreen] ? NO : YES;
}
- (BOOL)isSecondHalfBlocked {
return [self isSecondHalfGreen] ? NO : YES;
}
/* actions */
- (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c{
return YES;
}
- (id<WOActionResults>)defaultAction {
NSCalendarDate *now;
now = [NSCalendarDate date];
[self setDuration:@"120"]; /* 1 hour as default */
[self setStartDate:[now hour:9 minute:0]];
[self setEndDate:[now hour:18 minute:0]];
return self;
}
- (id)proposalSearchAction {
NSArray *attendees, *uids, *fbos, *ranges;
unsigned i, count;
NSMutableArray *allInfos;
[self logWithFormat:@"search from %@ to %@",
[self startDate], [self endDate]];
attendees = [self attendees];
uids = [[self clientObject] uidsFromICalPersons:attendees];
if ([uids count] == 0) {
[self logWithFormat:@"Note: no UIDs selected."];
return self;
}
fbos = [[self clientObject] lookupFreeBusyObjectsForUIDs:uids
inContext:[self context]];
count = [fbos count];
// wild guess at capacity
allInfos = [[[NSMutableArray alloc] initWithCapacity:count * 10] autorelease];
for (i = 0; i < count; i++) {
SOGoFreeBusyObject *fb;
NSArray *infos;
fb = [fbos objectAtIndex:i];
if (fb != (SOGoFreeBusyObject *)[NSNull null]) {
infos = [fb fetchFreebusyInfosFrom:[self startDate] to:[self endDate]];
[allInfos addObjectsFromArray:infos];
}
}
[self debugWithFormat:@" processing: %d infos", [allInfos count]];
ranges = [allInfos arrayByCreatingDateRangesFromObjectsWithStartDateKey:
@"startDate"
andEndDateKey:@"endDate"];
ranges = [ranges arrayByCompactingContainedDateRanges];
[self debugWithFormat:@" ranges: %@", ranges];
ASSIGNCOPY(self->blockedRanges, ranges);
return self;
}
/* URLs */
- (NSMutableDictionary *)currentQueryParameters {
if(!self->currentQueryParameters) {
self->currentQueryParameters = [[self queryParameters] mutableCopy];
[self->currentQueryParameters setObject:[self duration] forKey:@"dur"];
[self setICalPersons:[self resources] asQueryParameter:@"rs"];
[self setICalPersons:[self participants] asQueryParameter:@"ps"];
}
return self->currentQueryParameters;
}
- (void)setICalPersons:(NSArray *)_ps asQueryParameter:(NSString *)_qp {
NSMutableString *s;
unsigned i, count;
s = [[NSMutableString alloc] init];
count = [_ps count];
for(i = 0; i < count; i++) {
iCalPerson *p = [_ps objectAtIndex:i];
[s appendString:[p rfc822Email]];
if(i != (count - 1))
[s appendString:@","];
}
[[self currentQueryParameters] setObject:s forKey:_qp];
[s release];
}
- (NSDictionary *)currentHourQueryParametersForFirstHalf:(BOOL)_first {
NSMutableDictionary *qp;
NSString *hmString;
NSCalendarDate *date;
unsigned minute;
minute = _first ? 0 : 30;
qp = [self currentQueryParameters];
date = [self currentDay];
hmString = [NSString stringWithFormat:@"%02d%02d",
[item intValue], minute];
[self setSelectedDateQueryParameter:date inDictionary:qp];
[qp setObject:hmString forKey:@"hm"];
return qp;
}
- (NSDictionary *)currentFirstHalfQueryParameters {
return [self currentHourQueryParametersForFirstHalf:YES];
}
- (NSDictionary *)currentSecondHalfQueryParameters {
return [self currentHourQueryParametersForFirstHalf:NO];
}
@end /* UIxAppointmentProposal */
+39
View File
@@ -0,0 +1,39 @@
// $Id: UIxAppointmentView.h 768 2005-07-15 00:13:01Z helge $
#ifndef __SOGo_UIxAppointmentView_H__
#define __SOGo_UIxAppointmentView_H__
#include <SOGoUI/UIxComponent.h>
@class NSCalendarDate;
@class SOGoAppointment;
@class SOGoDateFormatter;
@interface UIxAppointmentView : UIxComponent
{
id appointment;
id attendee;
SOGoDateFormatter *dateFormatter;
id item;
}
- (SOGoAppointment *)appointment;
/* permissions */
- (BOOL)canAccessApt;
- (BOOL)canEditApt;
- (SOGoDateFormatter *)dateFormatter;
- (NSCalendarDate *)startTime;
- (NSCalendarDate *)endTime;
- (NSString *)attributesTabLink;
- (NSString *)participantsTabLink;
- (NSString *)completeHrefForMethod:(NSString *)_method
withParameter:(NSString *)_param
forKey:(NSString *)_key;
@end
#endif /* __SOGo_UIxAppointmentView_H__ */
+268
View File
@@ -0,0 +1,268 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include "UIxAppointmentView.h"
#include <NGiCal/NGiCal.h>
#include <SOGo/SOGoAppointment.h>
#include <SOGo/WOContext+Agenor.h>
#include <Appointments/SOGoAppointmentObject.h>
#include <SOGoUI/SOGoDateFormatter.h>
#include "UIxComponent+Agenor.h"
#include "common.h"
@interface UIxAppointmentView (PrivateAPI)
- (BOOL)isAttendeeActiveUser;
@end
@implementation UIxAppointmentView
- (void)dealloc {
[self->appointment release];
[self->attendee release];
[self->dateFormatter release];
[self->item release];
[super dealloc];
}
/* accessors */
- (NSString *)tabSelection {
NSString *selection;
selection = [self queryParameterForKey:@"tab"];
if (selection == nil)
selection = @"attributes";
return selection;
}
- (void)setAttendee:(id)_attendee {
ASSIGN(self->attendee, _attendee);
}
- (id)attendee {
return self->attendee;
}
- (BOOL)isAttendeeActiveUser {
NSString *email, *attEmail;
email = [[[self context] activeUser] email];
attEmail = [[self attendee] rfc822Email];
return [email isEqualToString:attEmail];
}
- (BOOL)showAcceptButton {
return [[self attendee] participationStatus] != iCalPersonPartStatAccepted;
}
- (BOOL)showRejectButton {
return [[self attendee] participationStatus] != iCalPersonPartStatDeclined;
}
- (NSString *)attendeeStatusColspan {
return [self isAttendeeActiveUser] ? @"1" : @"2";
}
- (void)setItem:(id)_item {
ASSIGN(self->item, _item);
}
- (id)item {
return self->item;
}
- (SOGoDateFormatter *)dateFormatter {
if (self->dateFormatter == nil) {
self->dateFormatter =
[[SOGoDateFormatter alloc] initWithLocale:[self locale]];
[self->dateFormatter setFullWeekdayNameAndDetails];
}
return self->dateFormatter;
}
- (NSCalendarDate *)startTime {
NSCalendarDate *date;
date = [[self appointment] startDate];
[date setTimeZone:[self viewTimeZone]];
return date;
}
- (NSCalendarDate *)endTime {
NSCalendarDate *date;
date = [[self appointment] endDate];
[date setTimeZone:[self viewTimeZone]];
return date;
}
- (NSString *)resourcesAsString {
NSArray *resources, *cns;
resources = [[self appointment] resources];
cns = [resources valueForKey:@"cnForDisplay"];
return [cns componentsJoinedByString:@"<br />"];
}
- (NSString *)categoriesAsString {
unsigned i, count;
NSArray *cats;
NSMutableString *s;
s = [NSMutableString stringWithCapacity:32];
cats = [((SOGoAppointment *)self->appointment) categories];
count = [cats count];
for(i = 0; i < count; i++) {
NSString *cat, *label;
cat = [cats objectAtIndex:i];
label = [self labelForKey:cat];
[s appendString:label];
if(i != (count - 1))
[s appendString:@", "];
}
return s;
}
/* backend */
- (SOGoAppointment *)appointment {
NSString *iCalString;
if (self->appointment != nil)
return self->appointment;
iCalString = [[self clientObject] valueForKey:@"iCalString"];
if (![iCalString isNotNull] || [iCalString length] == 0) {
[self errorWithFormat:@"(%s): missing iCal string!",
__PRETTY_FUNCTION__];
return nil;
}
self->appointment = [[SOGoAppointment alloc] initWithICalString:iCalString];
return self->appointment;
}
/* hrefs */
- (NSString *)attributesTabLink {
return [self completeHrefForMethod:[self ownMethodName]
withParameter:@"attributes"
forKey:@"tab"];
}
- (NSString *)participantsTabLink {
return [self completeHrefForMethod:[self ownMethodName]
withParameter:@"participants"
forKey:@"tab"];
}
- (NSString *)debugTabLink {
return [self completeHrefForMethod:[self ownMethodName]
withParameter:@"debug"
forKey:@"tab"];
}
- (NSString *)completeHrefForMethod:(NSString *)_method
withParameter:(NSString *)_param
forKey:(NSString *)_key
{
NSString *href;
[self setQueryParameter:_param forKey:_key];
href = [self completeHrefForMethod:[self ownMethodName]];
[self setQueryParameter:nil forKey:_key];
return href;
}
/* access */
- (BOOL)isMyApt {
NSString *email;
iCalPerson *organizer;
email = [[[self context] activeUser] email];
organizer = [[self appointment] organizer];
if (!organizer) return YES; // assume this is correct to do, right?
return [[organizer rfc822Email] isEqualToString:email];
}
- (BOOL)canAccessApt {
NSString *email;
NSArray *partMails;
if ([self isMyApt])
return YES;
/* not my apt - can access if it's public */
if ([[self appointment] isPublic])
return YES;
/* can access it if I'm invited :-) */
email = [[[self context] activeUser] email];
partMails = [[[self appointment] participants] valueForKey:@"rfc822Email"];
return [partMails containsObject:email];
}
- (BOOL)canEditApt {
return [self isMyApt];
}
/* action */
- (id<WOActionResults>)defaultAction {
if ([self appointment] == nil) {
return [NSException exceptionWithHTTPStatus:404 /* Not Found */
reason:@"could not locate appointment"];
}
return self;
}
- (BOOL)isDeletableClientObject {
return [[self clientObject] respondsToSelector:@selector(delete)];
}
- (id)deleteAction {
NSException *ex;
id url;
if ([self appointment] == nil) {
return [NSException exceptionWithHTTPStatus:404 /* Not Found */
reason:@"could not locate appointment"];
}
if (![self isDeletableClientObject]) {
/* return 400 == Bad Request */
return [NSException exceptionWithHTTPStatus:400
reason:@"method cannot be invoked on "
@"the specified object"];
}
if ((ex = [[self clientObject] delete]) != nil) {
// TODO: improve error handling
[self debugWithFormat:@"failed to delete: %@", ex];
return ex;
}
url = [[[self clientObject] container] baseURLInContext:[self context]];
return [self redirectToLocation:url];
}
@end /* UIxAppointmentView */
+75
View File
@@ -0,0 +1,75 @@
/*
Copyright (C) 2000-2003 SKYRIX Software AG
This file is part of OGo
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxAptTableView.m 59 2004-06-22 13:40:19Z znek $
#include <NGObjWeb/SoComponent.h>
@class NSArray, NSCalendarDate;
@interface UIxAptTableView : SoComponent
{
NSArray *appointments;
id appointment;
}
/* accessors */
- (NSArray *)appointments;
- (id)appointment;
@end
#include "common.h"
@implementation UIxAptTableView
- (void)dealloc {
[self->appointment release];
[self->appointments release];
[super dealloc];
}
/* accessors */
- (void)setAppointments:(NSArray *)_apts {
ASSIGN(self->appointments, _apts);
}
- (NSArray *)appointments {
return self->appointments;
}
- (void)setAppointment:(id)_apt {
ASSIGN(self->appointment, _apt);
}
- (id)appointment {
return self->appointment;
}
- (NSString *)appointmentViewURL {
id pkey;
if ((pkey = [[self appointment] valueForKey:@"dateId"]) == nil)
return nil;
return [NSString stringWithFormat:@"%@/view", pkey];
}
@end /* UIxAptTableView */
+49
View File
@@ -0,0 +1,49 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalBackForthNavView.m 181 2004-08-11 15:13:25Z helge $
#include <NGObjWeb/NGObjWeb.h>
/*
Associations:
methodName -> maps to href
prevQueryParameters -> queryDictionary
currentQueryParameters -> queryDictionary
nextQueryParameters -> queryDictionary
label -> user presentable name to display for "this"
*/
@interface UIxCalBackForthNavView : WOComponent
{
}
@end
@implementation UIxCalBackForthNavView
- (BOOL)synchronizesVariablesWithBindings {
return NO;
}
@end
+134
View File
@@ -0,0 +1,134 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalDateLabel.m 619 2005-03-02 15:16:32Z znek $
#include <SOGoUI/UIxComponent.h>
@interface UIxCalDateLabel : UIxComponent
{
NSString *selection;
NSCalendarDate *startDate;
NSCalendarDate *endDate;
}
- (NSString *)dayLabel;
- (NSString *)weekLabel;
- (NSString *)monthLabel;
- (NSString *)yearLabel;
@end
#include "common.h"
#include <NGiCal/NGiCal.h>
@implementation UIxCalDateLabel
- (void)dealloc {
[self->selection release];
[self->startDate release];
[self->endDate release];
[super dealloc];
}
/* accessors */
- (void)setSelection:(NSString *)_selection {
ASSIGNCOPY(self->selection, _selection);
}
- (NSString *)selection {
return self->selection;
}
- (void)setStartDate:(NSCalendarDate *)_date {
ASSIGN(self->startDate, _date);
}
- (NSCalendarDate *)startDate {
return self->startDate;
}
- (void)setEndDate:(NSCalendarDate *)_date {
ASSIGN(self->endDate, _date);
}
- (NSCalendarDate *)endDate {
return self->endDate;
}
- (NSString *)label {
NSString *key = [self selection];
if([key isEqualToString:@"day"])
return [self dayLabel];
if ([key isEqualToString:@"week"])
return [self weekLabel];
if ([key isEqualToString:@"month"])
return [self monthLabel];
return [self yearLabel];
}
- (NSString *)dayLabel {
NSString *fmt;
fmt = [self labelForKey:@"dayLabelFormat"];
return [self->startDate descriptionWithCalendarFormat:fmt];
}
- (NSString *)weekLabel {
NSString *label;
label = [self localizedNameForMonthOfYear:[self->startDate monthOfYear]];
label = [NSString stringWithFormat:@"%@ %d",
label,
[self->startDate yearOfCommonEra]];
if ([self->startDate monthOfYear] != [self->endDate monthOfYear]) {
NSString *le;
le = [self localizedNameForMonthOfYear:[self->endDate monthOfYear]];
label = [NSString stringWithFormat:@"<nobr>%@ / %@ %d</nobr>",
label, le,
[self->endDate yearOfCommonEra]];
}
return label;
}
- (NSString *)monthLabel {
NSString *l;
unsigned diff;
diff = [self->startDate monthsBetweenDate:self->endDate];
if (diff == 0) {
l = [self localizedNameForMonthOfYear:[self->startDate monthOfYear]];
}
else {
NSCalendarDate *date;
date = [self->startDate dateByAddingYears:0 months:0 days:15];
l = [self localizedNameForMonthOfYear:[date monthOfYear]];
}
return [NSString stringWithFormat:@"%@ %d",
l, [self->startDate yearOfCommonEra]];
}
- (NSString *)yearLabel {
return [NSString stringWithFormat:@"%d",
[self->startDate yearOfCommonEra]];
}
@end /* UIxCalDateLabel */
+62
View File
@@ -0,0 +1,62 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalDayChartview.m 663 2005-07-05 18:13:24Z znek $
#include "UIxCalDayView.h"
@interface UIxCalDayChartview : UIxCalDayView
{
}
@end
#include "common.h"
#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalDayChartview
- (void)configureFormatters {
[super configureFormatters];
[self->aptFormatter setShortTitleOnly];
}
- (NSArray *)columns {
static NSArray *columns = nil;
if(columns == nil) {
columns = [[NSArray arrayWithObject:@"0"] retain];
}
return columns;
}
- (BOOL)isPadColumn {
return NO;
}
- (NSString *)shortTextForApt {
if (![self canAccessApt])
return @"";
return [[self appointment] valueForKey:@"title"];
}
@end
+101
View File
@@ -0,0 +1,101 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include "UIxCalDayView.h"
/*
UIxCalDayListview
TODO: describe
*/
@class NSArray;
@interface UIxCalDayListview : UIxCalDayView
{
NSArray *uids;
id currentUid;
}
@end
#include "common.h"
#include <SOGoUI/SOGoAptFormatter.h>
#include <SOGo/AgenorUserManager.h>
#include <SoObjects/Appointments/SOGoAppointmentFolder.h>
@implementation UIxCalDayListview
- (void)dealloc {
[self->uids release];
[self->currentUid release];
[super dealloc];
}
- (void)configureFormatters {
[super configureFormatters];
[self->aptFormatter setShortTitleOnly];
}
/* accessors */
- (NSArray *)uids {
if (self->uids == nil) {
// TODO: use -copy?
self->uids = [[[(SOGoAppointmentFolder *)[self clientObject] calendarUIDs]
sortedArrayUsingSelector:@selector(compareAscending:)]
retain];
}
return self->uids;
}
- (void)setCurrentUid:(id)_currentUid { // TODO: NSString?
ASSIGN(self->currentUid, _currentUid);
}
- (id)currentUid {
return self->currentUid;
}
- (NSString *)cnForCurrentUid {
return [[AgenorUserManager sharedUserManager] getCNForUID:self->currentUid];
}
- (NSString *)shortTextForApt {
if (![self canAccessApt])
return @"";
return [[self appointment] valueForKey:@"title"];
}
- (BOOL)isRowActive {
AgenorUserManager *um;
NSString *mailChunk;
NSString *currentMail;
um = [AgenorUserManager sharedUserManager];
currentMail = [um getEmailForUID:self->currentUid];
mailChunk = [self->appointment valueForKey:@"partmails"];
return ([mailChunk rangeOfString:currentMail].length > 0) ? YES : NO;
}
@end /* UIxCalDayListview */
+42
View File
@@ -0,0 +1,42 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalDayOverview.h 193 2004-08-12 18:08:29Z znek $
#ifndef __UIxCalDayOverview_H__
#define __UIxCalDayOverview_H__
#include "UIxCalDayView.h"
@class NSArray;
@interface UIxCalDayOverview : UIxCalDayView
{
NSArray *currentApts;
}
- (void)setCurrentApts:(NSArray *)_apts;
- (NSArray *)currentApts;
- (int)minRequiredRowSpan;
@end
#endif /* __UIxCalDayOverview_H__ */
+126
View File
@@ -0,0 +1,126 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalDayOverview.m 663 2005-07-05 18:13:24Z znek $
#include "UIxCalDayOverview.h"
#include "common.h"
#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalDayOverview
- (void)dealloc {
[self->currentApts release];
[super dealloc];
}
- (void)setCurrentApts:(NSArray *)_apts {
ASSIGN(self->currentApts, _apts);
}
- (NSArray *)currentApts {
return self->currentApts;
}
- (int)minRequiredRowSpan {
unsigned count = [[self aptsForCurrentDate] count];
return count == 0 ? 1 : count;
}
/* overriding */
- (void)configureFormatters {
[super configureFormatters];
[self->aptFormatter setSingleLineFullDetails];
[self->aptTooltipFormatter setTooltip];
}
- (NSArray *)aptsForCurrentDate {
NSArray *apts;
NSMutableArray *filtered;
unsigned i, count;
NSCalendarDate *start, *end;
start = self->currentDate;
end = [start dateByAddingYears:0
months:0
days:0
hours:0
minutes:59
seconds:59];
apts = [self appointments];
filtered = [[NSMutableArray alloc] initWithCapacity:1];
count = [apts count];
for (i = 0; i < count; i++) {
id apt;
NSCalendarDate *aptStartDate;
apt = [apts objectAtIndex:i];
aptStartDate = [apt valueForKey:@"startDate"];
if([aptStartDate isGreaterThanOrEqualTo:start] &&
[aptStartDate isLessThan:end])
{
[filtered addObject:apt];
}
}
return [filtered autorelease];
}
- (NSArray *)allDayApts {
NSCalendarDate *start;
NSArray *apts;
NSMutableArray *filtered;
unsigned i, count;
if (self->allDayApts)
return self->allDayApts;
start = [self startDate];
apts = [self appointments];
filtered = [[NSMutableArray alloc] initWithCapacity:1];
count = [apts count];
for (i = 0; i < count; i++) {
id apt;
NSNumber *bv;
apt = [apts objectAtIndex:i];
bv = [apt valueForKey:@"isallday"];
if ([bv boolValue]) {
[filtered addObject:apt];
}
else {
NSCalendarDate *aptStartDate;
aptStartDate = [apt valueForKey:@"startDate"];
if([aptStartDate isLessThan:start]) {
[filtered addObject:apt];
}
}
}
ASSIGN(self->allDayApts, filtered);
[filtered release];
return self->allDayApts;
}
@end
+52
View File
@@ -0,0 +1,52 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalDayPrintview.m 463 2004-12-08 14:01:10Z znek $
#include "UIxCalDayOverview.h"
@interface UIxCalDayPrintview : UIxCalDayOverview
{
}
@end
#include "common.h"
@implementation UIxCalDayPrintview
- (NSString *)title {
NSString *fmt;
fmt = [self labelForKey:@"dayLabelFormat"];
return [[self startDate] descriptionWithCalendarFormat:fmt];
}
/* style sheet */
- (NSString *)aptStyle {
if (![self isMyApt])
return @"dayprintview_apt_other";
return nil;
}
@end
+49
View File
@@ -0,0 +1,49 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalDayView.h 181 2004-08-11 15:13:25Z helge $
#ifndef __UIxCalDayView_H_
#define __UIxCalDayView_H_
#include "UIxCalView.h"
@interface UIxCalDayView : UIxCalView
{
NSCalendarDate *currentDate;
}
- (void)setCurrentDate:(NSCalendarDate *)_date;
- (NSCalendarDate *)currentDate;
- (BOOL)isCurrentDateInApt;
- (NSDictionary *)currentDateQueryParameters;
- (NSArray *)dateRange;
/* appointments */
- (NSArray *)aptsForCurrentDate;
- (BOOL)hasAptsForCurrentDate;
@end
#endif /* __UIxCalDayView_H_ */
+218
View File
@@ -0,0 +1,218 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalDayView.m 663 2005-07-05 18:13:24Z znek $
#import "UIxCalDayView.h"
#include "common.h"
#include <EOControl/EOControl.h>
#include <NGExtensions/NGCalendarDateRange.h>
@interface UIxCalDayView (PrivateAPI)
- (BOOL)isCurrentDateInApt:(id)_apt;
- (NSArray *)_getDatesFrom:(NSCalendarDate *)_from to:(NSCalendarDate *)_to;
@end
@implementation UIxCalDayView
- (void)dealloc {
[self->currentDate release];
[super dealloc];
}
- (void)setCurrentDate:(NSCalendarDate *)_date {
ASSIGN(self->currentDate, _date);
}
- (NSCalendarDate *)currentDate {
return self->currentDate;
}
- (BOOL)isCurrentDateInApt {
return [self isCurrentDateInApt:[self appointment]];
}
- (BOOL)isCurrentDateInApt:(id)_apt {
NSCalendarDate *dateStart, *dateEnd, *aptStart, *aptEnd;
NGCalendarDateRange *dateRange, *aptRange;
dateStart = self->currentDate;
dateEnd = [dateStart dateByAddingYears:0 months:0 days:0
hours:1 minutes:0 seconds:0];
dateRange = [NGCalendarDateRange calendarDateRangeWithStartDate:dateStart
endDate:dateEnd];
aptStart = [self->appointment valueForKey:@"startDate"];
aptEnd = [self->appointment valueForKey:@"endDate"];
aptRange = [NGCalendarDateRange calendarDateRangeWithStartDate:aptStart
endDate:aptEnd];
return [dateRange doesIntersectWithDateRange:aptRange];
}
- (NSArray *)dateRange {
/* default range is from dayStartHour to dayEndHour. Any values before
or after are also fine */
NSCalendarDate *min, *max;
NSArray *aptDateRanges;
min = [[self startDate] hour:[self dayStartHour] minute:0];
max = [[self startDate] hour:[self dayEndHour] minute:0];
aptDateRanges = [[self appointments] valueForKey:@"startDate"];
if([aptDateRanges count] != 0) {
NSCalendarDate *d;
aptDateRanges = [aptDateRanges sortedArrayUsingSelector:@selector(compareAscending:)];
d = [aptDateRanges objectAtIndex:0];
if ([d isDateOnSameDay:min])
min = (NSCalendarDate *)[d earlierDate:min];
d = [aptDateRanges objectAtIndex:[aptDateRanges count] - 1];
if ([d isDateOnSameDay:max])
max = (NSCalendarDate *)[d laterDate:max];
}
return [self _getDatesFrom:min to:max];
}
- (NSArray *)_getDatesFrom:(NSCalendarDate *)_from to:(NSCalendarDate *)_to {
NSMutableArray *dates;
unsigned i, count, offset;
offset = [_from hourOfDay];
count = ([_to hourOfDay] + 1) - offset;
dates = [[NSMutableArray alloc] initWithCapacity:count];
for(i = 0; i < count; i++) {
NSCalendarDate *date;
date = [_from hour:offset + i minute:0];
[dates addObject:date];
}
return [dates autorelease];
}
/* URLs */
- (NSDictionary *)prevDayQueryParameters {
NSCalendarDate *date;
date = [[self startDate] dateByAddingYears:0 months:0 days:-1
hours:0 minutes:0 seconds:0];
return [self queryParametersBySettingSelectedDate:date];
}
- (NSDictionary *)nextDayQueryParameters {
NSCalendarDate *date;
date = [[self startDate] dateByAddingYears:0 months:0 days:1
hours:0 minutes:0 seconds:0];
return [self queryParametersBySettingSelectedDate:date];
}
- (NSDictionary *)currentDateQueryParameters {
NSMutableDictionary *qp;
NSString *hmString;
NSCalendarDate *date;
date = [self currentDate];
hmString = [NSString stringWithFormat:@"%02d%02d",
[date hourOfDay], [date minuteOfHour]];
qp = [[self queryParameters] mutableCopy];
[self setSelectedDateQueryParameter:date inDictionary:qp];
[qp setObject:hmString forKey:@"hm"];
return [qp autorelease];
}
/* fetching */
- (NSCalendarDate *)startDate {
return [[self selectedDate] beginOfDay];
}
- (NSCalendarDate *)endDate {
return [[self startDate] endOfDay];
}
/* appointments */
- (NSArray *)appointments {
return [self fetchCoreInfos];
}
- (NSArray *)aptsForCurrentDate {
NSArray *apts;
NSMutableArray *filtered;
unsigned i, count;
NSCalendarDate *start, *end;
start = self->currentDate;
end = [start dateByAddingYears:0
months:0
days:0
hours:0
minutes:59
seconds:59];
apts = [self appointments];
filtered = [[NSMutableArray alloc] initWithCapacity:1];
count = [apts count];
for(i = 0; i < count; i++) {
id apt;
NSCalendarDate *aptStartDate;
/* NOTE: appointments are totally opaque objects, we don't know much
about them. The reason for this is that they are backend-dependent
and we'd like to use UIx for SOGo *and* ZideStore also.
We have to accept the fact that we know just a little bit
of their API which is completely KVC driven.
*/
apt = [apts objectAtIndex:i];
aptStartDate = [apt valueForKey:@"startDate"];
if([aptStartDate isGreaterThanOrEqualTo:start] &&
[aptStartDate isLessThan:end])
{
[filtered addObject:apt];
}
else {
/* multiple day range? */
NSCalendarDate *aptEndDate;
if ((aptEndDate = [apt valueForKey:@"endDate"])) {
if ([aptEndDate isLessThanOrEqualTo:end] ||
([aptStartDate isLessThan:start] &&
[aptEndDate isGreaterThan:end]))
{
[filtered addObject:apt];
}
}
}
}
return [filtered autorelease];
}
- (BOOL)hasAptsForCurrentDate {
return [[self aptsForCurrentDate] count] != 0;
}
@end
+156
View File
@@ -0,0 +1,156 @@
/*
Copyright (C) 2000-2004 SKYRIX Software AG
This file is part of OGo
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalInlineAptView.m 885 2005-07-21 16:41:34Z znek $
#include <NGObjWeb/NGObjWeb.h>
@interface UIxCalInlineAptView : WOComponent
{
id appointment;
id formatter;
id tooltipFormatter;
id url;
id style;
id queryDictionary;
id referenceDate;
BOOL canAccess;
}
@end
#include "common.h"
#include <SOGoUI/SOGoAptFormatter.h>
#include <SOGo/SOGoUser.h>
#include <NGObjWeb/WOContext+SoObjects.h>
@implementation UIxCalInlineAptView
- (void)dealloc {
[self->appointment release];
[self->formatter release];
[self->tooltipFormatter release];
[self->url release];
[self->style release];
[self->queryDictionary release];
[self->referenceDate release];
[super dealloc];
}
- (void)setAppointment:(id)_appointment {
ASSIGN(self->appointment, _appointment);
}
- (id)appointment {
return self->appointment;
}
- (void)setFormatter:(id)_formatter {
ASSIGN(self->formatter, _formatter);
}
- (id)formatter {
return self->formatter;
}
- (void)setTooltipFormatter:(id)_tooltipFormatter {
ASSIGN(self->tooltipFormatter, _tooltipFormatter);
}
- (id)tooltipFormatter {
return self->tooltipFormatter;
}
- (void)setUrl:(id)_url {
ASSIGN(self->url, _url);
}
- (id)url {
return self->url;
}
- (void)setStyle:(id)_style {
NSMutableString *ms;
NSNumber *prio;
NSString *s;
NSString *email;
if (_style) {
ms = [NSMutableString stringWithString:_style];
}
else {
ms = (NSMutableString *)[NSMutableString string];
}
if ((prio = [self->appointment valueForKey:@"priority"])) {
[ms appendFormat:@" apt_prio%@", prio];
}
email = [[[self context] activeUser] email];
if ((s = [self->appointment valueForKey:@"orgmail"])) {
if ([s rangeOfString:email].length > 0) {
[ms appendString:@" apt_organizer"];
}
else {
[ms appendString:@" apt_other"];
}
}
if ((s = [self->appointment valueForKey:@"partmails"])) {
if ([s rangeOfString:email].length > 0) {
[ms appendString:@" apt_participant"];
}
else {
[ms appendString:@" apt_nonparticipant"];
}
}
ASSIGNCOPY(self->style, ms);
}
- (id)style {
return self->style;
}
- (void)setQueryDictionary:(id)_queryDictionary {
ASSIGN(self->queryDictionary, _queryDictionary);
}
- (id)queryDictionary {
return self->queryDictionary;
}
- (void)setReferenceDate:(id)_referenceDate {
ASSIGN(self->referenceDate, _referenceDate);
}
- (id)referenceDate {
return self->referenceDate;
}
- (void)setCanAccess:(BOOL)_canAccess {
self->canAccess = _canAccess;
}
- (BOOL)canAccess {
return self->canAccess;
}
/* helpers */
- (NSString *)title {
return [self->formatter stringForObjectValue:self->appointment
referenceDate:[self referenceDate]];
}
- (NSString *)tooltip {
return [self->tooltipFormatter stringForObjectValue:self->appointment
referenceDate:[self referenceDate]];
}
@end
+265
View File
@@ -0,0 +1,265 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalInlineMonthOverview.m 181 2004-08-11 15:13:25Z helge $
#include "UIxCalMonthOverview.h"
#include <NGExtensions/NGExtensions.h>
@interface UIxCalInlineMonthOverview : UIxCalMonthOverview
{
NSCalendarDate *selectedDate;
NSString *style;
NSString *headerStyle;
NSString *weekStyle;
NSString *todayWeekStyle;
NSString *dayHeaderStyle;
NSString *dayBodyStyle;
NSString *todayBodyStyle;
NSString *inactiveDayBodyStyle;
NSString *selectedDayExtraStyle;
NSString *daySelectionHref;
NSString *weekSelectionHref;
NSString *monthSelectionHref;
BOOL showWeekColumn;
BOOL showYear;
}
@end
@interface NSCalendarDate (UIxCalMonthOverviewExtensions)
- (BOOL)isDateInSameMonth:(NSCalendarDate *)_other;
@end
@implementation NSCalendarDate (UIxCalMonthOverviewExtensions)
- (BOOL)isDateInSameMonth:(NSCalendarDate *)_other {
if(_other == nil)
return NO;
if(([_other yearOfCommonEra] == [self yearOfCommonEra]) &&
([_other monthOfYear] == [self monthOfYear])) {
return YES;
}
return NO;
}
@end
@implementation UIxCalInlineMonthOverview
/* init & dealloc */
- (void)dealloc {
[self->selectedDate release];
[self->style release];
[self->headerStyle release];
[self->weekStyle release];
[self->todayWeekStyle release];
[self->dayHeaderStyle release];
[self->dayBodyStyle release];
[self->todayBodyStyle release];
[self->inactiveDayBodyStyle release];
[self->selectedDayExtraStyle release];
[self->daySelectionHref release];
[self->weekSelectionHref release];
[self->monthSelectionHref release];
[super dealloc];
}
/* binding accessors */
- (void)setSelectedDate:(NSCalendarDate *)_date {
[_date setTimeZone:[self viewTimeZone]];
ASSIGN(self->selectedDate, _date);
}
- (NSCalendarDate *)selectedDate {
return self->selectedDate;
}
- (void)setStyle:(NSString *)_style {
ASSIGN(self->style, _style);
}
- (NSString *)style {
return self->style;
}
- (void)setHeaderStyle:(NSString *)_style {
ASSIGN(self->headerStyle, _style);
}
- (NSString *)headerStyle {
return self->headerStyle;
}
- (void)setWeekStyle:(NSString *)_style {
ASSIGN(self->weekStyle, _style);
}
- (NSString *)weekStyle {
return self->weekStyle;
}
- (void)setTodayWeekStyle:(NSString *)_style {
ASSIGN(self->todayWeekStyle, _style);
}
- (NSString *)todayWeekStyle {
if(self->todayWeekStyle)
return self->todayWeekStyle;
return [self weekStyle];
}
- (void)setDayHeaderStyle:(NSString *)_style {
ASSIGN(self->dayHeaderStyle, _style);
}
- (NSString *)dayHeaderStyle {
return self->dayHeaderStyle;
}
- (void)setDayBodyStyle:(NSString *)_style {
ASSIGN(self->dayBodyStyle, _style);
}
- (NSString *)dayBodyStyle {
return self->dayBodyStyle;
}
- (void)setTodayBodyStyle:(NSString *)_style {
ASSIGN(self->todayBodyStyle, _style);
}
- (NSString *)todayBodyStyle {
return self->todayBodyStyle;
}
- (void)setInactiveDayBodyStyle:(NSString *)_style {
ASSIGN(self->inactiveDayBodyStyle, _style);
}
- (NSString *)inactiveDayBodyStyle {
return self->inactiveDayBodyStyle;
}
- (void)setSelectedDayExtraStyle:(NSString *)_style {
ASSIGN(self->selectedDayExtraStyle, _style);
}
- (NSString *)selectedDayExtraStyle {
return self->selectedDayExtraStyle;
}
- (void)setDaySelectionHref:(NSString *)_href {
ASSIGN(self->daySelectionHref, _href);
}
- (NSString *)daySelectionHref {
return self->daySelectionHref;
}
- (BOOL)hasDaySelectionHref {
return self->daySelectionHref != nil;
}
- (void)setWeekSelectionHref:(NSString *)_href {
ASSIGN(self->weekSelectionHref, _href);
}
- (NSString *)weekSelectionHref {
return self->weekSelectionHref;
}
- (BOOL)hasWeekSelectionHref {
return self->weekSelectionHref != nil;
}
- (void)setMonthSelectionHref:(NSString *)_href {
ASSIGN(self->monthSelectionHref, _href);
}
- (NSString *)monthSelectionHref {
return self->monthSelectionHref;
}
- (BOOL)hasMonthSelectionHref {
return self->monthSelectionHref != nil;
}
- (void)setShowWeekColumn:(BOOL)_yn {
self->showWeekColumn = _yn;
}
- (BOOL)showWeekColumn {
return self->showWeekColumn;
}
- (void)setShowYear:(BOOL)_yn {
self->showYear = _yn;
}
- (BOOL)showYear {
return self->showYear;
}
/* date ranges */
- (NSCalendarDate *)startDate {
return [[self selectedDate] firstDayOfMonth];
}
/* labels */
- (NSString *)headerString {
NSString *label;
label = [self localizedNameForMonthOfYear:[[self startDate] monthOfYear]];
if([self showYear]) {
label = [NSString stringWithFormat:@"%@ %d",
label,
[[self startDate] yearOfCommonEra]];
}
return label;
}
- (NSString *)localizedDayOfWeekName {
return [self localizedAbbreviatedNameForDayOfWeek:[self dayOfWeek]];
}
/* stylesheets */
- (NSString *)currentWeekStyle {
if([self->currentWeekStart isDateInSameWeek:[NSCalendarDate date]] &&
[self->currentWeekStart isDateInSameMonth:[self selectedDate]])
return [self todayWeekStyle];
return [self weekStyle];
}
- (NSString *)currentDayStyle {
return [self dayBodyStyle];
}
- (NSString *)contentStyle {
if([self->currentDay isToday] &&
[self->currentDay isDateInSameMonth:[self selectedDate]])
return [self todayBodyStyle];
else if([self->currentDay monthOfYear] != [[self startDate] monthOfYear])
return [self inactiveDayBodyStyle];
return [self dayBodyStyle];
}
- (NSString *)extraStyle {
if([[self selectedDate] isDateOnSameDay:self->currentDay]) {
return [self selectedDayExtraStyle];
}
return nil;
}
/* URLs */
- (NSDictionary *)currentMonthQueryParameters {
return [self queryParametersBySettingSelectedDate:[self startDate]];
}
/* overriding */
- (NSArray *)fetchCoreInfos {
return nil;
}
@end
+67
View File
@@ -0,0 +1,67 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalMonthOverview.h 181 2004-08-11 15:13:25Z helge $
#include "UIxCalMonthView.h"
@class NSCalendarDate, NSString, NSDictionary, NSArray;
@interface UIxCalMonthOverview : UIxCalMonthView
{
int dayIndex;
int dayOfWeek;
int weekOfYear;
NSCalendarDate *currentWeekStart;
}
- (void)setDayIndex:(int)_idx;
- (int)dayIndex;
- (void)setDayOfWeek:(int)_day;
- (int)dayOfWeek;
- (void)setCurrentWeekStartDate:(NSCalendarDate *)_date;
- (NSCalendarDate *)currentWeekStartDate;
- (void)setWeekOfYear:(int)_week;
- (int)weekOfYear;
- (int)year;
- (int)month;
- (NSString *)localizedDayOfWeekName;
- (NSDictionary *)currentWeekQueryParameters;
/* style sheet */
- (NSString *)weekStyle;
- (NSString *)contentStyle;
/* appointments */
- (NSArray *)appointments;
@end
+103
View File
@@ -0,0 +1,103 @@
// $Id: UIxCalMonthOverview.m 885 2005-07-21 16:41:34Z znek $
#include "UIxCalMonthOverview.h"
#include "common.h"
#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalMonthOverview
- (void)dealloc {
[self->currentWeekStart release];
[super dealloc];
}
- (void)configureFormatters {
[super configureFormatters];
[self->aptFormatter setShortTitleOnly];
[self->privateAptFormatter setPrivateTitleOnly];
}
- (void)setDayIndex:(int)_idx {
self->dayIndex = _idx;
}
- (int)dayIndex {
return self->dayIndex;
}
- (void)setDayOfWeek:(int)_day {
self->dayOfWeek = _day;
}
- (int)dayOfWeek {
return self->dayOfWeek;
}
- (void)setCurrentWeekStartDate:(NSCalendarDate *)_date {
ASSIGN(self->currentWeekStart, _date);
}
- (NSCalendarDate *)currentWeekStartDate {
return self->currentWeekStart;
}
- (void)setWeekOfYear:(int)_week {
NSCalendarDate *date;
self->weekOfYear = _week;
if(_week == 52 || _week == 53)
date = [[self startOfMonth] mondayOfWeek];
else
date = [self startOfMonth];
date = [date mondayOfWeek:_week];
[self setCurrentWeekStartDate:date];
}
- (int)weekOfYear {
return self->weekOfYear;
}
- (int)year {
return [[self startOfMonth] yearOfCommonEra];
}
- (int)month {
return [[self startOfMonth] monthOfYear];
}
- (NSString *)localizedDayOfWeekName {
return [self localizedNameForDayOfWeek:self->dayOfWeek];
}
- (NSDictionary *)currentWeekQueryParameters {
return [self queryParametersBySettingSelectedDate:self->currentWeekStart];
}
/* style sheet */
- (NSString *)weekStyle {
if([self->currentWeekStart isDateInSameWeek:[NSCalendarDate date]])
return @"monthoverview_week_hilite";
return @"monthoverview_week";
}
- (NSString *)contentStyle {
if([self->currentDay isToday])
return @"monthoverview_content_hilite";
else if([self->currentDay monthOfYear] != [[self startOfMonth] monthOfYear])
return @"monthoverview_content_dimmed";
return @"monthoverview_content";
}
/* appointments */
- (NSArray *)appointments {
return [self fetchCoreInfos];
}
@end /* UIxCalMonthOverview */
+115
View File
@@ -0,0 +1,115 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalMonthPrintview.m 471 2004-12-13 13:33:47Z znek $
#include "UIxCalMonthOverview.h"
@interface UIxCalMonthPrintview : UIxCalMonthOverview
{
}
@end
#include "common.h"
@implementation UIxCalMonthPrintview
- (NSString *)shortTextForApt {
NSCalendarDate *startDate, *endDate;
NSMutableString *aptDescr;
NSString *s;
BOOL isMyApt;
BOOL canAccessApt;
BOOL spansRange;
id apt;
apt = [self appointment];
isMyApt = [self isMyApt];
canAccessApt = [self canAccessApt];
spansRange = NO;
startDate = [apt valueForKey:@"startDate"];
[startDate setTimeZone:[self viewTimeZone]];
endDate = [apt valueForKey:@"endDate"];
if(endDate != nil) {
[endDate setTimeZone:[self viewTimeZone]];
spansRange = ![endDate isEqualToDate:startDate];
}
aptDescr = [[NSMutableString alloc] init];
[aptDescr appendFormat:@"<span class=\"%@\">%02i:%02i",
isMyApt ? @"monthprintview_apt_time" :
@"monthprintview_apt_time_other",
[startDate hourOfDay],
[startDate minuteOfHour]];
if(spansRange) {
[aptDescr appendFormat:@" - %02i:%02i",
[endDate hourOfDay],
[endDate minuteOfHour]];
}
[aptDescr appendFormat:@"</span>,"];
if (!isMyApt)
[aptDescr appendFormat:@"<span class=\"%@\">", [self aptStyle]];
if (canAccessApt) {
s = [apt valueForKey:@"title"];
if(s) {
[aptDescr appendFormat:@"<br />%@", s];
}
s = [apt valueForKey:@"location"];
if(s) {
[aptDescr appendFormat:@"<br />%@", s];
}
}
else {
[aptDescr appendFormat:@"<br />%@",
[self labelForKey:@"private appointment"]];
}
if(!isMyApt)
[aptDescr appendString:@"</span>"];
return [aptDescr autorelease];
}
- (NSString *)title {
NSCalendarDate *date;
date = [self startOfMonth];
return [NSString stringWithFormat:@"%@ %d",
[self localizedNameForMonthOfYear:[date monthOfYear]],
[date yearOfCommonEra]];
}
/* style sheet */
- (NSString *)contentStyle {
if([self->currentDay monthOfYear] != [[self startOfMonth] monthOfYear])
return @"monthprintview_content_dimmed";
return @"monthprintview_content";
}
- (NSString *)aptStyle {
if (![self isMyApt])
return @"monthprintview_apt_other";
return nil;
}
@end
+25
View File
@@ -0,0 +1,25 @@
// $Id: UIxCalMonthView.h 163 2004-08-02 12:59:28Z znek $
#ifndef __SOGo_UIxCalMonthView_H__
#define __SOGo_UIxCalMonthView_H__
#include "UIxCalView.h"
/*
UIxCalMonthView
Abstract superclass for views which display months.
*/
@interface UIxCalMonthView : UIxCalView
{
}
- (NSCalendarDate *)startOfMonth;
- (NSDictionary *)prevMonthQueryParameters;
- (NSDictionary *)nextMonthQueryParameters;
@end
#endif /* __SOGo_UIxCalMonthView_H__ */
+45
View File
@@ -0,0 +1,45 @@
// $Id: UIxCalMonthView.m 191 2004-08-12 16:28:32Z helge $
#include "UIxCalMonthView.h"
#include "NSCalendarDate+UIx.h"
#include "common.h"
@implementation UIxCalMonthView
- (NSCalendarDate *)startOfMonth {
return [[[super startDate] firstDayOfMonth] beginOfDay];
}
- (NSCalendarDate *)startDate {
return [[self startOfMonth] mondayOfWeek];
}
- (NSCalendarDate *)endDate {
NSCalendarDate *date;
date = [self startOfMonth];
date = [date dateByAddingYears:0 months:0 days:[date numberOfDaysInMonth]
hours:0 minutes:0 seconds:0];
date = [[date sundayOfWeek] endOfDay];
return date;
}
/* URLs */
- (NSDictionary *)prevMonthQueryParameters {
NSCalendarDate *date;
date = [[self startOfMonth] dateByAddingYears:0 months:-1 days:0
hours:0 minutes:0 seconds:0];
return [self queryParametersBySettingSelectedDate:date];
}
- (NSDictionary *)nextMonthQueryParameters {
NSCalendarDate *date;
date = [[self startOfMonth] dateByAddingYears:0 months:1 days:0
hours:0 minutes:0 seconds:0];
return [self queryParametersBySettingSelectedDate:date];
}
@end /* UIxCalMonthView */
@@ -0,0 +1,67 @@
/*
Copyright (C) 2000-2004 SKYRIX Software AG
This file is part of OGo
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalParticipationStatusView.m 759 2005-07-14 16:26:32Z znek $
#include <NGObjWeb/NGObjWeb.h>
@interface UIxCalParticipationStatusView : WOComponent
{
int partStat;
}
- (NSString *)participationStatus;
@end
#include <NGiCal/NGiCal.h> /* for iCalPersonPartStat */
#include "common.h"
@implementation UIxCalParticipationStatusView
- (void)setPartStat:(id)_partStat {
self->partStat = [_partStat intValue];
}
- (int)partStat {
return self->partStat;
}
- (NSString *)participationStatus {
switch (self->partStat) {
case iCalPersonPartStatNeedsAction:
return @"NEEDS-ACTION";
case iCalPersonPartStatAccepted:
return @"ACCEPTED";
case iCalPersonPartStatDeclined:
return @"DECLINED";
case iCalPersonPartStatTentative:
return @"TENTATIVE";
case iCalPersonPartStatDelegated:
return @"DELEGATED";
}
return @"OTHER";
}
- (NSString *)participationStatusLabel {
return [NSString stringWithFormat:@"partStat_%@",
[self participationStatus]];
}
@end
+391
View File
@@ -0,0 +1,391 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include <SOGoUI/UIxComponent.h>
@class NSMutableArray;
@interface UIxCalScheduleOverview : UIxComponent
{
NSMutableArray *userApts;
NSMutableArray *foreignApts;
id item;
NSMutableArray *partNames;
NSMutableArray *partStates;
NSString *userParticipationStatus;
unsigned participantIndex;
unsigned userIndex;
}
- (NSCalendarDate *)startDate;
- (NSCalendarDate *)endDate;
- (NSArray *)userAppointments;
- (NSArray *)foreignAppointments;
- (BOOL)hasUserAppointments;
- (BOOL)hasForeignAppointments;
- (BOOL)hasAnyAppointments;
- (void)fetchInfos;
- (NSString *)appointmentBaseURL;
- (unsigned)participantsCount;
- (unsigned)maxRenderedParticipantsCount;
- (unsigned)renderedParticipantsCount;
- (unsigned)truncatedParticipantsCount;
- (BOOL)didTruncateParticipants;
- (NSString *)getUserPartStateFromApt:(id)_apt;
- (BOOL)shouldIgnoreRejectedAppointments;
- (BOOL)shouldIgnoreAcceptedAppointments;
- (BOOL)shouldShowRejectedAndAcceptedAppointments;
@end
#include <NGObjWeb/SoComponent.h>
#include "UIxComponent+Agenor.h"
#include "SoObjects/Appointments/SOGoAppointmentFolder.h"
#include "common.h"
@implementation UIxCalScheduleOverview
- (void)dealloc {
[self->userApts release];
[self->foreignApts release];
[self->item release];
[self->partNames release];
[self->partStates release];
[self->userParticipationStatus release];
[super dealloc];
}
/* accessors */
- (void)setItem:(id)_item {
NSString *ps, *email;
NSArray *partmails;
unsigned idx;
ASSIGN(self->item, _item);
[self->partNames release];
[self->partStates release];
ps = [self->item valueForKey:@"participants"];
self->partNames = [[ps componentsSeparatedByString:@"\n"] mutableCopy];
ps = [self->item valueForKey:@"partstates"];
self->partStates = [[ps componentsSeparatedByString:@"\n"] mutableCopy];
ps = [self->item valueForKey:@"partmails"];
partmails = [ps componentsSeparatedByString:@"\n"];
/* reorder partNames/partStates */
/* ensure organizer is first entry */
email = [self->item valueForKey:@"orgmail"];
if ([email isNotNull]) {
idx = [partmails indexOfObject:email];
if (idx != NSNotFound && idx != 0) {
id obj;
obj = [self->partNames objectAtIndex:idx];
[self->partNames insertObject:obj atIndex:0]; /* frontmost */
[self->partNames removeObjectAtIndex:idx + 1];
obj = [self->partStates objectAtIndex:idx];
[self->partStates insertObject:obj atIndex:0]; /* frontmost */
[self->partStates removeObjectAtIndex:idx + 1];
}
}
/* user is either second, first or none at all */
[self->userParticipationStatus release];
email = [self emailForUser];
idx = [partmails indexOfObject:email];
if (idx != NSNotFound && idx != 0 && idx != 1) {
id obj;
self->userIndex = 1;
obj = [self->partNames objectAtIndex:idx];
[self->partNames insertObject:obj atIndex:self->userIndex]; /* second */
[self->partNames removeObjectAtIndex:idx + 1];
obj = [self->partStates objectAtIndex:idx];
[self->partStates insertObject:obj atIndex:self->userIndex]; /* second */
[self->partStates removeObjectAtIndex:idx + 1];
}
else {
self->userIndex = idx;
}
if (self->userIndex != NSNotFound)
self->userParticipationStatus =
[[self->partStates objectAtIndex:self->userIndex] retain];
else
self->userParticipationStatus = nil;
}
- (id)item {
return self->item;
}
- (void)setParticipantIndex:(unsigned)_participantIndex {
self->participantIndex = _participantIndex;
}
- (unsigned)participantIndex {
return self->participantIndex;
}
- (unsigned)userIndex {
return self->userIndex;
}
- (BOOL)isFirstParticipant {
return self->participantIndex == 0 ? YES : NO;
}
- (BOOL)hasUserAppointments {
// NOTE: this has been disabled for Agenor 0.8 on client's request
#if 1
return NO;
#else
return [[self userAppointments] count] > 0;
#endif
}
- (BOOL)hasForeignAppointments {
return [[self foreignAppointments] count] > 0;
}
- (BOOL)hasAnyAppointments {
return ([self hasUserAppointments] ||
[self hasForeignAppointments]) ? YES : NO;
}
- (unsigned)participantsCount {
return [self->partNames count];
}
- (NSString *)participant {
return [self->partNames objectAtIndex:self->participantIndex];
}
- (NSString *)participationStatus {
return [self->partStates objectAtIndex:self->participantIndex];
}
- (unsigned)maxRenderedParticipantsCount {
return 3;
}
- (unsigned)renderedParticipantsCount {
if ([self didTruncateParticipants])
return [self maxRenderedParticipantsCount];
return [self participantsCount];
}
- (unsigned)truncatedParticipantsCount {
return [self participantsCount] - [self renderedParticipantsCount];
}
- (BOOL)didTruncateParticipants {
return [self participantsCount] >
([self maxRenderedParticipantsCount] + 1) ? YES : NO;
}
- (unsigned)rowspan {
unsigned count;
count = [self renderedParticipantsCount];
if ([self didTruncateParticipants])
count += 1;
return count;
}
- (NSString *)userParticipationStatus {
return self->userParticipationStatus;
}
- (BOOL)shouldIgnoreRejectedAppointments {
return ![self shouldShowRejectedAndAcceptedAppointments];
}
- (BOOL)shouldIgnoreAcceptedAppointments {
return ![self shouldShowRejectedAndAcceptedAppointments];
}
- (BOOL)shouldShowRejectedAndAcceptedAppointments {
NSString *value;
value = [[[self context] request] formValueForKey:@"dr"];
if (!value) return NO;
return [value boolValue];
}
- (NSString *)toggleShowHideAptsQueryParameter {
BOOL shouldShow;
shouldShow = [self shouldShowRejectedAndAcceptedAppointments];
return shouldShow ? @"0" : @"1";
}
- (NSString *)toggleShowHideAptsText {
if ([self shouldShowRejectedAndAcceptedAppointments])
return @"Hide already accepted and rejected appointments";
return @"Show already accepted and rejected appointments";
}
- (NSString *)getUserPartStateFromApt:(id)_apt {
NSString *email;
NSArray *ps, *pms;
unsigned idx;
email = [self emailForUser];
pms = [[_apt valueForKey:@"partmails"]
componentsSeparatedByString:@"\n"];
idx = [pms indexOfObject:email];
if (idx == NSNotFound) return nil;
ps = [[_apt valueForKey:@"partstates"]
componentsSeparatedByString:@"\n"];
return [ps objectAtIndex:idx];
}
/* fetching */
- (NSCalendarDate *)startDate {
return [[NSCalendarDate date] beginOfDay];
}
/* ZNeK: is a month ok? */
- (NSCalendarDate *)endDate {
NSCalendarDate *date;
date = [NSCalendarDate date];
date = [date dateByAddingYears:0 months:1 days:0
hours:0 minutes:0 seconds:0];
date = [date endOfDay];
return date;
}
- (NSArray *)userAppointments {
if (!self->userApts) {
[self fetchInfos];
}
return self->userApts;
}
- (NSArray *)foreignAppointments {
if (!self->foreignApts) {
[self fetchInfos];
}
return self->foreignApts;
}
- (void)fetchInfos {
static NSArray *orders = nil;
id aptFolder;
NSArray *apts;
NSString *userEmail;
unsigned i, count;
if (!orders) {
EOSortOrdering *so;
so = [EOSortOrdering sortOrderingWithKey:@"startDate"
selector:EOCompareAscending];
orders = [[NSArray alloc] initWithObjects:so, nil];
}
aptFolder = [self clientObject];
apts = [aptFolder fetchCoreInfosFrom:[self startDate]
to:[self endDate]];
userEmail = [self emailForUser];
count = [apts count];
self->userApts = [[NSMutableArray alloc] initWithCapacity:count];
self->foreignApts = [[NSMutableArray alloc] initWithCapacity:count];
for (i = 0; i < count; i++) {
id apt;
NSString *orgEmail;
apt = [apts objectAtIndex:i];
orgEmail = [(NSDictionary *)apt objectForKey:@"orgmail"];
if (orgEmail && [orgEmail isEqualToString:userEmail]) {
[self->userApts addObject:apt];
}
else {
BOOL shouldAdd = YES;
if ([self shouldIgnoreAcceptedAppointments] ||
[self shouldIgnoreRejectedAppointments])
{
NSString *userPartStat;
userPartStat = [self getUserPartStateFromApt:apt];
if (userPartStat) {
if ([self shouldIgnoreAcceptedAppointments] &&
[userPartStat isEqualToString:@"1"])
shouldAdd = NO;
else if ([self shouldIgnoreRejectedAppointments] &&
[userPartStat isEqualToString:@"2"])
shouldAdd = NO;
}
}
if (shouldAdd)
[self->foreignApts addObject:apt];
}
}
[self->userApts sortUsingKeyOrderArray:orders];
[self->foreignApts sortUsingKeyOrderArray:orders];
}
/* URLs */
- (NSString *)appointmentBaseURL {
id pkey;
if (![(pkey = [self->item valueForKey:@"uid"]) isNotNull])
return nil;
return [[self clientObject] baseURLForAptWithUID:[pkey stringValue]
inContext:[self context]];
}
- (NSString *)appointmentViewURL {
return [[self appointmentBaseURL] stringByAppendingPathComponent:@"view"];
}
- (NSString *)acceptAppointmentURL {
return [[self appointmentBaseURL] stringByAppendingPathComponent:@"accept"];
}
- (NSString *)declineAppointmentURL {
return [[self appointmentBaseURL] stringByAppendingPathComponent:@"decline"];
}
/* access protection */
- (BOOL)canAccess {
NSString *owner;
owner = [[self clientObject] ownerInContext:[self context]];
if (!owner)
return NO;
return [[[[self context] activeUser] login] isEqualToString:owner];
}
@end
+115
View File
@@ -0,0 +1,115 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalSelectTab.m 477 2004-12-16 19:52:40Z znek $
#include <SOGoUI/UIxComponent.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGExtensions/NGExtensions.h>
@interface UIxCalSelectTab : UIxComponent
{
NSString *selection;
NSCalendarDate *currentDate;
}
@end
@implementation UIxCalSelectTab
- (void)dealloc {
[self->selection release];
[self->currentDate release];
[super dealloc];
}
- (void)setSelection:(NSString *)_selection {
ASSIGN(self->selection, _selection);
}
- (NSString *)selection {
return self->selection;
}
- (void)setCurrentDate:(NSCalendarDate *)_date {
[_date setTimeZone:[self viewTimeZone]];
ASSIGN(self->currentDate, _date);
}
- (NSCalendarDate *)currentDate {
return self->currentDate;
}
/* labels */
- (NSString *)dayLabel {
return [NSString stringWithFormat:@"%d",
[self->currentDate dayOfMonth]];
}
- (NSString *)weekLabel {
NSString *wlbl;
wlbl = [self labelForKey:@"Week"];
return [NSString stringWithFormat:@"%@ %d",
wlbl,
[self->currentDate weekOfYear]];
}
- (NSString *)monthLabel {
return [NSString stringWithFormat:@"%@",
[self localizedNameForMonthOfYear:[self->currentDate monthOfYear]]];
}
- (NSString *)yearLabel {
return [NSString stringWithFormat:@"%d",
[self->currentDate yearOfCommonEra]];
}
/* hrefs */
- (NSString *)scheduletabLink {
return [self completeHrefForMethod:@"schedule"];
}
- (NSString *)daytabLink {
return [self completeHrefForMethod:@"dayoverview"];
}
- (NSString *)weektabLink {
return [self completeHrefForMethod:@"weekoverview"];
}
- (NSString *)monthtabLink {
return [self completeHrefForMethod:@"monthoverview"];
}
- (NSString *)yeartabLink {
return [self completeHrefForMethod:@"yearoverview"];
}
@end
+106
View File
@@ -0,0 +1,106 @@
// $Id: UIxCalView.h 720 2005-07-12 13:56:19Z znek $
#ifndef __SOGo_UIxCalView_H__
#define __SOGo_UIxCalView_H__
#include <SOGoUI/UIxComponent.h>
/*
UIxCalView
Superclass for most components which render a set of appointments coming from
a SOPE clientObject (which usually is an SOGoAppointmentFolder).
*/
@class NSString, NSArray, NSDictionary, NSCalendarDate, SOGoAptFormatter;
@interface UIxCalView : UIxComponent
{
NSArray *appointments;
NSArray *allDayApts;
id appointment;
NSCalendarDate *currentDay;
SOGoAptFormatter *aptFormatter;
SOGoAptFormatter *aptTooltipFormatter;
SOGoAptFormatter *privateAptFormatter;
SOGoAptFormatter *privateAptTooltipFormatter;
struct {
unsigned isMyApt : 1;
unsigned canAccessApt : 1;
unsigned RESERVED : 30;
} aptFlags;
}
/* config */
- (void)configureFormatters;
/* accessors */
- (NSArray *)appointments;
- (void)setAppointments:(NSArray *)_apts;
- (NSArray *)allDayApts;
- (id)appointment;
- (BOOL)isMyApt;
- (BOOL)canAccessApt; /* protection */
- (BOOL)hasDayInfo;
- (BOOL)hasHoldidayInfo;
- (BOOL)hasAllDayApts;
- (NSDictionary *)aptTypeDict;
- (NSString *)aptTypeLabel;
- (NSString *)aptTypeIcon;
- (SOGoAptFormatter *)aptFormatter;
- (NSString *)shortTextForApt;
- (NSString *)shortTitleForApt;
- (NSString *)tooltipForApt;
- (NSString *)appointmentViewURL;
- (id)holidayInfo;
/* related to current day */
- (void)setCurrentDay:(NSCalendarDate *)_day;
- (NSCalendarDate *)currentDay;
- (NSString *)currentDayName; /* localized */
/* defaults */
- (BOOL)showFullNames;
- (BOOL)showAMPMDates;
- (unsigned)dayStartHour;
- (unsigned)dayEndHour;
- (BOOL)shouldDisplayWeekend;
- (BOOL)shouldDisplayRejectedAppointments;
- (NSCalendarDate *)referenceDateForFormatter;
- (NSCalendarDate *)thisMonth;
- (NSCalendarDate *)nextMonth;
/* fetching */
- (NSCalendarDate *)startDate;
- (NSCalendarDate *)endDate;
- (NSArray *)fetchCoreInfos;
/* date selection */
- (NSDictionary *)todayQueryParameters;
- (NSDictionary *)currentDayQueryParameters;
/* calendarUIDs */
- (NSString *)formattedCalendarUIDs;
/* CSS related */
- (NSString *)aptStyle;
@end
#endif /* __SOGo_UIxCalView_H__ */
+493
View File
@@ -0,0 +1,493 @@
// $Id: UIxCalView.m 885 2005-07-21 16:41:34Z znek $
#include "UIxCalView.h"
#include "common.h"
//#include <OGoContentStore/OCSFolder.h>
#include "SoObjects/Appointments/SOGoAppointmentFolder.h"
#include <NGObjWeb/SoUser.h>
#include <SOGoUI/SOGoAptFormatter.h>
#include <NGExtensions/NGCalendarDateRange.h>
#include <NGiCal/NGiCal.h>
#include "UIxComponent+Agenor.h"
@interface UIxCalView (PrivateAPI)
- (NSString *)_userFolderURI;
@end
@implementation UIxCalView
static BOOL shouldDisplayWeekend = NO;
+ (void)initialize {
static BOOL didInit = NO;
NSUserDefaults *ud;
if (didInit) return;
ud = [NSUserDefaults standardUserDefaults];
shouldDisplayWeekend = [ud boolForKey:@"SOGoShouldDisplayWeekend"];
}
- (id)init {
self = [super init];
if(self) {
NSTimeZone *tz;
tz = [self viewTimeZone];
self->aptFormatter =
[[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
self->aptTooltipFormatter =
[[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
self->privateAptFormatter =
[[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
self->privateAptTooltipFormatter =
[[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
[self configureFormatters];
}
return self;
}
- (void)dealloc {
[self->appointments release];
[self->allDayApts release];
[self->appointment release];
[self->currentDay release];
[self->aptFormatter release];
[self->aptTooltipFormatter release];
[self->privateAptFormatter release];
[self->privateAptTooltipFormatter release];
[super dealloc];
}
/* subclasses should override this */
- (void)configureFormatters {
NSString *title;
[self->aptFormatter setFullDetails];
[self->aptTooltipFormatter setTooltip];
[self->privateAptFormatter setPrivateDetails];
[self->privateAptTooltipFormatter setPrivateTooltip];
title = [self labelForKey:@"empty title"];
[self->aptFormatter setTitlePlaceholder:title];
[self->aptTooltipFormatter setTitlePlaceholder:title];
title = [self labelForKey:@"private appointment"];
[self->privateAptFormatter setPrivateTitle:title];
[self->privateAptTooltipFormatter setPrivateTitle:title];
}
- (NSArray *)filterAppointments:(NSArray *)_apts {
NSMutableArray *filtered;
unsigned i, count;
NSString *email;
count = [_apts count];
if (!count) return _apts;
if ([self shouldDisplayRejectedAppointments]) return _apts;
filtered = [[[NSMutableArray alloc] initWithCapacity:count] autorelease];
email = [self emailForUser];
for (i = 0; i < count; i++) {
NSDictionary *info;
NSArray *partmails;
unsigned p, pCount;
BOOL shouldAdd;
shouldAdd = YES;
info = [_apts objectAtIndex:i];
partmails = [[info objectForKey:@"partmails"]
componentsSeparatedByString:@"\n"];
pCount = [partmails count];
for (p = 0; p < pCount; p++) {
NSString *pEmail;
pEmail = [partmails objectAtIndex:p];
if ([pEmail isEqualToString:email]) {
NSArray *partstates;
NSString *state;
partstates = [[info objectForKey:@"partstates"]
componentsSeparatedByString:@"\n"];
state = [partstates objectAtIndex:p];
if ([state intValue] == iCalPersonPartStatDeclined)
shouldAdd = NO;
break;
}
}
if (shouldAdd)
[filtered addObject:info];
}
return filtered;
}
/* accessors */
- (void)setAppointments:(NSArray *)_apts {
_apts = [self filterAppointments:_apts];
ASSIGN(self->appointments, _apts);
}
- (NSArray *)appointments {
return self->appointments;
}
- (void)setAppointment:(id)_apt {
NSString *mailtoChunk;
NSString *myEmail;
ASSIGN(self->appointment, _apt);
/* cache some info about apt for faster access */
mailtoChunk = [_apt valueForKey:@"orgmail"];
myEmail = [self emailForUser];
if ([mailtoChunk rangeOfString:myEmail].length > 0) {
self->aptFlags.isMyApt = YES;
self->aptFlags.canAccessApt = YES;
}
else {
NSString *partmails;
self->aptFlags.isMyApt = NO;
partmails = [_apt valueForKey:@"partmails"];
if ([partmails rangeOfString:myEmail].length)
self->aptFlags.canAccessApt = YES;
else
self->aptFlags.canAccessApt = [[_apt valueForKey:@"ispublic"] boolValue];
}
}
- (id)appointment {
return self->appointment;
}
- (BOOL)isMyApt {
return self->aptFlags.isMyApt ? YES : NO;
}
- (BOOL)canAccessApt {
return self->aptFlags.canAccessApt ? YES : NO;
}
- (BOOL)canNotAccessApt {
return self->aptFlags.canAccessApt ? NO : YES;
}
- (NSDictionary *)aptTypeDict {
return nil;
}
- (NSString *)aptTypeLabel {
return @"aptLabel";
}
- (NSString *)aptTypeIcon {
return @"";
}
- (SOGoAptFormatter *)aptFormatter {
if(self->aptFlags.canAccessApt)
return self->aptFormatter;
return self->privateAptFormatter;
}
- (SOGoAptFormatter *)aptTooltipFormatter {
if(self->aptFlags.canAccessApt)
return self->aptTooltipFormatter;
return self->privateAptTooltipFormatter;
}
/* TODO: remove this */
- (NSString *)shortTextForApt {
[self warnWithFormat:@"%s IS DEPRECATED!", __PRETTY_FUNCTION__];
if (![self canAccessApt])
return @"";
return [[self aptFormatter] stringForObjectValue:self->appointment];
}
- (NSString *)shortTitleForApt {
NSString *title;
[self warnWithFormat:@"%s IS DEPRECATED!", __PRETTY_FUNCTION__];
if (![self canAccessApt])
return @"";
title = [self->appointment valueForKey:@"title"];
if ([title length] > 12)
title = [[title substringToIndex:11] stringByAppendingString:@"..."];
return title;
}
- (NSString *)tooltipForApt {
[self warnWithFormat:@"%s IS DEPRECATED!", __PRETTY_FUNCTION__];
return [[self aptTooltipFormatter] stringForObjectValue:self->appointment
referenceDate:[self currentDay]];
}
- (NSString *)aptStyle {
return nil;
}
- (NSCalendarDate *)referenceDateForFormatter {
return [self selectedDate];
}
- (NSCalendarDate *)thisMonth {
return [self selectedDate];
}
- (NSCalendarDate *)nextMonth {
NSCalendarDate *date = [self thisMonth];
return [date dateByAddingYears:0 months:1 days:0
hours:0 minutes:0 seconds:0];
}
/* current day related */
- (void)setCurrentDay:(NSCalendarDate *)_day {
[_day setTimeZone:[self viewTimeZone]];
ASSIGN(self->currentDay, _day);
}
- (NSCalendarDate *)currentDay {
return self->currentDay;
}
- (NSString *)currentDayName {
return [self localizedNameForDayOfWeek:[self->currentDay dayOfWeek]];
}
- (id)holidayInfo {
return nil;
}
- (NSArray *)allDayApts {
NSArray *apts;
NSMutableArray *filtered;
unsigned i, count;
if (self->allDayApts)
return self->allDayApts;
apts = [self appointments];
count = [apts count];
filtered = [[NSMutableArray alloc] initWithCapacity:3];
for (i = 0; i < count; i++) {
id apt;
NSNumber *bv;
apt = [apts objectAtIndex:i];
bv = [apt valueForKey:@"isallday"];
if ([bv boolValue])
[filtered addObject:apt];
}
ASSIGN(self->allDayApts, filtered);
[filtered release];
return self->allDayApts;
}
/* special appointments */
- (BOOL)hasDayInfo {
return [self hasHoldidayInfo] || [self hasAllDayApts];
}
- (BOOL)hasHoldidayInfo {
return [self holidayInfo] != nil;
}
- (BOOL)hasAllDayApts {
return [[self allDayApts] count] != 0;
}
/* defaults */
- (BOOL)showFullNames {
return YES;
}
- (BOOL)showAMPMDates {
return NO;
}
- (unsigned)dayStartHour {
return 8;
}
- (unsigned)dayEndHour {
return 18;
}
- (BOOL)shouldDisplayWeekend {
return shouldDisplayWeekend;
}
- (BOOL)shouldHideWeekend {
return ![self shouldDisplayWeekend];
}
/* URLs */
- (NSString *)appointmentViewURL {
id pkey;
if (![(pkey = [[self appointment] valueForKey:@"uid"]) isNotNull])
return nil;
return [[[self clientObject] baseURLForAptWithUID:[pkey stringValue]
inContext:[self context]]
stringByAppendingString:@"/view"];
}
/* fetching */
- (NSCalendarDate *)startDate {
return [self selectedDate];
}
- (NSCalendarDate *)endDate {
return [[self startDate] tomorrow];
}
- (NSArray *)fetchCoreInfos {
if (!self->appointments) {
id folder;
NSCalendarDate *sd, *ed;
folder = [self clientObject];
sd = [self startDate];
ed = [self endDate];
[self setAppointments:[folder fetchOverviewInfosFrom:sd to:ed]];
}
return self->appointments;
}
/* query parameters */
- (BOOL)shouldDisplayRejectedAppointments {
NSString *bv;
bv = [[[self context] request] formValueForKey:@"dr"];
if (!bv) return NO;
return [bv boolValue];
}
- (NSDictionary *)toggleShowRejectedAptsQueryParameters {
NSMutableDictionary *qp;
BOOL shouldDisplay;
shouldDisplay = ![self shouldDisplayRejectedAppointments];
qp = [[[self queryParameters] mutableCopy] autorelease];
[qp setObject:shouldDisplay ? @"1" : @"0" forKey:@"dr"];
return qp;
}
- (NSString *)toggleShowRejectedAptsLabel {
if (![self shouldDisplayRejectedAppointments])
return @"show_rejected_apts";
return @"hide_rejected_apts";
}
/* date selection & conversion */
- (NSDictionary *)todayQueryParameters {
NSCalendarDate *date;
date = [NSCalendarDate date]; /* today */
return [self queryParametersBySettingSelectedDate:date];
}
- (NSDictionary *)currentDayQueryParameters {
return [self queryParametersBySettingSelectedDate:self->currentDay];
}
/* calendarUIDs */
- (NSString *)formattedCalendarUIDs {
return [[[self clientObject] calendarUIDs]
componentsJoinedByString:@", "];
}
/* Actions */
- (NSString *)_userFolderURI {
WOContext *ctx;
id obj;
NSURL *url;
ctx = [self context];
obj = [[ctx objectTraversalStack] objectAtIndex:1];
url = [NSURL URLWithString:[obj baseURLInContext:ctx]];
return [[url path] stringByUnescapingURL];
}
- (id)redirectForUIDsAction {
NSMutableString *uri;
NSString *uidsString, *loc, *prevMethod, *userFolderID;
WORequest *req;
id <WOActionResults> r;
BOOL useGroups;
unsigned index;
req = [[self context] request];
uidsString = [req formValueForKey:@"userUIDString"];
uidsString = [uidsString stringByTrimmingWhiteSpaces];
prevMethod = [req formValueForKey:@"previousMethod"];
if(prevMethod == nil)
prevMethod = @"";
uri = [[NSMutableString alloc] initWithString:[self _userFolderURI]];
/* if we have more than one entry, use groups - otherwise don't */
useGroups = [uidsString rangeOfString:@","].length > 0;
userFolderID = [uri lastPathComponent];
if(useGroups) {
NSArray *uids;
uids = [uidsString componentsSeparatedByString:@","];
/* guarantee that our id is the first */
if(((index = [uids indexOfObject:userFolderID]) != NSNotFound) &&
(index != 0)) {
uids = [[uids mutableCopy] autorelease];
[(NSMutableArray *)uids removeObjectAtIndex:index];
[(NSMutableArray *)uids insertObject:userFolderID atIndex:0];
uidsString = [uids componentsJoinedByString:@","];
}
[uri appendString:@"Groups/_custom_"];
[uri appendString:uidsString];
[uri appendString:@"/"];
}
else {
/* check if lastPathComponent is the base that we want to have */
if((([uidsString length] != 0) &&
(![userFolderID isEqualToString:uidsString]))) {
NSRange r;
/* uri ends with an '/', so we have to adjust the range a little */
r = NSMakeRange(0, [uri length] - 1);
r = [uri rangeOfString:@"/"
options:NSBackwardsSearch
range:r];
r = NSMakeRange(r.location + 1, [uri length] - r.location - 2);
[uri replaceCharactersInRange:r withString:uidsString];
}
}
[uri appendString:@"Calendar/"];
[uri appendString:prevMethod];
#if 0
NSLog(@"%s redirect uri:%@",
__PRETTY_FUNCTION__,
uri);
#endif
loc = [self completeHrefForMethod:uri]; /* this might return uri! */
r = [self redirectToLocation:loc];
[uri release];
return r;
}
@end /* UIxCalView */
+191
View File
@@ -0,0 +1,191 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalWeekChartview.m 663 2005-07-05 18:13:24Z znek $
#include "UIxCalWeekView.h"
@interface UIxCalWeekChartview : UIxCalWeekView
{
int day;
int hour;
NSArray *hours;
}
- (NSCalendarDate *)currentDate;
@end
#include "common.h"
#include <NGExtensions/NGCalendarDateRange.h>
#include <sys/param.h> // MIN, MAX
#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalWeekChartview
- (void)dealloc {
[self->hours release];
[super dealloc];
}
- (void)setDay:(int)_day {
NSCalendarDate *date;
self->day = _day;
date = [[self startDate] dateByAddingYears:0 months:0 days:_day];
[self setCurrentDay:date];
}
- (int)day {
return self->day;
}
- (void)setHour:(int)_hour {
self->hour = _hour;
}
- (int)hour {
return self->hour;
}
- (NSCalendarDate *)currentDate {
NSCalendarDate *date;
date = [[self startDate] beginOfDay];
date = [date dateByAddingYears:0 months:0 days:[self day]
hours:[self hour] minutes:0 seconds:0];
return date;
}
/* columns */
- (NSArray *)columns {
static NSMutableArray *columns = nil;
if(!columns) {
unsigned i, count;
count = [self shouldDisplayWeekend] ? 7 : 5;
columns = [[NSMutableArray alloc] initWithCapacity:count];
for(i = 0; i < count; i++) {
[columns addObject:[NSNumber numberWithInt:i]];
}
}
return columns;
}
/* tests */
/* row is active, if apt intersects hour range */
- (BOOL)isRowActive {
NSCalendarDate *aptStart, *aptEnd, *date;
int aptStartHour, aptEndHour;
BOOL isStartOnSameDay, isEndOnSameDay;
aptStart = [self->appointment valueForKey:@"startDate"];
aptEnd = [self->appointment valueForKey:@"endDate"];
date = [self currentDay];
isStartOnSameDay = [aptStart isDateOnSameDay:date];
isEndOnSameDay = [aptEnd isDateOnSameDay:date];
if (!isStartOnSameDay && !isEndOnSameDay)
return YES;
aptStartHour = [aptStart hourOfDay];
aptEndHour = [aptEnd hourOfDay];
if (isStartOnSameDay && isEndOnSameDay)
return (([self hour] >= aptStartHour) &&
([self hour] <= aptEndHour));
if (!isStartOnSameDay)
return [self hour] <= aptEndHour;
return [self hour] >= aptStartHour;
}
/* item is active, if apt's dateRange intersects the range
of the current column (currentDay is set to be this date) */
- (BOOL)isItemActive {
NSCalendarDate *dateStart, *dateEnd, *aptStart, *aptEnd;
NGCalendarDateRange *dateRange, *aptRange;
dateStart = [self currentDate];
dateEnd = [dateStart dateByAddingYears:0 months:0 days:0
hours:1 minutes:0 seconds:0];
dateRange = [NGCalendarDateRange calendarDateRangeWithStartDate:dateStart
endDate:dateEnd];
aptStart = [self->appointment valueForKey:@"startDate"];
aptEnd = [self->appointment valueForKey:@"endDate"];
aptRange = [NGCalendarDateRange calendarDateRangeWithStartDate:aptStart
endDate:aptEnd];
return [dateRange doesIntersectWithDateRange:aptRange];
}
/* hours */
- (NSArray *)hours {
if(!self->hours) {
NSMutableArray *result;
NSArray *apts;
unsigned i, count;
unsigned min, max;
min = [self dayStartHour];
max = [self dayEndHour];
apts = [self appointments];
count = [apts count];
for(i = 0; i < count; i++) {
id apt;
NSCalendarDate *aptStart, *aptEnd;
apt = [apts objectAtIndex:i];
aptStart = [apt valueForKey:@"startDate"];
if(aptStart) {
min = MIN(min, [aptStart hourOfDay]);
}
aptEnd = [apt valueForKey:@"endDate"];
if(aptEnd) {
max = MAX(max, [aptEnd hourOfDay]);
}
}
result = [[NSMutableArray alloc] initWithCapacity:max - min];
for(i = min; i <= max; i++) {
[result addObject:[NSNumber numberWithInt:i]];
}
self->hours = result;
}
return self->hours;
}
/* descriptions */
- (void)configureFormatters {
[super configureFormatters];
[self->aptFormatter setTitleOnly];
[self->privateAptFormatter setPrivateTitleOnly];
}
/* style sheet */
- (NSString *)titleStyle {
if([self->currentDay isToday])
return @"weekoverview_title_hilite";
return @"weekoverview_title";
}
@end /* UIxCalWeekChartview */
+80
View File
@@ -0,0 +1,80 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalWeekColumnsview.m 663 2005-07-05 18:13:24Z znek $
#include "UIxCalWeekView.h"
@interface UIxCalWeekColumnsview : UIxCalWeekView
{
int dayIndex;
}
@end
#include "common.h"
#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalWeekColumnsview
- (void)configureFormatters {
[super configureFormatters];
[self->aptFormatter setOmitsEndDate];
}
- (void)setDayIndex:(char)_idx {
NSCalendarDate *d;
if ((self->dayIndex == _idx) && (self->currentDay != nil))
return;
self->dayIndex = _idx;
if (_idx > 0) {
d = [[self startDate] dateByAddingYears:0 months:0 days:_idx
hours:0 minutes:0 seconds:0];
}
else
d = [self startDate];
[self setCurrentDay:d];
}
- (int)dayIndex {
return self->dayIndex;
}
/* style sheet */
- (NSString *)titleStyle {
return [self->currentDay isToday]
? @"weekcolumnsview_title_hilite"
: @"weekcolumnsview_title";
}
- (NSString *)contentStyle {
return [self->currentDay isToday]
? @"weekcolumnsview_content_hilite"
: @"weekcolumnsview_content";
}
@end /* UIxCalWeekColumnsview */
+183
View File
@@ -0,0 +1,183 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalWeekListview.m 707 2005-07-08 15:48:48Z znek $
#include "UIxCalWeekView.h"
@interface UIxCalWeekListview : UIxCalWeekView
{
NSArray *uids;
id currentUid;
int column;
}
- (int)columnsPerDay;
@end
#include "common.h"
#include <NGExtensions/NGCalendarDateRange.h>
#include <SOGo/AgenorUserManager.h>
#include <SOGoUI/SOGoAptFormatter.h>
#include "SoObjects/Appointments/SOGoAppointmentFolder.h"
@implementation UIxCalWeekListview
- (void)dealloc {
[self->uids release];
[self->currentUid release];
[super dealloc];
}
/* fetching */
/* NOTE: this fetches coreInfos instead of overviewInfos
* as is done in the superclass!
*/
- (NSArray *)fetchCoreInfos {
if (!self->appointments) {
id folder;
NSCalendarDate *sd, *ed;
folder = [self clientObject];
sd = [self startDate];
ed = [self endDate];
[self setAppointments:[folder fetchCoreInfosFrom:sd to:ed]];
}
return self->appointments;
}
/* accessors */
- (NSArray *)uids {
if(!self->uids) {
self->uids = [[[[self clientObject] calendarUIDs]
sortedArrayUsingSelector:@selector(compareAscending:)]
retain];
}
return self->uids;
}
- (void)setCurrentUid:(id)_currentUid {
ASSIGN(self->currentUid, _currentUid);
}
- (id)currentUid {
return self->currentUid;
}
/* column corresponds to the current day/hour */
- (void)setColumn:(int)_column {
unsigned dayOfWeek, hour;
NSCalendarDate *date;
dayOfWeek = _column / [self columnsPerDay];
hour = _column % [self columnsPerDay];
date = [[self startDate] dateByAddingYears:0 months:0 days:dayOfWeek];
date = [date hour:hour minute:0];
/* let's reuse currentDay, although this isn't named too accurately */
[self setCurrentDay:date];
self->column = _column;
}
- (int)column {
return self->column;
}
/* columns */
- (int)columnsPerDay {
return 24;
}
- (NSArray *)columns {
static NSMutableArray *columns = nil;
if(!columns) {
unsigned i, count;
if([self shouldDisplayWeekend])
count = [self columnsPerDay] * 7;
else
count = [self columnsPerDay] * 5;
columns = [[NSMutableArray alloc] initWithCapacity:count];
for(i = 0; i < count; i++) {
[columns addObject:[NSNumber numberWithInt:i]];
}
}
return columns;
}
/* tests */
/* row is active, if currentUid is participant of apt */
- (BOOL)isRowActive {
AgenorUserManager *um;
NSString *mailChunk;
NSString *currentMail;
um = [AgenorUserManager sharedUserManager];
currentMail = [um getEmailForUID:self->currentUid];
mailChunk = [self->appointment valueForKey:@"partmails"];
if([mailChunk rangeOfString:currentMail].length > 0)
return YES;
return NO;
}
/* item is active, if apt's dateRange intersects the range
of the current column (currentDay is set to be this date) */
- (BOOL)isItemActive {
NSCalendarDate *dateStart, *dateEnd, *aptStart, *aptEnd;
NGCalendarDateRange *dateRange, *aptRange;
dateStart = [self currentDay];
dateEnd = [dateStart dateByAddingYears:0 months:0 days:0
hours:1 minutes:0 seconds:0];
dateRange = [NGCalendarDateRange calendarDateRangeWithStartDate:dateStart
endDate:dateEnd];
aptStart = [self->appointment valueForKey:@"startDate"];
aptEnd = [self->appointment valueForKey:@"endDate"];
aptRange = [NGCalendarDateRange calendarDateRangeWithStartDate:aptStart
endDate:aptEnd];
return [dateRange doesIntersectWithDateRange:aptRange];
}
/* descriptions */
- (void)configureFormatters {
[super configureFormatters];
[self->aptFormatter setTitleOnly];
[self->privateAptFormatter setPrivateTitleOnly];
}
- (NSString *)cnForCurrentUid {
return [[AgenorUserManager sharedUserManager] getCNForUID:self->currentUid];
}
/* style sheet */
- (NSString *)titleStyle {
if([self->currentDay isToday])
return @"weekoverview_title_hilite";
return @"weekoverview_title";
}
@end /* UIxCalWeekListview */
+30
View File
@@ -0,0 +1,30 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalWeekOverview.h 181 2004-08-11 15:13:25Z helge $
#include "UIxCalWeekView.h"
@interface UIxCalWeekOverview : UIxCalWeekView
{
int dayIndex;
}
@end
+72
View File
@@ -0,0 +1,72 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalWeekOverview.m 663 2005-07-05 18:13:24Z znek $
#include "UIxCalWeekOverview.h"
#include "common.h"
#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalWeekOverview
- (void)configureFormatters {
[super configureFormatters];
[self->aptFormatter setOmitsEndDate];
}
- (void)setDayIndex:(char)_idx {
NSCalendarDate *d;
if ((self->dayIndex == _idx) && (self->currentDay != nil))
return;
self->dayIndex = _idx;
if (_idx > 0) {
d = [[self startDate]
dateByAddingYears:0 months:0 days:_idx
hours:0 minutes:0 seconds:0];
}
else
d = [self startDate];
[self setCurrentDay:d];
}
- (int)dayIndex {
return self->dayIndex;
}
/* style sheet */
- (NSString *)titleStyle {
if([self->currentDay isToday])
return @"weekoverview_title_hilite";
return @"weekoverview_title";
}
- (NSString *)contentStyle {
if([self->currentDay isToday])
return @"weekoverview_content_hilite";
return @"weekoverview_content";
}
@end /* UIxCalWeekOverview */
+129
View File
@@ -0,0 +1,129 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalWeekPrintview.m 471 2004-12-13 13:33:47Z znek $
#include "UIxCalWeekOverview.h"
@interface UIxCalWeekPrintview : UIxCalWeekOverview
{
}
@end
#include "common.h"
@implementation UIxCalWeekPrintview
- (NSString *)shortTextForApt {
NSCalendarDate *startDate, *endDate;
NSMutableString *aptDescr;
NSString *s;
BOOL isMyApt;
BOOL canAccessApt;
BOOL spansRange;
id apt;
apt = [self appointment];
isMyApt = [self isMyApt];
canAccessApt = [self canAccessApt];
spansRange = NO;
startDate = [apt valueForKey:@"startDate"];
[startDate setTimeZone:[self viewTimeZone]];
endDate = [apt valueForKey:@"endDate"];
if(endDate != nil) {
[endDate setTimeZone:[self viewTimeZone]];
spansRange = ![endDate isEqualToDate:startDate];
}
aptDescr = [[NSMutableString alloc] init];
[aptDescr appendFormat:@"<span class=\"%@\">%02i:%02i",
isMyApt ? @"weekprintview_apt_time" :
@"weekprintview_apt_time_other",
[startDate hourOfDay],
[startDate minuteOfHour]];
if(spansRange) {
[aptDescr appendFormat:@" - %02i:%02i",
[endDate hourOfDay],
[endDate minuteOfHour]];
}
[aptDescr appendFormat:@"</span>,"];
if(!isMyApt)
[aptDescr appendFormat:@"<span class=\"%@\">", [self aptStyle]];
if (canAccessApt) {
s = [apt valueForKey:@"title"];
if(s) {
[aptDescr appendFormat:@"<br />%@", s];
}
s = [apt valueForKey:@"location"];
if(s) {
[aptDescr appendFormat:@"<br />%@", s];
}
}
else {
[aptDescr appendFormat:@"<br />%@",
[self labelForKey:@"private appointment"]];
}
if(!isMyApt)
[aptDescr appendString:@"</span>"];
return [aptDescr autorelease];
}
- (NSString *)title {
NSMutableString *title;
NSCalendarDate *date;
date = [self startDate];
title = [[NSMutableString alloc] init];
[title appendFormat:@"%@ %d",
[self localizedNameForMonthOfYear:[date monthOfYear]],
[date yearOfCommonEra]];
if([date monthOfYear] != [[self endDate] monthOfYear]) {
[title appendFormat:@" / %@ %d",
[self localizedNameForMonthOfYear:[[self endDate] monthOfYear]],
[[self endDate] yearOfCommonEra]];
}
[title appendFormat:@", %@ %d",
[self labelForKey:@"Week"],
[date weekOfYear]];
return [title autorelease];
}
/* style sheet */
- (NSString *)titleStyle {
if([self->currentDay isToday])
return @"weekoverview_title_hilite";
return @"weekoverview_title";
}
- (NSString *)contentStyle {
if([self->currentDay isToday])
return @"weekoverview_content_hilite";
return @"weekoverview_content";
}
- (NSString *)aptStyle {
if (![self isMyApt])
return @"weekprintview_apt_other";
return nil;
}
@end
+21
View File
@@ -0,0 +1,21 @@
// $Id: UIxCalWeekView.h 191 2004-08-12 16:28:32Z helge $
#ifndef __SOGo_UIxCalWeekView_H__
#define __SOGo_UIxCalWeekView_H__
#include "UIxCalView.h"
@class NSDictionary;
@interface UIxCalWeekView : UIxCalView
{
}
/* Query Parameters */
- (NSDictionary *)prevWeekQueryParameters;
- (NSDictionary *)nextWeekQueryParameters;
@end
#endif /* __SOGo_UIxCalWeekView_H__ */
+46
View File
@@ -0,0 +1,46 @@
// $Id: UIxCalWeekView.m 303 2004-09-10 15:23:10Z znek $
#include "UIxCalWeekView.h"
#include "common.h"
@implementation UIxCalWeekView
- (NSCalendarDate *)startDate {
return [[[super startDate] mondayOfWeek] beginOfDay];
}
- (NSCalendarDate *)endDate {
unsigned offset;
if([self shouldDisplayWeekend])
offset = 7;
else
offset = 5;
return [[[self startDate] dateByAddingYears:0 months:0 days:offset
hours:0 minutes:0 seconds:0]
endOfDay];
}
- (NSArray *)appointments {
return [self fetchCoreInfos];
}
/* URLs */
- (NSDictionary *)prevWeekQueryParameters {
NSCalendarDate *date;
date = [[self startDate] dateByAddingYears:0 months:0 days:-7
hours:0 minutes:0 seconds:0];
return [self queryParametersBySettingSelectedDate:date];
}
- (NSDictionary *)nextWeekQueryParameters {
NSCalendarDate *date;
date = [[self startDate] dateByAddingYears:0 months:0 days:7
hours:0 minutes:0 seconds:0];
return [self queryParametersBySettingSelectedDate:date];
}
@end /* UIxCalWeekView */
+149
View File
@@ -0,0 +1,149 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalYearOverview.m 191 2004-08-12 16:28:32Z helge $
#include <SOGoUI/UIxComponent.h>
@interface UIxCalYearOverview : UIxComponent
{
NSArray *row;
NSCalendarDate *month;
}
- (NSCalendarDate *)startDate;
- (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date;
- (void)setSelectedDateQueryParameter:(NSCalendarDate *)_newDate
inDictionary:(NSMutableDictionary *)_qp;
@end
#include "common.h"
@implementation UIxCalYearOverview
- (void)dealloc {
[self->row release];
[self->month release];
[super dealloc];
}
/* accessors */
- (void)setRow:(NSArray *)_row {
ASSIGN(self->row, _row);
}
- (NSArray *)row {
return self->row;
}
- (void)setMonth:(NSCalendarDate *)_date {
ASSIGN(self->month, _date);
}
- (NSCalendarDate *)month {
return self->month;
}
- (int)year {
return [[self selectedDate] yearOfCommonEra];
}
- (NSArray *)arrayOfDateArrays {
NSCalendarDate *startDate;
NSMutableArray *result, *tmp;
unsigned rowIdx, columnIdx;
int monthOffset = 0;
startDate = [self startDate];
result = [NSMutableArray arrayWithCapacity:3];
for (rowIdx = 0; rowIdx < 3; rowIdx++) {
tmp = [[NSMutableArray alloc] initWithCapacity:4];
for (columnIdx = 0; columnIdx < 4; columnIdx++) {
NSCalendarDate *date;
date = [startDate dateByAddingYears:0 months:monthOffset days:0];
[tmp addObject:date];
monthOffset++;
}
[result addObject:tmp];
[tmp release];
}
return result;
}
/* date ranges */
- (NSCalendarDate *)startDate {
return [[[NSCalendarDate alloc] initWithYear:[self year] month:1 day:1
hour:0 minute:0 second:0
timeZone:[self viewTimeZone]] autorelease];
}
- (NSCalendarDate *)endDate {
return nil;
}
/* URLs */
- (NSDictionary *)todayQueryParameters {
NSCalendarDate *date;
date = [NSCalendarDate date]; /* today */
return [self queryParametersBySettingSelectedDate:date];
}
- (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date{
NSMutableDictionary *qp;
qp = [[self queryParameters] mutableCopy];
[self setSelectedDateQueryParameter:_date inDictionary:qp];
return [qp autorelease];
}
- (void)setSelectedDateQueryParameter:(NSCalendarDate *)_newDate
inDictionary:(NSMutableDictionary *)_qp;
{
if (_newDate != nil)
[_qp setObject:[self dateStringForDate:_newDate] forKey:@"day"];
else
[_qp removeObjectForKey:@"day"];
}
- (NSDictionary *)prevYearQueryParameters {
NSCalendarDate *date;
date = [[self startDate] dateByAddingYears:-1 months:0 days:0
hours:0 minutes:0 seconds:0];
return [self queryParametersBySettingSelectedDate:date];
}
- (NSDictionary *)nextYearQueryParameters {
NSCalendarDate *date;
date = [[self startDate] dateByAddingYears:1 months:0 days:0
hours:0 minutes:0 seconds:0];
return [self queryParametersBySettingSelectedDate:date];
}
@end /* UIxCalYearOverview */
+38
View File
@@ -0,0 +1,38 @@
/*
Copyright (C) 2000-2004 SKYRIX Software AG
This file is part of OGo
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxComponent+Agenor.h 705 2005-07-08 13:29:26Z znek $
#ifndef __UIxComponent_Agenor_H_
#define __UIxComponent_Agenor_H_
#include <SOGoUI/UIxComponent.h>
@interface UIxComponent (Agenor)
/* email, cn */
- (NSString *)emailForUser;
- (NSString *)cnForUser;
/* restrictions */
- (BOOL)isAccessRestricted;
@end
#endif /* __UIxComponent_Agenor_H_ */
+42
View File
@@ -0,0 +1,42 @@
/*
Copyright (C) 2000-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include "UIxComponent+Agenor.h"
#include <SOGo/AgenorUserManager.h>
#include <SOGo/WOContext+Agenor.h>
#include <SOGo/SOGoUser.h>
#include "common.h"
@implementation UIxComponent(Agenor)
- (NSString *)emailForUser {
return [[[self context] activeUser] email];
}
- (NSString *)cnForUser {
return [[[self context] activeUser] cn];
}
- (BOOL)isAccessRestricted {
return [[self context] isAccessFromIntranet] ? NO : YES;
}
@end /* UIxComponent(Agenor) */
+210
View File
@@ -0,0 +1,210 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include <NGObjWeb/WOComponent.h>
@class NSString;
@interface UIxDatePicker : WOComponent
{
NSString *dateID;
id day;
id month;
id year;
NSString *label;
}
- (NSString *)dateID;
- (NSString *)dateFormat;
- (NSString *)jsDateFormat;
- (BOOL)useISOFormats;
@end
#include "common.h"
@implementation UIxDatePicker
- (void)dealloc {
[self->dateID release];
[self->day release];
[self->month release];
[self->year release];
[self->label release];
[super dealloc];
}
/* Accessors */
- (void)setDateID:(NSString *)_dateID {
ASSIGNCOPY(self->dateID, _dateID);
}
- (NSString *)dateID {
return self->dateID;
}
- (void)setDay:(id)_day {
ASSIGN(self->day, _day);
}
- (id)day {
return self->day;
}
- (void)setMonth:(id)_month {
ASSIGN(self->month, _month);
}
- (id)month {
return self->month;
}
- (void)setYear:(id)_year {
ASSIGN(self->year, _year);
}
- (id)year {
return self->year;
}
- (void)setLabel:(NSString *)_label {
ASSIGNCOPY(self->label, _label);
}
- (NSString *)label {
return self->label;
}
/* formats */
- (BOOL)useISOFormats {
WOContext *ctx;
NSNumber *useISOFormats;
ctx = [self context];
useISOFormats = [ctx valueForKey:@"useISOFormats"];
if (!useISOFormats) {
NSArray *languages = [ctx resourceLookupLanguages];
if (languages && [languages count] > 0) {
if ([[languages objectAtIndex:0] isEqualToString:@"French"]) {
useISOFormats = [NSNumber numberWithBool:NO];
}
}
if (!useISOFormats)
useISOFormats = [NSNumber numberWithBool:YES];
[ctx takeValue:useISOFormats forKey:@"useISOFormats"];
}
return [useISOFormats boolValue];
}
- (NSString *)formattedDateString {
char buf[22];
if ([self useISOFormats]) {
sprintf(buf, "%04d-%02d-%02d",
[[self year] intValue],
[[self month] intValue],
[[self day] intValue]);
}
else {
sprintf(buf, "%02d/%02d/%04d",
[[self day] intValue],
[[self month] intValue],
[[self year] intValue]);
}
return [NSString stringWithCString:buf];
}
- (NSString *)dateFormat {
return [self useISOFormats] ? @"%Y-%m-%d" : @"%d/%m/%Y";
}
- (NSString *)jsDateFormat {
return [self useISOFormats] ? @"yyyy-mm-dd" : @"dd/mm/yyyy";
}
/* URLs */
- (NSString *)calendarPageURL {
WOResourceManager *rm;
WOContext *ctx;
NSArray *languages;
if ((rm = [self resourceManager]) == nil)
rm = [[WOApplication application] resourceManager];
if (rm == nil)
[self warnWithFormat:@"missing resource manager!"];
ctx = [self context];
#if 0
languages = [ctx resourceLookupLanguages];
#else
#warning !! FIX SoProduct to enable localizable resource, then disable this!
languages = nil;
#endif
return [rm urlForResourceNamed:@"skycalendar.html" inFramework:nil
languages:languages request:[ctx request]];
}
/* JavaScript */
- (NSString *)jsPopup {
return [NSString stringWithFormat:@"javascript:calendar_%@.popup()",
[self dateID]];
}
- (NSString *)jsCode {
static NSString *code = \
@"var calendar_%@ = new skycalendar(document.getElementById('%@'));\n"
@"calendar_%@.setCalendarPage('%@');\n"
@"calendar_%@.setDateFormat('%@');\n";
return [NSString stringWithFormat:code,
self->dateID,
self->dateID,
self->dateID,
[self calendarPageURL],
self->dateID,
[self jsDateFormat]];
}
/* action */
- (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
NSString *dateString;
NSCalendarDate *d;
dateString = [_rq formValueForKey:[self dateID]];
if (dateString == nil) {
[self debugWithFormat:@"got no date string!"];
return;
}
d = [NSCalendarDate dateWithString:dateString
calendarFormat:[self dateFormat]];
if (d == nil) {
[self warnWithFormat:@"Could not parse dateString: '%@'",
dateString];
}
[self setDay: [NSNumber numberWithInt:[d dayOfMonth]]];
[self setMonth:[NSNumber numberWithInt:[d monthOfYear]]];
[self setYear: [NSNumber numberWithInt:[d yearOfCommonEra]]];
[super takeValuesFromRequest:_rq inContext:_ctx];
}
@end /* UIxDatePicker */
+37
View File
@@ -0,0 +1,37 @@
/*
Copyright (C) 2000-2004 SKYRIX Software AG
This file is part of OGo
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxDatePickerScript.m 223 2004-08-15 14:50:22Z znek $
#include <NGObjWeb/NGObjWeb.h>
@interface UIxDatePickerScript : WOComponent
{
}
@end
@implementation UIxDatePickerScript
@end
+210
View File
@@ -0,0 +1,210 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxTimeDateControl.m 601 2005-02-22 15:45:03Z znek $
#include <SOGoUI/UIxComponent.h>
@interface UIxTimeDateControl : UIxComponent
{
NSString *controlID;
NSString *label;
NSCalendarDate *date;
id hour;
id minute;
id second;
id day;
id month;
id year;
BOOL displayTimeControl;
}
- (void)setControlID:(NSString *)_controlID;
- (NSString *)controlID;
- (void)setLabel:(NSString *)_label;
- (NSString *)label;
- (void)setDate:(NSCalendarDate *)_date;
- (NSCalendarDate *)date;
- (void)setHour:(id)_hour;
- (id)hour;
- (void)setMinute:(id)_minute;
- (id)minute;
- (void)setSecond:(id)_second;
- (id)second;
- (void)setDay:(id)_day;
- (id)day;
- (void)setMonth:(id)_month;
- (id)month;
- (void)setYear:(id)_year;
- (id)year;
- (NSString *)timeID;
- (NSString *)dateID;
- (void)_setDate:(NSCalendarDate *)_date;
@end
#include "common.h"
@implementation UIxTimeDateControl
- (id)init {
self = [super init];
if (self) {
self->displayTimeControl = YES;
}
return self;
}
- (void)dealloc {
[self->controlID release];
[self->label release];
[self->date release];
[self->hour release];
[self->minute release];
[self->second release];
[self->day release];
[self->month release];
[self->year release];
[super dealloc];
}
/* accessors */
- (void)setControlID:(NSString *)_controlID {
ASSIGNCOPY(self->controlID, _controlID);
}
- (NSString *)controlID {
return self->controlID;
}
- (void)setLabel:(NSString *)_label {
ASSIGNCOPY(self->label, _label);
}
- (NSString *)label {
return self->label;
}
- (void)setDate:(NSCalendarDate *)_date {
if (!_date)
_date = [NSCalendarDate date];
[self _setDate:_date];
[self setHour:[NSNumber numberWithInt:[_date hourOfDay]]];
[self setMinute:[NSNumber numberWithInt:[_date minuteOfHour]]];
[self setYear:[NSNumber numberWithInt:[_date yearOfCommonEra]]];
[self setMonth:[NSNumber numberWithInt:[_date monthOfYear]]];
[self setDay:[NSNumber numberWithInt:[_date dayOfMonth]]];
}
- (void)_setDate:(NSCalendarDate *)_date {
ASSIGN(self->date, _date);
}
- (NSCalendarDate *)date {
return self->date;
}
- (void)setHour:(id)_hour {
ASSIGN(self->hour, _hour);
}
- (id)hour {
return self->hour;
}
- (void)setMinute:(id)_minute {
ASSIGN(self->minute, _minute);
}
- (id)minute {
return self->minute;
}
- (void)setSecond:(id)_second {
ASSIGN(self->second, _second);
}
- (id)second {
return self->second;
}
- (void)setDay:(id)_day {
ASSIGN(self->day, _day);
}
- (id)day {
return self->day;
}
- (void)setMonth:(id)_month {
ASSIGN(self->month, _month);
}
- (id)month {
return self->month;
}
- (void)setYear:(id)_year {
ASSIGN(self->year, _year);
}
- (id)year {
return self->year;
}
- (NSString *)timeID {
return [[self controlID] stringByAppendingString:@"_time"];
}
- (NSString *)dateID {
return [[self controlID] stringByAppendingString:@"_date"];
}
- (void)setDisplayTimeControl:(BOOL)_displayTimeControl {
self->displayTimeControl = _displayTimeControl;
}
- (BOOL)displayTimeControl {
return self->displayTimeControl;
}
#if 0
- (NSString *)timeControlStyle {
if (self->displayTimeControl)
return @"visibility : visible;";
return @"visibility : hidden;";
}
#endif
/* processing request */
- (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
NSCalendarDate *d;
unsigned _year, _month, _day, _hour, _minute, _second;
/* call super, so that the form values are applied on the popups */
[super takeValuesFromRequest:_rq inContext:_ctx];
_year = [[self year] intValue];
if(_year == 0)
return;
_month = [[self month] intValue];
_day = [[self day] intValue];
_hour = [[self hour] intValue];
_minute = [[self minute] intValue];
_second = [[self second] intValue];
d = [NSCalendarDate dateWithYear:_year
month:_month
day:_day
hour:_hour
minute:_minute
second:_second
timeZone:[self viewTimeZone]];
[self _setDate:d];
}
@end /* UIxTimeDateControl */
+94
View File
@@ -0,0 +1,94 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxTimeSelector.m 247 2004-08-16 09:32:04Z znek $
#include <NGObjWeb/WOComponent.h>
@class NSString, NSCalendarDate, NSArray;
@interface UIxTimeSelector : WOComponent
{
NSString *timeID;
id hour;
id minute;
NSString *minuteInterval;
}
- (void)setTimeID:(NSString *)_timeID;
- (NSString *)timeID;
- (void)setHour:(id)_hour;
- (id)hour;
- (void)setMinute:(id)_minute;
- (id)minute;
- (void)setMinuteInterval:(NSString *)_minuteInterval;
- (NSString *)minuteInterval;
@end
#include "common.h"
@implementation UIxTimeSelector
- (void)dealloc {
[self->timeID release];
[self->hour release];
[self->minute release];
[self->minuteInterval release];
[super dealloc];
}
/* accessors */
- (void)setTimeID:(NSString *)_timeID {
ASSIGNCOPY(self->timeID, _timeID);
}
- (NSString *)timeID {
return self->timeID;
}
- (void)setHour:(id)_hour {
ASSIGN(self->hour, _hour);
}
- (id)hour {
return self->hour;
}
- (void)setMinute:(id)_minute {
ASSIGN(self->minute, _minute);
}
- (id)minute {
return self->minute;
}
- (void)setMinuteInterval:(NSString *)_minuteInterval {
ASSIGNCOPY(self->minuteInterval, _minuteInterval);
}
- (NSString *)minuteInterval {
if(self->minuteInterval == nil)
return @"1";
return self->minuteInterval;
}
- (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
/* call super, so that the form values are applied on the popups */
[super takeValuesFromRequest:_rq inContext:_ctx];
}
@end /* UIxTimeSelector */
+26
View File
@@ -0,0 +1,26 @@
# Version file
SUBMINOR_VERSION:=147
# v0.9.147 requires Appointments v0.9.50
# v0.9.136 requires SOGoUI v0.9.30
# v0.9.123 requires Appointments v0.9.35
# v0.9.123 requires SOGoUI v0.9.24
# v0.9.115 requires NGiCal v4.5.44
# v0.9.113 requires libSOGo v0.9.30
# v0.9.112 requires SOGoLogic v0.9.12
# v0.9.107 requires WOExtensions v4.5.21
# v0.9.105 requires NGObjWeb v4.5.102
# v0.9.101 requires NGiCal v4.5.36
# v0.9.100 requires SOGoUI v0.9.21
# v0.9.99 requires SOGoUI v0.9.20
# v0.9.98 requires SOGoUI v0.9.19
# v0.9.96 requires SOGoLogic v0.9.27
# v0.9.94 requires NGExtensions v4.5.136
# v0.9.84 requires SOGoLogic v0.9.12
# v0.9.70 requires NGExtensions v4.3.107
# v0.9.67 requires SOPE v4.3
# v0.9.61 requires NGExtensions v4.2.102
# v0.9.41 requires NGObjWeb v4.2.431
# v0.9.31 requires WEExtensions v4.2.52
# v0.9.29 requires WEExtensions v4.2.51
+17
View File
@@ -0,0 +1,17 @@
{
"__cvs__" = "$Id: bundle-info.plist,v 1.1 2003/11/24 01:24:40 helge Exp $";
requires = {
bundleManagerVersion = 1;
classes = (
{ name = NSObject; }
);
};
provides = {
classes = (
);
WOComponents = (
);
};
}
+34
View File
@@ -0,0 +1,34 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: common.h 181 2004-08-11 15:13:25Z helge $
#import <Foundation/Foundation.h>
#if LIB_FOUNDATION_LIBRARY
# include <Foundation/exceptions/GeneralExceptions.h>
#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
# include <NGExtensions/NGObjectMacros.h>
# include <NGExtensions/NSString+Ext.h>
#endif
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
+33
View File
@@ -0,0 +1,33 @@
(
{
"label" = "cycle_once";
},
{
"label" = "cycle_daily";
"rule" = "FREQ=DAILY";
},
{
"label" = "cycle_weekly";
"rule" = "FREQ=WEEKLY";
},
{
"label" = "cycle_2weeks";
"rule" = "FREQ=WEEKLY;INTERVAL=2";
},
{
"label" = "cycle_4weeks";
"rule" = "FREQ=WEEKLY;INTERVAL=4";
},
{
"label" = "cycle_monthly";
"rule" = "FREQ=MONTHLY";
},
{
"label" = "cycle_weekday";
"rule" = "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR";
},
{
"label" = "cycle_yearly";
"rule" = "FREQ=YEARLY";
}
)
+34
View File
@@ -0,0 +1,34 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $
#ifndef __iCalPerson_UIx_H__
#define __iCalPerson_UIx_H__
#include <NGiCal/NGiCal.h>
@class NSString;
@interface iCalPerson(Convenience)
- (NSString *)cnForDisplay;
@end
#endif /* __iCalPerson_UIx_H__ */
+32
View File
@@ -0,0 +1,32 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $
#include "iCalPerson+UIx.h"
#include "common.h"
@implementation iCalPerson(Convenience)
- (NSString *)cnForDisplay {
return [self cnWithoutQuotes];
}
@end /* iCalPerson(Convenience) */
+52
View File
@@ -0,0 +1,52 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include <NGiCal/NGiCal.h>
#include "common.h"
/* HACK ALERT
This is a pretty ugly (unfortunately necessary) hack to map our limited
set of recurrence rules back to the popup list
*/
@interface iCalRecurrenceRule (UsedPrivates)
- (NSString *)freq;
- (NSString *)byDayList;
@end /* iCalRecurrenceRule (UsedPrivates) */
@implementation iCalRecurrenceRule (SOGoExtensions)
- (NSString *)cycleRepresentationForSOGo {
NSMutableString *s;
s = [NSMutableString stringWithCapacity:20];
[s appendString:@"FREQ="];
[s appendString:[self freq]];
if ([self repeatInterval] != 1) {
[s appendFormat:@";INTERVAL=%d", [self repeatInterval]];
}
if (self->byDay.mask != 0) {
[s appendString:@";BYDAY="];
[s appendString:[self byDayList]];
}
return s;
}
@end /* iCalRecurrenceRule (SOGoExtensions) */
Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

+145
View File
@@ -0,0 +1,145 @@
{
requires = ( MAIN, CommonUI, Appointments );
publicResources = (
previous_week.gif,
next_week.gif,
icon_view_overview.gif,
icon_view_overview_inactive.gif,
icon_view_chart.gif,
icon_view_chart_inactive.gif,
icon_view_list.gif,
icon_view_list_inactive.gif,
icon_view_columns.gif,
icon_view_columns_inactive.gif,
icon_popupcalendar.gif,
first.gif,
previous.gif,
next.gif,
last.gif,
skycalendar.html,
skycalendar.js,
green_corner.gif,
invisible_space_2.gif,
cycles.plist,
);
factories = {
};
categories = {
SOGoAppointmentFolder = {
methods = {
dayoverview = {
protectedBy = "View";
pageName = "UIxCalDayOverview";
};
daychartview = {
protectedBy = "View";
pageName = "UIxCalDayChartview";
};
daylistview = {
protectedBy = "View";
pageName = "UIxCalDayListview";
};
dayprintview = {
protectedBy = "View";
pageName = "UIxCalDayPrintview";
};
weekoverview = {
protectedBy = "View";
pageName = "UIxCalWeekOverview";
};
weekchartview = {
protectedBy = "View";
pageName = "UIxCalWeekChartview";
};
weeklistview = {
protectedBy = "View";
pageName = "UIxCalWeekListview";
};
weekcolumnsview = {
protectedBy = "View";
pageName = "UIxCalWeekColumnsview";
};
weekprintview = {
protectedBy = "View";
pageName = "UIxCalWeekPrintview";
};
monthoverview = {
protectedBy = "View";
pageName = "UIxCalMonthOverview";
};
monthprintview = {
protectedBy = "View";
pageName = "UIxCalMonthPrintview";
};
yearoverview = {
protectedBy = "View";
pageName = "UIxCalYearOverview";
};
new = {
protectedBy = "View";
pageName = "UIxAppointmentEditor";
actionName = "new";
};
show = {
protectedBy = "View";
pageName = "UIxCalView";
actionName = "redirectForUIDs";
};
proposal = {
protectedBy = "View";
pageName = "UIxAppointmentProposal";
};
proposalSearch = {
protectedBy = "View";
pageName = "UIxAppointmentProposal";
actionName = "proposalSearch";
};
};
};
SOGoAppointmentObject = {
methods = {
printview = {
protectedBy = "View";
pageName = "UIxAppointmentPrintview";
};
view = {
protectedBy = "View";
pageName = "UIxAppointmentView";
};
delete = {
protectedBy = "View";
pageName = "UIxAppointmentView";
actionName = "delete";
};
edit = {
protectedBy = "View";
pageName = "UIxAppointmentEditor";
};
save = {
protectedBy = "View";
pageName = "UIxAppointmentEditor";
actionName = "save";
};
accept = {
protectedBy = "View";
pageName = "UIxAppointmentEditor";
actionName = "accept";
};
decline = {
protectedBy = "View";
pageName = "UIxAppointmentEditor";
actionName = "decline";
};
test = {
protectedBy = "View";
pageName = "UIxAppointmentEditor";
actionName = "test";
};
};
};
};
}
+160
View File
@@ -0,0 +1,160 @@
<!--
Title: Tigra Calendar
Description: See the demo at url
URL: http://www.softcomplex.com/products/tigra_calendar/
Version: 3.1
Date: 08-08-2002 (mm-dd-yyyy)
Feedback: feedback@softcomplex.com (specify product title in the subject)
Note: Permission given to use this script in ANY kind of applications if
header lines are left unchanged.
Note: Script consists of two files: calendar?.js and calendar.html
About us: Our company provides offshore IT consulting services.
Contact us at sales@softcomplex.com if you have any programming task you
want to be handled by professionals. Our typical hourly rate is $20.
modified by Martin Hoerning, mh@skyrix.com, 2002-12-05
-->
<html>
<head>
<title>Select Date, Please.</title>
<style>
td {font-family: Tahoma, Verdana, sans-serif; font-size: 12px;}
</style>
<script language="JavaScript">
// months as they appear in the calendar's title
var ARR_MONTHS = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
// week day titles as they appear on the calendar
var ARR_WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
// day week starts from (normally 0-Mo or 1-Su)
var NUM_WEEKSTART = 1;
// path to the directory where calendar images are stored. trailing slash req.
var STR_ICONPATH = '';
var re_url = new RegExp('datetime=(\\-?\\d+)');
var dt_current = (re_url.exec(String(window.location))
? new Date(new Number(RegExp.$1)) : new Date());
var re_id = new RegExp('id=(\\d+)');
var num_id = (re_id.exec(String(window.location))
? new Number(RegExp.$1) : 0);
var obj_caller = (window.opener ? window.opener.calendars[num_id] : null);
if (obj_caller && obj_caller.year_scroll) {
// get same date in the previous year
var dt_prev_year = new Date(dt_current);
dt_prev_year.setFullYear(dt_prev_year.getFullYear() - 1);
if (dt_prev_year.getDate() != dt_current.getDate())
dt_prev_year.setDate(0);
// get same date in the next year
var dt_next_year = new Date(dt_current);
dt_next_year.setFullYear(dt_next_year.getFullYear() + 1);
if (dt_next_year.getDate() != dt_current.getDate())
dt_next_year.setDate(0);
}
// get same date in the previous month
var dt_prev_month = new Date(dt_current);
dt_prev_month.setMonth(dt_prev_month.getMonth() - 1);
if (dt_prev_month.getDate() != dt_current.getDate())
dt_prev_month.setDate(0);
// get same date in the next month
var dt_next_month = new Date(dt_current);
dt_next_month.setMonth(dt_next_month.getMonth() + 1);
if (dt_next_month.getDate() != dt_current.getDate())
dt_next_month.setDate(0);
// get first day to display in the grid for current month
var dt_firstday = new Date(dt_current);
dt_firstday.setDate(1);
dt_firstday.setDate(1 - (7 + dt_firstday.getDay() - NUM_WEEKSTART) % 7);
// function passing selected date to calling window
function set_datetime(n_datetime, b_close) {
if (!obj_caller) return;
var dt_datetime = new Date(n_datetime);
if (!dt_datetime) {
alert('failed to generate date string');
return;
}
if (b_close) { // only set value when closing window
obj_caller.target.value = (document.cal
? obj_caller.gen_tsmp(dt_datetime)
: obj_caller.gen_date(dt_datetime)
);
}
if (b_close) window.close();
else obj_caller.popup(dt_datetime.valueOf());
}
</script>
</head>
<body bgcolor="#FFFFFF" marginheight="5" marginwidth="5" topmargin="5" leftmargin="5" rightmargin="5">
<table class="clsOTable" cellspacing="0" border="0" width="100%">
<tr><td bgcolor="#E8E8E0">
<table cellspacing="1" cellpadding="3" border="0" width="100%">
<tr><td colspan="7" bgcolor="#D0D0D0"><table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<script language="JavaScript">
document.write(
'<td>'+(obj_caller&&obj_caller.year_scroll?'<a href="javascript:set_datetime('+dt_prev_year.valueOf()+')"><img src="'+STR_ICONPATH+'first.gif" width="15" height="15" border="0" alt="previous year" title="previous year"></a>&nbsp;':'')+'<a href="javascript:set_datetime('+dt_prev_month.valueOf()+')"><img src="'+STR_ICONPATH+'previous.gif" width="15" height="15" border="0" alt="previous month" title="previous month"></a></td>'+
'<td align="center" width="100%"><font color="#000000">'+ARR_MONTHS[dt_current.getMonth()]+' '+dt_current.getFullYear() + '</font></td>'+
'<td><a href="javascript:set_datetime('+dt_next_month.valueOf()+')"><img src="'+STR_ICONPATH+'next.gif" width="15" height="15" border="0" alt="next month" title="next month"></a>'+(obj_caller && obj_caller.year_scroll?'&nbsp;<a href="javascript:set_datetime('+dt_next_year.valueOf()+')"><img src="'+STR_ICONPATH+'last.gif" width="15" height="15" border="0" alt="next year" title="next year"></a>':'')+'</td>'
);
</script>
</tr>
</table></td></tr>
<tr>
<script language="JavaScript">
// print weekdays titles
for (var n=0; n<7; n++)
document.write('<td bgcolor="#D0D0D0" align="center"><font color="#000000">'+ARR_WEEKDAYS[(NUM_WEEKSTART+n)%7]+'</font></td>');
document.write('</tr>');
// print calendar table
var dt_current_day = new Date(dt_firstday);
while (dt_current_day.getMonth() == dt_current.getMonth() ||
dt_current_day.getMonth() == dt_firstday.getMonth()) {
// print row heder
document.write('<tr>');
for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
if (dt_current_day.getDate() == dt_current.getDate() &&
dt_current_day.getMonth() == dt_current.getMonth())
// print current date
document.write('<td bgcolor="#F18D39" align="center" width="14%">');
//else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
else if (dt_current_day.getMonth() != dt_current.getMonth())
// old: weekend days // new: other month
document.write('<td bgcolor="#D0D0D0" align="center" width="14%">');
else
// print working days of current month
document.write('<td bgcolor="#E0E0E0" align="center" width="14%">');
document.write('<a href="javascript:set_datetime('+dt_current_day.valueOf() +', true);">');
if (dt_current_day.getMonth() == this.dt_current.getMonth())
// print days of current month
document.write('<font color="#000000">');
else
// print days of other months
document.write('<font color="#555555">');
document.write(dt_current_day.getDate()+'</font></a></td>');
dt_current_day.setDate(dt_current_day.getDate()+1);
}
// print row footer
document.write('</tr>');
}
//if (obj_caller && obj_caller.time_comp)
// document.write('<form onsubmit="javascript:set_datetime('+dt_current.valueOf()+', true)" name="cal"><tr><td colspan="7" bgcolor="#87CEFA"><font color="White" face="tahoma, verdana" size="2">Time: <input type="text" name="time" value="'+obj_caller.gen_time(this.dt_current)+'" size="8" maxlength="8"></font></td></tr></form>');
</script>
</table></tr></td>
</table>
</body>
</html>
+190
View File
@@ -0,0 +1,190 @@
// Title: Tigra Calendar
// Description: See the demo at url
// URL: http://www.softcomplex.com/products/tigra_calendar/
// Version: 3.1 (European date format)
// Date: 08-08-2002 (mm-dd-yyyy)
// Feedback: feedback@softcomplex.com (specify product title in the subject)
// Note: Permission given to use this script in ANY kind of applications if
// header lines are left unchanged.
// Note: Script consists of two files: calendar?.js and calendar.html
// About us: Our company provides offshore IT consulting services.
// Contact us at sales@softcomplex.com if you have any programming task you
// want to be handled by professionals. Our typical hourly rate is $20.
// modified by Martin Hoerning, mh@skyrix.com, 2002-12-05
// 2003-01-23 added date format support (Martin Hoerning)
// if two digit year input dates after this year considered 20 century.
var NUM_CENTYEAR = 30;
// are year scrolling buttons required by default
var BUL_YEARSCROLL = true;
var DEF_CALPAGE = 'skycalendar.html';
var calendars = [];
var RE_NUM = /^\-?\d+$/;
var dateFormat = "yyyy-mm-dd";
function skycalendar(obj_target) {
// assing methods
this.gen_date = cal_gen_date1;
this.gen_tsmp = cal_gen_tsmp1;
this.prs_date = cal_prs_date1;
this.prs_tsmp = cal_prs_tsmp1;
this.popup = cal_popup1;
this.setCalendarPage = cal_setcalpage1;
this.setDateFormat = cal_setdateformat1;
// validate input parameters
if (!obj_target)
return cal_error("Error calling the calendar: no target control specified");
if (obj_target.value == null)
return cal_error("Error calling the calendar: parameter specified is not valid tardet control");
this.target = obj_target;
this.year_scroll = BUL_YEARSCROLL;
this.calpage = DEF_CALPAGE;
// register in global collections
this.id = calendars.length;
calendars[this.id] = this;
}
function cal_setcalpage1(str_page) {
this.calpage = str_page;
}
function cal_setdateformat1(str_dateformat) {
this.dateFormat = str_dateformat;
}
function cal_popup1(str_datetime) {
this.dt_current = this.prs_tsmp(str_datetime ? str_datetime : this.target.value);
if (!this.dt_current) return;
var obj_calwindow = window.open(
this.calpage+'?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,
'Calendar', 'width=200,height=190'+
',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
);
obj_calwindow.opener = window;
obj_calwindow.focus();
}
// timestamp generating function
function cal_gen_tsmp1(dt_datetime) {
return this.gen_date(dt_datetime);
}
// date generating function
function cal_gen_date1(dt_datetime) {
var out = this.dateFormat;
var idx;
if (out.indexOf("yyyy") != 1) {
t = out.split("yyyy");
out = t.join(dt_datetime.getFullYear());
}
else {
return cal_error("Missing year-part 'yyyy' in format: '"+this.dateFormat);
}
if (out.indexOf("mm") != 1) {
t = out.split("mm");
out = t.join((dt_datetime.getMonth() < 9 ? '0' : '')+
(dt_datetime.getMonth()+1));
}
else {
return cal_error("Missing month-part 'mm' in format: '"+this.dateFormat);
}
if (out.indexOf("dd") != 1) {
t = out.split("dd");
out = t.join((dt_datetime.getDate() < 10 ? '0' : '')+
dt_datetime.getDate());
}
else {
return cal_error("Missing day-part 'dd' in format: '"+this.dateFormat);
}
return out;
}
// timestamp parsing function
function cal_prs_tsmp1(str_datetime) {
// if no parameter specified return current timestamp
if (!str_datetime)
return (new Date());
// if positive integer treat as milliseconds from epoch
if (RE_NUM.exec(str_datetime))
return new Date(str_datetime);
return this.prs_date(str_datetime);
}
// date parsing function
function cal_prs_date1(str_date) {
var idx;
var year = null;
var month = null;
var day = null;
if (str_date.length != this.dateFormat.length) {
return cal_error ("Invalid date format: '"+str_date+
"'.\nFormat accepted is '"+this.dateFormat+"'.");
}
if ((idx = this.dateFormat.indexOf("yyyy")) != 1) {
year = str_date.substring(idx, idx+4);
}
else {
return cal_error("Missing year-part 'yyyy' in format: '"+this.dateFormat);
}
if ((idx = this.dateFormat.indexOf("mm")) != 1) {
month = str_date.substring(idx, idx+2);
}
else {
return cal_error("Missing month-part 'mm' in format: '"+this.dateFormat);
}
if ((idx = this.dateFormat.indexOf("dd")) != 1) {
day = str_date.substring(idx, idx+2);
}
else {
return cal_error("Missing day-part 'dd' in format: '"+this.dateFormat);
}
if (!day) return cal_error("Invalid date format: '"+str_date+
"'.\nNo day of month value can be found.");
if (!RE_NUM.exec(day))
return cal_error("Invalid day of month value: '"+day+
"'.\nAllowed values are unsigned integers.");
if (!month) return cal_error("Invalid date format: '"+str_date+
"'.\nNo month of year value can be found.");
if (!RE_NUM.exec(month))
return cal_error("Invalid month of year value: '"+month+
"'.\nAllowed values are unsigned integers.");
if (!year) return cal_error("Invalid date format: '"+str_date+
"'.\nNo year value can be found.");
if (!RE_NUM.exec(year))
return cal_error("Invalid year value: '"+year+
"'.\nAllowed values are unsigned integers.");
var dt_date = new Date();
dt_date.setDate(1);
if (month < 1 || month > 12)
return cal_error("Invalid month value: '"+month+
"'.\nAllowed range is 01-12.");
dt_date.setMonth(month-1);
if (year < 100) year = Number(year)+(year < NUM_CENTYEAR ? 2000 : 1900);
dt_date.setFullYear(year);
var dt_numdays = new Date(year, month, 0);
dt_date.setDate(day);
if (dt_date.getMonth() != (month-1))
return cal_error("Invalid day of month value: '"+day+
"'.\nAllowed range is 01-"+dt_numdays.getDate()+".");
return (dt_date);
}
function cal_error(str_message) {
alert (str_message);
return null;
}