コード例 #1
0
ファイル: card.php プロジェクト: Albertopf/prueba
}
$result = restrictedArea($user, 'deplacement', $id, '');
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$object = new Deplacement($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('tripsandexpensescard', 'globalcard'));
$permissionnote = $user->rights->deplacement->creer;
// Used by the include of actions_setnotes.inc.php
/*
 * Actions
 */
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';
// Must be include, not includ_once
if ($action == 'validate' && $user->rights->deplacement->creer) {
    $object->fetch($id);
    if ($object->statut == 0) {
        $result = $object->setStatut(1);
        if ($result > 0) {
            header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
            exit;
        } else {
            setEventMessages($object->error, $object->errors, 'errors');
        }
    }
} else {
    if ($action == 'classifyrefunded' && $user->rights->deplacement->creer) {
        $object->fetch($id);
        if ($object->statut == 1) {
            $result = $object->setStatut(2);
            if ($result > 0) {
コード例 #2
0
ファイル: fiche.php プロジェクト: remyyounes/dolibarr
		{
			$mesg=$deplacement->error;
		}
	}
	else
	{
		Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_POST["id"]);
		exit;
	}
}

// Set into a project
if ($_POST['action'] == 'classin')
{
	$trip = new Deplacement($db);
	$trip->fetch($_GET['id']);
	$result=$trip->setProject($_POST['projectid']);
	if ($result < 0) dol_print_error($db,$trip->error);
}



/*
 * View
 */

llxHeader();

$html = new Form($db);

/*
コード例 #3
0
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int');
if ($page == -1) {
    $page = 0;
}
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) {
    $sortorder = "ASC";
}
if (!$sortfield) {
    $sortfield = "name";
}
$object = new Deplacement($db);
$object->fetch($id, $ref);
$upload_dir = $conf->deplacement->dir_output . '/' . dol_sanitizeFileName($object->ref);
$modulepart = 'trip';
/*
 * Actions
 */
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
 * View
 */
$form = new Form($db);
llxHeader("", "", $langs->trans("TripCard"));
if ($object->id) {
    $object->fetch_thirdparty();
    $head = trip_prepare_head($object, $user);
    dol_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip');
コード例 #4
0
 * 	\ingroup    trip
 * 	\brief      Page to show a trip information
 */
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/trip.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/compta/deplacement/class/deplacement.class.php';
$langs->load("trips");
// Security check
$id = GETPOST('id', 'int');
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'deplacement', $id, '');
/*
 * View
 */
llxHeader();
if ($id) {
    $object = new Deplacement($db);
    $object->fetch($id);
    $object->info($id);
    $head = trip_prepare_head($object);
    dol_fiche_head($head, 'info', $langs->trans("TripCard"), 0, 'trip');
    print '<table width="100%"><tr><td>';
    dol_print_object_info($object);
    print '</td></tr></table>';
    print '</div>';
}
$db->close();
llxFooter();
コード例 #5
0
ファイル: note.php プロジェクト: remyyounes/dolibarr

/******************************************************************************/
/* Affichage fiche                                                            */
/******************************************************************************/

llxHeader();

$html = new Form($db);

$id = $_GET['id'];
$ref= $_GET['ref'];
if ($id > 0 || ! empty($ref))
{
	$trip = new Deplacement($db);
	$trip->fetch($id,$ref);

	$soc = new Societe($db, $trip->socid);
    $soc->fetch($trip->socid);

	$h=0;

	$head[$h][0] = DOL_URL_ROOT."/compta/deplacement/fiche.php?id=$trip->id";
	$head[$h][1] = $langs->trans("Card");
	$head[$h][2] = 'card';
	$h++;

	$head[$h][0] = DOL_URL_ROOT."/compta/deplacement/note.php?id=$trip->id";
	$head[$h][1] = $langs->trans("Note");
	$head[$h][2] = 'note';
	$h++;