|
@@ -32,6 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php';
|
|
|
require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstationusergroup.class.php';
|
|
|
require_once DOL_DOCUMENT_ROOT.'/workstation/lib/workstation_workstation.lib.php';
|
|
|
|
|
|
+global $conf, $db, $hookmanager, $langs, $user;
|
|
|
+
|
|
|
// Load translation files required by the page
|
|
|
$langs->loadLangs(array('mrp', 'other'));
|
|
|
|
|
@@ -78,11 +80,11 @@ if (empty($action) && empty($id) && empty($ref)) {
|
|
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
|
|
|
|
|
// Permissions
|
|
|
-$permissiontoread = $user->rights->workstation->workstation->read;
|
|
|
-$permissiontoadd = $user->rights->workstation->workstation->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
|
|
-$permissiontodelete = $user->rights->workstation->workstation->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
|
|
-$permissionnote = $user->rights->workstation->workstation->write; // Used by the include of actions_setnotes.inc.php
|
|
|
-$permissiondellink = $user->rights->workstation->workstation->write; // Used by the include of actions_dellink.inc.php
|
|
|
+$permissiontoread = $user->hasRight('workstation', 'workstation', 'read');
|
|
|
+$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
|
|
+$permissiontodelete = $user->hasRight('workstation', 'workstation', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DISABLED);
|
|
|
+$permissionnote = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_setnotes.inc.php
|
|
|
+$permissiondellink = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_dellink.inc.php
|
|
|
|
|
|
$upload_dir = $conf->workstation->multidir_output[isset($object->entity) ? $object->entity : 1];
|
|
|
|
|
@@ -161,7 +163,7 @@ llxHeader('', $title, $help_url);
|
|
|
|
|
|
// jquery code
|
|
|
?>
|
|
|
- <script type="text/javascript">
|
|
|
+ <script>
|
|
|
|
|
|
jQuery(document).ready(function() {
|
|
|
jQuery("#type").change(function() {
|