resource_add.tpl.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!-- BEGIN TEMPLATE resource_add.tpl.php -->
  2. <?php
  3. // Protection to avoid direct call of template
  4. if (empty($conf) || !is_object($conf)) {
  5. print "Error, template page can't be called as URL";
  6. exit;
  7. }
  8. require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
  9. $form = new Form($db);
  10. $formresources = new FormResource($db);
  11. $out = '';
  12. $out .= '<div class="centpercent allwidth nohover">';
  13. $out .= '<form class="nohover '.($var == true ? 'pair' : 'impair').'" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
  14. $out .= '<input type="hidden" name="token" value="'.newToken().'">';
  15. $out .= '<input type="hidden" name="action" value="add_element_resource">';
  16. $out .= '<input type="hidden" name="element" value="'.$element.'">';
  17. $out .= '<input type="hidden" name="element_id" value="'.$element_id.'">';
  18. $out .= '<input type="hidden" name="ref" value="'.$element_ref.'">';
  19. $out .= '<input type="hidden" name="resource_type" value="'.(empty($resource_type) ? 'dolresource' : $resource_type).'">';
  20. $out .= '<div class="noborder borderbottom">';
  21. // Place
  22. $out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">'.$langs->trans("SelectResource").'</div>';
  23. $out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
  24. $events = array();
  25. $out .= $formresources->select_resource_list('', 'fk_resource', '', 1, 1, 0, $events, '', 2, null);
  26. $out .= '</div>';
  27. $out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block marginleftonly"><label for="resbusy">'.$langs->trans('Busy').'</label> ';
  28. //$out .= $form->selectyesno('busy', (GETPOSTISSET('busy') ? GETPOST('busy') : 1), 1);
  29. $out .= '<input type="checkbox" id="resbusy" name="busy" value="1"'.(GETPOSTISSET('fk_resource') ? (GETPOST('busy') ? ' checked' : '') : ' checked').'>';
  30. $out .= '</div>';
  31. $out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block marginleftonly"><label for="resmandatory">'.$langs->trans('Mandatory').'</label> ';
  32. //$out .= $form->selectyesno('mandatory', (GETPOSTISSET('mandatory') ? GETPOST('mandatory') : 0), 1);
  33. $out .= '<input type="checkbox" id="resmandatory" name="mandatory" value="1"'.(GETPOSTISSET('fk_resource') ? (GETPOST('mandatory') ? ' checked' : '') : ' checked').'>';
  34. $out .= '</div>';
  35. $out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block right">';
  36. $out .= '<input type="submit" id="add-resource-place" class="button button-add" value="'.$langs->trans("Add").'"/>';
  37. $out .= '</div>';
  38. $out .= '</div>';
  39. $out .= '</form>';
  40. $out .= '</div>';
  41. $out .= '<br>';
  42. print $out;
  43. ?>
  44. <!-- END TEMPLATE resource_add.tpl.php -->