Beispiel #1
0
 public function move(Vtiger_Request $request)
 {
     $updatedFieldsList = $request->get('updatedFields');
     //This will update the fields sequence for the updated blocks
     Settings_LayoutEditor_Block_Model::updateFieldSequenceNumber($updatedFieldsList);
     $response = new Vtiger_Response();
     $response->setResult(array('success' => true));
     $response->emit();
 }
Beispiel #2
0
 public function move()
 {
     global $log, $adb;
     $log->debug("Entering YetiForceUpdate::move() method ...");
     $move = [];
     $moveOtherFields = [];
     $assignedTabs = $this->getSmowneridTab();
     $fields = $this->getBlocks();
     foreach ($assignedTabs as $assignedTab) {
         foreach ($fields['showners'] as $showner) {
             if ($assignedTab['tabid'] == $showner['tabid']) {
                 $move[] = ['fieldid' => $showner['fieldid'], 'sequence' => (int) $assignedTab['sequence'] + 1, 'block' => $assignedTab['block']];
             }
         }
         if ($fields['others']) {
             $maxSeq = $this->getNextSequence($assignedTab['tabid'], $assignedTab['block']);
             foreach ($fields['others'] as $field) {
                 if ($assignedTab['tabid'] == $field['tabid']) {
                     $moveOtherFields[] = ['fieldid' => $field['fieldid'], 'sequence' => ++$maxSeq, 'block' => $assignedTab['block']];
                 }
             }
         }
     }
     //This will update the fields sequence for the updated blocks
     if ($move) {
         Settings_LayoutEditor_Block_Model::updateFieldSequenceNumber($move);
     }
     if ($moveOtherFields) {
         Settings_LayoutEditor_Block_Model::updateFieldSequenceNumber($moveOtherFields);
     }
     $this->deleteBlocks($fields['blocks']);
     $log->debug("Exiting YetiForceUpdate::move() method ...");
 }