Set Context status to 'On Hold' or 'Active' programmatically - omnifocus

Is it possible to set the status of an OmniFocus Context to On Hold or Active programmatically?

Related

Remove selected user from User picker in Google App maker

In the User Picker widget after I pick a user and then select the same user after clearing the value (
widget.value = null;
), selecting that user does not trigger the onValueChange event (because it is not a regarded as a newValue).
Even in the Training Hub example this issue is present.
Issue it causes: If I add a user then delete it I cannot add the user again until I add a different user which changes the value of the widget.
Depending on when you clear the value, I use this script when exiting a page/popup with a user picker on it. This way the user picker does not retain the last user selected when returning to that page/popup. This script is usually in the onClick of a button to cancel/submit/exit/etc., which is why you can't use widget.value. You will need to use your own page/widget names as appropriate -
app.popups.Popup1.children.Content.children.Form1.children.Form1Body.children.UserPicker1.value = null;

Plone - How can I setDefaultPage in an event subscriber?

I have a folderish dexterity content type and I have an event subscriber. When the content type is created, I create a Collection, which shows the children in the container according to several parameters. After the collection is created, I try to set the default page of the container to the collection.
def myContainerAdded(my_container, event):
#get container
#set advanced query for collection
#create collection with api.create
my_container.setDefaultPage(new_collection.id)
The subscriber in configure.zcml
<subscriber
for="my.product.my_container.IMyContainer
zope.lifecycleevent.interfaces.IObjectAddedEvent"
handler=".events.myContainerAdded" />
Unfortunately, the default page is not being fully set. It just shows the container page, but the Collection is selected under the 'Display' drop down.
If I click "Change content item as default view" and select the collection, it does change the default page to the collection.
Earlier, I was using a "setuphandler" to setup a folder structure (as opposed to an add event), and setDefaultPage was working. Am I forgetting a step since I'm attempting this through an event?
I am using plone.4.3.
Edit: I also tried:
my_container.default_page = new_collection.id
Edit:
I found something interesting. I temporarily commented out the code related to the collection in the event subscriber. I manually added the collection to the container object and then set the default page of the container to the collection. The container's default page was the collection.
Maybe something isn't getting indexed right?
In fact everything went well, it's just that after creating a Dexterity-based content-type, one will land on the default-view's URL, meaning '/view' is appended to the item's URL, which is an alias to the default-view-method and here resolves to the 'folder_listing'-template.
To overcome this quickly, you can add a redirect to the object's URL in the subscriber's method, without any view-name appended to the URL:
event.REQUEST.RESPONSE.redirect(my_container.absolute_url())

drupal - collection field with status - publish checkbox

is there a way to have a publish checkbox on a collection field associated to a content type ?
if i have 3 items on a collection field associated to a node , one i want to set it unpublished so only 2 are displayed.
cars content type:
-mercedes....
-bmw.....
-audi.... = unpublished
Thanks
By default (through the UI) you can't do it.
You can do it programmatically by adding a check-box on your collection by using _form_alter() and add your own validation callback where you'll can modify referenced node accordingly.

CheckedListBox Item Selection

I have created a site that allows users to see a list of files that currently reside on my FTP site.
I have got the files appearing but when I select one and click download, it is not registering that I have selected an item.
At the moment I am using:
If CheckBoxList1.SelectedItem.Value = "" Then
MsgBox("A file needs to be selected...!")
End If
'NOTE - A SELECTION ISN'T BEING RECORDED BY THE PROGRAM!!'
If CheckBoxList1.SelectedItem.Value <> "" Then
I think that it is not registering the selection being made, because the item being selected is not a string value.
But I am not sure what to set this as.
It would help if you provided the actual code being used to attach the selection / change handler as well as the event method body.
I'm guessing your attaching to the checkbox SelectedIndexChanged event. If that's the case then make sure that you have actually bound a "value" to the checkbox list, ensure that you are using the "DataTextField"and "DataValueField" properties instead of just default binding the checkboxlist to a collection.

Drupal Access to Admin panel Denied

Inserted new menu item in hook_menu. But the menu item is not reflected. So in module i added the statement as
function {module_name}_menu_alter(&$items) {
$items['archives/faculty_article'] = array(
'access callback'=>'archives_list_faculty_article',
'access arguments'=>array(1),
);
$items['archives/faculty_article']['access callback'] = 'user_access';
}
Problem raised
1. Not able to access admin panel
2. user warning: Table 'nodewords_custom' doesn't exist query: SELECT * FROM nodewords_custom ORDER BY weight ASC
How can I correct the problem.
Have you flushed your menu cache after creating your new menu entry in the hook_menu()? It's mandatory if you want your new menu entry to be evaluated.
About your code snippet in the hook_menu_alter(), you are not altering properly the menu item, either your rewrite the full attributes of the item (title, page callback, access callback etc) either you just override one attribute (such as what you did for the access callback).
If you want to override two attributes you have to do something like that:
$items['archives/faculty_article']['access callback'] = 'user_access';
$items['archives/faculty_article']['access arguments'] = array('view');
After implementing the hook_menu_alter() you also have to flush your caches.
That's for problem 1. For problem 2, it means that you didn't install nodewords correctly, try to disabling it, uninstalling it and then re-enabling it to try to fix the issue. It should recreate the table for you.

Resources