Esempio n. 1
0
addField('submit2', 'submit', __('Save entry'));
addField('empty', '', '');
addField('invoice', 'radio', __('Invoice'), __('Choose yes if invoice should be made from this entry.'));
addField('invoice_ref_your', 'text', __('Your reference'), __('The customers internal reference.'));
addField('invoice_comment', 'textarea', 'Fakturakommentar', __('Comment that is displayed in the top of the invoice.'));
addField('invoice_internal_comment', 'textarea', 'Intern fakturakommentar', __('Internal comment on the invoice (not shown to the customer).'));
addField('invoice_electronic', 'radio', __('E-delivery'), __('Choose yes if the customer want to have the invoice delivery by e-mail.'));
// Address
//addField ('invoice_address_id',			'select',				_('Address'),				_('Choose a address from the customer. This will be the address that the invoice will be sent to.'));
//addID ('invoice_address_id', 'invoice_address_id');
addField('invoice_address', 'textarea', __('Address'), __('Choose a address from the customer. This will be the address that the invoice will be sent to. To change the addresses please press the edit button for the customer.'));
addID('invoice_address', 'invoice_address');
disableField('invoice_address');
addAfterField('invoice_address', '<br>' . '<input size="1" type="text" name="invoice_address_id2" disabled="disabled" id="invoice_address_id2">' . '<input type="button" value="Velg/endre adresse" onclick="chooseAddress(\'invoice_address_id\', \'invoice_address\'); return false;">' . '');
addField('invoice_address_id', 'hidden', '');
addID('invoice_address_id', 'invoice_address_id');
addField('invoice_email', 'text', __('E-mail'), __('E-mail that the customer wants the invoice delivery to.'));
addField('invoice_content', 'invoice_content', __('Content'));
addField('empty', '', '');
addField('submit3', 'submit', __('Save entry'));
function addOnchange($var, $value)
{
    global $entry_fields;
    $entry_fields[$var]['onchange'] = $value;
}
function addValue($var, $value)
{
    global $entry_fields;
    $entry_fields[$var]['value'] = $value;
}
function addValueArray($var, $value_array)
Esempio n. 2
0
            echo '<li class="DD_file DD_error"><span class="DD_filename">Upload path problem with ' . $sFileName . ' </span></li>            ';
        } elseif ($sFileError) {
            // file upload error
            echo '<li class="DD_file DD_error"><span class="DD_filename">' . $sFileName . ': ' . $sFileError . ' </span></li>            ';
        } elseif (is_dir($_SESSION['upload_path'] . $auto_dropzone['destination_filepath'])) {
            $file = $sFileName;
            $sFileName = $auto_dropzone['destination_filepath'] . $sFileName;
            if (is_file($_SESSION['upload_path'] . $sFileName)) {
                $newfilename = rename_item($file);
                echo '<li class="DD_file DD_warning"><span class="DD_filename">' . $file . ' => ' . $newfilename . ' </span></li>';
                $sFileName = $auto_dropzone['destination_filepath'] . $newfilename;
            }
            echo $ok;
            rename($_FILES['myfile']['tmp_name'], $_SESSION['upload_path'] . $sFileName);
            chmod($_SESSION['upload_path'] . $sFileName, 0644);
            addID($sFileName);
        }
    } else {
        echo $notok;
    }
    exit;
} else {
    // GENERATE DROPZONE
    if ($auto_dropzone['use_style']) {
        echo '
        <style>
            .DD_dropzone{
                font-family:courier;cursor:pointer;
                text-shadow:0 2px 1px white;
                box-sizing: border-box;
                text-align:center;
Esempio n. 3
0
    }
    save($_SESSION['profiles_rights_file'], $rights);
    header('location:index.php?p=edit_profiles&token=' . TOKEN . '&msg=' . e('Changes saved', false));
    exit;
}
# Editor
if (isset($_POST['editor_content']) && !empty($_POST['editor_filename']) && is_allowed('markdown editor')) {
    $extension = pathinfo($_POST['editor_filename'], PATHINFO_EXTENSION);
    if (empty($extension)) {
        $_POST['editor_filename'] .= '.md';
    }
    $file = no_special_char($_POST['editor_filename']);
    $path = addslash_if_needed($_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $_SESSION['current_path']);
    if (is_file($path . $file) && !isset($_POST['overwrite'])) {
        $file = rename_item($file, $path);
    }
    file_put_contents($path . $file, $_POST['editor_content']);
    if (!isset($_POST['overwrite'])) {
        $id = addID($path . $file);
        $tree = add_branch($path . $file, $id, $_SESSION['login'], $tree);
    }
    header('location:index.php?p=admin&token=' . TOKEN . '&msg=' . $_POST['editor_filename'] . ' ' . e('Changes saved', false));
    exit;
}
# Config change
if (isset($_POST['config']) && is_allowed('config page')) {
}
if ($_FILES && is_allowed('upload')) {
    include 'core/auto_dropzone.php';
    exit;
}
Esempio n. 4
0
        addID($_SESSION['current_path'] . '/' . $folder);
    }
    header('location:admin.php');
    exit;
}
# get file from url
if (!empty($_GET['url']) && $_GET['url'] != '') {
    if ($content = file_curl_contents($_GET['url'])) {
        $basename = basename($_GET['url']);
        $filename = addslash_if_needed($_SESSION['current_path']) . $basename;
        if (is_file($_SESSION['upload_path'] . $filename)) {
            $newfilename = uniqid() . '_' . $basename;
            $filename = addslash_if_needed($_SESSION['current_path']) . $newfilename;
        }
        file_put_contents($_SESSION['upload_path'] . $filename, $content);
        addID($filename);
        header('location:admin.php');
        exit;
    } else {
        $message .= '<div class="error">' . e('Problem accessing remote file.', false) . '</div>';
    }
}
# delete file/folder
if (!empty($_GET['del']) && $_GET['del'] != '') {
    $f = id2file($_GET['del']);
    if (is_file($_SESSION['upload_path'] . $f)) {
        # delete file
        unlink($_SESSION['upload_path'] . $f);
        unlink(get_thumbs_name($f));
        unset($ids[$_GET['del']]);
        store();
Esempio n. 5
0
function new_folder($folder = null)
{
    if (!$folder) {
        return false;
    }
    $thumbs_path = 'thumbs/' . $_SESSION['upload_user_path'] . addslash_if_needed($_SESSION['current_path']);
    $path = $_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . addslash_if_needed($_SESSION['current_path']);
    $complete_path = $path . $folder;
    $complete_thumbs = $thumbs_path . $folder;
    if (is_dir($complete_path) && is_dir($complete_thumbs)) {
        # Folder already exists, rename
        $folder = rename_item($folder, $path);
        $complete_path = $path . $folder;
        $complete_thumbs = $thumbs_path . $folder;
    } else {
        if (!is_dir($complete_path) && is_dir($complete_thumbs)) {
            rrmdir($complete_thumbs);
        }
    }
    mkdir($complete_path, 0744, true);
    mkdir($complete_thumbs, 0744, true);
    return addID($complete_path);
}
Esempio n. 6
0
            echo '<li class="DD_file DD_error"><span class="DD_filename">Upload path problem with ' . $sFileName . ' </span></li>            ';
        } elseif ($sFileError) {
            // file upload error
            echo '<li class="DD_file DD_error"><span class="DD_filename">' . $sFileName . ': ' . $sFileError . ' </span></li>            ';
        } elseif (is_dir($_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $auto_dropzone['destination_filepath'])) {
            $file = $sFileName;
            $sFileName = $auto_dropzone['destination_filepath'] . $sFileName;
            if (is_file($_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $sFileName)) {
                $newfilename = rename_item($file, $_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $auto_dropzone['destination_filepath']);
                echo '<li class="DD_file DD_warning"><span class="DD_filename">' . $file . ' => ' . $newfilename . ' </span></li>';
                $sFileName = $auto_dropzone['destination_filepath'] . $newfilename;
            }
            echo $ok;
            rename($_FILES['myfile']['tmp_name'], $_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $sFileName);
            chmod($_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $sFileName, 0644);
            $id = addID($_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $sFileName);
            $tree = add_branch($_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $sFileName, $id, $_SESSION['login'], $tree);
        }
    } else {
        echo $notok;
    }
    exit;
} else {
    // GENERATE DROPZONE
    if ($auto_dropzone['use_style']) {
        echo '
        <style>
            .DD_dropzone{
                font-family:courier;cursor:pointer;
                text-shadow:0 2px 1px white;
                box-sizing: border-box;