Order-disorder model of phase transitions in the dmagas-dmaals family crystals