Exemple #1
0
                setEventMessage($object->error, 'errors');
                $action = '';
            }
        } else {
            $action = '';
        }
    } else {
        Header("Location: list.php");
    }
}
/*
 * View
 *
 */
$form = new Form($db);
$formresource = new FormResource($db);
if (!$action) {
    $pagetitle = $langs->trans('AddResource');
    llxHeader('', $pagetitle, '');
    print_fiche_titre($pagetitle, '', 'resource.png@resource');
    print '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="add_resource">';
    print '<input type="hidden" name="action" value="confirm_add_resource" />';
    print '<table class="border" width="100%">';
    // Ref / label
    $field = 'ref';
    print '<tr>';
    print '<td>';
    print '<label for="' . $field . '" class="fieldrequired">';
    print $langs->trans('ResourceFormLabel_' . $field);
    print '</td>';
    print '<td>';
Exemple #2
0
 /**
  * Pobranie uprawnień
  *
  * @todo skończyć (pobierać również uprawnienia do filtrów i formularzy)
  * @return Zend_Db_Table_Rowset_Abstract
  */
 public function getResources($types = array())
 {
     $resources = array();
     if (in_array('form', $types) || empty($types)) {
         $formModel = new FormResource();
         $resources['form'] = $formModel->getResources();
     }
     if (in_array('mvc', $types) || empty($types)) {
         $linkModel = new LinkResource();
         $resources['mvc'] = $linkModel->getResources();
     }
     if (in_array('filter', $types) || empty($types)) {
         $filtrModel = new Filter();
         $resources['filter'] = $filtrModel->getResources();
     }
     if (in_array('vresource', $types) || empty($types)) {
         $filtrModel = new VirtualResource();
         $resources['vresource'] = $filtrModel->getResources();
     }
     return $resources;
 }
<?php

//$langs->load($resource_type);
$form = new Form($db);
if (!class_exists('FormResource')) {
    require_once DOL_DOCUMENT_ROOT . '/resource/class/html.formresource.class.php';
}
$formresources = new FormResource($db);
$out .= '<div class="tagtable centpercent border allwidth">';
$out .= '<form class="tagtr ' . ($var == true ? 'pair' : 'impair') . '" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
$out .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
$out .= '<input type="hidden" name="action" value="add_element_resource">';
$out .= '<input type="hidden" name="element" value="' . $element . '">';
$out .= '<input type="hidden" name="element_id" value="' . $element_id . '">';
$out .= '<input type="hidden" name="resource_type" value="' . $resource_type . '">';
// Place
$out .= '<div class="tagtd">' . $langs->trans("SelectResource") . '</div><div>';
$events = array();
$out .= $formresources->select_resource_list('', 'fk_resource', '', 1, 1, 0, $events, '', 2);
$out .= '</div>';
$out .= '<div class="tagtd"><label>' . $langs->trans('Busy') . '</label> ' . $form->selectyesno('busy', $linked_resource['busy'] ? 1 : 0, 1) . '</div>';
$out .= '<div class="tagtd"><label>' . $langs->trans('Mandatory') . '</label> ' . $form->selectyesno('mandatory', $linked_resource['mandatory'] ? 1 : 0, 1) . '</div>';
$out .= '<div class="tagtd">';
$out .= '<input type="submit" id="add-resource-place" class="button" value="' . $langs->trans("Add") . '"';
$out .= ' />';
$out .= '<input type="submit" name="cancel" class="button" value="' . $langs->trans("Cancel") . '" />';
$out .= '</div>';
$out .= '</form>';
$out .= '</div>';
$out .= '<br />';
print $out;
		left: \'prev,next today\',
		center: \'title\',
		right: \'month,agendaWeek,agendaDay\'
	},
	defaultView: \'agendaWeek\',
    eventSources: [

        // your event source
        {
            url: "' . dol_buildpath('/resource/core/ajax/resource_action.json.php', 1) . '",
            type: "POST",
            data: {
                fk_resource: "' . $fk_resource . '"
            },
            error: function() {
                alert("there was an error while fetching events!");
            },
        }


    ]

});
});
</script>';
$formresource = new FormResource($db);
print $formresource->select_resource_list();
print '<div id="calendar"></div>';
// End of page
llxFooter();
$db->close();