Changeset 28bab7b
- Timestamp:
- 11/03/21 12:39:35 (3 years ago)
- Branches:
- master
- Children:
- e3af09e
- Parents:
- 3536fe9
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/DepartmentsController.php
r3536fe9 r28bab7b 163 163 164 164 else { 165 Alert::flash("All departments are empty", "warning");165 Alert::flash("All folders are empty", "warning"); 166 166 return redirect()->back(); 167 167 } -
app/Http/Controllers/Dashboard/FoldersController.php
r3536fe9 r28bab7b 119 119 $existingFolder = Folder::where(['department_id' => $request->department, 'name' => $request->name, 'arch_id' => $request->arch_id])->count(); 120 120 121 $existingFolderName = Folder::where(['department_id' => $request->department, 'name' => $request->name])-> count();122 $existingFolderArchId = Folder::where(['department_id' => $request->department, 'arch_id' => $request->arch_id])-> count();121 $existingFolderName = Folder::where(['department_id' => $request->department, 'name' => $request->name])->get(); 122 $existingFolderArchId = Folder::where(['department_id' => $request->department, 'arch_id' => $request->arch_id])->get(); 123 123 124 124 if($existingFolder > 0) { … … 126 126 } 127 127 128 if(($existingFolderName > 0 && $existingFolderArchId <= 0) || ($existingFolderName <= 0 && $existingFolderArchId > 0)) { 128 //dd($existingFolderName, $existingFolderArchId); 129 130 if(($existingFolderName->isNotEmpty() && $existingFolderArchId->isEmpty()) || ($existingFolderName->isEmpty() && $existingFolderArchId->isNotEmpty())) { 129 131 Alert::flash("Can't create another version since folder name or archive ID is different", "error"); 130 132 -
resources/views/dashboard/folders/index.blade.php
r3536fe9 r28bab7b 152 152 <a href="{{ route("dashboard.folders.downloadFolder", ['id' => $folder->id]) }}" class="dropdown-item">Download</a> 153 153 @endif 154 @if(auth()->user()->hasPermission('manage_all_folders')) 155 <a href="javascript:void(0)" data-toggle="modal" data-target="#createVersionModal_{{$folder->id}}" class="dropdown-item">Create version</a> 156 @endif 154 157 @if(auth()->user()->hasPermission('delete_data')) 155 158 <a href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#deleteModal_{{$folder->id}}">Delete</a> … … 205 208 <div class="modal-content"> 206 209 <div class="modal-header"> 207 <h5 class="modal-title" id="exampleModalCenterTitle">Upload </h5>210 <h5 class="modal-title" id="exampleModalCenterTitle">Upload files to {{$folder->name}}</h5> 208 211 <button type="button" class="close" data-dismiss="modal" aria-label="Close"> 209 212 <i class="ti-close"></i> … … 242 245 </div> 243 246 </div> 247 248 <div class="modal fade" id="createVersionModal_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true"> 249 <div class="modal-dialog modal-dialog-centered modal-lg" role="document"> 250 <div class="modal-content"> 251 <div class="modal-header"> 252 <h5 class="modal-title" id="exampleModalCenterTitle">Create folder</h5> 253 <button type="button" class="close" data-dismiss="modal" aria-label="Close"> 254 <i class="ti-close"></i> 255 </button> 256 </div> 257 <div class="modal-body"> 258 <form action="{{ route("dashboard.folders.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data"> 259 @csrf 260 <div class="row"> 261 <div class="col-md-6"> 262 <div class="form-group"> 263 <label for="exampleFormControlSelect1">Department</label> 264 <select class="form-control" name="department" required> 265 <option value="{{ $folder->department->id }}">{{ $folder->department->name }}</option> 266 </select> 267 </div> 268 </div> 269 <div class="col-md-6"> 270 <div class="form-group"> 271 <label>Archive ID</label> 272 <input type="text" name="arch_id" value="{{$folder->arch_id}}" class="form-control" placeholder="Archive ID" required> 273 </div> 274 </div> 275 </div> 276 <div class="row"> 277 <div class="col-md-6"> 278 <div class="form-group"> 279 <label>Name</label> 280 <input type="text" name="name" value="{{ $folder->name }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required> 281 </div> 282 </div> 283 <div class="col-md-6"> 284 <div class="form-group"> 285 <label>Note</label> 286 <textarea class="form-control" name="note" maxlength="80">{{ old('note') }}</textarea> 287 </div> 288 </div> 289 </div> 290 <div class="row"> 291 <div class="col-md-6"> 292 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple> 293 </div> 294 </div> 295 <br/> 296 <div class="modal-footer"> 297 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close 298 </button> 299 <button type="submit" class="btn btn-primary">Save changes</button> 300 </div> 301 </form> 302 </div> 303 304 </div> 305 </div> 306 </div> 307 244 308 @empty 245 309 <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">No items found</div>
Note:
See TracChangeset
for help on using the changeset viewer.