Quote from: BobRay at Jun 26, 2013, 06:06 PM
On the properties tab when editing the ResourceWatcher plugin, if you set these properties to true, it should work on both new and updated resources:
&resourcewatcher.new_active
&resourcewatcher.upd_active
Hi Bob, yeh I already have both
&resourcewatcher.new_active
&resourcewatcher.upd_active
set to Yes in the system settings.
What I meant was, when an Editor opens a published resource - they should not be able to make edits to that resource and push them straight live by hitting the save button. What I would like to happen when they hit the save button is that the Publisher gets notified that the Editor has updated a resource which needs approval - the Editors updates are stored in a staged version of the page (by using your StageCoach plugin), then the Publisher logs in following the email notification they have received and they can edit / publish the updated page.
Bob - I am also not having much luck with StageCoach - I have it running and looks like it is working ok from the manager side of things, e.g. creating a duplicate resource and putting it into the new Staged Resources folder.... but... when I edit a published page and then set the Stage Date TV to a time in the future and hit save - my updates are made live straight away... e.g. no staging is actually happening...? Any ideas why this might be? I can drop you an admin user access via DM if you like so you can have a look... seems very odd to me!
Bob - Could the issues with StageCoach be due to the custom hook I am using on the ResourceWatcher plugin?
/** * * * A hook to send approval request. Only triggered upon resource update */
$usergroup='Collab_Editors';
if (! isset($scriptProperties['id'])) {
$modx->log(MODX::LOG_LEVEL_ERROR, 'scriptProperties ID not set');
return;
}
$resource = $modx->getObject('modResource', $scriptProperties['id']);
if (! $resource) {
$modx->log(MODX::LOG_LEVEL_ERROR, 'Could not get Resource. ID: ' . $scriptProperties['id']);
return;
}
$editor = $resource->get('editedby');
if (empty($editor)) {
$editor = $resource->get('createdby');
}
if (! $editor) {
$modx->log(MODX::LOG_LEVEL_ERROR, 'editedby is empty');
return;
}
$user=$modx->getObject('modUser',array('id'=>$editor));
if (!$user) {
$modx->log(MODX::LOG_LEVEL_ERROR, 'user is empty');
return;
}
$checkMembership = $user->isMember($usergroup);
$state = $resource->getTVValue('approvalSwitch');
if ($state=='yes' && $checkMembership==true) {
return true;
}
return false;
[ed. note: dubbs last edited this post 13 years, 3 months ago.]