25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
33 $langs->loadLangs(array(
"mrp",
"companies"));
38 $action =
GETPOST(
'action',
'aZ09');
39 $cancel =
GETPOST(
'cancel',
'aZ09');
40 $backtopage =
GETPOST(
'backtopage',
'alpha');
43 $object =
new Mo($db);
45 $diroutputmassaction = $conf->mrp->dir_output.
'/temp/massgeneration/'.$user->id;
46 $hookmanager->initHooks(array(
'monote',
'globalcard'));
49 $extrafields->fetch_name_optionals_label($object->table_element);
52 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
53 if ($id > 0 || !empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity].
"/".$object->id;
58 $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
59 $result =
restrictedArea($user,
'mrp', $object->id,
'mrp_mo',
'',
'fk_soc',
'rowid', $isdraft);
70 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
77 $form =
new Form($db);
82 llxHeader(
'', $langs->trans(
'Mo'), $help_url);
84 if ($id > 0 || !empty($ref))
86 $object->fetch_thirdparty();
94 $linkback =
'<a href="'.dol_buildpath(
'/mrp/mo_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
96 $morehtmlref =
'<div class="refidno">';
101 $morehtmlref .= $langs->trans(
'ThirdParty').
' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) :
'');
103 if (!empty($conf->projet->enabled))
105 $langs->load(
"projects");
106 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
107 if ($permissiontoadd)
109 if ($action !=
'classify')
110 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
111 if ($action ==
'classify') {
113 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
114 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
115 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
116 $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project,
'projectid', 0, 0, 1, 0, 1, 0, 0,
'', 1);
117 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
118 $morehtmlref .=
'</form>';
120 $morehtmlref .= $form->form_project(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->fk_soc, $object->fk_project,
'none', 0, 0, 0, 1);
123 if (!empty($object->fk_project)) {
125 $proj->fetch($object->fk_project);
126 $morehtmlref .=
' : '.$proj->getNomUrl();
132 $morehtmlref .=
'</div>';
134 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
137 print '<div class="fichecenter">';
138 print '<div class="underbanner clearboth"></div>';
141 $cssclass =
"titlefield";
142 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname= '')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
moPrepareHead($object)
Prepare array of tabs for Mo.
Class to manage projects.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.