예제 #1
0
 public static function remove_Kbit_from_delivery($Kbit_UID, $Delivery_UID, $link_type, $user)
 {
     if (Lock::is_locked_by_user($Delivery_UID, 'DELIVERY_BASE', $user) == false) {
         debugLog::log("<i>[delivery.php:remove_term_from_Delivery]</i> Delivery (" . $Delivery_UID . ") is not locked by the user (" . $user . ")");
         return null;
     }
     $locking_user = Lock::get_locking_user($UID, 'KBIT_BASE');
     if ($locking_user != null && $locking_user["UID"] != $user) {
         debugLog::log("<i>[delivery.php:add_Kbit_to_delivery]</i> Kbit(" . $Kbit_UID . ") is locked by other user(" . $locking_user["UID"] . ")");
         return null;
     }
     return D2KRelation::remove_D2K_relation($Kbit_UID, $Delivery_UID, $link_type, 'user');
 }
예제 #2
0
 public static function remove_K2K_relation($first_UID, $second_UID)
 {
     // check if Kbits is locked by user
     if (Lock::is_locked_by_user($first_UID, 'KBIT_BASE', $user) == false && Lock::is_locked_by_user($second_UID, 'KBIT_BASE', $user) == false) {
         debugLog::log("<i>[Kbits.php:add_K2K_relation]</i> Non of the Kbits (" . $first_UID . ", " . $second_UID . ") are locked by user (" . $user . ")");
         return null;
     }
     // check soft lock
     $locking_user = Lock::get_locking_user($first_UID, 'KBIT_BASE');
     if ($locking_user != null && $locking_user["UID"] != $user) {
         debugLog::log("<i>[Kbits.php:add_K2K_relation]</i> one of the Kbits (" . $first_UID . ") is locked by other user(" . $locking_user["UID"] . ")");
         return null;
     }
     $locking_user = Lock::get_locking_user($second_UID, 'KBIT_BASE');
     if ($locking_user != null && $locking_user["UID"] != $user) {
         debugLog::log("<i>[Kbits.php:add_K2K_relation]</i> one of the Kbits (" . $first_UID . ") is locked by other user(" . $locking_user["UID"] . ")");
         return null;
     }
     refRelation::remove_relation($first_UID, $second_UID, 'R_LK2K', 'user');
 }