Connecting nodes to multiple dates - date

I have company website, with many offices around the world (around 50 offices).
The company want to create a gift giveaway with the employees in a specific company each specific day.
For example:
Office 1: will do the giveaway the days: 1/1/2010, 7/1/2010, 15/1/2010, etc...
Office 2: the days: 2/1/2010, 9/1/2010, 19/1/2010, etc...
Office 3: ....
Office 50: ...
(the days are setup manually to specific offices, no need of an algorithm here)
I have a node per Office, it's a CCK content type with details of each office (location, phone, email, etc), now I need to assign those days to the offices.
But my problem here is that I don't need to create events (or at least node events) because I don't need to store any data in the event. Just need to say: Office 1? Yes, days 1/1/2010, 7/1/2010, etc...
Nothing else, just to know the dates.
And, if possible, make them available to display in the calendar module.
What is your suggestion?

Withs CCK and date module you can create date fields, but if you have many fields you want to add, this might not be the best solution.
You have two general ways of solving this issue. Either you need store each date. This could be done with date field, not sure if it can handle multiple values, node reference or similar. This is inefective it some ways, but will make it easy to generate calendar view.
You could also write a string with as the date info and let php convert it to dates. This route will make it easier to create and store the data, but will make it a lot harder to get things integrated with calendar.
The fatest / easiest solution would probably be node reference with a date module, combined with a script to create all the nodes need. Instead of making them inside Drupal.
You could also create a custom module that stores this info for you. It would be a more longterm solution and require more work to integrate it with views and date/calendar modules.
There are many ways to go about this, but it really depends on your need, skill and time

Why not use a plain old CCK text field with a good clear description of what it's for and how to format it with something in the help section to back it up?
Use a text area (multiple rows) and apply the default input format that converts lines line breaks. I like to use the mark down filter too.
You could also use multiple single line fields in place of a text area...
This assumes your users are smart enough to enter the correct info of course but that's what the help and description are for. If your users can't be trusted to enter the content in correctly then yes, go for something that forces them to do so.

Ok I've found the solution myself and I want to share it with you:
Created three content types:
Office: with data of the office
Days: with a node per day (365 * year)
and Giveaway: with two node-reference fields, one for Office and another for Day.
(Days must be populated manually using a script that fills the upcoming 2 years or so).
So I can fill only Giveaway content type, and that's enough.
And then only the views are remaining.

Related

Using a holiday calendar in kdb?

has anyone ever implemented a holiday calendar in kdb?
it's pretty easy to exclude weekends or to create a function to get nextweekday or previous weekday, but what if you want to also take into account public holidays / bank holidays?
What have people done in order to account for this?
A rudimentary way is to create a file with known bank holidays across LDN & NY let's say - but is there a more automated way?
You may want to take a look at holiday.q on Github. Note that NYSE rules change from time to time so you may need to make some adjustments to bring that code up to date.
Most places will have purchased some form of calendar data product (.e.g Copp Clark). From that you'd build a suite of functions for getPrevBizDay etc, and you'd do it for all regions. It will also have future holidays.
Alternatively I'm sure there are some open source holiday data downloads you could scrape from the web and from them you could manually put together a table (perhaps it would be an annual once-off process to update it for the next year).

Autofill various columns in different Google Sheets as new rows are submitted through Google Forms

I sing in a gospel choir in Barcelona and I have been assigned the task of managing the "IT related" issues of the choir.
One of the things we need is to ask the singers wether or not they will attend to the programmed concerts or not. We use Google Forms for that.
The difficulty is that we have various forms opened simultaneously and all the answers go to the same Google Sheets document, but each form to its own sheet. We need it like this to keep it simple and organised, by year in the first sheet.
And the real problem is that we need to expand the formulas from (usually) 3 columns to all the existing rows evey time an answer is provided (or from some to some more, to say so) and also that the columns are not always in the same columns. Here are the examples:
The explanation is this:
Sheet "Resum Concerts Cantaires" contains the summary of all the answer sheet
Each "yyyy-mm-dd whateverplace" is the destination of each different form
Some concerts have 2 answers (first image: email address and "will you attend the concert?") and some have 3 answers (second image: same previous two plus "will you come with our bus?")
Therefore, the columns needed to be copied down sometimes are D,E,F and sometimes are E,F,G.
Can anybody help me with this, please? I have tried the "CopyDown" plug-in, but it's not what I need (it prevents the second row to be sorted and I need it to be).
Thank you very much in advance for the help.

MS Access 2007 Form Logic

This is my first post on Stack. I've been reading for a while and learned a lot. Thanks to all those who share on this site.
My office runs still runs MS Access 2007 and I was tasked with creating a database even though I had no experience doing so. I read "The Missing Manual for Access 2007", another book that I can't remember the name of, multiple posts on this site and Microsoft's and can't find the solution to what I need to do.
Issue: I want to have two fields on a form referring to the same table, each with look ups but want the second field's options to be dependent on the first. For example, I want the first field for "Region" to list options to select 1 2 3 or 4. If someone chooses 1, I want the second field only listed offices that are in Region 1. This doesn't seem like it should wildly complicated but I cannot figure out how to do it.
I have tried using the expression builder to create nested IIf functions, filtering queries, macros and a few other things but don't have the depth of knowledge to make any of them accomplish what I'm looking to do.
Is there a way to accomplish this easily without VBA? Or if VBA is the only way, can someone point me to a good code that I hopefully figure out and edit for this purpose?
Thank you for any help and advice. Please let me know if I left out any useful information
Steve
enter image description here

MS Word - using a date variable without macros

I want to create a Word template which will:
a) prompt user for a date
b) display that date
c) calculate other dates from that date.
I'm using MS Word 2016.
I've never done anything like this in Word but after doing a bit of research I see that there are advanced options in Word which maybe I could use for that. I don't want to use macros for this as I'm thinking that if I can make this work, then I would share this template with the rest of the company and I don't want them to enable macros (we have enough security concerns without that).
I've tried to use a FILLIN field to prompt user for a date. This works, however, I would like this field to be a variable which I can reference later in the document. I haven't found a way to do that with my FILLIN field. Is it possible?
I've seen others mention DocProperties but I'm having a hard time making it work.
For example, if I go to Quick Parts -> Document Property, none of the options are for a custom date. Is there a way to add your own?
And if I go to Quick Parts -> Fields, I see Date, CreateDate, SaveDate which insert "today's date" - not what I want. Again, how do I add my own Field?
I could do this in many ways by using Excel but I wanted to see if I can make it happen with Word. I hope you guys will have an idea.

Powershell AD tool

Basically, I've created a 400+ and growing AD tool with a GUI. I've given them the option to search using many filters with get-aduser and wild cards fill the rest. This company is large so when I search for a common name like kyle or john, it takes along time to pull the information because the search was not specific.
Is there a way to stop them from doing such a general search or limit the number of entries can be in an array, or stop the search if there's too much information.
Edit: I have a solution using a variable to count wild cards but that only works if the form is completely blank. If i set the number any different they won't be able to look someone up by ID number