18 require_once SQ_CORE_PACKAGE_PATH.
'/system/cron/cron_job/cron_job_edit_fns.inc';
42 parent::__construct();
64 foreach ($exclude_permission as $permission) {
65 unset($descs[$permission]);
70 combo_box($prefix.
'_add_future_permissions', Array(
'1' => translate(
'add'),
'0' => translate(
'remove')), FALSE,
'1');
71 echo
' '.translate(
'the_following').
' ';
72 combo_box($prefix.
'_future_permission', $descs, FALSE, $asset->
attr(
'permission'), NULL, $form_extra_elements);
74 echo $asset->
attr(
'add')? translate(
'add') : translate(
'remove');
75 echo $descs[$asset->
attr(
'permission')];
78 echo
' '.translate(
'permission').
'<br /><br /><br />';
82 <table cellspacing=
"0">
86 combo_box($prefix.
'_future_permissions_access[public][granted]', Array(
'' =>
'',
'1' => translate(
'grant'),
'0' => translate(
'deny')), FALSE,
'');
87 echo
' '.translate(
'public_permission');
94 combo_box($prefix.
'_future_permissions_access[user][granted]', Array(
'' =>
'',
'1' => translate(
'grant'),
'0' => translate(
'deny')), FALSE,
'');
95 echo
' '.translate(
'specific_permission');
99 <td><?php multiple_asset_finder($prefix.
'_future_permissions_access[user][userid]', Array(), Array(
'user' =>
'D',
'user_group' =>
'D')); ?></td>
104 echo
'<br /><br />'.translate(
'at').
' ';
105 $this->
_paintWhenBox($asset, $o, $prefix, $when, $form_extra_elements);
108 check_box($prefix.
'_cascade_to_new',
'1', $cascade_to_new);
109 echo translate(
'cascade_permission_to_new_children');
112 check_box($prefix.
'_cascade_permission_changes',
'1', !$dependants_only);
113 echo translate(
'update_permission_to_current_children');
137 if (!empty($_POST[$prefix.
'_future_permission']) && $asset->
setAttrValue(
'permission', $_POST[$prefix.
'_future_permission'])) {
138 $add_permissions = (!isset($_POST[$prefix.
'_add_future_permissions']) || $_POST[$prefix.
'_add_future_permissions']) ? TRUE : FALSE;
144 $permission_access = $_POST[$prefix.
'_future_permissions_access'];
145 $permission_set = FALSE;
146 if (isset($permission_access[
'public'][
'granted']) && ($permission_access[
'public'][
'granted'] !=
'')) {
147 $public_userid = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAssetid(
'public_user');
148 $userids[$public_userid] = (int)$permission_access[
'public'][
'granted'];
149 $permission_set = TRUE;
151 if (isset($permission_access[
'user'][
'granted']) && ($permission_access[
'user'][
'granted'] !=
'')) {
152 foreach ($permission_access[
'user'][
'userid'] as $entry) {
153 if (!empty($entry[
'assetid'])) {
154 $userids[$entry[
'assetid']] = (int)$permission_access[
'user'][
'granted'];
155 $permission_set = TRUE;
159 if (!$permission_set || !$asset->
setAttrValue(
'userids', $userids)) {
163 $cascade_to_new = (isset($_POST[$prefix.
'_cascade_to_new']) && $_POST[$prefix.
'_cascade_to_new']) ? TRUE : FALSE;
164 $dependants_only = (isset($_POST[$prefix.
'_cascade_permission_changes']) && $_POST[$prefix.
'_cascade_permission_changes']) ? FALSE : TRUE;
165 if (!$asset->
setAttrValue(
'cascade_to_new', $cascade_to_new) || !$asset->
setAttrValue(
'dependants_only', $dependants_only)) {
172 trigger_localised_error(
'CRON0058', E_USER_NOTICE);