Ejemplo n.º 1
0
    $result = $object->fetch($id, $ref);
    $dir = $conf->immobilier->dir_output . '/photo/' . dol_sanitizeFileName($object->id);
}
/*
 * Actions
 */
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && GETPOST('sendit') && !empty($conf->global->MAIN_UPLOAD_DOC)) {
    if ($object->id) {
        $result = $object->add_photo($dir, $_FILES['userfile']);
    }
}
if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && ($user->rights->produit->creer || $user->rights->service->creer)) {
    $object->delete_photo($dir . "/" . $_GET["file"]);
}
if ($action == 'addthumb' && $_GET["file"]) {
    $object->add_thumb($dir . "/" . $_GET["file"]);
}
/*
 *	View
 */
$form = new Form($db);
if ($object->id) {
    llxHeader("", "", $langs->trans("CardProduct" . $object->type));
    /*
     *  En mode visu
     */
    $local = new Local($db, GETPOST('id'));
    $head = local_prepare_head($local);
    dol_fiche_head($head, 'photo', $langs->trans("photo"), 0, 'propertie');
    /*
     * Confirmation de la suppression de photo