Subversion-Projekte lars-tiefland.webanos.marine-sales.de

Revision

Revision 151 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 151 Revision 161
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
Zeile 3... Zeile 3...
3
namespace App\Http\Requests;
3
    namespace App\Http\Requests;
Zeile 4... Zeile 4...
4
 
4
 
5
use Illuminate\Foundation\Http\FormRequest;
-
 
6
 
-
 
7
class UpdateSupplierRequest extends FormRequest
-
 
8
{
-
 
9
    /**
-
 
10
     * Determine if the user is authorized to make this request.
-
 
11
     *
-
 
12
     * @return bool
5
    use Illuminate\Foundation\Http\FormRequest;
-
 
6
 
13
     */
7
    class UpdateSupplierRequest extends FormRequest
-
 
8
    {
-
 
9
        /**
-
 
10
         * Determine if the user is authorized to make this request.
-
 
11
         *
14
    public function authorize(): bool
12
         * @return bool
-
 
13
         */
-
 
14
        public function authorize(): bool
15
    {
15
        {
-
 
16
            if ( isset( $GLOBALS["user_rechte"]["bestellwesen"]["lieferanten"] ) )
-
 
17
            {
16
        if ( isset( $GLOBALS["user_rechte"]["bestellwesen"]["lieferanten"] ) )
18
                return true;
17
        {
-
 
18
            return true;
-
 
Zeile 19... Zeile 19...
19
        }
19
            }
20
        return false;
20
            return false;
21
    }
21
        }
22
 
22
 
23
    /**
23
        /**
24
     * Get the validation rules that apply to the request.
24
         * Get the validation rules that apply to the request.
25
     *
25
         *
26
     * @return array<string, mixed>
26
         * @return array<string, mixed>
-
 
27
         */
-
 
28
        public function rules(): array
-
 
29
        {
-
 
30
            return [
-
 
31
                //
-
 
32
                "name"             => "required",
-
 
33
                "name2"            => "sometimes",
-
 
34
                "rank"             => "sometimes|integer",
-
 
35
                "contact"          => "sometimes",
-
 
36
                "street"           => "sometimes",
-
 
37
                "houseno"          => "sometimes",
-
 
38
                "zip"              => "sometimes",
-
 
39
                "city"             => "sometimes",
-
 
40
                "phone"            => "sometimes",
-
 
41
                "fax"              => "sometimes",
-
 
42
                "email"            => "sometimes|email",
-
 
43
                "customer_no"      => "sometimes",
-
 
44
                "shipping_hint"    => "sometimes",
-
 
45
                "payment_hint"     => "sometimes",
-
 
46
                "common"           => "sometimes",
-
 
47
                "script"           => "sometimes",
27
     */
48
                "stock_script"     => "sometimes",
-
 
49
                "interval"         => "sometimes",
-
 
50
                "accounts_payable" => "sometimes",
-
 
51
                "ledger_account"   => "sometimes",
-
 
52
            ];
-
 
53
        }
-
 
54
 
-
 
55
        protected function passedValidation(): void
-
 
56
        {
-
 
57
            foreach ( $this as $key => $val )
-
 
58
            {
-
 
59
                if ( is_null( $val ) )
-
 
60
                {
-
 
61
                    if ( $key == "country_id" )
-
 
62
                    {
-
 
63
                        continue;
28
    public function rules(): array
64
                    }
29
    {
65
                    $this->$key = "";
30
        return [
-